/* =====================================================================
   Axiam Networks Billing - Main stylesheet (v2)
   Brand tokens match axiamnetworks.com.
   ===================================================================== */

:root {
    --primary:   #1C82D6;
    --primary-d: #156DBF;
    --accent:    #2AA8FF;
    --accent2:   #6FD3FF;
    --bg0:       #F4FBFF;
    --bg1:       #EAF6FF;
    --surface:   #FFFFFF;
    --text:      #0B1B2B;
    --muted:     #516B85;
    --border:    rgba(11,27,43,.10);
    --border-strong: rgba(11,27,43,.18);
    --danger:    #D32F2F;
    --warn:      #E08800;
    --success:   #1F9D55;

    --radius-xl: 22px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;

    --shadow-sm: 0 1px 2px rgba(11,27,43,.06);
    --shadow-md: 0 8px 24px rgba(10,40,70,.07);
    --shadow-lg: 0 16px 48px rgba(10,40,70,.12);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg0);
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.01em; margin: 0 0 12px; line-height: 1.2; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }

.muted { color: var(--muted); }
.small, .muted.small { font-size: 12px; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- Site topbar (slim accent strip on public pages) ---------- */
.site-topbar {
    background: var(--primary-d);
    color: #fff;
    font-size: 12px;
}
.site-topbar .container {
    display: flex; justify-content: space-between; align-items: center;
    height: 32px;
}
.site-topbar a { color: #fff; opacity: .92; }
.site-topbar a:hover { opacity: 1; }

/* ---------- Public site header ---------- */
.site-header {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-md);
    position: sticky; top: 0; z-index: 50;
}
.nav-row {
    display: flex; align-items: center; justify-content: space-between;
    height: 78px; gap: 24px;
}
.brand {
    display: inline-flex; align-items: center; gap: 12px;
    color: inherit; font-weight: 700; font-size: 18px;
    text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, #fff 0%, var(--accent2) 100%);
    color: var(--primary); font-weight: 800; font-size: 16px;
    flex: 0 0 auto;
}
.brand-text { white-space: nowrap; }

/* Configurable logo - fits inside the header brand block */
.brand-logo { display: block; max-height: 40px; max-width: 200px; width: auto; height: auto; object-fit: contain; }
.brand-logo-header { max-height: 60px; max-width: 220px; }
.brand-logo-auth   { max-height: 56px; max-width: 280px; margin: 0 auto; }
.brand-logo-mark   { max-height: 36px; max-width: 36px; }

/* When a logo is used inside a coloured header (public site), don't stack
   the gradient bg behind it - the image already has its own colours. */
.site-header .brand-logo { background: transparent; padding: 0; }

.primary-nav { display: flex; gap: 24px; }
.primary-nav a { color: #fff; opacity: .85; font-weight: 500; }
.primary-nav a:hover { opacity: 1; text-decoration: none; }

.nav-right { display: flex; align-items: center; gap: 12px; }

.btn-icon {
    position: relative; width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; color: #fff; background: rgba(255,255,255,.12);
    text-decoration: none;
}
.btn-icon:hover { background: rgba(255,255,255,.22); text-decoration: none; }
.btn-icon .badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 18px; height: 18px;
    background: #fff; color: var(--primary);
    border-radius: 99px; font-size: 11px; font-weight: 700;
    padding: 0 5px; display: inline-flex; align-items: center; justify-content: center;
}

.currency-form { margin: 0; }
.currency-form select {
    background: rgba(255,255,255,.18); color: #fff;
    border: 1px solid rgba(255,255,255,.3);
    padding: 6px 8px; border-radius: 8px; font-size: 12px;
    font-family: inherit;
}
.currency-form select option { color: var(--text); }

/* ---------- Buttons ---------- */
.btn-neo, .btn-ghost, .btn-ghost-light, .btn-danger, .btn-warn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: 10px;
    font-weight: 600; font-size: 13px; cursor: pointer;
    border: 1px solid transparent; line-height: 1; transition: all .12s ease;
    font-family: inherit; text-decoration: none;
}
.btn-neo {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    color: #fff; box-shadow: 0 4px 14px rgba(28,130,214,.32);
}
.btn-neo:hover  { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(28,130,214,.38); text-decoration: none; color: #fff; }
.btn-ghost      { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover{ border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn-ghost-light{ background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost-light:hover { background: rgba(255,255,255,.28); text-decoration: none; color: #fff; }
.btn-danger     { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B42727; text-decoration: none; color: #fff; }
.btn-warn       { background: var(--warn); color: #fff; }
.btn-warn:hover { background: #C57700; text-decoration: none; color: #fff; }
.btn-sm         { padding: 6px 12px; font-size: 12px; }
.btn-xs         { padding: 3px 8px; font-size: 11px; line-height: 1.2; }
.btn-block      { width: 100%; }

/* Hamburger menu buttons. By default they're hidden; mobile.css shows
   them at narrow viewports. This avoids a flash of visible hamburger
   while the stylesheet loads. */
.nav-hamburger,
.admin-hamburger { display: none; }

/* ---------- Button loading state ----------
   Toggle .is-loading on any button (or element) to show a spinner and
   block interaction. Used by the Stripe payment / setup buttons so the
   customer gets immediate feedback when their click is being processed.
   Pair with the global setButtonLoading() helper in app/Views/layouts. */
button.is-loading,
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.85;
    color: transparent !important;
}
button.is-loading::after,
.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: btn-spin 0.7s linear infinite;
    color: var(--text);
    opacity: 1;
}
button.btn-neo.is-loading::after,
.btn-neo.btn-loading::after {
    color: #fff;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ---------- Hero / sections ---------- */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-d) 100%);
    color: #fff; padding: 80px 0; text-align: center;
}
.hero h1 { font-size: 44px; }
.hero-sub { font-size: 17px; opacity: .9; max-width: 680px; margin: 8px auto 24px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.section { padding: 56px 0; }
.section h2 { margin-bottom: 28px; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.service-card {
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    color: var(--text);
    text-decoration: none;
}
.service-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(28,130,214,.3);
    text-decoration: none;
}
.service-card h3 { margin: 12px 0 4px; }
.service-card p  { color: var(--muted); margin: 0; }
.service-card .price-tag { margin-top: 16px; color: var(--primary); font-weight: 700; }

.feature-icon-wrap {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--bg1); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px;
}

.badge-blue {
    display: inline-block; padding: 3px 10px; border-radius: 99px;
    background: var(--bg1); color: var(--primary);
    font-size: 11px; font-weight: 700; letter-spacing: .04em;
}

/* ---------- Footer (ported from main site) ---------- */
.footer {
    background: #0B1B2B;
    color: rgba(255,255,255,.8);
    padding: 60px 0 30px;
    margin-top: 64px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}
.footer-logo {
    margin-bottom: 16px;
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}
.footer-tagline {
    color: rgba(255,255,255,.7);
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 14px;
}
.footer-social { display: flex; gap: 12px; }
.footer-social a {
    width: 38px; height: 38px; border-radius: 10px;
    background: rgba(255,255,255,.1);
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.8);
    transition: all .2s ease;
}
.footer-social a:hover {
    background: rgba(42,168,255,.2);
    color: #fff;
    transform: translateY(-2px);
    text-decoration: none;
}
.footer-title {
    font-size: 16px; font-weight: 800;
    margin: 0 0 16px; color: #fff;
}
.footer-links, .footer-contact {
    list-style: none; padding: 0; margin: 0;
}
.footer-links li, .footer-contact li { margin-bottom: 10px; }
.footer-links a, .footer-contact a {
    color: rgba(255,255,255,.7);
    text-decoration: none;
    transition: color .2s ease;
    font-size: 14px;
}
.footer-links a:hover, .footer-contact a:hover { color: #fff; }
.footer-contact li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.footer-contact i { color: #2AA8FF; width: 16px; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 24px;
    text-align: center;
}
.footer-bottom p { margin: 0; color: rgba(255,255,255,.6); font-size: 14px; }

/* Sticky-footer wiring: page fills the viewport so the footer hugs the
   bottom on short pages but is pushed down naturally on long ones. */
body.has-sticky-footer { min-height: 100vh; display: flex; flex-direction: column; }
body.has-sticky-footer .site-main { flex: 1 0 auto; }
body.has-sticky-footer .footer    { flex-shrink: 0; margin-top: 0; }

/* =====================================================================
   FORMS - both .form-stack (used in views) and .form-stacked work.
   The crucial bit: labels are flex columns so input renders BELOW text.
   ===================================================================== */
.form-stack, .form-stacked { display: flex; flex-direction: column; gap: 14px; }

.form-stack label,
.form-stacked label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0;
}

.form-stack input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=range]):not([type=hidden]),
.form-stack select,
.form-stack textarea,
.form-stacked input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=range]):not([type=hidden]),
.form-stacked select,
.form-stacked textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: inherit; font-size: 14px;
    color: var(--text); background: var(--surface);
    text-transform: none; letter-spacing: 0; font-weight: 400;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.form-stack input:focus,
.form-stack select:focus,
.form-stack textarea:focus,
.form-stacked input:focus,
.form-stacked select:focus,
.form-stacked textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(28,130,214,.18);
}

