@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Inter-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/Inter-SemiBold.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/Inter-SemiBold.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/Inter-Bold.woff2') format('woff2');
}

:root {
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg-base: #080c14;
  --bg-surface: #0d1320;
  --bg-elevated: #151b27;
  --bg-card: #192130;
  --bg-hover: #212b3b;
  --border: #293446;
  --border-light: #354258;

  --accent: #2563eb;
  --accent-bright: #3b82f6;
  --accent-glow: rgba(37, 99, 235, 0.25);
  --accent-muted: #1e3a6e;

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --info: #06b6d4;
  --info-bg: rgba(6, 182, 212, 0.1);

  --text-primary: #e8edf5;
  --text-secondary: #8a9bc0;
  --text-muted: #4a5980;
  --text-accent: #3b82f6;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --radius-xl: 10px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-accent: 0 0 30px rgba(37, 99, 235, 0.2);

  --sidebar-width: 260px;
  --header-height: 64px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

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

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: var(--transition);
  overflow: hidden;
}

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

.logo-mark {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  box-shadow: var(--shadow-accent);
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.2;
}
.logo-text span {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-role-badge {
  margin: 16px 16px 0;
  padding: 8px 12px;
  background: var(--accent-muted);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-bright);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-section-label {
  padding: 14px 20px 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: var(--transition);
  position: relative;
  border-radius: 0;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-item.active {
  color: var(--accent-bright);
  background: rgba(37, 99, 235, 0.08);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.nav-item .nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 15px;
}
.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.nav-badge[hidden] { display: none; }

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

.app-legal-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.app-legal-links a,
.legal-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.app-legal-links a:hover,
.legal-links a:hover {
  color: var(--accent-bright);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}
.user-card:hover { background: var(--bg-hover); }

.user-menu {
  margin-top: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.user-menu-head {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.user-menu-head span {
  color: var(--text-muted);
  font-size: 11px;
}

.user-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--danger);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.user-menu button:hover {
  background: var(--bg-hover);
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-muted);
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent-bright);
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

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

/* ─── TOPBAR ─── */
.topbar {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.topbar-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: var(--font-sans);
  text-decoration: none;
}
.topbar-btn.primary {
  background: var(--accent);
  color: #fff;
}
.topbar-btn.primary:hover { background: var(--accent-bright); }
.topbar-btn.ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.topbar-btn.ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ─── PAGE CONTENT ─── */
.page-content {
  flex: 1;
  padding: 28px;
  animation: fadeIn 0.3s ease;
}

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

/* ─── KPI CARDS ─── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.kpi-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.kpi-card.success::before { background: linear-gradient(90deg, var(--success), transparent); }
.kpi-card.warning::before { background: linear-gradient(90deg, var(--warning), transparent); }
.kpi-card.danger::before { background: linear-gradient(90deg, var(--danger), transparent); }
.kpi-card.info::before { background: linear-gradient(90deg, var(--info), transparent); }

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.kpi-value {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 8px;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-delta {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.kpi-delta.up { background: var(--success-bg); color: var(--success); }
.kpi-delta.down { background: var(--danger-bg); color: var(--danger); }

.kpi-icon {
  position: absolute;
  right: 18px; top: 18px;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

/* ─── CARDS & PANELS ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.card-title {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-body { padding: 22px; }
.card-body.no-pad { padding: 0; }
.dashboard-news h3 { margin-bottom: 8px; font-size: 15px; }
.dashboard-news p { color: var(--text-secondary); white-space: pre-wrap; margin-bottom: 10px; }

/* ─── TABLES ─── */
.table-wrap { overflow-x: auto; }

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

thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }

tbody td {
  padding: 13px 16px;
  color: var(--text-secondary);
  vertical-align: middle;
}
tbody td:first-child { color: var(--text-primary); font-weight: 500; }

/* ─── BADGES / STATUS ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-success::before { background: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-warning::before { background: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-danger::before { background: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-info::before { background: var(--info); }
.badge-muted { background: rgba(74,89,128,0.2); color: var(--text-secondary); }
.badge-muted::before { background: var(--text-muted); }
.badge-accent { background: rgba(37,99,235,0.15); color: var(--accent-bright); }
.badge-accent::before { background: var(--accent-bright); }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: var(--font-sans);
  text-decoration: none;
  line-height: 1;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-bright); box-shadow: 0 0 20px rgba(37,99,235,0.4); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }

.btn-warning { background: var(--warning); color: #000; }
.btn-warning:hover { filter: brightness(1.1); }

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

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 8px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── FORMS ─── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1/-1; }

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input, select, textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: var(--transition);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
select { cursor: pointer; }
textarea { resize: vertical; min-height: 90px; }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
select option { background: var(--bg-elevated); }

.form-hint { font-size: 11px; color: var(--text-muted); }

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.filter-card { margin-bottom: 20px; }
.detail-region { margin-top: 20px; scroll-margin-top: calc(var(--header-height) + 16px); }
.detail-heading { margin: 20px 0 10px; font-size: 14px; }
.table-sub { color: var(--text-muted); font-size: 11px; margin-top: 2px; }
.metadata-view { overflow: auto; max-height: 320px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated); color: var(--text-secondary); font: 12px/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; }

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.checkbox-list {
  display: grid;
  gap: 8px;
}

.checkbox-list label {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}

.checkbox-list label:hover { border-color: var(--border-light); background: var(--bg-hover); }
.checkbox-list label:has(input:focus-visible) { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
.checkbox-list label:has(input:checked) { border-color: var(--accent); background: rgba(37,99,235,0.1); color: var(--text-primary); }
.checkbox-list input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.checkbox-list label::before,
.selection-marker {
  content: '';
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin-top: 1px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
}
.checkbox-list label:has(input:checked)::before,
.selection-option:has(input:checked) .selection-marker { border: 5px solid var(--accent-bright); }
.selection-option::before { display: none; }
.selection-option span:last-child { display: grid; gap: 2px; }
.selection-option small { color: var(--text-muted); font-size: 11px; }
.selection-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.choice-list {
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 8px;
}
.choice-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.choice-item:hover { border-color: var(--accent); background: var(--bg-hover); }
.choice-item span, .choice-hint { color: var(--text-muted); font-size: 12px; }
.choice-hint { padding: 10px 2px; }
.choice-primary, .choice-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choice-primary { grid-template-columns: minmax(120px, .4fr) 1fr; color: var(--text-primary) !important; }
.choice-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choice-notes { padding-top: 6px; border-top: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.inline-detail { margin: 8px 0; border: 1px solid var(--border-light); border-radius: var(--radius-md); background: var(--bg-card); overflow: auto; max-height: 70vh; }

.detail-scroll {
  max-width: calc(100vw - var(--sidebar-width) - 88px);
  max-height: 72vh;
  overflow: auto;
  overscroll-behavior: contain;
}

.amount-breakdown { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 1px; margin-top: 20px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--border); }
.amount-breakdown > div { display: grid; gap: 4px; padding: 14px; background: var(--bg-elevated); }
.amount-breakdown span { color: var(--text-muted); font-size: 11px; text-transform: uppercase; }
.amount-breakdown strong { font-size: 16px; }
.text-danger { color: var(--danger); }

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.checkbox-item input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ─── PROGRESS BAR ─── */
.progress-wrap { }
.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 12px;
}
.progress-bar {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-fill.success { background: linear-gradient(90deg, #059669, var(--success)); }
.progress-fill.warning { background: linear-gradient(90deg, #d97706, var(--warning)); }
.progress-fill.danger { background: linear-gradient(90deg, #dc2626, var(--danger)); }

/* ─── TABS ─── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
}
.tab {
  padding: 8px 18px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  white-space: nowrap;
}
.tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.tab:hover:not(.active) { color: var(--text-secondary); }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}
.modal.modal-lg { max-width: 900px; }
.modal.modal-xl { max-width: 1100px; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-title {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: var(--transition);
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }

.modal-body { padding: 26px; }
.modal-footer {
  padding: 18px 26px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ─── CALLCENTER CARDS ─── */
.cc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.cc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.cc-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-accent);
}

.cc-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cc-name {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.cc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.cc-stat { }
.cc-stat-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }
.cc-stat-value { font-family: var(--font-sans); font-size: 18px; font-weight: 700; color: var(--text-primary); }

/* ─── STAFFEL CALC ─── */
.staffel-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}

.staffel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.staffel-row:last-child { border-bottom: none; }

.staffel-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--accent-muted);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  margin-top: 12px;
}
.staffel-total-label {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.staffel-total-amount {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-bright);
}

/* ─── UPLOAD ZONE ─── */
.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
}
.upload-zone:hover {
  border-color: var(--accent);
  background: rgba(37,99,235,0.04);
  color: var(--text-secondary);
}
.upload-zone-icon { font-size: 28px; margin-bottom: 10px; }
.upload-zone p { font-size: 13px; }
.upload-zone strong { color: var(--accent-bright); }

/* ─── TIMELINE ─── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex;
  gap: 14px;
  padding-bottom: 20px;
  position: relative;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 5px;
  position: relative;
  z-index: 1;
}
.timeline-item:not(:last-child) .timeline-dot::after {
  content: '';
  position: absolute;
  left: 50%; top: 100%;
  transform: translateX(-50%);
  width: 2px;
  height: calc(100% + 12px);
  background: var(--border);
}
.timeline-content { flex: 1; }
.timeline-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.timeline-time { font-size: 11px; color: var(--text-muted); }

/* ─── SECTION TITLE ─── */
.section-title {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.section-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

/* ─── DIVIDER ─── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ─── ALERT ─── */
.alert {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-bg); border: 1px solid rgba(16,185,129,0.3); color: var(--success); }
.alert-warning { background: var(--warning-bg); border: 1px solid rgba(245,158,11,0.3); color: var(--warning); }
.alert-danger { background: var(--danger-bg); border: 1px solid rgba(239,68,68,0.3); color: var(--danger); }
.alert-info { background: var(--info-bg); border: 1px solid rgba(6,182,212,0.3); color: var(--info); }

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 40px; margin-bottom: 14px; opacity: 0.4; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-sub { font-size: 13px; }

/* ─── INVOICE PREVIEW ─── */
.invoice-preview {
  background: #fff;
  color: #1a1a2e;
  border-radius: var(--radius-md);
  padding: 40px;
  font-family: var(--font-sans);
}
.invoice-preview * { color: inherit; }
.inv-header { display: flex; justify-content: space-between; margin-bottom: 32px; }
.inv-logo { font-family: var(--font-sans); font-size: 22px; font-weight: 700; color: #2563eb; }
.inv-meta { text-align: right; font-size: 12px; color: #666; }
.inv-meta strong { display: block; font-size: 20px; font-weight: 700; color: #1a1a2e; margin-bottom: 4px; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 30px; }
.inv-party-label { font-size: 10px; font-weight: 700; color: #999; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.inv-party-name { font-size: 15px; font-weight: 700; color: #1a1a2e; }
.inv-party-detail { font-size: 12px; color: #555; line-height: 1.7; }
.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 13px; }
.inv-table th { background: #f1f5f9; padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; color: #666; }
.inv-table td { padding: 11px 14px; border-bottom: 1px solid #e8ecf0; color: #333; }
.inv-total-row { background: #eff6ff; font-weight: 700; }
.inv-total-row td { color: #2563eb !important; font-size: 15px; }
.inv-footer { margin-top: 30px; padding-top: 20px; border-top: 1px solid #e8ecf0; font-size: 11px; color: #888; }

/* ─── NOTIFICATION DOT ─── */
.notif-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 16px;
  transition: var(--transition);
}
.notif-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

/* ─── LOGIN ─── */
.login-page {
  min-height: 100vh;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(37,99,235,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 80% 20%, rgba(37,99,235,0.06) 0%, transparent 60%);
}
.login-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px;
  justify-content: center;
}
.login-title {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 6px;
}
.login-sub {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
}

.login-powered {
  text-align: center;
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.login-error {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 12px;
}

.legal-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.legal-card {
  max-width: 760px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.legal-copy {
  display: grid;
  gap: 18px;
  margin: 24px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.legal-copy a {
  color: var(--accent-bright);
  text-decoration: none;
}

.legal-copy a:hover {
  text-decoration: underline;
}

.legal-intro {
  color: var(--text-primary);
  font-size: 15px;
}

.legal-section {
  display: grid;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.legal-section h2 {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-primary);
}

.legal-section ul {
  display: grid;
  gap: 4px;
  margin-left: 18px;
}

.legal-date {
  color: var(--text-muted);
  font-size: 12px;
}

.legal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .cc-grid { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .detail-scroll { max-width: calc(100vw - 32px); }
  .amount-breakdown { grid-template-columns: 1fr; }
}

/* ─── CHART STUB ─── */
.chart-placeholder {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 80px;
  padding: 8px 0;
}
.chart-bar {
  flex: 1;
  background: linear-gradient(to top, var(--accent), var(--accent-bright));
  border-radius: 3px 3px 0 0;
  opacity: 0.7;
  transition: opacity 0.2s;
  min-height: 4px;
}
.chart-bar:hover { opacity: 1; }

/* ─── SEARCH BAR ─── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  flex: 1;
  max-width: 320px;
}
.search-bar input {
  border: none;
  background: transparent;
  padding: 9px 0;
  font-size: 13px;
  flex: 1;
}
.search-bar input:focus { box-shadow: none; }
.search-bar-icon { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }

/* ─── FILTER ROW ─── */
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.filter-row select {
  width: auto;
  min-width: 140px;
}

/* ─── RANKING LIST ─── */
.rank-list { display: flex; flex-direction: column; gap: 1px; }
.rank-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  transition: var(--transition);
}
.rank-item:first-child { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.rank-item:last-child { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.rank-item:hover { background: var(--bg-hover); }
.rank-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--bg-card);
  color: var(--text-muted);
  flex-shrink: 0;
}
.rank-num.gold { background: rgba(245,158,11,0.2); color: var(--warning); }
.rank-num.silver { background: rgba(148,163,184,0.2); color: #94a3b8; }
.rank-num.bronze { background: rgba(180,120,80,0.2); color: #b47850; }
.rank-info { flex: 1; }
.rank-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.rank-sub { font-size: 11px; color: var(--text-muted); }
.rank-value { font-family: var(--font-sans); font-size: 16px; font-weight: 700; color: var(--text-primary); }

/* ─── DOCUMENT CHECKLIST ─── */
.doc-checklist { display: flex; flex-direction: column; gap: 8px; }
.doc-check-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.doc-check-icon { font-size: 16px; flex-shrink: 0; }
.doc-check-name { flex: 1; color: var(--text-secondary); }
.doc-check-status { font-size: 11px; font-weight: 600; }
.doc-check-status.ok { color: var(--success); }
.doc-check-status.pending { color: var(--warning); }
.doc-check-status.missing { color: var(--danger); }

/* hide */
.hidden { display: none !important; }
