﻿:root {
  --gold: #e7b536;
  --gold-dark: #b98716;
  --ink: #232426;
  --paper: #f8f6f0;
  --white: #ffffff;
  --line: #e6dfce;
  --muted: #736f66;
  --danger: #a33c2f;
  --success: #236b4b;
  --shadow: 0 18px 45px rgba(35, 36, 38, 0.12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, system-ui, sans-serif;
  display: grid;
  grid-template-columns: 280px 1fr;
}
.sidebar { background: var(--ink); color: var(--white); padding: 24px; min-height: 100vh; position: sticky; top: 0; }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.brand img { width: 64px; height: 64px; object-fit: contain; background: var(--white); border-radius: 8px; padding: 6px; }
.brand strong { display: block; font-family: "Playfair Display", serif; font-size: 1.2rem; }
.brand span { display: block; color: #d7d0c0; font-size: .85rem; }
nav { display: grid; gap: 8px; }
.nav-button, .ghost-button, .primary-button {
  border: 0; border-radius: 8px; font: inherit; cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.nav-button { width: 100%; text-align: left; padding: 13px 14px; color: #f5f1e8; background: transparent; }
.nav-button:hover, .nav-button.active { background: rgba(231, 181, 54, .18); color: var(--gold); }
.app-shell { padding: 28px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.eyebrow { color: var(--gold-dark); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 6px; font-size: .75rem; }
h1, h2 { margin: 0; font-family: "Playfair Display", serif; }
h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
h2 { font-size: 1.45rem; }
.view { display: none; }
.active-view { display: block; }
.metrics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.metric, .form-grid, .table-wrap, .alert-list { background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.metric { padding: 22px; }
.metric span { color: var(--muted); font-weight: 700; }
.metric strong { display: block; font-size: 2.35rem; margin-top: 8px; }
.metric.warning strong { color: var(--danger); }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 18px 0 14px; }
.section-header span { color: var(--muted); }
.form-grid { padding: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.form-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; font-size: .86rem; }
.wide { grid-column: 1 / -1; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 12px;
  font: inherit; color: var(--ink); background: #fffdf8;
}
textarea { resize: vertical; }
.primary-button { background: var(--gold); color: var(--ink); font-weight: 800; padding: 13px 18px; align-self: end; }
.ghost-button { background: var(--white); color: var(--ink); border: 1px solid var(--line); padding: 12px 16px; font-weight: 800; }
.primary-button:hover, .ghost-button:hover { transform: translateY(-1px); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.badge { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.badge.in { background: rgba(35, 107, 75, .12); color: var(--success); }
.badge.out { background: rgba(163, 60, 47, .12); color: var(--danger); }
.badge.low { background: rgba(231, 181, 54, .22); color: var(--gold-dark); }
.alert-list { padding: 6px; display: grid; gap: 8px; }
.alert-item { display: flex; justify-content: space-between; gap: 12px; padding: 14px; border-radius: 8px; background: #fffaf0; border: 1px solid #f1dfad; }
.alert-item strong { display: block; }
.alert-item span { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--ink); color: var(--white); padding: 14px 16px; border-radius: 8px; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: .2s; max-width: 360px; }
.toast.show { opacity: 1; transform: translateY(0); }
a { color: var(--gold-dark); font-weight: 800; }
@media (max-width: 920px) {
  body { display: block; }
  .sidebar { min-height: auto; position: relative; padding: 16px; }
  nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell { padding: 18px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .metrics-grid, .form-grid, .form-grid.compact { grid-template-columns: 1fr; }
  .section-header { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 520px) {
  nav { grid-template-columns: 1fr; }
  .brand img { width: 54px; height: 54px; }
  h1 { font-size: 2rem; }
  .alert-item { flex-direction: column; }
}
