:root {
  --bg: #efe6db;
  --panel: rgba(255, 250, 245, 0.9);
  --panel-soft: #f5ede4;
  --border: rgba(114, 90, 66, 0.18);
  --text: #211d19;
  --muted: #6e6256;
  --gold: #c88a2d;
  --green: #4f8d6f;
  --blue: #56789a;
  --red: #b56a5f;
  --lavender: #cdc6d9;
  --peach: #e7c2a2;
  --mint: #d6e5db;
  --butter: #efd6a4;
  --ore: #342c27;
  --ore-soft: #4a4038;
  --copper: #b8742f;
  --sand: #fbf4ed;
  --shadow: 0 28px 70px rgba(65, 45, 23, 0.14);
}

[data-theme="dark"] {
  --bg: #161311;
  --panel: rgba(31, 26, 22, 0.94);
  --panel-soft: #221c18;
  --border: rgba(214, 189, 165, 0.14);
  --text: #f4eadf;
  --muted: #d0bcaa;
  --gold: #f2b552;
  --green: #77ca91;
  --blue: #90b5ff;
  --red: #e28a7e;
  --lavender: #70688c;
  --peach: #8c6545;
  --mint: #294033;
  --butter: #8e6b3a;
  --ore: #0f0d0c;
  --ore-soft: #1a1715;
  --copper: #d08a42;
  --sand: #1a1614;
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(200, 138, 45, 0.12), transparent 22%),
    radial-gradient(circle at top right, rgba(86, 120, 154, 0.12), transparent 24%),
    linear-gradient(180deg, #f9f2ea 0%, var(--bg) 58%, #eadfce 100%);
  color: var(--text);
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(242, 181, 82, 0.1), transparent 22%),
    radial-gradient(circle at top right, rgba(144, 181, 255, 0.1), transparent 24%),
    linear-gradient(180deg, #161311 0%, #120f0d 58%, #0e0c0b 100%);
}

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

.shell {
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-stage {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
  align-items: stretch;
}

.login-card,
.panel,
.sheet,
.kpi,
.list-card,
.mini-card {
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.96), rgba(245, 237, 228, 0.96));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.login-card {
  border-radius: 28px;
  padding: 30px;
}

.login-card-feature {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(52, 44, 39, 0.97), rgba(73, 55, 38, 0.95)),
    linear-gradient(180deg, rgba(255, 251, 246, 0.96), rgba(245, 237, 228, 0.96));
  color: #f8efe3;
  border-color: rgba(200, 138, 45, 0.22);
}

.login-card-feature .brand h1,
.login-card-feature .brand h2 {
  color: #fff4e7;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.login-card-feature .muted,
.login-card-feature .hero-copy .muted {
  color: rgba(255, 241, 225, 0.92);
}

.login-card-feature::after {
  content: "";
  position: absolute;
  inset: auto -60px -60px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 138, 45, 0.26), transparent 70%);
}

.login-card-feature::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 0 44%, rgba(255, 255, 255, 0.03) 44% 46%, transparent 46% 100%),
    linear-gradient(45deg, transparent 0 58%, rgba(255, 255, 255, 0.025) 58% 60%, transparent 60% 100%);
  opacity: 0.9;
  pointer-events: none;
}

.hero-copy {
  max-width: 520px;
  margin-bottom: 18px;
}

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

.hero-chip {
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
  color: #f7ead7;
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.brand-badge {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f5deb2, #c68537);
  color: #3f2a11;
  font-size: 28px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand-badge-logo {
  padding: 0;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.brand-logo {
  width: 100%;
  height: 100%;
  display: block;
}

.login-theme-card {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 252, 248, 0.9);
  margin-bottom: 14px;
}

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

.brand h1,
.brand h2,
.section-title,
.panel h3 {
  margin: 0;
}

.brand h1,
.topbar h2,
.panel h3 {
  font-family: "Fraunces", Georgia, serif;
  letter-spacing: -0.02em;
}

.hero-kicker,
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(239, 214, 164, 0.3);
  border: 1px solid rgba(200, 138, 45, 0.24);
  color: #8c5a17;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.login-card-feature .hero-kicker {
  color: #d38a2b;
  background: rgba(247, 208, 142, 0.14);
  border-color: rgba(228, 170, 80, 0.3);
}

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

.login-card-feature .muted {
  color: rgba(248, 239, 227, 0.8);
}

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

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

.field label {
  color: #6a5644;
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 252, 248, 0.96);
  color: var(--text);
  padding: 13px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #8a7662;
}

