:root {
  --bg: #08101f;
  --bg-secondary: #0d1528;
  --shell: rgba(7, 12, 24, 0.92);
  --panel: linear-gradient(180deg, rgba(17, 24, 44, 0.96), rgba(10, 16, 31, 0.96));
  --panel-strong: linear-gradient(180deg, rgba(22, 31, 58, 0.98), rgba(10, 16, 31, 0.98));
  --panel-muted: rgba(14, 20, 38, 0.88);
  --border: rgba(129, 156, 255, 0.16);
  --border-strong: rgba(96, 137, 255, 0.34);
  --text: #f4f7ff;
  --text-secondary: #c5d2f0;
  --muted: #7f8db2;
  --accent: #2f6bff;
  --accent-2: #00c2ff;
  --accent-3: #8b5cf6;
  --accent-4: #ff4fd8;
  --success: #1dd1a1;
  --warning: #ffb648;
  --danger: #ff5b7f;
  --info: #5aa8ff;
  --tone-budget: #8dc5ff;
  --tone-paid: #1dd1a1;
  --tone-open: #ffb648;
  --tone-overpay: #ff4fd8;
  --shadow-sm: 0 14px 28px -18px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(96, 137, 255, 0.08);
  --shadow-md: 0 30px 60px -28px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(96, 137, 255, 0.10), 0 0 40px rgba(47, 107, 255, 0.08);
  --shadow-lg: 0 48px 90px -38px rgba(0, 0, 0, 0.82), 0 0 0 1px rgba(129, 156, 255, 0.12), 0 0 72px rgba(47, 107, 255, 0.12);
  --radius: 24px;
  --radius-sm: 18px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', 'Inter', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(47, 107, 255, 0.22), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 79, 216, 0.18), transparent 20%),
    radial-gradient(circle at bottom center, rgba(0, 194, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #08101f 0%, #0a1224 46%, #070d19 100%);
  color: var(--text);
  font-family: var(--font);
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  outline: none;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: .88rem;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3,
h4,
.brand-card h1 {
  font-family: var(--font-display);
}

.eyebrow {
  margin: 0 0 6px;
  color: #8dc5ff;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
}

/* ─── Progress Bars ──────────────────────────────────────────────────────── */
.progress-bar-bg {
  background: rgba(129, 156, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #1dd1a1, #10ac84);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(29, 209, 161, 0.4);
  transition: width 0.4s ease;
}

/* ─── Panels ─────────────────────────────────────────────────────────────── */
.panel,
.modal-card,
.mini-card,
.alert-card,
.role-tile,
.status-card,
.receipt-box,
.stat-card,
.nav-item,
.role-meta-card,
.month-cell,
.contact-card,
.msg-item,
.receipt-card,
.approval-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

/* ─── Login Screen ───────────────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-shell {
  width: min(1320px, 100%);
  display: grid;
  grid-template-columns: 1.35fr .85fr;
  gap: 24px;
}

.login-hero,
.login-form-card,
.topbar,
.sidebar,
.summary-card,
.gradient-card {
  backdrop-filter: blur(18px);
}

.login-hero,
.login-form-card,
.topbar,
.sidebar,
.summary-card,
.gradient-card,
.premium-panel {
  overflow: hidden;
}

.login-hero {
  padding: 24px;
}

.hero-brand {
  margin-bottom: 24px;
}

.hero-copy {
  margin-bottom: 22px;
  max-width: 58ch;
}

.hero-copy h2 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 3vw, 3.4rem);
  line-height: .98;
  letter-spacing: -.05em;
}

.brand-card {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background:
    radial-gradient(circle at top right, rgba(0, 194, 255, 0.18), transparent 28%),
    radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.20), transparent 30%),
    linear-gradient(160deg, rgba(18, 27, 53, 0.98), rgba(9, 14, 28, 0.98));
  box-shadow: var(--shadow-lg);
}

.brand-card h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.04em;
}

/* hide verbose description in sidebar brand card */
.sidebar .brand-card p {
  display: none;
}

.sidebar .brand-card {
  grid-template-columns: 38px 1fr;
  gap: 8px;
  padding: 10px;
}

.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(227, 235, 255, 0.92));
  padding: 6px;
  box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.55), 0 0 16px rgba(47, 107, 255, 0.14);
}

.sidebar .brand-logo {
  width: 38px;
  height: 38px;
  padding: 4px;
  border-radius: 10px;
}

/* ─── Role Tiles (Login) ─────────────────────────────────────────────────── */
.role-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.role-tile {
  padding: 16px;
  text-align: left;
  cursor: pointer;
  color: var(--text-secondary);
  display: grid;
  gap: 8px;
  min-height: 110px;
  transition: .18s ease;
  background: linear-gradient(180deg, rgba(17, 24, 44, 0.96), rgba(10, 16, 31, 0.96));
}

.role-tile strong {
  color: var(--text);
  font-size: 1rem;
}

.role-tile span {
  font-size: .88rem;
  color: var(--muted);
}

.role-tile.active,
.role-tile:hover {
  border-color: rgba(0, 194, 255, 0.32);
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.30), rgba(0, 194, 255, 0.12));
  color: #f6fbff;
  transform: translateY(-1px);
}

