:root{
  --bg:#0b0f14;
  --card:#111826;
  --text:#e7eef8;
  --muted:#9fb0c5;
  --line:#1e2a3a;
  --link:#8ab4ff;
}

/* =========================
   RESET / BASE
========================= */
*{box-sizing:border-box}

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background:var(--bg);
  color:var(--text);
}

a{color:var(--link);text-decoration:none}
a:hover{text-decoration:underline}

h1{margin:0 0 10px 0;font-size:24px}
h2{margin:0 0 10px 0;font-size:18px;color:var(--muted)}

.small{color:var(--muted);font-size:12px}

/* =========================
   LAYOUT
========================= */

.app{
  display:block;
}

.main{
  max-width:1100px;
  margin:0 auto;
  padding:20px;
}

/* =========================
   CARDS
========================= */

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  padding:16px;
  margin:12px 0;
}

/* =========================
   TABLES
========================= */

table{
  width:100%;
  border-collapse:collapse;
}

th,td{
  padding:10px;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:top;
}

th{
  color:var(--muted);
  font-weight:600;
}

/* =========================
   FORMS
========================= */

input,select,textarea{
  width:100%;
  padding:10px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#0f1724;
  color:var(--text);
}

label{
  display:block;
  margin:10px 0 6px;
  color:var(--muted);
}

.row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

/* =========================
   BUTTONS
========================= */

.btn{
  display:inline-block;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#0f1724;
  color:var(--text);
  cursor:pointer;
}

.btn.primary{
  background:#16233a;
}

.btn.active{
  outline:2px solid rgba(255,255,255,0.10);
}

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

/* =========================
   TOPBAR
========================= */

.topbar{
  position:sticky;
  top:0;
  z-index:50;
  padding:12px 20px;
  backdrop-filter: blur(8px);
}

.topbar-inner{
  max-width:1100px;
  margin:0 auto;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}

.brand-title{
  font-size:17px;
  font-weight:800;
  line-height:1.1;
  letter-spacing:.2px;
}

.brand-sub{
  margin-top:3px;
  color:var(--muted);
  font-size:12px;
  line-height:1.2;
}

.brand-user{
  margin-top:2px;
  color:#64748b;
  font-size:11px;
  line-height:1.2;
}

.icon-btn{
  width:40px;
  height:40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
  border:1px solid var(--line);
  background:#0f1724;
  color:var(--text);
  cursor:pointer;
}

/* =========================
   SIDEBAR OFF-CANVAS
========================= */

.sidebar{
  position:fixed;
  left:0;
  top:0;
  width:320px;
  height:100vh;
  background:var(--card);
  border-right:1px solid var(--line);
  transform:translateX(-105%);
  transition:transform .2s ease;
  z-index:80;
  padding:16px;
  overflow:auto;
}

.sidebar.open{
  transform:translateX(0);
}

.overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  display:none;
  z-index:70;
}

.overlay.open{
  display:block;
}

/* Sidebar content */

.side-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
}

.side-user{
  color:var(--muted);
  font-size:12px;
  margin:6px 0 12px;
}

.side-section{
  margin:10px 0;
  padding-top:10px;
  border-top:1px solid var(--line);
}

.side-section:first-child{
  border-top:none;
  padding-top:0;
}

.side-section-title{
  color:var(--muted);
  font-size:12px;
  margin:0 0 8px;
  text-transform:uppercase;
  letter-spacing:.6px;
}

.side-links{
  display:grid;
  gap:6px;
}

.side-link{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid transparent;
  background:transparent;
  color:var(--text);
  text-decoration:none;
}

.side-link:hover{
  background:#0f1724;
  border-color:var(--line);
  text-decoration:none;
}

.side-link.active{
  background:#16233a;
  border-color:var(--line);
}

.side-link small{
  color:var(--muted);
  font-size:12px;
}

/* =========================
   FOOTER
========================= */

.footer{
  margin-top:40px;
  padding:18px 24px 28px;
  border-top:0;
  background:transparent;
}

.footer-inner{
  max-width:1100px;
  margin:0 auto;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.footer-left,
.footer-center,
.footer-right{
  display:flex;
  align-items:center;
  gap:8px;
}

.env-badge{
  font-size:11px;
  font-weight:700;
  padding:4px 8px;
  border-radius:6px;
  background:#16233a;
  border:1px solid var(--line);
  letter-spacing:.5px;
}

/* =========================
   CHARTS
========================= */

canvas{
  width:100% !important;
}

.brand-link{
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .4px;
}

.brand-link:hover{
  opacity: .8;
  text-decoration: none;
}

.audit-details{
  margin-top:14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:transparent;
}

.audit-details > summary{
  cursor:pointer;
  padding:12px 14px;
  font-weight:600;
}

.audit-details-body{
  padding:0 14px 14px 14px;
}

.audit-axis{
  margin-top:22px;
  border-top:2px solid var(--line);
  padding-top:10px;
}

.audit-axis > summary{
  font-size:1.1rem;
  font-weight:700;
}

.audit-question{
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid var(--line);
}

.audit-muted{
  opacity:.85;
}

.audit-badge{
  opacity:.8;
  font-weight:500;
  margin-left:8px;
}

.audit-comment-view{
  margin:8px 0 6px 0;
}

.audit-comment-box{
  display:none;
  margin-top:8px;
}

.audit-comment-box textarea{
  width:100%;
  min-height:90px;
}

/* =========================
   DASHBOARD TABS
========================= */

.dashboard-tabs{
  display:flex;
  gap:8px;
  margin:14px 0;
  flex-wrap:wrap;
}

.tab-btn{
  padding:9px 13px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#0f1724;
  color:var(--muted);
  cursor:pointer;
  font-weight:600;
}

.tab-btn:hover{
  color:var(--text);
  border-color:#2b3a50;
}

.tab-btn.active{
  background:#16233a;
  color:var(--text);
}

.tab-content{
  display:none;
}

.tab-content.active{
  display:block;
}

/* =========================
   HELP TITLES
========================= */


.help-hint{
  margin-left:6px;
  font-size:12px;
  color:var(--muted);
  opacity:.75;
  cursor:help;
}
