:root {
  --bg: #f4efe6;
  --paper: rgba(255, 252, 245, 0.9);
  --paper-strong: #fffaf0;
  --line: rgba(67, 59, 45, 0.14);
  --text: #2f2a24;
  --muted: #70675b;
  --accent: #0d5b5a;
  --accent-soft: #d9eceb;
  --danger: #a53d2d;
  --danger-soft: #f6ddd8;
  --shadow: 0 18px 40px rgba(68, 52, 35, 0.08);
  --radius: 20px;
  --radius-sm: 12px;
  --font: "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(13, 91, 90, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(189, 123, 71, 0.12), transparent 24%),
    linear-gradient(180deg, #fbf7f1 0%, var(--bg) 100%);
}

a {
  color: inherit;
}

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

.sidebar {
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 248, 236, 0.72);
  backdrop-filter: blur(10px);
}

.brand-kicker,
.eyebrow,
.detail-label,
.panel-subtitle,
.header-meta,
.muted,
.inline-note {
  color: var(--muted);
}

.brand h1,
.page-header h2,
.panel h3 {
  margin: 0;
}

.brand h1 {
  margin-top: 8px;
  font-size: 1.45rem;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.nav-link {
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  transition: background-color 160ms ease, transform 160ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--paper-strong);
  transform: translateX(2px);
}

.nav-link.is-active {
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(13, 91, 90, 0.16);
}

.main {
  padding: 28px;
}

.page-header,
.panel-header,
.row-actions,
.pagination,
.pagination-actions,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-header {
  margin-bottom: 22px;
}

.flash,
.panel,
.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.flash {
  padding: 14px 16px;
  margin-bottom: 18px;
}

.flash-notice {
  background: var(--accent-soft);
}

.flash-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.panel {
  padding: 20px;
  margin-bottom: 22px;
}

.panel-muted {
  border-style: dashed;
}

.table-shell {
  overflow-x: auto;
  margin-top: 16px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.data-table th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(13, 91, 90, 0.1);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.button-secondary,
.button-ghost,
.pagination-link {
  background: var(--paper-strong);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.button-ghost {
  background: transparent;
}

.pagination {
  margin-top: 18px;
}

.pagination-actions {
  gap: 10px;
}

.pagination-link {
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
}

.pagination-link.is-disabled {
  opacity: 0.45;
}

.empty-state {
  padding: 18px;
  margin-top: 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.54);
  color: var(--muted);
}

.stack-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.stack-form label {
  display: grid;
  gap: 8px;
}

.stack-form input,
.stack-form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  font: inherit;
}

.detail-grid,
.stat-grid {
  display: grid;
  gap: 16px;
}

.detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: 18px;
}

.detail-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.84rem;
}

.stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card {
  padding: 18px;
}

.stat-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-value {
  margin-top: 10px;
  font-size: 1.8rem;
  font-weight: 700;
}

.row-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.inline-note {
  margin-top: 6px;
  font-size: 0.85rem;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main {
    padding: 18px;
  }

  .page-header,
  .panel-header,
  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }
}

.shell-auth {
  grid-template-columns: minmax(0, 1fr);
}

.main-auth {
  display: grid;
  align-content: center;
  min-height: 100vh;
  max-width: 720px;
  margin: 0 auto;
}

.auth-panel {
  margin-top: 12px;
}
