/* ─── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0F172A;
  --surface:     #1E293B;
  --surface-2:   #263348;
  --border:      #334155;
  --border-2:    #475569;
  --text:        #F8FAFC;
  --text-muted:  #94A3B8;
  --text-dim:    #64748B;
  --accent:      #3B82F6;
  --accent-glow: rgba(59,130,246,0.15);
  --amber:       #F59E0B;
  --amber-bg:    rgba(245,158,11,0.12);
  --green:       #22C55E;
  --green-bg:    rgba(34,197,94,0.12);
  --red:         #EF4444;
  --red-bg:      rgba(239,68,68,0.12);
  --radius:      10px;
  --radius-sm:   6px;
  --font:        'Inter', system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', monospace;
  --sidebar-w:   240px;
  --transition:  150ms ease;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  overflow: hidden;
}

/* ─── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.logo-tagline {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: 0.2px;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-align: left;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(59,130,246,0.2);
}

.nav-item.active .nav-icon svg { stroke: var(--accent); }

.nav-icon { display: flex; align-items: center; flex-shrink: 0; }

.nav-label { flex: 1; }

.nav-badge {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid rgba(245,158,11,0.3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 20px;
  min-width: 28px;
  text-align: center;
}

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

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse-green 2.5s ease-in-out infinite;
}

.status-label {
  font-size: 12px;
  color: var(--text-dim);
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--green); }
  50%       { opacity: 0.6; box-shadow: 0 0 12px var(--green); }
}

/* ─── Main ──────────────────────────────────────────────────────── */
.main {
  flex: 1;
  overflow-y: auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 32px;
  gap: 20px;
}

.page.hidden { display: none; }

/* ─── Page Header ───────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

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

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}

/* Live indicator — the signature element */
.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.25);
  padding: 3px 10px 3px 8px;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.live-indicator.visible { opacity: 1; }

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-live 1.8s ease-in-out infinite;
}

.live-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

.coming-soon-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.pagination-info {
  font-size: 12.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn-refresh {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-refresh:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-refresh:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-refresh.spinning svg {
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.btn-retry {
  margin-top: 12px;
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--transition);
}

.btn-retry:hover { opacity: 0.85; }

.btn-page {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.btn-page:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-2);
}

.btn-page:disabled { opacity: 0.35; cursor: not-allowed; }

/* ─── Stats Bar ─────────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 14px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 120px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 11.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* ─── Table Container ───────────────────────────────────────────── */
.table-container {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  min-height: 320px;
}

/* ─── State Overlays ────────────────────────────────────────────── */
.state-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 10;
  background: var(--surface);
}

.state-overlay.hidden { display: none; }

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.state-icon svg { stroke: var(--text-dim); }
.error-icon svg { stroke: var(--red); }
.empty-icon svg { stroke: var(--green); }

.state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.state-text {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  max-width: 320px;
}

