/* ============================================================
   ASKARA CLIENT PORTAL — Mobile-First Design System
   ============================================================ */

/* ── Tokens ── */
:root {
    --brand:      #e0621c;
    --brand-deep: #a8400e;
    --brand-soft: #fff4ed;
    --brand-grad: linear-gradient(135deg, #e8681f 0%, #b04510 100%);

    --bg:         #f1f3f7;
    --surface:    #ffffff;
    --surface-2:  #f7f8fb;
    --border:     rgba(17,24,39,0.08);
    --border-md:  rgba(17,24,39,0.14);

    --ink:        #111827;
    --ink-2:      #374151;
    --muted:      #6b7280;
    --faint:      #9ca3af;

    --ok:         #059669; --ok-soft:    #d1fae5; --ok-ink:    #065f46;
    --warn:       #d97706; --warn-soft:  #fef3c7; --warn-ink:  #92400e;
    --danger:     #dc2626; --danger-soft:#fee2e2; --danger-ink:#991b1b;
    --info:       #2563eb; --info-soft:  #dbeafe; --info-ink:  #1e3a8a;

    --sh-xs: 0 1px 3px rgba(0,0,0,0.07);
    --sh-sm: 0 2px 8px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
    --sh:    0 4px 20px rgba(0,0,0,0.09), 0 2px 6px rgba(0,0,0,0.04);
    --sh-lg: 0 16px 48px rgba(0,0,0,0.11), 0 4px 12px rgba(0,0,0,0.05);

    --r-sm:  8px;  --r:    14px; --r-lg: 20px;
    --r-xl:  26px; --r-2xl:32px; --r-f:  9999px;

    --header-h: 56px;
    --nav-h:    60px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--ink);
    font-family: "Google Sans","Plus Jakarta Sans","Segoe UI",system-ui,Arial,sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; }
p { margin: 0; }
h1,h2,h3,h4 { margin: 0; }

/* ── Shell ── */
/* Full width on mobile, centered with max-width on wider screens */
.portal-shell {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: calc(var(--nav-h) + 16px);
}
.portal-shell.shell-guest {
    padding-bottom: 24px;
}

/* ── Content Area ── */
.portal-content {
    display: grid;
    gap: 10px;
    padding: 12px 12px 0;
}

/* ── Sticky Header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.site-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    padding: 5px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.eyebrow {
    margin: 0 0 1px;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand);
    font-weight: 700;
}

.site-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Desktop-only nav */
.site-header-nav { display: none; }

/* User chip */
.site-header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.site-user-chip {
    display: none; /* hidden on mobile to save space */
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 12px;
    border-radius: var(--r-f);
    border: 1px solid var(--border-md);
    background: var(--surface-2);
    color: var(--ink-2);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Bottom Tab Bar ── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    height: var(--nav-h);
    display: flex;
    align-items: stretch;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    border: none;
    background: transparent;
    color: var(--faint);
    font: inherit;
    font-size: 0.67rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    transition: color 100ms ease;
}

.nav-tab svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 100ms ease;
}

.nav-tab.is-active { color: var(--brand); }

/* Active indicator dot above icon */
.nav-tab.is-active::before {
    content: '';
    position: absolute;
    top: 6px;
    width: 20px;
    height: 3px;
    border-radius: var(--r-f);
    background: var(--brand);
}

/* ── Flash Banners ── */
.banner {
    border-radius: var(--r);
    padding: 12px 14px;
    font-size: 0.87rem;
    font-weight: 600;
    line-height: 1.45;
    border: 1px solid transparent;
}

.banner-success { background: var(--ok-soft);     color: var(--ok-ink);     border-color: rgba(5,150,105,0.18); }
.banner-error   { background: var(--danger-soft);  color: var(--danger-ink); border-color: rgba(220,38,38,0.18); }
.banner-warn    { background: var(--warn-soft);    color: var(--warn-ink);   border-color: rgba(217,119,6,0.18); }
.banner-info    { background: var(--info-soft);    color: var(--info-ink);   border-color: rgba(37,99,235,0.18); }

/* ── Panel / Card ── */
.panel, .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-xs);
    padding: 16px;
}

.panel-head {
    margin-bottom: 14px;
}

.panel-head h2,
.panel-head h3 {
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.22;
    margin-top: 3px;
    color: var(--ink);
}

.panel-head p {
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}

.panel-head-tight {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

/* ── Login Hero ── */
.login-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-lg);
    padding: 26px 20px 22px;
    position: relative;
    overflow: hidden;
}

