/* 
   NARRA  -  Hub / Portal components ("Narra Fresh")
   Layouts, sidebar, stat cards, widgets, tables, auth, checkout.
   Loads after style.css. Tokens come from style.css.
    */

/*  Hub shell  */
.hub-layout { display: flex; min-height: 100vh; background: var(--bg); }

.hub-sidebar {
    width: 258px; flex-shrink: 0;
    background: var(--surface); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
    z-index: 100; transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.hub-layout.collapsed .hub-sidebar { width: 0; overflow: hidden; border-right: none; pointer-events: none; }
.hub-layout.collapsed #sidebar-uncollapse-toggle { display: flex !important; }

.hub-sidebar-header { padding: 1.35rem 1.5rem; display: flex; align-items: center; gap: 0.7rem; border-bottom: 1px solid var(--border-subtle); }
.hub-sidebar-header img { width: 32px; height: 32px; }
.hub-sidebar-header span { font-weight: 800; font-size: 1.08rem; font-family: var(--ff-font-heading); color: var(--text); }
.hub-sidebar-header b { color: var(--brand-strong); }
.hub-sidebar-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--text-dim); padding: 0 0.5rem; margin: 0.5rem 0 0.25rem; }
.hub-sidebar-divider { height: 1px; background: var(--border-subtle); margin: 0.6rem 0.5rem; }

.hub-nav { padding: 1rem 0.85rem; flex: 1; display: flex; flex-direction: column; gap: 0.22rem; overflow-y: auto; }
.hub-nav-item {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.62rem 0.85rem; min-height: 44px;
    color: var(--text-muted); border-radius: var(--radius-sm);
    font-weight: 500; font-size: 0.88rem; transition: var(--transition);
    border: 1px solid transparent; position: relative;
}
.hub-nav-item svg, .hub-nav-item i { width: 19px; height: 19px; flex-shrink: 0; }
.hub-nav-item:hover { background: var(--surface-2); color: var(--text); }
.hub-nav-item.active { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); font-weight: 600; }
.nav-new-badge { margin-left: auto; font-size: 0.6rem; font-weight: 700; text-transform: uppercase; padding: 0.1rem 0.4rem; border-radius: 999px; background: var(--brand); color: #fff; }
.hub-sidebar-footer { padding: 1rem 0.85rem; border-top: 1px solid var(--border-subtle); margin-top: auto; }
/* style.css reuses .profile-dropdown as a hidden floating panel (opacity 0).
   In the sidebar footer it is the always-visible account row, so reset it. */
.hub-sidebar-footer .profile-dropdown {
    position: relative; top: auto; right: auto; min-width: 0; padding: 0;
    background: none; border: 0; border-radius: 0; box-shadow: none;
    opacity: 1; pointer-events: auto; transform: none; z-index: auto;
}
.hub-sidebar-footer .profile-toggle:hover { background: var(--surface-2) !important; }
.hub-sidebar-footer .profile-menu {
    list-style: none; opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}
.hub-sidebar-footer .profile-menu.active { opacity: 1; visibility: visible; pointer-events: auto; }
.hub-sidebar-footer .profile-menu a:hover { background: var(--surface-2); }
.hub-sidebar-section { display: flex; flex-direction: column; gap: 0.2rem; }

.hub-content { flex: 1; padding: 2rem 2.5rem 4rem; max-width: 1300px; margin: 0 auto; width: 100%; min-width: 0; }
.hub-topbar { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.hub-title h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 0.15rem; letter-spacing: -0.02em; }
.hub-title p { color: var(--text-muted); font-size: 0.82rem; }
.hub-top-actions { display: flex; align-items: center; gap: 0.85rem; margin-left: auto; }
.hub-page-header { margin-bottom: 2rem; }
.hub-page-title h1 { font-size: 1.6rem; font-weight: 800; }
.hub-page-title p { color: var(--text-muted); font-size: 0.84rem; }

/*  Stat cards  */
.stat-grid, .stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.stat-card {
    position: relative; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.4rem; min-height: 116px;
    display: flex; flex-direction: column; justify-content: center;
    box-shadow: none; transition: var(--transition); overflow: hidden;
}
.stat-card:hover { border-color: var(--border-strong); box-shadow: none; }


.stat-card h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); font-weight: 700; display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.5rem; font-family: var(--ff-font-ui); }
.stat-card h3 svg { width: 16px; height: 16px; }
.stat-value, .stat-val { font-family: var(--ff-font-heading); font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.stat-value.green { color: var(--brand-strong); }
.stat-card-label { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); font-weight: 700; }
.stat-card-label i { margin-right: 0.35rem; }
.stat-card-sub { font-size: 0.76rem; color: var(--text-dim); margin-top: 0.35rem; }
.stat-card-trend { font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px; display: inline-flex; align-items: center; gap: 0.25rem; margin-top: 0.6rem; }
.stat-card-trend.up { background: var(--brand-050); color: var(--brand-strong); }
.stat-card-trend.neutral { background: var(--surface-3); color: var(--text-muted); }
.stat-icon { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }

/*  Widgets / grids  */
.widget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.widget-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.widget-action, .widget-action-link { font-size: 0.8rem; color: var(--brand-strong); font-weight: 600; display: inline-flex; align-items: center; gap: 0.3rem; }
.widget-action:hover, .widget-action-link:hover { color: var(--brand); }
.dashboard-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.5rem; align-items: start; }
.dashboard-grid > div { display: flex; flex-direction: column; gap: 1.5rem; }
.instance-grid, .services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }

/*  Server / instance cards  */
.server-card, .server-card-enhanced, .instance-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.4rem; box-shadow: none;
    transition: var(--transition);
}
.server-card-enhanced.running { border-color: var(--border-strong); }
.server-card-enhanced.stopped { border-color: var(--border-strong); }
.server-card-enhanced.provisioning { border-color: var(--border-strong); }
.server-card-enhanced:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.server-icon, .instance-icon { width: 42px; height: 42px; border-radius: 11px; background: var(--brand-050); color: var(--brand-strong); display: inline-flex; align-items: center; justify-content: center; }
.instance-summary, .container-summary { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1rem; }
.instance-details, .container-details { flex: 1; min-width: 0; }
.instance-details h4, .container-details h4, .server-card h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.15rem; }
.instance-details p, .container-details p { font-size: 0.78rem; color: var(--text-muted); }
.server-details { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.75rem; }
.server-details .detail-row { display: flex; justify-content: space-between; font-size: 0.8rem; padding: 0.35rem 0; border-bottom: 1px solid var(--border-subtle); }
.server-details .detail-row:last-child { border-bottom: none; }
.server-details .label { color: var(--text-dim); }
.server-details .val { color: var(--text); font-weight: 600; font-family: var(--ff-font-mono); font-size: 0.78rem; }
.quick-actions, .hub-hero-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
.quick-action-btn { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.5rem 0.9rem; min-height: 44px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); font-size: 0.81rem; font-weight: 600; }
.quick-action-btn:hover { border-color: var(--brand); color: var(--brand-strong); background: var(--brand-050); }
.save-pill { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px; background: var(--brand-050); color: var(--brand-strong); }

/*  Resource meters  */
.resource-item { margin-bottom: 0.9rem; }
.resource-labels { display: flex; justify-content: space-between; font-size: 0.78rem; margin-bottom: 0.35rem; color: var(--text-muted); }
.resource-value { font-family: var(--ff-font-mono); color: var(--text); font-weight: 600; }
.resource-track, .progress-track { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.resource-fill, .progress-fill { height: 100%; border-radius: 999px; background: var(--brand); transition: width 0.5s ease; }
.resource-fill.warning { background: var(--warning); }
.resource-fill.danger { background: var(--danger); }
.progress-fill.fill-green { background: var(--brand); }
.metrics-container .metric-block { margin-bottom: 1rem; }
.metric-header { display: flex; justify-content: space-between; font-size: 0.78rem; margin-bottom: 0.35rem; }

/*  Plan banner  */
.plan-banner { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.plan-info { flex: 1; min-width: 180px; }
.plan-details h2 { font-size: 1.1rem; margin-bottom: 0.2rem; }
.plan-details p { font-size: 0.8rem; color: var(--text-muted); }
.plan-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--btn-bg); color: var(--btn-fg); display: inline-flex; align-items: center; justify-content: center; }
.plan-amount { font-family: var(--ff-font-heading); font-weight: 800; font-size: 1.4rem; }
.mono-account { font-family: var(--ff-font-mono); font-size: 0.82rem; color: var(--text-muted); }