/* ─── Data Table ────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
}

.data-table thead tr {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-title     { width: 25%; }
.col-article   { width: 10%; }
.col-operation { width: 12%; }
.col-reference { width: 14%; }
.col-status    { width: 10%; }
.col-date      { width: 14%; }
.col-details   { width: 8%; }

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

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

.data-table tbody tr:hover { background: var(--surface-2); }

.data-table td {
  padding: 13px 16px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-title {
  font-weight: 500;
  color: var(--text);
  font-size: 13.5px;
}

.cell-title-sub {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-article,
.cell-reference {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
}

.cell-article { color: var(--accent); }

/* Operation badges */
.badge-op {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-op.insert   { background: var(--green-bg);  color: var(--green);  border: 1px solid rgba(34,197,94,0.25); }
.badge-op.delete   { background: var(--red-bg);    color: var(--red);    border: 1px solid rgba(239,68,68,0.25); }
.badge-op.update   { background: var(--accent-glow); color: var(--accent); border: 1px solid rgba(59,130,246,0.25); }
.badge-op.replace  { background: var(--amber-bg);  color: var(--amber);  border: 1px solid rgba(245,158,11,0.25); }
.badge-op.default  { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

/* Status badge */
.badge-status {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-status.pending  { background: var(--amber-bg); color: var(--amber); border: 1px solid rgba(245,158,11,0.3); }
.badge-status.approved { background: var(--green-bg); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.badge-status.rejected { background: var(--red-bg);   color: var(--red);   border: 1px solid rgba(239,68,68,0.3); }

.cell-date {
  font-size: 12.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.btn-details {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.btn-details:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}

/* ─── Pagination ────────────────────────────────────────────────── */
.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.page-numbers {
  display: flex;
  gap: 6px;
  align-items: center;
}

.page-num-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.page-num-btn:hover:not(.active) {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-2);
}

.page-num-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.page-ellipsis {
  color: var(--text-dim);
  font-size: 13px;
  padding: 0 4px;
}

/* ─── Detail Drawer ─────────────────────────────────────────────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 440px;
  max-width: 95vw;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.4);
}

.drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.drawer-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition), border-color var(--transition);
}

.drawer-close:hover { color: var(--text); border-color: var(--border-2); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.drawer-meta-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.drawer-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.drawer-save-hint {
  font-size: 12px;
  color: var(--green);
  opacity: 0;
  transition: opacity var(--transition);
}

.drawer-save-hint.visible { opacity: 1; }

.btn-save {
  padding: 9px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
  flex-shrink: 0;
}

.btn-save:hover { opacity: 0.88; }

.drawer-section { display: flex; flex-direction: column; gap: 8px; }

.drawer-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-dim);
}

.drawer-value {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.6;
}

.drawer-value.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
}

.drawer-content-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.drawer-json-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #93C5FD;
  line-height: 1.7;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.drawer-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  word-break: break-all;
}

/* ─── Edit Form (drawer) ─────────────────────────────────────────── */
.edit-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group { flex: 1; min-width: 0; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-dim);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  padding: 9px 11px;
  transition: border-color var(--transition), background var(--transition);
}

.form-input.mono { font-family: var(--font-mono); font-size: 12.5px; }

.form-textarea {
  resize: vertical;
  line-height: 1.6;
  min-height: 90px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-2);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* ─── Matched Items ──────────────────────────────────────────────── */
.matched-items-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.matched-items-count {
  font-size: 11.5px;
  color: var(--text-dim);
}

.matched-items-empty {
  font-size: 13px;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}

.matched-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.matched-item-card {
  display: flex;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.matched-item-card:hover {
  border-color: var(--border-2);
}

.matched-item-card.selected {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.matched-item-radio-wrap {
  flex-shrink: 0;
  padding-top: 2px;
}

.matched-item-radio {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.matched-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.matched-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.matched-item-article {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
}

.matched-item-ref {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
}

.matched-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.matched-item-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.matched-item-tag {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}

.matched-item-text {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

.matched-item-list {
  list-style: disc;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.matched-item-more {
  font-size: 11px;
  color: var(--text-dim);
}

.matched-item-toggle {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 0;
}

.matched-item-toggle:hover { text-decoration: underline; }

.matched-item-full {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.matched-item-full.hidden { display: none; }

.matched-item-full-text {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

.matched-item-full-exigences ul {
  list-style: disc;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 4px;
}

/* ─── Match count badge (table row) ──────────────────────────────── */
.details-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.match-count-badge {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(59,130,246,0.3);
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ─── History Placeholder ───────────────────────────────────────── */
.history-placeholder {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.placeholder-grid {
  flex: 1;
  padding: 0;
}

.ph-row {
  display: flex;
  gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.ph-header { background: var(--surface-2); }

.ph-cell {
  height: 10px;
  background: var(--border);
  border-radius: 4px;
  flex-shrink: 0;
}

.ph-short  { width: 80px; }
.ph-medium { width: 140px; }
.ph-long   { width: 220px; }

.ph-shimmer {
  background: linear-gradient(90deg, var(--border) 25%, var(--surface-2) 50%, var(--border) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.6s ease infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.placeholder-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  font-size: 13px;
  color: var(--text-dim);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.placeholder-notice svg { stroke: var(--text-dim); flex-shrink: 0; }

/* ─── Filter Row (History) ──────────────────────────────────────── */
.filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-select,
.filter-date {
  padding: 7px 10px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  cursor: not-allowed;
  opacity: 0.5;
}

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

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }
  .page { padding: 20px; }
  .stats-bar { flex-wrap: wrap; }
  .col-reference, .col-date { display: none; }
}

@media (max-width: 680px) {
  body { flex-direction: column; overflow: auto; }
  .sidebar { width: 100%; height: auto; flex-direction: row; flex-wrap: wrap; }
  .sidebar-logo { flex: 1; }
  .sidebar-nav { flex-direction: row; flex: 0 0 100%; padding: 8px 12px; }
  .sidebar-footer { display: none; }
  .main { height: auto; overflow: visible; }
  .col-operation { display: none; }
}
