:root {
  --bg: #f4f7f9;
  --panel: #ffffff;
  --ink: #182230;
  --muted: #667085;
  --line: #d8e1e8;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --blue: #2563eb;
  --green: #16a34a;
  --amber: #b7791f;
  --red: #dc2626;
  --purple: #7c3aed;
  --rose: #e11d48;
  --slate: #475569;
  --cyan: #0891b2;
}

html {
  font-size: 14px;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  margin: 0;
}

a {
  color: var(--primary-dark);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 .18rem rgba(15, 118, 110, .18);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  background: #102a2a;
  color: #e7f5f2;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  align-items: center;
  color: #fff;
  display: flex;
  gap: .75rem;
  text-decoration: none;
}

.brand span {
  align-items: center;
  background: #2dd4bf;
  border-radius: 8px;
  color: #063b38;
  display: inline-flex;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.brand strong {
  font-size: 1.05rem;
}

.side-nav {
  display: grid;
  gap: .25rem;
  overflow: auto;
  padding-bottom: 1rem;
}

.side-nav small {
  color: #9ed9d1;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08rem;
  margin: 1rem 0 .25rem;
  text-transform: uppercase;
}

.side-nav a {
  border-radius: 8px;
  color: #d9fffb;
  padding: .62rem .75rem;
  text-decoration: none;
}

.side-nav a:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.app-workspace {
  min-width: 0;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 70px;
  padding: .85rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-label {
  color: var(--muted);
  display: block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06rem;
  text-transform: uppercase;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: .75rem;
}

.topbar-actions a,
.topbar-actions button {
  background: #eef7f6;
  border: 1px solid #cfe8e5;
  border-radius: 8px;
  color: var(--primary-dark);
  font-weight: 700;
  padding: .45rem .7rem;
  text-decoration: none;
}

.topbar-actions button {
  cursor: pointer;
}

.topbar-actions form {
  margin: 0;
}

.user-chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
  padding: .42rem .75rem;
}

.app-main {
  padding: 1.5rem;
}

.dashboard-hero {
  align-items: center;
  background: linear-gradient(135deg, #0f766e 0%, #155e75 100%);
  border-radius: 8px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  min-height: 210px;
  padding: 2rem;
}

.dashboard-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 .5rem;
}

.dashboard-hero p {
  color: #daf7f2;
  margin: 0;
  max-width: 760px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.page-heading {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.page-heading h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
}

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

.page-subtitle {
  color: var(--muted);
  margin: .25rem 0 0;
  max-width: 760px;
}

.eyebrow {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08rem;
  margin-bottom: .25rem;
  text-transform: uppercase;
}

.dashboard-hero .eyebrow {
  color: #b7fff5;
}

.metric-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 1.25rem;
}

.metric-card,
.content-panel,
.module-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}

.metric-card {
  padding: 1rem;
}

.metric-card span {
  color: var(--muted);
  display: block;
  font-size: .9rem;
}

.metric-card strong {
  color: var(--primary-dark);
  display: block;
  font-size: 2rem;
  line-height: 1.1;
  margin-top: .35rem;
}

.dashboard-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .75fr);
}

.content-panel {
  margin-bottom: 1.25rem;
  padding: 1.25rem;
}

.section-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: .75rem;
}

.section-title h2,
.module-section h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
}

.data-table {
  margin: 0;
}

.data-table thead th {
  background: #f8fafc;
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .04rem;
  text-transform: uppercase;
}

.data-table td small {
  color: var(--muted);
  display: block;
  margin-top: .12rem;
}

.status-pill {
  background: #e6f4ea;
  border-radius: 999px;
  color: #146c43;
  display: inline-block;
  font-size: .82rem;
  font-weight: 700;
  padding: .24rem .65rem;
}

.quick-actions {
  display: grid;
  gap: .65rem;
}

.quick-actions a {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  font-weight: 700;
  justify-content: space-between;
  padding: .75rem;
  text-decoration: none;
}

.quick-actions a:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.module-section {
  margin-bottom: 1.5rem;
}

.module-section h2 {
  margin-bottom: .75rem;
}

.module-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.module-card {
  border-top: 4px solid var(--primary);
  color: var(--ink);
  display: grid;
  min-height: 150px;
  padding: 1rem;
  text-decoration: none;
}

.module-card span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06rem;
  text-transform: uppercase;
}

.module-card strong {
  font-size: 1.1rem;
}

.module-card small {
  color: var(--muted);
}

.module-card em {
  color: var(--primary-dark);
  font-style: normal;
  font-weight: 800;
  margin-top: .5rem;
}

.module-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.module-card-blue { border-top-color: var(--blue); }
.module-card-green { border-top-color: var(--green); }
.module-card-amber { border-top-color: var(--amber); }
.module-card-red { border-top-color: var(--red); }
.module-card-purple { border-top-color: var(--purple); }
.module-card-rose { border-top-color: var(--rose); }
.module-card-slate { border-top-color: var(--slate); }
.module-card-cyan { border-top-color: var(--cyan); }
.module-card-indigo { border-top-color: #4f46e5; }

.form-panel {
  max-width: 1050px;
}

.form-actions {
  display: flex;
  gap: .5rem;
  margin-top: 1rem;
}

.empty-state-block {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px dashed #b6c7d4;
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  gap: .25rem;
  padding: 1rem;
}

.empty-state-block strong {
  color: var(--ink);
}

.app-alert {
  border-radius: 8px;
}

.auth-body {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .88), rgba(21, 94, 117, .88)),
    #0f766e;
  min-height: 100vh;
}

.auth-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 1.25rem;
}

.auth-card {
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 8px;
  box-shadow: 0 30px 70px rgba(15, 23, 42, .25);
  max-width: 440px;
  padding: 1.5rem;
  width: 100%;
}

.auth-heading {
  margin-bottom: 1.25rem;
  text-align: center;
}

.auth-heading span {
  align-items: center;
  background: #ccfbf1;
  border-radius: 8px;
  color: #134e4a;
  display: inline-flex;
  font-weight: 900;
  height: 48px;
  justify-content: center;
  margin-bottom: .85rem;
  width: 48px;
}

.auth-heading h1 {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
}

.auth-heading p,
.auth-help span {
  color: var(--muted);
  margin: .25rem 0 0;
}

.auth-help {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: .12rem;
  margin-top: 1rem;
  padding: .75rem;
}

.auth-help strong {
  color: var(--ink);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    height: auto;
    position: static;
  }

  .side-nav {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .side-nav small {
    grid-column: 1 / -1;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar,
  .dashboard-hero,
  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .app-main {
    padding: 1rem;
  }

  .dashboard-hero {
    padding: 1.25rem;
  }

  .dashboard-hero h1 {
    font-size: 2rem;
  }

  .hero-actions .btn,
  .page-heading .btn {
    width: 100%;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
