:root {
  --primary: #00a859;
  --primary-dark: #08783e;
  --primary-soft: #e9f8f0;
  --gold: #d9a928;
  --danger: #d92d20;
  --danger-soft: #fff0ee;
  --warning: #f79009;
  --warning-soft: #fff7e8;
  --info: #1570ef;
  --info-soft: #eff6ff;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #1d2939;
  --muted: #667085;
  --border: #e4e7ec;
  --shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
  --shadow-sm: 0 5px 15px rgba(16, 24, 40, 0.06);
  --radius: 16px;
  --sidebar-width: 270px;
  --topbar-height: 84px;
}

html[data-theme="dark"] {
  --bg: #101418;
  --surface: #171c21;
  --surface-2: #20262c;
  --text: #f2f4f7;
  --muted: #98a2b3;
  --border: #30373e;
  --primary-soft: #123326;
  --danger-soft: #3c1d1a;
  --warning-soft: #3f2c12;
  --info-soft: #152b4c;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  --shadow-sm: 0 5px 15px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(0, 168, 89, 0.22);
  outline-offset: 2px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #08783e 0%, #065c30 100%);
  color: white;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: width .25s ease, transform .25s ease;
}

.sidebar.collapsed {
  width: 86px;
}

.brand {
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.brand-mark {
  width: 45px;
  height: 45px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffd76e, var(--gold));
  color: #5f4700;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
  flex: none;
  font-size: 22px;
}

.brand-copy {
  min-width: 0;
  flex: 1;
}

.brand-copy strong {
  font-family: "Plus Jakarta Sans", sans-serif;
  display: block;
  font-size: 14px;
  letter-spacing: .02em;
}

.brand-copy small {
  color: rgba(255,255,255,.68);
  font-size: 11px;
}

.sidebar .icon-button {
  color: white;
  background: rgba(255,255,255,.1);
}

.nav-list {
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.78);
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  text-align: left;
  transition: .2s ease;
}

.nav-item:hover {
  color: white;
  background: rgba(255,255,255,.08);
}

.nav-item.active {
  background: white;
  color: var(--primary-dark);
  box-shadow: 0 10px 24px rgba(0,0,0,.15);
}

.nav-icon {
  width: 25px;
  text-align: center;
  font-size: 18px;
  flex: none;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
}

.nav-count {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

.nav-item.active .nav-count {
  background: var(--primary-soft);
}

.nav-count.danger {
  background: rgba(217,45,32,.9);
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-radius: 14px;
  background: rgba(255,255,255,.1);
}

.avatar, .top-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f6d775;
  color: #614b00;
  font-weight: 800;
  flex: none;
}

.profile-copy strong,
.profile-copy small,
.profile-copy span {
  display: block;
}

.profile-copy strong {
  font-size: 13px;
}

.profile-copy small {
  margin-top: 2px;
  color: rgba(255,255,255,.7);
  font-size: 11px;
}

.profile-copy span {
  margin-top: 5px;
  color: rgba(255,255,255,.8);
  font-size: 10px;
}

.profile-copy i {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #61e99a;
  border-radius: 50%;
}

.sidebar.collapsed .brand-copy,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-count,
.sidebar.collapsed .profile-copy {
  display: none;
}

.sidebar.collapsed .brand {
  justify-content: center;
  padding-inline: 10px;
  flex-wrap: wrap;
}

.sidebar.collapsed .sidebar-toggle {
  position: absolute;
  top: 70px;
  width: 30px;
  height: 30px;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding-inline: 0;
}

.sidebar.collapsed .profile-card {
  justify-content: center;
  padding: 10px;
}

.main-content {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  transition: margin-left .25s ease, width .25s ease;
}

.sidebar.collapsed + .main-content {
  margin-left: 86px;
  width: calc(100% - 86px);
}

