html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --surface-alt: #f7f3ec;
  --text: #1f2d36;
  --muted: #5d6b75;
  --border: #cfc4b6;

  --primary: #124559;
  --primary-600: #0a3342;
  --accent: #b85c38;
  --accent-2: #d58a3b;
  --focus: #2c7da0;

  --success: #16a34a;
  --info: #0284c7;
  --warning: #d97706;
  --error: #dc2626;

  --chart-base: #8a97a1;
  --chart-up: #2f9e68;
  --chart-down: #d45757;
  --chart-grid: rgb(31 45 54 / 0.12);

  --shadow-sm: 0 3px 0 rgb(29 45 52 / 0.14);
  --shadow-md: 0 8px 18px rgb(29 45 52 / 0.12);
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 100% 0%, rgb(184 92 56 / 0.09), transparent 30%),
    radial-gradient(circle at 0% 100%, rgb(18 69 89 / 0.1), transparent 28%),
    var(--bg);
  line-height: 1.6;
  font-size: 17px;
}

h1,
h2,
h3,
h4 {
  font-family: "Fraunces", "Manrope", serif;
  margin: 0;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
  color: var(--muted);
}

.mono {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 0.95rem;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.8rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 100ms ease-out, box-shadow 140ms ease-out, background-color 120ms ease-out;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-600);
}

.btn-secondary {
  background: #efe7da;
  color: var(--primary);
  border: 1px solid #d7ccbd;
}

.btn-danger {
  background: #b42318;
  color: #fff;
  border: 1px solid #8f1c13;
}

.btn-danger:hover {
  background: #8f1c13;
}

.btn-pricing-cta {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-pricing-cta:hover {
  background: #b85c38;
}

.user-pill {
  display: none;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
}

.user-pill:empty {
  display: none !important;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border-radius: 999px;
  font-size: 0.85rem;
  padding: 0.15rem 0.6rem;
  font-weight: 600;
}

.badge-success {
  color: #27462f;
  background: #dcebd8;
}

.badge-warning {
  color: #6c431d;
  background: #f4e4cf;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.section {
  padding: var(--space-8) 0;
}

.section-title {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  margin-bottom: var(--space-4);
}

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

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.kpi-card {
  padding: var(--space-4);
}

.kpi-label {
  font-size: 1rem;
  color: var(--muted);
}

.kpi-value {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 1.85rem;
  margin-top: var(--space-2);
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: var(--space-3);
  padding: var(--space-4);
}

.field {
  display: grid;
  gap: 0.3rem;
}

.field label {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 600;
}

input,
select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0.78rem 0.8rem;
  font: inherit;
  color: var(--text);
  min-height: 48px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  font-size: 0.85rem;
  color: var(--muted);
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(4px);
  background: rgb(244 241 234 / 0.9);
  border-bottom: 1px solid var(--border);
}

.top-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 800;
  padding: 0.15rem 0;
}

.brand img {
  height: 44px !important;
  width: auto;
  display: block;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background:
    linear-gradient(135deg, var(--primary) 0 55%, var(--accent) 55% 100%);
  border: 1px solid rgb(10 51 66 / 0.25);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  margin-left: 1.25rem;
  margin-right: auto;
}

.nav-links a {
  position: relative;
  padding: 0.35rem 0.55rem;
  font-size: 0.95rem;
  border-radius: 6px;
  transition: color 140ms ease-out, background-color 140ms ease-out;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: -2px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 180ms ease-out;
  pointer-events: none;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a:hover::after {
  transform: scaleX(0.6);
}

.nav-links a.active {
  color: var(--primary);
  font-weight: 700;
  border-bottom: 0;
}

.nav-links a.active::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  min-height: 40px;
  min-width: 40px;
  padding: 0.3rem 0.5rem;
}

.nav-links.is-open {
  display: flex;
}

.nav-utility {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
  flex-shrink: 0;
  padding-left: 0.7rem;
  border-left: 1px solid var(--border);
}

/* ── User avatar / dropdown ──────────────────────────────────────── */
.account-menu {
  position: relative;
  display: flex;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Public landing pages add .is-hidden to start the menu invisible; session.js
   removes the class after confirming a logged-in user. */
.account-menu.is-hidden {
  display: none;
}

.account-menu-trigger {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid #c7bba9;
  border-radius: 999px;
  padding: 0.28rem 0.75rem 0.28rem 0.35rem;
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, border-color 0.12s;
}

.account-menu-trigger::-webkit-details-marker {
  display: none;
}

.account-menu[open] .account-menu-trigger {
  background: #f7ead5;
  border-color: #9f834f;
}

.account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0;
  letter-spacing: 0.03em;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative;
  z-index: 1;
}

.account-menu-chevron {
  width: 14px;
  height: 14px;
  opacity: 0.55;
  transition: transform 0.15s;
}

.account-menu[open] .account-menu-chevron {
  transform: rotate(180deg);
}

.account-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 230px;
  display: grid;
  gap: 0.15rem;
  padding: 0.5rem;
  border: 1px solid #d2c3ad;
  border-radius: var(--radius-md);
  background: #fffdf9;
  box-shadow: 0 12px 28px rgba(26, 38, 47, 0.16);
  z-index: 200;
}

.account-menu-user {
  padding: 0.4rem 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.2rem;
}

.account-menu-user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-menu-user-email {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.1rem;
}

.account-menu-panel a,
.account-menu-panel button.account-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 7px;
  padding: 0.45rem 0.5rem;
  font-size: 0.92rem;
  color: var(--text);
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s;
}

.account-menu-panel a:hover,
.account-menu-panel button.account-menu-btn:hover {
  background: #f4ece0;
}

.account-menu-panel a svg,
.account-menu-panel button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
}

.account-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

.account-menu-logout {
  color: var(--error) !important;
}

.account-menu-logout svg {
  opacity: 1 !important;
  color: var(--error);
}

/* ── Account page tabs ───────────────────────────────────────────── */
.account-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: var(--space-5);
  overflow-x: auto;
  scrollbar-width: none;
}

.account-tabs::-webkit-scrollbar {
  display: none;
}

.account-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s;
}

.account-tab-btn:hover {
  color: var(--text);
}

.account-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.account-tab-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.account-panel {
  display: none;
}

.account-panel.active {
  display: block;
}

/* ── Billing stepper ─────────────────────────────────────────────── */
.billing-stepper {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: var(--space-6);
  counter-reset: step;
}

.billing-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  counter-increment: step;
}

.billing-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 15px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.billing-step.done:not(:last-child)::after {
  background: var(--primary);
}

.billing-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  z-index: 1;
  position: relative;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.billing-step.done .billing-step-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.billing-step.active .billing-step-dot {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 3px rgb(18 69 89 / 0.12);
}

.billing-step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 0.35rem;
  text-align: center;
}

.billing-step.active .billing-step-label,
.billing-step.done .billing-step-label {
  color: var(--primary);
}

/* ── Plan selection cards ────────────────────────────────────────── */
.plan-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.plan-card-option {
  padding: var(--space-4);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.plan-card-option:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgb(18 69 89 / 0.08);
}

.plan-card-option.selected {
  border-color: var(--primary);
  background: rgb(18 69 89 / 0.04);
  box-shadow: 0 4px 12px rgb(18 69 89 / 0.1);
}

.plan-card-option .plan-name {
  font-family: "Fraunces", serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.plan-card-option .plan-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  font-family: "Fraunces", serif;
}

