/* ─── Design Tokens ──────────────────────────────────────────── */
:root {
  /* Primitive colors */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --blue-50:  #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a8a;

  --green-100: #dcfce7;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;

  --yellow-100: #fef9c3;
  --yellow-500: #eab308;
  --yellow-600: #ca8a04;

  --red-100:  #fee2e2;
  --red-500:  #ef4444;
  --red-600:  #dc2626;
  --red-700:  #b91c1c;

  --purple-100: #ede9fe;
  --purple-500: #a855f7;
  --purple-600: #9333ea;

  /* Semantic tokens */
  --bg:              var(--gray-50);
  --surface:         #ffffff;
  --surface-raised:  #ffffff;
  --border:          var(--gray-200);
  --border-subtle:   var(--gray-100);

  --text-primary:    var(--gray-900);
  --text-secondary:  var(--gray-600);
  --text-muted:      var(--gray-400);
  --text-inverse:    #ffffff;

  --primary:         var(--blue-600);
  --primary-hover:   var(--blue-700);
  --primary-active:  var(--blue-800);
  --primary-subtle:  var(--blue-50);
  --primary-ring:    rgba(59, 130, 246, 0.25);

  /* Sidebar tokens */
  --sidebar-bg:        var(--gray-900);
  --sidebar-border:    rgba(255,255,255,.06);
  --sidebar-header-bg: rgba(255,255,255,.03);
  --sidebar-item-fg:   var(--gray-400);
  --sidebar-item-hover-bg:   rgba(255,255,255,.06);
  --sidebar-item-hover-fg:   #ffffff;
  --sidebar-active-bg: rgba(59,130,246,.15);
  --sidebar-active-fg: var(--blue-400);
  --sidebar-active-border: var(--blue-500);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 25px rgba(0,0,0,.1),  0 8px 10px rgba(0,0,0,.04);
  --shadow-modal: 0 25px 50px rgba(0,0,0,.18), 0 10px 20px rgba(0,0,0,.1);

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.12s ease;
  --transition-base: 0.18s ease;
  --transition-slow: 0.28s ease;
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
    "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ─── Layout ─────────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: 224px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
}
.sidebar-header {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  background: var(--sidebar-header-bg);
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-header .badge {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
  color: #fff;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  box-shadow: 0 2px 8px rgba(59,130,246,.4);
  flex-shrink: 0;
}
.sidebar-header h1 {
  margin: 0; font-size: 15px; font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.sidebar-menu { flex: 1; padding: 10px 10px; overflow-y: auto; }
.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.menu-group-title {
  padding: 14px 12px 6px;
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  color: var(--sidebar-item-fg);
  margin-bottom: 2px;
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative;
  user-select: none;
}
.menu-item:hover {
  background: var(--sidebar-item-hover-bg);
  color: var(--sidebar-item-hover-fg);
}
.menu-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-fg);
  font-weight: 600;
}
.menu-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--sidebar-active-border);
  border-radius: 0 2px 2px 0;
}

.menu-icon {
  width: 16px; height: 16px;
  display: inline-block;
  background: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  flex-shrink: 0;
  opacity: 0.8;
}
.menu-item.active .menu-icon,
.menu-item:hover .menu-icon { opacity: 1; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--sidebar-border);
}

