/* ================================================================
   AuthShield B2B Partner Portal — app.css
   All styles extracted from index.html for CSP compliance.
   ================================================================ */

/* Font stack is fully local/system (no external font calls). */

:root {
  --bg0: #07080d;
  --bg1: #0c0e16;
  --card: rgba(18, 21, 38, 0.85);
  --card-hover: rgba(24, 28, 48, 0.92);
  --border: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(99, 102, 241, 0.45);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --muted2: #64748b;
  --accent: #6366f1;
  --accent-dim: rgba(99, 102, 241, 0.15);
  --ok: #34d399;
  --warn: #fbbf24;
  --r: 14px;
  --r-sm: 10px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: Consolas, "Courier New", ui-monospace, monospace;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);
  /** Main column width — wide enough for admin tables, capped for readability */
  --layout-max: 1440px;
}

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

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg0);
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 90% 60% at 50% -25%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 0%, rgba(167, 139, 250, 0.08), transparent 50%),
    linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 45%, #080a10 100%);
}

/* —— Login overlay — 1:1 copy of frontend .auth-modal-* —— */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0a0a0f;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.25s ease;
}
.login-overlay.hidden { display: none; opacity: 0; pointer-events: none; }

.login-box {
  background: rgba(12, 14, 24, 0.72);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 32px 36px 36px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  text-align: center;
  position: relative;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.login-logo-text-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.login-logo-sub {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(167, 139, 250, 0.75);
}

.login-logo-icon {
  width: 64px;
  height: 64px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo-icon::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  animation: loginHexPulse 2s infinite;
  box-shadow: 0 0 20px rgba(79, 70, 229, 0.4);
}

.login-logo-icon::after {
  content: '';
  position: absolute;
  width: 80%;
  height: 80%;
  background: #1a1a2e;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  z-index: 1;
}

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

.login-logo-icon svg {
  width: 22px;
  height: 22px;
  z-index: 2;
  fill: #4f46e5;
}

.login-logo-text {
  font-size: 24px;
  font-weight: 600;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-error {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  padding: 12px;
  font-size: 13px;
  text-align: center;
}
.login-error:empty { display: none; }

.btn-ms-login {
  width: 100%;
  padding: 14px;
  background: #0078d4;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 2px 10px rgba(0, 120, 212, 0.3);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}
.btn-ms-login:hover {
  background: #106ebe;
  box-shadow: 0 4px 20px rgba(0, 120, 212, 0.4);
  transform: translateY(-1px);
}
.btn-ms-login:active { transform: translateY(0); }
.btn-ms-login:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-ms-login svg.ms-logo { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Login stack (login box + partner teaser) ── */
.login-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  max-width: 420px;
}

/* ── Partner teaser card ── */
.partner-teaser {
  background: rgba(12, 14, 24, 0.72);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}
.partner-teaser[open] {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.1);
}
.partner-teaser-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  color: #f1f5f9;
  font-size: 13.5px;
  font-weight: 600;
  user-select: none;
  transition: color 0.18s;
}
.partner-teaser-trigger::-webkit-details-marker { display: none; }
.partner-teaser-trigger:hover { color: #a78bfa; }
.partner-teaser[open] .partner-teaser-trigger { color: #f1f5f9; }
.partner-teaser-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #a78bfa;
}
.partner-teaser-chevron {
  width: 13px;
  height: 13px;
  margin-left: auto;
  flex-shrink: 0;
  color: #94a3b8;
  transition: transform 0.22s ease;
}
.partner-teaser[open] .partner-teaser-chevron {
  transform: rotate(180deg);
}
.partner-teaser-body {
  padding: 0 18px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.partner-teaser-body p {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.65;
}
.partner-teaser-mail {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #a78bfa;
  text-decoration: none;
  transition: color 0.18s, gap 0.18s;
}
.partner-teaser-mail svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.partner-teaser-mail:hover {
  color: #c4b5fd;
  gap: 9px;
}

/* —— Top bar —— */
.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 20, 0.75);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  flex-shrink: 0;
  color: inherit;
}

.brand--portal-lockup { cursor: default; }

.brand-text-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  line-height: 1.05;
}

.brand-text-stack > .brand-text {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  line-height: 1.1;
}

.brand-tagline {
  font-family: var(--font);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.86);
  line-height: 1.2;
}

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