.plan-card-option .plan-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.plan-card-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ── Løyve picker (dynamic pricing) ─────────────────────────────── */
.loyve-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4);
  background: var(--surface-alt);
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  max-width: 320px;
}

.loyve-picker-counter {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.loyve-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

.loyve-btn:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
}

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

.loyve-count-display {
  font-family: "Fraunces", serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 3ch;
  text-align: center;
  line-height: 1;
}

.loyve-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: lowercase;
}

/* Price breakdown */
.price-breakdown {
  margin-top: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-width: 420px;
  width: 100%;
}

.price-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  font-size: 0.92rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.price-breakdown-row.is-hidden {
  display: none;
}

.price-breakdown-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  font-weight: 700;
  font-size: 1rem;
  background: var(--surface-alt);
}

/* ── Account sub-form section ────────────────────────────────────── */
.account-form-section {
  display: grid;
  gap: var(--space-5);
  max-width: 540px;
}

.account-form-section + .account-form-section {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.account-section-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-1);
}

.account-section-subtext {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}

/* ── Subscription status card ────────────────────────────────────── */
.sub-status-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.sub-status-card .sub-plan-name {
  font-family: "Fraunces", serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.sub-status-card .sub-plan-meta {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
  margin-top: 0.2rem;
}

.sub-status-card-actions {
  margin-left: auto;
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}

/* ── Editorial Admin Layout (Upload, Register, Reports) ── */
.adm-page {
  min-height: calc(100vh - 76px);
  background: var(--bg);
}

.adm-layout {
  display: flex;
  min-height: inherit;
}

.adm-sidebar {
  width: 320px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.adm-main {
  flex: 1;
  padding: var(--space-6) var(--space-8);
  min-width: 0;
}

@media (max-width: 1024px) {
  .adm-layout {
    flex-direction: column;
  }
  .adm-sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .adm-main {
    padding: var(--space-5) var(--space-4);
  }
}

.adm-sidebar-header {
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.adm-sidebar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.adm-sidebar-body {
  padding: var(--space-5);
  flex: 1;
  overflow-y: auto;
}

.adm-add-form {
  display: grid;
  gap: 0.85rem;
}

.adm-field {
  display: grid;
  gap: 0.35rem;
}

.adm-field label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

.adm-add-btn {
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.4rem;
}

.adm-add-btn:hover {
  background: var(--primary-600);
}

.adm-message {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 1.2em;
}

.adm-content-header {
  margin-bottom: var(--space-6);
}

.adm-content-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.adm-content-hint {
  font-size: 0.95rem;
  color: var(--muted);
}

.adm-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.adm-table {
  width: 100%;
  border-collapse: collapse;
}

.adm-table th {
  background: var(--surface-alt);
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.adm-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text);
}

.adm-table tr:hover td {
  background: #ede8de;
  cursor: pointer;
}

/* ── Reports Page (Lønnsoppgjør) ── */
.rp-page {
  min-height: calc(100vh - 76px);
  background: var(--bg);
}

.rp-layout {
  display: flex;
  min-height: inherit;
}

.rp-sidebar {
  width: 320px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.rp-main {
  flex: 1;
  padding: var(--space-6) var(--space-8);
  min-width: 0;
}

@media (max-width: 1024px) {
  .rp-layout {
    flex-direction: column;
  }
  .rp-sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .rp-main {
    padding: var(--space-5) var(--space-4);
  }
}

.rp-sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1.1rem 1.25rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  min-height: 52px;
  flex-shrink: 0;
}

.rp-sidebar-toggle:hover {
  background: #f0eadd;
}

.rp-sidebar-toggle svg {
  flex-shrink: 0;
  color: var(--accent);
}

.rp-sidebar.is-collapsed {
  width: 52px;
  background: var(--bg);
  border-right-color: transparent;
  transition: width 220ms ease, background-color 220ms ease;
}

.rp-sidebar.is-collapsed .rp-sidebar-body {
  display: none;
}

.rp-sidebar.is-collapsed .rp-sidebar-toggle-label {
  display: none;
}

.rp-sidebar.is-collapsed .rp-sidebar-toggle {
  background: var(--bg);
  border-bottom-color: transparent;
}

.rp-layout:has(.rp-sidebar.is-collapsed) .rp-main {
  flex: 1;
}

.rp-sidebar {
  transition: width 220ms ease, background-color 220ms ease;
}

.rp-sidebar-body {
  padding: var(--space-5);
  flex: 1;
}

.rp-filter-stack {
  display: grid;
  gap: 1.25rem;
}

.rp-field {
  display: grid;
  gap: 0.4rem;
}

.rp-field label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

.rp-filter-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0.25rem 0;
}

.rp-field.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.rp-sidebar-actions {
  margin-top: 2rem;
}

.rp-apply-btn {
  width: 100%;
}

.rp-content-header {
  margin-bottom: var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.rp-table-header th {
  background: var(--surface-alt);
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
}

.rp-table-row td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text);
}

/* ────────────────────────────────────────────────────────────────── */
/* ── Invoice list ────────────────────────────────────────────────── */
.invoice-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.invoice-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.invoice-row .inv-number {
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.invoice-row .inv-amount {
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.invoice-row .inv-due {
  color: var(--muted);
  flex-shrink: 0;
}

.invoice-row .inv-status {
  margin-left: auto;
}

/* ── Onboarding / activation flow ───────────────────────────────── */
.onboarding-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #1a5f7a 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-6);
  margin-bottom: var(--space-6);
}

.onboarding-banner h2 {
  color: #fff;
  font-size: 1.4rem;
  margin-bottom: var(--space-2);
}

.onboarding-banner p {
  color: rgba(255,255,255,0.8);
  margin: 0;
}

.billing-flow-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.billing-flow-step-content {
  display: none;
}

.billing-flow-step-content.active {
  display: block;
}

.payment-method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.payment-method-grid--stacked {
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.payment-method-option {
  position: relative;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.payment-method-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.payment-method-option:hover {
  border-color: var(--primary);
}

.payment-method-option.selected {
  border-color: var(--primary);
  background: rgb(18 69 89 / 0.04);
}

.payment-method-option .pm-icon {
  font-size: 2rem;
  line-height: 1;
}

.payment-method-option .pm-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.payment-method-option .pm-brand-mark {
  flex-shrink: 0;
  border-radius: 8px;
  display: block;
}

.payment-method-option .pm-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.payment-method-option .pm-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.payment-method-option .pm-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: 0.01em;
}

.payment-method-option .pm-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  padding-left: calc(36px + var(--space-3));
}

.payment-method-option.pm-stripe:hover,
.payment-method-option.pm-stripe.selected {
  border-color: #635BFF;
  background: rgb(99 91 255 / 0.05);
  box-shadow: 0 0 0 3px rgb(99 91 255 / 0.08);
}

.payment-method-option.pm-vipps:hover,
.payment-method-option.pm-vipps.selected {
  border-color: #FF5B24;
  background: rgb(255 91 36 / 0.05);
  box-shadow: 0 0 0 3px rgb(255 91 36 / 0.08);
}

.btn-stripe {
  background: #635BFF;
  color: #fff;
  border-color: #635BFF;
}

.btn-stripe:hover:not(:disabled) {
  background: #5147e5;
  border-color: #5147e5;
}

.btn-vipps {
  background: #FF5B24;
  color: #fff;
  border-color: #FF5B24;
}

.btn-vipps:hover:not(:disabled) {
  background: #e74d1a;
  border-color: #e74d1a;
}

@media (max-width: 480px) {
  .payment-method-grid:not(.payment-method-grid--stacked) {
    grid-template-columns: 1fr;
  }
  .plan-cards-grid {
    grid-template-columns: 1fr;
  }
  .billing-stepper {
    display: none;
  }
  .payment-method-option .pm-desc {
    padding-left: 0;
  }
}

.nav-admin-link {
  display: none;
  align-items: center;
  padding: 0.2rem 0.1rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-admin-link:hover {
  color: var(--primary);
  border-bottom-color: rgb(18 69 89 / 0.25);
}

.hero {
  padding: var(--space-8) 0 var(--space-7);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-6);
  align-items: center;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
}

.hero-highlight {
  color: var(--accent);
}

.hero-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.hero-trust {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hero-trust span {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.92rem;
  color: var(--text);
}

.illustration {
  min-height: 320px;
  border-radius: var(--radius-lg);
  background:
    repeating-linear-gradient(
      160deg,
      rgb(18 69 89 / 0.06) 0 2px,
      rgb(255 253 248 / 0.9) 2px 14px
    ),
    linear-gradient(160deg, #fffdf8, #f0e9dd);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
  position: relative;
  overflow: hidden;
}

.illustration .line {
  height: 14px;
  border-radius: 999px;
  margin-bottom: var(--space-3);
  background: linear-gradient(90deg, #d5c4ad, #b9a489);
}

.line.short {
  width: 52%;
}

.line.mid {
  width: 73%;
}

.line.long {
  width: 90%;
}

.price-grid,
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.step-card,
.price-card {
  padding: var(--space-5);
}

.single-price-wrap {
  display: grid;
  place-items: center;
}

.single-price-card {
  width: min(560px, 100%);
}

.single-price-card .btn {
  width: 100%;
}

.price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
}

.list {
  margin-top: var(--space-4);
  display: grid;
  gap: var(--space-2);
}

.list span::before {
  content: "•";
  color: var(--primary);
  margin-right: var(--space-2);
}

.upload-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
}

.flow-step {
  padding: var(--space-3);
  text-align: center;
}

.flow-step strong {
  display: block;
  margin-bottom: var(--space-2);
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #dfd4c4;
}

.progress-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent-2));
  transition: width 340ms ease-out;
}

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

