/* =========================================================
   STEINWEG VIC — Design System
   Light Corporate Theme · Vessel Inspection Checklist
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;500;600;700;900&display=swap');

:root {
  --steinweg-teal: #006B7F;
  --steinweg-dark-navy: #003F59;
  --steinweg-gold: #D9AA27;
  --background: #FFFFFF;
  --background-alt: #F2F6F9;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --text-primary: #1E293B;
  --text-secondary: #5A5C65;
  --success: #16A34A;
  --warning: #D97706;
  --danger: #DC2626;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.07), 0 4px 6px rgba(0,0,0,0.05);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --sidebar-width: 240px;
  --header-height: 60px;
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--background-alt);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
}

/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
  width: var(--sidebar-width);
  background: var(--steinweg-dark-navy);
  min-height: 100vh;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 16px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
  background: var(--steinweg-dark-navy);
}

.sidebar-logo {
  height: 40px;
  width: auto;
  display: block;
}

.sidebar-subtitle {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steinweg-gold);
  margin-top: 6px;
  opacity: 1;
}

.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 12px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.7);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

.nav-item.active {
  background: rgba(0,107,127,0.35);
  color: #fff;
  border-left-color: var(--steinweg-gold);
}

.nav-item svg {
  width: 17px;
  height: 17px;
  opacity: 0.8;
  flex-shrink: 0;
}

.nav-item.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--steinweg-gold);
  color: var(--steinweg-dark-navy);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

.sidebar-footer strong {
  display: block;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
  font-size: 12.5px;
}

/* =========================================================
   MAIN LAYOUT
   ========================================================= */

.app-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-xs);
}

.header-left {
  display: flex;
  flex-direction: column;
}

.header-page-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.header-breadcrumb {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-date {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-port-badge {
  background: var(--background-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--steinweg-teal);
  display: flex;
  align-items: center;
  gap: 5px;
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--steinweg-teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.page-content {
  padding: 24px 28px;
  flex: 1;
}

/* =========================================================
   PAGE VISIBILITY
   ========================================================= */

.page { display: none; }
.page.active { display: block; }

/* =========================================================
   TYPOGRAPHY & HELPERS
   ========================================================= */

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .title-accent {
  display: inline-block;
  width: 3px;
  height: 16px;
  background: var(--steinweg-teal);
  border-radius: 2px;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--steinweg-teal);
  color: #fff;
  border-color: var(--steinweg-teal);
}
.btn-primary:hover {
  background: var(--steinweg-dark-navy);
  border-color: var(--steinweg-dark-navy);
}

.btn-outlined {
  background: transparent;
  color: var(--steinweg-teal);
  border-color: var(--steinweg-teal);
}
.btn-outlined:hover {
  background: rgba(0,107,127,0.06);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--background-alt);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* =========================================================
   CARDS
   ========================================================= */

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

.card-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 20px;
}

/* =========================================================
   KPI CARDS
   ========================================================= */

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

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--kpi-color, var(--steinweg-teal));
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}

.kpi-meta {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  background: var(--kpi-bg, rgba(0,107,127,0.08));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--kpi-color, var(--steinweg-teal));
}

.kpi-icon svg { width: 18px; height: 18px; }

.kpi-trend-up { color: var(--success); }
.kpi-trend-down { color: var(--danger); }
.kpi-trend-neutral { color: var(--text-secondary); }

/* =========================================================
   TABLE
   ========================================================= */

.data-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table thead th {
  background: var(--background-alt);
  padding: 11px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
  cursor: pointer;
}

.data-table tbody tr:last-child { border-bottom: none; }

.data-table tbody tr:hover { background: rgba(0,107,127,0.03); }

.data-table tbody td {
  padding: 12px 16px;
  vertical-align: middle;
  color: var(--text-primary);
}