.brand-mark {
  width: 40px;
  height: 40px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark::before {
  content: "";
  position: absolute;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #6046ff 0%, #7c3aed 100%);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  animation: logoHexagonPulse 2s infinite;
  top: 0;
  left: 0;
  box-shadow: 0 0 15px rgba(96, 70, 255, 0.4);
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  background: var(--bg0);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  top: 6px;
  left: 6px;
}

.brand-text {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark::before { animation: none !important; }
}

.topbar-brand-extra {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.topbar-brand-extra .pipe {
  color: var(--border);
  font-weight: 300;
  user-select: none;
}

.topbar-brand-extra .sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem 0.35rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #334155, #475569);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.user-meta small {
  font-size: 0.65rem;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.user-meta span {
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted2);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}
.btn-logout:hover { color: var(--text); border-color: rgba(255,255,255,0.18); }

/* ── Admin account label ── */
.user-account-label--admin {
  color: #a78bfa !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
}

/* ── Partner preview toggle button ── */
.btn-preview-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: rgba(251, 191, 36, 0.75);
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.btn-preview-toggle svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-preview-toggle:hover {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.6);
  background: rgba(251, 191, 36, 0.07);
}
.btn-preview-toggle.hidden { display: none; }

/* ── Preview mode bar ── */
.preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.55rem 1.2rem;
  background: rgba(251, 191, 36, 0.08);
  border-bottom: 1px solid rgba(251, 191, 36, 0.25);
  color: #fbbf24;
  font-size: 0.82rem;
  font-weight: 500;
}
.preview-bar svg { width: 15px; height: 15px; flex-shrink: 0; }
.preview-bar.hidden { display: none; }

.btn-exit-preview {
  margin-left: auto;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fbbf24;
  padding: 0.25rem 0.7rem;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.btn-exit-preview:hover {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.65);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.btn-lang {
  border: none;
  background: transparent;
  color: var(--muted2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.33rem 0.52rem;
  cursor: pointer;
}

.btn-lang.active {
  color: #e0e7ff;
  background: rgba(99, 102, 241, 0.2);
}

/* —— Layout —— */
.layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  align-items: start;
}

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

.sidebar {
  position: sticky;
  top: 72px;
}

.nav-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.65rem;
  box-shadow: var(--shadow);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--r-sm);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}
.nav-item.active {
  background: var(--accent-dim);
  color: #e0e7ff;
  border-color: rgba(99, 102, 241, 0.25);
}
.nav-item .icon {
  width: 1.15rem;
  text-align: center;
  opacity: 0.85;
}

.sidebar-foot {
  margin-top: 1rem;
  padding: 0.85rem;
  font-size: 0.75rem;
  color: var(--muted2);
  line-height: 1.45;
  border-top: 1px solid var(--border);
}

/* —— Main —— */
.main-header { margin-bottom: 1.25rem; }
.main-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.main-header p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.grid-main {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 1100px) { .grid-main { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.card-title h2 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.card-title .step {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid.full { grid-template-columns: 1fr; }

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
label .req { color: #f87171; }

input, select, textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px 8px;
  padding-right: 2.25rem;
  cursor: pointer;
}
select option { background: #151825; color: var(--text); padding: 0.5rem 0.75rem; }
select option:checked { background: rgba(99, 102, 241, 0.35); color: #fff; }
select:hover { border-color: rgba(255, 255, 255, 0.15); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
input::placeholder { color: var(--muted2); }
textarea { min-height: 72px; resize: vertical; }

input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.hint { font-size: 0.72rem; color: var(--muted2); margin-top: 0.3rem; }

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 0;
  cursor: pointer;
}

.checkline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

/* —— Step bar —— */
.step-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.5rem;
}

.step-bar-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted2);
  white-space: nowrap;
}

.step-bar-item.active { color: var(--text); }
.step-bar-item.done { color: var(--ok); }

.step-bar-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-bar-item.active .step-bar-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.step-bar-item.done .step-bar-dot {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.step-bar-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 0.6rem;
}

/* —— Summary column —— */
.summary-sticky { position: sticky; top: 88px; }

.price-hero {
  text-align: center;
  padding: 1.1rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.price-hero .label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted2);
  margin-bottom: 0.2rem;
}
.price-hero .amount {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

/* tier pill now in card-title */
.tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.2);
  white-space: nowrap;
}

/* —— Quote groups —— */
.quote-group {
  margin-top: 0.9rem;
}

.quote-group-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted2);
  margin-bottom: 0.35rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.line-items { font-size: 0.84rem; }