input[type="password"] {
  -webkit-text-security: disc;
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.actions,
.toolbar,
.segmented,
.grid,
.list {
  display: grid;
  gap: 12px;
}

.ai-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.ai-result {
  margin: 0;
  white-space: pre-wrap;
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.65;
}

.btn {
  border: 0;
  border-radius: 16px;
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.btn-primary {
  background: linear-gradient(135deg, #d79a4a, #b86b30);
  color: #fff7ef;
  box-shadow: 0 14px 26px rgba(184, 107, 48, 0.24);
}

.btn-secondary {
  background: rgba(255, 252, 247, 0.88);
  color: #2d241d;
  border: 1px solid var(--border);
}

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

.btn-secondary:hover {
  border-color: rgba(184, 116, 47, 0.32);
  box-shadow: 0 14px 30px rgba(84, 60, 38, 0.08);
}

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

.sidebar {
  padding: 24px 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at top, rgba(200, 138, 45, 0.14), transparent 22%),
    linear-gradient(180deg, rgba(37, 31, 27, 0.98), rgba(53, 44, 38, 0.97));
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  height: 100vh;
  color: #f4ebdf;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}

.sidebar-block {
  margin-bottom: 0;
}

.sidebar-nav {
  display: grid;
  gap: 14px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.sidebar-actions {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(37, 31, 27, 0), rgba(37, 31, 27, 0.72));
}

.sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(239, 214, 164, 0.18);
  border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar .brand h2,
.sidebar .brand .muted,
.sidebar .sidebar-block .muted {
  color: rgba(245, 237, 225, 0.8);
}

.sidebar .section-eyebrow {
  background: rgba(200, 138, 45, 0.18);
  border-color: rgba(239, 214, 164, 0.18);
  color: #e7bc71;
}

.content {
  padding: 24px;
  position: relative;
  isolation: isolate;
}

.content::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.42), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 32%);
  z-index: -1;
}

.nav-btn {
  width: 100%;
  text-align: left;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
  background: rgba(255, 255, 255, 0.04);
  color: #f5ede1;
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-btn.active {
  background: linear-gradient(135deg, rgba(245, 222, 178, 0.96), rgba(219, 171, 106, 0.92));
  color: #3b2b1c;
  border-color: rgba(255, 228, 193, 0.65);
  box-shadow: 0 10px 24px rgba(200, 138, 45, 0.22);
}

.nav-btn:hover {
  transform: translateX(3px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px 22px;
  border: 1px solid rgba(114, 90, 66, 0.16);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 248, 241, 0.92), rgba(245, 234, 222, 0.84));
  box-shadow: 0 24px 60px rgba(65, 45, 23, 0.1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: linear-gradient(180deg, rgba(200, 138, 45, 0.95), rgba(86, 120, 154, 0.65));
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto -80px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 138, 45, 0.12), transparent 72%);
}

.topbar h2 {
  margin: 0 0 6px;
  font-size: 34px;
}

.topbar-copy {
  display: grid;
  gap: 10px;
  max-width: 860px;
}

.topbar p {
  margin: 0;
  color: #665849;
}