/*  Billing  */
.billing-list { display: flex; flex-direction: column; }
.billing-item { display: flex; align-items: center; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border-subtle); }
.billing-item:last-child { border-bottom: none; }
.billing-thumb, .b-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); flex-shrink: 0; }
.billing-info { flex: 1; min-width: 0; }
.billing-info h4 { font-size: 0.9rem; margin-bottom: 0.1rem; }
.billing-info p { font-size: 0.78rem; color: var(--text-muted); }
.billing-amount { text-align: right; }
.billing-amount .price { font-family: var(--ff-font-heading); font-weight: 800; font-size: 1.05rem; }
.billing-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.billing-label.active { color: var(--brand-strong); }
.billing-track { position: relative; height: 38px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); display: flex; align-items: center; padding: 0 6px; cursor: pointer; width: 100%; }
.billing-thumb { transition: transform 0.25s ease; }
.billing-track.annual .billing-thumb { transform: translateX(calc(100% + 6px)); }
.summary-item { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 0.5rem 0; color: var(--text-muted); }
.summary-total { display: flex; justify-content: space-between; font-size: 1.05rem; font-weight: 800; padding-top: 0.75rem; margin-top: 0.5rem; border-top: 1px solid var(--border); color: var(--text); }
.total-price { font-family: var(--ff-font-heading); font-weight: 800; color: var(--brand-strong); }

/*  Settings  */
.settings-tabs-container, .settings-tabs { display: flex; gap: 1.5rem; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 1.75rem; padding-bottom: 0; }
.settings-tab-btn { padding: 0.65rem 0.25rem; min-height: 44px; display: inline-flex; align-items: center; gap: 0.45rem; border-radius: 0; font-size: 0.88rem; font-weight: 500; color: var(--text-muted); border: none; background: none; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.settings-tab-btn:hover { color: var(--text); }
.settings-tab-btn.active { color: var(--text); border-bottom-color: var(--brand); font-weight: 600; }
.settings-section-title { font-size: 1.02rem; font-weight: 700; font-family: var(--ff-font-heading); margin-bottom: 0.25rem; }
.settings-section-desc { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.settings-list .s-row, .s-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border-subtle); font-size: 0.85rem; }
.settings-list .s-lbl, .s-key { color: var(--text-muted); }
.settings-list .s-val, .s-val { color: var(--text); font-weight: 600; }
.settings-row-action { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.25rem; }
.toggle-row { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; }

/* Toggle switch */
.tgl-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.tgl-switch input { opacity: 0; width: 0; height: 0; }
.tgl-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border-strong); border-radius: 999px; transition: var(--transition); }
.tgl-slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: var(--transition); box-shadow: var(--shadow-xs); }
.tgl-switch input:checked + .tgl-slider { background: var(--brand); }
.tgl-switch input:checked + .tgl-slider::before { transform: translateX(20px); }
.tgl-label { font-size: 0.86rem; font-weight: 600; }
.tgl-sub { font-size: 0.76rem; color: var(--text-muted); }

