/* ── Reset & Variables ─────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-base: #0d1117;
  --bg-surface: #161b22;
  --bg-elevated: #1c2230;
  --bg-hover: #21283a;

  --accent: #00bfa5;
  --accent-glow: rgba(0, 191, 165, 0.15);
  --accent-dim: #009688;

  --text-primary: #e6edf3;
  --text-secondary: #a0a6b1;
  --text-muted: #8b949e;

  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(0, 191, 165, 0.4);

  --sidebar-w: 260px;
  --topbar-h: 56px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(0, 191, 165, 0.12);

  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100dvh;
}

/* ── Skip Link ── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--accent);
  color: #0d1117;
  padding: 8px 16px;
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 4px 0;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* ── App Shell ────────────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100dvh;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100dvh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  overflow-y: auto;
  z-index: 100;
}

/* ── Custom Scrollbar ── */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 191, 165, 0.3);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  background: linear-gradient(135deg, var(--accent), #26c6da);
  color: #0d1117;
  font-weight: 800;
  font-size: 13px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo-title {
  font-weight: 600;
  font-size: 13px;
}

.env-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
}

.env-staging {
  background: rgba(255, 167, 38, 0.18);
  color: #ffb74d;
  border: 1px solid rgba(255, 183, 77, 0.3);
}

.env-sandbox {
  background: rgba(100, 181, 246, 0.15);
  color: #64b5f6;
  border: 1px solid rgba(100, 181, 246, 0.3);
}

.env-production {
  background: rgba(129, 199, 132, 0.15);
  color: #81c784;
  border: 1px solid rgba(129, 199, 132, 0.3);
}

.env-local {
  background: rgba(206, 147, 216, 0.15);
  color: #ce93d8;
  border: 1px solid rgba(206, 147, 216, 0.3);
}

/* ── Navigation ───────────────────────────────────────────────────────────── */
.nav-section {
  border-bottom: 1px solid var(--border);
}

.nav-section-header {
  width: 100%;
  background: transparent;
  border: none;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  text-align: left;
}

.nav-section-header:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: var(--bg-hover);
}

.nav-section-header:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-icon {
  font-size: 14px;
}

.chevron {
  margin-left: auto;
  font-size: 10px;
  transition: transform 0.2s;
}

.nav-list {
  list-style: none;
  padding: 4px 0;
}

.nav-subgroup-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 16px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 0;
  font-size: 13px;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-item.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-left-color: var(--accent);
}

.nav-item.nav-sub {
  padding-left: 36px;
  font-size: 12px;
}

.nav-item-icon {
  font-size: 13px;
  width: 18px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  border: 1px solid var(--border);
}

.user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.user-email {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 1px 6px;
  border-radius: 4px;
  width: fit-content;
  margin-top: 2px;
}

.logout-link {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(239, 83, 80, 0.1) !important;
  color: #ef9a9a !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid rgba(239, 83, 80, 0.2) !important;
  padding: 0 !important;
  transition: all 0.2s;
  flex-shrink: 0;
}

.logout-link:hover {
  background: rgba(239, 83, 80, 0.2) !important;
  transform: translateY(-1px);
  border-color: rgba(239, 83, 80, 0.4) !important;
}

/* ── Main Content ─────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-logout-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(239, 83, 80, 0.1);
  color: #ef9a9a;
  border: 1px solid rgba(239, 83, 80, 0.2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-logout-top:hover {
  background: rgba(239, 83, 80, 0.2);
  border-color: rgba(239, 83, 80, 0.4);
  transform: translateY(-1px);
}

.page-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.content-area {
  flex: 1;
  padding: 28px;
  max-width: 1400px;
}

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 13.5px;
}

.alert-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-error {
  background: rgba(244, 67, 54, 0.12);
  border: 1px solid rgba(244, 67, 54, 0.3);
  color: #ef9a9a;
}

.alert-success {
  background: rgba(102, 187, 106, 0.12);
  border: 1px solid rgba(102, 187, 106, 0.3);
  color: #a5d6a7;
}

.alert strong {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.alert p {
  margin: 0;
  opacity: 0.9;
}

/* ── Cards / Dashboard ────────────────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  gap: 16px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s;
  cursor: pointer;
}

.card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.card-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.card h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.card p {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.card-links {
  list-style: none;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.card-links a {
  font-size: 11.5px;
  color: var(--accent);
  text-decoration: none;
  background: var(--accent-glow);
  padding: 2px 8px;
  border-radius: 20px;
}

.card-links a:hover {
  background: rgba(0, 191, 165, 0.25);
}

.card-settings {
  border-color: rgba(206, 147, 216, 0.25);
}

.card-settings:hover {
  border-color: rgba(206, 147, 216, 0.5);
}

/* ── Search Layout ────────────────────────────────────────────────────────── */
.search-layout,
.detail-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1100px) {

  .search-layout,
  .detail-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Filter Panel ─────────────────────────────────────────────────────────── */
.filter-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
}

.filter-group {
  margin-bottom: 18px;
  border: none;
  padding: 0;
  margin-inline: 0;
}

.filter-group legend {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding: 0;
}

.filter-group label:first-child {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.filter-group small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 5px;
}

input[type="text"],
input[type="date"],
input[type="password"],
select,
textarea {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: auto;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 3px 0;
  transition: color 0.15s;
}

.checkbox-label:hover {
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #0d1117;
}

.btn-primary:hover {
  background: var(--accent-dim);
  box-shadow: 0 0 16px var(--accent-glow);
}

.btn-full {
  width: 100%;
}

.btn-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: opacity 0.15s;
}

