/* ===== Tokens ===== */
:root {
  --font: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Consolas', monospace;
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar-w: 232px;
  --transition: 0.18s ease;
}

/* ===== Light Theme ===== */
[data-theme="light"] {
  --bg: #F5F5F3;
  --bg-card: #FFFFFF;
  --bg-elevated: #FAFAF9;
  --bg-hover: #F0F0EE;
  --bg-invert: #1A1A1A;
  --border: #E4E4E2;
  --border-light: #ECECEA;
  --text: #1A1A1A;
  --text-secondary: #555;
  --text-muted: #999;
  --text-on-accent: #FFFFFF;
  --accent: #2563EB;
  --accent-dim: rgba(37,99,235,0.08);
  --accent-hover: #1D4FD7;
  --green: #16A34A;
  --green-dim: rgba(22,163,74,0.08);
  --red: #DC2626;
  --red-dim: rgba(220,38,38,0.06);
  --orange: #D97706;
  --orange-dim: rgba(217,119,6,0.08);
  --blue: #2563EB;
  --blue-dim: rgba(37,99,235,0.08);
  --ba: #8B5CF6;
  --ba-dim: rgba(139,92,246,0.08);
  --ma: #0891B2;
  --ma-dim: rgba(8,145,178,0.08);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --sidebar-bg: #FFFFFF;
  --sidebar-text: #1A1A1A;
  --sidebar-muted: #888;
  --sidebar-border: #E4E4E2;
  --sidebar-active-bg: rgba(37,99,235,0.08);
  --sidebar-active-text: var(--accent);
}

/* ===== Dark Theme ===== */
[data-theme="dark"] {
  --bg: #111111;
  --bg-card: #1A1A1A;
  --bg-elevated: #161616;
  --bg-hover: #222;
  --bg-invert: #F0F0F0;
  --border: #2A2A2A;
  --border-light: #202020;
  --text: #ECECEC;
  --text-secondary: #AAA;
  --text-muted: #666;
  --text-on-accent: #FFFFFF;
  --accent: #5B8DEF;
  --accent-dim: rgba(91,141,239,0.1);
  --accent-hover: #7AA4F7;
  --green: #34D399;
  --green-dim: rgba(52,211,153,0.1);
  --red: #F87171;
  --red-dim: rgba(248,113,113,0.08);
  --orange: #FBBF24;
  --orange-dim: rgba(251,191,36,0.1);
  --blue: #5B8DEF;
  --blue-dim: rgba(91,141,239,0.1);
  --ba: #A78BFA;
  --ba-dim: rgba(167,139,250,0.12);
  --ma: #22D3EE;
  --ma-dim: rgba(34,211,238,0.1);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --sidebar-bg: #141414;
  --sidebar-text: #ECECEC;
  --sidebar-muted: #666;
  --sidebar-border: #2A2A2A;
  --sidebar-active-bg: rgba(91,141,239,0.1);
  --sidebar-active-text: var(--accent);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

::selection { background: var(--accent); color: var(--text-on-accent); }

/* ===== Sidebar ===== */
#sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column; z-index: 100;
  border-right: 1px solid var(--sidebar-border);
  transition: width 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}

#sidebar.collapsed {
  width: 56px;
}
#sidebar.collapsed .brand-name,
#sidebar.collapsed .sidebar-user,
#sidebar.collapsed .nav-links span,
#sidebar.collapsed .sidebar-footer-text { display: none; }
#sidebar.collapsed .nav-links { padding: 12px 6px; }
#sidebar.collapsed .nav-link { padding: 9px 0; text-align: center; font-size: 0; }
#sidebar.collapsed .nav-link::before { font-size: 16px; }
#sidebar.collapsed .sidebar-brand { padding: 20px 12px; justify-content: center; }
#sidebar.collapsed .sidebar-toggle svg { transform: rotate(180deg); }
#sidebar.collapsed .sidebar-bottom { justify-content: center; }

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

.sidebar-toggle {
  width: 24px; height: 24px; border-radius: var(--radius-sm);
  border: 1px solid var(--sidebar-border); background: transparent;
  color: var(--sidebar-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); margin-left: auto; flex-shrink: 0;
}
.sidebar-toggle:hover { color: var(--accent); border-color: var(--accent); }
.sidebar-toggle svg { transition: transform 0.2s ease; }