.line-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.38rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.line-row:last-child { border-bottom: none; }
.line-row dt { margin: 0; color: var(--muted); }
.line-row dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.line-row.total {
  margin-top: 0.45rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  border-bottom: none;
}
.line-row.total dt { color: var(--text); font-weight: 700; }
.line-row.total dd { font-size: 1.1rem; color: #e0e7ff; font-weight: 700; }
.text-ok { color: var(--ok) !important; }

.vat-note {
  font-size: 0.68rem;
  color: var(--muted2);
  text-align: center;
  margin: 0.85rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.btn-primary {
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.35);
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.42);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary .sub {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 0.2rem;
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.form-grid--ref { margin-top: 0.75rem; }

/* ── Invoice download button in order history ── */
.btn-invoice-dl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.3rem 0.6rem;
  background: rgba(99, 102, 241, 0.1);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.btn-invoice-dl:hover {
  background: rgba(99, 102, 241, 0.2);
}
.btn-invoice-dl svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.invoice-cell-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
}
.invoice-cell-wrap--admin {
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.45rem;
  min-width: 0;
}
.invoice-cell-wrap--admin .text-muted.mono-sm {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}
.invoice-dl-check {
  display: none;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}
.invoice-dl-check.invoice-dl-check--visible {
  display: inline-flex;
}

/* ── Profile summary (read-only partner data) ── */
.profile-summary {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border);
}
.profile-row:last-child { border-bottom: none; }
.profile-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}
.profile-value {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

/* ── Confirmation modal ── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 240;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}
.confirm-hidden { display: none !important; }
.confirm-modal {
  width: 100%;
  max-width: 500px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem 2rem 1.5rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.25s ease;
}
.confirm-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.5rem;
}
.confirm-header svg {
  width: 28px;
  height: 28px;
  color: #f59e0b;
  flex-shrink: 0;
}
.confirm-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.confirm-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 1rem 0;
  padding-left: 40px;
}
.confirm-details {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.2rem;
}
.confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--border);
}
.confirm-row:last-child { border-bottom: none; }
.confirm-row--total { background: rgba(99, 102, 241, 0.06); }
.confirm-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}
.confirm-value {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 600;
  text-align: right;
}
.confirm-actions {
  display: flex;
  gap: 0.75rem;
}
.confirm-actions .btn-primary { flex: 1; }
.confirm-actions .btn-cancel {
  flex: 0.5;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.7rem 1rem;
  font-family: inherit;
  transition: background 0.15s;
}
.confirm-actions .btn-cancel:hover { background: rgba(255,255,255,0.1); }

/* ── Partner pending notice (above submit button) ── */
.pending-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  color: #fbbf24;
  font-size: 0.8rem;
  line-height: 1.45;
  margin-bottom: 0.85rem;
}
.pending-notice svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.pending-notice.hidden { display: none; }

/* Pending state overrides for btn-primary */
.btn-primary.btn--pending {
  background: rgba(251, 191, 36, 0.1) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
  border: 1.5px solid rgba(251, 191, 36, 0.3) !important;
}
.btn-primary.btn--pending .sub {
  color: rgba(251, 191, 36, 0.65) !important;
}

.disclaimer {
  margin-top: 0.85rem;
  font-size: 0.68rem;
  color: var(--muted2);
  line-height: 1.45;
}

.info-callout {
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--r-sm);
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
  font-size: 0.78rem;
  color: #a7f3d0;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}
.info-callout strong { color: #ecfdf5; }

/* —— Table (order history) —— */
.panel-hidden { display: none; }
.table-wrap { overflow-x: auto; }

/* Admin “Alle Bestellungen”: use full content width, comfortable cell padding */
#panel-admin-orders .table-wrap table {
  width: 100%;
  min-width: 920px;
}
#panel-admin-orders .table-wrap th,
#panel-admin-orders .table-wrap td {
  padding: 0.5rem 0.65rem;
  vertical-align: top;
}
#panel-admin-orders .table-wrap th {
  font-size: 0.65rem;
}

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  color: var(--muted2);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}
tr:hover td { background: rgba(255, 255, 255, 0.02); }