.topbar {
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 12px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h1 {
  margin: 2px 0 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 24px;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 10px;
  letter-spacing: .14em;
  font-weight: 800;
}

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

.compact-field {
  min-width: 140px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.compact-field span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  margin-bottom: 2px;
}

.compact-field select {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: 0;
  font-size: 12px;
  font-weight: 600;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
}

.notification-button {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
}

.notification-button span {
  position: absolute;
  top: -6px;
  right: -4px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  font-size: 9px;
  border: 2px solid var(--surface);
}

.mobile-menu {
  display: none;
}

.page-container {
  position: relative;
  padding: 28px 30px 20px;
  max-width: 1680px;
  margin: 0 auto;
}

.page {
  display: none;
  animation: fade-in .28s ease;
}

.page.active {
  display: block;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: var(--bg);
  padding: 28px 30px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.skeleton {
  height: 160px;
  border-radius: 16px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.1s infinite;
}

.skeleton.large {
  grid-column: 1 / -1;
  height: 220px;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.hero-card {
  min-height: 255px;
  padding: 34px 38px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 20%, rgba(255,255,255,.16), transparent 18%),
    linear-gradient(135deg, #08783e, #00a859);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 20px 45px rgba(0, 117, 62, .22);
  position: relative;
}

.hero-card::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  right: -150px;
  bottom: -260px;
  border: 70px solid rgba(255,255,255,.07);
}

.hero-kicker {
  display: inline-block;
  color: #d7ffe8;
  font-size: 11px;
  letter-spacing: .12em;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero-card h2 {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: clamp(28px, 3vw, 40px);
  margin: 0 0 12px;
}

.hero-card p {
  max-width: 650px;
  color: rgba(255,255,255,.84);
  line-height: 1.65;
  margin: 0;
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.btn {
  border: 0;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 8px 20px rgba(0,168,89,.22);
}

.hero-card .btn.primary {
  background: white;
  color: var(--primary-dark);
  box-shadow: none;
}

.btn.secondary {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
}

.hero-card .btn.secondary {
  color: white;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.12);
}

.btn.ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 50%, var(--border));
}

.hero-visual {
  width: 360px;
  height: 210px;
  position: relative;
  flex: none;
  z-index: 2;
}

.radar-ring {
  position: absolute;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.ring-1 { width: 190px; height: 190px; }
.ring-2 { width: 120px; height: 120px; }

.radar-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62px;
  height: 62px;
  transform: translate(-50%, -50%);
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ffe486, #d9a928);
  color: #6f5200;
  font-size: 27px;
  box-shadow: 0 14px 30px rgba(0,0,0,.2);
}

.floating-stat {
  position: absolute;
  padding: 12px 15px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 14px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
}

.floating-stat strong,
.floating-stat small {
  display: block;
}

.floating-stat strong {
  font-size: 18px;
}

.floating-stat small {
  color: rgba(255,255,255,.72);
  font-size: 10px;
}

.stat-a { left: 5px; top: 25px; }
.stat-b { right: 0; bottom: 18px; }

.kpi-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.kpi-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.kpi-value {
  margin-top: 18px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 27px;
  font-weight: 800;
  white-space: nowrap;
}

.kpi-caption {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.mini-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

.mini-dot.warning { background: var(--warning); }
.mini-dot.danger { background: var(--danger); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.span-2 {
  grid-column: auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.card h3 {
  margin: 5px 0 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 17px;
}

.trend-pill {
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 10px;
  font-weight: 800;
}

.trend-pill.down {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.line-chart {
  height: 240px;
  position: relative;
  padding: 10px 8px 26px 38px;
}

.line-chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-label {
  fill: var(--muted);
  font-size: 10px;
}

.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: url(#areaGradient);
}

.chart-point {
  fill: var(--surface);
  stroke: var(--primary);
  stroke-width: 3;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 18px;
  min-height: 240px;
}

.donut {
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
}

.donut::after {
  content: "";
  position: absolute;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  background: var(--surface);
}

.donut-center {
  z-index: 1;
  text-align: center;
}

.donut-center strong,
.donut-center small {
  display: block;
}

.donut-center strong {
  font-size: 24px;
}

.donut-center small {
  color: var(--muted);
  font-size: 10px;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.legend-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}

.legend-color {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.legend-item span:last-child {
  color: var(--muted);
  font-weight: 700;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  font-size: 12px;
  padding: 0;
}

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

.alert-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.alert-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--warning-soft);
  color: var(--warning);
}

.alert-row.critical .alert-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.alert-copy strong,
.alert-copy small {
  display: block;
}

.alert-copy strong {
  font-size: 12px;
}

.alert-copy small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}

.badge,
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.success,
.status-chip.success {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.badge.warning {
  background: var(--warning-soft);
  color: #a85d00;
}

.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.info {
  background: var(--info-soft);
  color: var(--info);
}

.badge.neutral,
.status-chip.neutral {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 10px;
  position: relative;
}

.timeline-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 15px;
  height: calc(100% + 7px);
  width: 1px;
  background: var(--border);
}

.timeline-item i {
  width: 11px;
  height: 11px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.timeline-item strong,
.timeline-item span {
  display: block;
}

.timeline-item strong {
  font-size: 11px;
}

.timeline-item span {
  color: var(--muted);
  font-size: 9px;
  margin-top: 3px;
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-lead {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}

.toolbar-actions,
.button-row {
  display: flex;
  gap: 9px;
}

.filter-panel {
  margin-bottom: 16px;
  padding: 16px;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(4, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 11px 12px;
  outline: 0;
}

.field textarea {
  resize: vertical;
  line-height: 1.5;
}

.align-end {
  align-self: end;
}

.table-card {
  padding: 0;
  overflow: hidden;
}

.table-card .card-header {
  padding: 20px 20px 0;
}

.table-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
}

.table-scroll {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th {
  padding: 12px 14px;
  text-align: left;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 11px;
}

tr:last-child td {
  border-bottom: 0;
}

.review-cell {
  max-width: 300px;
}

.review-rating {
  color: var(--gold);
  letter-spacing: 1px;
  font-size: 10px;
}

.review-cell strong {
  display: block;
  margin: 4px 0;
  font-size: 11px;
}

.review-cell p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.outlet-cell strong,
.outlet-cell small {
  display: block;
}

.outlet-cell small {
  color: var(--muted);
  margin-top: 4px;
}

.sla-cell {
  min-width: 95px;
}

.sla-bar {
  width: 70px;
  height: 5px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 5px;
}

.sla-fill {
  height: 100%;
  border-radius: 99px;
}

.sla-cell small {
  color: var(--muted);
  font-size: 9px;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.mini-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.mini-button.primary {
  border-color: rgba(0,168,89,.3);
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.empty-state {
  text-align: center;
  padding: 70px 20px;
}

.empty-icon {
  font-size: 40px;
  color: var(--muted);
}

.empty-state h3 {
  margin-bottom: 5px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(230px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.kanban-column {
  min-height: 540px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 12px;
}

.kanban-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 4px 3px 12px;
}

.kanban-header strong {
  font-size: 11px;
}

.kanban-header span {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 9px;
}

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

.ticket-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: .18s ease;
}

.ticket-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0,168,89,.35);
}

.ticket-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ticket-id {
  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
}

.risk-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ticket-card h4 {
  font-size: 11px;
  margin: 10px 0 5px;
}

.ticket-card p {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
  margin: 0 0 10px;
}

.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 11px;
}

.ticket-meta span {
  padding: 4px 6px;
  background: var(--surface-2);
  border-radius: 6px;
  color: var(--muted);
  font-size: 8px;
}

.ticket-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ticket-footer small {
  color: var(--muted);
  font-size: 8px;
}

.pic-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 8px;
  font-weight: 800;
}

.empty-column {
  border: 1px dashed var(--border);
  padding: 25px 10px;
  text-align: center;
  border-radius: 10px;
  color: var(--muted);
  font-size: 9px;
}

.tab-strip {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.tab-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.tab-btn span {
  margin-left: 4px;
  color: inherit;
}

.tab-btn.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: rgba(0,168,89,.25);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.metric-highlight span,
.metric-highlight small,
.metric-highlight strong {
  display: block;
}

.metric-highlight span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.metric-highlight strong {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 25px;
  margin: 12px 0 5px;
}

.metric-highlight small {
  color: var(--primary);
  font-size: 9px;
}

.heatmap {
  overflow: auto;
}

.heatmap-table {
  min-width: 600px;
  display: grid;
  grid-template-columns: 150px repeat(5, 1fr);
  gap: 5px;
}

.heatmap-cell {
  min-height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
}

.heatmap-cell.label {
  justify-items: start;
  padding-left: 9px;
  color: var(--muted);
  background: var(--surface-2);
}

.heatmap-cell.level-1 { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary-dark); }
.heatmap-cell.level-2 { background: color-mix(in srgb, var(--primary) 28%, var(--surface)); color: var(--primary-dark); }
.heatmap-cell.level-3 { background: color-mix(in srgb, var(--primary) 48%, var(--surface)); color: #04592f; }
.heatmap-cell.level-4 { background: color-mix(in srgb, var(--primary) 72%, var(--surface)); color: white; }

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 35px;
  align-items: center;
  gap: 8px;
  font-size: 9px;
}

.bar-track {
  height: 9px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  border-radius: inherit;
}

.comparison-summary {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.group-card {
  border-radius: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.group-card.implementation {
  background: linear-gradient(135deg, var(--primary-soft), var(--surface));
  border-color: rgba(0,168,89,.25);
}

.group-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.group-card strong {
  display: block;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 25px;
  margin-top: 10px;
}

.group-card p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.versus {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--text);
  color: var(--surface);
  font-weight: 800;
  font-size: 11px;
}

.comparison-table td:nth-child(2),
.comparison-table td:nth-child(3) {
  font-weight: 700;
}

.insight-banner {
  margin-top: 18px;
  border-radius: 18px;
  padding: 22px;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #08783e, #00a859);
  color: white;
}

.insight-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.14);
  font-size: 24px;
}

.insight-banner span {
  font-size: 10px;
  color: #d6ffe7;
}

.insight-banner h3 {
  margin: 4px 0;
  font-size: 16px;
}

.insight-banner p {
  color: rgba(255,255,255,.76);
  font-size: 10px;
  margin: 0;
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.report-stat {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 15px;
}

.report-stat span,
.report-stat strong {
  display: block;
}

.report-stat span {
  color: var(--muted);
  font-size: 9px;
}

.report-stat strong {
  margin-top: 8px;
  font-size: 20px;
}

.budget-progress {
  margin: 28px 0 20px;
}

.progress-track {
  height: 13px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
}

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

.budget-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.budget-row span {
  font-size: 10px;
}

.budget-row small {
  color: var(--muted);
}

.decision-card {
  text-align: center;
  padding: 10px;
}

.decision-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  border-radius: 18px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 25px;
  font-weight: 800;
}

.decision-card > span {
  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.decision-card p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.check-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
}

.check-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 800;
}

.check-item.warning .check-icon {
  background: var(--warning-soft);
  color: var(--warning);
}

.check-item strong,
.check-item small {
  display: block;
}

.check-item strong {
  font-size: 10px;
}

.check-item small {
  color: var(--muted);
  font-size: 8px;
  margin-top: 4px;
}

.disclaimer-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 14px;
  border-left: 4px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 10%, var(--surface));
}

