:root {
  --bg: #f3efe6;
  --paper: #fffdf8;
  --ink: #1a1c1f;
  --muted: #6b655b;
  --line: #e4dccb;
  --accent: #c45c26;
  --accent-2: #1f6f5b;
  --warn: #b42318;
  --sidebar: #16181b;
  --ok: #1f6f5b;
  --shadow: 0 10px 30px rgba(26, 28, 31, .08);
  font-family: Manrope, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { display: flex; min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.login-body {
  display: grid; place-items: center; min-height: 100vh;
  background: radial-gradient(1200px 500px at 20% 0%, #2a211c, #16181b);
  color: #f4efe6;
}
.login-card {
  width: min(420px, 92vw); background: #1e2126; padding: 32px;
  border-radius: 18px; border: 1px solid #2c3138;
}
.login-card h1 { font-family: Unbounded, sans-serif; font-size: 26px; margin: 4px 0 8px; }
.login-card label { display: block; margin: 14px 0 6px; font-size: 13px; color: #cbbfad; }
.login-card input {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid #3a4048;
  background: #121416; color: #fff;
}
.form-error { color: #ff8a7a; font-size: 14px; }
.sidebar {
  width: 228px; background: var(--sidebar); color: #efe8dc;
  display: flex; flex-direction: column; padding: 18px 14px; flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin: 0 6px 22px; }
.brand img { height: 22px; width: auto; filter: brightness(0) invert(1); }
.brand span { font-family: Unbounded, sans-serif; font-size: 12px; letter-spacing: .04em; }
#nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
#nav a {
  color: #c9c2b5; text-decoration: none; padding: 9px 12px; border-radius: 10px; font-weight: 600; font-size: 14px;
}
#nav a.active, #nav a:hover { background: #262a30; color: #fff; }
.sidebar-user { padding: 12px; border-top: 1px solid #2a2e34; font-size: 13px; color: #b7b0a4; }
.sidebar-user strong { display: block; color: #fff; margin-bottom: 6px; }
.link { background: none; border: 0; color: #e8b48a; cursor: pointer; padding: 0; }
.main { flex: 1; padding: 24px 28px 48px; overflow: auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-family: Unbounded, sans-serif; font-size: 26px; margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: var(--muted); margin: 0 0 6px; }
.muted { color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 700; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-danger { background: #f8e4e0; color: var(--warn); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow);
}
.kpi .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.kpi .value { font-family: Unbounded, sans-serif; font-size: 22px; margin-top: 8px; }
.kpi.warn .value { color: var(--warn); }
.kpi.ok .value { color: var(--ok); }
.grid-2 { display: grid; grid-template-columns: 1.4fr .9fr; gap: 14px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.card h2 { margin: 0 0 12px; font-size: 16px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tr:hover td { background: #faf6ee; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select, .field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff;
}
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.badge { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-active { background: #e3f4ee; color: #145c4b; }
.badge-paused { background: #f4ead3; color: #8a5a12; }
.badge-archived { background: #eee; color: #555; }
.badge-planned { background: #e8eef8; color: #314e86; }
.badge-done { background: #e3f4ee; color: #145c4b; }
.badge-cancelled { background: #eee; color: #666; }
.badge-draft { background: #eee; color: #555; }
.badge-issued { background: #f4ead3; color: #8a5a12; }
.badge-partial { background: #f8e4e0; color: #9a3412; }
.badge-paid { background: #e3f4ee; color: #145c4b; }
.badge-warn { background: #f8e4e0; color: var(--warn); }
.dossier { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; align-items: start; }
.dossier-head {
  grid-column: 1 / -1; background: #1a1c1f; color: #f4efe6; border-radius: 18px; padding: 20px 22px;
  display: grid; grid-template-columns: 1fr auto; gap: 12px;
}
.dossier-head h1 { font-family: Unbounded, sans-serif; font-size: 28px; margin: 0 0 6px; }
.dossier-meta { color: #c9c2b5; font-size: 14px; }
.dossier-stats { display: flex; gap: 18px; text-align: right; }
.dossier-stats b { display: block; font-size: 20px; font-family: Unbounded, sans-serif; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.note {
  border-left: 4px solid #cbbfad; background: #faf6ee; padding: 10px 12px; border-radius: 0 12px 12px 0; margin-bottom: 8px;
}
.note.warn { border-color: var(--warn); background: #fdf2f0; }
.note.process { border-color: var(--accent-2); background: #eef7f3; }
.note h3 { margin: 0 0 4px; font-size: 13px; }
.note p { margin: 0; font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.modal-back {
  position: fixed; inset: 0; background: rgba(22, 24, 27, .45); display: grid; place-items: center; z-index: 20; padding: 20px;
}
.modal { width: min(720px, 100%); background: var(--paper); border-radius: 16px; padding: 22px; max-height: 90vh; overflow: auto; }
.modal h2 { margin: 0 0 14px; font-family: Unbounded, sans-serif; font-size: 20px; }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 72px; }
.spark span { flex: 1; background: #c45c26; border-radius: 4px 4px 0 0; min-height: 3px; opacity: .85; }
.hint { padding: 10px 12px; border: 1px dashed #d8b48a; border-radius: 12px; margin-bottom: 8px; background: #fffaf3; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.toast {
  position: fixed; right: 20px; bottom: 20px; background: #1a1c1f; color: #fff;
  padding: 12px 16px; border-radius: 12px; z-index: 40; max-width: 360px;
}
.check { width: 16px; }
@media (max-width: 980px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; gap: 12px; }
  #nav { flex-direction: row; overflow: auto; }
  .kpis, .grid-2, .dossier, .form-grid { grid-template-columns: 1fr; }
  .dossier-head { grid-template-columns: 1fr; }
  .dossier-stats { text-align: left; }
}
