@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Cairo:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #f4f7fb;
  --bg-2: #eef3f9;
  --surface: rgba(255,255,255,.88);
  --surface-solid: #ffffff;
  --surface-dark: #091221;
  --surface-dark-2: #101b2c;
  --surface-dark-3: #162338;
  --text: #0e1726;
  --text-2: #334155;
  --sub: #64748b;
  --line: #dbe4ee;
  --line-2: #cfd9e6;
  --primary: #2358ff;
  --primary-2: #1e48d8;
  --primary-soft: #eaf0ff;
  --accent: #0ea5e9;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --purple: #7c3aed;
  --gold: #d6a755;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05), 0 1px 1px rgba(15,23,42,.04);
  --shadow-md: 0 12px 28px rgba(15,23,42,.08), 0 4px 10px rgba(15,23,42,.05);
  --shadow-lg: 0 20px 50px rgba(15,23,42,.12);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Cairo', 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, rgba(35,88,255,.09), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(14,165,233,.08), transparent 28%),
    linear-gradient(180deg, #f7faff 0%, var(--bg) 100%);
  min-height: 100vh;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.32) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 85%);
}
.app, .login-body { position: relative; z-index: 1; }

.gov-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  background: rgba(255,255,255,.68);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(203,213,225,.8);
  color: var(--text-2);
  font-size: 12px;
}
.gov-ribbon .seal {
  font-weight: 800;
  letter-spacing: .02em;
}
.gov-ribbon .meta {
  display: flex;
  gap: 16px;
  color: var(--sub);
  flex-wrap: wrap;
}

.app {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: calc(100vh - 49px);
}

.sidebar {
  position: sticky;
  top: 0;
  height: calc(100vh - 49px);
  background: linear-gradient(180deg, rgba(9,18,33,.98), rgba(16,27,44,.98));
  border-inline-start: 1px solid rgba(255,255,255,.06);
  color: #dce6f3;
  padding: 20px 18px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 10px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(148,163,184,.2); border-radius: 999px; }

.brand-wrap {
  padding: 8px 6px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #2d67ff, #0ea5e9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 12px 20px rgba(35,88,255,.28);
}
.brand strong {
  display: block;
  font-size: 22px;
  color: #fff;
  line-height: 1.2;
}
.brand span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #8fa3bc;
  letter-spacing: .12em;
}
.brand-note {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.8;
  color: #a4b4c8;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 12px 14px;
}

nav { display: grid; gap: 4px; margin-top: 8px; }
.nav-section {
  margin-top: 12px;
  margin-bottom: 4px;
  padding: 8px 12px 4px;
  font-size: 11px;
  color: #6f85a2;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 800;
}
nav button {
  appearance: none;
  border: 0;
  text-align: right;
  font: inherit;
  color: #d6e2f0;
  background: transparent;
  padding: 12px 14px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: .18s ease;
}
nav button:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}
nav button.active {
  background: linear-gradient(180deg, rgba(35,88,255,.22), rgba(14,165,233,.12));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(79,140,255,.35);
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
  opacity: .4;
  flex: none;
}
nav button.active .dot { opacity: 1; }
.logout {
  margin-top: auto;
  width: 100%;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: #d9e2ec;
  font: inherit;
  padding: 13px 14px;
  border-radius: 14px;
  cursor: pointer;
  transition: .18s ease;
}
.logout:hover { background: rgba(220,38,38,.12); border-color: rgba(220,38,38,.24); }