/*  Mobile tab bar  */
.mobile-tab-bar, .hub-bottom-nav {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom));
}
.mobile-tabs, .hub-bottom-nav-inner { display: flex; justify-content: space-around; align-items: center; }
.mobile-tab-item, .hub-bottom-nav-item { flex: 1; text-align: center; color: var(--text-dim); font-size: 0.66rem; font-weight: 600; padding: 0.35rem 0.2rem; min-height: 44px; display: flex; flex-direction: column; justify-content: center; align-items: center; border-radius: var(--radius-sm); position: relative; }
.mobile-tab-item svg, .hub-bottom-nav-item i, .mobile-tab-item i { width: 22px; height: 22px; margin: 0 auto 3px; display: block; }
.mobile-tab-item.active, .mobile-tab-item.active a, .hub-bottom-nav-item.active { color: var(--brand-strong); }
.hub-bottom-nav-item.active::before { content: ''; position: absolute; top: 0; left: 25%; right: 25%; height: 2px; border-radius: 999px; background: var(--brand); }

/*  Steps / timeline  */
.timeline { position: relative; padding-left: 1.75rem; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-step { position: relative; padding-bottom: 1.5rem; }
.timeline-step:last-child { padding-bottom: 0; }
.step-dot { position: absolute; left: -1.75rem; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.step-dot.completed { background: var(--brand); border-color: var(--brand); }
.step-title { font-weight: 700; font-size: 0.9rem; }
.step-desc, .step-content p { font-size: 0.82rem; color: var(--text-muted); }
.step-indicator, .checkout-process { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; }
.step-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-dim); }
.step-no { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; }
.step-item.active .step-no { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.cp-step { display: flex; align-items: center; gap: 0.5rem; }

/*  Auth pages  */
.auth-container, .auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: var(--bg); }
.auth-card-v2 {
    width: 100%; max-width: 440px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: none; padding: 2.25rem;
}
.auth-logo-wrap { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.auth-logo-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--brand-050); display: flex; align-items: center; justify-content: center; }
.auth-logo-icon img { width: 32px; height: 32px; }
.auth-title { text-align: center; font-size: 1.5rem; font-weight: 800; margin-bottom: 0.4rem; }
.auth-subtitle { text-align: center; font-size: 0.86rem; color: var(--text-muted); margin-bottom: 1.75rem; }
.auth-field { position: relative; margin-bottom: 1.1rem; }
.auth-field label { font-size: 0.8rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; display: block; }
.auth-field input, .auth-field select { width: 100%; min-height: 44px; padding: 0.7rem 0.9rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.9rem; color: var(--text); }
.auth-field input:focus, .auth-field select:focus { border-color: var(--brand); box-shadow: var(--ring); outline: none; }
.auth-field .pw-toggle { position: absolute; right: 0.5rem; top: 1.85rem; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-dim); cursor: pointer; background: none; border: none; }
.auth-field .pw-toggle:hover { color: var(--brand-strong); }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; font-size: 0.8rem; }
.auth-submit { width: 100%; min-height: 44px; padding: 0.8rem; background: var(--btn-bg); color: var(--btn-fg); border: 1px solid transparent; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.92rem; transition: var(--transition); cursor: pointer; }
.auth-submit:hover { background: var(--btn-bg-hover); color: var(--btn-fg); }
.auth-divider { display: flex; align-items: center; gap: 0.9rem; margin: 1.5rem 0; color: var(--text-dim); font-size: 0.76rem; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; background: var(--border); flex: 1; }
.login-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: none; padding: 2.25rem; }
.otp-inputs { display: flex; gap: 0.6rem; justify-content: center; }
.otp-digit { width: 48px; height: 56px; text-align: center; font-size: 1.4rem; font-weight: 700; font-family: var(--ff-font-mono); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.otp-digit:focus { border-color: var(--brand); box-shadow: var(--ring); outline: none; }
.success-card, .success-hero { text-align: center; }
.success-icon { width: 68px; height: 68px; border-radius: 50%; background: var(--brand-050); color: var(--brand-strong); display: inline-flex; align-items: center; justify-content: center; margin: 0 auto 1.25rem; }
.success-hero h1 { margin-bottom: 0.75rem; }
.success-msg { color: var(--text-muted); }

/*  Portal / integration  */
.portal-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.portal-card { position: relative; display: flex; flex-direction: column; }
.portal-card-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-050); color: var(--brand-strong); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 0.9rem; }
.portal-card h3 { font-size: 1.05rem; margin-bottom: 0.35rem; }
.portal-card p { font-size: 0.84rem; color: var(--text-muted); flex: 1; }
.portal-card-action { margin-top: 1.1rem; }
.portal-card-status { position: absolute; top: 1.25rem; right: 1.25rem; font-size: 0.68rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 999px; }
.portal-card-status.available { background: var(--brand-050); color: var(--brand-strong); }
.portal-card-status.coming-soon { background: var(--surface-3); color: var(--text-dim); }
.portal-lookup { display: flex; gap: 0.6rem; max-width: 520px; margin: 1.5rem auto 0; }
.portal-lookup input { flex: 1; }
.integration-banner { display: flex; align-items: center; gap: 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; flex-wrap: wrap; }
.integration-banner-icon { width: 50px; height: 50px; border-radius: 13px; background: var(--btn-bg); color: var(--btn-fg); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.integration-banner-text { flex: 1; min-width: 220px; }
.integration-banner-text h3 { font-size: 1.05rem; margin-bottom: 0.25rem; }
.integration-banner-text p { font-size: 0.85rem; color: var(--text-muted); }
.integration-banner-text a { color: var(--brand-strong); font-weight: 600; }

/*  Checkout drawer  */
.checkout-drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(440px, 100%); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 1600; transform: translateX(100%); transition: transform 0.3s ease; display: flex; flex-direction: column; overflow-y: auto; }
.checkout-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 1.5rem; border-bottom: 1px solid var(--border); }
.drawer-header h3 { font-size: 1.1rem; }
.drawer-close { width: 44px; height: 44px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 1.3rem; }
.drawer-close:hover { background: var(--surface-2); color: var(--text); }
.drawer-form { padding: 1.5rem; flex: 1; }
.drawer-plan-summary { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem; }
.drawer-plan-name { font-weight: 700; font-size: 1rem; }
.drawer-plan-price { display: flex; align-items: baseline; gap: 0.3rem; margin-top: 0.35rem; }
.drawer-plan-price strong { font-family: var(--ff-font-heading); font-size: 1.6rem; font-weight: 800; color: var(--brand-strong); }
.drawer-submit { width: 100%; margin-top: 1rem; }