.form-stack .check,
.form-stacked .check {
    flex-direction: row;
    align-items: center; gap: 8px;
    text-transform: none; letter-spacing: 0;
    font-weight: 500; color: var(--text); font-size: 14px;
}
.form-stack .check input,
.form-stacked .check input { width: auto; }

.form-stack fieldset,
.form-stacked fieldset {
    border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 14px 16px; margin: 0;
    display: flex; flex-direction: column; gap: 12px;
}
.form-stack legend,
.form-stacked legend {
    padding: 0 8px; font-weight: 600; color: var(--muted);
    font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
}

.form-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.error-text { color: var(--danger); font-size: 13px; }
small.muted { font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}
.card-inset {
    background: var(--bg0); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 16px; margin-bottom: 14px;
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }

/* ---------- Tables ---------- */
.data-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.data-table th, .data-table td {
    text-align: left; padding: 10px 12px;
    border-bottom: 1px solid var(--border); font-size: 13px;
}
.data-table th {
    color: var(--muted); font-weight: 600; font-size: 11px;
    text-transform: uppercase; letter-spacing: .06em;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg0); }
.data-table tfoot td { font-weight: 600; }
.total-row td {
    background: var(--bg1) !important;
    font-size: 15px; font-weight: 700; color: var(--primary);
}
table.kv th { text-align: left; padding: 6px 12px 6px 0; color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; }
table.kv td { padding: 6px 0; font-size: 14px; }