.animate-in {
  animation: riseIn 140ms ease-out forwards;
}

.delay-1 {
  animation-delay: 40ms;
}

.delay-2 {
  animation-delay: 80ms;
}

.delay-3 {
  animation-delay: 120ms;
}

.delay-4 {
  animation-delay: 160ms;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  margin-right: 0.45rem;
  animation: btn-spin 0.6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .btn-spinner {
    animation-duration: 1.4s;
  }
}

.kpi-chip,
.kpi-card-hover,
.rp-kpi-card {
  transition: transform 160ms ease-out, box-shadow 160ms ease-out;
}

.kpi-chip:hover,
.kpi-card-hover:hover,
.rp-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.session-checking {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgb(244 241 234 / 0.96);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  animation: riseIn 200ms ease-out;
}

.session-checking .btn-spinner {
  width: 22px;
  height: 22px;
  border-width: 2.5px;
  margin: 0;
  color: var(--primary);
}

@media (prefers-reduced-motion: reduce) {
  .session-checking {
    animation: none;
  }
}

.filters-help {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.report-guidance {
  margin-top: 0.5rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #d6dee3;
  border-left: 3px solid #9aa7b0;
  border-radius: var(--radius-sm);
  background: #f8fafb;
}

.report-guidance.is-hidden {
  display: none;
}

.report-guidance-title {
  color: #2d424e;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0;
}

.report-guidance-body {
  color: #3b5461;
  margin-top: 0.25rem;
}

.report-guidance-link {
  display: inline-flex;
  align-items: center;
  margin-top: 0.35rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #c5d0d6;
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.report-guidance-link:hover {
  background: #f6f9fb;
}

.payroll-header {
  background: linear-gradient(180deg, #fffdf9 0%, #fbf8f2 100%);
}

.payroll-intro {
  max-width: 66ch;
}

.payroll-panel {
  background: #fffdf9;
}

.payroll-table-title {
  margin-bottom: 0.4rem;
}

.report-setup-badge {
  vertical-align: middle;
}

.report-setup-badge--offset {
  margin-left: 0.45rem;
}

.row-action-btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid #b8c5ce;
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  background: #fff;
  color: var(--primary);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, transform 120ms ease-out;
}

.row-action-btn:hover {
  background: #f3f7fa;
  border-color: #9fb1bc;
  transform: translateY(-1px);
}

.row-action-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.row-action-btn--primary {
  border-color: #cfae7a;
  background: #fff3df;
  color: #6f491d;
}

.row-action-btn--primary:hover {
  border-color: #ba8e53;
  background: #ffebcb;
}

.payroll-edit-panel h3 {
  margin-bottom: 0.35rem;
}

.payroll-edit-form {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.75rem;
}

.payroll-edit-form .next-actions {
  margin-top: 0.2rem;
}

.payroll-edit-form #driverEditStatus {
  min-height: 1.3rem;
}

.quota-status {
  border: 1px solid #98b9c6;
  border-left: 4px solid var(--info);
  border-radius: var(--radius-sm);
  background: #e8f5fb;
  color: #1b495e;
  padding: 0.6rem 0.75rem;
  font-weight: 700;
}

.quota-status--warning {
  border-color: #d9b07a;
  border-left-color: var(--warning);
  background: #fff2e1;
  color: #6e4a1c;
}

.field.is-disabled {
  opacity: 0.6;
}

.trend-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: 0.5rem;
  align-items: end;
  min-height: 240px;
}

.trend-bar {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
}

.trend-bar-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
}

.trend-bar .segment {
  display: block;
  width: 100%;
  min-height: 4px;
}

