:root {
  --bg: #08111f;
  --panel: #0f1b2e;
  --panel-2: #14243a;
  --text: #eef5ff;
  --muted: #95a7c0;
  --line: rgba(255,255,255,.10);
  --accent: #7dd3fc;
  --accent-2: #a78bfa;
  --danger: #fb7185;
  --ok: #86efac;
  --shadow: 0 18px 60px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Arial, sans-serif; background: radial-gradient(circle at top left, #15284a 0, var(--bg) 38%, #050913 100%); color: var(--text); min-height: 100vh; }
a { color: inherit; }
.auth-body { display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03)); border: 1px solid var(--line); border-radius: 28px; padding: 32px; box-shadow: var(--shadow); }
.brand-mark { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06101f; font-weight: 900; letter-spacing: -1px; }
h1, h2, h3 { margin: 0 0 8px; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }
.tiny { color: var(--muted); font-size: 12px; line-height: 1.5; }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: #dbeafe; font-size: 14px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: rgba(5, 12, 24, .72); color: var(--text); border-radius: 14px; padding: 12px 13px; outline: none; }
textarea { min-height: 78px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(125,211,252,.75); box-shadow: 0 0 0 3px rgba(125,211,252,.12); }
button, .link { border: 0; border-radius: 14px; padding: 12px 15px; cursor: pointer; font-weight: 800; text-decoration: none; }
button.primary, .primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06101f; }
button.ghost, .ghost { border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text); }
button.danger { background: rgba(251,113,133,.16); color: #fecdd3; border: 1px solid rgba(251,113,133,.32); }
.message { min-height: 18px; color: var(--accent); font-size: 13px; }
.app-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--line); background: rgba(8,17,31,.78); backdrop-filter: blur(14px); padding: 22px; display: grid; grid-template-rows: auto 1fr auto; gap: 24px; position: sticky; top: 0; height: 100vh; }
.brand-block { display: flex; gap: 12px; align-items: center; }
.brand-block span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.sidebar nav { display: grid; align-content: start; gap: 9px; }
.sidebar nav button { text-align: left; background: transparent; color: var(--muted); border: 1px solid transparent; }
.sidebar nav button.active, .sidebar nav button:hover { color: var(--text); background: rgba(255,255,255,.07); border-color: var(--line); }
.content { padding: 26px; max-width: 1450px; width: 100%; }
.content.standalone { margin: 0 auto; }
.topbar { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 22px; }
.topbar p { color: var(--muted); }
.user-pill { border: 1px solid var(--line); background: rgba(255,255,255,.05); border-radius: 999px; padding: 10px 14px; color: #dbeafe; white-space: nowrap; }
.tab { display: none; }
.tab.active { display: block; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card, .panel { background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035)); border: 1px solid var(--line); border-radius: 24px; padding: 20px; box-shadow: 0 12px 40px rgba(0,0,0,.20); }
.card strong { display: block; font-size: 28px; margin-top: 8px; }
.card span { color: var(--muted); }
.two-col { display: grid; grid-template-columns: 360px 1fr; gap: 22px; align-items: start; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 18px; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: #bfdbfe; background: rgba(255,255,255,.05); position: sticky; top: 0; }
tr:hover td { background: rgba(255,255,255,.03); }
.badge { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; color: #dbeafe; background: rgba(255,255,255,.05); font-size: 12px; }
.badge.approved { color: var(--ok); border-color: rgba(134,239,172,.35); }
.badge.submitted, .badge.verified { color: var(--accent); }
.badge.cancelled { color: var(--danger); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions button { padding: 8px 10px; font-size: 12px; }
.inline-form { display: flex; gap: 12px; align-items: center; margin: 12px 0 18px; }
.inline-form select { max-width: 360px; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .cards { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; }
}
@media (max-width: 540px) { .cards { grid-template-columns: 1fr; } }
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.notice { border: 1px solid var(--line); background: rgba(125, 211, 252, .08); border-radius: 16px; padding: 12px 13px; color: #dbeafe; }
.danger-note { border-color: rgba(251,113,133,.35); background: rgba(251,113,133,.10); color: #fecdd3; }
.badge.open, .badge.reopened { color: var(--ok); border-color: rgba(134,239,172,.35); }
.badge.locked { color: #fde68a; border-color: rgba(253,230,138,.36); }
.badge.paid { color: #c4b5fd; border-color: rgba(196,181,253,.36); }
.badge.pending { color: #fde68a; border-color: rgba(253,230,138,.36); }
.filter-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 12px; align-items: end; margin: 12px 0 18px; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.compact-cards { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
.compact-cards .card strong { font-size: 21px; }
.badge.applied { color: #86efac; border-color: rgba(134,239,172,.35); }
.badge.rejected { color: #fb7185; border-color: rgba(251,113,133,.36); }
@media (max-width: 1100px) { .filter-grid, .report-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .filter-grid, .report-grid { grid-template-columns: 1fr; } }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .three-col { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .three-col { grid-template-columns: 1fr; } }
.panel-sub { border: 1px solid var(--line); background: rgba(2,6,23,.22); border-radius: 20px; padding: 16px; margin-top: 18px; }
.wide-inline { display: grid; grid-template-columns: 1fr 1fr 1fr 120px 150px 1fr auto; align-items: end; }
.badge.low { color: #fecdd3; border-color: rgba(251,113,133,.36); }
.badge.high { color: #fde68a; border-color: rgba(253,230,138,.36); }
.badge.ok { color: #86efac; border-color: rgba(134,239,172,.35); }
@media (max-width: 1180px) { .wide-inline { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .wide-inline { grid-template-columns: 1fr; } }

/* Phase 15: permission manager UI */
.mini-panel { border: 1px solid rgba(148, 163, 184, .22); background: rgba(15, 23, 42, .44); border-radius: 16px; padding: 14px; margin-bottom: 14px; }
.mini-panel h4 { margin: 0 0 10px; }
.check-row { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid rgba(148, 163, 184, .12); }
.check-row:first-of-type { border-top: 0; }
.check-row input { width: 18px; height: 18px; margin-top: 3px; }
.clean-list { margin: 0; padding-left: 20px; line-height: 1.7; color: #cbd5e1; }
.badge.warning { background: rgba(245, 158, 11, .18); color: #fde68a; border: 1px solid rgba(245, 158, 11, .35); }
.badge.inactive { background: rgba(239, 68, 68, .13); color: #fecaca; border: 1px solid rgba(239, 68, 68, .28); }
hr { border: 0; border-top: 1px solid rgba(148, 163, 184, .18); margin: 22px 0; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; padding: 8px 10px; border-radius: 10px; font-weight: 700; }
.badge.critical { background: rgba(239, 68, 68, .16); color: #fecaca; border-color: rgba(239, 68, 68, .35); }
.badge.created { color: #86efac; border-color: rgba(134,239,172,.35); }
.badge.deleted { color: #cbd5e1; border-color: rgba(203,213,225,.28); }
/* Phase 27 evidence vault helpers */
.tiny-btn { padding: 6px 10px; border-radius: 10px; font-size: 12px; }
.tiny-link { display: inline-block; padding: 6px 10px; border-radius: 10px; text-decoration: none; }
input[type="file"] { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: rgba(2, 6, 23, .45); color: var(--text); }