/* ---------- Status chips ---------- */
.status, .chip {
    display: inline-block;
    padding: 3px 10px; border-radius: 99px;
    font-size: 11px; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase;
}
.status-active, .status-paid, .status-succeeded { background: rgba(31,157,85,.12);  color: #1F9D55; }
.status-pending, .status-unpaid, .status-draft   { background: rgba(28,130,214,.12); color: var(--primary); }
.status-overdue, .status-failed, .status-suspended, .status-customer_reply { background: rgba(211,47,47,.10); color: var(--danger); }
.status-cancelled, .status-terminated, .status-refunded, .status-closed { background: rgba(81,107,133,.12); color: var(--muted); }
.status-answered, .status-on_hold, .status-requires_action { background: rgba(224,136,0,.12); color: var(--warn); }

.chip { background: var(--bg1); color: var(--primary); }
.chip-warn { background: rgba(224,136,0,.14); color: var(--warn); }
.chip-priority-low      { background: rgba(81,107,133,.12); color: var(--muted); }
.chip-priority-medium   { background: rgba(28,130,214,.12); color: var(--primary); }
.chip-priority-high     { background: rgba(224,136,0,.14); color: var(--warn); }
.chip-priority-urgent   { background: rgba(211,47,47,.14); color: var(--danger); }

/* ---------- Layout helpers ---------- */
.grid-2  { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.grid-5  { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.grid-3-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
@media (max-width: 900px) {
    .grid-2, .grid-3, .grid-4, .grid-5, .grid-3-1 { grid-template-columns: 1fr; }
    .nav-row { height: auto; padding: 16px 0; flex-wrap: wrap; }
    .primary-nav { width: 100%; }
    .hero h1 { font-size: 30px; }
}

.page-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin: 0 0 22px; flex-wrap: wrap;
}
.page-header h1 { margin: 0; }
.action-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-row { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.filter-row select, .filter-row input {
    padding: 8px 10px; border-radius: 8px;
    border: 1px solid var(--border-strong); font-family: inherit;
}

/* ---------- Flash messages ---------- */
.flash-stack {
    max-width: 1200px; margin: 16px auto; padding: 0 24px;
    display: flex; flex-direction: column; gap: 10px;
}
.flash {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius-md); font-weight: 500;
    border: 1px solid var(--border); background: var(--surface);
}
.flash-success { color: var(--success); border-color: rgba(31,157,85,.32); background: rgba(31,157,85,.06); }
.flash-error   { color: var(--danger);  border-color: rgba(211,47,47,.32); background: rgba(211,47,47,.06); }
.flash-info    { color: var(--primary); border-color: rgba(28,130,214,.32); background: rgba(28,130,214,.06); }

/* =====================================================================
   AUTH PAGES
   ===================================================================== */
.auth-body {
    background: linear-gradient(135deg, var(--bg0) 0%, var(--bg1) 100%);
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.auth-shell { width: 100%; max-width: 480px; }
.auth-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 36px;
}
.auth-card h1 { margin-bottom: 6px; text-align: center; font-size: 26px; }
.auth-card .auth-sub, .auth-card > p:first-of-type {
    text-align: center; color: var(--muted); margin: 0 0 24px;
}
.auth-card .btn-block { width: 100%; padding: 12px 18px; justify-content: center; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }

.auth-brand {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; margin-bottom: 24px;
}
.auth-body .auth-brand .brand-mark {
    width: 56px; height: 56px; font-size: 22px; border-radius: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
}
.auth-body .auth-brand .brand-text {
    font-weight: 600; color: var(--muted); font-size: 14px;
}

.auth-links {
    display: flex; gap: 10px; align-items: center;
    justify-content: center; margin-top: 18px; font-size: 13px; color: var(--muted);
}
.auth-links a { color: var(--primary); }
.auth-links span { color: var(--border-strong); }

.auth-divider {
    text-align: center; position: relative; margin: 24px 0;
    color: var(--muted); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
    content: ''; position: absolute; top: 50%; width: 40%;
    height: 1px; background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }
.auth-divider span { background: var(--surface); padding: 0 12px; position: relative; }

/* =====================================================================
   PORTAL / ADMIN SHELL
   ===================================================================== */
.portal-shell, .admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 78px);
}
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 0;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 22px; color: var(--text);
    font-size: 13px; font-weight: 500;
    border-left: 3px solid transparent;
    text-decoration: none;
}
.sidebar-nav a:hover { background: var(--bg0); text-decoration: none; }
.sidebar-nav a.active {
    background: var(--bg1); color: var(--primary);
    border-left-color: var(--primary);
}
.sidebar-nav a i { width: 18px; opacity: .75; }
.sidebar-group {
    padding: 14px 22px 4px; font-size: 10px; font-weight: 700;
    color: var(--muted); text-transform: uppercase; letter-spacing: .08em;
}

