/* app.css - Gaya Sistem Manajemen Kawasan Terpadu (Antigravity Ops + SIKAP) */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --ink: #0f172a;
  --ink2: #475569;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --ring: rgba(15, 23, 42, 0.08);

  /* Identitas Pengelola: Navy Elegan + Aksen Biru Kawasan */
  --accent: #0f2744;
  --accent-light: #1e3a5f;
  --accent-ink: #ffffff;
  --accent-soft: #e0f2fe;
  --accent-hover: #163b65;
  --brand-blue: #0284c7;

  /* Indikator Status & SLA */
  --good: #059669;
  --good-soft: #d1fae5;
  --good-text: #065f46;
  
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --warn-text: #92400e;
  
  --serious: #ea580c;
  --serious-soft: #ffedd5;
  --serious-text: #9a3412;
  
  --crit: #dc2626;
  --crit-soft: #fee2e2;
  --crit-text: #991b1b;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
}

[data-theme="dark"] {
  --bg: #0b0f17;
  --surface: #131b26;
  --surface2: #1c2738;
  --ink: #f8fafc;
  --ink2: #94a3b8;
  --muted: #64748b;
  --line: #243042;
  --ring: rgba(255, 255, 255, 0.08);

  --accent: #38bdf8;
  --accent-light: #7dd3fc;
  --accent-ink: #0b0f17;
  --accent-soft: #172b42;
  --accent-hover: #0284c7;
  --brand-blue: #38bdf8;

  --good: #10b981;
  --good-soft: #064e3b;
  --good-text: #a7f3d0;

  --warn: #f59e0b;
  --warn-soft: #78350f;
  --warn-text: #fde68a;

  --serious: #f97316;
  --serious-soft: #7c2d12;
  --serious-text: #fed7aa;

  --crit: #ef4444;
  --crit-soft: #7f1d1d;
  --crit-text: #fecaca;

  --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.5);
}

/* RESET & BASE */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}
h1, h2, h3, h4 {
  font-family: "Archivo", "IBM Plex Sans", sans-serif;
  letter-spacing: -0.015em;
  font-weight: 700;
  color: var(--ink);
}
a { color: var(--brand-blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
.mono { font-family: "IBM Plex Mono", monospace; font-size: 0.9em; }
.num { font-variant-numeric: tabular-nums; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 12px; }
.text-center { text-align: center; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.ml-auto { margin-left: auto; }
.my-4 { margin-top: 16px; margin-bottom: 16px; }

/* LAYOUT */
.app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--line);
}
.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: #0f2744;
  color: #38bdf8;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(15, 39, 68, 0.3);
}
.brand-text h2 {
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: 0.02em;
}
.brand-text span {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

/* PERSONA CARD */
.persona-card {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin: 16px 0;
}
.persona-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.persona-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: #ffffff;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 13px;
}
.persona-info b {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.persona-role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 4px;
}
.persona-switcher {
  margin-top: 10px;
  font-size: 11px;
}
.persona-switcher label {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}
.persona-switcher select {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

/* SIDEBAR NAV */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink2);
  font-weight: 500;
  font-size: 13px;
  transition: all 0.15s ease;
  min-height: 44px;
}
.nav-item:hover {
  background: var(--surface2);
  color: var(--ink);
}
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.nav-pill {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface2);
  color: var(--ink2);
  padding: 2px 7px;
  border-radius: 10px;
}
.nav-item.active .nav-pill {
  background: var(--accent);
  color: var(--accent-ink);
}

/* SIDEBAR FOOTER */
.sidebar-footer {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink2);
  font-size: 12px;
  min-height: 40px;
}
.sidebar-btn:hover {
  background: var(--surface2);
  color: var(--ink);
}
.server-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  padding: 0 8px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 2px var(--good-soft);
}