.topbar-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.stat-chip {
  min-width: 132px;
  border-radius: 18px;
  padding: 10px 12px;
  background: rgba(255, 252, 248, 0.76);
  border: 1px solid rgba(114, 90, 66, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.stat-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7b6958;
  margin-bottom: 4px;
}

.stat-value {
  display: block;
  color: #241d17;
  font-size: 16px;
}

.stat-success {
  background: linear-gradient(180deg, rgba(214, 229, 219, 0.82), rgba(250, 251, 248, 0.9));
}

.stat-info {
  background: linear-gradient(180deg, rgba(228, 235, 243, 0.92), rgba(250, 251, 248, 0.9));
}

.stat-warn {
  background: linear-gradient(180deg, rgba(239, 214, 164, 0.45), rgba(250, 246, 239, 0.94));
}

.stat-danger {
  background: linear-gradient(180deg, rgba(239, 207, 198, 0.72), rgba(250, 245, 242, 0.94));
}

.project-select {
  min-width: 240px;
}

.topbar-side {
  align-self: stretch;
  justify-content: center;
  min-width: 260px;
}

.project-select select {
  background: rgba(255, 253, 249, 0.98);
  color: #2d241d;
  font-weight: 700;
}

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

.secondary-grid {
  margin-top: 14px;
}

.kpi {
  border-radius: 24px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  background:
    linear-gradient(180deg, rgba(255, 251, 246, 0.98), rgba(246, 239, 230, 0.96));
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, rgba(200, 138, 45, 0.92), rgba(86, 120, 154, 0.62));
}

.kpi::after {
  content: "";
  position: absolute;
  inset: auto -20px -30px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 138, 45, 0.08), transparent 70%);
}

.kpi.compact {
  padding: 16px;
}

.kpi-split {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kpi-split strong {
  color: var(--text);
  margin-right: 4px;
}

.kpi-truck .kpi-value {
  margin-bottom: 2px;
}

.kpi-label {
  color: #53463a;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-value {
  font-size: 34px;
  font-weight: 800;
  margin-top: 10px;
  color: #1f1a17;
}

.kpi-value.small {
  font-size: 26px;
}

.kpi-unit {
  color: var(--muted);
  font-size: 14px;
}

.kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(114, 90, 66, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.two-cols {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.dashboard-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 18px;
  align-items: start;
}

.panel {
  border-radius: 22px;
  padding: 20px;
  transition: transform 180ms ease, box-shadow 180ms ease;
  background:
    linear-gradient(180deg, rgba(255, 251, 246, 0.96), rgba(244, 236, 227, 0.96));
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, rgba(200, 138, 45, 0.86), rgba(86, 120, 154, 0.55));
  opacity: 0.85;
}

.panel::after {
  content: "";
  position: absolute;
  inset: auto -70px -90px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 116, 47, 0.08), transparent 74%);
}

.panel-feature {
  margin-top: 18px;
}

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

.module-head {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.module-copy {
  margin: 0;
  max-width: 58ch;
  font-size: 14px;
  line-height: 1.55;
  color: #685746;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.shift-grid,
.card-grid {
  display: grid;
  gap: 12px;
}

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

.list-card,
.mini-card {
  border-radius: 18px;
  padding: 16px;
  border: 1px solid rgba(114, 90, 66, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.96), rgba(247, 239, 231, 0.96));
  position: relative;
  overflow: hidden;
}

.list-card::before,
.mini-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, rgba(200, 138, 45, 0.86), rgba(86, 120, 154, 0.55));
  opacity: 0.7;
}

.kpi:hover,
.panel:hover,
.list-card:hover,
.mini-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 52px rgba(65, 45, 23, 0.16);
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.lead-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.lead-dot.active {
  background: var(--green);
  box-shadow: 0 0 12px rgba(91, 211, 107, 0.5);
}

.lead-dot.inactive {
  background: #b4acb5;
}

.table-list {
  display: grid;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 252, 247, 0.5);
  border: 1px solid rgba(114, 90, 66, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.inline-note {
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 251, 246, 0.86);
  border: 1px dashed rgba(114, 90, 66, 0.2);
  color: #5f5144;
  line-height: 1.5;
}

[data-theme="dark"] .login-card,
[data-theme="dark"] .panel,
[data-theme="dark"] .sheet,
[data-theme="dark"] .kpi,
[data-theme="dark"] .list-card,
[data-theme="dark"] .mini-card,
[data-theme="dark"] .topbar,
[data-theme="dark"] .form-grid,
[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .range-chip,
[data-theme="dark"] .pill,
[data-theme="dark"] .stat-chip,
[data-theme="dark"] .inline-note {
  color: var(--text);
}

[data-theme="dark"] .content::before {
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 32%);
}