.trend-bar .segment--base {
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #8a97a1, #66757f);
  background: linear-gradient(180deg, color-mix(in srgb, var(--chart-base) 90%, #fff 10%), color-mix(in srgb, var(--chart-base) 78%, #000 22%));
}

.trend-bar .segment--up {
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #2f9e68, #16754d);
  background: linear-gradient(180deg, color-mix(in srgb, var(--chart-up) 88%, #fff 12%), color-mix(in srgb, var(--chart-up) 78%, #000 22%));
}

.trend-bar .segment--down {
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #d45757, #a83d3d);
  background: linear-gradient(180deg, color-mix(in srgb, var(--chart-down) 88%, #fff 12%), color-mix(in srgb, var(--chart-down) 78%, #000 22%));
}

.trend-bar > span {
  font-size: 0.76rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  color: var(--muted);
}

/* Custom Chart Tooltip */
.chart-tooltip {
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 1000;
  color: var(--text);
  line-height: 1.4;
  min-width: 140px;
}

.chart-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #fff transparent transparent transparent;
}

.trend-bar-rect {
  transition: fill 0.2s ease, filter 0.2s ease;
  cursor: pointer;
}

.trend-bar-rect:hover {
  filter: brightness(1.1);
}

.table-note {
  margin-bottom: var(--space-3);
  font-size: 1rem;
}

.invoice-summary {
  white-space: pre-line;
  line-height: 1.5;
  background: #f8fafb;
  border: 1px solid #d6dee3;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
}

.activation-guide {
  margin-top: 0.6rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #d9b07a;
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-sm);
  background: #fff2e1;
}

.activation-guide.is-hidden {
  display: none;
}

.activation-guide-title {
  margin: 0;
  color: #6e4a1c;
  font-weight: 700;
}

.activation-guide-body {
  margin-top: 0.25rem;
  color: #6e4a1c;
}

.video-card {
  overflow: hidden;
  padding: 0.5rem;
}

.demo-video {
  width: 100%;
  display: block;
  border-radius: var(--radius-sm);
  background: #000;
  min-height: 260px;
  object-fit: cover;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.trust-item {
  padding: 1.1rem;
}

.trust-item h3 {
  margin-bottom: 0.5rem;
}

.final-cta-band {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  padding: 1.5rem;
  border: 2px solid var(--primary);
  background: linear-gradient(180deg, #fffdf8, #f5eee3);
}

.final-cta-band .btn {
  min-width: 250px;
}

.site-footer,
.global-footer {
  border-top: 1px solid var(--border);
  background: #ece5d9;
  padding: var(--space-7) 0 0;
  margin-top: var(--space-8);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--space-6);
  padding-bottom: var(--space-6);
}

@media (max-width: 640px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
}

.footer-brand p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-brand a {
  color: var(--primary);
  font-weight: 700;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-nav-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: var(--space-1);
}

.footer-nav a {
  font-size: 0.92rem;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-nav a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: var(--space-4) 0;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.site-footer a,
.global-footer a {
  color: var(--text);
}

.site-footer a:hover,
.global-footer a:hover {
  color: var(--primary);
}

.login-card {
  width: min(620px, 100%);
  margin: 0 auto;
  padding: 1.2rem;
}

.login-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.user-pill {
  display: none;
  align-items: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  transition: all 0.2s ease;
}

.user-pill:empty {
  display: none !important;
}

.top-nav .user-pill {
  min-height: 34px;
  padding: 0.12rem 0.58rem;
  font-size: 0.8rem;
  border-color: #c8bcae;
}

.top-nav .user-pill::before {
  display: none;
}

.top-nav .nav-utility .btn.btn-secondary {
  padding: 0.2rem 0.72rem;
  min-height: 34px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 999px;
  border-color: #c8bcae;
  background: #f7f1e7;
}

.top-nav .nav-utility .btn.btn-secondary:hover {
  background: #ede3d4;
}

.user-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #9ca3af;
}

.user-pill--admin {
  border-color: #2f4f63;
  background: #dce9f0;
  color: #12384a;
}

.user-pill--admin::before {
  background: #124559;
}

.user-pill--sponsored {
  border-color: #7b4e1f;
  background: #f7e7cf;
  color: #6b431b;
}

.user-pill--sponsored::before {
  background: #b85c38;
}

.user-pill--active {
  border-color: #2f6d45;
  background: #dff3e6;
  color: #1f5633;
}

.user-pill--active::before {
  background: #16a34a;
}

.user-pill--pending {
  border-color: #8d6a2f;
  background: #f5ecd6;
  color: #6a4d1d;
}

.user-pill--pending::before {
  background: #d97706;
}

.user-pill--past-due,
.user-pill--canceled {
  border-color: #8f2f2f;
  background: #f8e0e0;
  color: #742a2a;
}

.user-pill--past-due::before,
.user-pill--canceled::before {
  background: #dc2626;
}

.user-pill--trialing {
  border-color: #2b617f;
  background: #dbeef8;
  color: #144660;
}

.user-pill--trialing::before {
  background: #0284c7;
}

.overview-grid {
  display: grid;
  gap: 1rem;
}

.section-pane {
  padding: 1.2rem 1.35rem;
}

.overview-panel {
  display: grid;
  gap: 1rem;
}

.overview-panel-head .section-title {
  margin-bottom: 0.3rem;
}

.overview-controls {
  display: grid;
  grid-template-columns: minmax(170px, 240px) minmax(170px, 240px) auto;
  gap: 0.7rem;
  align-items: end;
}

.overview-controls .btn {
  min-height: 48px;
}

.kpi-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.kpi-chip {
  border: 1px solid #bdb1a1;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  padding: 0.75rem 0.9rem;
}

.kpi-chip-label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.kpi-chip-value {
  margin-top: 0.2rem;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
}

.kpi-chip-subtle {
  margin-top: 0.2rem;
  font-size: 0.86rem;
}

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

.kpi-delta--up {
  color: var(--success);
}

.kpi-delta--up::before {
  content: "↑ ";
}

.kpi-delta--down {
  color: var(--error);
}

.kpi-delta--down::before {
  content: "↓ ";
}

.trend-chart-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background:
    repeating-linear-gradient(
      to top,
      var(--chart-grid) 0 1px,
      transparent 1px 56px
    ),
    linear-gradient(180deg, #f9f6ef 0%, #fffdf8 100%);
  padding: 0.8rem;
}

.overview-table-wrap {
  border-top: 1px solid var(--border);
  padding-top: 0.35rem;
}

.overview-table-wrap th,
.overview-table-wrap td {
  padding: 0.62rem 0.7rem;
}

.next-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.admin-row-actions {
  display: inline-flex;
  align-items: center;
}

.admin-tabs {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.admin-tab {
  border: 1px solid #c7bba9;
  background: #fff;
  color: var(--primary);
  border-radius: 999px;
  padding: 0.36rem 0.75rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.admin-tab.is-active {
  border-color: #9f834f;
  background: #f7ead5;
  color: #6f491d;
}

.admin-section[hidden] {
  display: none !important;
}

.invoice-action-inline {
  gap: 0.45rem;
}

.invoice-action-select {
  min-height: 34px;
  min-width: 160px;
}

.audit-details summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 700;
}

.audit-details pre {
  margin-top: 0.35rem;
  max-width: 620px;
  max-height: 180px;
  overflow: auto;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fbfaf8;
  font-size: 0.8rem;
}

.admin-status-card {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 0.42rem 0.5rem;
  display: grid;
  gap: 0.35rem;
}

.admin-status-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}

.admin-status-picker {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) auto;
  align-items: center;
  gap: 0.4rem;
}

.admin-status-picker .admin-status-select {
  min-height: 34px;
  padding: 0.36rem 0.52rem;
  font-size: 0.84rem;
  border-color: #c7bba9;
  background: var(--surface);
}

.admin-status-picker .btn {
  min-height: 34px;
  padding: 0.32rem 0.62rem;
  font-size: 0.82rem;
}

@media (max-width: 960px) {
  .admin-status-picker {
    grid-template-columns: 1fr;
  }
  .admin-status-picker .btn {
    justify-self: stretch;
  }
}

.action-btn {
  min-height: 52px;
  min-width: 190px;
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
}

.wizard-step {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
}

.wizard-step.active {
  border-color: var(--primary);
  background: #e5ecef;
}

.wizard-step.done {
  border-color: var(--success);
  background: #e8f6ee;
}

.upload-checklist {
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(29 45 52 / 0.35);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 1rem;
}

.dialog-backdrop.is-hidden {
  display: none;
}

.dialog-panel {
  width: min(520px, 100%);
  padding: 1rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table-empty {
  text-align: center;
  color: var(--muted);
}

.register-tabs {
  margin-top: 1rem;
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-alt);
}

.register-tab {
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  padding: 0.65rem 1rem;
  cursor: pointer;
}

.register-tab:last-child {
  border-right: 0;
}

.register-tab.active {
  background: var(--primary);
  color: #fff;
}

.register-panel.is-hidden {
  display: none;
}

.senior-filters {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (prefers-reduced-motion: reduce) {
  .animate-in,
  .delay-1,
  .delay-2,
  .delay-3 {
    animation: none;
  }

  .btn,
  .progress-bar > span {
    transition: none;
  }
}

@media (max-width: 960px) {
  .hero-grid,
  .kpi-grid,
  .steps-grid,
  .trust-grid,
  .price-grid,
  .upload-flow {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .overview-controls,
  .kpi-chips {
    grid-template-columns: 1fr;
  }

  .wizard-steps,
  .senior-filters {
    grid-template-columns: 1fr;
  }

  .report-guidance {
    padding: 0.75rem;
  }

  .payroll-edit-panel {
    width: min(560px, 100%);
  }

  .row-action-btn {
    width: 100%;
    justify-content: center;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    margin: 0;
    padding: 0.75rem 1rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 180ms ease-out, transform 180ms ease-out, visibility 0s linear 180ms;
  }

  .nav-links.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 180ms ease-out, transform 180ms ease-out, visibility 0s linear 0s;
  }

  .nav-links a {
    width: 100%;
    padding: 0.5rem 0.6rem;
  }

  .nav-links a::after {
    left: 0.6rem;
    right: auto;
    width: 18px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-utility {
    margin-left: 0.25rem;
    padding-left: 0.45rem;
  }

  .user-pill {
    display: none;
  }
}

/* ── Account / Subscription page ────────────────────────────────── */

.acct-page {
  min-height: 100vh;
}

/* Hero */
.acct-hero {
  padding: 2.5rem 0 2rem;
}

.acct-hero--pending {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-600) 100%);
  color: #fff;
}

.acct-hero--active {
  background: linear-gradient(135deg, #1a5c3a 0%, #134528 100%);
  color: #fff;
}

/* Grace period: subscription scheduled to cancel but still active */
.acct-hero--scheduled-cancel {
  background: linear-gradient(135deg, #b96a1f 0%, #8a4d12 100%);
  color: #fff;
}

/* Fully canceled: subscription has ended */
.acct-hero--canceled {
  background: linear-gradient(135deg, #5c1a1a 0%, #3a0f0f 100%);
  color: #fff;
}

.acct-hero-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.acct-hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.4rem;
}

.acct-hero-title {
  font-family: "Fraunces", serif;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.acct-hero-sub {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1rem;
  max-width: 42ch;
}

.acct-hero--pending .user-pill,
.acct-hero--active .user-pill,
.acct-hero--scheduled-cancel .user-pill,
.acct-hero--canceled .user-pill {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.acct-hero--pending .user-pill::before,
.acct-hero--active .user-pill::before,
.acct-hero--scheduled-cancel .user-pill::before,
.acct-hero--canceled .user-pill::before {
  background: rgba(255, 255, 255, 0.6);
}

/* Body */
.acct-body {
  padding: 2rem 0 4rem;
  display: grid;
  gap: 1.25rem;
  max-width: 700px;
}

/* Global message */
.acct-global-msg {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.acct-global-msg--success {
  background: #dff3e6;
  border-color: #86efac;
  color: #15803d;
}

.acct-global-msg--error {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

.acct-global-msg--info {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

/* Checkout card (pending state) */
.acct-checkout-card {
  border: 1.5px solid var(--border);
}

.acct-checkout-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: start;
}

.acct-checkout-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.acct-checkout-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding-top: 0.25rem;
  min-width: 200px;
}

.acct-checkout-pitch {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.acct-cta-btn {
  width: 100%;
  font-size: 1rem;
  padding: 0.9rem 1.4rem;
}

.acct-checkout-stripe-note {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Active plan card */
.acct-active-layout {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.acct-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.acct-plan-name {
  font-family: "Fraunces", serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.acct-plan-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 0.2rem;
}

.acct-plan-meta {
  font-size: 0.88rem;
  margin-top: 0.15rem;
}

.acct-active-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex-shrink: 0;
}

.acct-invoice-section {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 0.25rem;
}

.acct-pending-banner {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.acct-pending-cancel {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.8rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.acct-pending-cancel:hover {
  color: var(--text);
  border-color: var(--text);
}

.acct-pending-cancel:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.acct-change-preview {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  min-height: 4rem;
}

.acct-change-rows p {
  color: var(--text);
}

/* Responsive */
@media (max-width: 600px) {
  .acct-checkout-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .acct-checkout-right {
    min-width: unset;
    width: 100%;
  }

  .acct-active-layout {
    flex-direction: column;
  }

  .acct-active-actions {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .acct-hero-inner {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* ── Dashboard metric grid responsive ───────────────────────────── */
@media (max-width: 900px) {
  .dash-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 540px) {
  .dash-metric-grid {
    grid-template-columns: 1fr !important;
  }
}

.faq-item p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.6;
}
.rp-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.rp-kpi-card {
  padding: 2.5rem 2rem 2.5rem;
  border-top: 4px solid var(--text);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rp-kpi-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.rp-kpi-value {
  display: block;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.45rem;
}

.rp-kpi-sub {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ── Missing Data Alert (main content) ── */

.rp-alert {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: #fff5ed;
  border-left: 4px solid var(--accent);
  margin-bottom: 0;
}

.rp-alert.is-hidden {
  display: none;
}

.rp-alert-icon {
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 0.1rem;
}

.rp-alert-body {
  flex: 1;
}

.rp-alert-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin: 0 0 0.2rem;
}

.rp-alert-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.rp-alert-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.25rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 2px;
  white-space: nowrap;
  transition: opacity 120ms ease-out;
}

.rp-alert-btn:hover {
  opacity: 0.88;
}

/* ── Data Table ── */

.rp-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 2rem;
}

.rp-table {
  width: 100%;
  border-collapse: collapse;
}

.rp-table thead th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--text);
  padding: 0.85rem 1rem;
  border-top: none;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  background: var(--surface);
  text-align: left;
}

.rp-th-sortable:hover {
  color: var(--text);
}

.rp-sort-arrow {
  font-style: normal;
  margin-left: 0.25rem;
  opacity: 0.7;
}

.rp-table tbody td {
  padding: 1rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
  vertical-align: middle;
  color: var(--text);
  transition: background-color 80ms ease;
}

.rp-table tbody tr:nth-child(even) td {
  background: #f3efe7;
}

.rp-table tbody tr:hover td {
  background: #ede8de;
}

.rp-table tbody tr[data-missing-setup="true"] td {
  background: #fdf8ef;
}

.rp-table tbody tr[data-missing-setup="true"]:hover td {
  background: #ede8de;
}

.rp-table .table-empty {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
  font-size: 1rem;
}

/* ── Edit Driver Dialog ── */

.rp-edit-panel {
  width: min(540px, 96vw);
  padding: 0;
  overflow: hidden;
  border-radius: 2px;
}

.rp-bulk-fix-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.rp-bulk-fix-counter {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.rp-bulk-fix-actions {
  flex-wrap: wrap;
}

.rp-edit-header {
  padding: 1.5rem 1.75rem 1rem;
  border-bottom: 2px solid var(--text);
}

.rp-edit-header h3 {
  font-family: "Fraunces", serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.rp-edit-form {
  padding: 1.5rem 1.75rem 1.75rem;
  display: grid;
  gap: 1.1rem;
}

.rp-edit-status {
  font-size: 0.9rem;
  color: var(--muted);
  min-height: 1.3rem;
  margin: 0;
}

.rp-edit-actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.rp-save-btn {
  min-height: 48px;
  border-radius: 2px;
  flex: 1;
  font-size: 1rem;
}

/* ── Responsive: collapse to single column ── */

@media (max-width: 960px) {
  .rp-layout {
    grid-template-columns: 1fr;
  }

  .rp-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 2px solid var(--border);
  }

  .rp-main {
    padding: 1.5rem 1rem 3rem;
  }

  .rp-kpi-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
  }

  .rp-kpi-card {
    border-top: 4px solid var(--text);
  }

  .rp-edit-actions {
    flex-direction: column;
  }
}

/* ===================================================
   ADMINISTRER — Nordic Editorial Redesign (adm-*)
   =================================================== */

.adm-page {
  background: var(--bg);
  min-height: calc(100vh - 76px);
  font-size: 18px;
}

/* Two-column layout: sidebar 30% + main 70% */
.adm-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  align-items: start;
  min-height: calc(100vh - 76px);
  transition: grid-template-columns 220ms ease;
}

.adm-layout:has(.adm-sidebar.is-collapsed) {
  grid-template-columns: 52px 1fr;
}

/* ── Left Sidebar ── */

.adm-sidebar {
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  overflow: hidden;
  border-right: 2px solid #ddd8d0;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  transition: width 220ms ease, background-color 220ms ease;
  width: 280px;
}

.adm-sidebar.is-collapsed {
  width: 52px;
  background: var(--bg);
  border-right-color: transparent;
}

.adm-sidebar.is-collapsed #sidebarBody {
  display: none;
}

.adm-sidebar.is-collapsed .adm-sidebar-toggle-label {
  display: none;
}

.adm-sidebar.is-collapsed .adm-sidebar-toggle {
  background: var(--bg);
  border-bottom-color: transparent;
}

.adm-sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1.1rem 1.25rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  min-height: 52px;
  flex-shrink: 0;
}

.adm-sidebar-toggle:hover {
  background: #f0eadd;
}

.adm-sidebar-toggle svg {
  flex-shrink: 0;
  color: var(--accent);
}


.adm-sidebar-header {
  padding: 2rem 1.75rem 1.25rem;
  border-bottom: 2px solid var(--primary);
  flex-shrink: 0;
}

.adm-sidebar-eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.adm-sidebar-title {
  font-family: "Fraunces", serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
}

/* Tab switcher — horizontal strip below header */

.adm-tab-switcher {
  display: flex;
  border-bottom: 1px solid #ddd8d0;
  flex-shrink: 0;
}

.adm-tab {
  flex: 1;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.85rem 0.4rem;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}

.adm-tab:hover {
  color: var(--primary);
}

.adm-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.adm-tab:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

/* Sidebar body — scrollable add forms */

.adm-sidebar-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ddd8d0 transparent;
}

/* Add form */

.adm-add-form {
  padding: 1.6rem 1.75rem 2rem;
  display: grid;
  gap: 1.3rem;
}

.adm-add-form.is-hidden {
  display: none;
}

/* Uploads sidebar (no form) */

.adm-uploads-sidebar {
  padding: 1.6rem 1.75rem 2rem;
  display: grid;
  gap: 1rem;
}

.adm-uploads-sidebar.is-hidden {
  display: none;
}

.adm-uploads-hint {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

/* Field */

.adm-field {
  display: grid;
  gap: 0.45rem;
}

.adm-field label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
}

.adm-field input {
  border: 1px solid #ddd8d0;
  border-bottom: 2px solid var(--primary);
  border-radius: 0;
  background: #fff;
  padding: 0.85rem 0.75rem;
  font: inherit;
  font-size: 1rem;
  color: var(--primary);
  min-height: 52px;
  width: 100%;
  transition: border-color 120ms ease;
}

.adm-field input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  border-bottom-color: var(--focus);
}

/* Primary add button — solid ink block */

.adm-add-btn {
  display: block;
  width: 100%;
  min-height: 54px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 0;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background-color 120ms ease;
  text-align: center;
  line-height: 54px;
  padding: 0;
}

.adm-add-btn:hover {
  background: var(--primary-600);
}

.adm-add-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Refresh button (uploads) */

.adm-refresh-btn {
  width: 100%;
  min-height: 44px;
  background: transparent;
  color: var(--muted);
  border: 1px solid #ddd8d0;
  border-radius: 0;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.adm-refresh-btn:hover {
  background: #edeae3;
  color: var(--primary);
}

.adm-refresh-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Status message below form */

.adm-message {
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.3em;
  margin: 0;
}

/* Quota hint in license form */

.adm-quota-hint {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.55rem 0.75rem;
  border-left: 3px solid var(--primary);
  background: rgb(0 0 0 / 0.04);
  color: var(--primary);
  line-height: 1.45;
}

.adm-quota-hint--warning {
  border-left-color: var(--warning);
  background: #fff2e1;
  color: #6e4a1c;
}

/* ── Main Content ── */

.adm-main {
  padding: 2.5rem 2.5rem 4rem;
  min-width: 0;
}

.adm-content-header {
  padding-bottom: 1.25rem;
  border-bottom: 2px solid #ddd8d0;
}

.adm-content-title {
  font-family: "Fraunces", serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 0.2rem;
}

.adm-content-hint {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--muted);
  margin: 0;
}

/* Tab panels */

.adm-panel {
  margin-top: 0;
}

.adm-panel.is-hidden {
  display: none;
}

/* Table */

.adm-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.adm-table {
  width: 100%;
  border-collapse: collapse;
}

.adm-table thead th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--text);
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border);
  text-align: left;
  white-space: nowrap;
  background: var(--surface);
}

.adm-table tbody td {
  padding: 1rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
  vertical-align: middle;
  color: var(--text);
  background: #fdf8ef;
  transition: background-color 80ms ease;
}

/* Clickable rows */

.adm-row-clickable {
  cursor: pointer;
}

.adm-row-clickable:hover td,
.adm-table tbody tr:hover td {
  background: #ede8de;
}

.adm-row-clickable:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--primary);
}

.adm-table tbody tr[data-missing-setup="true"] td {
  background: #fdf8ef;
}

.adm-table tbody tr[data-missing-setup="true"]:hover td {
  background: #ede8de;
}

/* "Mangler navn" — subtle underlined italic */

.adm-missing {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #bbb;
  font-style: italic;
}

/* Trash icon delete action */

.adm-delete-link {
  background: none;
  border: none;
  padding: 4px;
  margin: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.35;
  transition: color 120ms ease, opacity 120ms ease;
  border-radius: 4px;
}

.adm-delete-link:hover {
  color: var(--error);
  opacity: 1;
}

.adm-delete-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
  opacity: 1;
}

/* Table empty state */

.adm-table-empty {
  text-align: center;
  color: var(--muted);
  padding: 3.5rem 1rem;
  font-size: 1rem;
}

/* ── Dialogs ── */

.adm-dialog-panel {
  width: min(520px, 96vw);
  padding: 0;
  overflow: hidden;
  border-radius: 0;
  background: #f9f7f2;
  border: 2px solid var(--primary);
}

.adm-dialog-header {
  padding: 1.5rem 1.75rem 1.1rem;
  border-bottom: 2px solid var(--primary);
}

.adm-dialog-header h3 {
  font-family: "Fraunces", serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 0.25rem;
  letter-spacing: -0.015em;
}

.adm-dialog-header p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.adm-dialog-form {
  padding: 1.5rem 1.75rem 1.75rem;
  display: grid;
  gap: 1.25rem;
}

.adm-dialog-actions {
  display: flex;
  gap: 0.65rem;
}

.adm-dialog-save {
  flex: 1;
  min-height: 52px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 0;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.adm-dialog-save:hover {
  background: var(--primary-600);
}

.adm-dialog-save:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.adm-dialog-cancel {
  min-height: 52px;
  padding: 0 1.4rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid #ddd8d0;
  border-radius: 0;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.adm-dialog-cancel:hover {
  background: #edeae3;
  color: var(--primary);
}

.adm-dialog-cancel:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.adm-status-msg {
  font-size: 0.88rem;
  color: var(--muted);
  min-height: 1.3rem;
  margin: 0;
}

.adm-delete-confirm-btn {
  flex: 1;
  min-height: 52px;
  background: var(--error);
  color: #fff;
  border: none;
  border-radius: 0;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.adm-delete-confirm-btn:hover {
  background: #b42318;
}

.adm-delete-confirm-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ── Upload Area ── */

.upload-container {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.upload-dropzone {
  position: relative;
  width: 100%;
  max-width: 500px;
  border: 2px dashed #b8c5ce;
  border-radius: var(--radius-md);
  padding: 3rem 2rem;
  text-align: center;
  background: var(--surface-alt);
  transition: border-color 200ms ease, background-color 200ms ease;
  margin: 0 auto;
}

.upload-dropzone:hover,
.upload-dropzone:focus-within {
  border-color: var(--focus);
  background: #f9fbfd;
}

.upload-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.upload-icon {
  color: var(--primary);
  margin-bottom: 1rem;
}

.upload-instruction {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.upload-status-area {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  margin-top: 2rem;
}

.upload-status-text {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
}

.upload-success-panel {
  text-align: center;
  width: 100%;
  margin-top: 2rem;
  animation: riseIn 400ms ease-out forwards;
}

.upload-animation-track {
  position: relative;
  height: 60px;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  border-bottom: 3px solid #ddd8d0;
  overflow: hidden;
}

.upload-animation-car {
  position: absolute;
  bottom: 0;
  left: 0;
  color: var(--primary);
  animation: driveIn 2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

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

  100% {
    transform: translateX(130px);
  }
}

.upload-success-stats {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  color: var(--primary);
  font-weight: 600;
}

.success-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

/* ── Responsive ── */

@media (max-width: 960px) {
  .adm-layout {
    grid-template-columns: 1fr;
  }

  .adm-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 2px solid #ddd8d0;
    overflow: visible;
  }

  .adm-sidebar-body {
    overflow: visible;
  }

  .adm-main {
    padding: 1.5rem 1rem 3rem;
  }

  .adm-dialog-actions {
    flex-direction: column;
  }

  .adm-add-btn {
    line-height: normal;
    padding: 1rem;
    height: auto;
    min-height: 54px;
  }
}

/* ===================================================
   OPPLASTING — Upload Page (up-*)
   =================================================== */

/* ── Drop Zone ── */

.up-zone {
  position: relative;
  width: 100%;
  min-height: 280px;
  border: 2px solid #ddd8d0;
  background: #faf8f4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 2rem;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
  text-align: center;
  margin-top: 2rem;
}

.up-zone:hover,
.up-zone:focus-within {
  border-color: var(--primary);
  background: #f0ede7;
}

.up-zone--drag {
  border-color: #111 !important;
  background: #edeae3 !important;
}

.up-zone-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.up-zone-icon {
  color: var(--primary);
  flex-shrink: 0;
  transition: transform 200ms ease;
}

.up-zone:hover .up-zone-icon,
.up-zone--drag .up-zone-icon {
  transform: translateY(-4px);
}

.up-zone-heading {
  font-family: "Fraunces", serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.015em;
  margin: 0;
}

.up-zone-sub {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
  letter-spacing: 0.01em;
}

/* ── File preview (after file selected) ── */

.up-file-preview {
  width: 100%;
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid #ddd8d0;
  border-left: 4px solid #111;
  background: #f9f7f2;
  animation: riseIn 200ms ease-out forwards;
}

.up-file-preview.is-hidden {
  display: none;
}

.up-file-icon {
  color: var(--primary);
  flex-shrink: 0;
}

.up-file-info {
  flex: 1;
  min-width: 0;
}

.up-file-name {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  font-weight: 500;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.up-file-size {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: var(--muted);
  display: block;
  margin-top: 0.15rem;
}

.up-file-clear {
  background: none;
  border: none;
  padding: 0.3rem 0.5rem;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  border-radius: 2px;
  flex-shrink: 0;
  transition: color 120ms ease, background-color 120ms ease;
}

.up-file-clear:hover {
  color: var(--error);
  background: #fce8e8;
}

.up-file-clear:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ── Start Upload Button ── */

.up-start-btn {
  display: block;
  width: 100%;
  min-height: 54px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 0;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  cursor: pointer;
  margin-top: 1rem;
  transition: background-color 120ms ease;
}

.up-start-btn:hover {
  background: #2e2e2e;
}

.up-start-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.up-start-btn.is-hidden {
  display: none;
}

/* ── Step Indicators ── */

.up-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-top: 2.5rem;
}

.up-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.85rem 0.5rem;
  border: 1px solid #ddd8d0;
  background: #f9f7f2;
  transition: border-color 200ms ease, background-color 200ms ease, color 200ms ease;
}

.up-step--active {
  border-color: var(--primary);
  border-width: 2px;
  background: #edf2f5;
  animation: up-pulse 2s ease-in-out infinite;
}

.up-step--done {
  border-color: #111;
  background: #111;
}

.up-step--error {
  border-color: var(--error);
  background: var(--error);
}

@keyframes up-pulse {
  0%, 100% { border-color: var(--primary); }
  50%       { border-color: var(--focus); }
}

.up-step-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
  transition: color 200ms ease;
}

.up-step--active .up-step-num {
  color: var(--primary);
}

.up-step--done .up-step-num,
.up-step--error .up-step-num {
  color: #fff;
}

.up-step-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
  transition: color 200ms ease;
}

.up-step--active .up-step-label {
  color: #111;
}

.up-step--done .up-step-label,
.up-step--error .up-step-label {
  color: rgba(255,255,255,0.85);
}

/* ── Progress Bar (augments existing .progress-bar) ── */

.up-progress-wrap {
  margin-top: 1.5rem;
}

.up-progress-wrap .progress-bar {
  height: 6px;
  border-radius: 0;
}

.up-progress-wrap .progress-bar > span {
  background: linear-gradient(90deg, #111 0%, var(--primary) 100%);
}

/* ── Phase Display ── */

.up-phase-display {
  margin-top: 1.75rem;
  min-height: 5rem;
}

.up-phase-display.is-hidden {
  display: none;
}

.up-phase-title {
  font-family: "Fraunces", serif;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 700;
  color: #111;
  letter-spacing: -0.015em;
  margin: 0 0 0.4rem;
  line-height: 1.15;
}

.up-phase-title--error {
  color: var(--error);
}

.up-phase-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}

.up-retry-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 1.25rem;
  padding: 0.7rem 1.4rem;
  background: transparent;
  color: #111;
  border: 2px solid #111;
  border-radius: 0;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.up-retry-btn:hover {
  background: #111;
  color: #fff;
}

.up-retry-btn.is-hidden {
  display: none;
}

.up-retry-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ── Worker Alert ── */

.up-worker-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-top: 1.5rem;
  padding: 1.1rem 1.25rem;
  border-left: 4px solid var(--warning);
  background: #fdf7ed;
}

.up-worker-alert.is-hidden {
  display: none;
}

.up-worker-alert-icon {
  color: var(--warning);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.up-worker-alert-body {
  flex: 1;
}

.up-worker-alert-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #111;
  margin: 0 0 0.2rem;
}

.up-worker-alert-desc {
  font-size: 0.87rem;
  color: var(--muted);
  margin: 0;
}

.up-worker-alert-desc code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  background: rgba(0,0,0,0.06);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

/* ── Success Modal ── */

.up-success-panel {
  width: min(600px, 96vw);
  background: #f9f7f2;
  border: 2px solid #111;
  border-top: 4px solid var(--success);
  border-radius: 0;
  overflow: hidden;
  animation: riseIn 400ms ease-out forwards;
}

.up-success-header {
  padding: 2rem 2rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid #ddd8d0;
}

.up-success-check {
  color: var(--success);
  margin-bottom: 0.75rem;
}

.up-success-title {
  font-family: "Fraunces", serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.02em;
  margin: 0 0 0.3rem;
}

.up-success-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.up-success-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid #ddd8d0;
}

