/* ─── TSR Marine — Design System v2 ──────────────────────────────────────── */
:root {
  --sidebar-bg: #0d1b2a;
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 64px;
  --sidebar-text: #8fa3b8;
  --sidebar-text-hover: #e2e8f0;
  --sidebar-active-bg: rgba(59,130,246,0.15);
  --sidebar-active-color: #60a5fa;
  --sidebar-border: rgba(255,255,255,0.06);

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;

  --success: #22c55e;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --info: #3b82f6;
  --info-bg: #eff6ff;
  --purple: #8b5cf6;
  --purple-bg: #f5f3ff;
  --orange: #f97316;
  --orange-bg: #fff7ed;

  --header-height: 64px;
  --bg-main: #f1f5f9;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --transition: 0.2s ease;
}

/* ─── Dark Mode ─── */
body.dark {
  --bg-main: #0f172a;
  --card-bg: #1e293b;
  --border: #334155;
  --border-light: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --primary-light: #1e3a5f;
  --success-bg: #052e16;
  --warning-bg: #1c1209;
  --danger-bg: #1c0a0a;
  --info-bg: #0c1a2e;
  --purple-bg: #1a0f2e;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
}
body.dark .main-header { background: #1e293b; border-bottom-color: #334155; }
body.dark .header-search { background: #0f172a; border-color: #334155; }
body.dark .header-search input { background: transparent; color: #f1f5f9; }
body.dark .header-btn { color: #94a3b8; }
body.dark .header-btn:hover { background: #334155; color: #f1f5f9; }
body.dark .data-table thead { background: #0f172a; }
body.dark .data-table tbody tr:hover { background: #334155; }
body.dark .data-table tbody tr.selected { background: rgba(37,99,235,.2); }
body.dark .modal { background: #1e293b; }
body.dark .modal-header { border-bottom-color: #334155; }
body.dark .modal-footer { background: #0f172a; border-top-color: #334155; }
body.dark .form-control { background: #0f172a; border-color: #334155; color: #f1f5f9; }
body.dark .form-control:focus { border-color: var(--primary); }
body.dark .btn-outline { background: #1e293b; color: #94a3b8; border-color: #334155; }
body.dark .btn-outline:hover { background: #334155; color: #f1f5f9; }
body.dark .card { background: #1e293b; border-color: #334155; }
body.dark .filter-bar { background: #1e293b; border-color: #334155; }
body.dark select.form-control option { background: #1e293b; }
body.dark .detail-panel, body.dark .list-panel { background: #1e293b; }
body.dark .panel-header { background: #0f172a; border-bottom-color: #334155; }
body.dark .tab-btn { color: #94a3b8; }
body.dark .tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
body.dark .action-dropdown { background: #1e293b; border-color: #334155; }
body.dark .action-dropdown-item:hover { background: #334155; }
body.dark .kpi-card { background: #1e293b; border-color: #334155; }
body.dark .reminder-item { background: #1e293b; }
body.dark .reminder-item:hover { background: #334155; }
body.dark .reminder-group { border-color: #334155; }
body.dark .reminder-group-header { background: #0f172a; }
body.dark .msg-layout { background: #1e293b; border-color: #334155; }
body.dark .msg-sidebar { background: #0f172a; border-right-color: #334155; }
body.dark .msg-tab.active { background: #1e293b; }
body.dark .msg-item { border-bottom-color: #334155; }
body.dark .msg-item:hover { background: #334155; }
body.dark .msg-item.unread { background: rgba(37,99,235,.08); }
body.dark .settings-tab { color: #64748b; }
body.dark .settings-tab.active { color: var(--primary); }

/* ─── Multi-Select ─── */
.ms-wrap { position: relative; }
.ms-trigger {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card-bg); cursor: pointer; font-size: 13px; color: var(--text-muted);
  min-height: 36px; transition: border-color var(--transition);
}
.ms-wrap.open .ms-trigger, .ms-trigger:hover { border-color: var(--primary); }
.ms-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-label.ms-has-val { color: var(--text-primary); }
.ms-arrow { font-size: 10px; color: var(--text-muted); flex-shrink: 0; transition: transform var(--transition); }
.ms-wrap.open .ms-arrow { transform: rotate(180deg); }
.ms-dropdown {
  position: absolute; z-index: 999; top: calc(100% + 3px); left: 0; right: 0;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); max-height: 220px; overflow-y: auto;
}
.ms-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; cursor: pointer; font-size: 12px; color: var(--text-primary);
}
.ms-item:hover { background: var(--primary-light); }
.ms-item input[type=checkbox] { accent-color: var(--primary); flex-shrink: 0; }
body.dark .ms-trigger { background: #0f172a; border-color: #334155; }
body.dark .ms-dropdown { background: #1e293b; border-color: #334155; }
body.dark .ms-item:hover { background: #334155; }

.rp-checklist {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card-bg); padding: 6px 4px;
  display: flex; flex-wrap: wrap; gap: 2px;
}
.rp-item {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 10px; cursor: pointer; font-size: 12px;
  color: var(--text-primary); border-radius: 4px;
  width: calc(50% - 4px); box-sizing: border-box;
}
.rp-item:hover { background: var(--primary-light); }
.rp-item input[type=checkbox] { accent-color: var(--primary); flex-shrink: 0; }
body.dark .rp-checklist { background: #0f172a; border-color: #334155; }
body.dark .rp-item:hover { background: #334155; }

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 1000;
  transition: width var(--transition);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed-width); }

.sidebar-header {
  padding: 18px 14px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 8px;
  padding: 7px 10px;
}
.sidebar-logo-img {
  max-width: 148px;
  max-height: 46px;
  width: 100%;
  object-fit: contain;
}
.sidebar.collapsed .sidebar-logo { padding: 5px; }
.sidebar.collapsed .sidebar-logo-img { max-width: 32px; max-height: 32px; }
.sidebar-powered {
  font-size: 9px;
  color: #fff;
  text-align: center;
  padding: 4px 8px 8px;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  font-weight: 700;
  letter-spacing: 0.6px;
}
.sidebar.collapsed .sidebar-powered { display: none; }
.logo-title { font-size: 14px; font-weight: 700; color: #fff; letter-spacing: 0.5px; white-space: nowrap; display: block; }
.logo-subtitle { font-size: 10px; color: var(--sidebar-text); white-space: nowrap; display: block; line-height: 1.4; }

.sidebar-nav { flex: 1; padding: 10px 8px; overflow-y: auto; overflow-x: hidden; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 2px;
  white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--sidebar-text-hover); }
.nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-color); }
.nav-item .ni { width: 18px; text-align: center; flex-shrink: 0; font-size: 14px; }
.nav-label { overflow: hidden; flex: 1; }
.nav-badge {
  background: var(--danger); color: white;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; flex-shrink: 0;
}

.sidebar.collapsed .nav-item { justify-content: center; gap: 0; padding: 10px; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .sidebar-logo-text { display: none; }

.sidebar-user {
  padding: 10px 8px;
  border-top: 1px solid var(--sidebar-border);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: white; flex-shrink: 0;
  text-transform: uppercase;
}
.user-info { flex: 1; overflow: hidden; }
.user-name { display: block; color: #e2e8f0; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; color: var(--sidebar-text); font-size: 10px; text-transform: capitalize; }
.btn-logout {
  color: var(--sidebar-text); padding: 6px; border-radius: 6px;
  transition: all var(--transition); flex-shrink: 0;
}
.btn-logout:hover { color: var(--danger); background: rgba(239,68,68,0.1); }
.sidebar.collapsed .user-info { display: none; }

/* ─── Main Wrapper ─── */
.main-wrapper {
  flex: 1; margin-left: var(--sidebar-width);
  display: flex; flex-direction: column; min-height: 100vh;
  transition: margin-left var(--transition);
  overflow-x: hidden;
}
.main-wrapper.sidebar-collapsed { margin-left: var(--sidebar-collapsed-width); }

/* ─── Header ─── */
.main-header {
  height: var(--header-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
}
.hamburger-btn {
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; padding: 7px; border-radius: var(--radius);
  font-size: 16px; transition: all var(--transition); flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--bg-main); color: var(--text-primary); }
.header-search {
  flex: 1; max-width: 460px;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-main); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 7px 12px;
}
.header-search i { color: var(--text-muted); font-size: 12px; }
.header-search input {
  border: none; background: transparent; outline: none;
  width: 100%; font-size: 13px; color: var(--text-primary); font-family: var(--font);
}
.header-search input::placeholder { color: var(--text-muted); }
.header-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.header-btn {
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; padding: 7px; border-radius: var(--radius);
  font-size: 15px; transition: all var(--transition);
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
}
.header-btn:hover { background: var(--bg-main); color: var(--text-primary); }
.header-btn .hbadge {
  position: absolute; top: 1px; right: 1px;
  background: var(--danger); color: white;
  font-size: 9px; font-weight: 700;
  min-width: 15px; height: 15px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

/* ─── Page Content ─── */
.page-content { flex: 1; padding: 24px; }

/* ─── Page Header ─── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-muted); margin-bottom: 4px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.page-title { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.page-subtitle { font-size: 12px; color: var(--text-muted); }
.page-header-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px;
}
.page-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-top: 2px; }

/* ─── KPI Cards ─── */
.kpi-row {
  display: flex; flex-wrap: wrap;
  gap: 12px; margin-bottom: 18px;
}
.kpi-card {
  flex: 0 0 auto;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: all var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow-md); border-color: #cbd5e1; }
.kpi-icon {
  width: 42px; height: 42px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.kpi-icon.blue { background: #dbeafe; color: #2563eb; }
.kpi-icon.green { background: #dcfce7; color: #16a34a; }
.kpi-icon.orange { background: #ffedd5; color: #ea580c; }
.kpi-icon.red { background: #fee2e2; color: #dc2626; }
.kpi-icon.purple { background: #ede9fe; color: #7c3aed; }
.kpi-icon.gray { background: #f8fafc; color: #64748b; }
.kpi-icon.yellow { background: #fef9c3; color: #ca8a04; }
.kpi-icon.teal { background: #ccfbf1; color: #0d9488; }
.kpi-value { font-size: 20px; font-weight: 700; line-height: 1; margin-bottom: 2px; }
.kpi-value.blue { color: #2563eb; }
.kpi-value.green { color: #16a34a; }
.kpi-value.orange { color: #ea580c; }
.kpi-value.red { color: #dc2626; }
.kpi-value.purple { color: #7c3aed; }
.kpi-value.yellow { color: #ca8a04; }
.kpi-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.kpi-sub { font-size: 10px; color: var(--text-muted); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition); line-height: 1; font-family: var(--font);
}
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-outline { background: white; color: var(--text-secondary); border-color: var(--border); }
.btn-outline:hover { background: var(--bg-main); color: var(--text-primary); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: white; }
.btn-ghost { background: none; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-main); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px; border-radius: 6px; width: 30px; height: 30px; justify-content: center; }
.btn:disabled, .btn[disabled] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ─── Unsaved Changes Badge ─── */
.unsaved-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #d97706;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: 20px;
  padding: 3px 10px;
  margin-left: auto;
  animation: pulse-badge 2s ease-in-out infinite;
}
.unsaved-badge .fas { font-size: 7px; }
@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
body.dark .unsaved-badge {
  color: #fbbf24;
  background: rgba(245,158,11,0.18);
  border-color: rgba(245,158,11,0.4);
}

/* ─── Filter Bar ─── */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px 18px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 14px;
}
.filter-search {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-main); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 10px; min-width: 180px;
}
.filter-search i { color: var(--text-muted); font-size: 11px; }
.filter-search input {
  border: none; background: transparent; outline: none;
  font-size: 12px; color: var(--text-primary); font-family: var(--font); width: 100%;
}
.filter-search input::placeholder { color: var(--text-muted); }
.filter-select {
  background: var(--bg-main); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 26px 6px 10px;
  font-size: 12px; color: var(--text-primary); font-family: var(--font);
  cursor: pointer; outline: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.filter-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg-main);
  color: var(--text-secondary); font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: var(--font); transition: all var(--transition);
}
.filter-btn:hover { border-color: #94a3b8; color: var(--text-primary); }
.filter-spacer { flex: 1; }

/* ─── Tabs ─── */
.tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border); margin-bottom: 14px;
}
.tab-item {
  padding: 9px 16px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all var(--transition); white-space: nowrap;
}
.tab-item:hover { color: var(--text-primary); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ─── Table ─── */
.table-wrapper {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  padding: 9px 14px; text-align: left;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border); background: #fafbfc; white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border-light); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; cursor: pointer; }
tbody tr.selected { background: #eff6ff; }
tbody td { padding: 10px 14px; vertical-align: middle; }
.table-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-top: 1px solid var(--border-light);
  font-size: 12px; color: var(--text-muted);
}

/* ─── Pagination ─── */
.pagination { display: flex; align-items: center; gap: 3px; }
.page-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; cursor: pointer; color: var(--text-secondary);
  background: var(--card-bg); transition: all var(--transition); font-family: var(--font);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn.disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Status Badges ─── */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef9c3; color: #a16207; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }

.entity-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
}
.entity-badge.vessel { background: #dbeafe; color: #1d4ed8; }
.entity-badge.company { background: #fce7f3; color: #9d174d; }
.entity-badge.provider { background: #dcfce7; color: #065f46; }

.days-left { font-weight: 600; font-size: 12px; }
.days-left.ok { color: var(--text-secondary); }
.days-left.soon { color: var(--warning); }
.days-left.danger { color: var(--danger); }

/* ─── Right Detail Panel ─── */
.content-with-panel { display: flex; gap: 14px; align-items: flex-start; }
.content-main { flex: 1; min-width: 0; }
.detail-panel {
  width: 300px; flex-shrink: 0;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); display: none; flex-direction: column;
  max-height: calc(100vh - 110px); position: sticky; top: 78px; overflow: hidden;
}
.detail-panel.open { display: flex; }
.detail-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border-light); flex-shrink: 0;
}
.detail-panel-title { font-size: 13px; font-weight: 600; }
.detail-panel-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 13px; padding: 3px; border-radius: 4px;
}
.detail-panel-close:hover { background: var(--bg-main); color: var(--text-primary); }
.detail-panel-tabs {
  display: flex; border-bottom: 1px solid var(--border-light);
  flex-shrink: 0; padding: 0 6px; overflow-x: auto;
}
.detail-tab {
  padding: 7px 10px; font-size: 11px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all var(--transition); white-space: nowrap;
}
.detail-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.detail-panel-body { flex: 1; overflow-y: auto; padding: 14px; }
.detail-panel-footer {
  padding: 10px 14px; border-top: 1px solid var(--border-light);
  display: flex; gap: 8px; flex-shrink: 0;
}
.detail-panel-footer .btn { flex: 1; justify-content: center; font-size: 12px; }

.detail-field { margin-bottom: 10px; }
.detail-label { font-size: 10px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.3px; margin-bottom: 2px; }
.detail-value { font-size: 12px; color: var(--text-primary); }
.detail-section { margin-bottom: 14px; }
.detail-section-title {
  font-size: 11px; font-weight: 700; color: var(--text-secondary);
  margin-bottom: 8px; letter-spacing: 0.3px;
  display: flex; align-items: center; justify-content: space-between;
}
.detail-mini-link { font-size: 11px; color: var(--primary); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* Mini table in panel */
.mini-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.mini-table th { padding: 5px 6px; text-align: left; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border-light); }
.mini-table td { padding: 6px 6px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.mini-table tr:last-child td { border-bottom: none; }

/* ─── Timeline ─── */
.timeline { }
.timeline-item { display: flex; gap: 10px; padding-bottom: 14px; position: relative; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0; margin-top: 3px; position: relative; z-index: 1;
}
.timeline-dot.green { background: var(--success); }
.timeline-dot.blue { background: var(--info); }
.timeline-dot.gray { background: white; border: 2px solid #cbd5e1; }
.timeline-dot.orange { background: var(--warning); }
.timeline-line {
  position: absolute; left: 4px; top: 14px; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-content { flex: 1; }
.timeline-title { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.timeline-sub { font-size: 11px; color: var(--text-muted); }
.timeline-right { font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* ─── Flash Messages ─── */
.flash-container { padding: 12px 24px 0; }
.flash {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: var(--radius);
  font-size: 13px; margin-bottom: 6px;
}
.flash button { background: none; border: none; cursor: pointer; margin-left: auto; padding: 2px; opacity: 0.6; }
.flash button:hover { opacity: 1; }
.flash-success { background: var(--success-bg); color: #166534; border: 1px solid var(--success-border); }
.flash-danger { background: var(--danger-bg); color: #991b1b; border: 1px solid var(--danger-border); }
.flash-warning { background: var(--warning-bg); color: #92400e; border: 1px solid var(--warning-border); }
.flash-info { background: var(--info-bg); color: #1e40af; border: 1px solid #bfdbfe; }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 2000; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-overlay.active { display: flex; }
.modal {
  background: var(--card-bg); border-radius: var(--radius-xl);
  width: 100%; max-width: 560px; max-height: 90vh;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.modal > form {
  display: flex; flex-direction: column; flex: 1; overflow: hidden; min-height: 0;
}
.modal-lg { max-width: 700px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px; padding: 3px; border-radius: 4px;
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-main); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 12px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end; flex-shrink: 0;
}

/* ─── Forms ─── */
.form-row { display: grid; gap: 12px; margin-bottom: 12px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.form-control {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; font-family: var(--font); color: var(--text-primary);
  background: var(--card-bg); outline: none; transition: border-color var(--transition); width: 100%;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,0.08); }
textarea.form-control { resize: vertical; min-height: 70px; }

/* ─── Cards ─── */
.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border-light);
}
.card-title { font-size: 13px; font-weight: 600; }
.card-body { padding: 18px; }

/* ─── Dashboard ─── */
.dashboard-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 14px;
}
.dashboard-grid .span-2 { grid-column: span 2; }

.activity-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}
.activity-text { flex: 1; font-size: 12px; color: var(--text-primary); line-height: 1.4; }
.activity-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.quick-actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-action {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px; border: 1px solid var(--border);
  border-radius: var(--radius-lg); cursor: pointer;
  transition: all var(--transition);
}
.quick-action:hover { border-color: var(--primary); background: var(--primary-light); }
.quick-action-icon {
  width: 34px; height: 34px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.quick-action-label { font-size: 10px; font-weight: 500; color: var(--text-secondary); text-align: center; line-height: 1.3; }

.upcoming-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--border-light);
}
.upcoming-item:last-child { border-bottom: none; }
.upcoming-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.upcoming-info { flex: 1; }
.upcoming-name { font-size: 12px; font-weight: 500; line-height: 1.3; }
.upcoming-vessel { font-size: 11px; color: var(--text-muted); }
.upcoming-date-col { text-align: right; flex-shrink: 0; }
.upcoming-date { font-size: 11px; color: var(--text-secondary); }
.upcoming-days { font-size: 11px; font-weight: 600; }

.bar-rank-item { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.bar-rank { font-size: 11px; color: var(--text-muted); width: 14px; text-align: right; flex-shrink: 0; }
.bar-label { font-size: 12px; color: var(--text-secondary); width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.bar-track { flex: 1; background: #f1f5f9; border-radius: 4px; height: 6px; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 4px; }
.bar-count { font-size: 12px; font-weight: 600; color: var(--text-secondary); width: 18px; text-align: right; flex-shrink: 0; }

/* Overview sidebar for pages */
.page-with-overview { display: flex; gap: 14px; align-items: flex-start; }
.page-overview-area { flex: 1; min-width: 0; }
.overview-sidebar { width: 240px; flex-shrink: 0; }
.overview-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px; margin-bottom: 14px;
}
.overview-title { font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 10px; letter-spacing: 0.3px; }
.overview-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 0; font-size: 12px; border-bottom: 1px solid var(--border-light);
}
.overview-row:last-child { border-bottom: none; }
.overview-row-label { color: var(--text-secondary); display: flex; align-items: center; gap: 5px; }
.overview-row-value { font-weight: 600; color: var(--text-primary); }

/* ─── Reminder Groups ─── */
.reminder-group { margin-bottom: 18px; }
.reminder-group-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.reminder-group-title {
  font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px;
  letter-spacing: 0.5px;
}
.reminder-group-title.overdue { color: var(--danger); }
.reminder-group-title.soon30 { color: var(--warning); }
.reminder-group-title.soon90 { color: var(--info); }
.reminder-group-title.future { color: var(--success); }

/* Mini calendar */
.mini-calendar { }
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.calendar-title { font-size: 12px; font-weight: 600; }
.calendar-nav { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 3px; border-radius: 4px; }
.calendar-nav:hover { color: var(--text-primary); background: var(--bg-main); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.cal-day-header { text-align: center; padding: 3px; color: var(--text-muted); font-size: 10px; font-weight: 600; }
.cal-day {
  text-align: center; padding: 4px 2px; border-radius: 4px;
  color: var(--text-secondary); cursor: pointer; font-size: 11px;
}
.cal-day:hover { background: var(--primary-light); color: var(--primary); }
.cal-day.today { background: var(--primary); color: white; font-weight: 700; }
.cal-day.other-month { color: var(--text-muted); }

/* ─── Reports ─── */
.report-type-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 12px;
  border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; cursor: pointer; font-size: 13px;
  font-family: var(--font); color: var(--text-secondary);
  margin-bottom: 3px; transition: all var(--transition); text-align: left;
}
.report-type-btn:hover { background: var(--bg-main); color: var(--text-primary); }
.report-type-btn.active { background: var(--primary-light); color: var(--primary); border-color: #bfdbfe; font-weight: 500; }

/* ─── Settings ─── */
.settings-layout { display: flex; gap: 14px; }
.settings-sidebar {
  width: 190px; flex-shrink: 0;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 8px; align-self: flex-start;
}
.settings-nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition); margin-bottom: 2px;
}
.settings-nav-item:hover { background: var(--bg-main); color: var(--text-primary); }
.settings-nav-item.active { background: var(--primary-light); color: var(--primary); }
.settings-content { flex: 1; }

/* ─── Cert Picker ─── */
.cert-picker-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.5);
  z-index: 3000; display: none; align-items: flex-start;
  justify-content: center; padding: 50px 20px 20px;
}
.cert-picker-overlay.open { display: flex; }
.cert-picker-box {
  background: var(--card-bg); border-radius: var(--radius-xl);
  width: 100%; max-width: 660px; max-height: 80vh;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.cert-picker-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.cert-picker-search { padding: 10px 14px; flex-shrink: 0; }
.cert-picker-body { overflow-y: auto; padding: 0 14px 14px; }
.cert-picker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.cert-check-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: all var(--transition); font-size: 12px;
}
.cert-check-item:hover { border-color: var(--primary); background: var(--primary-light); }
.cert-check-item.checked { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 500; }
.cert-picker-footer {
  padding: 10px 14px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; flex-shrink: 0;
}
.cert-display-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; min-height: 24px; }
.cert-tag {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--primary-light); color: var(--primary);
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 500;
  cursor: pointer;
}
.cert-tag:hover { background: #bfdbfe; }

/* Action menu */
.action-menu { position: relative; display: inline-block; }
.action-dots, .action-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 3px 8px; border-radius: 4px; font-size: 14px;
}
.action-dots:hover, .action-btn:hover { background: var(--bg-main); color: var(--text-primary); }
.action-dropdown {
  position: absolute; right: 0; top: 100%;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  min-width: 130px; z-index: 3000; display: none;
}
.action-dropdown.open { display: block; }
.action-dropdown-item {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 12px; font-size: 12px; color: var(--text-secondary);
  cursor: pointer; border: none; background: none;
  width: 100%; text-align: left; font-family: var(--font); transition: background var(--transition);
}
.action-dropdown-item:hover { background: var(--bg-main); color: var(--text-primary); }
.action-dropdown-item.danger { color: var(--danger); }
.action-dropdown-item.danger:hover { background: var(--danger-bg); }

/* Login */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0d1b2a 0%, #1e3a5f 100%);
}
.login-card {
  background: var(--card-bg); border-radius: var(--radius-xl);
  padding: 36px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg);
}
.login-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 24px; justify-content: center;
}
.login-logo { display: flex; justify-content: center; margin-bottom: 4px; }
.login-logo-img { max-width: 220px; max-height: 70px; object-fit: contain; }
.login-logo .anchor-icon { width: 40px; height: 40px; border-radius: 10px; font-size: 18px; }
.login-logo-text .logo-title { font-size: 16px; color: var(--text-primary); }
.login-logo-text .logo-subtitle { font-size: 11px; }
.login-title { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.login-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 22px; }

/* Empty state */
.empty-state { text-align: center; padding: 36px 20px; color: var(--text-muted); }
.empty-state i { font-size: 36px; margin-bottom: 10px; opacity: 0.3; display: block; }
.empty-state p { font-size: 13px; }

/* Separator */
.sep { height: 1px; background: var(--border-light); margin: 12px 0; }

/* ─── Compatibility Layer (v2 template naming) ──────────────────────────── */

/* CSS variable aliases */
:root {
  --bg-card: var(--card-bg);
  --bg-secondary: var(--bg-main);
  --bg-hover: #f8fafc;
  --text: var(--text-primary);
}

/* Layout aliases */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 1rem; flex-wrap: wrap; }
.page-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.header-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* Content split layout (list + right panel) */
.content-area { display: flex; gap: 0; min-height: 0; }
.list-panel { flex: 1; min-width: 0; transition: all .2s; }
.list-panel.has-panel { flex: 0 0 55%; }
.detail-panel { display: none; flex-direction: column; width: 380px; flex-shrink: 0; border-left: 1px solid var(--border); background: var(--card-bg); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.detail-panel.open { display: flex; }

/* Panel inner */
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.panel-title { font-weight: 600; font-size: 13px; }
.panel-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 14px; padding: 4px; border-radius: 4px; }
.panel-close:hover { background: var(--bg-main); color: var(--text-primary); }
.panel-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 14px; }
.tab-btn { background: none; border: none; padding: 8px 12px; cursor: pointer; font-size: 12px; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.panel-body { flex: 1; overflow-y: auto; padding: 14px; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.panel-placeholder { color: var(--text-muted); font-size: 12px; text-align: center; padding: 2rem 0; }

/* Detail rows */
.detail-section { display: flex; flex-direction: column; gap: 0; }
.detail-row { display: flex; padding: 6px 0; border-bottom: 1px solid var(--border-light); gap: 8px; }
.detail-label { flex: 0 0 110px; font-size: 11px; color: var(--text-muted); font-weight: 500; padding-top: 1px; }
.detail-val { flex: 1; font-size: 12px; color: var(--text-primary); min-width: 0; word-break: break-word; }

/* Table aliases */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th { background: #f8fafc; padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 600; color: var(--text-muted); letter-spacing: .04em; white-space: nowrap; border-bottom: 1px solid var(--border); }
.data-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.data-table tbody tr { cursor: pointer; transition: background .12s; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr.selected { background: var(--primary-light); }
.action-cell { width: 40px; text-align: right; }

/* Filter bar */
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.search-wrap { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 180px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 5px 10px; }
.search-wrap i { color: var(--text-muted); font-size: 12px; }
.search-wrap input { border: none; outline: none; background: none; flex: 1; font-size: 13px; }

/* Badge space-separated variants (aliases for badge-X) */
.badge.success { background: #dcfce7; color: #15803d; }
.badge.warning { background: #fef9c3; color: #a16207; }
.badge.danger  { background: #fee2e2; color: #b91c1c; }
.badge.info    { background: #dbeafe; color: #1d4ed8; }
.badge.purple  { background: #ede9fe; color: #6d28d9; }
.badge.gray    { background: #f1f5f9; color: #475569; }

/* KPI card color variants */
.kpi-card.success { border-left: 3px solid var(--success); }
.kpi-card.warning { border-left: 3px solid var(--warning); }
.kpi-card.danger  { border-left: 3px solid var(--danger); }
.kpi-card.info    { border-left: 3px solid var(--info); }
.kpi-card.purple  { border-left: 3px solid var(--purple); }
.kpi-card.gray    { border-left: 3px solid #cbd5e1; }

/* Form grid */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form-grid-2 { grid-template-columns: 1fr; } }
.form-control { width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: var(--card-bg); }
.form-control:focus { outline: none; border-color: var(--primary); }

/* Cert list in panels */
.cert-list { display: flex; flex-direction: column; gap: 8px; }
.cert-item { background: var(--bg-main); border-radius: var(--radius); padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.cert-name { font-weight: 600; font-size: 12px; }
.cert-meta { font-size: 11px; color: var(--text-muted); }
.link-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.link-list li { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.link-list li i { color: var(--text-muted); }
.note-item { background: var(--bg-main); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 8px; }
.note-item p { font-size: 12px; margin-bottom: 4px; }
.note-item small { font-size: 11px; color: var(--text-muted); }

/* Timeline (plan approval) */
.timeline { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }
.tl-item { display: flex; gap: 10px; align-items: flex-start; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.tl-dot.info    { background: var(--info); }
.tl-dot.warning { background: var(--warning); }
.tl-dot.success { background: var(--success); }
.tl-dot.danger  { background: var(--danger); }
.tl-body { font-size: 12px; line-height: 1.5; }

/* Utility text colors */
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-success { color: var(--success) !important; }
.text-muted   { color: var(--text-muted) !important; }

/* Color dots */
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot-green { background: var(--success); }
.dot-orange { background: var(--warning); }
.dot-red { background: var(--danger); }
.dot-blue { background: var(--info); }
.dot-gray { background: #cbd5e1; }

/* Responsive */
@media (max-width: 1200px) {
  .detail-panel, .overview-sidebar { display: none !important; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .kpi-row { gap: 8px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-row.cols-2, .form-row.cols-3, .form-row.cols-4 { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 14px; }
  .main-header { padding: 0 14px; }
}