.vehicle-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vehicle-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: rgba(0,107,127,0.08);
  color: var(--steinweg-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vehicle-icon svg { width: 16px; height: 16px; }

.vessel-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vessel-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: rgba(0,107,127,0.08);
  color: var(--steinweg-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vessel-icon svg { width: 16px; height: 16px; }

.vessel-name {
  font-weight: 600;
  color: var(--text-primary);
}

.vessel-imo {
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* =========================================================
   BADGES / STATUS
   ========================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-success { background: #DCFCE7; color: var(--success); }
.badge-warning { background: #FEF3C7; color: var(--warning); }
.badge-danger  { background: #FEE2E2; color: var(--danger); }
.badge-info    { background: #E0F2FE; color: #0369A1; }
.badge-teal    { background: rgba(0,107,127,0.1); color: var(--steinweg-teal); }
.badge-navy    { background: rgba(0,63,89,0.1); color: var(--steinweg-dark-navy); }
.badge-neutral { background: #F1F5F9; color: var(--text-secondary); }

/* =========================================================
   PROGRESS BAR
   ========================================================= */

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
  min-width: 80px;
}

.progress-fill {
  height: 100%;
  border-radius: 10px;
  background: var(--steinweg-teal);
  transition: width 0.4s ease;
}

.progress-fill.complete { background: var(--success); }
.progress-fill.blocked  { background: var(--danger); }
.progress-fill.pending  { background: var(--warning); }

.progress-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 32px;
  text-align: right;
}

/* =========================================================
   ACTION ROW
   ========================================================= */

.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.action-row .spacer { flex: 1; }

/* =========================================================
   CHARTS ROW
   ========================================================= */

.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

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

.chart-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-title span {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.chart-container {
  position: relative;
  height: 200px;
}

/* =========================================================
   VESSELS GRID
   ========================================================= */

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

.vessel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}

.vessel-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.vessel-card-header {
  background: linear-gradient(135deg, var(--steinweg-dark-navy) 0%, var(--steinweg-teal) 100%);
  padding: 18px 20px 14px;
  color: #fff;
  position: relative;
}

.vessel-card-flag {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 22px;
}

.vessel-card-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 3px;
}

.vessel-card-type {
  font-size: 11.5px;
  opacity: 0.75;
}

.vessel-card-body {
  padding: 16px 20px;
}

.vessel-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.vessel-meta-item label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 2px;
}

.vessel-meta-item span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.vessel-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--background-alt);
}

/* =========================================================
   SIDE PANELS (Vehicle Detail / Violation Detail)
   ========================================================= */

.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.detail-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.detail-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 520px;
  background: var(--surface);
  box-shadow: -4px 0 30px rgba(0,0,0,0.12);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-panel.open {
  transform: translateX(0);
}

.detail-panel-header {
  background: linear-gradient(135deg, var(--steinweg-dark-navy) 0%, var(--steinweg-teal) 100%);
  padding: 22px 24px;
  color: #fff;
  flex-shrink: 0;
}

.detail-panel-close {
  position: absolute;
  top: 18px;
  right: 20px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.15s;
}

.detail-panel-close:hover { background: rgba(255,255,255,0.25); }

.detail-panel-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.detail-panel-subtitle { font-size: 12.5px; opacity: 0.75; }

.detail-panel-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
}

.detail-section {
  margin-bottom: 22px;
}

.detail-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--background-alt);
  font-size: 13px;
}

.detail-row:last-child { border-bottom: none; }

.detail-row label {
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-row span {
  font-weight: 600;
  color: var(--text-primary);
}

.detail-panel-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* =========================================================
   INSPECTIONS PAGE
   ========================================================= */

.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--background-alt);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 18px;
  width: fit-content;
}

.filter-tab {
  padding: 7px 16px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.filter-tab:hover { color: var(--text-primary); background: rgba(0,0,0,0.04); }

.filter-tab.active {
  background: var(--surface);
  color: var(--steinweg-teal);
  box-shadow: var(--shadow-xs);
}

.filter-tab .tab-count {
  background: var(--steinweg-teal);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
}

/* Checklist Detail View */

.checklist-back {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--steinweg-teal);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
}

.checklist-back:hover { text-decoration: underline; }

.checklist-header-card {
  background: linear-gradient(135deg, var(--steinweg-dark-navy) 0%, var(--steinweg-teal) 100%);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  color: #fff;
  margin-bottom: 20px;
}

.checklist-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.checklist-vehicle-name {
  font-size: 20px;
  font-weight: 700;
}