/* ─── Login Form ─────────────────────────────────────────────────────────── */
.login-form-card {
  padding: 22px;
  align-self: stretch;
}

.login-role-explainer {
  margin-top: 18px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(17, 24, 44, 0.72), rgba(10, 16, 31, 0.72));
  border: 1px solid rgba(129, 156, 255, 0.10);
}

.login-role-explainer h4 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.login-buttons,
.button-row,
.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

label {
  display: grid;
  gap: 8px;
  color: var(--text-secondary);
  font-size: .96rem;
  font-weight: 600;
}

input,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(129, 156, 255, 0.14);
  background: rgba(8, 13, 26, 0.9);
  color: var(--text);
}

textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(129, 156, 255, 0.14);
  background: rgba(8, 13, 26, 0.9);
  color: var(--text);
  resize: vertical;
  min-height: 88px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(47, 107, 255, 0.52);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.10), 0 0 18px rgba(47, 107, 255, 0.16);
}

/* ─── App Shell ──────────────────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 10px;
  border-right: 1px solid rgba(129, 156, 255, 0.08);
  background: rgba(5, 10, 20, 0.62);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.role-meta-card {
  padding: 8px;
}

.panel-heading,
.compact-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: .9rem;
  font-weight: 600;
  flex-wrap: wrap;
}

.compact-heading {
  margin-bottom: 8px;
}

.nav {
  display: flex;
  flex-direction: column;
  padding: 12px 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.nav::-webkit-scrollbar {
  width: 4px;
}

.nav::-webkit-scrollbar-track {
  background: transparent;
}

.nav::-webkit-scrollbar-thumb {
  background: rgba(129, 156, 255, 0.16);
  border-radius: 10px;
}

.ghost-button,
.primary-button {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-group-label {
  padding: 12px 14px 6px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-2);
  opacity: 0.8;
}

.nav-item {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  background: transparent;
  color: var(--text-secondary);
  font-size: .95rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.nav-item .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  margin-right: 8px;
  font-size: 1rem;
}

.nav-item .nav-label {
  display: inline;
  vertical-align: middle;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(47, 107, 255, 0.15), transparent);
  color: #fff;
  font-weight: 700;
  border-left: 3px solid var(--accent-2);
  border-radius: 4px 10px 10px 4px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  transform: translateX(4px);
}

.ghost-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  background: rgba(255, 255, 255, 0.05);
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-3) 54%, var(--accent-4));
  color: white;
  border-color: transparent;
  box-shadow: 0 12px 24px -12px rgba(47, 107, 255, 0.58), 0 0 16px rgba(139, 92, 246, 0.18);
  font-weight: 600;
  font-family: var(--font-display);
}

.primary-button:hover {
  opacity: .95;
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -12px rgba(47, 107, 255, 0.7), 0 0 24px rgba(139, 92, 246, 0.3);
}

.full {
  width: 100%;
}

.small-button {
  padding: 7px 12px;
  font-size: .88rem;
  border-radius: 10px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 8px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  color: var(--text-secondary);
  font-size: .82rem;
}

/* ─── Main Content ───────────────────────────────────────────────────────── */
.main-content {
  padding: 12px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.topbar {
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(14, 20, 38, 0.72), rgba(10, 16, 31, 0.68));
  border: 1px solid rgba(129, 156, 255, 0.10);
  border-radius: var(--radius-sm);
}