.btn-link:hover {
  opacity: 0.75;
}

/* ── Results Panel ────────────────────────────────────────────────────────── */
.results-panel {
  min-height: 300px;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.results-count {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--border-accent);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── Data Table ───────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead {
  background: var(--bg-elevated);
}

.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

.data-table th:hover {
  color: var(--text-primary);
}

.data-table th[data-sort="asc"]::after {
  content: " ▲";
  color: var(--accent);
}

.data-table th[data-sort="desc"]::after {
  content: " ▼";
  color: var(--accent);
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr {
  transition: background 0.1s;
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

/* ── Badges ───────────────────────────────────────────────────────────────── */
.code-tag {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.code-tag-lg {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}

.type-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(100, 181, 246, 0.12);
  color: #90caf9;
  border: 1px solid rgba(100, 181, 246, 0.25);
  white-space: nowrap;
}

.type-badge.type-TrainingPackage {
  background: rgba(255, 183, 77, 0.12);
  color: #ffcc80;
  border-color: rgba(255, 183, 77, 0.25);
}

.type-badge.type-Qualification {
  background: rgba(0, 191, 165, 0.12);
  color: #80cbc4;
  border-color: rgba(0, 191, 165, 0.25);
}

.type-badge.type-Unit {
  background: rgba(100, 181, 246, 0.12);
  color: #90caf9;
  border-color: rgba(100, 181, 246, 0.25);
}

.type-badge.type-SkillSet {
  background: rgba(186, 104, 200, 0.12);
  color: #ce93d8;
  border-color: rgba(186, 104, 200, 0.25);
}

.type-badge.type-AccreditedCourse {
  background: rgba(129, 199, 132, 0.12);
  color: #a5d6a7;
  border-color: rgba(129, 199, 132, 0.25);
}

.status-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.status-badge.status-Current {
  background: rgba(129, 199, 132, 0.12);
  color: #a5d6a7;
  border-color: rgba(129, 199, 132, 0.3);
}

.status-badge.status-Superseded {
  background: rgba(255, 167, 38, 0.12);
  color: #ffcc80;
  border-color: rgba(255, 167, 38, 0.3);
}

.status-badge.status-Deleted {
  background: rgba(239, 83, 80, 0.12);
  color: #ef9a9a;
  border-color: rgba(239, 83, 80, 0.3);
}

/* ── Detail Card ──────────────────────────────────────────────────────────── */
.detail-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.detail-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.4;
}

.detail-meta {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 12px;
}

.detail-meta strong {
  color: var(--text-primary);
}

.detail-body-preview {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.detail-body-preview h4 {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.detail-body-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-height: 200px;
  overflow-y: auto;
}

.raw-xml-toggle {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.raw-xml-toggle summary {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}

.raw-xml-toggle summary:hover {
  color: var(--text-secondary);
}

.raw-xml {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 8px;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.5;
  white-space: pre;
}

/* ── Form Card (Settings) ─────────────────────────────────────────────────── */
.form-container {
  max-width: 680px;
}

.form-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.form-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 24px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.form-section-title:first-child {
  margin-top: 0;
}

.form-group {
  margin-bottom: 14px;
}

.form-group>label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-row {
  display: flex;
  gap: 14px;
}

.form-row .form-group {
  flex: 1;
}

.form-check-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-actions {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ── Empty / Loading State ────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  min-height: 280px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13px;
  max-width: 400px;
  line-height: 1.6;
  margin-bottom: 4px;
}

.empty-state strong {
  color: var(--text-primary);
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--bg-hover);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Info Card (Server Time) ──────────────────────────────────────────────── */
.info-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
}

.info-icon {
  font-size: 36px;
}

.info-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.server-time-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}

/* \u2500\u2500 List Page \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */


/* \u2500\u2500 Responsive / Mobile \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */

/* Hamburger button \u2013 hidden on desktop */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 0 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  margin-right: 12px;
}

.hamburger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--text-secondary);
  transition: background 0.15s;
}

.hamburger:hover span {
  background: var(--text-primary);
}

/* Sidebar overlay backdrop */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.open {
  display: block;
}

@media (max-width: 767px) {

  /* Show hamburger */
  .hamburger {
    display: flex;
  }

  /* Sidebar slides in from left */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* Main content takes full width */
  .main-content {
    margin-left: 0;
  }

  /* Topbar becomes flex row with hamburger */
  .topbar {
    padding: 0 16px;
    gap: 0;
  }

  .page-title {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Content area tighter padding */
  .content-area {
    padding: 16px;
  }

  /* Detail card tighter on small screens */
  .detail-card {
    padding: 16px;
  }

  /* Form rows stack vertically */
  .form-row {
    flex-direction: column;
    gap: 0;
  }

  /* Filter panel no longer sticky on mobile */
  .filter-panel {
    position: static;
  }

  /* Dashboard cards single column */
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  /* Info card stack vertically */
  .info-card {
    flex-direction: column;
    gap: 12px;
    padding: 20px;
  }

  /* Make tap targets bigger */
  .nav-item {
    padding: 10px 16px;
  }

  .btn {
    padding: 10px 16px;
  }

  /* Detail meta wraps */
  .detail-meta {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 480px) {

  /* Even tighter on very small phones */
  .content-area {
    padding: 12px;
  }

  .detail-card {
    padding: 12px;
  }

  .code-tag-lg {
    font-size: 18px;
  }

  .detail-title {
    font-size: 17px;
  }

  /* Hide empty-state min-height on tiny screens */
  .empty-state {
    min-height: 160px;
    padding: 32px 16px;
  }
}