html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(54, 117, 136, .13), transparent 32rem),
    linear-gradient(180deg, #f7f9fc 0%, #eef3f7 100%);
  color: #182230;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body.login-body {
  margin-bottom: 0;
  background: #0f2638;
}

.app-navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid rgba(198, 210, 222, .75);
  box-shadow: 0 10px 30px rgba(24, 34, 48, .08);
  backdrop-filter: blur(12px);
}

.app-shell {
  max-width: 1480px;
  padding: 0 28px;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: #132f46;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #ffffff;
  border-radius: 8px;
  background: linear-gradient(135deg, #176d7a, #1e3f63);
  box-shadow: 0 8px 18px rgba(23, 109, 122, .26);
}

.brand-mark-lg {
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
}

.navbar .nav-link {
  color: #405466;
  border-radius: 8px;
  font-weight: 600;
  padding: 8px 10px;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus,
.navbar .nav-link.active {
  color: #14384f;
  background: #eef5f7;
}

.navbar .nav-link.active {
  color: #176d7a;
  box-shadow: inset 0 0 0 1px rgba(23, 109, 122, .12);
}

.user-chip {
  color: #176d7a !important;
  background: #eef8fa;
}

.footer {
  background: rgba(255, 255, 255, .7);
}

.dashboard-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 28px 0 20px;
  padding: 34px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(19, 47, 70, .95) 0%, rgba(28, 99, 113, .93) 62%, rgba(59, 116, 83, .92) 100%),
    url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.14'%3E%3Cpath d='M0 40h160M0 80h160M0 120h160M40 0v160M80 0v160M120 0v160'/%3E%3C/g%3E%3C/svg%3E");
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 14px;
  box-shadow: 0 24px 54px rgba(20, 56, 79, .22);
}

.dashboard-hero h1 {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 700;
}

.dashboard-subtitle {
  max-width: 680px;
  margin: 10px 0 0;
  color: #dbe7ef;
}

.dashboard-kicker {
  margin: 0 0 6px;
  color: #8bb8c8;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-hero-actions .btn-outline-secondary {
  color: #ffffff;
  border-color: rgba(255, 255, 255, .72);
}