.topbar h2 {
  margin: 0;
  font-size: clamp(1.2rem, 1.6vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -.04em;
}

.hero-grid,
.dashboard-grid.two-col {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 10px;
}

.gradient-card,
.summary-card,
.panel,
.stat-card,
.chart-card {
  padding: 12px;
}

.gradient-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 79, 216, 0.18), transparent 20%),
    radial-gradient(circle at 14% 100%, rgba(0, 194, 255, 0.18), transparent 24%),
    linear-gradient(140deg, rgba(18, 27, 53, 0.98), rgba(10, 16, 31, 0.98) 55%, rgba(19, 14, 37, 0.98));
  box-shadow: var(--shadow-lg);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.hero-card h3 {
  margin: 0 0 6px;
  font-size: clamp(3.2rem, 1.6vw, 1.8rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -.05em;
  max-width: 14ch;
}

.hero-card .muted {
  max-width: 48ch;
  line-height: 1.4;
  font-size: .86rem;
}

.hero-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-metrics>div {
  min-width: 70px;
  padding: 5px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(129, 156, 255, 0.10);
}

.metric-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.03em;
}

.metric-label,
.stat-title {
  color: var(--muted);
  font-size: .82rem;
}

.summary-card {
  background: radial-gradient(circle at top right, rgba(47, 107, 255, 0.16), transparent 24%), linear-gradient(180deg, rgba(17, 24, 44, 0.98), rgba(8, 13, 26, 0.98));
}

.alert-stack {
  display: grid;
  gap: 8px;
}

.alert-card {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
  border-radius: 12px;
}

.alert-card h4 {
  margin: 0 0 4px;
  font-size: .9rem;
}

.alert-card.warning {
  border-color: rgba(255, 182, 72, 0.36);
  background: rgba(255, 182, 72, 0.04);
}

.alert-card.info {
  border-color: rgba(90, 168, 255, 0.36);
  background: rgba(90, 168, 255, 0.04);
}

.alert-card.success {
  border-color: rgba(29, 209, 161, 0.30);
  background: rgba(29, 209, 161, 0.04);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stat-card {
  padding: 10px;
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.03em;
}

.view-root {
  display: grid;
  gap: 10px;
}

/* ─── Info / Table ───────────────────────────────────────────────────────── */
.info-stack,
.table-like,
.timeline,
.status-grid,
.tags-wrap,
.receipt-box,
.metric-bars,
.mini-bars,
.donut-legend {
  display: grid;
  gap: 8px;
}

.table-like {
  overflow-x: auto;
  padding-bottom: 4px;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline li,
.row,
.status-card,
.receipt-box,
.mini-card {
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(17, 24, 44, 0.92), rgba(10, 16, 31, 0.92));
  border: 1px solid rgba(129, 156, 255, 0.10);
  transition: all .2s ease;
}

.row:hover,
.status-card:hover,
.receipt-box:hover {
  transform: translateY(-2px);
  border-color: rgba(129, 156, 255, 0.25);
  box-shadow: var(--shadow-sm);
}

.timeline li {
  list-style: none;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(129, 156, 255, 0.08);
}

.info-row:last-child {
  border-bottom: 0;
}

.status-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.status-grid.four {
  grid-template-columns: repeat(4, 1fr);
}

.status-card {
  padding: 12px;
  text-align: center;
}

.status-card span {
  display: block;
  color: var(--muted);
  font-size: .82rem;
  margin-bottom: 4px;
}

.status-card strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
}

/* ─── Metric Bars ────────────────────────────────────────────────────────── */
.metric-bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 110px;
  gap: 10px;
  align-items: center;
  font-size: .92rem;
}

.metric-bar-track,
.segmented-track {
  width: 100%;
  min-height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
}

.metric-bar-fill,
.seg {
  display: block;
  height: 10px;
  border-radius: 999px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-fill {
  height: 8px;
  border-radius: 999px;
  transition: width .4s ease;
}

/* ─── Colors / Tones ─────────────────────────────────────────────────────── */
.tone-budget {
  color: #8dc5ff !important;
}

.tone-success {
  color: #7ef0c8 !important;
}

.tone-warning {
  color: #ffd08d !important;
}

.tone-danger {
  color: #ff9cb2 !important;
}

.tone-neutral {
  color: #d5ddf5 !important;
}

.tone-budget-surface {
  background: linear-gradient(180deg, rgba(30, 59, 118, 0.9), rgba(12, 20, 39, 0.95)) !important;
}

.tone-paid-surface {
  background: linear-gradient(180deg, rgba(17, 58, 54, 0.92), rgba(10, 20, 24, 0.95)) !important;
}

.tone-open-surface {
  background: linear-gradient(180deg, rgba(73, 46, 16, 0.92), rgba(20, 16, 10, 0.95)) !important;
}

.metric-bar-fill.tone-budget,
.seg.tone-budget {
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.95), rgba(0, 194, 255, 0.95));
}

