:root {
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --surface-green: #f5fbf5;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --nav: #131b2e;
  --nav-muted: #bec6e0;
  --primary: #006948;
  --primary-bright: #00855d;
  --primary-soft: #dff8ec;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --error: #ba1a1a;
  --error-soft: #fee2e2;
  --success: #059669;
  --success-soft: #dcfce7;
  --radius: 8px;
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

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

button {
  cursor: pointer;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 440px) 1fr;
  background:
    radial-gradient(circle at 80% 20%, rgba(104, 219, 169, 0.32), transparent 28%),
    linear-gradient(135deg, #f5fbf5, #eef6f0 45%, #ffffff);
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  background: rgba(255, 255, 255, 0.84);
  border-right: 1px solid var(--border);
}

.login-art {
  padding: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: min(520px, 100%);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}

.login-panel h1,
.page-title h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.login-panel p,
.page-title p {
  color: var(--muted);
  margin: 8px 0 0;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: var(--nav);
  color: white;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.sidebar h1 {
  font-size: 18px;
  margin: 0;
}

.sidebar small {
  color: var(--nav-muted);
}

.nav {
  margin-top: 32px;
  display: grid;
  gap: 4px;
}

.nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  color: var(--nav-muted);
  background: transparent;
  padding: 12px 14px;
  border-left: 4px solid transparent;
  border-radius: 4px;
  text-align: left;
  font-weight: 600;
}

.nav button.active {
  color: #85f8c4;
  background: rgba(255, 255, 255, 0.08);
  border-left-color: #68dba9;
}

.nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.main {
  margin-left: 240px;
  min-height: 100vh;
}

.topbar {
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.search {
  max-width: 440px;
  flex: 1;
  position: relative;
}

.search span {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search input {
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 11px 12px 11px 42px;
  outline: none;
}

.content {
  padding: 32px;
  max-width: 1440px;
}

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

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

.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}

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

.btn.danger {
  color: var(--error);
  border-color: var(--error-soft);
}

.btn.ghost {
  background: transparent;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

.kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.metric {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.metric-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}

.metric label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
}

.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-tools {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.input,
.select,
.textarea {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #fff;
  min-height: 40px;
  padding: 9px 11px;
  outline: none;
  width: 100%;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 105, 72, 0.14);
}

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

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

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

tr:hover td {
  background: #fbfdfb;
}

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

.chip.success {
  background: var(--success-soft);
  color: #047857;
}

.chip.warn {
  background: var(--warning-soft);
  color: #92400e;
}

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

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  z-index: 50;
  display: none;
}

.drawer-backdrop.open {
  display: block;
}

.drawer {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(520px, 100%);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(15, 23, 42, 0.12);
}

.drawer-head,
.drawer-foot {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-foot {
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.drawer-body {
  padding: 20px;
  overflow: auto;
}

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

.field label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 13px 16px;
  background: var(--nav);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 80;
}

.bottom-nav {
  display: none;
}

.mobile-cards {
  display: none;
}

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

  .login-art {
    display: none;
  }

  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
    padding-bottom: 74px;
  }

  .topbar {
    padding: 0 16px;
  }

  .content {
    padding: 20px 16px;
  }

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

  .page-head {
    display: grid;
  }

  .desktop-table {
    display: none;
  }

  .mobile-cards {
    display: grid;
    gap: 12px;
  }

  .mobile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
  }

  .mobile-card strong {
    display: block;
    margin-bottom: 4px;
  }

  .mobile-card span {
    color: var(--muted);
  }

  .bottom-nav {
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #dee4de;
    border-top: 1px solid var(--border-strong);
  }

  .bottom-nav button {
    border: 0;
    background: transparent;
    color: var(--muted);
    display: grid;
    place-items: center;
    gap: 2px;
    font-size: 11px;
  }

  .bottom-nav button.active {
    color: var(--primary);
    font-weight: 800;
  }

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