/* legacy alias */
.checklist-vessel-name { font-size: 20px; font-weight: 700; }

.checklist-meta {
  display: flex;
  gap: 18px;
  font-size: 12.5px;
  opacity: 0.82;
}

.checklist-progress-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.checklist-progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  overflow: hidden;
}

.checklist-progress-fill {
  height: 100%;
  background: var(--steinweg-gold);
  border-radius: 10px;
  transition: width 0.5s ease;
}

.checklist-progress-pct {
  font-size: 14px;
  font-weight: 700;
  min-width: 42px;
  text-align: right;
}

.checklist-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.checklist-section-header {
  padding: 14px 18px;
  background: var(--background-alt);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.checklist-section-header:hover { background: #e8eef3; }

.checklist-section-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.checklist-section-name svg { color: var(--steinweg-teal); width: 16px; height: 16px; }

.checklist-section-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.section-chevron {
  transition: transform 0.2s;
}

.section-chevron.open { transform: rotate(180deg); }

.checklist-items {
  padding: 4px 0;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.checklist-item:last-child { border-bottom: none; }

.checklist-item:hover { background: rgba(0,107,127,0.025); }

.item-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  user-select: none;
}

.item-checkbox:hover { border-color: var(--steinweg-teal); }

.item-checkbox.checked {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.item-checkbox.issue {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.item-checkbox.na {
  background: var(--text-secondary);
  border-color: var(--text-secondary);
  color: #fff;
}

.item-checkbox svg { width: 11px; height: 11px; }

.item-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
}

.item-text .item-note {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.item-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

/* =========================================================
   REPORTS PAGE
   ========================================================= */

.reports-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}

.report-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.report-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.report-card-icon svg { width: 22px; height: 22px; }

.report-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.report-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
}

.report-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

.report-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.report-preview-header {
  background: linear-gradient(135deg, var(--steinweg-dark-navy) 0%, var(--steinweg-teal) 100%);
  padding: 18px 24px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.report-preview-title { font-size: 16px; font-weight: 700; }
.report-preview-meta { font-size: 12px; opacity: 0.75; }

.report-preview-body { padding: 22px 24px; }

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

.report-stat {
  text-align: center;
  padding: 14px 10px;
  background: var(--background-alt);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.report-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--steinweg-teal);
}

.report-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 3px;
}

/* =========================================================
   SEARCH / FILTER ROW
   ========================================================= */

.search-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 320px;
}

.search-input-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-secondary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus { border-color: var(--steinweg-teal); }

.filter-select {
  padding: 8px 30px 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--surface);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235A5C65' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.15s;
}

.filter-select:focus { border-color: var(--steinweg-teal); }

/* =========================================================
   MODAL
   ========================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(-16px) scale(0.98);
  transition: transform 0.2s;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  background: var(--background-alt);
  border-bottom: 1px solid var(--border);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  font-size: 18px;
}

.modal-close:hover { background: var(--border); }

.modal-body { padding: 22px; }

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-primary);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus { border-color: var(--steinweg-teal); }

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

.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: var(--surface);
}

/* =========================================================
   TOAST NOTIFICATIONS
   ========================================================= */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--text-primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 380px;
  animation: toastIn 0.3s ease;
  pointer-events: all;
}

.toast.toast-success { background: var(--success); }
.toast.toast-danger  { background: var(--danger); }
.toast.toast-warning { background: var(--warning); }
.toast.toast-info    { background: var(--steinweg-teal); }

.toast svg { width: 16px; height: 16px; flex-shrink: 0; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* =========================================================
   MISC
   ========================================================= */

.divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

.empty-state {
  text-align: center;
  padding: 44px 20px;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 44px;
  height: 44px;
  opacity: 0.3;
  margin-bottom: 12px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.empty-state p { font-size: 14px; font-weight: 500; }

/* Defect legend items */
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.legend-item:last-child { border-bottom: none; }

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-item-label { flex: 1; color: var(--text-primary); }

.legend-item-val {
  font-weight: 700;
  color: var(--text-primary);
}

/* Animate in pages */
.page.active {
  animation: pageIn 0.2s ease;
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #CBD5E1; }