.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 22px 28px 18px;
  background: rgba(244,247,251,.76);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(203,213,225,.7);
}
.topbar-title { flex: 1 1 260px; }
.eyebrow {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.topbar h1 {
  margin: 4px 0 0;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 900;
  color: var(--text);
}
.topbar .sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--sub);
}
.search-box {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.88);
  border-radius: 16px;
  padding: 12px 16px;
  color: var(--sub);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: min(360px, 100%);
  font: inherit;
}
.search-box span:last-child {
  background: #eef2f7;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  color: #475569;
}
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.content { padding: 28px; }
.view { display: none; }
.view.active { display: block; }
.section-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.section-intro h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
}
.section-intro p {
  margin: 6px 0 0;
  color: var(--sub);
  font-size: 14px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, .9fr);
  gap: 18px;
  margin-bottom: 20px;
}
.hero-card {
  border: 1px solid rgba(203,213,225,.75);
  border-radius: 28px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
}
.hero-primary {
  padding: 24px 26px;
  background:
    radial-gradient(circle at 100% 0%, rgba(14,165,233,.18), transparent 32%),
    radial-gradient(circle at 0% 100%, rgba(35,88,255,.13), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(246,250,255,.92));
}
.hero-badge {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(35,88,255,.08);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}
.hero-copy h2 {
  margin: 16px 0 8px;
  font-size: 34px;
  line-height: 1.2;
}
.hero-copy p {
  margin: 0;
  font-size: 15px;
  color: var(--text-2);
  max-width: 820px;
}
.hero-actions {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-side {
  padding: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.88));
}
.hero-side-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.hero-side-head b { font-size: 18px; }
.hero-side-head span { font-size: 12px; color: var(--sub); }
.hero-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hero-list li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: #f8fbff;
  border: 1px solid var(--line);
}
.hero-list li > span {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-size: 12px;
  font-weight: 800;
}
.hero-list b { display: block; font-size: 14px; margin-bottom: 2px; }
.hero-list small { color: var(--sub); line-height: 1.6; }

.executive-strip { display: none; }

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.kpi {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  border: 1px solid rgba(203,213,225,.75);
  background: rgba(255,255,255,.88);
  border-radius: 22px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
}
.kpi::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.kpi.accent::before { background: linear-gradient(90deg, var(--success), #22c55e); }
.kpi.gold::before { background: linear-gradient(90deg, var(--gold), #f59e0b); }
.kpi .label {
  color: var(--sub);
  font-size: 12px;
  font-weight: 700;
}
.kpi .value {
  margin-top: 10px;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -.02em;
}
.kpi .sub {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.8;
}

.grid { display: grid; gap: 18px; }
.two-col-equal, .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.split-layout, .grid.r-l, .grid.l-r { grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); }
.compact-grid { align-items: start; }

.card {
  border: 1px solid rgba(203,213,225,.76);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.wide-card { padding: 22px; }
.chart-card { min-height: 360px; }
.card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
}
.card-head .meta, .meta {
  font-size: 12px;
  color: var(--sub);
}
.info-text {
  margin: 0 0 14px;
  color: var(--sub);
  line-height: 1.9;
}
.subsection-title { margin: 20px 0 12px; font-size: 15px; }

.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #edf2f7;
}
.bar-row:last-child { border-bottom: 0; }
.bar-row b { display: block; margin-bottom: 10px; font-size: 14px; }
.bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf2f7;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.num {
  min-width: 56px;
  text-align: left;
  font-weight: 800;
  color: var(--text-2);
}

.kanban {
  display: grid;
  gap: 14px;
}
.pipeline-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kanban-col {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  min-height: 110px;
}
.kanban-col h4 {
  margin: 0;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.count {
  font-size: 30px;
  font-weight: 900;
  color: var(--primary);
}
.kanban-card, .mini-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 1px 0 rgba(15,23,42,.03);
}
.kanban-card {
  margin-bottom: 12px;
  cursor: pointer;
  transition: .18s ease;
}
.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: #c5d3e3;
}
.kanban-card b, .mini-item b { display: block; font-size: 14px; }
.kanban-card small, .mini-item small {
  display: block;
  margin-top: 4px;
  color: var(--sub);
  line-height: 1.6;
}
.mini-list { display: grid; gap: 10px; }
.empty {
  border: 1px dashed var(--line-2);
  color: var(--sub);
  background: #f8fbff;
  border-radius: 18px;
  padding: 18px;
  text-align: center;
}

.filters {
  display: grid;
  grid-template-columns: 2fr repeat(4, minmax(120px,1fr)) auto;
  gap: 12px;
  margin-bottom: 16px;
}
.glass-bar {
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(203,213,225,.8);
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow-sm);
}
input, select, textarea, button {
  font: inherit;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  outline: 0;
  transition: .16s ease;
}
textarea { min-height: 106px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(35,88,255,.45);
  box-shadow: 0 0 0 4px rgba(35,88,255,.1);
}
.form-stack { display: grid; gap: 12px; }
.form-stack label {
  margin-bottom: -4px;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 700;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.upload {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.88);
  color: var(--text);
  padding: 11px 16px;
  border-radius: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  transition: .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: #c0cedf; }
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  border-color: transparent;
}
.btn.primary:hover { box-shadow: 0 12px 24px rgba(35,88,255,.18); }
.btn.gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border-color: transparent;
}
.btn.danger { color: var(--danger); }
.btn.sm { padding: 8px 12px; font-size: 12px; }

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(203,213,225,.78);
  border-radius: 22px;
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow-sm);
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbff;
  color: #475569;
  font-size: 12px;
  text-align: right;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: top;
}
tbody tr:hover { background: rgba(35,88,255,.03); }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 6px 0;
  color: var(--sub);
}
.pager button {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  border-radius: 12px;
  padding: 9px 12px;
  cursor: pointer;
}
.pager button:disabled { opacity: .4; cursor: not-allowed; }