.status {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
}
.status-ok      { background: rgba(52, 211, 153, 0.12); color: #6ee7b7; }
.status-fail    { background: rgba(248, 113, 113, 0.12); color: #fca5a5; }
.status-pending { background: rgba(251, 191, 36, 0.12); color: #fcd34d; }

.app-banner {
  display: none;
  max-width: var(--layout-max);
  margin: 0.5rem auto 0;
  padding: 0.65rem 1rem;
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  box-sizing: border-box;
  width: calc(100% - 2.5rem);
}
.app-banner.is-visible { display: block; }
.app-banner--ok  { background: rgba(52, 211, 153, 0.1);  border-color: rgba(52, 211, 153, 0.25);  color: #a7f3d0; }
.app-banner--err { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.25); color: #fecaca; }

.mono-sm {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #c4b5fd;
}

/* —— Admin nav section label —— */
.nav-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6366f1;
  padding: 0.5rem 0.75rem 0.25rem;
  margin-bottom: 0.1rem;
}
.nav-hidden { display: none; }

/* —— Stats grid —— */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.1rem 1.25rem;
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted2);
}
.text-warn { color: #fbbf24; }

/* —— Status badges —— */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.badge-active   { background: rgba(52,211,153,0.12);  color: #34d399; border: 1px solid rgba(52,211,153,0.25); }
.badge-pending  { background: rgba(251,191,36,0.1);   color: #fbbf24; border: 1px solid rgba(251,191,36,0.25); }
.badge-suspended{ background: rgba(248,113,113,0.1);  color: #f87171; border: 1px solid rgba(248,113,113,0.25); }

/* —— Admin table action button —— */
.btn-edit-partner {
  padding: 0.28rem 0.65rem;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 5px;
  color: #a5b4fc;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}
.btn-edit-partner:hover { background: rgba(99,102,241,0.22); }

/* —— Partner editor slide-in —— */
/* ── Order success modal ── */
.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}
.success-hidden { display: none !important; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.success-modal {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem 2rem 1.5rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.25s ease;
}

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

.success-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.35rem;
}
.success-icon {
  width: 32px;
  height: 32px;
  color: #34d399;
  flex-shrink: 0;
}
.success-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.success-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 1.2rem 0;
  padding-left: 44px;
}

.success-details {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.success-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border);
}
.success-row:last-child { border-bottom: none; }
.success-row--key { background: rgba(99, 102, 241, 0.06); }

.success-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}
.success-value {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 600;
  text-align: right;
}
.success-key {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  letter-spacing: 0.03em;
  color: #a78bfa;
}

.success-email-hint {
  font-size: 0.75rem;
  color: var(--muted2);
  text-align: center;
  margin: 0 0 1.2rem 0;
  line-height: 1.4;
}

.success-close {
  width: 100%;
}

/* Submitting state for order button */
.btn-primary.btn--submitting {
  position: relative;
  pointer-events: none !important;
}
.btn-primary.btn--submitting::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}
.editor-hidden { display: none; }
.editor-panel {
  width: 100%;
  max-width: 780px;
  max-height: 88vh;
  background: #13131f;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #0f0f1a;
  border-radius: 14px 14px 0 0;
  flex-shrink: 0;
}
.editor-header h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.editor-close {
  background: none;
  border: none;
  color: var(--muted2);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.1s, color 0.1s;
}
.editor-close:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  overscroll-behavior: contain;
}
/* 2-column grid inside the editor modal */
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}
.editor-grid .form-group { margin-bottom: 0.75rem; }
.ed-span2 { grid-column: 1 / -1; }

.ed-tier-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.5rem 0 0.35rem;
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.35rem 0.25rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.35);
}
.ed-tier-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.5rem 5rem;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.78rem;
}
.ed-tier-label { color: var(--text-muted, #94a3b8); }
.ed-tier-default { text-align: right; color: #64748b; font-variant-numeric: tabular-nums; }
.ed-tier-input {
  width: 100%;
  padding: 0.25rem 0.35rem;
  border-radius: 4px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(30, 41, 59, 0.6);
  color: inherit;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.btn-tier-reset {
  margin-top: 0.25rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}
.btn-tier-reset:hover {
  border-color: rgba(99, 102, 241, 0.45);
  color: #a5b4fc;
}

.editor-section-label--gap { margin-top: 1.2rem; }
.editor-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted2);
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.editor-status-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.editor-status-btns { display: flex; gap: 0.5rem; }
.btn-approve {
  padding: 0.35rem 0.75rem;
  background: rgba(52,211,153,0.12);
  border: 1px solid rgba(52,211,153,0.3);
  border-radius: 6px;
  color: #34d399;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-approve:hover { background: rgba(52,211,153,0.22); }
.btn-suspend {
  padding: 0.35rem 0.75rem;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 6px;
  color: #f87171;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-suspend:hover { background: rgba(248,113,113,0.2); }
.editor-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.6rem;
  background: #0f0f1a;
  border-radius: 0 0 14px 14px;
  flex-shrink: 0;
}
.btn-save {
  flex: 1;
  padding: 0.6rem 1rem;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  border: none;
  border-radius: 7px;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.btn-save:hover { opacity: 0.9; }
.btn-cancel {
  padding: 0.6rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* —— Utility classes (replacing inline styles for CSP) —— */
.partner-email { font-size: 0.65rem; color: var(--muted2); }
.public-url { font-size: 0.72rem; color: #a5b4fc; margin-bottom: 0.5rem; word-break: break-all; }
.form-full-row { grid-column: 1 / -1; }
.info-callout--spaced { margin-top: 1rem; }
.text-muted { color: var(--muted2); }
.text-sm { font-size: 0.78rem; }
.text-error { color: #f87171; }
