:root {
  --bg: #eef3f8;
  --bg-soft: #f8fafc;
  --card: #ffffff;
  --card-muted: #f8fafc;
  --text: #111827;
  --heading: #0f172a;
  --muted: #64748b;
  --line: #dbe4ee;
  --line-strong: #bac7d6;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --accent-light: #e6f6f4;
  --blue: #2563eb;
  --amber: #d97706;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #15803d;
  --success-soft: #ecfdf5;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.06);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 28px 16px 44px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(37, 99, 235, 0.05) 44%, rgba(217, 119, 6, 0.06)), var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.container.narrow {
  max-width: 760px;
}

.container.full {
  max-width: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sidebar,
.top-nav {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.sidebar {
  position: sticky;
  top: 18px;
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--heading);
  text-decoration: none;
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}

.sidebar-brand strong {
  font-size: 1rem;
  line-height: 1.15;
}

.sidebar-brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-links {
  display: grid;
  gap: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #536174;
  font-size: 0.94rem;
  font-weight: 800;
  text-decoration: none;
}

.sidebar-link.active {
  border-color: #99d4cf;
  background: var(--accent-light);
  color: var(--accent-dark);
}

.sidebar-logout {
  width: 100%;
  margin-top: auto;
}

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

.top-nav {
  position: sticky;
  top: 18px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 18px;
}

.top-title {
  margin: 0;
  color: var(--heading);
  font-size: 1.35rem;
  line-height: 1.2;
}

.top-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #536174;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.top-link.active {
  border-color: #99d4cf;
  background: var(--accent-light);
  color: var(--accent-dark);
}

.page-title,
.hero-title,
.panel-title {
  margin: 0 0 6px;
  color: var(--heading);
  line-height: 1.15;
  letter-spacing: 0;
}

.page-title {
  font-size: 2.15rem;
}

.hero-title {
  font-size: 2.1rem;
}

.panel-title {
  font-size: 1.35rem;
}

.page-subtitle {
  margin: 0 0 22px;
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-body {
  padding: 28px;
}

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

.full {
  grid-column: 1 / -1;
}

label {
  display: block;
  margin-bottom: 6px;
  color: #334155;
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  background: #ffffff;
  font-size: 0.95rem;
}

input:focus,
select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 118, 110, 0.15);
}

.actions,
.mini-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.actions {
  margin-top: 18px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.primary {
  border: 1px solid var(--accent-dark);
  background: var(--accent);
  color: #ffffff;
}

.secondary {
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: #334155;
}

.danger {
  border: 1px solid #f4b4ad;
  background: var(--danger-soft);
  color: #991b1b;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.message {
  display: none;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-weight: 700;
}

.message.error {
  display: block;
  border: 1px solid #f4b4ad;
  background: var(--danger-soft);
  color: var(--danger);
}

.message.success {
  display: block;
  border: 1px solid #afdcc3;
  background: var(--success-soft);
  color: var(--success);
}

.message.info {
  display: block;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
}

.eyebrow,
.summary-label,
.badge {
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 800;
}

.dash-nav {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--heading);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #536174;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-link.active {
  border-color: #99d4cf;
  background: var(--accent-light);
  color: var(--accent-dark);
}

.summary,
.metric-grid {
  display: grid;
  gap: 14px;
}

.summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.summary-card,
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 20px;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}

.summary-label {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.summary-value {
  margin: 0;
  color: var(--heading);
  font-size: 1.45rem;
  font-weight: 800;
}

.summary-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 6px 10px;
  border: 1px solid #fed7aa;
  background: #fffbeb;
  color: #9a3412;
  font-size: 0.78rem;
  font-weight: 800;
}

form {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-muted);
}

.table-wrap {
  width: 100%;
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.92rem;
  vertical-align: middle;
}

th {
  background: var(--bg-soft);
  color: #475569;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

tr:last-child td {
  border-bottom: 0;
}

.status-pill {
  display: inline-flex;
  min-width: 72px;
  justify-content: center;
  border-radius: 8px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: capitalize;
}

.status-pill.active {
  border-color: #bbf7d0;
  background: var(--success-soft);
  color: var(--success);
}

.status-pill.pending {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #b45309;
}

.empty-state {
  color: var(--muted);
  font-weight: 650;
  text-align: center;
}

@media (max-width: 820px) {
  body {
    padding: 18px 12px 32px;
  }

  .card-body {
    padding: 20px;
  }

  .grid,
  .summary,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .dash-nav,
  .panel-head,
  .actions,
  .mini-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dash-nav {
    position: static;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .top-nav {
    position: static;
  }

  .top-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .sidebar {
    min-height: auto;
  }

  .sidebar-links,
  .top-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-links {
    display: grid;
    justify-content: stretch;
  }

  .nav-links {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
}