/* MAIN WRAPPER & TOPBAR */
.main-wrapper {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.mobile-only { display: none; }
.page-title-box h1 {
  font-size: 18px;
  line-height: 1.2;
}
.breadcrumbs {
  font-size: 11px;
  color: var(--muted);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
}
.search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  width: 180px;
}
.clock-display {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  min-height: 40px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  min-height: 32px;
}
.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
  min-height: 26px;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: var(--accent-hover);
}
.btn-outline {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.btn-outline:hover {
  background: var(--surface2);
}
.btn-danger {
  background: var(--crit);
  color: #ffffff;
}
.btn-danger:hover {
  background: #b91c1c;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--ink2);
}
.icon-btn:hover {
  background: var(--surface2);
  color: var(--ink);
}

/* CONTENT AREA */
.content-area {
  padding: 24px 28px;
  flex: 1;
}
.view-pane {
  display: none;
}
.view-pane.active {
  display: block;
}

/* KPI GRID */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}
.kpi-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
}
.kpi-blue { background: var(--accent-soft); color: var(--brand-blue); }
.kpi-green { background: var(--good-soft); color: var(--good); }
.kpi-emerald { background: #dcfce7; color: #15803d; }
.kpi-amber { background: var(--warn-soft); color: var(--warn); }
.kpi-red { background: var(--crit-soft); color: var(--crit); }
.kpi-title {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kpi-value {
  font-size: 22px;
  line-height: 1.2;
}
.kpi-subtext {
  display: block;
  font-size: 11px;
  color: var(--ink2);
  margin-top: 2px;
}

/* DASHBOARD GRID & CARDS */
.dashboard-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-header h3 {
  font-size: 15px;
}
.card-header small {
  color: var(--muted);
  font-size: 11px;
}
.card-link {
  font-size: 12px;
  font-weight: 600;
}
.legend-box {
  display: flex;
  gap: 12px;
  font-size: 11px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot-blue { background: #0284c7; }
.dot-green { background: #059669; }
.chart-container {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* TABLES */
.table-wrap {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.data-table th {
  padding: 10px 12px;
  background: var(--surface2);
  color: var(--ink2);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table tr:hover td {
  background: var(--surface2);
}

/* BADGES & PILLS */
.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: capitalize;
}
.badge-baru { background: var(--surface2); color: var(--ink2); border: 1px solid var(--line); }
.badge-ditinjau { background: #e0f2fe; color: #0369a1; }
.badge-dikerjakan { background: #fef3c7; color: #b45309; }
.badge-review { background: #ede9fe; color: #6d28d9; }
.badge-selesai { background: var(--good-soft); color: var(--good-text); }
.badge-revisi { background: #fed7aa; color: #c2410c; }
.badge-ditolak { background: var(--crit-soft); color: var(--crit-text); }

.prio-tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.prio-P1 { background: var(--crit-soft); color: var(--crit-text); }
.prio-P2 { background: var(--serious-soft); color: var(--serious-text); }
.prio-P3 { background: var(--warn-soft); color: var(--warn-text); }
.prio-P4 { background: var(--surface2); color: var(--ink2); }

.badge-outline {
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

/* KANBAN BOARD */
.pane-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.filter-group select, .filter-group input {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  outline: none;
}
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(260px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
}
.kanban-col {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}
.col-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
}
.col-count {
  font-size: 11px;
  font-weight: 700;
  background: var(--surface);
  color: var(--ink2);
  padding: 2px 7px;
  border-radius: 10px;
}
.col-cards {
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

/* TICKET CARD */
.ticket-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ticket-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--brand-blue);
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-id {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}
.card-deliverable {
  font-size: 11px;
  background: var(--surface2);
  padding: 6px 8px;
  border-radius: 4px;
  color: var(--ink2);
  border-left: 3px solid var(--accent);
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 6px;
}

/* SLA BADGES */
.sla-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.sla-aman { background: var(--good-soft); color: var(--good-text); }
.sla-berisiko { background: var(--warn-soft); color: var(--warn-text); }
.sla-lewat { background: var(--crit-soft); color: var(--crit-text); }

/* SLIDE-OVER DRAWER */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
}
.drawer-overlay[hidden] { display: none; }
.drawer-panel {
  background: var(--surface);
  width: 100%;
  max-width: 540px;
  height: 100vh;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.2s ease-out;
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.drawer-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.drawer-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* SLA METER */
.sla-meter-box {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.sla-meter-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 8px;
}
.sla-progress-track {
  width: 100%;
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.sla-progress-bar {
  height: 100%;
  background: var(--brand-blue);
  transition: width 0.3s ease;
}
.sla-time-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

/* DELIVERABLE CALLOUT */
.deliverable-callout {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  gap: 12px;
}
[data-theme="dark"] .deliverable-callout {
  background: #064e3b;
  border-color: #047857;
}
.deliv-icon { color: var(--good); }
.deliv-content b { font-size: 12px; color: var(--good-text); display: block; margin-bottom: 4px; }
.deliv-content p { font-size: 13px; color: var(--ink); }

/* META SECTION */
.meta-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--surface2);
  padding: 12px;
  border-radius: var(--radius);
  font-size: 12px;
}
.meta-item small { color: var(--muted); display: block; }
.pic-assign-wrap { display: flex; gap: 6px; margin-top: 4px; }
.pic-assign-wrap select { font-size: 12px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }

/* ACTION CARDS */
.action-card {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.status-btn-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* RATING CARD */
.confirm-rating-card {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 14px;
}
[data-theme="dark"] .confirm-rating-card {
  background: #451a03;
  border-color: #78350f;
}
.star-rating {
  font-size: 24px;
  color: #d1d5db;
  cursor: pointer;
  margin: 6px 0;
}
.star-rating .star { transition: color 0.1s; }
.star-rating .star.active { color: #f59e0b; }
.confirm-rating-card textarea {
  width: 100%;
  padding: 8px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}

/* TIMELINE */
.history-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
  border-left: 2px solid var(--line);
  padding-left: 14px;
}
.history-item {
  position: relative;
  font-size: 12px;
}
.history-item::before {
  content: "";
  position: absolute;
  left: -19px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-blue);
  border: 2px solid var(--surface);
}
.history-meta {
  font-size: 11px;
  color: var(--muted);
}

/* MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay[hidden] { display: none; }
.modal-dialog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-lg { max-width: 840px; }
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* FORMS */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
}
.form-group input, .form-group select, .form-group textarea {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.required-label::after {
  content: " *";
  color: var(--crit);
}
.form-help {
  font-size: 11px;
  color: var(--muted);
}

/* LEMBAR PARAF (SIKAP CORE) */
.approval-sheet {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
}
.approval-step-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
}
.approval-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 6px;
}
.signature-thumb {
  width: 120px;
  height: 48px;
  object-fit: contain;
  background: #ffffff;
  border: 1px dashed var(--line);
  border-radius: 4px;
}
.signature-canvas-wrap {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  position: relative;
  touch-action: none;
}
.signature-canvas-wrap canvas {
  width: 100%;
  height: 120px;
  display: block;
}

/* TOAST */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--ink);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.2s ease-out;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* DASHBOARD ACTION & REPORT BAR */
.dash-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 12px;
}
.report-filter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}
.report-filter-wrap select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--ink);
  outline: none;
}
.report-btns {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* LIVE SLA PREVIEW IN FORM */
.sla-live-preview {
  background: var(--accent-soft);
  border: 1px solid var(--brand-blue);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--accent);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sla-live-preview b {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-blue);
}

/* MOBILE BOTTOM NAVIGATION */
.mobile-bottom-nav {
  display: none;
}

@keyframes slideInUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* RESPONSIVE & MOBILE PWA ENHANCEMENTS */
@media (max-width: 860px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  .main-wrapper {
    padding-bottom: calc(65px + env(safe-area-inset-bottom));
  }
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 270px;
    transition: left 0.25s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.mobile-open {
    left: 0;
  }
  .mobile-only {
    display: grid;
  }
  .content-area {
    padding: 14px;
  }
  .topbar {
    padding: 10px 14px;
  }
  .search-box {
    display: none;
  }
  .dashboard-grid-2 {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* NATIVE MOBILE BOTTOM NAV BAR */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--line);
    z-index: 85;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  }
  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    min-height: 48px;
    text-decoration: none;
    transition: color 0.15s ease;
  }
  .mobile-nav-item.active {
    color: var(--brand-blue);
    font-weight: 700;
  }
  .mobile-nav-item svg {
    stroke-width: 2.2;
  }

  /* BOTTOM SHEET FOR DRAWER ON MOBILE */
  .drawer-overlay {
    align-items: flex-end;
  }
  .drawer-panel {
    max-width: 100%;
    height: 88vh;
    border-radius: 18px 18px 0 0;
    animation: slideInUp 0.25s ease-out;
  }

  /* MODAL ON MOBILE */
  .modal-dialog {
    max-height: 92vh;
    border-radius: 16px;
    margin: auto 8px;
  }
}

