/* ============================================================
   Consent Hub — professional light theme (no gradients)
   ============================================================ */
:root {
  /* Neutrals */
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Text */
  --text: #1e293b;
  --text-2: #475569;
  --muted: #64748b;
  --faint: #94a3b8;

  /* Brand + status (flat, no gradients) */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --green: #15803d;
  --green-soft: #dcfce7;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --blue: #1d4ed8;
  --blue-soft: #dbeafe;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

.view { min-height: 100vh; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.875rem; }

/* ----------------------------- Auth ----------------------------- */
.auth-shell {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px; gap: 20px;
  background: var(--bg);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 34px;
  box-shadow: var(--shadow-lg);
}
.auth-footer { color: var(--faint); font-size: 0.78rem; text-align: center; }

.brand { display: flex; align-items: center; gap: 13px; margin-bottom: 28px; }
.brand.small { margin: 0; gap: 10px; min-width: 0; }
/* Logo is tightly cropped, so these sizes render the mark at full visible size. */
.brand-logo {
  display: block; flex-shrink: 0; object-fit: contain;
  width: 40px; height: 40px;
}
.brand-logo-lg { width: 60px; height: 60px; }
.brand h1 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.brand-sub { color: var(--muted); font-size: 0.8rem; margin-top: 1px; }
.brand.small .brand-name { font-weight: 700; font-size: 1.05rem; color: var(--text); white-space: nowrap; }

h2 { font-size: 1.2rem; font-weight: 650; margin-bottom: 4px; letter-spacing: -0.01em; color: var(--text); }

.field { display: block; margin: 16px 0; }
.field span { display: block; font-size: 0.8rem; color: var(--text-2); margin-bottom: 7px; font-weight: 550; }
.field input, select, textarea {
  width: 100%; padding: 11px 13px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 8px;
  font-size: 0.925rem; font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.field input::placeholder, textarea::placeholder { color: var(--faint); }
.field input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* Buttons */
.btn {
  cursor: pointer; border: 1px solid transparent; border-radius: 8px;
  padding: 10px 16px; font-size: 0.9rem; font-weight: 550;
  font-family: inherit; transition: background .12s, border-color .12s, color .12s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active { transform: translateY(0.5px); }
.btn-block { width: 100%; margin-top: 8px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { padding: 7px 12px; font-size: 0.82rem; }
.btn-danger { background: var(--surface); color: var(--red); border-color: #fca5a5; }
.btn-danger:hover { background: var(--red-soft); }
.btn-success { background: var(--surface); color: var(--green); border-color: #86efac; }
.btn-success:hover { background: var(--green-soft); }

/* Demo-account picker */
.hint-box {
  margin-top: 24px; padding: 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 7px;
}
.hint-box strong { font-size: 0.72rem; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.chip {
  text-align: left; cursor: pointer; font-family: inherit;
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 11px; font-size: 0.82rem; transition: border-color .12s, background .12s;
}
.chip:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

.otp-row { display: flex; gap: 8px; }
.otp-row input { flex: 1; letter-spacing: 5px; font-weight: 600; }
.btn-copy { white-space: nowrap; }

.demo-otp {
  background: var(--blue-soft); border: 1px solid #bfdbfe;
  color: var(--blue); border-radius: 8px; padding: 11px 13px;
  font-size: 0.84rem; margin-bottom: 12px; line-height: 1.5;
}
.demo-otp b { font-weight: 650; }

.error { color: var(--red); font-size: 0.85rem; margin-top: 14px; }

/* ----------------------------- App shell / sidebar ----------------------------- */
.app-shell { display: flex; min-height: 100vh; }

:root { --sidebar-w: 248px; --sidebar-w-collapsed: 72px; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  transition: width .18s ease;
  z-index: 40;
}
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 14px; gap: 8px; height: 60px;
  border-bottom: 1px solid var(--border);
}
.sidebar-toggle {
  cursor: pointer; background: transparent; border: 1px solid var(--border);
  color: var(--muted); border-radius: 8px; width: 30px; height: 30px;
  display: grid; place-items: center; flex-shrink: 0; transition: background .12s, color .12s;
}
.sidebar-toggle:hover { background: var(--surface-3); color: var(--text); }

.side-nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; background: transparent; border: none;
  color: var(--text-2); font-family: inherit; font-size: 0.9rem; font-weight: 550;
  padding: 10px 12px; border-radius: 9px; text-align: left; width: 100%;
  transition: background .12s, color .12s; white-space: nowrap;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-icon { width: 19px; height: 19px; flex-shrink: 0; }

.sidebar-foot { padding: 14px 12px; border-top: 1px solid var(--border); }
.user-pill { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-width: 0; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-size: 0.78rem; font-weight: 700;
}
.user-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.user-name { font-size: 0.85rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-badge {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 7px; border-radius: 5px; font-weight: 700; align-self: flex-start;
  background: var(--primary-soft); color: var(--primary);
}
.btn-logout { justify-content: flex-start; }

/* Collapsed state: show only the Operisoft logo + nav icons */
.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.sidebar-collapsed .brand-name,
.sidebar-collapsed .label-text,
.sidebar-collapsed .user-meta,
.sidebar-collapsed .brand-sub { display: none; }
/* Stack logo + collapse toggle vertically and centered when collapsed. */
.sidebar-collapsed .sidebar-head {
  flex-direction: column; justify-content: center; align-items: center;
  gap: 10px; height: auto; padding: 14px 0;
}
.sidebar-collapsed .brand.small { justify-content: center; gap: 0; }
.sidebar-collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar-collapsed .user-pill { justify-content: center; margin-bottom: 0; }
.sidebar-collapsed .btn-logout { justify-content: center; padding: 10px; }
.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }

/* Main column */
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.appbar {
  display: flex; align-items: center; gap: 16px;
  height: 60px; padding: 0 26px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.appbar-menu {
  display: none; cursor: pointer; background: transparent; border: none;
  color: var(--text-2); padding: 4px; border-radius: 8px;
}
.appbar-title { font-size: 1.05rem; font-weight: 650; flex: 1; letter-spacing: -0.01em; }
.appbar-right { display: flex; align-items: center; gap: 12px; }
.lang-select { width: auto; padding: 7px 10px; font-size: 0.82rem; border-radius: 8px; }

.sidebar-scrim {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 35;
}

/* ----------------------------- Content ----------------------------- */
.content { max-width: 1080px; margin: 0 auto; width: 100%; padding: 32px 32px 80px; }
.page-head { margin-bottom: 24px; }
.page-head h2 { font-size: 1.5rem; font-weight: 680; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 680px; font-size: 0.9rem; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.card h3 { font-size: 1.02rem; font-weight: 620; margin-bottom: 3px; letter-spacing: -0.01em; }
.card-sub { color: var(--muted); font-size: 0.85rem; margin-bottom: 18px; line-height: 1.5; }

/* Notice */
.notice-box {
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  background: var(--surface-2);
  padding: 18px 20px; border-radius: 10px; line-height: 1.6;
}
.notice-box h4 { margin-bottom: 10px; font-size: 0.98rem; font-weight: 620; }
.notice-box p { color: var(--text-2); margin-bottom: 10px; font-size: 0.9rem; }
.notice-meta { font-size: 0.76rem; color: var(--faint); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* Purpose rows */
.purpose {
  display: flex; align-items: flex-start; gap: 18px;
  padding: 18px 0; border-bottom: 1px solid var(--border);
}
.purpose:first-of-type { padding-top: 4px; }
.purpose:last-child { border-bottom: none; padding-bottom: 0; }
.purpose-info { flex: 1; min-width: 0; }
.purpose-info .ptitle { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.95rem; }
.purpose-info .pdesc { color: var(--text-2); font-size: 0.875rem; margin-top: 5px; }
.purpose-info .pdata { font-size: 0.78rem; color: var(--faint); margin-top: 7px; }
.pill {
  font-size: 0.64rem; text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 8px; border-radius: 6px; font-weight: 700;
}
.pill-req { background: var(--amber-soft); color: var(--amber); }
.pill-opt { background: var(--surface-3); color: var(--muted); }
.pill-blocked { background: var(--red-soft); color: var(--red); }

/* Toggle switch */
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; margin-top: 2px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border-strong);
  border-radius: 24px; transition: background .18s;
}
.slider::before {
  content: ""; position: absolute; height: 18px; width: 18px;
  left: 3px; top: 3px; background: #fff;
  border-radius: 50%; transition: transform .18s;
  box-shadow: var(--shadow-sm);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:disabled + .slider { opacity: .45; cursor: not-allowed; }

.actions-row { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid var(--border); }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm);
}
.stat .num { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em; color: var(--text); }
.stat .label { color: var(--muted); font-size: 0.8rem; margin-top: 4px; font-weight: 500; }
.stat.accent .num { color: var(--primary); }
.stat.red .num { color: var(--red); }
.stat.amber .num { color: var(--amber); }

/* Table */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
thead th { color: var(--muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
td code { font-size: 0.76rem; color: var(--primary); background: var(--primary-soft); padding: 2px 6px; border-radius: 5px; word-break: break-all; }

.badge {
  display: inline-block; font-size: 0.7rem; font-weight: 650;
  padding: 3px 9px; border-radius: 6px; letter-spacing: .02em;
}
.badge-GRANTED, .badge-RESOLVED { background: var(--green-soft); color: var(--green); }
.badge-WITHDRAWN, .badge-EXPIRED { background: var(--red-soft); color: var(--red); }
.badge-MODIFIED, .badge-IN_PROGRESS { background: var(--amber-soft); color: var(--amber); }
.badge-OPEN { background: var(--blue-soft); color: var(--blue); }

.chain-ok { color: var(--green); font-weight: 600; }
.chain-bad { color: var(--red); font-weight: 600; }
/* Inline SVG icons sit on the text baseline and align with adjacent text. */
.ic { display: inline-block; vertical-align: -0.18em; flex-shrink: 0; }
.chain-ok .ic, .chain-bad .ic { vertical-align: -0.18em; }
.card h3 .ic { vertical-align: -0.14em; margin-right: 7px; color: var(--primary); }
.rights-tile .ricon .ic { color: var(--primary); }

/* Inline forms */
.inline-form { display: flex; flex-direction: column; gap: 12px; max-width: 520px; }
.inline-form input, .inline-form textarea {
  width: 100%; padding: 10px 13px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 8px;
  font-family: inherit; font-size: 0.9rem;
}
.inline-form input:focus, .inline-form textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
textarea { min-height: 92px; resize: vertical; }

/* Rights tiles */
.rights-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; }
.rights-tile {
  cursor: pointer; text-align: left; font-family: inherit;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px; transition: border-color .12s, box-shadow .12s;
}
.rights-tile:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.rights-tile .ricon { font-size: 1.35rem; }
.rights-tile .rtitle { font-weight: 600; margin-top: 10px; font-size: 0.92rem; }
.rights-tile .rdesc { color: var(--muted); font-size: 0.8rem; margin-top: 4px; line-height: 1.45; }

/* Banners */
.guardian-banner {
  background: var(--amber-soft); border: 1px solid #fcd34d;
  border-radius: 10px; padding: 16px 18px; margin-bottom: 18px;
  font-size: 0.9rem; line-height: 1.55; color: #78350f;
}
.guardian-banner.verified { background: var(--green-soft); border-color: #86efac; color: #14532d; }
.guardian-banner b { font-weight: 650; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--text); border: 1px solid rgba(0,0,0,.1);
  color: #fff; padding: 12px 18px; border-radius: 10px;
  box-shadow: var(--shadow-lg); font-size: 0.88rem; font-weight: 500; z-index: 200;
  display: flex; align-items: center; gap: 9px;
  animation: toastIn .18s ease;
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.toast.success::before { background: #4ade80; }
.toast.error::before { background: #f87171; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

/* Confirmation modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: fadeIn .14s ease;
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); max-width: 420px; width: 100%;
  padding: 24px; animation: modalIn .16s ease;
}
.modal h3 { font-size: 1.08rem; font-weight: 650; margin-bottom: 8px; }
.modal p { color: var(--text-2); font-size: 0.9rem; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* Larger detail modal */
.modal-lg { max-width: 560px; max-height: 86vh; display: flex; flex-direction: column; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.detail-head h3 { margin-bottom: 8px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.detail-tags .tag { gap: 4px; }
.detail-tags .ic-wrap { display: inline-flex; }
.icon-btn { cursor: pointer; background: transparent; border: none; color: var(--muted); padding: 4px; border-radius: 7px; flex-shrink: 0; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.detail-body { overflow-y: auto; padding: 18px 2px 4px; margin-right: -8px; padding-right: 8px; }
.detail-section { margin-bottom: 18px; }
.detail-section:last-child { margin-bottom: 0; }
.detail-label { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 650; color: var(--primary); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.detail-text { color: var(--text-2); font-size: 0.9rem; line-height: 1.6; }

/* (i) info button on a purpose row */
.info-btn {
  cursor: pointer; background: transparent; border: none;
  color: var(--faint); padding: 2px; border-radius: 50%;
  display: inline-flex; vertical-align: -0.2em; transition: color .12s, background .12s;
}
.info-btn:hover { color: var(--primary); background: var(--primary-soft); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px); } }

.empty {
  color: var(--muted); text-align: center; padding: 40px 20px; font-size: 0.9rem;
}

/* Two-column dashboard grid */
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* Horizontal bar (acceptance rates) */
.bar-row { margin-bottom: 16px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.bar-label { font-size: 0.88rem; font-weight: 550; color: var(--text); display: flex; align-items: center; gap: 7px; }
.bar-val { font-size: 0.82rem; font-weight: 650; color: var(--text-2); }
.bar-track { height: 8px; background: var(--surface-3); border-radius: 20px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 20px; transition: width .4s ease; }
.bar-fill.req { background: var(--amber); }
.bar-fill.low { background: var(--red); }

/* Activity feed */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: none; }
.feed-dot {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center;
}
.feed-dot.GRANTED, .feed-dot.RESOLVED { background: var(--green-soft); color: var(--green); }
.feed-dot.WITHDRAWN, .feed-dot.EXPIRED { background: var(--red-soft); color: var(--red); }
.feed-dot.MODIFIED { background: var(--amber-soft); color: var(--amber); }
.feed-body { flex: 1; min-width: 0; }
.feed-title { font-size: 0.88rem; color: var(--text); }
.feed-title b { font-weight: 600; }
.feed-time { font-size: 0.76rem; color: var(--faint); margin-top: 2px; }

/* Health rows */
.health-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.health-row:last-child { border-bottom: none; }
.health-row .hk { color: var(--text-2); }
.health-dot { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.health-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.health-dot.good { color: var(--green); } .health-dot.good::before { background: var(--green); }
.health-dot.warn { color: var(--amber); } .health-dot.warn::before { background: var(--amber); }
.health-dot.bad  { color: var(--red); }   .health-dot.bad::before  { background: var(--red); }

/* Search input */
.search-box { position: relative; margin-bottom: 16px; max-width: 360px; }
.search-box input { width: 100%; padding: 10px 13px 10px 36px; border: 1px solid var(--border-strong); border-radius: 8px; font-family: inherit; font-size: 0.9rem; }
.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.search-box .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }

/* Tag chips */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }
.tag.minor { background: var(--amber-soft); color: var(--amber); }
.tag.adult { background: var(--blue-soft); color: var(--blue); }
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.pending { background: var(--amber-soft); color: var(--amber); }

/* Mini summary cards (consent page) */
.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.mini {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px;
}
.mini .mlabel { font-size: 0.76rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.mini .mval { font-size: 1.3rem; font-weight: 700; margin-top: 6px; color: var(--text); }
.mini .msub { font-size: 0.76rem; color: var(--faint); margin-top: 2px; }

/* Spinner */
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--muted); font-size: 0.9rem; }
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--border-strong);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  /* Sidebar becomes an off-canvas drawer. */
  .sidebar {
    position: fixed; left: 0; top: 0; height: 100vh;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-open .sidebar-scrim { display: block; }
  .appbar-menu { display: inline-flex; }
  .content { padding: 24px 18px 60px; }
  /* Ignore collapse on mobile — always show full drawer when open. */
  .sidebar-collapsed .sidebar { width: var(--sidebar-w); }
  .sidebar-collapsed .brand-name,
  .sidebar-collapsed .label-text,
  .sidebar-collapsed .user-meta { display: initial; }
}

/* ---- Enterprise modules UI ---- */
.snippet-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; overflow-x: auto;
}
.snippet-box code {
  background: transparent; color: var(--text-2); padding: 0;
  font-size: 0.8rem; white-space: nowrap; flex: 1;
}
.snippet-box .btn { flex-shrink: 0; }

.policy-pre {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px; margin-top: 12px;
  font-size: 0.8rem; line-height: 1.5; color: var(--text-2);
  white-space: pre-wrap; max-height: 460px; overflow-y: auto;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* Sub-tabs (privacy suite) */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.subtab {
  cursor: pointer; background: transparent; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); font-family: inherit; font-size: 0.9rem; font-weight: 550;
  padding: 10px 14px; margin-bottom: -1px; transition: color .12s, border-color .12s;
}
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---- Consent-request inbox (principal) ---- */
.req-card .req-detail { display: grid; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.req-card .detail-label { display: flex; align-items: center; gap: 7px; font-size: 0.76rem; font-weight: 650;
  color: var(--primary); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.req-card .detail-text { color: var(--text-2); font-size: 0.9rem; line-height: 1.5; }
.req-note { width: 100%; margin-top: 14px; padding: 9px 12px; border: 1px solid var(--border-strong);
  border-radius: 8px; font-family: inherit; font-size: 0.88rem; }
.req-note:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.req-note-shown { margin-top: 12px; color: var(--muted); font-style: italic; font-size: 0.88rem; }

.count-pill { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 20px; background: var(--red); color: #fff; font-size: 0.72rem; font-weight: 700; vertical-align: middle; }

/* Badge on a sidebar nav item */
.nav-item { position: relative; }
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 20px;
  background: var(--red); color: #fff; font-size: 0.68rem; font-weight: 700; display: inline-grid; place-items: center; }
.sidebar-collapsed .nav-badge { position: absolute; top: 4px; right: 6px; margin: 0; }