.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent); color: var(--text-on-accent);
  font-family: var(--font); font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.brand-name {
  font-size: 16px; font-weight: 700; letter-spacing: -0.03em;
  color: var(--sidebar-text);
}

.sidebar-user {
  padding: 14px 18px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-user label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--sidebar-muted); font-weight: 500;
  display: block; margin-bottom: 6px;
}

.user-select-row { display: flex; gap: 6px; align-items: center; }

.sidebar-user select {
  flex: 1; padding: 6px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--sidebar-border); background: var(--bg-elevated);
  color: var(--sidebar-text); font-size: 12px; font-family: var(--font);
}
.sidebar-user select:focus { outline: none; border-color: var(--accent); }
.sidebar-user select option { background: var(--bg-card); color: var(--text); }

.user-info { flex: 1; min-width: 0; }
.user-name { display: block; font-size: 13px; font-weight: 600; color: var(--sidebar-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-email { display: block; font-size: 10px; color: var(--sidebar-muted); font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }

.btn-icon {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  border: 1px solid var(--sidebar-border); background: transparent;
  color: var(--sidebar-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; transition: var(--transition); flex-shrink: 0;
}
.btn-icon:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

.nav-links { list-style: none; padding: 12px 10px; flex: 1; }
.nav-links li { margin-bottom: 1px; }

.nav-link {
  display: block; padding: 9px 14px;
  color: var(--sidebar-muted); text-decoration: none;
  font-size: 13px; font-weight: 500; border-radius: var(--radius-sm);
  transition: var(--transition);
}
.nav-link:hover { color: var(--sidebar-text); background: var(--bg-hover); }
.nav-link.active { color: var(--sidebar-active-text); background: var(--sidebar-active-bg); font-weight: 600; }

.sidebar-bottom {
  padding: 14px 18px;
  border-top: 1px solid var(--sidebar-border);
  display: flex; align-items: center; justify-content: space-between;
}

.sidebar-footer-text {
  font-size: 10px; color: var(--sidebar-muted); font-family: var(--font-mono);
  letter-spacing: 0.04em; text-transform: uppercase;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  border: 1px solid var(--sidebar-border); background: transparent;
  color: var(--sidebar-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* ===== Main ===== */
#content {
  margin-left: var(--sidebar-w); flex: 1;
  padding: 32px 40px;
  animation: fadeUp 0.3s ease;
  transition: margin-left 0.2s ease;
}
#sidebar.collapsed ~ #content { margin-left: 56px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes staggerIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Page Header ===== */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 28px; padding-bottom: 18px; border-bottom: 1px solid var(--border);
}
.page-header h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.page-header-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ===== Cards ===== */
.card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 24px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm); animation: staggerIn 0.35s ease both;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.card-header h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; font-family: var(--font);
  cursor: pointer; border: 1px solid transparent;
  transition: var(--transition); text-decoration: none; white-space: nowrap;
}
.btn-primary, .btn-gold { background: var(--accent); color: var(--text-on-accent); }
.btn-primary:hover, .btn-gold:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-success { background: var(--green); color: white; }
.btn-success:hover { opacity: 0.9; }
.btn-outline { background: var(--bg-card); color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--bg-hover); border-color: var(--text-muted); }
.btn-ghost { background: transparent; color: var(--text-muted); border: none; padding: 4px 8px; font-size: 12px; }
.btn-ghost:hover { color: var(--accent); background: var(--accent-dim); }
.btn-ghost.danger:hover { color: var(--red); background: var(--red-dim); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 5px;
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

input[type="text"], input[type="number"], input[type="date"],
input[type="email"], input[type="password"], select, textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font);
  color: var(--text); background: var(--bg-elevated);
  transition: var(--transition);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
textarea { min-height: 100px; resize: vertical; }

/* ===== Type Selector ===== */
.type-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
.type-option {
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  text-align: center; cursor: pointer; transition: var(--transition); background: var(--bg-card);
}
.type-option:hover { border-color: var(--accent); }
.type-option.active { border-color: var(--accent); background: var(--accent-dim); }
.type-option h3 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.type-option p { font-size: 11px; color: var(--text-muted); }