.metric-bar-fill.tone-paid,
.seg.tone-paid,
.progress-fill.tone-paid {
  background: linear-gradient(135deg, rgba(29, 209, 161, 0.95), rgba(0, 194, 145, 0.92));
}

.metric-bar-fill.tone-open,
.seg.tone-open {
  background: linear-gradient(135deg, rgba(255, 182, 72, 0.95), rgba(255, 132, 53, 0.92));
}

.metric-bar-fill.tone-overpay {
  background: linear-gradient(135deg, rgba(255, 79, 216, 0.95), rgba(139, 92, 246, 0.92));
}

.metric-bar-fill.tone-neutral {
  background: linear-gradient(135deg, rgba(167, 180, 214, 0.9), rgba(122, 136, 171, 0.85));
}

/* ─── Legend / Donut ─────────────────────────────────────────────────────── */
.donut-legend {
  grid-template-columns: 1fr;
}

.legend-item {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 10px;
  align-items: center;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.legend-dot.tone-budget-dot {
  background: linear-gradient(135deg, rgba(47, 107, 255, 1), rgba(0, 194, 255, 1));
}

.legend-dot.tone-paid-dot {
  background: linear-gradient(135deg, rgba(29, 209, 161, 1), rgba(0, 194, 145, 1));
}

.legend-dot.tone-open-dot {
  background: linear-gradient(135deg, rgba(255, 182, 72, 1), rgba(255, 132, 53, 1));
}

.legend-dot.tone-overpay-dot {
  background: linear-gradient(135deg, rgba(255, 79, 216, 1), rgba(139, 92, 246, 1));
}

/* ─── Table rows ─────────────────────────────────────────────────────────── */
.row {
  display: grid;
  gap: 10px;
  align-items: center;
}

.row.header {
  background: linear-gradient(180deg, rgba(26, 36, 68, 0.96), rgba(14, 20, 38, 0.96));
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.row.cols-3 {
  grid-template-columns: 1.4fr 1fr 1fr;
}

.row.cols-4 {
  grid-template-columns: 1.3fr 1fr 1fr .9fr;
}

.row.cols-5 {
  grid-template-columns: 1.2fr 1fr 1fr 1fr .8fr;
}

/* ─── Pills / Chips ──────────────────────────────────────────────────────── */
.tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .02em;
  transition: all .2s ease;
}

.pill.accent {
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.26), rgba(0, 194, 255, 0.16));
  color: #d7ebff;
  border-color: rgba(0, 194, 255, 0.28);
}

.pill.success {
  background: rgba(29, 209, 161, 0.12);
  color: #b6ffe8;
  border-color: rgba(29, 209, 161, 0.24);
}

.tone-success {
  color: var(--success);
}

.tone-danger {
  color: var(--danger);
}

.tone-accent {
  color: var(--accent);
}

.tone-budget {
  color: var(--tone-budget);
}

.tone-paid {
  color: var(--tone-paid);
}

.tone-open {
  color: var(--tone-open);
}

.clickable-row {
  cursor: pointer;
  transition: background 0.2s;
}

.clickable-row:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

.clickable-row.active {
  background: rgba(47, 107, 255, 0.1) !important;
  border-left: 3px solid var(--accent);
}

.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(47, 107, 255, 0.2);
}

.row.cols-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.2fr;
  align-items: center;
  gap: 16px;
}

.pill.warning {
  background: rgba(255, 182, 72, 0.12);
  color: #ffdca6;
  border-color: rgba(255, 182, 72, 0.28);
}

.pill.info {
  background: rgba(90, 168, 255, 0.12);
  color: #b8d9ff;
  border-color: rgba(90, 168, 255, 0.28);
}

.pill.danger {
  background: rgba(255, 91, 127, 0.12);
  color: #ffb8c8;
  border-color: rgba(255, 91, 127, 0.28);
}

.pill.neutral {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.10);
}

.pill.small {
  font-size: .70rem;
  padding: 3px 8px;
}

.action-chip {
  cursor: pointer;
  transition: .14s ease;
}

.action-chip:hover {
  border-color: rgba(0, 194, 255, 0.4);
  color: #d7ebff;
}

/* ─── Channel Grid (Payment) ─────────────────────────────────────────────── */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.channel-tile {
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: .86rem;
  font-weight: 600;
  background: linear-gradient(180deg, rgba(17, 24, 44, 0.96), rgba(10, 16, 31, 0.96));
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: .16s ease;
}