.portal-main, .admin-main { padding: 28px 32px; min-width: 0; }
@media (max-width: 900px) {
    .portal-shell, .admin-shell { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .portal-main, .admin-main { padding: 18px; }
}

.portal-topbar, .admin-topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    height: 78px; display: flex; align-items: center;
}
.portal-topbar .container, .admin-topbar .container {
    display: flex; justify-content: space-between; align-items: center;
}
.portal-topbar .brand, .admin-topbar .brand { color: var(--text); }
.portal-topbar .brand-mark, .admin-topbar .brand-mark {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
}

.admin-tag {
    background: var(--bg1); color: var(--primary);
    font-size: 10px; font-weight: 700; letter-spacing: .08em;
    padding: 3px 8px; border-radius: 6px; text-transform: uppercase;
    margin-left: 6px;
}

.admin-user, .portal-user { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.admin-user form, .portal-user form { margin: 0; }

/* =====================================================================
   PORTAL AREA (new design - integrated with public site shell)
   Customer portal pages use the same site-header + footer as the public
   site. The portal-bar below sits inside .container and provides the
   horizontal tab navigation plus a small account widget.
   ===================================================================== */
.portal-area { padding: 28px 0 56px; }

.portal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 8px 14px;
    margin-bottom: 22px;
}

.portal-tabs {
    display: flex;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}
.portal-tabs::-webkit-scrollbar { height: 4px; }
.portal-tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.portal-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: all .12s ease;
}
.portal-tab i { width: 16px; opacity: .8; }
.portal-tab:hover {
    background: var(--bg0);
    color: var(--text);
    text-decoration: none;
}
.portal-tab.active {
    background: var(--bg1);
    color: var(--primary);
}
.portal-tab.active i { opacity: 1; }

.portal-account {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-left: 1px solid var(--border);
    flex-shrink: 0;
}
.portal-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}
.portal-account-text { display: flex; flex-direction: column; line-height: 1.2; }
.portal-account-name { font-size: 13px; font-weight: 600; color: var(--text); }
.portal-account-email { font-size: 11px; }

@media (max-width: 800px) {
    .portal-bar { flex-direction: column; align-items: stretch; padding: 8px; }
    .portal-account {
        border-left: none;
        border-top: 1px solid var(--border);
        padding: 8px;
        margin-top: 4px;
    }
    .portal-tabs { padding-bottom: 4px; }
}