/*  Add-ons  */
.addons-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.addon-card { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; transition: var(--transition); }
.addon-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.addon-icon { width: 42px; height: 42px; border-radius: 11px; background: var(--brand-050); color: var(--brand-strong); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.addon-name { font-weight: 700; font-size: 0.92rem; }
.addon-desc { font-size: 0.78rem; color: var(--text-muted); }
.addon-price { font-weight: 700; color: var(--brand-strong); }

/*  Live support chat  */
.chat-container, .chat-window { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; min-height: 520px; box-shadow: none; }
.chat-sidebar { width: 280px; border-right: 1px solid var(--border); background: var(--surface-2); display: flex; flex-direction: column; flex-shrink: 0; }
.chat-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); font-weight: 700; }
.channels-list { flex: 1; overflow-y: auto; padding: 0.5rem; }
.channel-item { display: flex; gap: 0.7rem; padding: 0.7rem; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); }
.channel-item:hover, .channel-item.active { background: var(--surface-3); }
.channel-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-050); color: var(--brand-strong); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.channel-info { flex: 1; min-width: 0; }
.channel-name { font-size: 0.86rem; font-weight: 600; }
.channel-preview { font-size: 0.76rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-meta { font-size: 0.68rem; color: var(--text-dim); }
.channel-time { font-size: 0.68rem; color: var(--text-dim); }
.unread-badge { background: var(--brand); color: #fff; font-size: 0.64rem; font-weight: 700; border-radius: 999px; padding: 0.05rem 0.4rem; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 0.9rem; }
.message-bubble { max-width: 75%; padding: 0.7rem 1rem; border-radius: 14px; font-size: 0.86rem; background: var(--surface-3); color: var(--text); }
.message-bubble.outgoing, .message-bubble.me { align-self: flex-end; background: var(--btn-bg); color: var(--btn-fg); }
.message-time { font-size: 0.66rem; color: var(--text-dim); margin-top: 0.25rem; }
.chat-input-container { display: flex; gap: 0.6rem; padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.chat-input-container input { flex: 1; }
.chat-placeholder { display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 0.86rem; flex: 1; }

/*  Radio tiles  */
.radio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.9rem; }
.radio-tile { position: relative; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; cursor: pointer; transition: var(--transition); background: var(--surface); }
.radio-tile:hover { border-color: var(--border-strong); }
.radio-tile.selected, .radio-tile input:checked ~ * { border-color: var(--brand); }
.radio-tile:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.tile-top-content { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.tile-logo { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; }
.tile-bottom-content { font-size: 0.8rem; color: var(--text-muted); }

/*  Log console (ops)  */
.log { background: var(--surface-inset); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.85rem; font-family: var(--ff-font-mono); font-size: 0.76rem; overflow-y: auto; line-height: 1.7; }
.log .e { display: flex; gap: 0.5rem; color: var(--text-muted); }
.log .e span:first-child { color: var(--text-dim); }
.log .e.ok span:first-child { color: var(--success); }
.log .e.error span:first-child { color: var(--danger); }

/*  Misc shared  */
.search-container, .search-box { position: relative; }
.search-icon { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.search-box input, .search-container input { padding-left: 2.4rem; }
.search-kbd, .s-key { font-family: var(--ff-font-mono); font-size: 0.68rem; background: var(--surface-3); border: 1px solid var(--border); border-radius: 6px; padding: 0.1rem 0.4rem; color: var(--text-dim); }
.filter-tab { padding: 0.45rem 0.9rem; min-height: 44px; display: inline-flex; align-items: center; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); font-size: 0.8rem; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.filter-tab:hover { border-color: var(--border-strong); color: var(--text); }
.filter-tab.active { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.history-card, .user-list-card, .table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: none; }
.incident-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.incident-card.resolved { border-color: var(--border-strong); }
.incident-title { font-weight: 700; font-size: 0.95rem; }
.incident-body { font-size: 0.84rem; color: var(--text-muted); margin-top: 0.35rem; }
.incident-tag, .port-badge { font-family: var(--ff-font-mono); font-size: 0.7rem; background: var(--surface-3); border: 1px solid var(--border); border-radius: 6px; padding: 0.1rem 0.45rem; color: var(--text-muted); }
.upload-drag-container { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 2rem; text-align: center; color: var(--text-muted); transition: var(--transition); cursor: pointer; }
.upload-drag-container:hover, .upload-drag-container.dragover { border-color: var(--brand); background: var(--brand-050); color: var(--brand-strong); }
.document-viewer { background: var(--surface-inset); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; overflow: auto; }
.explorer-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.85rem; }
.explorer-row:hover { background: var(--surface-2); }
.manage-modal-left { flex: 1; } .manage-modal-right { width: 320px; }

/*  Responsive  */
@media (max-width: 968px) {
    .hub-sidebar { position: fixed; left: 0; top: 0; height: 100vh; transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .hub-sidebar.open { transform: translateX(0); }
    .hub-content { padding: 1.5rem 1.25rem 5.5rem; }
    .mobile-tab-bar, .hub-bottom-nav { display: block; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .chat-container, .chat-window { flex-direction: column; }
    .chat-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
}
@media (max-width: 640px) {
    .stat-grid, .stat-cards { grid-template-columns: 1fr 1fr; }
    .hub-topbar { flex-direction: column; align-items: flex-start; }
    .hub-top-actions { margin-left: 0; width: 100%; }
}
@media (max-width: 420px) {
    .stat-grid, .stat-cards { grid-template-columns: 1fr; }
    .otp-digit { width: 40px; height: 48px; }
}

/* --- Keyboard Accessibility (WCAG AA) --- */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--brand-strong);
    outline-offset: 2px;
}
.btn:focus-visible, .hub-nav-item:focus-visible, .settings-tab-btn:focus-visible {
    outline: 2px solid var(--brand-strong);
    outline-offset: 2px;
}