/* ===== Scoring ===== */
.scoring-section { margin-top: 24px; }
.scoring-section-header {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 16px; background: var(--bg-invert); color: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
  font-weight: 700; font-size: 13px;
}
.scoring-section-header span:last-child { font-family: var(--font-mono); font-size: 13px; }

.scoring-group { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.scoring-group-header {
  padding: 7px 16px; background: var(--bg-hover);
  font-weight: 600; font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  display: flex; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.scoring-item {
  display: flex; align-items: center; padding: 7px 16px;
  border-bottom: 1px solid var(--border-light); gap: 12px;
  transition: background 0.1s;
}
.scoring-item:hover { background: var(--bg-hover); }
.scoring-item label { flex: 1; font-size: 13px; color: var(--text-secondary); font-weight: 400; margin-bottom: 0; }
.scoring-item input[type="number"] {
  width: 64px; text-align: center; padding: 5px 6px;
  font-size: 14px; font-weight: 600; font-family: var(--font-mono); border-radius: var(--radius-sm);
}
.scoring-subtotal {
  padding: 6px 16px; background: var(--bg-elevated);
  display: flex; justify-content: flex-end; gap: 10px;
  font-weight: 600; font-size: 12px; color: var(--text-muted);
  border-bottom: 1px solid var(--border); font-family: var(--font-mono);
}
.scoring-section-footer {
  display: flex; justify-content: flex-end; align-items: center;
  padding: 10px 16px; background: var(--bg-hover);
  font-weight: 700; font-size: 13px; color: var(--accent);
  border: 1px solid var(--border); border-top: 2px solid var(--accent);
  border-radius: 0 0 var(--radius) var(--radius);
  gap: 10px; font-family: var(--font-mono);
}

/* ===== Grade Display ===== */
.grade-display {
  margin-top: 24px; padding: 28px;
  background: var(--bg-invert); border-radius: var(--radius);
  display: flex; justify-content: center; gap: 72px; text-align: center;
}
.grade-item h4 { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }
.grade-value { font-family: var(--font); font-size: 42px; font-weight: 700; color: var(--bg); line-height: 1; letter-spacing: -0.04em; }

[data-theme="dark"] .grade-value { color: var(--text); }
[data-theme="dark"] .grade-display { background: var(--bg-elevated); border: 1px solid var(--border); }

.grade-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== Tables ===== */
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); }
td { padding: 11px 12px; font-size: 13px; border-bottom: 1px solid var(--border-light); color: var(--text-secondary); }
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: var(--bg-hover); }
td strong { color: var(--text); font-weight: 600; }

/* ===== Badges ===== */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-success { background: var(--green-dim); color: var(--green); }
.badge-warning { background: var(--orange-dim); color: var(--orange); }
.badge-info { background: var(--blue-dim); color: var(--blue); }
.badge-ba { background: var(--ba-dim); color: var(--ba); font-weight: 700; }
.badge-ma { background: var(--ma-dim); color: var(--ma); font-weight: 700; }

/* ===== Stats ===== */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
  animation: staggerIn 0.35s ease both;
}
.stat-card:nth-child(1) { animation-delay: .04s; }
.stat-card:nth-child(2) { animation-delay: .08s; }
.stat-card:nth-child(3) { animation-delay: .12s; }
.stat-card h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; }
.stat-value { font-size: 32px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== Progress ===== */
.progress-container { margin-top: 12px; }
.progress-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-bottom: 5px; font-weight: 500; }
.progress-bar { width: 100%; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.8s ease; }
.progress-fill.reached { background: var(--green); }

/* ===== Year Sections ===== */
.year-section { margin-bottom: 22px; animation: staggerIn 0.35s ease both; }
.year-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 16px; background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0; font-weight: 700; font-size: 14px;
}
.year-header .sws-val { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--accent); }
.year-header.sws-reached { background: var(--green-dim); border-color: var(--green); }
.year-header.sws-reached .sws-val { color: var(--green); }
.year-section table { border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }

/* ===== Upload ===== */
.upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 48px 32px; text-align: center; cursor: pointer;
  transition: var(--transition); background: var(--bg-elevated);
}
.upload-area:hover, .upload-area.dragover { border-color: var(--accent); background: var(--accent-dim); }
.upload-area h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.upload-area p { font-size: 12px; color: var(--text-muted); }
.upload-icon { width: 40px; height: 40px; margin: 0 auto 12px; border-radius: 50%; background: var(--accent-dim); display: flex; align-items: center; justify-content: center; color: var(--accent); }
.upload-results { margin-top: 14px; }
.upload-result-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 6px; font-size: 12px; background: var(--bg-card); }