.login-hero::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(224,98,28,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.login-hero-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.login-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 14px;
    background: var(--brand-soft);
    padding: 8px;
    border: 1px solid rgba(224,98,28,0.12);
}

.login-hero-brand-text .eyebrow { margin-bottom: 2px; }

.login-hero-brand-text strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.login-hero h1 {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--ink);
    margin-bottom: 8px;
}

.login-hero > p {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.55;
    margin-bottom: 22px;
}

/* ── Feature Cards (login page) ── */
.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px 14px;
    box-shadow: var(--sh-xs);
}

.feature-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--r);
    background: var(--brand-soft);
    display: grid;
    place-items: center;
    margin-bottom: 10px;
}

.feature-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--brand);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.feature-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
}

.feature-card p {
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.5;
}

/* ── Dashboard Hero (orange gradient) ── */
.dashboard-hero {
    background: var(--brand-grad);
    border-radius: var(--r-xl);
    padding: 20px 18px 18px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(224,98,28,0.28);
}

.dashboard-hero::after {
    content: '';
    position: absolute;
    top: -36px; right: -36px;
    width: 150px; height: 150px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    pointer-events: none;
}

.dashboard-hero .eyebrow { color: rgba(255,255,255,0.72); margin-bottom: 3px; }

.dashboard-hero h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.18;
    margin-bottom: 4px;
}

.dashboard-hero > p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.78);
    margin-bottom: 16px;
}

/* Hero stats: 3 cols by default, 2 cols on tiny screens */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.hero-stat {
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: var(--r);
    padding: 10px 8px;
}

.hero-stat .data-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
    display: block;
    margin-bottom: 3px;
}

.hero-stat strong {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Stat / Info / Receipt Boxes ── */
.stat-box, .info-box, .receipt-box, .gateway-meta-item {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 12px;
}

.stat-box strong, .info-box strong, .receipt-box strong, .gateway-meta-item strong {
    display: block;
    margin-top: 4px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.35;
}

.stat-box-wide { grid-column: 1 / -1; }

/* ── Data Grids (stats row) ── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

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

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

/* legacy compat aliases */
.dashboard-data-grid   { display: grid; gap: 8px; }
.dashboard-data-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.dashboard-data-grid-4 { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.summary-grid          { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.data-grid             { display: grid; gap: 8px; }
.hero-metrics-grid     { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.portal-card-grid      { display: grid; gap: 10px; }
.grid-two              { display: grid; gap: 10px; }

/* ── Invoice Card List (mobile-native, no scroll) ── */
.invoice-list {
    display: grid;
    gap: 0;
}

.invoice-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 2px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
    align-items: start;
}

.invoice-row:first-child { border-top: 1px solid var(--border); }

.invoice-row-id {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.3;
    grid-column: 1;
    grid-row: 1;
}

.invoice-row-meta {
    font-size: 0.78rem;
    color: var(--muted);
    grid-column: 1;
    grid-row: 2;
    margin-top: 2px;
}

.invoice-row-status {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
}

.invoice-row-amount {
    grid-column: 2;
    grid-row: 2;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink);
    justify-self: end;
    margin-top: 2px;
}

.invoice-row-action {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 8px;
}

/* ── Device List (mobile-native) ── */
.device-list {
    display: grid;
    gap: 0;
}

.device-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.device-row:first-child { border-top: 1px solid var(--border); }

.device-row-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
}

.device-row-meta {
    font-size: 0.76rem;
    color: var(--muted);
    margin-top: 1px;
}

.device-row-mac {
    font-size: 0.72rem;
    color: var(--faint);
    font-family: monospace;
    letter-spacing: 0.04em;
}

/* ── Data Label ── */
.data-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ── Forms ── */
.stack-sm { display: grid; gap: 8px; }
.stack-md { display: grid; gap: 12px; }
.stack-lg { display: grid; gap: 16px; }

.field { display: grid; gap: 5px; }

.field span {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink-2);
    letter-spacing: 0.03em;
}

.field input, .field select {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1.5px solid var(--border-md);
    border-radius: var(--r);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 1rem;
    transition: border-color 120ms ease, box-shadow 120ms ease;
    appearance: none;
}

.field input:focus, .field select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(224,98,28,0.12);
}

.field input::placeholder { color: var(--faint); }

.inline-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: end;
}

.grow { grid-column: 1 / -1; }

/* ── Buttons ── */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 48px;
    padding: 0 18px;
    border-radius: var(--r-f);
    border: 1.5px solid transparent;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    transition: all 120ms ease;
    white-space: nowrap;
}

.button:active { transform: scale(0.97); }