.up-success-kpi {
  padding: 1.5rem 1.25rem 1.25rem;
  border-right: 1px solid #ddd8d0;
  border-top: 3px solid #ddd8d0;
  text-align: center;
}

.up-success-kpi:last-child {
  border-right: none;
}

.up-success-kpi--highlight {
  border-top-color: #111;
}

.up-success-kpi-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.up-success-kpi-value {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.up-success-actions {
  padding: 1.5rem 2rem;
  display: flex;
  gap: 0.75rem;
}

.up-cta-btn {
  flex: 1;
  min-height: 52px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 0;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  cursor: pointer;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background-color 120ms ease;
}

.up-cta-btn:hover {
  background: #2e2e2e;
}

.up-cta-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.up-cta-secondary {
  min-height: 52px;
  padding: 0 1.4rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid #ddd8d0;
  border-radius: 0;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
  white-space: nowrap;
}

.up-cta-secondary:hover {
  background: #edeae3;
  color: #111;
}

.up-cta-secondary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ── Sidebar Checklist ── */

.up-guide-section {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid #ddd8d0;
}

.up-guide-section:last-child {
  border-bottom: none;
}

.up-guide-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.up-guide-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.up-guide-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}

.up-guide-list li::before {
  content: "—";
  color: #bbb;
  flex-shrink: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.up-guide-list li strong {
  color: #111;
  font-weight: 700;
}

.up-guide-list li code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  background: rgba(0,0,0,0.06);
  padding: 0.1em 0.35em;
  border-radius: 2px;
  color: #111;
}

