@import url("/assets/css/rp-base.css"); /* UI-VOCAB-01 §1.2: the ONE shared base sheet (tokens + scrollbars) — rules live there, never here */
/* ResPilot Platform/Corp Portal — brand overrides + platform content classes
 * Shell CSS (sidebar, topbar, main) is provided by /admin/assets/admin.css
 * This file overrides brand vars and adds platform-specific content classes.
 */
:root {
  /* Override admin.css shell colours for purple/indigo brand */
  --brand:               #7c3aed;
  --primary:             var(--brand);   /* an alias: platform pages (voip_order, user_accounts, enterprise_order, …) use var(--primary), which was never defined — the wizards' active step painted white-on-white (2026-10-04) */
  --brand-hover:         #6d28d9;
  --brand-ring:          rgba(124,58,237,.22);   /* purple focus ring (overrides admin.css blue for Corp/Platform) */
  --sidebar-bg:          #1e1b4b;
  --sidebar-text:        rgba(255,255,255,.75);
  --sidebar-hover:       rgba(255,255,255,.08);
  --sidebar-active-color:#c4b5fd;
  --sidebar-active-bg:   rgba(124,58,237,.15);
  /* Content vars */
  --danger:    #dc2626;
  --success:   #16a34a;
  /* --warning moved to rp-base.css (PLATFORM-STARTER-08 §2: ONE definition) */
  --text:      #111827;
  --muted:     #6b7280;
  --body-bg:   #f3f4f6;
  --bg:        #f3f4f6;
  --card-bg:   #ffffff;
  --border:    #e5e7eb;
  --radius:    8px;
  --font:      system-ui, -apple-system, sans-serif;
  /* NAV FOLLOW-UP (Michael 2026-10-03 12:46): every left-nav count badge is this light-red pill; solid red (--danger) only where the badge
     already flags "needs action now". Measured: text 5.37:1 on the tint; the tint 13.06:1 against --sidebar-bg. The nav is dark in both
     colour schemes, so these two values are the dark-mode values too. */
  --nav-badge-bg: #fde2e2;
  --nav-badge-fg: #b42318;
}

body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--body-bg); }