/* Slightly denser portal cards/tables compared to the rest of the site */
.portal-area .card { padding: 18px 20px; margin-bottom: 14px; }
.portal-area .card h3 { font-size: 15px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.portal-area .card h3:first-child { margin-top: 0; }
.portal-area .data-table th { font-size: 10px; padding: 8px 10px; }
.portal-area .data-table td { font-size: 13px; padding: 9px 10px; }
.portal-area .stat-card { padding: 14px 16px; }
.portal-area .stat-num  { font-size: 24px; }
.portal-area .stat-grid { gap: 12px; margin-bottom: 18px; }

/* Tighter page header inside the portal */
.portal-area .page-header { margin-bottom: 14px; }
.portal-area .page-header h1 { font-size: 22px; }
.portal-area .page-header p  { margin: 2px 0 0; font-size: 13px; }

/* ---------- Stats ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px; margin-bottom: 24px;
}
.stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 18px;
}
.stat-num { font-size: 28px; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-lbl { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-top: 6px; }

/* ---------- Tickets ---------- */
.reply {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 14px 18px; margin-bottom: 12px;
}
.reply-admin    { border-left: 3px solid var(--primary); }
.reply-user     { border-left: 3px solid var(--accent2); }
.reply-internal { background: rgba(224,136,0,.06); border-left-color: var(--warn); }
.reply-head { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; font-size: 12px; }

/* ---------- Misc ---------- */
.line-row { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.line-row:last-child { border-bottom: none; }
.values-list { padding: 8px 0 0; border-top: 1px dashed var(--border); margin-top: 10px; }
.option-block { background: var(--bg0); border-radius: var(--radius-md); padding: 14px; margin-bottom: 14px; }

code {
    background: var(--bg1); padding: 2px 6px;
    border-radius: 4px; font-size: 12px;
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
}
pre code { background: transparent; padding: 0; }

/* ---------- Cart ---------- */
.cart-card { padding: 0; overflow: hidden; }

.cart-items { width: 100%; border-collapse: collapse; }
.cart-items th, .cart-items td {
    padding: 16px 22px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}
.cart-items thead th {
    background: var(--bg0);
    color: var(--muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.cart-items tbody tr:last-child td { border-bottom: none; }
.cart-items td.num, .cart-items th.num { text-align: right; }
.cart-amount { font-weight: 700; color: var(--text); font-size: 15px; }

.cart-line-options { color: var(--muted); font-size: 12px; margin-top: 4px; }

.cart-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    background: var(--bg0);
    border-top: 1px solid var(--border);
    gap: 12px;
}
.cart-clear { margin: 0; }

.cart-summary-card {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cart-summary-card h3 {
    margin: 0 0 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.cart-summary-card .btn-neo,
.cart-summary-card .btn-ghost {
    margin-top: 14px;
}

/* Promo code input on the cart summary. The input lives outside a
   .form-stacked container so it doesn't inherit those styles -
   give it the same look explicitly. */
.cart-promo-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: border-color .12s ease, box-shadow .12s ease;
    min-width: 0;       /* lets flex shrink the input below content width */
}
.cart-promo-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(28,130,214,.18);
}
.cart-promo-input::placeholder {
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0;
}

@media (max-width: 900px) {
    .cart-summary-card { position: static; }
}

/* ---------- Generic key/value rows (used in cart, builder, anywhere) ---------- */
.kv {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 6px 0;
    font-size: 14px;
}
.kv > span:first-child { color: var(--muted); }
.kv > strong { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

.kv-total {
    margin-top: 8px;
    padding: 14px 0 4px;
    border-top: 1px solid var(--border);
    font-size: 18px;
}
.kv-total > span:first-child { color: var(--text); font-weight: 700; }
.kv-total > strong { color: var(--primary); font-size: 20px; }

/* ---------- Small button helpers ---------- */
/* Trash-icon button in tables, no border, hover lifts the icon to red */
.btn-icon-link {
    background: transparent;
    border: none;
    padding: 8px 10px;
    color: var(--muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all .12s ease;
    font-family: inherit;
    font-size: 14px;
    line-height: 1;
}
.btn-icon-link:hover { background: rgba(211,47,47,.08); color: var(--danger); }

/* Plain text-style button for low-emphasis actions like "Clear cart" */
.btn-link-muted {
    background: transparent;
    border: none;
    padding: 4px 6px;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color .12s ease;
}
.btn-link-muted:hover { color: var(--danger); text-decoration: underline; }

/* ---------- Service configuration display ---------- */
.kv-section {
    border-top: 1px solid var(--border);
    margin-top: 8px;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.kv-section > strong {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.codeblock {
    background: var(--bg0);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin: 0;
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--text);
    white-space: pre-wrap;
    overflow-x: auto;
}

/* Secret values rendered for admins (passwords). Visually distinct so admins
   know they're looking at sensitive data. */
.admin-secret {
    background: rgba(224,136,0,.08);
    border: 1px solid rgba(224,136,0,.30);
    color: var(--text);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
    font-size: 13px;
    user-select: all;
}

/* ---------- VPS builder ---------- */
.builder-row {
    display: grid;
    grid-template-columns: 1fr 100px 120px;
    gap: 16px; align-items: center;
    padding: 14px 0; border-bottom: 1px dashed var(--border);
}
.builder-row:last-child { border-bottom: none; }
.builder-row label { font-weight: 600; }
.builder-row input[type=range] { width: 100%; }
.builder-summary {
    position: sticky; top: 100px;
    background: var(--bg0); padding: 22px;
    border-radius: var(--radius-lg); border: 1px solid var(--border);
}
.builder-summary .price-big { font-size: 32px; font-weight: 800; color: var(--primary); }

/* =====================================================================
   PRODUCTS PAGE
   ===================================================================== */
.products-hero {
    padding: 48px 0 24px;
    background: linear-gradient(135deg, var(--bg0) 0%, var(--bg1) 100%);
    border-bottom: 1px solid var(--border);
}
.products-hero h1 { font-size: 32px; margin-bottom: 6px; }

.cat-tabs {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin: 18px 0 0;
    padding-bottom: 4px;
    overflow-x: auto;
}
.cat-tab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 99px;
    background: var(--surface); border: 1px solid var(--border-strong);
    color: var(--text); font-size: 13px; font-weight: 600;
    text-decoration: none; white-space: nowrap;
    transition: all .12s ease;
}
.cat-tab:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.cat-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.cat-tab.active:hover { color: #fff; }
.cat-tab i { opacity: .8; }

.cat-section { padding: 40px 0; border-bottom: 1px solid var(--border); }
.cat-section:last-of-type { border-bottom: none; }
.cat-section .cat-head {
    display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
}
.cat-section .cat-head .feature-icon-wrap { flex: 0 0 auto; }
.cat-section .cat-head h2 { margin: 0; }
.cat-section .cat-head p  { margin: 0; color: var(--muted); font-size: 13px; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.product-card {
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    text-decoration: none; color: var(--text);
    min-height: 240px;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(28,130,214,.3);
    text-decoration: none;
}
.product-card-body { padding: 22px 22px 18px; flex: 1; display: flex; flex-direction: column; }
.product-type-badge {
    align-self: flex-start;
    background: var(--bg1); color: var(--primary);
    font-size: 10px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase;
    padding: 3px 10px; border-radius: 99px;
    margin-bottom: 10px;
}
.product-card h3 { margin: 0 0 6px; font-size: 18px; }
.product-card-desc { color: var(--muted); margin: 0; font-size: 13px; flex: 1; }

.product-card-footer {
    background: linear-gradient(135deg, var(--bg0) 0%, var(--bg1) 100%);
    border-top: 1px solid var(--border);
    padding: 16px 22px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.product-price { display: flex; flex-direction: column; }
.product-price .from { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.product-price .amount {
    font-size: 22px; font-weight: 800; color: var(--primary); line-height: 1.1;
}
.product-price .cycle { font-size: 12px; color: var(--muted); font-weight: 500; }
.product-card .cta {
    color: var(--primary); font-weight: 600; font-size: 13px;
    display: inline-flex; align-items: center; gap: 6px;
}
.product-card:hover .cta { transform: translateX(2px); }

.empty-state {
    text-align: center; padding: 60px 20px;
    color: var(--muted);
    background: var(--bg0); border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.empty-state i { font-size: 42px; margin-bottom: 8px; color: var(--border-strong); }
.empty-state h3 { color: var(--text); margin: 4px 0; }
.empty-state p { margin: 0 0 12px; color: var(--muted); }

/* =====================================================================
   PRODUCT DETAIL PAGE
   ===================================================================== */

/* Two-thirds + one-third layout (used by show.php and vps_builder.php).
   Keeps consistent with .grid-3-1 above; aliasing in case any view uses it. */
.grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}
@media (max-width: 900px) {
    .grid-2-1 { grid-template-columns: 1fr; }
}

.product-detail-hero {
    background: linear-gradient(135deg, var(--bg0) 0%, var(--bg1) 100%);
    padding: 32px 0 40px;
    border-bottom: 1px solid var(--border);
}
.back-link {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--muted); font-size: 13px; font-weight: 500;
    margin-bottom: 18px;
}
.back-link:hover { color: var(--primary); text-decoration: none; }

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: end;
}
.product-detail-grid h1 { font-size: 36px; margin: 8px 0 6px; line-height: 1.15; }
.product-detail-tagline { color: var(--muted); font-size: 16px; max-width: 640px; margin: 0; }

.product-detail-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    box-shadow: var(--shadow-sm);
    text-align: right;
    min-width: 200px;
}
.product-detail-summary .from {
    display: block; color: var(--muted); font-size: 11px;
    text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
    margin-bottom: 4px;
}
.product-detail-summary .price-line {
    display: flex; align-items: baseline; gap: 4px; justify-content: flex-end;
}
.product-detail-summary .amount {
    font-size: 28px; font-weight: 800; color: var(--primary); line-height: 1;
}
.product-detail-summary .cycle { color: var(--muted); font-size: 14px; font-weight: 500; }

@media (max-width: 800px) {
    .product-detail-grid { grid-template-columns: 1fr; }
    .product-detail-summary { text-align: left; }
    .product-detail-summary .price-line { justify-content: flex-start; }
    .product-detail-grid h1 { font-size: 28px; }
}

.product-detail-body { padding: 36px 0 60px; }

/* Long-form description rendered from the admin's HTML editor */
.prose { line-height: 1.7; color: var(--text); }
.prose h1, .prose h2, .prose h3 { margin-top: 18px; }
.prose h2 { font-size: 20px; }
.prose h3 { font-size: 16px; }
.prose p  { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; }
.prose ul li, .prose ol li { margin-bottom: 6px; }
.prose strong { color: var(--text); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.prose code { background: var(--bg1); padding: 2px 6px; border-radius: 4px; }

/* Configurator card on the right side of the product page */
.config-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 22px;
    position: sticky;
    top: 100px;
    display: flex; flex-direction: column; gap: 18px;
}
.config-card h3 { margin: 0; padding-bottom: 14px; border-bottom: 1px solid var(--border); }

.config-field { display: flex; flex-direction: column; gap: 8px; }
.config-card .config-field + .config-field { /* right card uses flex gap, no extra margin needed */ }
.options-card .config-field + .config-field { margin-top: 22px; }
.config-label {
    font-size: 12px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .04em;
    display: flex; align-items: center; gap: 8px;
}
.required-pill {
    background: rgba(211,47,47,.10); color: var(--danger);
    font-size: 9px; font-weight: 700; letter-spacing: .06em;
    padding: 2px 6px; border-radius: 99px; text-transform: uppercase;
}

/* Cycle radio cards */
.cycle-options {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.cycle-options.vps-cycles { grid-template-columns: 1fr; }
.cycle-option { position: relative; cursor: pointer; margin: 0; }
.cycle-option input { position: absolute; opacity: 0; pointer-events: none; }
.cycle-option-body {
    display: flex; flex-direction: column; gap: 4px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    transition: all .12s ease;
    background: var(--surface);
}
.cycle-option:hover .cycle-option-body { border-color: var(--accent); }
.cycle-option input:checked + .cycle-option-body {
    border-color: var(--primary);
    background: var(--bg1);
    box-shadow: 0 0 0 3px rgba(28,130,214,.12);
}
.cycle-option .cycle-name { font-weight: 600; font-size: 13px; color: var(--text); display: flex; gap: 6px; align-items: center; }
.cycle-option .cycle-price { font-size: 12px; color: var(--muted); }
.save-tag {
    background: rgba(31,157,85,.14); color: var(--success);
    font-size: 9px; font-weight: 700; letter-spacing: .04em;
    padding: 2px 6px; border-radius: 99px; text-transform: uppercase;
}

/* Quantity stepper */
.qty-control {
    display: inline-flex; align-items: stretch;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm); overflow: hidden;
    width: fit-content;
}
.qty-btn {
    width: 36px; background: var(--bg0); border: none;
    color: var(--text); font-size: 16px; font-weight: 700;
    cursor: pointer; transition: background .12s ease;
    font-family: inherit;
}
.qty-btn:hover { background: var(--bg1); color: var(--primary); }
.qty-control input {
    width: 60px; text-align: center; border: none;
    border-left: 1px solid var(--border); border-right: 1px solid var(--border);
    font-family: inherit; font-size: 14px; font-weight: 600;
    color: var(--text); background: var(--surface);
    -moz-appearance: textfield;
}
.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-control input:focus { outline: none; }

/* Selects, checkboxes inside the config card */
.config-select {
    width: 100%; padding: 10px 12px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: inherit; font-size: 14px; font-weight: 500;
    color: var(--text); background: var(--surface);
}
.config-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(28,130,214,.18); }

.check-list { display: flex; flex-direction: column; gap: 6px; }
.check-list .check {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    transition: background .12s ease; cursor: pointer; margin: 0;
    font-size: 13px;
}
.check-list .check:hover { background: var(--bg0); }
.check-list .check input { margin: 0; }
.check-list .check span:first-of-type { flex: 1; }
.check-list .check .check-price { color: var(--primary); font-weight: 600; font-size: 12px; }

/* Quantity slider style */
.slider-row {
    display: flex; flex-direction: column; gap: 8px;
    background: var(--bg0); padding: 12px 14px;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.slider-row input[type=range] { width: 100%; accent-color: var(--primary); }
.slider-readout {
    font-size: 14px; font-weight: 700; color: var(--primary);
    display: flex; align-items: baseline; gap: 6px;
}

/* The "Total" block at the bottom of the configurator */
.config-total {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--bg0) 0%, var(--bg1) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: 4px;
}
.config-total-label {
    color: var(--muted); font-size: 12px; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase;
}
.config-total-amount {
    display: flex; align-items: baseline; gap: 4px;
}
.config-total-amount #total-amount,
.config-total-amount #sum-total {
    font-size: 24px; font-weight: 800; color: var(--primary); line-height: 1;
}

.btn-large { padding: 14px 18px; font-size: 14px; }

@media (max-width: 900px) {
    .config-card { position: static; }
}

/* =====================================================================
   VPS BUILDER (sliders + summary)
   ===================================================================== */
.vps-builder { padding: 26px; }
.vps-builder > h3 { margin: 0; }
.vps-builder > p { margin-top: 4px; }

.vps-builder .builder-row {
    display: flex; flex-direction: column; gap: 8px;
    padding: 18px 0; border-bottom: 1px dashed var(--border);
}
.vps-builder .builder-row:last-child { border-bottom: none; }

.builder-row-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.builder-row-head label {
    display: inline-flex; align-items: center; gap: 8px;
    font-weight: 600; font-size: 14px; color: var(--text); margin: 0;
    text-transform: none; letter-spacing: 0;
}
.builder-row-head label i { color: var(--primary); width: 18px; }
.builder-readout {
    font-size: 13px; color: var(--muted);
    background: var(--bg1); padding: 4px 12px; border-radius: 99px;
}
.builder-readout strong { color: var(--primary); font-size: 15px; margin-right: 4px; }

.vps-builder input[type=range] {
    width: 100%; accent-color: var(--primary); height: 6px;
}

.builder-scale {
    display: flex; justify-content: space-between;
    font-size: 11px; color: var(--muted); margin-top: -2px;
}

.build-summary {
    display: flex; flex-direction: column; gap: 8px;
    background: var(--bg0); padding: 14px;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.build-summary .kv {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 13px;
}
.build-summary .kv span:first-child {
    color: var(--muted); display: inline-flex; align-items: center; gap: 8px;
}
.build-summary .kv i { color: var(--primary); width: 16px; }
.build-summary .kv strong { color: var(--text); font-weight: 700; }


/* =====================================================================
   ADMIN - LOGO UPLOADER
   ===================================================================== */
.logo-uploader {
    display: grid; grid-template-columns: 220px 1fr; gap: 22px;
    background: var(--bg0); padding: 18px;
    border-radius: var(--radius-md); border: 1px solid var(--border);
}
.logo-preview {
    background: var(--surface); border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md); min-height: 120px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; padding: 14px;
}
.logo-preview img { max-width: 100%; max-height: 100px; object-fit: contain; }
.logo-placeholder { display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
.logo-placeholder .brand-mark {
    width: 48px; height: 48px; font-size: 18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
}
.logo-controls { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 700px) {
    .logo-uploader { grid-template-columns: 1fr; }
}

/* =====================================================================
   Admin customer profile - top row: profile card + activity card
   ===================================================================== */
.customer-top-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 18px;
}
@media (max-width: 900px) {
    .customer-top-grid { grid-template-columns: 1fr; }
}

.customer-profile-card {
    text-align: center;
    align-self: start;
}
.customer-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
    font-weight: 800;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 22px rgba(20, 134, 216, 0.25);
}
.customer-meta-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 14px;
    text-align: left;
}
.customer-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.12s ease;
}
.customer-meta-row:hover { background: var(--bg1); }
.customer-meta-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(28, 130, 214, 0.10);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.customer-meta-text {
    flex: 1;
    min-width: 0;       /* lets long emails truncate */
    display: flex;
    flex-direction: column;
}
.customer-meta-text small {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 700;
}
.customer-meta-text strong {
    font-size: 13px;
    color: var(--text);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.customer-copy-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    font-size: 12px;
}
.customer-copy-btn:hover {
    background: rgba(28, 130, 214, 0.10);
    color: var(--primary);
}
.customer-copy-btn.is-copied { color: #1F8A4C; }

.customer-spend-strip {
    margin-top: 16px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(28,130,214,0.08), rgba(111,211,255,0.08));
    border: 1px solid rgba(28, 130, 214, 0.18);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.customer-spend-strip small {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    font-weight: 700;
}
.customer-spend-strip strong {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}

/* Activity card */
.customer-activity-card { align-self: start; }
.customer-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 6px;
}
.customer-stat-grid > div {
    background: var(--bg1);
    padding: 12px 14px;
    border-radius: 10px;
}
.customer-stat-grid small {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 4px;
}
.customer-stat-grid strong {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}
.customer-open-balance {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(220, 38, 38, 0.06);
    border: 1px solid rgba(220, 38, 38, 0.18);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.customer-open-balance small {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--danger);
    font-weight: 700;
}
.customer-open-balance strong {
    font-size: 14px;
    font-weight: 800;
    color: var(--danger);
    display: flex;
    gap: 8px;
}

/* Saved cards list */
.customer-pm-list { display: flex; flex-direction: column; gap: 8px; }
.customer-pm-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    flex-wrap: wrap;
}
.customer-pm-row.is-default {
    border-color: rgba(28, 130, 214, 0.35);
    background: rgba(28, 130, 214, 0.04);
}
.customer-pm-icon {
    font-size: 22px;
    color: var(--primary);
    width: 28px;
    text-align: center;
}
.customer-pm-meta { flex: 1; min-width: 120px; display: flex; flex-direction: column; }
.customer-pm-meta strong { font-size: 13px; font-weight: 600; color: var(--text); }
.customer-pm-meta small { font-size: 11px; color: var(--muted); }
.customer-pm-form { display: inline; margin: 0; }
.customer-pm-tag { margin-left: auto; }