.button-primary {
    background: var(--brand-grad);
    color: #fff;
    box-shadow: 0 3px 12px rgba(224,98,28,0.28);
}

.button-secondary {
    background: var(--surface);
    border-color: var(--border-md);
    color: var(--ink);
}

.button-ghost {
    width: auto;
    min-height: 34px;
    padding: 0 12px;
    border-radius: var(--r);
    background: var(--surface-2);
    border-color: var(--border);
    font-size: 0.82rem;
    color: var(--ink-2);
}

.button-inline {
    width: auto;
    min-height: 40px;
    padding: 0 16px;
}

.button-wa {
    background: linear-gradient(135deg, #25d366 0%, #128c4e 100%);
    color: #fff;
    box-shadow: 0 3px 12px rgba(18,140,78,0.25);
}

/* ── Status Pills ── */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--r-f);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-success { background: var(--ok-soft);     color: var(--ok-ink); }
.status-warn    { background: var(--warn-soft);   color: var(--warn-ink); }
.status-danger  { background: var(--danger-soft); color: var(--danger-ink); }
.status-info    { background: var(--info-soft);   color: var(--info-ink); }

/* ── Tables (tablet+) ── */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--r);
}

.portal-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 0.87rem;
}

.portal-table-compact { min-width: 420px; }

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

.portal-table tbody td {
    padding: 11px 12px;
    text-align: left;
    vertical-align: middle;
    border-top: 1px solid var(--border);
    color: var(--ink-2);
    line-height: 1.4;
}

/* ── Empty State ── */
.empty-state {
    border: 1.5px dashed var(--border-md);
    border-radius: var(--r);
    padding: 18px 14px;
    color: var(--muted);
    text-align: center;
    font-size: 0.88rem;
    line-height: 1.5;
}

/* ── Muted ── */
.muted {
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.link-inline {
    color: var(--brand-deep);
    font-size: 0.83rem;
    font-weight: 600;
}

/* ── Invoice Detail Page ── */
.invoice-headline { display: grid; gap: 5px; }

.invoice-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.invoice-compact { display: grid; gap: 12px; }

.invoice-meta {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 8px;
}

.invoice-meta-item, .invoice-meta-item-wide {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 11px 12px;
}

.invoice-meta-item strong, .invoice-meta-item-wide strong {
    display: block;
    margin-top: 4px;
    font-size: 0.93rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.3;
}

.invoice-meta-item-wide { grid-column: 1 / -1; }

.invoice-total-card {
    background: linear-gradient(135deg, #fff8f5 0%, #fff4ed 100%);
    border: 1px solid rgba(224,98,28,0.16);
    border-radius: var(--r-lg);
    padding: 14px;
}

.amount-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.92rem;
    color: var(--ink-2);
}

.amount-row + .amount-row { border-top: 1px solid rgba(0,0,0,0.07); }

.amount-row strong { font-size: 0.92rem; font-weight: 700; color: var(--ink); }

.amount-row-total strong {
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--brand-deep);
}

/* ── Payment Methods ── */
.method-group { display: grid; gap: 10px; }

.method-group-head h4 { font-size: 0.95rem; font-weight: 700; color: var(--ink); margin-bottom: 2px; }

.method-group-head p { font-size: 0.83rem; color: var(--muted); }

.method-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 7px;
}

.method-form { display: block; }

.method-button {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: grid;
    grid-template-rows: 36px 1fr auto;
    gap: 4px;
    align-content: center;
    text-align: center;
    padding: 8px 5px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    transition: border-color 120ms ease, box-shadow 120ms ease;
    -webkit-tap-highlight-color: transparent;
}

.method-button-logo { display: grid; place-items: center; }

.method-button-logo img { max-width: 60px; max-height: 28px; object-fit: contain; }

.method-logo-fallback, .gateway-fallback {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--r);
    background: var(--surface-2);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--muted);
    text-align: center;
}

.method-button strong { font-size: 0.72rem; line-height: 1.22; display: block; }
.method-button span   { font-size: 0.68rem; color: var(--muted); display: block; }

.method-button.is-active {
    border-color: var(--ok);
    background: var(--ok-soft);
    box-shadow: 0 0 0 3px rgba(5,150,105,0.1);
}

.method-button:disabled { opacity: 0.48; cursor: not-allowed; }

/* ── Gateway Detail ── */
.gateway-stage { display: grid; gap: 12px; }

.gateway-summary { display: grid; gap: 8px; }

.gateway-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 13px;
}