.dashboard-hero-actions .btn-outline-secondary:hover {
  color: #17324d;
  background: #ffffff;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric-card,
.dashboard-panel {
  background: #ffffff;
  border: 1px solid #e4e9f2;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(24, 34, 48, .07);
}

.metric-card {
  min-height: 146px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .16s ease, box-shadow .16s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(24, 34, 48, .1);
}

.metric-card strong {
  font-size: 2.25rem;
  line-height: 1;
}

.metric-label,
.metric-note,
.panel-muted {
  color: #64748b;
}

.metric-label {
  font-weight: 600;
}

.metric-primary {
  border-color: #b8d8e2;
  background: #edf8fb;
}

.dashboard-panels {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 18px;
}

.dashboard-panel {
  padding: 24px;
}

.table {
  overflow: hidden;
  background: #ffffff;
  border-color: #dce5ee;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(24, 34, 48, .06);
}

.table thead th {
  color: #42576a;
  background: #eef4f7;
  border-bottom: 1px solid #d8e3eb;
  font-size: .86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.table tbody tr {
  transition: background .14s ease;
}

.table tbody tr:hover {
  background: #f7fbfc;
}

.table td,
.table th {
  padding: 13px 14px;
  vertical-align: middle;
}

.btn {
  border-radius: 8px;
  font-weight: 700;
}

.btn-primary {
  background: #176d7a;
  border-color: #176d7a;
}

.btn-primary:hover,
.btn-primary:focus {
  background: #125a65;
  border-color: #125a65;
}

.btn-success {
  background: #3b7453;
  border-color: #3b7453;
}

.btn-danger {
  background: #b42318;
  border-color: #b42318;
}

.btn-info {
  color: #ffffff;
  background: #356f95;
  border-color: #356f95;
}

.form-control,
.form-select {
  min-height: 42px;
  border-color: #cbd7e3;
  border-radius: 8px;
}

.form-control:focus,
.form-select:focus {
  border-color: #176d7a;
  box-shadow: 0 0 0 .2rem rgba(23, 109, 122, .16);
}

label {
  margin-bottom: 6px;
  color: #33475b;
  font-weight: 700;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.35rem;
}

.status-pill {
  white-space: nowrap;
  border-radius: 999px;
  background: #edf8fb;
  color: #25636f;
  font-weight: 700;
  padding: 8px 12px;
}

.alert-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.alert-summary div {
  padding: 18px;
  border-radius: 8px;
  background: #f8fafc;
}

.alert-summary strong,
.cost-value {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
  font-weight: 800;
}

.critical-alert {
  color: #b42318;
  background: #fff1f0 !important;
}

.cost-value {
  color: #1d4f5f;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 16px;
}

.page-heading h2 {
  margin: 0;
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-form {
  max-width: 720px;
  padding: 28px;
  background: #ffffff;
  border: 1px solid #e4e9f2;
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(24, 34, 48, .08);
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr);
  align-items: stretch;
  margin: 0 -28px;
}

.login-showcase {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(15, 38, 56, .94), rgba(24, 92, 101, .9)),
    url("data:image/svg+xml,%3Csvg width='220' height='220' viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.12'%3E%3Ccircle cx='110' cy='110' r='42'/%3E%3Ccircle cx='110' cy='110' r='76'/%3E%3Cpath d='M0 110h220M110 0v220'/%3E%3C/g%3E%3C/svg%3E");
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 56px;
  font-size: 1.05rem;
  font-weight: 800;
}

.login-showcase h1 {
  max-width: 620px;
  font-size: 3rem;
  line-height: 1.08;
  font-weight: 850;
}

.login-showcase p {
  max-width: 560px;
  margin-top: 16px;
  color: #d5e6eb;
  font-size: 1.08rem;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 560px;
  margin-top: 42px;
}

.login-stats div {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
}

.login-stats strong,
.login-stats span {
  display: block;
}

.login-stats strong {
  font-size: 1.25rem;
}

.login-stats span {
  color: #c9dde3;
}

.login-card {
  align-self: center;
  width: min(440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, .9);
  border-radius: 16px;
  box-shadow: 0 28px 70px rgba(4, 15, 24, .28);
}

.login-card h2 {
  margin-bottom: 22px;
  font-weight: 850;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.detail-grid div {
  padding: 16px;
  background: #ffffff;
  border: 1px solid #e4e9f2;
  border-radius: 8px;
}

.detail-grid span {
  display: block;
  color: #64748b;
  margin-bottom: 6px;
}

.access-denied {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
}

.access-denied-card {
  max-width: 560px;
  padding: 36px;
  text-align: center;
  background: #ffffff;
  border: 1px solid #e4e9f2;
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(24, 34, 48, .1);
}

.access-denied-card h1 {
  font-weight: 850;
}

.access-denied-card p:not(.dashboard-kicker) {
  color: #64748b;
}

.permission-box {
  padding: 18px;
  border: 1px solid #dce6ee;
  border-radius: 12px;
  background: #f8fbfc;
}

.permission-box-heading p {
  margin: 0;
  color: #64748b;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.permission-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid #dce6ee;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
}

.permission-item input {
  margin-top: 4px;
}

.permission-item strong,
.permission-item small {
  display: block;
}

.permission-item small {
  color: #64748b;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-actions form {
  margin: 0;
}

@media (max-width: 992px) {
  .dashboard-grid,
  .dashboard-panels,
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .login-page {
    grid-template-columns: 1fr;
    margin: 0 -12px;
    padding: 28px 0;
  }

  .login-showcase {
    display: none;
  }

  .login-card {
    width: min(440px, calc(100% - 32px));
  }
}

@media (max-width: 768px) {
  .dashboard-hero,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-hero-actions {
    justify-content: flex-start;
  }

  .dashboard-grid,
  .dashboard-panels,
  .alert-summary,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-shell {
    padding: 0 14px;
  }

  .dashboard-hero {
    padding: 24px;
  }
}