.channel-tile.active,
.channel-tile:hover {
  border-color: rgba(0, 194, 255, 0.40);
  color: #d7ebff;
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.24), rgba(0, 194, 255, 0.12));
  transform: translateY(-1px);
}

/* ─── QR Panel ───────────────────────────────────────────────────────────── */
.qr-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(17, 24, 44, 0.92), rgba(10, 16, 31, 0.92));
  border: 1px solid rgba(129, 156, 255, 0.14);
}

.qr-visual-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(129, 156, 255, 0.16);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.qr-bank-info {
  display: grid;
  gap: 10px;
}

.qr-info-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  align-items: start;
  font-size: .9rem;
}

.qr-info-row span {
  color: var(--muted);
  font-size: .84rem;
}

.qr-info-row strong {
  word-break: break-all;
}

/* ─── Apple Pay Button ───────────────────────────────────────────────────── */
.apple-pay-button {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: .18s ease;
  letter-spacing: -.01em;
}

.apple-pay-button:hover {
  background: linear-gradient(135deg, #252542, #1e2d52);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ─── Receipt Card ───────────────────────────────────────────────────────── */
.receipt-list {
  display: grid;
  gap: 12px;
}

.receipt-card {
  padding: 16px;
}

.receipt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.receipt-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.receipt-box {
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(17, 24, 44, 0.92), rgba(10, 16, 31, 0.92));
  border: 1px solid rgba(129, 156, 255, 0.10);
}

.receipt-box strong {
  font-size: 1.05rem;
  display: block;
  margin-bottom: 4px;
}

/* ─── Month Grid ─────────────────────────────────────────────────────────── */
.month-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.month-cell {
  padding: 12px 10px;
  text-align: center;
  display: grid;
  gap: 6px;
  align-content: start;
  transition: .16s ease;
  min-height: 100px;
}

.month-label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.month-cell.quittiert {
  border-color: rgba(29, 209, 161, 0.24);
  background: linear-gradient(180deg, rgba(17, 58, 54, 0.7), rgba(10, 20, 24, 0.7));
}

.month-cell.bestätigt {
  border-color: rgba(47, 107, 255, 0.28);
  background: linear-gradient(180deg, rgba(20, 40, 80, 0.7), rgba(10, 16, 31, 0.7));
}

.month-cell[class*="angefragt"] {
  border-color: rgba(0, 194, 255, 0.28);
  background: linear-gradient(180deg, rgba(15, 35, 60, 0.7), rgba(10, 16, 31, 0.7));
}

.month-cell.offen {
  border-color: rgba(255, 182, 72, 0.24);
  background: linear-gradient(180deg, rgba(40, 28, 10, 0.7), rgba(20, 16, 10, 0.7));
}

.month-cell:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.month-pay-icon {
  margin-top: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  color: #ffffff;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.month-pay-icon::after {
  content: '→';
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.month-pay-icon:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 6px 16px rgba(168, 85, 247, 0.4);
}

.month-pay-icon:hover::after {
  transform: translateX(3px);
}

.month-pay-icon:active {
  transform: translateY(0);
}

/* ─── Contacts ───────────────────────────────────────────────────────────── */
.contact-list {
  display: grid;
  gap: 10px;
}

.contact-card {
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.contact-info {
  display: grid;
  gap: 3px;
}

.contact-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── Communication ──────────────────────────────────────────────────────── */
.msg-list {
  display: grid;
  gap: 10px;
}

.msg-item {
  padding: 14px;
}

.msg-header {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.msg-header .muted {
  margin-left: auto;
}

/* ─── Approvals ──────────────────────────────────────────────────────────── */
.approval-list {
  display: grid;
  gap: 10px;
}

.approval-item {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.approval-info {
  display: grid;
  gap: 4px;
}

.approval-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── Cash Flow Steps ────────────────────────────────────────────────────── */
.cash-flow-steps {
  display: grid;
  gap: 0;
  position: relative;
  padding-left: 24px;
}

.cash-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 0;
  border-left: 2px solid rgba(129, 156, 255, 0.14);
  padding-left: 20px;
  position: relative;
}

.cash-step.done {
  border-left-color: rgba(29, 209, 161, 0.38);
}

.cash-step-dot {
  position: absolute;
  left: -7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(129, 156, 255, 0.24);
  border: 2px solid rgba(129, 156, 255, 0.38);
  flex-shrink: 0;
}

.cash-step.done .cash-step-dot {
  background: rgba(29, 209, 161, 0.5);
  border-color: rgba(29, 209, 161, 0.7);
}

.cash-step strong {
  font-size: .96rem;
  display: block;
  margin-bottom: 4px;
}

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal {
  border: none;
  background: transparent;
  padding: 0;
}

.modal::backdrop {
  background: rgba(5, 10, 20, 0.72);
  backdrop-filter: blur(4px);
}

.modal-card {
  width: min(560px, calc(100vw - 32px));
  padding: 22px;
  color: var(--text);
}

dialog {
  color: var(--text);
}

.mini-card {
  padding: 16px;
  border-radius: 14px;
}

/* ─── Chart Card ─────────────────────────────────────────────────────────── */
.chart-card {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(129, 156, 255, 0.08);
}

.compact-space {
  margin-top: 14px;
}

/* ─── Segmented Bar ──────────────────────────────────────────────────────── */
.segmented-track {
  display: flex;
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  gap: 1px;
  margin-bottom: 14px;
}

.seg {
  flex-shrink: 0;
  height: 10px;
  border-radius: 0;
}

.seg:first-child {
  border-radius: 999px 0 0 999px;
}

.seg:last-child {
  border-radius: 0 999px 999px 0;
}

/* ─── Dashboard Premium Panel ────────────────────────────────────────────── */
.premium-panel {
  background:
    radial-gradient(circle at 90% 10%, rgba(47, 107, 255, 0.14), transparent 32%),
    radial-gradient(circle at 10% 90%, rgba(139, 92, 246, 0.12), transparent 30%),
    linear-gradient(160deg, rgba(18, 27, 58, 0.98), rgba(10, 16, 31, 0.98));
}

/* ─── Topbar ─────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar .eyebrow {
  margin-bottom: 4px;
}

/* ─── Misc ───────────────────────────────────────────────────────────────── */
.compact-heading {
  margin-bottom: 10px;
}

.mini-bars {
  display: grid;
  gap: 8px;
}

.tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

  .channel-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1100px) {

  .login-shell,
  .hero-grid,
  .dashboard-grid.two-col,
  .stats-grid,
  .status-grid.four {
    grid-template-columns: 1fr 1fr;
  }

  .role-tiles {
    grid-template-columns: repeat(3, 1fr);
  }

  .app-shell {
    grid-template-columns: 220px 1fr;
  }
}

@media (max-width: 920px) {

  .app-shell,
  .login-shell,
  .hero-grid,
  .dashboard-grid.two-col,
  .stats-grid,
  .status-grid,
  .status-grid.four {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .row.cols-4,
  .row.cols-5,
  .role-tiles {
    grid-template-columns: 1fr 1fr;
  }

  .qr-panel {
    grid-template-columns: 1fr;
  }

  .channel-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .month-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {

  .login-screen,
  .main-content,
  .sidebar {
    padding: 14px;
  }

  .brand-card {
    grid-template-columns: 58px 1fr;
  }

  .brand-logo {
    width: 58px;
    height: 58px;
  }

  .row.cols-4,
  .row.cols-5,
  .role-tiles {
    grid-template-columns: 1fr;
  }

  .channel-grid,
  .month-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-metrics {
    gap: 10px;
  }

  .metric-value {
    font-size: 1.5rem;
  }
}

@media (max-width: 780px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: auto;
    z-index: 40;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid rgba(129, 156, 255, 0.16);
    background: linear-gradient(180deg, rgba(8, 14, 28, 0.96), rgba(6, 10, 20, 0.98));
    box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.42);
    overflow: visible;
  }

  .sidebar .brand-card,
  .sidebar .role-meta-card,
  .sidebar .sidebar-footer {
    display: none;
  }

  .nav {
    display: flex;
    gap: 10px;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    padding: 8px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    border: 1px solid rgba(129, 156, 255, 0.2);
    background: rgba(255, 255, 255, 0.02);
    text-align: center;
    scroll-snap-align: center;
    margin-bottom: 0;
  }

  .nav-item .nav-icon {
    margin: 0;
    width: auto;
    font-size: 1.2rem;
    line-height: 1;
  }

  .nav-item .nav-label {
    display: none;
  }

  .nav-item.active {
    border-left: 1px solid rgba(0, 194, 255, 0.45);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(47, 107, 255, 0.34), rgba(0, 194, 255, 0.16));
    box-shadow: 0 0 0 1px rgba(0, 194, 255, 0.22);
  }

  .nav-item:hover {
    transform: none;
  }

  .main-content {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
}