/* ── CSS Variables ───────────────────────────────────────────────── */
:root {
  /* Light, warm main background like SPED AMS */
  --bg-base:       #f5f0e8;
  --bg-surface:    #ffffff;
  --bg-elevated:   #ffffff;
  --bg-hover:      #f0ebe1;
  --bg-active:     #e8e2d6;

  /* Sidebar-specific */
  --sidebar-bg:    #1a3d54;
  --sidebar-hover: #163348;
  --sidebar-active:#122a3d;
  --sidebar-border:rgba(255,255,255,0.08);

  --border:        #d4cec3;
  --border-subtle: #e8e2d6;

  --text-primary:  #2c3e50;
  --text-secondary:#5f6b7a;
  --text-muted:    #9aa3b3;
  --text-inverse:  #ffffff;

  /* Accent teal/green for headings (matches SPED AMS) */
  --accent:        #2f6fb2;
  --accent-2:      #5aa2cf;
  --accent-green:  #2f9c6b;
  --accent-red:    #e25b5b;
  --accent-amber:  #d4883a;
  --heading-color: #2c5f4e;

  --accent-bg:     rgba(47, 111, 178, 0.10);
  --green-bg:      rgba(47, 156, 107, 0.08);
  --red-bg:        rgba(226, 91, 91, 0.08);
  --amber-bg:      rgba(212, 136, 58, 0.10);

  --radius-sm:     4px;
  --radius:        8px;
  --radius-lg:     12px;
  --radius-xl:     16px;

  --font-sans:     'Geist', -apple-system, sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  --shadow-sm:     0 1px 3px rgba(0,0,0,0.06);
  --shadow:        0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.10);
  --sidebar-w:     240px;
}

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

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

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: none;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

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

.db-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  font-family: var(--font-mono);
}

.db-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
  animation: pulse-dot 2s infinite;
}

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

.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.65);
  font-size: 13.5px;
  font-weight: 450;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--text-inverse);
}

.nav-item.active {
  background: rgba(255,255,255,0.10);
  color: var(--text-inverse);
  font-weight: 500;
}

.nav-item.active svg { color: var(--text-inverse); }

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

.sidebar-footer-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

.mono { font-family: var(--font-mono); }

/* ── Main Content ────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px 0;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--heading-color);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.content-area {
  padding: 24px 32px 40px;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
}
.btn-primary:hover:not(:disabled) {
  background: #3d8ef0;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,156,249,0.3);
}

.btn-success {
  background: var(--accent-green);
  color: #052e16;
}
.btn-success:hover:not(:disabled) {
  background: #2fc88b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52,211,153,0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-active);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--red-bg);
  color: var(--accent-red);
  border: 1px solid rgba(248,113,113,0.2);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(248,113,113,0.15);
}

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

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

.card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body { padding: 20px; }

/* ── Upload Zone ─────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 56px 40px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
}

.upload-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(79,156,249,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 4px rgba(79,156,249,0.06), inset 0 0 40px rgba(79,156,249,0.02);
}

.upload-zone.drag-over {
  border-style: solid;
  transform: scale(1.005);
}

.upload-icon {
  width: 52px; height: 52px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--accent);
}

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

.upload-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.upload-constraint {
  display: inline-flex;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── Progress Bar ────────────────────────────────────────────────── */
.progress-wrap {
  background: var(--bg-elevated);
  border-radius: 99px;
  height: 3px;
  overflow: hidden;
  margin-top: 16px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 99px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ── Validation Report ───────────────────────────────────────────── */
.validation-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
}

.stat-value.green { color: var(--accent-green); }
.stat-value.red   { color: var(--accent-red); }
.stat-value.amber { color: var(--accent-amber); }
.stat-value.blue  { color: var(--accent); }

/* ── Alert Banners ───────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 8px;
  border: 1px solid transparent;
}

.alert-error {
  background: var(--red-bg);
  border-color: rgba(248,113,113,0.2);
  color: var(--accent-red);
}

.alert-warning {
  background: var(--amber-bg);
  border-color: rgba(251,191,36,0.2);
  color: var(--accent-amber);
}

.alert-success {
  background: var(--green-bg);
  border-color: rgba(52,211,153,0.2);
  color: var(--accent-green);
}

.alert-icon { flex-shrink: 0; margin-top: 1px; }

/* ── Preview Table ───────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead {
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 2;
}

th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color 0.1s;
}

th:hover { color: var(--text-secondary); }

th .sort-icon {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.4;
  font-size: 10px;
}

th.sort-asc .sort-icon,
th.sort-desc .sort-icon { opacity: 1; color: var(--accent); }

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

tbody tr {
  transition: background 0.1s;
}

tbody tr:hover td {
  background: #f8f5ef;
  color: var(--text-primary);
}

tbody tr.row-error td {
  background: rgba(248,113,113,0.04);
}

tbody tr.row-warning td {
  background: rgba(251,191,36,0.04);
}

td .badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
}

td .badge-null {
  background: var(--red-bg);
  color: var(--accent-red);
}

td .badge-dup {
  background: var(--amber-bg);
  color: var(--accent-amber);
}

/* ── Tags ────────────────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  gap: 4px;
}
.tag-blue { background: var(--accent-bg); color: var(--accent); }
.tag-green { background: var(--green-bg); color: var(--accent-green); }
.tag-red { background: var(--red-bg); color: var(--accent-red); }
.tag-amber { background: var(--amber-bg); color: var(--accent-amber); }

/* ── Search Input ────────────────────────────────────────────────── */
.search-wrap {
  position: relative;
}