.disclaimer-card strong {
  font-size: 11px;
}

.disclaimer-card p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  margin-bottom: 0;
}

.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.settings-link {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 10px;
  padding: 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
}

.settings-link.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: rgba(0,168,89,.25);
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
}

.category-list,
.policy-list,
.template-list,
.role-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-row,
.policy-list > div {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

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

.category-icon,
.role-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 9px;
  font-weight: 800;
}

.category-row small,
.policy-list span {
  color: var(--muted);
  font-size: 9px;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.matrix-grid > div {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.matrix-grid span {
  color: var(--primary);
  font-weight: 800;
  font-size: 10px;
}

.matrix-grid p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  margin-bottom: 0;
}

.template-list article {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
}

.template-list strong {
  font-size: 11px;
}

.template-list p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.role-list > div {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 2px 10px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.role-list strong {
  font-size: 10px;
}

.role-list small {
  grid-column: 2;
  color: var(--muted);
  font-size: 9px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  color: var(--muted);
  font-size: 9px;
  margin-top: 24px;
  padding: 12px 2px 0;
}

/* DRAWER & MODALS */
.backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .58);
  backdrop-filter: blur(3px);
  z-index: 80;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 100%);
  background: var(--surface);
  z-index: 90;
  transform: translateX(102%);
  transition: transform .25s ease;
  box-shadow: -20px 0 50px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
}

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