.gateway-brand img { width: 64px; max-height: 34px; object-fit: contain; flex-shrink: 0; }
.gateway-brand-qris img { width: 50px; max-height: 50px; }
.gateway-brand strong { display: block; font-weight: 700; font-size: 0.93rem; color: var(--ink); }

.gateway-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.content-compact {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-all;
    font-size: 0.82rem;
    line-height: 1.35;
}

.countdown-pill {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    padding: 4px 9px;
    border-radius: var(--r-f);
    background: rgba(224,98,28,0.1);
    color: var(--brand-deep);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

/* ── QRIS ── */
.qris-box {
    display: grid;
    gap: 10px;
    justify-items: center;
    text-align: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 16px;
}

.qris-box img {
    width: 100%;
    max-width: 260px;
    border-radius: var(--r);
    border: 1px solid var(--border);
    background: #fff;
    padding: 6px;
}

.instruction-box {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 13px;
}

.instruction-box strong { display: block; font-size: 0.9rem; margin-bottom: 7px; color: var(--ink); }

.instruction-list {
    margin: 0;
    padding-left: 17px;
    display: grid;
    gap: 5px;
    font-size: 0.84rem;
    color: var(--muted);
    line-height: 1.5;
}

/* ── Receipt ── */
.receipt-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--sh);
    overflow: hidden;
}

.receipt-hero {
    display: grid;
    gap: 12px;
    padding: 20px 18px;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #fff;
}

.receipt-hero .eyebrow { color: rgba(255,255,255,0.72); }
.receipt-hero h3 { font-size: 1.15rem; font-weight: 800; color: #fff; margin-top: 3px; }
.receipt-hero p  { color: rgba(255,255,255,0.8); font-size: 0.87rem; }

.receipt-amount {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: var(--r);
    padding: 13px;
}

.receipt-amount span   { display: block; font-size: 0.76rem; font-weight: 600; color: rgba(255,255,255,0.76); margin-bottom: 4px; }
.receipt-amount strong { display: block; font-size: 1.45rem; font-weight: 800; color: #fff; }

.receipt-grid {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 8px;
    padding: 16px;
}

.receipt-actions {
    display: grid;
    gap: 8px;
    padding: 0 16px 16px;
}

/* ── Isolir Hero ── */
.isolir-hero {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    border-radius: var(--r-xl);
    padding: 22px 18px 20px;
    color: #fff;
    box-shadow: 0 6px 24px rgba(153,27,27,0.3);
    position: relative;
    overflow: hidden;
}

.isolir-hero::after {
    content: '';
    position: absolute;
    bottom: -32px; right: -32px;
    width: 130px; height: 130px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    pointer-events: none;
}

.isolir-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 11px;
    border-radius: var(--r-f);
    background: rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.9);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.isolir-icon {
    width: 56px; height: 56px;
    border-radius: 18px;
    background: rgba(255,255,255,0.11);
    border: 1px solid rgba(255,255,255,0.16);
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.isolir-hero h2 {
    font-size: 1.28rem;
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
    margin-bottom: 8px;
}

.isolir-hero > p {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.78);
    line-height: 1.55;
    margin-bottom: 18px;
}

.hero-actions { display: grid; gap: 9px; }

/* ── Speedtest ── */
.speedtest-embed {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: #fff;
    min-height: 480px;
}

.speedtest-embed iframe {
    width: 100%;
    min-height: 480px;
    border: 0;
    background: #fff;
    display: block;
}

/* ── Footer ── */
.site-footer {
    padding: 10px 12px 4px;
    display: grid;
    gap: 3px;
    font-size: 0.76rem;
    color: var(--faint);
    text-align: center;
}

/* ── Clean List ── */
.clean-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 0.88rem;
}

/* ── Header nav links (desktop) ── */
.site-header-nav a {
    display: inline-flex;
    align-items: center;
    padding: 5px 13px;
    border-radius: var(--r-f);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--ink-2);
    transition: 100ms ease;
}

.site-header-nav a:hover  { background: var(--surface-2); }
.site-header-nav a.is-active { color: var(--brand); background: var(--brand-soft); }

/* ── Login Method Buttons ── */
.login-method-group {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.login-method-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 15px 16px;
    border-radius: var(--r-lg);
    border: 1.5px solid var(--border-md);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: var(--sh-xs);
    transition: box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
    -webkit-tap-highlight-color: transparent;
}