/* ===== Zweitgutachten ===== */
.zweit-section { margin-top: 24px; padding: 20px; background: var(--bg-elevated); border-radius: var(--radius); border: 1px solid var(--border); }
.zweit-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.checkbox-group { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.checkbox-group input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.checkbox-group label { font-size: 13px; margin-bottom: 0; color: var(--text-secondary); font-weight: 500; cursor: pointer; }

/* ===== Modal ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal-overlay.hidden { display: none; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); max-width: 440px; width: 90%; animation: staggerIn 0.2s ease; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 20px; padding: 2px 6px; border-radius: 4px; transition: var(--transition); }
.modal-close:hover { color: var(--text); background: var(--bg-hover); }
.modal-body { padding: 20px; }

/* ===== Auth ===== */
.auth-card { width: 100%; max-width: 380px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow); animation: staggerIn 0.4s ease; }
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand .brand-mark { margin: 0 auto 12px; }
.auth-brand h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; }
.auth-brand p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.auth-error { color: var(--red); font-size: 12px; min-height: 18px; margin-top: 6px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 12px; color: var(--text-muted); }
.auth-switch a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

/* ===== Share ===== */
.share-list { display: flex; flex-direction: column; gap: 6px; }
.share-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated); }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state h3 { font-size: 17px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 20px; right: 20px; padding: 10px 20px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; z-index: 300; animation: toastIn 0.25s ease; box-shadow: var(--shadow); }
.toast-success { background: var(--green); color: white; }
.toast-error { background: var(--red); color: white; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

@keyframes confettiFall {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) translateX(var(--drift)) rotate(720deg); opacity: 0; }
}

/* ===== Dropdown ===== */
.dropdown-menu {
  display: none; position: absolute; right: 0; top: 100%;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  z-index: 50; min-width: 140px; padding: 4px 0;
}
.dropdown-menu.show { display: block; }
.dropdown-menu button {
  display: block; width: 100%; padding: 7px 14px;
  font-size: 12px; font-family: var(--font); text-align: left;
  border: none; background: none; color: var(--text); cursor: pointer;
}
.dropdown-menu button:hover { background: var(--bg-hover); }

/* ===== DEIC Badge ===== */
.deic-badge {
  display: inline-block; font-size: 7px; font-weight: 800; letter-spacing: 0.5px;
  background: linear-gradient(135deg, #f59e0b, #d97706, #f59e0b); color: #451a03;
  padding: 1px 5px; border-radius: 3px; margin-left: 5px; vertical-align: middle;
  box-shadow: 0 0 6px rgba(245,158,11,0.4);
  animation: deicPulse 2s ease-in-out infinite;
}
@keyframes deicPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(245,158,11,0.3); }
  50% { box-shadow: 0 0 12px rgba(245,158,11,0.7), 0 0 4px rgba(217,119,6,0.5); }
}

/* ===== Misc ===== */
.actions-cell { display: flex; gap: 2px; flex-wrap: wrap; }
table { table-layout: auto; }

.filter-btn {
  padding: 6px 14px; font-size: 12px; font-weight: 600;
  font-family: var(--font); border: none; cursor: pointer;
  background: var(--bg-elevated); color: var(--text-muted);
  transition: var(--transition);
}
.filter-btn:hover { background: var(--bg-hover); color: var(--text); }
.filter-btn.active { background: var(--accent); color: var(--text-on-accent); }
.form-actions { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  #sidebar { width: 100%; position: relative; flex-direction: row; flex-wrap: wrap; align-items: center; }
  #content { margin-left: 0; padding: 20px 16px; }
  .sidebar-brand { padding: 12px 16px; border-bottom: none; border-right: 1px solid var(--sidebar-border); }
  .sidebar-user { display: none; }
  .nav-links { display: flex; padding: 6px 8px; flex: 1; }
  .nav-link { padding: 8px 10px; font-size: 12px; }
  .sidebar-bottom { display: none; }
  .type-selector { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .grade-display { gap: 36px; padding: 20px; }
  .grade-value { font-size: 30px; }
}