/* ── Page header ── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-title  { font-size: 22px; font-weight: 700; margin-bottom: 3px; }
.page-sub    { font-size: 13px; color: var(--muted); }

/* ── Platform KPI stat cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card  { background: var(--card-bg); border: 1px solid var(--border); border-top: 3px solid var(--brand); border-radius: var(--radius); padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.stat-card.brand   { border-top-color: var(--brand); }
.stat-card.success { border-top-color: var(--success); }
.stat-card.warn    { border-top-color: var(--warning); }
.stat-card.danger  { border-top-color: var(--danger); }
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat-card.warn    .stat-value { color: var(--warning); }
.stat-card.danger  .stat-value { color: var(--danger); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.brand   .stat-value { color: var(--brand); }

/* ── Card ── */
.card { background: var(--card-bg); border: 1px solid var(--border); border-top: 3px solid var(--brand); border-radius: var(--radius); margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.card.card-danger  { border-top-color: var(--danger); }
.card.card-success { border-top-color: var(--success); }
.card.card-neutral { border-top-color: var(--border); }
.card-hd { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-hd h2 { font-size: 14px; font-weight: 600; }
.card-body  { padding: 20px; }

/* ── Data table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--border); background: #f9fafb; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f9fafb; }
.row-muted td { opacity: .55; }

/* ── Tier labels ── */
.tier-basic      { color: #0284c7; font-weight: 600; }
.tier-mid        { color: #7c3aed; font-weight: 600; }
.tier-top        { color: #0f766e; font-weight: 600; }
.tier-enterprise { color: #374151; font-weight: 600; }

/* ── Badges (platform-specific variants) ── */
/* UI-06 §1.4 (2026-09-03): the legacy .badge family is GONE — every status label is .rp-badge + a tone (assets/css/rp-base.css). */

/* ── Buttons ── (platform pages use .btn.primary not .btn-primary) ── */
.btn { display: inline-block; padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; border: 1px solid var(--border); background: #fff; color: var(--text); transition: background .15s; white-space: nowrap; }
.btn:hover    { background: #f3f4f6; }
.btn.primary  { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.danger   { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm       { padding: 4px 10px; font-size: 12px; }
.btn-primary  { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-hover); }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 18px; font-size: 13px; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-danger  { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* ── Forms ── */
.form-group  { margin-bottom: 14px; }
.form-label  { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.form-control { width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; color: var(--text); font-family: inherit; }
.form-control:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124,58,237,.1); }
/* Purple chevron for the purple-scoped portals (Corp/Platform). admin.css ships a
   blue chevron (Park); this overrides only the background-image (SVG can't use a
   CSS var). Focus border/ring + checkbox fill already follow --brand/--brand-ring. */
select:not([multiple]):not([size]),
.fg select:not([multiple]):not([size]),
select.form-control:not([multiple]):not([size]) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; display: block; }
.req { color: var(--danger); }

/* ── Login ── */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--sidebar-bg); }
.login-card { background: #fff; border-radius: 14px; padding: 36px 40px; width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo { font-size: 24px; font-weight: 800; color: var(--brand); margin-bottom: 4px; }
.login-sub  { font-size: 12px; color: var(--muted); margin-bottom: 28px; }
.login-btn  { width: 100%; padding: 11px; background: var(--brand); color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 8px; }
.login-btn:hover { background: var(--brand-hover); }

/* ── Detail section ── */
.detail-grid { display: grid; grid-template-columns: 150px 1fr; gap: 6px 16px; font-size: 13px; }
.detail-grid dt { color: var(--muted); align-self: start; padding-top: 1px; }
.detail-grid dd { font-weight: 500; }

/* ── Provision box ── */
.provision-box { background: #1e1b4b; color: #c4b5fd; border-radius: 10px; padding: 16px; font-family: monospace; font-size: 12px; white-space: pre-wrap; word-break: break-all; margin-top: 12px; }

/* ── Page header (ph = platform header row) ── */
.ph { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.ph-left h1, .ph-left .page-title { font-size: 22px; font-weight: 700; margin: 0; line-height: 1.2; }
.ph-left .ph-sub, .ph-left .page-sub { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.ph-right { display: flex; gap: 8px; align-items: center; }

/* ── Layout helpers ── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.col-2    { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }

/* ── Card sub-header ── */
.card-sh { padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.card-sh strong { font-size: 13px; font-weight: 600; }
.card-sh.danger strong { color: var(--danger); }

/* ── Section divider ── */
.section-divider { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 24px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

/* ── Utility ── */
.hidden       { display: none !important; }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-muted   { color: var(--muted); }

@media (max-width: 900px) {
  .stats-grid, .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .col-2 { grid-template-columns: 1fr; }
}

/* ── Dollar input component ── */
.input-dollar { position:relative; display:inline-flex; align-items:center; }
.input-dollar-prefix { position:absolute; left:10px; color:var(--muted,#6b7280); font-size:14px; pointer-events:none; user-select:none; line-height:1; }
.input-dollar .form-control { padding-left:22px; }

/* ── VOIP-ADMIN-02 ADDENDUM D R1 — the SERVICE group's parent rows (Voice SRV / Network CTRL) and their Orders child ──
   Platform-only (the park/corp shells have no parent rows). The child is indented under a left rule; the active child is the
   sidebar's own active treatment. Collapsed rail: the children and chevrons hide, the parent icon stays. */
.sb-parent-row { display: flex; align-items: center; }
.sb-parent-row > a { flex: 1; min-width: 0; }
.sb-parent-row > a.has-active-child { color: #e2e8f0; }
.sb-parent-toggle { flex: 0 0 auto; width: 28px; height: 28px; margin-right: 8px; border: 0; border-radius: 6px; background: none; color: var(--sidebar-active-color); cursor: pointer; font-size: 9px; opacity: .85; }
.sb-parent-toggle::before { content: '\25B8'; }
.sb-parent.open .sb-parent-toggle::before { content: '\25BE'; }
.sb-parent-toggle:hover { background: var(--sidebar-hover); opacity: 1; }
.sb-children { max-height: 0; overflow: hidden; transition: max-height .2s ease; position: relative; }
.sb-parent.open .sb-children { max-height: 120px; }
.sb-children::before { content: ''; position: absolute; left: 44px; top: 4px; bottom: 4px; width: 1px; background: rgba(255,255,255,.14); }
.sb-group-items .sb-children a { padding-left: 56px; font-size: 13px; }
body.sb-collapsed .sidebar .sb-parent-toggle, body.sb-collapsed .sidebar .sb-children { display: none; }