[data-theme="dark"] .sidebar {
  background:
    radial-gradient(circle at top, rgba(242, 181, 82, 0.14), transparent 22%),
    linear-gradient(180deg, rgba(17, 15, 14, 0.98), rgba(26, 22, 20, 0.98));
}

[data-theme="dark"] .sidebar-actions {
  border-top-color: rgba(242, 181, 82, 0.12);
  background: linear-gradient(180deg, rgba(17, 15, 14, 0), rgba(17, 15, 14, 0.86));
}

[data-theme="dark"] .sidebar .brand h2,
[data-theme="dark"] .sidebar .brand .muted,
[data-theme="dark"] .sidebar .sidebar-block .muted {
  color: rgba(244, 234, 223, 0.84);
}

[data-theme="dark"] .login-theme-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(214, 189, 165, 0.14);
}

[data-theme="dark"] .login-card:not(.login-card-feature) {
  background:
    linear-gradient(180deg, rgba(27, 23, 20, 0.98), rgba(21, 18, 16, 0.98));
  border-color: rgba(214, 189, 165, 0.14);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .login-card:not(.login-card-feature) .item-title,
[data-theme="dark"] .login-card:not(.login-card-feature) label {
  color: #ead9c8;
}

[data-theme="dark"] .login-card:not(.login-card-feature) .muted {
  color: #d5c2af;
}

[data-theme="dark"] .section-eyebrow {
  color: #efbd73;
  background: rgba(242, 181, 82, 0.16);
  border-color: rgba(242, 181, 82, 0.24);
}

[data-theme="dark"] .nav-btn {
  background: rgba(255, 255, 255, 0.03);
  color: #f4eadf;
  -webkit-text-fill-color: #f4eadf;
  border-color: rgba(255, 255, 255, 0.07);
}

[data-theme="dark"] .nav-btn.active {
  background: linear-gradient(135deg, rgba(245, 199, 123, 0.96), rgba(214, 141, 56, 0.92));
  color: #23180e;
  -webkit-text-fill-color: #23180e;
  border-color: rgba(250, 215, 158, 0.68);
  box-shadow: 0 10px 24px rgba(200, 138, 45, 0.26);
}

[data-theme="dark"] .nav-btn,
[data-theme="dark"] .nav-btn * {
  color: inherit;
}

[data-theme="dark"] .nav-btn:not(.active):hover {
  color: #fff2e3;
}

[data-theme="dark"] .topbar,
[data-theme="dark"] .panel,
[data-theme="dark"] .list-card,
[data-theme="dark"] .mini-card,
[data-theme="dark"] .kpi {
  background:
    linear-gradient(180deg, rgba(31, 26, 22, 0.98), rgba(24, 20, 18, 0.98));
  border-color: rgba(214, 189, 165, 0.12);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .panel h3,
[data-theme="dark"] .brand h1,
[data-theme="dark"] .brand h2,
[data-theme="dark"] .topbar h2,
[data-theme="dark"] .item-title,
[data-theme="dark"] .kpi-value,
[data-theme="dark"] .kpi-split strong,
[data-theme="dark"] .stat-value,
[data-theme="dark"] .auto-label {
  color: var(--text);
}

[data-theme="dark"] .muted,
[data-theme="dark"] .field label,
[data-theme="dark"] .topbar p,
[data-theme="dark"] .module-copy,
[data-theme="dark"] .kpi-label,
[data-theme="dark"] .kpi-split,
[data-theme="dark"] .kpi-unit,
[data-theme="dark"] .bar-date,
[data-theme="dark"] .stat-label,
[data-theme="dark"] .empty {
  color: var(--muted);
}

[data-theme="dark"] .sidebar .muted,
[data-theme="dark"] .table-list .muted,
[data-theme="dark"] .list-card .muted,
[data-theme="dark"] .mini-card .muted,
[data-theme="dark"] .hero-copy .muted,
[data-theme="dark"] .login-card .muted {
  color: #d8c7b6;
}

[data-theme="dark"] .project-select label,
[data-theme="dark"] .serverLabel,
[data-theme="dark"] .metricLabel,
[data-theme="dark"] .filterLabel {
  color: #e1cfbc;
}

[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .range-chip,
[data-theme="dark"] .project-select select,
[data-theme="dark"] .pill,
[data-theme="dark"] .stat-chip,
[data-theme="dark"] .inline-note {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(214, 189, 165, 0.14);
}

[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .project-select select {
  color: #f4eadf;
  -webkit-text-fill-color: #f4eadf;
}

[data-theme="dark"] .field input::placeholder,
[data-theme="dark"] .field textarea::placeholder {
  color: #aa9783;
}

[data-theme="dark"] .field select option,
[data-theme="dark"] .project-select select option {
  background: #221c18;
  color: #f4eadf;
}

[data-theme="dark"] .btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: rgba(214, 189, 165, 0.14);
}

[data-theme="dark"] .login-card:not(.login-card-feature) .btn-primary {
  color: #1d140d;
}

[data-theme="dark"] .btn-secondary:hover {
  color: #fff2e3;
  border-color: rgba(242, 181, 82, 0.28);
}

[data-theme="dark"] .btn-primary {
  color: #25190d;
}

[data-theme="dark"] .empty {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(214, 189, 165, 0.12);
}

[data-theme="dark"] .pill {
  color: #f1e1cf;
}

[data-theme="dark"] .pill-success {
  color: #a9efbd;
}

[data-theme="dark"] .pill-info {
  color: #bad0ff;
}

[data-theme="dark"] .pill-warn {
  color: #ffd48f;
}

[data-theme="dark"] .pill-danger {
  color: #ffb9ae;
}

[data-theme="dark"] .pill-neutral {
  color: #d9c8b8;
}

[data-theme="dark"] .table-list .row.list-card > span:not(.lead-dot):not(.pill) {
  color: var(--text);
}

[data-theme="dark"] .row.list-card .btn-secondary,
[data-theme="dark"] .actions .btn-secondary {
  color: #f4eadf;
}

[data-theme="dark"] .bar-value.mineral {
  color: #ffd68e;
}

[data-theme="dark"] .bar-value.esteril {
  color: #bcd2ff;
}

[data-theme="dark"] .notice {
  background: rgba(98, 74, 31, 0.34);
  color: #f3ddb0;
  border-color: rgba(242, 181, 82, 0.26);
}

[data-theme="dark"] .success {
  background: rgba(52, 91, 61, 0.38);
  color: #bdebc9;
  border-color: rgba(110, 204, 130, 0.28);
}

[data-theme="dark"] .danger {
  background: rgba(94, 45, 45, 0.4);
  color: #ffc1b8;
  border-color: rgba(235, 139, 139, 0.28);
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 240px;
  margin-top: 12px;
}

.bar-col {
  display: grid;
  gap: 8px;
  align-items: end;
}

.bar-stack {
  height: 190px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 6px;
}

.bar-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.bar {
  width: 14px;
  border-radius: 999px 999px 4px 4px;
}

.bar.mineral {
  background: var(--gold);
}

.bar.esteril {
  background: var(--blue);
}

.bar-date {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.bar-value {
  font-size: 11px;
  font-weight: 800;
}

.bar-value.mineral {
  color: #986712;
}

.bar-value.esteril {
  color: #4f79aa;
}

.trend-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 8px;
}

.range-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 16px;
}

.dashboard-filter-panel {
  padding: 20px 24px;
}

.dashboard-filter-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.dashboard-filter-head h3 {
  margin-bottom: 6px;
}

.dashboard-filter-meta {
  margin: 0;
}

.dashboard-range-toolbar {
  margin: 0 0 12px;
  gap: 8px;
}

.dashboard-filter-apply {
  padding: 9px 16px;
  min-width: 110px;
}

.compact-form-grid {
  padding: 12px 14px;
  margin-bottom: 0;
}

.range-chip {
  border: 1px solid var(--border);
  background: rgba(255, 252, 247, 0.92);
  color: #2f241b;
  border-radius: 999px;
  padding: 7px 13px;
  font-weight: 800;
  cursor: pointer;
}

.range-chip.active {
  background: linear-gradient(135deg, #efd6a4, #d79a4a);
  color: #3d2918;
  border-color: rgba(200, 138, 45, 0.32);
}

.trend-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.trend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.trend-swatch.mineral {
  background: var(--gold);
}

.trend-swatch.esteril {
  background: var(--blue);
}

.item-title {
  font-weight: 800;
  color: #261f18;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  color: #4f4033;
  font-size: 12px;
  background: rgba(255, 251, 245, 0.82);
  font-weight: 700;
}

.pill-success {
  background: rgba(214, 229, 219, 0.9);
  color: #2e6148;
  border-color: rgba(79, 141, 111, 0.2);
}

.pill-info {
  background: rgba(228, 235, 243, 0.94);
  color: #35506e;
  border-color: rgba(86, 120, 154, 0.2);
}

.pill-warn {
  background: rgba(239, 214, 164, 0.58);
  color: #7b4f11;
  border-color: rgba(200, 138, 45, 0.24);
}

.pill-danger {
  background: rgba(239, 207, 198, 0.84);
  color: #8a4335;
  border-color: rgba(181, 106, 95, 0.26);
}

.pill-neutral {
  background: rgba(231, 224, 214, 0.84);
  color: #5a4d41;
  border-color: rgba(114, 90, 66, 0.18);
}

.empty {
  padding: 24px;
  text-align: center;
  color: #6e6256;
  border: 1px dashed rgba(114, 90, 66, 0.18);
  border-radius: 18px;
  background: rgba(255, 251, 246, 0.58);
}

.span-2 {
  grid-column: span 2;
}

.notice {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(239, 214, 164, 0.48);
  color: #5d431c;
  border: 1px solid rgba(200, 138, 45, 0.24);
  font-weight: 600;
}

.success {
  background: rgba(215, 236, 217, 0.85);
  color: #2f5642;
  border-color: rgba(118, 179, 157, 0.35);
}

.danger {
  background: rgba(243, 211, 195, 0.75);
  color: #6f3b3b;
  border-color: rgba(217, 137, 137, 0.35);
}

.btn:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.range-chip:focus-visible {
  outline: 2px solid #a96726;
  outline-offset: 2px;
}

.panel h3,
.brand h1,
.brand h2,
.topbar h2 {
  color: #251f1a;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  border-color: rgba(184, 116, 47, 0.45);
  box-shadow: 0 0 0 4px rgba(200, 138, 45, 0.12);
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: rgba(184, 116, 47, 0.28);
}

.list-card,
.mini-card,
.kpi {
  background: linear-gradient(180deg, #fffbf6, #f5ede5);
}

.kpi:nth-child(1) .kpi-icon,
.mini-card .kpi-icon.gold {
  background: rgba(246, 231, 178, 0.85);
}

.kpi:nth-child(2) .kpi-icon {
  background: rgba(215, 211, 240, 0.75);
}

.kpi:nth-child(3) .kpi-icon {
  background: rgba(243, 211, 195, 0.82);
}

.kpi:nth-child(4) .kpi-icon {
  background: rgba(215, 236, 217, 0.9);
}

.row.list-card {
  align-items: flex-start;
}

.row.list-card .pill,
.row.list-card .btn {
  flex-shrink: 0;
}

.table-list .row.list-card > span:not(.lead-dot):not(.pill) {
  color: #3f3328;
  font-weight: 700;
}

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

  .login-stage {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: static;
    height: auto;
  }

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

  .topbar {
    flex-direction: column;
  }

  .topbar-side {
    min-width: 100%;
    width: 100%;
  }

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

  .dashboard-filter-panel {
    padding: 18px;
  }

  .span-2 {
    grid-column: auto;
  }
}
