:root {
  --bg: #120f06;
  --panel: rgba(255, 224, 102, 0.15);
  --panel-2: rgba(255, 224, 102, 0.08);
  --text: #fff6d8;
  --muted: #e8ddb4;
  --accent: #ff3b30;
  --ok: #38d996;
  --border: rgba(255, 80, 80, 0.45);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #2c1f02, var(--bg));
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  background: rgba(12, 8, 3, .84);
  backdrop-filter: blur(8px);
}
.topbar h1 { margin: 0; font-size: 1.1rem; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.status-pill {
  border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 10px; background: var(--panel); font-size: .78rem;
}
.status-pill.ok { border-color: rgba(56,217,150,.5); color: #b6ffe0; }

.tabs {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.1);
  background: rgba(14, 10, 4, .75);
}
.tab {
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  border-radius: 999px; padding: 8px 12px; font-weight: 700; white-space: nowrap;
}
.tab.active { background: var(--accent); border-color: transparent; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 12px; }
.tab-page { display: none; }
.tab-page.active { display: block; }

.grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 12px; }
.kpi, .card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(6px);
}
.kpi { padding: 12px; }
.kpi small { display: block; color: var(--muted); }
.kpi strong { font-size: 1.2rem; }
.card { padding: 12px; margin-bottom: 12px; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
h2, h3, h4 { margin: 0 0 10px; }
.sub { color: var(--muted); }

input, select, textarea, button, a {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: 10px;
  margin-bottom: 8px;
}
textarea { min-height: 80px; }
button { cursor: pointer; background: var(--accent); border: none; font-weight: 700; }
button.danger { background: #721515; border: 1px solid #a73333; }
button.small { width: auto; margin-top: 8px; padding: 6px 9px; font-size: .8rem; }

.inline-form { display: grid; gap: 8px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.12); }
th { color: var(--text); background: #2a200a; position: sticky; top: 0; }
td { color: var(--muted); vertical-align: top; }
.actions button { width: auto; margin: 0 4px 4px 0; padding: 6px 8px; font-size: .78rem; }

.note {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel-2); padding: 10px; margin-bottom: 8px;
}
.note h4 { margin: 0 0 6px; }
.note p { margin: 0 0 6px; color: var(--muted); }

.kanban {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 10px 0 14px;
}
.lane {
  border: 1px solid var(--border); border-radius: 12px; padding: 8px; background: rgba(255,255,255,.03);
}
.lane h4 { margin: 0 0 8px; text-transform: capitalize; display: flex; justify-content: space-between; }
.lane-card {
  border: 1px solid rgba(255,255,255,.16); border-radius: 9px; padding: 8px; margin-bottom: 7px; background: rgba(255,255,255,.03);
  display: block;
}
.lane-card small { display: block; color: var(--muted); margin-top: 4px; }

.risk { padding: 3px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; color: #fff; }
.risk.low { background: #3c7c46; }
.risk.medium { background: #b17316; }
.risk.high { background: #b83b19; }
.risk.critical { background: #8b102a; }

.charts-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.chart-card { border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: var(--panel-2); }
.chart-card canvas { width: 100% !important; height: 250px !important; }

.export-actions { display: grid; gap: 8px; }
.export-actions a {
  display: inline-block; text-decoration: none;
  border: 1px solid var(--border); background: var(--panel-2);
}

@media (min-width: 880px) {
  .grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .inline-form { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .kanban { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .charts-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