.search-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px 8px 36px;
  font-size: 13.5px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  outline: none;
  width: 280px;
  transition: border-color 0.15s;
}

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

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,156,249,0.1);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Pagination ──────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 12.5px;
  font-family: var(--font-mono);
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.1s;
}

.page-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

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

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

/* ── Empty State ─────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  margin: 0 auto 14px;
  opacity: 0.3;
  display: block;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-state small { font-size: 12px; }

/* ── Skeleton Loader ─────────────────────────────────────────────── */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
  height: 12px;
}

/* ── File Chip ───────────────────────────────────────────────────── */
.file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.file-chip-icon {
  width: 34px; height: 34px;
  background: var(--accent-bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.file-chip-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

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

.file-chip-remove {
  margin-left: auto;
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  transition: color 0.1s, background 0.1s;
}

.file-chip-remove:hover {
  color: var(--accent-red);
  background: var(--red-bg);
}

/* ── Toast ───────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: slide-up 0.25s ease forwards;
  min-width: 280px;
  max-width: 380px;
}

.toast.hide { animation: slide-down 0.25s ease forwards; }

@keyframes slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slide-down {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(12px); }
}

.toast-success { border-left: 3px solid var(--accent-green); }
.toast-error   { border-left: 3px solid var(--accent-red); }
.toast-warning { border-left: 3px solid var(--accent-amber); }
.toast-info    { border-left: 3px solid var(--accent); }

/* ── Layout Utilities ────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ── Column list ─────────────────────────────────────────────────── */
.columns-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* ── Divider ─────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 16px 0;
}

/* ── Action Row ──────────────────────────────────────────────────── */
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── Accordion ──────────────────────────────────────────────────── */
.accordion {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}

.accordion-header:hover {
  background: #f8f5ef;
}

.accordion-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.accordion-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--radius);
}

.accordion-icon.amber { background: var(--amber-bg); color: var(--accent-amber); }
.accordion-icon.red { background: var(--red-bg); color: var(--accent-red); }
.accordion-icon.blue { background: var(--accent-bg); color: var(--accent); }

.accordion-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.accordion-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.accordion-chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

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

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion.open .accordion-body {
  max-height: 2000px;
}

.accordion-body-inner {
  border-top: 1px solid var(--border-subtle);
}

.accordion-body-inner .table-wrap {
  border: none;
  border-radius: 0;
}

/* ── Modal ───────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.15s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 520px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modal-up 0.2s ease;
}

@keyframes modal-up {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: all 0.1s;
}
.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--border-subtle);
}

/* ── Form Fields ────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 14px;
}

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

.form-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 156, 249, 0.1);
}

/* ── Delete Bar ─────────────────────────────────────────────────── */
.delete-bar {
  background: var(--bg-elevated);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 12px;
  animation: fade-in 0.15s ease;
}

/* ── Checkbox Styling ───────────────────────────────────────────── */
.row-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

th.cb-col, td.cb-col {
  width: 40px;
  text-align: center;
  padding: 10px 8px;
}

/* ── Actions Column ─────────────────────────────────────────────── */
th.actions-col, td.actions-col {
  width: 90px;
  text-align: center;
  padding: 6px 8px;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.action-btn.edit-btn:hover { color: var(--accent); background: var(--accent-bg); }
.action-btn.save-btn { color: var(--accent-green); }
.action-btn.save-btn:hover { background: var(--green-bg); }
.action-btn.cancel-btn { color: var(--accent-red); }
.action-btn.cancel-btn:hover { background: var(--red-bg); }

/* ── Inline Edit ────────────────────────────────────────────────── */
td .inline-edit-input {
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  outline: none;
  width: 100%;
  max-width: 180px;
  box-shadow: 0 0 0 2px rgba(79, 156, 249, 0.12);
}

tr.editing td {
  background: var(--accent-bg) !important;
}

/* ── User Section (Sidebar Footer) ───────────────────────────────── */
.user-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sidebar-border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.user-avatar-placeholder {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255,255,255,0.12);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.user-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-inverse);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 10.5px;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  flex-shrink: 0;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.45);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-btn:hover {
  color: var(--accent-red);
  background: rgba(226,91,91,0.15);
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .validation-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .topbar, .content-area { padding-left: 16px; padding-right: 16px; }
  .validation-grid { grid-template-columns: repeat(2, 1fr); }
  .search-input { width: 100%; }
}