.pill, .tag, .priority, .score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}
.tag { background: #eff6ff; color: #1d4ed8; margin-inline-end: 6px; margin-top: 8px; }
.pill { background: #f1f5f9; color: var(--text-2); }
.pill.green { background: #dcfce7; color: #166534; }
.pill.blue { background: #dbeafe; color: #1d4ed8; }
.pill.red { background: #fee2e2; color: #b91c1c; }
.score.good { background: #dcfce7; color: #166534; }
.score.mid { background: #fef3c7; color: #92400e; }
.score.bad { background: #fee2e2; color: #b91c1c; }
.priority.High { background: #fee2e2; color: #b91c1c; }
.priority.Medium { background: #fef3c7; color: #92400e; }
.priority.Low { background: #dbeafe; color: #1d4ed8; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.detail-grid > div {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: #f9fbff;
}
.detail-grid b {
  display: block;
  color: var(--sub);
  font-size: 12px;
  margin-bottom: 8px;
}
.v { font-weight: 800; }
.rule-list {
  margin: 0;
  padding-inline-start: 18px;
  color: var(--text-2);
  line-height: 2;
}
pre {
  overflow: auto;
  background: #0b1220;
  color: #d8e1ee;
  border-radius: 18px;
  padding: 16px;
  font-size: 12px;
  line-height: 1.8;
}
#importResult {
  margin-top: 14px;
  max-height: 220px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(6px);
  z-index: 40;
}
.modal.show { display: flex; }
.modal-content {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100vh - 60px);
  overflow: auto;
  border-radius: 28px;
  border: 1px solid rgba(203,213,225,.55);
  background: #fff;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}
.modal-content h2 { margin: 0 0 8px; font-size: 26px; }
.modal-content h3 { margin: 22px 0 10px; font-size: 18px; }
.modal-close {
  position: absolute;
  inset-inline-start: 18px;
  top: 18px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.toast {
  position: fixed;
  inset-inline-start: 24px;
  bottom: 24px;
  background: #0f172a;
  color: white;
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  transition: .18s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Login */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(35,88,255,.12), transparent 28%),
    radial-gradient(circle at bottom left, rgba(14,165,233,.12), transparent 26%),
    linear-gradient(180deg, #f8fbff, #eef3f9);
}
.login-card {
  width: min(460px, 100%);
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(203,213,225,.8);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  padding: 30px;
}
.brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 900;
  margin-bottom: 18px;
}
.login-card h1 { margin: 0; font-size: 28px; }
.login-card p { margin: 8px 0 22px; color: var(--sub); }
.login-card form { display: grid; gap: 12px; }
.login-card label { font-size: 13px; font-weight: 700; color: var(--text-2); }
.login-card button {
  margin-top: 4px;
  border: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  padding: 13px 16px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
}
.login-card small {
  display: block;
  margin-top: 16px;
  color: var(--sub);
  line-height: 1.8;
}

@media (max-width: 1360px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1120px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-inline-start: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .content, .topbar { padding-inline: 18px; }
}
@media (max-width: 860px) {
  .filters,
  .grid.split-layout, .grid.r-l, .grid.l-r,
  .two-col-equal, .grid.two, .grid.three,
  .detail-grid,
  .form-row,
  .pipeline-grid {
    grid-template-columns: 1fr;
  }
  .kpis { grid-template-columns: 1fr; }
  .topbar { align-items: stretch; }
  .search-box { min-width: 100%; }
  .content { padding: 18px; }
  .hero-copy h2 { font-size: 26px; }
}

/* === Category Reports Engine === */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.report-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(203,213,225,.78);
  background:
    radial-gradient(circle at 100% 0%, rgba(35,88,255,.12), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,251,255,.92));
  border-radius: 26px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: .18s ease;
}
.report-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(35,88,255,.24);
}
.report-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.report-label {
  display: inline-flex;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.report-card h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
}
.report-status {
  display: inline-flex;
  margin-top: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.report-status.good { background: #dcfce7; color: #166534; }
.report-status.mid { background: #fef3c7; color: #92400e; }
.report-status.bad { background: #fee2e2; color: #b91c1c; }
.report-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.report-metrics > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
}
.report-metrics b {
  display: block;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
}
.report-metrics small {
  display: block;
  margin-top: 4px;
  color: var(--sub);
  font-size: 11px;
}
.report-mini {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  color: var(--text-2);
}
.report-mini b { color: var(--text); }
.report-tags {
  margin-top: 14px;
  min-height: 44px;
}
.report-packaging {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 18px;
  color: var(--sub);
  font-size: 12px;
}
.report-packaging span {
  background: #f1f5f9;
  border-radius: 999px;
  padding: 5px 10px;
}
.report-open { width: 100%; }
.category-report-modal .report-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 18px;
  align-items: stretch;
  padding: 22px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(14,165,233,.18), transparent 32%),
    linear-gradient(135deg, #f8fbff, #fff);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.category-report-modal .report-hero h2 {
  font-size: 34px;
  margin: 0 0 8px;
}
.category-report-modal .report-hero p {
  margin: 0;
  color: var(--text-2);
  line-height: 1.9;
}
.report-score {
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 18px;
}
.report-score b { font-size: 42px; line-height: 1; }
.report-score span { font-weight: 800; margin-top: 8px; }
.modal-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.report-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}
.report-section {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: #fff;
  margin-bottom: 18px;
}
.report-section h3 {
  margin: 0 0 14px;
  font-size: 18px;
}
.gap-grid {
  display: grid;
  gap: 10px;
}
.gap-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 12px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.gap-item b { font-size: 13px; }
.gap-item span {
  min-width: 34px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fee2e2;
  color: #991b1b;
  font-weight: 900;
}
.gap-item small {
  grid-column: 1 / -1;
  color: var(--sub);
  line-height: 1.7;
}
.table-wrap.embedded {
  box-shadow: none;
  border-radius: 18px;
}
@media (max-width: 1360px) {
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .category-grid,
  .category-report-modal .report-hero,
  .report-metrics,
  .modal-metrics { grid-template-columns: 1fr; }
}