/* =====================================================================
   Portal: outstanding-balance pay banner
   Sits above the dashboard stats when the customer has unpaid invoices.
   Two visual states: orange/amber for unpaid (informational nudge),
   red for overdue (urgent).
   ===================================================================== */
.pay-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 18px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #FFF7E6 0%, #FFEDC2 100%);
    border: 1px solid rgba(217, 119, 6, 0.25);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.08);
}
.pay-banner.pay-banner-overdue {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    border-color: rgba(220, 38, 38, 0.30);
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.10);
}
.pay-banner-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    color: #B45309;
    font-size: 20px;
}
.pay-banner.pay-banner-overdue .pay-banner-icon { color: var(--danger); }
.pay-banner-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pay-banner-text strong { font-size: 15px; color: var(--text); font-weight: 700; }
.pay-banner-text small { font-size: 12px; color: var(--muted); }
.pay-banner .btn-neo { flex-shrink: 0; }

@media (max-width: 640px) {
    .pay-banner { flex-wrap: wrap; }
    .pay-banner .btn-neo { width: 100%; justify-content: center; margin-top: 6px; }
}

/* Overdue row highlight on the customer invoices list */
.data-table tr.row-overdue { background: rgba(220, 38, 38, 0.04); }
.data-table tr.row-overdue:hover { background: rgba(220, 38, 38, 0.08); }