.drawer-header,
.modal-header {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-header h2,
.modal-header h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.drawer-content {
  overflow-y: auto;
  padding: 22px;
}

.review-quote {
  padding: 18px;
  border-radius: 14px;
  background: var(--surface-2);
  border-left: 4px solid var(--gold);
  font-size: 13px;
  line-height: 1.65;
}

.review-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.meta-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px;
}

.meta-card span,
.meta-card strong {
  display: block;
}

.meta-card span {
  color: var(--muted);
  font-size: 9px;
}

.meta-card strong {
  font-size: 11px;
  margin-top: 4px;
}

.repeat-alert {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 13px;
  margin-bottom: 16px;
  border-radius: 11px;
  background: var(--warning-soft);
  color: #8b5200;
}

.repeat-alert p {
  margin: 4px 0 0;
  font-size: 9px;
}

.drawer-content .field {
  margin-top: 14px;
}

.drawer-actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-backdrop {
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal {
  width: min(760px, 100%);
  max-height: 94vh;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 25px 65px rgba(0,0,0,.24);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.large-modal {
  width: min(920px, 100%);
}

.small-modal {
  width: min(510px, 100%);
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.privacy-checklist {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.privacy-checklist strong {
  font-size: 11px;
  margin-bottom: 3px;
}

.privacy-checklist label {
  font-size: 10px;
  color: var(--muted);
}

.form-error {
  margin-top: 12px;
  padding: 10px;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 10px;
  font-weight: 700;
}

.ticket-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 22px 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.ticket-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 2px solid transparent;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.ticket-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.ticket-panel {
  display: none;
}

.ticket-panel.active {
  display: block;
}

.ticket-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.summary-box {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.summary-box span,
.summary-box strong {
  display: block;
}

.summary-box span {
  color: var(--muted);
  font-size: 9px;
}

.summary-box strong {
  margin-top: 4px;
  font-size: 10px;
}

.ticket-description {
  margin-top: 14px;
  padding: 15px;
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
  border-radius: 10px;
  font-size: 10px;
  line-height: 1.6;
}

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

.action-checklist label {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 11px;
}

.upload-zone {
  min-height: 220px;
  border: 2px dashed var(--border);
  border-radius: 14px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: 25px;
}

.upload-zone.dragging {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.upload-icon {
  font-size: 32px;
  color: var(--primary);
}

.upload-zone p {
  color: var(--muted);
  font-size: 10px;
}

.file-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-row {
  padding: 10px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 9px;
}

.status-select {
  margin-right: auto;
}

.status-select span {
  color: var(--muted);
  font-size: 9px;
  margin-right: 5px;
}

.status-select select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 8px;
  font-size: 9px;
}

.toast-container {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  z-index: 200;
}

.toast {
  min-width: 260px;
  max-width: 390px;
  padding: 13px 15px;
  border-radius: 12px;
  background: #101828;
  color: white;
  box-shadow: 0 15px 35px rgba(0,0,0,.25);
  font-size: 11px;
  animation: toast-in .25s ease;
}

.toast.success {
  border-left: 4px solid #32d583;
}

.toast.warning {
  border-left: 4px solid var(--warning);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1250px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .report-stats { grid-template-columns: repeat(3, 1fr); }
  .filter-grid { grid-template-columns: 2fr repeat(2, 1fr); }
  .filter-grid .align-end { align-self: stretch; }
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }

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

  .sidebar.collapsed {
    width: var(--sidebar-width);
  }

  .sidebar.collapsed .brand-copy,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .nav-count,
  .sidebar.collapsed .profile-copy {
    display: block;
  }

  .sidebar.collapsed .nav-item {
    justify-content: flex-start;
    padding-inline: 13px;
  }

  .sidebar.collapsed .brand {
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  .sidebar.collapsed .sidebar-toggle {
    position: static;
    width: 40px;
    height: 40px;
  }

  .main-content,
  .sidebar.collapsed + .main-content {
    margin-left: 0;
    width: 100%;
  }

  .mobile-menu { display: grid; float: left; margin-right: 12px; }
  .desktop-only { display: none; }
  .hero-visual { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; overflow-x: auto; }
  .settings-link { white-space: nowrap; }
}

@media (max-width: 720px) {
  .topbar { padding-inline: 16px; }
  .topbar-actions .compact-field { display: none; }
  .page-container { padding: 20px 14px; }
  .hero-card { padding: 26px 22px; min-height: 240px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .kpi-grid,
  .report-stats,
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-grid { grid-template-columns: 1fr; }
  .section-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .btn { flex: 1; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .comparison-summary { grid-template-columns: 1fr; }
  .versus { margin: auto; }
  .insight-banner { grid-template-columns: 45px 1fr; }
  .insight-banner .status-chip { grid-column: 1 / -1; justify-self: start; }
  .checklist-grid { grid-template-columns: 1fr; }
  .matrix-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .ticket-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-footer { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .kpi-grid,
  .report-stats,
  .analytics-grid { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 19px; }
  .hero-card h2 { font-size: 27px; }
  .top-avatar { display: none; }
  .review-meta-grid,
  .ticket-summary-grid { grid-template-columns: 1fr; }
}
