/* =============================================
   GDPR Request Handler — Stylesheet
   ============================================= */

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

/* ----------- CSS Variables ----------- */
:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #1c2128;
  --surface3: #262c34;
  --border: #30363d;
  --accent: #58a6ff;
  --accent-bright: #79c0ff;
  --accent2: #9d7ead;
  --warning: #f0883e;
  --danger: #f85149;
  --success: #3fb950;
  --text: #f0f6fc;
  --text-secondary: #c9d1d9;
  --muted: #8b949e;
  --stone-light: #30363d;
  --stone-mid: #21262d;
  --stone-dark: #0d1117;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-xl: 0 12px 32px rgba(0,0,0,0.6);
  --glow-accent: 0 0 12px rgba(88,166,255,0.15);
  --accent-aaa: #79c0ff;
  --warning-aaa: #ffa94d;
  --danger-aaa: #ff8383;
  --success-aaa: #69db7c;
}

/* ----------- Light Theme Overrides ----------- */
[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f6f8fa;
  --surface2: #eaeef2;
  --surface3: #d8dee4;
  --border: #d0d7de;
  --accent: #0969da;
  --accent-bright: #0550ae;
  --accent2: #8250df;
  --warning: #bf8700;
  --danger: #cf222e;
  --success: #1a7f37;
  --text: #1f2328;
  --text-secondary: #424a53;
  --muted: #656d76;
  --stone-light: #d0d7de;
  --stone-mid: #eaeef2;
  --stone-dark: #ffffff;
  --shadow-sm: 0 1px 3px rgba(31,35,40,0.12);
  --shadow-md: 0 3px 8px rgba(31,35,40,0.15);
  --shadow-lg: 0 6px 16px rgba(31,35,40,0.18);
  --shadow-xl: 0 8px 24px rgba(31,35,40,0.2);
  --glow-accent: 0 0 8px rgba(9,105,218,0.1);
  --accent-aaa: #0550ae;
  --warning-aaa: #9a6700;
  --danger-aaa: #a40e26;
  --success-aaa: #116329;
}

/* Light theme: flip white inset highlights to dark */
[data-theme="light"] .stat-card,
[data-theme="light"] .stat-card:hover,
[data-theme="light"] .modal-content,
[data-theme="light"] .form-control,
[data-theme="light"] .form-control:hover,
[data-theme="light"] .form-control:focus,
[data-theme="light"] .search-input,
[data-theme="light"] .search-input:hover,
[data-theme="light"] .search-input:focus,
[data-theme="light"] .filter-btn,
[data-theme="light"] .filter-btn:hover,
[data-theme="light"] .filter-btn.active,
[data-theme="light"] .deadline-card,
[data-theme="light"] .deadline-card:hover,
[data-theme="light"] .template-card,
[data-theme="light"] .template-card:hover,
[data-theme="light"] .detail-panel,
[data-theme="light"] .help-button,
[data-theme="light"] .help-button:hover,
[data-theme="light"] .btn,
[data-theme="light"] .btn:hover,
[data-theme="light"] .table-row:hover,
[data-theme="light"] .topbar {
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .stat-icon {
  background: linear-gradient(135deg, rgba(0,0,0,0.05) 0%, transparent 100%);
}

/* ----------- Reset ----------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* =============================================
   WCAG AAA ACCESSIBILITY
   ============================================= */

/* Skip to main content link (visible on focus) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
}

/* Focus styles - visible outline for keyboard navigation */
*:focus-visible {
  outline: 3px solid var(--accent-bright);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ----------- Grid Background ----------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(88,166,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88,166,255,0.04) 1px, transparent 1px),
    linear-gradient(135deg, rgba(88,166,255,0.01) 1px, transparent 1px),
    linear-gradient(45deg, rgba(88,166,255,0.01) 1px, transparent 1px);
  background-size: 50px 50px, 50px 50px, 70px 70px, 70px 70px;
  pointer-events: none;
  z-index: 0;
}

