:root {
  --ink: #15110e;
  --muted: #7d756f;
  --line: #ead8c8;
  --paper: #fff8f1;
  --panel: #ffffff;
  --orange: #ff6a00;
  --orange-2: #ff8b2b;
  --amber: #ffd8b4;
  --dark: #100d0b;
  --shadow: 0 20px 55px rgba(69, 33, 0, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at top left, #fff2e5, #f7f4ef 46%, #ece7df); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { border: 0; border-radius: 14px; padding: 13px 18px; background: linear-gradient(135deg, var(--orange), #ff7d19); color: #1a0d03; font-weight: 850; cursor: pointer; box-shadow: 0 12px 26px rgba(255,106,0,.22); }
button.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
button.danger { background: #fff1ec; color: #c13900; border: 1px solid #ffc7ad; box-shadow: none; }
.muted { color: var(--muted); }
.eyebrow { letter-spacing: .14em; text-transform: uppercase; color: var(--orange); font-weight: 900; font-size: 12px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #080604, #24150a 55%, #442005); }
.login-card { width: min(560px, 100%); background: rgba(255, 248, 241, .96); border: 1px solid rgba(255, 174, 99, .35); border-radius: 24px; padding: 40px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login-logo { width: 360px; max-width: 100%; height: auto; display: block; margin-bottom: 24px; background: #050505; border-radius: 16px; padding: 16px; }
.login-card h1 { font-size: clamp(34px, 5vw, 56px); margin: 6px 0 10px; line-height: 1; }
.login-form { display: grid; gap: 16px; margin-top: 28px; }
label { display: grid; gap: 8px; color: #4f453d; font-weight: 800; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; background: #fff; color: var(--ink); outline-color: var(--orange); }
textarea { min-height: 92px; resize: vertical; }
.form-msg { min-height: 20px; color: #c13900; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 290px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 22px; background: #100d0b; border-right: 1px solid rgba(255,255,255,.08); }
.brand-logo { width: 100%; background: #050505; border-radius: 14px; padding: 10px; }
#sectionNav { display: grid; gap: 8px; overflow: auto; }
.nav-btn { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; border-radius: 14px; padding: 12px 13px; color: #fff6ee; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07); box-shadow: none; }
.nav-btn.active { background: linear-gradient(135deg, var(--orange), #ff8b2b); color: #1d0e04; }
.nav-count { font-size: 12px; border-radius: 999px; padding: 3px 8px; background: rgba(255,255,255,.16); }
.workspace { min-width: 0; padding: 28px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 620px); gap: 24px; align-items: end; padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,238,221,.8)); box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(44px, 6vw, 86px); margin: 0; line-height: .95; }
.hero p { font-size: 18px; color: #5f554d; }
.toolbar { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; }
.toolbar input { grid-column: 1 / -1; }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 16px; margin: 24px 0; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.stat-card b { display: block; font-size: 34px; margin-top: 8px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; border-bottom: 1px solid var(--line); }
.panel-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.panel-head h2 { margin: 0; font-size: 26px; }
.table-wrap { overflow: auto; max-height: calc(100vh - 330px); }
table { width: 100%; border-collapse: collapse; min-width: 1500px; }
th, td { padding: 14px 16px; border-bottom: 1px solid #f0ded0; text-align: left; vertical-align: top; }
th { position: sticky; top: 0; background: #fff5ea; color: #6c5544; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; z-index: 1; }
td { color: #312820; max-width: 340px; }
.pill { display: inline-flex; border-radius: 999px; padding: 5px 10px; background: #fff0e3; color: #a94300; font-weight: 850; font-size: 12px; }
.dialog-card { width: min(980px, 94vw); max-height: 88vh; overflow: auto; padding: 0; border-radius: 22px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
dialog { border: 0; background: transparent; }
dialog::backdrop { background: rgba(18, 10, 3, .55); backdrop-filter: blur(4px); }
.dialog-card header, .dialog-card footer { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dialog-card footer { border-top: 1px solid var(--line); border-bottom: 0; position: sticky; bottom: 0; background: #fff; }
.icon-btn { background: #fff; border: 1px solid var(--line); box-shadow: none; font-size: 28px; padding: 4px 12px; margin-left: auto; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 22px; }
.field-grid .wide { grid-column: 1 / -1; }
.spacer { flex: 1; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .hero { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid { grid-template-columns: 1fr; }
}
