:root {
  --bg: #f4eee6;
  --bg-soft: #fbf7f1;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: #ffffff;
  --text: #1f1918;
  --muted: #6f6662;
  --brand: #761d27;
  --brand-deep: #4f1017;
  --accent: #0d7d79;
  --line: rgba(83, 56, 43, 0.12);
  --success: #11734f;
  --warning: #a96c15;
  --danger: #a43a3a;
  --shadow-lg: 0 24px 64px rgba(49, 28, 20, 0.12);
  --shadow-md: 0 14px 30px rgba(49, 28, 20, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Aptos", "Segoe UI", sans-serif;
  line-height: 1.5;
  background:
    radial-gradient(circle at top left, rgba(13, 125, 121, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(118, 29, 39, 0.11), transparent 24%),
    linear-gradient(180deg, #f8f4ee 0%, #f1ebe3 52%, #ece5dc 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  z-index: -1;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.55;
}

body::before {
  width: 340px;
  height: 340px;
  left: -120px;
  top: -100px;
  background: rgba(118, 29, 39, 0.09);
}

body::after {
  width: 420px;
  height: 420px;
  right: -160px;
  bottom: -140px;
  background: rgba(13, 125, 121, 0.1);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

input::placeholder {
  color: rgba(111, 102, 98, 0.82);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(13, 125, 121, 0.35);
  outline-offset: 2px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 252, 248, 0.7));
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: grid;
  gap: 12px;
}

.sidebar h1,
.topbar h2,
.panel h3,
.hero-copy h3 {
  margin: 0;
  letter-spacing: -0.04em;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.sidebar h1 {
  font-size: clamp(2.2rem, 4vw, 3rem);
  line-height: 0.95;
}

.sidebar-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-md);
}

.sidebar-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 1rem;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.3);
  color: var(--muted);
  padding: 13px 16px;
  border-radius: 16px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.nav-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.7);
}

.nav-link.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  box-shadow: var(--shadow-lg);
}

.main {
  padding: 24px;
}

.topbar {
  position: sticky;
  top: 18px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 20px;
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-xl);
  background: rgba(255, 252, 248, 0.78);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

.topbar h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1;
}

.topbar-copy {
  max-width: 52ch;
  margin-top: 8px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

#global-search {
  min-width: 340px;
}

.btn {
  border: none;
  border-radius: 16px;
  padding: 12px 18px;
  font-weight: 700;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
}

#app {
  display: grid;
  gap: 20px;
  width: 100%;
  max-width: 1400px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.cards,
.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.card,
.panel {
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
}

.card {
  min-height: 154px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-value {
  margin-top: 14px;
  font-size: clamp(2.4rem, 4vw, 3.5rem);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--brand);
}

.card-note {
  max-width: 22ch;
}

.panel {
  padding: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header .muted {
  max-width: 42ch;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.hero-copy h3 {
  font-size: clamp(1.9rem, 3.2vw, 2.8rem);
  max-width: 12ch;
  line-height: 0.98;
}

.hero-copy p {
  max-width: 60ch;
  font-size: 1.02rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(118, 29, 39, 0.14);
  background: rgba(118, 29, 39, 0.08);
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 700;
}

.hero-aside {
  display: grid;
  gap: 12px;
}

.hero-stat {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 244, 0.82));
  box-shadow: var(--shadow-md);
}

.hero-stat strong {
  font-size: 1.08rem;
}

.stack {
  display: grid;
  gap: 12px;
}

.queue-item {
  position: relative;
  padding: 18px 18px 18px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 252, 248, 0.84));
  box-shadow: var(--shadow-md);
}

.queue-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 22px 0 0 22px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
  opacity: 0.85;
}

.queue-item strong {
  display: block;
  font-size: 1rem;
}

.queue-item .muted + .muted {
  margin-top: 6px;
}

.two-cols {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: start;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 20px;
}

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

th,
td {
  padding: 14px 10px;
  border-top: 1px solid rgba(115, 23, 34, 0.08);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody tr {
  transition: background 180ms ease;
}

tbody tr:hover {
  background: rgba(118, 29, 39, 0.03);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.success {
  color: var(--success);
  background: rgba(17, 115, 79, 0.12);
}

.badge.warning {
  color: var(--warning);
  background: rgba(169, 108, 21, 0.12);
}

.badge.danger {
  color: var(--danger);
  background: rgba(164, 58, 58, 0.12);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

.muted {
  color: var(--muted);
}

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

  .sidebar {
    position: relative;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main {
    padding: 16px;
  }

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

  .topbar-actions {
    width: 100%;
    align-items: stretch;
  }

  #global-search {
    min-width: 0;
    width: 100%;
  }

  .topbar-actions > * {
    flex: 1 1 220px;
  }

  .hero,
  .two-cols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .sidebar,
  .topbar,
  .panel,
  .card {
    padding: 18px;
  }

  .card-value {
    font-size: 2.5rem;
  }

  .nav-link {
    padding: 12px 14px;
  }
}
