/* Power BI Requirements Checklist - styles.css (v5) */
:root{
  --bg:#f5f7fb;
  --card:#ffffff;
  --text:#121826;
  --muted:#667085;
  --border:#e6e8ef;
  --accent:#2b579a;
  --accent2:#1f3f6e;
  --danger:#b42318;
  --warn:#b54708;
  --ok:#027a48;
  --shadow: 0 10px 30px rgba(16,24,40,.08);
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}

.muted{ color: var(--muted); }

.topbar{
  position: sticky;
  top:0;
  z-index:10;
  background: rgba(245,247,251,.92);
  backdrop-filter: blur(8px);
  border-bottom:1px solid var(--border);
  padding:14px 18px;
  display:flex;
  gap:14px;
  align-items:center;
  justify-content:space-between;
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
  min-width: 280px;
}
.logo{
  width:40px;
  height:40px;
  border-radius:12px;
  background: var(--accent);
  color:white;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  box-shadow: var(--shadow);
}
h1{
  font-size:18px;
  margin:0;
  line-height:1.2;
}
.subtitle{
  margin:2px 0 0;
  color:var(--muted);
  font-size:12px;
}

.top-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap: wrap;
  justify-content:flex-end;
}

.toggle{
  display:flex;
  align-items:center;
  gap:8px;
  color: var(--muted);
  font-size:12px;
  font-weight:800;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:white;
}
.toggle select{
  border:1px solid var(--border);
  border-radius:10px;
  padding:8px 8px;
  font-size:13px;
  color: var(--text);
  background:white;
  outline:none;
}

.container{
  max-width: 1100px;
  margin: 18px auto 40px;
  padding: 0 16px;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.card-row{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
}
@media (max-width: 900px){
  .card-row{ grid-template-columns: 1fr; }
}

.card-col h2{
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing: .2px;
}

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.grid-2{
  grid-template-columns: 1fr 1fr;
  margin-top: 10px;
}
@media (max-width: 650px){
  .grid{ grid-template-columns: 1fr; }
  .grid-2{ grid-template-columns: 1fr; }
}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:12px;
  color: var(--muted);
}
.field span{ font-weight:700; }
.field input, .field select{
  padding:10px 10px;
  border:1px solid var(--border);
  border-radius:12px;
  font-size:14px;
  color:var(--text);
  background:white;
  outline:none;
}
.field input:focus, .field select:focus, textarea:focus{
  border-color: rgba(43,87,154,.45);
  box-shadow: 0 0 0 4px rgba(43,87,154,.12);
}

.field.small{ min-width: 180px; }

.btn{
  border:1px solid var(--border);
  background: white;
  color: var(--text);
  padding:10px 12px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 13px;
  cursor:pointer;
}
.btn:hover{ border-color: rgba(43,87,154,.35); }
.btn:active{ transform: translateY(1px); }

.btn-primary{
  background: var(--accent);
  color:white;
  border-color: rgba(0,0,0,0);
}
.btn-primary:hover{ background: var(--accent2); }

.btn-ghost{
  background: white;
}

.file-label{
  position:relative;
  overflow:hidden;
}
.file-label input{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
}

.progress-wrap{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.progress-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.progress-text{ font-weight:900; }
.progress-counts{ color:var(--muted); font-size:12px; }

.progress-bar{
  width:100%;
  height: 12px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid var(--border);
  overflow:hidden;
}
.progress-fill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(43,87,154,1), rgba(43,87,154,.65));
}

.risk-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
@media (max-width: 450px){
  .risk-row{ grid-template-columns: 1fr; }
}
.risk-box{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: #fbfcff;
}
.risk-title{
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.risk-score{
  font-size: 26px;
  font-weight: 900;
  margin-top: 6px;
}
.risk-max{
  font-size: 12px;
  color: var(--muted);
  margin-left: 6px;
  font-weight: 900;
}
.risk-label{
  margin-top: 4px;
  font-size: 12px;
  font-weight: 900;
  color: var(--ok);
}
.risk-label.warn{ color: var(--warn); }
.risk-label.danger{ color: var(--danger); }

.mini-help{
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 10px;
}

.card-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.card-head h2{
  margin:0;
  font-size: 14px;
}
.filters{
  display:flex;
  gap: 10px;
  align-items:flex-end;
  flex-wrap: wrap;
  justify-content:flex-end;
}

.section{
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}
.section:first-child{
  border-top:none;
  padding-top:0;
  margin-top:0;
}

.section-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 10px;
  cursor:pointer;
  user-select:none;
}
.section-title h3{
  margin:0;
  font-size: 13px;
}
.section-toggle{
  display:flex;
  gap:8px;
  align-items:center;
}
.chev{
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
  color: var(--muted);
  background: #fff;
}
.section-meta{
  display:flex;
  gap: 8px;
  align-items:center;
  flex-wrap: wrap;
}
.badge{
  font-size:12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: #fbfcff;
  font-weight: 900;
}