/* ─── Main ───────────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}
.topbar-title {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}
.topbar-title b { color: var(--text-primary); margin-left: 4px; font-weight: 600; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 14px;
}
.user-info {
  text-align: right;
  line-height: 1.35;
}
.user-info .name { font-weight: 600; color: var(--text-primary); font-size: 13.5px; }
.user-info .role {
  font-size: 11.5px;
  color: var(--text-muted);
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-400));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  box-shadow: 0 2px 6px rgba(59,130,246,.3);
  flex-shrink: 0;
}
.btn-logout {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.btn-logout:hover { color: var(--red-600); border-color: var(--red-500); background: var(--red-100); }

.content {
  flex: 1;
  padding: 20px 28px 40px;
  overflow-y: auto;
  min-width: 0;
}

/* ─── Card ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 20px 24px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.card-title h3 {
  margin: 0;
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}
.btn:hover {
  color: var(--primary);
  border-color: var(--blue-300);
  background: var(--primary-subtle);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
  border-color: var(--primary);
  box-shadow: 0 1px 3px rgba(37,99,235,.3);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--text-inverse);
  box-shadow: 0 2px 6px rgba(37,99,235,.35);
}
.btn-primary:active { background: var(--primary-active); border-color: var(--primary-active); }

.btn-danger { color: var(--red-600); border-color: #fca5a5; }
.btn-danger:hover {
  color: #fff; background: var(--red-600); border-color: var(--red-600);
  box-shadow: 0 1px 3px rgba(220,38,38,.3);
}

.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: var(--radius-sm); }

.btn-link {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 500;
  height: auto;
  transition: color var(--transition-fast);
}
.btn-link:hover { color: var(--primary-hover); }
.btn-link:active { transform: none; }
.btn-link.danger { color: var(--red-600); }
.btn-link.danger:hover { color: var(--red-700); }

/* ─── Filter bar ─────────────────────────────────────────────── */
.filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 16px;
  margin-bottom: 16px;
  padding: 16px 18px;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.filter-bar .field { display: flex; align-items: center; gap: 8px; }
.filter-bar .field label {
  width: 64px;
  text-align: right;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  flex-shrink: 0;
}
.filter-bar input,
.filter-bar select {
  flex: 1;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 10px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.filter-bar input:focus,
.filter-bar select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.filter-actions {
  grid-column: 4 / -1;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

/* ─── Toolbar ────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.toolbar-left, .toolbar-right { display: flex; gap: 8px; align-items: center; }

/* ─── Table ──────────────────────────────────────────────────── */
.table-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: auto;
  box-shadow: var(--shadow-xs);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 13px;
}
table th {
  background: var(--gray-50);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 11px 14px;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
table td {
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}
table tbody tr:last-child td { border-bottom: none; }
table tbody tr {
  transition: background var(--transition-fast);
}
table tbody tr:hover { background: var(--gray-50); }
table td.actions {
  display: flex;
  gap: 2px;
  align-items: center;
}

/* ─── Tags ───────────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.2px;
}
.tag-red    { background: var(--red-100);    color: var(--red-700); }
.tag-green  { background: var(--green-100);  color: var(--green-700); }
.tag-yellow { background: var(--yellow-100); color: var(--yellow-600); }
.tag-blue   { background: var(--blue-100);   color: var(--blue-800); }
.tag-gray   { background: var(--gray-100);   color: var(--gray-600); }
.tag-purple { background: var(--purple-100); color: var(--purple-600); }

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 16px;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
}
.pagination button {
  border: 1px solid var(--border);
  background: var(--surface);
  height: 30px;
  min-width: 30px;
  padding: 0 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.pagination button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-subtle); }
.pagination button.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 1px 3px rgba(37,99,235,.3);
}
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ─── Modal ──────────────────────────────────────────────────── */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-mask.show { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: 760px;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  border: 1px solid var(--border);
  animation: slideUp 0.2s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-lg { width: 940px; }
.modal-sm { width: 460px; }

.modal-header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h3 {
  margin: 0; font-size: 16px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.modal-close {
  background: transparent;
  border: none;
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  transition: all var(--transition-fast);
}
.modal-close:hover { color: var(--text-primary); background: var(--gray-100); }
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  border-top: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ─── Form ───────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 20px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-grid .span2 { grid-column: span 2; }

.form-item label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.1px;
}
.form-item label .req { color: var(--red-500); margin-right: 2px; }
.form-item .switch { display: inline-flex; margin-bottom: 0; }

.form-item input,
.form-item select,
.form-item textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 13.5px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: auto;
}
.form-item input::placeholder,
.form-item textarea::placeholder { color: var(--text-muted); }
.form-item textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.form-item input:hover,
.form-item select:hover { border-color: var(--gray-300); }
.form-item input:focus,
.form-item select:focus,
.form-item textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.form-item .help {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.4;
}

/* ─── Switch ─────────────────────────────────────────────────── */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
.switch input { display: none; }
.switch .slider {
  width: 40px;
  height: 22px;
  background: var(--gray-300);
  border-radius: 11px;
  position: relative;
  flex-shrink: 0;
  transition: background var(--transition-base);
}
.switch .slider::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: left var(--transition-base);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::after { left: 21px; }
.switch .switch-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; white-space: nowrap; }

.switch-row {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  padding-top: 4px;
}

/* ─── Image grid ─────────────────────────────────────────────── */
.img-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.img-thumb {
  width: 84px; height: 84px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--gray-50);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-fast);
}
.img-thumb:hover { border-color: var(--gray-400); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-thumb .remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 20px; height: 20px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.img-thumb:hover .remove { opacity: 1; }

.img-upload {
  width: 84px; height: 84px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 24px;
  font-weight: 300;
  background: var(--gray-50);
  transition: all var(--transition-fast);
  gap: 2px;
}
.img-upload span { font-size: 10px; font-weight: 500; margin-top: -2px; }
.img-upload:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-subtle); }