/* =============================================
   TOP BAR
   ============================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(22,27,34,0.95) 0%, rgba(16,21,28,0.92) 100%);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.logo {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-bright);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 0 12px rgba(88,166,255,0.1);
  transition: all 0.3s ease;
}

.logo:hover {
  text-shadow: 0 0 20px rgba(88,166,255,0.2);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.clock { color: var(--accent); font-weight: 500; }

/* =============================================
   LAYOUT
   ============================================= */
.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 56px);
  position: relative;
  z-index: 1;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
  background: linear-gradient(180deg, var(--surface2) 0%, var(--stone-mid) 100%);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  box-shadow: inset -1px 0 0 rgba(88,166,255,0.05);
}

.sidebar-section {
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 16px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  margin: 2px 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 3px solid transparent;
  border-radius: 4px;
  user-select: none;
  position: relative;
  background: none;
  border: none;
  font-family: inherit;
}

.nav-item:hover {
  color: var(--text-secondary);
  background: rgba(88,166,255,0.08);
  border-left-color: transparent;
  transform: translateX(2px);
}

.nav-item.active {
  color: var(--accent-bright);
  border-left-color: var(--accent);
  background: linear-gradient(90deg, rgba(88,166,255,0.12) 0%, transparent 100%);
  box-shadow: inset 0 0 8px rgba(88,166,255,0.1);
}

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

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
}

.nav-badge.warning { background: var(--warning); color: var(--bg); }
.nav-badge.muted { background: var(--surface2); color: var(--muted); }

/* =============================================
   MAIN CONTENT
   ============================================= */
.main {
  padding: 28px;
  overflow-y: auto;
  background: linear-gradient(180deg, transparent 0%, rgba(88,166,255,0.01) 100%);
}

/* ----------- Page Header ----------- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-title {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.page-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* =============================================
   STATS CARDS
   ============================================= */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: linear-gradient(135deg, var(--surface2) 0%, rgba(28,33,40,0.5) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.05);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 2px;
}

.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 0%, rgba(88,166,255,0.05) 0%, transparent 100%);
  pointer-events: none;
}

.stat-card.blue::before   { background: linear-gradient(90deg, var(--accent), var(--accent-bright)); }
.stat-card.purple::before { background: linear-gradient(90deg, var(--accent2), #b393d3); }
.stat-card.orange::before { background: linear-gradient(90deg, var(--warning), #f5a623); }
.stat-card.green::before  { background: linear-gradient(90deg, var(--success), #58d68d); }

.stat-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.08), var(--glow-accent);
  transform: translateY(-2px);
}

.stat-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-meta { font-size: 11px; color: var(--muted); }
.stat-meta span { color: var(--warning); font-weight: 500; }

/* =============================================
   SECTIONS (VIEWS)
   ============================================= */
.section { margin-bottom: 28px; display: none; }
.section.active { display: block; }

/* =============================================
   FILTERS BAR
   ============================================= */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--surface3) 0%, var(--surface2) 100%);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.05em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 8px rgba(88,166,255,0.1);
}

.filter-btn.active {
  background: linear-gradient(135deg, rgba(88,166,255,0.2) 0%, rgba(88,166,255,0.1) 100%);
  border-color: var(--accent);
  color: var(--accent-bright);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), inset 0 0 8px rgba(88,166,255,0.1), 0 0 8px rgba(88,166,255,0.15);
}

.search-box {
  margin-left: auto;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--surface3) 0%, var(--surface2) 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 14px;
  gap: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 12px rgba(88,166,255,0.1);
}

.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  width: 180px;
}

.search-box input::placeholder { color: var(--muted); }

/* =============================================
   REQUEST TABLE
   ============================================= */
.request-table {
  background: linear-gradient(135deg, rgba(22,27,34,0.8) 0%, rgba(18,23,28,0.6) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.05);
}