.login-method-btn--primary {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.login-method-btn:active {
    box-shadow: none;
}

.login-method-btn__icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: var(--r);
    background: var(--brand-grad);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-method-btn__icon svg { width: 20px; height: 20px; }

.login-method-btn__icon--muted {
    background: var(--surface-2);
    color: var(--muted);
    border: 1.5px solid var(--border-md);
}

.login-method-btn__body {
    flex: 1;
    min-width: 0;
}

.login-method-btn__body strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
    margin-bottom: 2px;
}

.login-method-btn__body small {
    display: block;
    font-size: 0.76rem;
    color: var(--muted);
}

.login-method-btn__arrow {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--faint);
}

/* ── Portal Modal ── */
.portal-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: flex-end;
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms ease;
}

.portal-modal.is-open {
    pointer-events: auto;
    opacity: 1;
}

.portal-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.portal-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    padding: 20px 18px 32px;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.18);
    max-height: 92dvh;
    overflow-y: auto;
    transform: translateY(24px);
    transition: transform 220ms cubic-bezier(0.34, 1.2, 0.64, 1);
}

.portal-modal.is-open .portal-modal__dialog {
    transform: translateY(0);
}

.portal-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.portal-modal__eyebrow {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand);
    margin: 0 0 2px;
}

.portal-modal__title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ink);
    margin: 0;
    line-height: 1.15;
}

.portal-modal__close {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: var(--r);
    border: 1px solid var(--border-md);
    background: var(--surface-2);
    color: var(--ink-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font: inherit;
    transition: background 120ms;
}

.portal-modal__close:active { background: var(--border); }
.portal-modal__close svg { width: 16px; height: 16px; }

.portal-modal__flash {
    padding: 10px 14px;
    border-radius: var(--r-sm);
    font-size: 0.84rem;
    font-weight: 600;
    margin-bottom: 14px;
    line-height: 1.4;
}

.portal-modal__flash--ok     { background: var(--ok-soft);     color: var(--ok-ink); }
.portal-modal__flash--danger { background: var(--danger-soft); color: var(--danger-ink); }

.portal-modal__desc {
    font-size: 0.86rem;
    color: var(--muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* OTP step indicators */
.portal-modal__step-badge {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 14px;
}

.portal-modal__step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--surface-2);
    color: var(--faint);
    border: 1.5px solid var(--border-md);
    flex-shrink: 0;
}

.portal-modal__step--active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.portal-modal__step--done {
    background: var(--ok-soft);
    color: var(--ok-ink);
    border-color: var(--ok);
}

.portal-modal__step-line {
    flex: 1;
    height: 1.5px;
    background: var(--border-md);
    max-width: 40px;
}

/* ── Ghost button variant ── */
.button-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 11px 16px;
    border-radius: var(--r-lg);
    border: 1.5px solid var(--border-md);
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms;
}
.button-ghost:active { background: var(--surface-2); }

/* ======================================================
   BREAKPOINTS — progressive enhancement
   ====================================================== */

/* 360px and below: even tighter */
@media (max-width: 360px) {
    .hero-stats { grid-template-columns: repeat(2,1fr); }
    .hero-stat:last-child { display: none; }
    .method-grid { grid-template-columns: repeat(2,1fr); }
    .feature-grid { grid-template-columns: 1fr; }
}

/* 480px+ */
@media (min-width: 480px) {
    .portal-content { padding: 14px 14px 0; gap: 12px; }
    .panel, .card { padding: 18px; }
    .gateway-meta { grid-template-columns: repeat(2,1fr); }
    .dashboard-data-grid-4 { grid-template-columns: repeat(4,1fr); }
    .dashboard-data-grid-3 { grid-template-columns: repeat(3,1fr); }
}

/* 600px+ */
@media (min-width: 600px) {
    .portal-card-grid { grid-template-columns: repeat(2,1fr); }
    .grid-two         { grid-template-columns: repeat(2,1fr); }
    .summary-grid     { grid-template-columns: repeat(4,1fr); }
    .hero-metrics-grid { grid-template-columns: repeat(3,1fr); }
    .feature-grid      { grid-template-columns: repeat(2,1fr); }
}

/* 768px+ : show desktop nav, hide bottom nav, show user chip */
@media (min-width: 768px) {
    :root { --header-h: 62px; }

    .portal-shell { padding-bottom: 24px; }
    .bottom-nav   { display: none; }

    .site-header-nav {
        display: flex;
        align-items: center;
        gap: 2px;
    }

    .site-user-chip { display: flex; }

    .portal-content { padding: 16px 16px 0; gap: 14px; }

    .invoice-title-row { flex-wrap: nowrap; }

    .isolir-support-grid {
        grid-template-columns: 1.4fr 1fr;
        align-items: center;
    }
}