/* ─── Detail view ────────────────────────────────────────────── */
.detail-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.detail-table th, .detail-table td {
  border: 1px solid var(--border);
  padding: 11px 16px;
  font-size: 13px;
  vertical-align: top;
}
.detail-table th {
  width: 13%;
  background: var(--gray-50);
  text-align: center;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
}
.detail-images {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.detail-images img {
  width: 108px; height: 84px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: border-color var(--transition-fast);
}
.detail-images img:hover { border-color: var(--primary); }

/* ─── Evidence import ───────────────────────────────────────── */
.evidence-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 22px 16px;
  text-align: center;
  background: var(--gray-50);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 16px;
  grid-column: 1 / -1;
}
.evidence-drop-zone:hover,
.evidence-drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-subtle);
}
.evidence-drop-zone .drop-icon {
  font-size: 26px;
  color: var(--gray-400);
  line-height: 1;
}
.evidence-drop-zone p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}
.evidence-drop-zone a {
  color: var(--primary);
  text-decoration: none;
}
.evidence-drop-zone a:hover { text-decoration: underline; }

.evidence-summary {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-xl);
  padding: 12px 14px;
  margin-bottom: 16px;
  grid-column: 1 / -1;
}
.evidence-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-primary);
}
.evidence-meta .ev-time { color: var(--text-muted); }
.evidence-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.ev-tag {
  background: var(--blue-50);
  color: var(--blue-800);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 12px;
  white-space: nowrap;
}
.ev-tag b { color: var(--blue-700); }

/* Evidence detail panel in record view */
.evidence-detail {
  margin-top: 4px;
}
.ev-section {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.ev-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--gray-50);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  user-select: none;
}
.ev-section-header:hover { background: var(--gray-100); }
.ev-section-header .ev-count {
  background: var(--blue-100);
  color: var(--blue-800);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
}
.ev-section-body { display: none; overflow-x: auto; }
.ev-section-body.open { display: block; }
.ev-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.ev-data-table th {
  background: var(--gray-50);
  padding: 6px 10px;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  color: var(--text-secondary);
}
.ev-data-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  word-break: break-all;
  max-width: 320px;
}
.ev-data-table tr:last-child td { border-bottom: none; }
.ev-data-table tr:hover td { background: var(--gray-50); }

/* ─── Empty state ────────────────────────────────────────────── */
.empty {
  padding: 72px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
.empty::before {
  content: '📭';
  display: block;
  font-size: 32px;
  margin-bottom: 10px;
}

/* ─── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  top: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--gray-900);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  font-weight: 500;
  z-index: 2000;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  max-width: 360px;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--green-600); }
.toast.error   { background: var(--red-600); }
.toast.warn    { background: var(--yellow-600); color: var(--gray-900); }

/* ─── Stat cards (bookings) ──────────────────────────────────── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 16px 18px;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition-fast);
  border-radius: inherit;
}
.stat-card:hover { box-shadow: var(--shadow-md); border-color: var(--gray-300); transform: translateY(-1px); }
.stat-card.active { border-color: var(--primary); background: var(--primary-subtle); }
.stat-card .stat-n {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -0.03em;
}
.stat-card .stat-l {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1100px) {
  .filter-bar { grid-template-columns: repeat(2, 1fr); }
  .filter-actions { grid-column: 2 / -1; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
  .sidebar { display: none; }
  .content { padding: 16px; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-actions { grid-column: 1 / -1; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