.items{
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.item{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.item-top{
  display:flex;
  gap: 10px;
  align-items:flex-start;
  justify-content:space-between;
}
.item-left{
  display:flex;
  gap: 10px;
  align-items:flex-start;
}
.item-left input{
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.item-text{
  display:flex;
  flex-direction:column;
  gap: 4px;
}
.item-text .q{
  font-weight: 900;
  color: var(--text);
  line-height: 1.3;
}
.item-text .why{
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.item-tools{
  display:flex;
  gap: 8px;
  align-items:center;
}
.smallbtn{
  border:1px solid var(--border);
  background:#fff;
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
  font-weight:900;
  font-size:12px;
}
.smallbtn:hover{ border-color: rgba(43,87,154,.35); }

textarea{
  width:100%;
  border:1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  resize: vertical;
  min-height: 64px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
}
.bigtext{
  min-height: 160px;
}

.note-row{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  align-items:center;
}

.pill{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid var(--border);
  background:#fff;
  color: var(--text);
  font-weight: 900;
}
.pill-muted{
  color: var(--muted);
  background:#fbfcff;
}

.warnings-panel{
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.warnings-panel.collapsed{
  display:none;
}
.warn-item{
  border: 1px solid rgba(181,71,8,.25);
  background: rgba(255, 250, 235, .65);
  border-radius: 14px;
  padding: 12px;
}
.warn-title{
  font-weight: 900;
  color: var(--warn);
}
.warn-text{
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}
.warn-action{
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hidden{ display:none !important; }

.footer{
  display:flex;
  justify-content:space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.toast{
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18,24,38,.95);
  color:white;
  padding: 10px 12px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  max-width: 92vw;
  font-size: 13px;
  font-weight: 800;
}
.toast.show{ opacity:1; }

/* Section collapse state */
.section.collapsed .items{ display:none; }
.section.collapsed .chev{ transform: rotate(-90deg); }

/* Scroll buttons */
.scroll-fab{
  position: fixed;
  right: 16px;
  bottom: 16px;
  display:flex;
  flex-direction:column;
  gap: 10px;
  z-index: 20;
}
.fab{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 900;
  cursor:pointer;
  box-shadow: var(--shadow);
}
.fab:hover{ border-color: rgba(43,87,154,.35); }

/* Dark theme overrides */
html[data-theme="dark"]{
  --bg:#0b1220;
  --card:#0f172a;
  --text:#e5e7eb;
  --muted:#a3aab8;
  --border: rgba(148,163,184,.22);
  --shadow: 0 12px 34px rgba(0,0,0,.45);
  --accent:#60a5fa;
  --accent2:#3b82f6;
}

html[data-theme="dark"] .topbar{
  background: rgba(11,18,32,.85);
  border-bottom: 1px solid var(--border);
}
html[data-theme="dark"] .toggle,
html[data-theme="dark"] .btn,
html[data-theme="dark"] .card,
html[data-theme="dark"] .risk-box,
html[data-theme="dark"] .badge,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select{
  background: rgba(15,23,42,.9);
  color: var(--text);
}
html[data-theme="dark"] .chev,
html[data-theme="dark"] .smallbtn,
html[data-theme="dark"] .pill,
html[data-theme="dark"] .fab{
  background: rgba(15,23,42,.9);
  color: var(--text);
}
html[data-theme="dark"] .progress-bar{
  background: rgba(96,165,250,.12);
}
html[data-theme="dark"] .progress-fill{
  background: linear-gradient(90deg, rgba(96,165,250,1), rgba(96,165,250,.65));
}
html[data-theme="dark"] .warn-item{
  background: rgba(180,83,9,.18);
  border-color: rgba(245,158,11,.25);
}
html[data-theme="dark"] .toast{
  background: rgba(229,231,235,.14);
}
html[data-theme="dark"] .btn:hover,
html[data-theme="dark"] .smallbtn:hover,
html[data-theme="dark"] .fab:hover{
  border-color: rgba(96,165,250,.35);
}


/* Dropdown visibility */
select{
  color: var(--text);
  background: #fff;
}
select option{
  color: var(--text);
  background: #fff;
}
html[data-theme="dark"] select{
  color: var(--text);
  background: rgba(15,23,42,.98);
}
html[data-theme="dark"] select option{
  color: var(--text);
  background: #0f172a;
}

/* Topbar mode dropdown (extra safety) */
.toggle select{
  -webkit-appearance: none;
  appearance: none;
}
.toggle select option{
  color: var(--text);
  background: #fff;
}
html[data-theme="dark"] .toggle select option{
  color: var(--text);
  background: #0f172a;
}


/* Header alignment */
.topbar{
  padding: 14px 0;
}
.topbar-inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
}

/* Toolbar under header */
.toolbar{
  position: sticky;
  top: 76px;
  z-index: 9;
}
.toolbar-row{
  display:flex;
  gap: 12px;
  align-items:flex-end;
  justify-content:space-between;
  flex-wrap: wrap;
}
.toolbar-left{
  display:flex;
  gap: 10px;
  align-items:flex-end;
  flex-wrap: wrap;
}
.toolbar-right{
  display:flex;
  gap: 8px;
  align-items:center;
  flex-wrap: wrap;
  justify-content:flex-end;
}
.field.search{
  min-width: 260px;
}
@media (max-width: 650px){
  .toolbar{ top: 90px; }
  .field.search{ min-width: 200px; }
}

/* Dark mode header/toolbar sticky backgrounds */
html[data-theme="dark"] .topbar{
  background: rgba(11,18,32,.85);
}
html[data-theme="dark"] .toolbar{
  background: transparent;
}
