/* =============================================
   GDPR Request Handler — Components
   Buttons, Badges, Cards, Tables, Modals, Forms, etc.
   ============================================= */

/* =============================================
   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; }

/* =============================================
   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 {
  width: 0%;
  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);
}

/* -- 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;
}

/* =============================================
   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); }
.search-icon { color: var(--muted); font-size: 13px; }

/* =============================================
   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;
}

.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);
}

/* -- 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; }

/* =============================================
   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;
}

.th-sortable { cursor: pointer; user-select: none; }
.th-sortable:hover { color: var(--accent); }
.th-sorted { color: var(--accent); }
.sort-arrow { margin-left: 4px; font-size: 9px; }

.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;
}

.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); }

/* ----------- 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);
}

.btn-secondary {
  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-full {
  margin-top: 8px;
  width: 100%;
}

.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);
}

.modal-wide    { max-width: 720px; }
.modal-wider   { max-width: 740px; }

.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-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.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; }

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

/* -- 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);
}

/* =============================================
   FORMS
   ============================================= */
.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); }

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

/* =============================================
   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;
}

.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-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;
}

/* =============================================
   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; }
.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;
}

/* =============================================
   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);
}

/* =============================================
   EMAIL PARSING
   ============================================= */
.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);
}

/* =============================================
   KEYBOARD SHORTCUTS
   ============================================= */
.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
   ============================================= */
.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);
}

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

.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);
}

/* =============================================
   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;
}

/* =============================================
   THEME TOGGLE
   ============================================= */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  transition: all 0.2s ease;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}
.theme-toggle:focus-visible {
  outline: 3px solid var(--accent-bright);
  outline-offset: 2px;
}

/* =============================================
   RISK ALERT (detail panel)
   ============================================= */
.risk-alert {
  padding: 12px;
  border-left: 3px solid transparent;
  border-radius: 4px;
  margin-bottom: 16px;
}

.risk-alert--critical { background: rgba(255,107,107,0.15); }
.risk-alert--high     { background: rgba(255,131,131,0.15); }
.risk-alert--medium   { background: rgba(255,165,77,0.15); }

.risk-alert__title {
  font-weight: 600;
  margin-bottom: 6px;
}

.risk-alert__flags {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
}

.risk-alert__recommendation {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  font-style: italic;
}

/* =============================================
   IMPORT / RESTORE
   ============================================= */
.import-section {
  margin-top: 0;
  border-top: 1px solid var(--border);
  padding-top: 0;
}

.import-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.import-drop-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(0,0,0,0.15);
}

.import-drop-zone:hover,
.import-drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(88,166,255,0.06);
  color: var(--accent-bright);
}

.import-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.import-preview {
  margin-top: 14px;
  padding: 14px;
  background: rgba(88,166,255,0.06);
  border: 1px solid rgba(88,166,255,0.15);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text);
}

.import-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* =============================================
   BULK ACTION TOOLBAR
   ============================================= */
.bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(88,166,255,0.1) 0%, rgba(88,166,255,0.04) 100%);
  border: 1px solid rgba(88,166,255,0.25);
  border-radius: 10px;
  animation: slideDown 0.25s ease;
}

.bulk-toolbar-left,
.bulk-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bulk-count {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-bright);
}

.bulk-delete-btn {
  border-color: var(--danger) !important;
  color: var(--danger) !important;
}

.bulk-dropdown-wrap {
  position: relative;
}

.bulk-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 130px;
  z-index: 50;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.bulk-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.bulk-dropdown button:hover {
  background: rgba(88,166,255,0.1);
  color: var(--accent-bright);
}

/* =============================================
   TABLE CHECKBOX COLUMN
   ============================================= */
.table-head-check {
  grid-template-columns: 36px 100px 1fr 120px 110px 130px 110px 100px;
}

.table-row-check {
  grid-template-columns: 36px 100px 1fr 120px 110px 130px 110px 100px;
}

.th-check,
.td-check {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bulk-check-all,
.row-check {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

.table-row.selected {
  background: linear-gradient(90deg, rgba(88,166,255,0.1) 0%, rgba(88,166,255,0.03) 100%);
  border-bottom-color: rgba(88,166,255,0.2);
}

/* =============================================
   SVG CHARTS — DONUT
   ============================================= */
.chart-container {
  position: relative;
  min-height: 60px;
}

.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.donut-svg {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}

.donut-seg {
  cursor: pointer;
  transition: opacity 0.2s, filter 0.2s;
}

.donut-total {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  fill: var(--text);
  transform: rotate(90deg);
  transform-origin: center;
}

.donut-label {
  font-family: var(--mono);
  font-size: 9px;
  fill: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transform: rotate(90deg);
  transform-origin: center;
}

/* =============================================
   CHART LEGEND
   ============================================= */
.chart-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin-top: 12px;
  width: 100%;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

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

.legend-text {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.legend-val {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

/* =============================================
   SVG CHARTS — BAR
   ============================================= */
.bar-svg {
  width: 100%;
  height: auto;
}

.bar-label {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--text-secondary);
}

.bar-val {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--muted);
}

/* =============================================
   SVG CHARTS — TREND LINE
   ============================================= */
.trend-wrap {
  position: relative;
}

.trend-svg {
  width: 100%;
  height: auto;
}

.trend-dot {
  transition: r 0.15s;
}

.trend-hover:hover + .trend-dot,
.trend-hover:hover ~ .trend-dot {
  r: 5;
}

.tick-label {
  font-family: var(--mono);
  font-size: 8px;
  fill: var(--muted);
}

/* =============================================
   SVG CHARTS — HEATMAP
   ============================================= */
.heatmap-wrap {
  position: relative;
}

.heatmap-svg {
  width: 100%;
  height: auto;
}

.heatmap-cell {
  cursor: pointer;
  transition: stroke 0.15s, stroke-width 0.15s;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 6px;
}

.heatmap-legend-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
}

.heatmap-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--accent);
}

/* =============================================
   CHART TOOLTIP
   ============================================= */
.chart-tooltip {
  position: absolute;
  padding: 6px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  pointer-events: none;
  z-index: 40;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  line-height: 1.5;
}

/* =============================================
   VIZ GRID 2x2
   ============================================= */
.viz-grid-2x2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
}

@media (max-width: 768px) {
  .viz-grid-2x2 {
    grid-template-columns: 1fr;
  }
  .bulk-toolbar {
    flex-direction: column;
    gap: 8px;
  }
  .bulk-toolbar-right {
    flex-wrap: wrap;
  }
  .table-head-check {
    grid-template-columns: 28px 70px 1fr 90px 90px 100px 80px 70px;
  }
  .table-row-check {
    grid-template-columns: 28px 70px 1fr 90px 90px 100px 80px 70px;
  }
}

/* =============================================
   HIDDEN BY DEFAULT (replaced inline styles)
   ============================================= */
.hidden { display: none; }