.up-guide-link {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.up-guide-link:hover {
  color: var(--primary-600);
}

/* Numbered how-to steps */

.up-guide-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
}

.up-guide-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
  padding: 0.85rem 0;
  border-bottom: 1px solid #ddd8d0;
}

.up-guide-steps li:last-child {
  border-bottom: none;
}

.up-guide-steps li strong {
  color: #111;
  font-weight: 700;
}

.up-guide-steps li code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  background: rgba(0,0,0,0.06);
  padding: 0.1em 0.35em;
  border-radius: 2px;
  color: #111;
}

.up-guide-step-num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: #111;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.15rem;
  letter-spacing: 0;
}

/* ── Responsive ── */

@media (max-width: 960px) {
  .up-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .up-success-kpi-row {
    grid-template-columns: 1fr;
  }

  .up-success-kpi {
    border-right: none;
    border-bottom: 1px solid #ddd8d0;
  }

  .up-success-kpi:last-child {
    border-bottom: none;
  }

  .up-success-actions {
    flex-direction: column;
    padding: 1.25rem;
  }

  .up-cta-secondary {
    text-align: center;
  }
}
/* === Sticky footer (added May 2026) === */
html {
  height: 100%;
}
body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
body > main,
body > .page-shell {
  flex: 1;
}