.table-head {
  display: grid;
  grid-template-columns: 100px 1fr 120px 110px 130px 110px 100px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.th {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

.table-row {
  display: grid;
  grid-template-columns: 100px 1fr 120px 110px 130px 110px 100px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(48,54,61,0.3);
  align-items: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  animation: rowIn 0.3s ease both;
  position: relative;
}

@keyframes rowIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.table-row:hover {
  background: linear-gradient(90deg, rgba(88,166,255,0.06) 0%, transparent 100%);
  border-bottom-color: rgba(88,166,255,0.2);
  box-shadow: inset 0 0 8px rgba(88,166,255,0.05);
}

.table-row:last-child { border-bottom: none; }
.td { font-size: 13px; }

.req-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}

.req-subject strong { display: block; font-size: 13px; color: var(--text); }
.req-subject span   { font-size: 11px; color: var(--muted); font-family: var(--mono); }

/* ----------- Type Badges ----------- */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.type-access        { background: rgba(0,212,255,0.12);   color: var(--accent); }
.type-erasure       { background: rgba(239,68,68,0.12);   color: #f87171; }
.type-portability   { background: rgba(124,58,237,0.12);  color: #a78bfa; }
.type-objection     { background: rgba(245,158,11,0.12);  color: var(--warning); }
.type-rectification { background: rgba(16,185,129,0.12);  color: var(--success); }
.type-art22         { background: rgba(124,58,237,0.15);  color: #a78bfa; }

/* ----------- Status Badges ----------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

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

.status-new .status-dot         { background: var(--accent);  box-shadow: 0 0 6px var(--accent); }
.status-new                     { color: var(--accent); }
.status-in-progress .status-dot { background: var(--warning); box-shadow: 0 0 6px var(--warning); animation: pulse 2s infinite; }
.status-in-progress             { color: var(--warning); }
.status-completed .status-dot   { background: var(--success); }
.status-completed               { color: var(--success); }
.status-overdue .status-dot     { background: var(--danger);  box-shadow: 0 0 6px var(--danger); animation: pulse 1.5s infinite; }
.status-overdue                 { color: var(--danger); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ----------- Deadline Colours ----------- */
.deadline-urgent { color: var(--danger); }
.deadline-soon   { color: var(--warning); }
.deadline-ok     { color: var(--success); }
.deadline-done   { color: var(--muted); }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover::before { opacity: 1; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
  color: var(--bg);
  box-shadow: 0 4px 12px rgba(88,166,255,0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(88,166,255,0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: linear-gradient(135deg, var(--surface3) 0%, var(--surface2) 100%);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 12px rgba(88,166,255,0.1);
}

.action-btn {
  background: linear-gradient(135deg, var(--surface3) 0%, var(--surface2) 100%);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  font-family: var(--mono);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 8px rgba(88,166,255,0.12);
}

.action-btn.primary {
  background: linear-gradient(135deg, rgba(88,166,255,0.15) 0%, rgba(88,166,255,0.08) 100%);
  border-color: var(--accent);
  color: var(--accent-bright);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 8px rgba(88,166,255,0.1);
}

.action-btn.primary:hover {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 0 12px rgba(88,166,255,0.2);
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: linear-gradient(135deg, var(--surface2) 0%, var(--stone-mid) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255,255,255,0.08);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: none; }
}

.modal-header {
  padding: 24px 28px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title { font-family: var(--mono); font-size: 16px; font-weight: 600; color: var(--text); }

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 2px;
}

.modal-close:hover { color: var(--text); }
.modal-body { padding: 0 28px 28px; }

/* ----------- Form Layout ----------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { margin-bottom: 0; }
.form-field.full { grid-column: 1 / -1; }

.form-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}

.form-control {
  width: 100%;
  background: linear-gradient(135deg, var(--stone-dark) 0%, rgba(13,17,23,0.8) 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2), 0 0 12px rgba(88,166,255,0.15);
  background: linear-gradient(135deg, var(--stone-dark) 0%, rgba(13,17,23,0.9) 100%);
}

.form-control::placeholder { color: var(--muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; font-family: var(--sans); }

.form-section-title {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 20px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

/* =============================================
   DETAIL SIDE PANEL
   ============================================= */
.detail-panel {
  position: fixed;
  right: 0;
  top: 56px;
  width: 460px;
  height: calc(100vh - 56px);
  background: linear-gradient(180deg, var(--surface2) 0%, var(--stone-mid) 100%);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px rgba(0,0,0,0.4);
  z-index: 150;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.detail-panel.open { transform: none; }

.detail-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.detail-id { font-family: var(--mono); font-size: 11px; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.detail-name { font-size: 18px; font-weight: 600; color: var(--text); line-height: 1.3; }
.detail-body { padding: 20px 24px; flex: 1; }

.detail-section { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.detail-section:last-child { border-bottom: none; }

.detail-section-title {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.detail-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; gap: 16px; }
.detail-key { font-size: 11px; color: var(--muted); font-family: var(--mono); flex-shrink: 0; min-width: 110px; }
.detail-val { font-size: 12px; color: var(--text); text-align: right; word-break: break-word; }

/* ----------- Timeline ----------- */
.timeline { margin-top: 4px; }

.tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 20px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.tl-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--accent);
  margin-top: 2px;
}

.tl-dot.done { background: var(--accent); color: var(--bg); }
.tl-dot.warn { border-color: var(--warning); color: var(--warning); }
.tl-dot.warn.done { background: var(--warning); color: var(--bg); }

.tl-action { font-size: 12px; color: var(--text); font-weight: 500; }
.tl-time   { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 2px; }

/* ----------- Deadline Meter ----------- */
.deadline-meter { margin-top: 10px; background: var(--bg); border-radius: 4px; height: 6px; overflow: hidden; }
.deadline-fill  { height: 100%; border-radius: 4px; transition: width 0.5s ease; }

/* =============================================
   DEADLINE CARDS
   ============================================= */
.deadline-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.dc-card {
  background: linear-gradient(135deg, var(--surface2) 0%, rgba(28,33,40,0.6) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.04);
  position: relative;
  overflow: hidden;
}

.dc-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.dc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.08);
}

.dc-card:hover::before { width: 6px; }

.dc-card.urgent::before { background: linear-gradient(180deg, var(--danger), #ff6b6b); }
.dc-card.soon::before   { background: linear-gradient(180deg, var(--warning), #ffa94d); }
.dc-card.ok::before     { background: linear-gradient(180deg, var(--success), #69db7c); }

.dc-days { font-family: var(--mono); font-size: 28px; font-weight: 600; line-height: 1; margin-bottom: 4px; }
.urgent .dc-days { color: var(--danger); }
.soon .dc-days   { color: var(--warning); }
.ok .dc-days     { color: var(--success); }

.dc-label { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.dc-firm  { font-size: 13px; font-weight: 500; color: var(--text); }
.dc-type  { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* =============================================
   RESPONSE TEMPLATES
   ============================================= */
.templates-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.template-card {
  background: linear-gradient(135deg, rgba(28,33,40,0.6) 0%, rgba(22,27,34,0.4) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.04);
}

.template-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(88,166,255,0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.template-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.08), var(--glow-accent);
  transform: translateY(-4px);
}

.template-card:hover::before { opacity: 1; }

.template-card h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
  transition: color 0.2s ease;
}

.template-card:hover h3 { color: var(--accent-bright); }

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

.template-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 2px;
  background: rgba(0,212,255,0.1);
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* =============================================
   NOTIFICATION TOAST
   ============================================= */
.notif {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, var(--surface2) 0%, var(--stone-mid) 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 13px;
  color: var(--text);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255,255,255,0.05);
  animation: notifIn 0.3s ease;
  max-width: 340px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.notif.show { opacity: 1; pointer-events: auto; }
@keyframes notifIn { from { transform: translateY(20px); } to { transform: none; } }
.notif-icon { font-size: 16px; }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state { text-align: center; padding: 60px 24px; color: var(--muted); }
.empty-icon  { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-title { font-size: 16px; color: var(--text); margin-bottom: 8px; font-weight: 500; }
.empty-desc  { font-size: 13px; margin-bottom: 20px; }

/* =============================================
   SPECIAL TAGS
   ============================================= */
.art22-tag {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(124,58,237,0.15);
  color: #a78bfa;
  border: 1px solid rgba(124,58,237,0.3);
  letter-spacing: 0.05em;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  background: linear-gradient(180deg, rgba(22,27,34,0.95) 0%, rgba(13,17,23,0.98) 100%);
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  position: relative;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
}

.footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(88,166,255,0.02) 0%, transparent 100%);
  pointer-events: none;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
  position: relative;
  z-index: 1;
}

.footer-text {
  transition: color 0.2s ease;
}

.footer-text strong {
  color: var(--accent-bright);
  font-weight: 600;
  transition: all 0.2s ease;
}

.footer-divider {
  color: var(--border);
  opacity: 0.5;
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar        { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* =============================================
   ORGANIZATION SELECTOR
   ============================================= */
.org-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.org-pill {
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--surface3) 0%, var(--surface2) 100%);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.org-pill:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
  box-shadow: 0 0 12px rgba(88,166,255,0.1);
}

.org-pill.active {
  background: linear-gradient(135deg, rgba(88,166,255,0.2) 0%, rgba(88,166,255,0.1) 100%);
  border-color: var(--accent);
  color: var(--accent-bright);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 8px rgba(88,166,255,0.15);
}

/* =============================================
   STATUS OVERVIEW
   ============================================= */
.status-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.overview-card {
  background: linear-gradient(135deg, rgba(30,36,43,0.8) 0%, rgba(22,27,34,0.6) 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.03);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.overview-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.05), var(--glow-accent);
  transform: translateY(-2px);
}

.overview-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(88,166,255,0.05) 0%, transparent 80%);
  pointer-events: none;
}

.overview-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.overview-value {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 600;
  color: var(--accent-bright);
  line-height: 1;
  margin-bottom: 8px;
}

.overview-value.critical {
  color: var(--danger-aaa, #ff8383);
}

.overview-bar {
  height: 5px;
  background: rgba(48,54,61,0.4);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.overview-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  border-radius: 3px;
  transition: width 0.6s ease;
}

.overview-spark {
  font-size: 20px;
  margin-bottom: 4px;
}

.overview-meta {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}

/* =============================================
   ADVANCED FILTER PANEL
   ============================================= */
.filter-panel {
  background: linear-gradient(135deg, var(--surface2) 0%, var(--stone-mid) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.04);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.filter-panel-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.filter-panel-body {
  padding: 16px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent-bright);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

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

.filter-multi label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease;
}

.filter-multi label:hover {
  color: var(--accent-bright);
}

.filter-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

.filter-panel-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}

.filter-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(88,166,255,0.1);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent-bright);
  border: 1px solid rgba(88,166,255,0.2);
}

/* =============================================
   FORM ACCESSIBILITY
   ============================================= */
fieldset {
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

legend {
  display: block;
  width: 100%;
  padding: 0 !important;
  margin-bottom: 8px !important;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent-bright);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* Required field indicator (text-only, not just asterisk) */
.form-required::after {
  content: ' (required)';
  color: var(--danger-aaa);
  font-weight: 600;
}

/* Keyboard shortcut help button */
.help-button {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  color: var(--bg);
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(88,166,255,0.3);
  transition: all 0.2s ease;
  z-index: 99;
}

.help-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(88,166,255,0.4);
}

.help-button:focus-visible {
  outline: 3px solid var(--accent-bright);
  outline-offset: 2px;
}

/* =============================================
   EXTRACTED INLINE STYLES
   ============================================= */

/* -- Topbar -- */
.topbar-divider { color: var(--border); }
.topbar-warning { color: var(--warning); }

/* -- Nav icon colours (by article) -- */
.nav-icon-access        { color: var(--accent); }
.nav-icon-erasure       { color: #f87171; }
.nav-icon-portability   { color: #a78bfa; }
.nav-icon-objection     { color: var(--warning); }
.nav-icon-rectification { color: var(--success); }
.nav-icon-art22         { color: #a78bfa; }

/* -- Page header actions -- */
.page-header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.page-header-actions-sm {
  display: flex;
  gap: 8px;
}

/* -- Dashboard visualisation grid -- */
.viz-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}

.viz-card {
  background: linear-gradient(135deg, rgba(30,36,43,0.8) 0%, rgba(22,27,34,0.6) 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.viz-card-title {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

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

.status-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* -- Recent requests header -- */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-bar-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* -- Modal subtitle -- */
.modal-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* -- Modal tabs -- */
.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  padding: 0;
}

.modal-tab {
  flex: 1;
  padding: 12px;
  text-align: left;
  background: none;
  border: none;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.modal-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* -- Email parsing tab -- */
.email-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.email-textarea {
  min-height: 200px;
  font-family: var(--mono);
  font-size: 11px;
}

.email-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

/* -- AI suggestions box -- */
.ai-suggestions-box {
  display: none;
  margin-top: 16px;
  padding: 12px;
  background: rgba(120,200,255,0.1);
  border: 1px solid rgba(120,200,255,0.2);
  border-radius: 6px;
}

.ai-suggestion-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

.ai-suggestion-line {
  font-size: 12px;
  margin-bottom: 6px;
}

.ai-suggestion-meta {
  font-size: 11px;
  color: var(--muted);
}

.btn-full {
  margin-top: 8px;
  width: 100%;
}

/* -- Keyboard shortcuts table -- */
.shortcuts-table {
  width: 100%;
  font-size: 12px;
  line-height: 1.8;
}

.shortcuts-table-spaced {
  margin-bottom: 20px;
}

.shortcuts-table td {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.shortcuts-table tr:last-child td {
  border-bottom: none;
}

.shortcuts-table .shortcut-key {
  color: var(--muted);
}

.shortcuts-table .shortcut-desc {
  padding-left: 12px;
}

.kbd {
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 3px;
}

/* -- Export format selector -- */
.export-format-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.export-format-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: linear-gradient(135deg, var(--surface3) 0%, var(--surface2) 100%);
}

.export-format-option:hover {
  border-color: var(--accent);
}

.accent-input { accent-color: var(--accent); }

.export-format-name { font-weight: 600; color: var(--text); }
.export-format-desc { font-size: 11px; color: var(--muted); }

/* -- Export checkboxes -- */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-text {
  font-size: 12px;
  color: var(--text);
}

/* -- Template tag variants -- */
.template-tag-rectification { background: rgba(16,185,129,0.12); color: var(--success); }
.template-tag-art22         { background: rgba(124,58,237,0.15); color: #a78bfa; }
.template-tag-extension     { background: rgba(245,158,11,0.12); color: var(--warning); }

/* -- Template body viewer -- */
.template-viewer {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--text);
  font-family: var(--sans);
  white-space: pre-wrap;
}

/* -- Modal widths -- */
.modal-wide    { max-width: 720px; }
.modal-wider   { max-width: 740px; }

/* -- Filter panel reset (fieldsets) -- */
.fieldset-reset {
  border: none;
  padding: 0;
  margin: 0;
}

.filter-panel-legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.filter-close-btn { margin: 0; }

/* -- Search icon -- */
.search-icon { color: var(--muted); font-size: 13px; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1100px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .status-overview { grid-template-columns: repeat(2, 1fr); }
  .table-head, .table-row { grid-template-columns: 90px 1fr 100px 100px 110px 110px; }
  .table-head :nth-child(7), .table-row :nth-child(7) { display: none; }
  .deadline-cards { grid-template-columns: repeat(2, 1fr); }
  .templates-grid { grid-template-columns: 1fr; }
  .filter-panel-body { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stats-row { grid-template-columns: 1fr; }
  .status-overview { grid-template-columns: 1fr; }
  .deadline-cards { grid-template-columns: 1fr; }
  .detail-panel { width: 100%; }
  .filter-panel-body { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; gap: 12px; }
  .page-header > div:last-child { display: flex; gap: 8px; width: 100%; }
}