/* === Negative netto utbetaling in lønnsoppgjør === */
.payout-negative {
  color: #c0392b;
}

/* ── Upload: compact zone when queue has files ── */

.up-zone--compact {
  min-height: 72px;
  padding: 1rem 1.5rem;
  flex-direction: row;
  gap: 1rem;
  margin-top: 0;
}

.up-zone--compact .up-zone-icon {
  width: 22px;
  height: 22px;
}

.up-zone--compact .up-zone-heading {
  font-size: 0.95rem;
}

.up-zone--compact .up-zone-sub {
  font-size: 0.82rem;
}

/* ── File queue ── */

.up-queue {
  margin-top: 1rem;
}

.up-queue.is-hidden {
  display: none;
}

.up-queue-header {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0 0 0.6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.up-queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* ── Queue item ── */

.up-qi {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 0.875rem;
  background: #faf8f4;
  border: 1px solid #ddd8d0;
  border-left: 3px solid #ddd8d0;
  overflow: hidden;
  transition: border-left-color 200ms ease, background 200ms ease;
}

.up-qi--uploading,
.up-qi--polling {
  border-left-color: var(--primary);
  background: #f5f3ef;
}

.up-qi--completed {
  border-left-color: var(--success, #2d7a4f);
  background: #f4faf7;
}

.up-qi--failed {
  border-left-color: var(--error, #c0392b);
  background: #fdf6f5;
}

.up-qi-icon-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.up-qi-file-icon {
  color: var(--muted);
  transition: color 200ms;
}

.up-qi--uploading .up-qi-file-icon,
.up-qi--polling .up-qi-file-icon {
  color: var(--primary);
}

.up-qi--completed .up-qi-file-icon {
  color: var(--success, #2d7a4f);
}

.up-qi--failed .up-qi-file-icon {
  color: var(--error, #c0392b);
}

.up-qi-body {
  flex: 1;
  min-width: 0;
}

.up-qi-name {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.83rem;
  font-weight: 500;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.3;
}

.up-qi-status {
  font-size: 0.78rem;
  color: var(--muted);
  display: block;
  margin-top: 0.1rem;
  line-height: 1.3;
}

.up-qi--failed .up-qi-status {
  color: var(--error, #c0392b);
}

.up-qi--completed .up-qi-status {
  color: var(--success, #2d7a4f);
}

.up-qi-summary {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.up-qi-summary:empty {
  display: none;
}

.up-qi-kpi {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: var(--muted);
}

.up-qi-kpi strong {
  color: #111;
  font-weight: 700;
}

.up-qi-remove {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: color 120ms, background 120ms;
}

.up-qi-remove:hover {
  color: #111;
  background: rgba(0, 0, 0, 0.06);
}

.up-qi-remove:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.up-qi-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
}

.up-qi-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 350ms ease;
}

.up-qi--completed .up-qi-fill {
  width: 100% !important;
  background: var(--success, #2d7a4f);
}

.up-qi--failed .up-qi-fill {
  background: var(--error, #c0392b);
}

/* ── Action row (start + clear) ── */

.up-action-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.up-action-row.is-hidden {
  display: none;
}
