/* ============================================================
   Console — light application shell (matches homepage style)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; margin: 0; }
body { min-height: 100%; margin: 0; padding-top: 64px; }

:root {
    --cb-bg:        #fffcf5;
    --cb-topbar:    rgba(255, 255, 255, 0.95);
    --cb-sidebar:   rgba(255, 255, 255, 0.92);
    --cb-surface:   rgba(255, 255, 255, 0.80);
    --cb-surface-2: rgba(255, 255, 255, 0.60);
    --cb-border:    rgba(15, 23, 42, 0.08);
    --cb-border-2:  rgba(15, 23, 42, 0.05);
    --cb-text:      #0a0a0a;
    --cb-text-2:    #3f3f46;
    --cb-text-3:    #6b7280;
    --amber:        #f59e0b;
    --amber-light:  #fbbf24;
    --amber-deep:   #d97706;
    --amber-glow:   rgba(245, 158, 11, 0.12);
    --dock-h:       0px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(160deg, #fffbf2 0%, #ffffff 40%, #fffdf5 72%, #fff9ed 100%) fixed;
    color: var(--cb-text);
    min-height: 100vh;
}

/* ── Console application top bar ── */
#console-top-bar {
    height: 64px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(245, 158, 11, 0.18);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    padding: 0;
    /* Use fixed instead of sticky — sticky breaks on iOS Safari when html/body
       height is constrained; fixed + GPU compositing is the reliable solution */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    flex-shrink: 0;
    box-shadow: 0 1px 8px rgba(15, 23, 42, 0.06);
    /* Force GPU compositing — prevents iOS Safari scroll-away bug */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}
#console-top-bar-inner {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.ctb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    padding: 4px 6px;
    margin: -4px -6px;
    transition: background 0.15s ease;
}
.ctb-brand:hover {
    background: rgba(255, 255, 255, 0.06);
}
.ctb-logo-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 60%, #d97706 100%);
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ctb-logo-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--cb-text);
    letter-spacing: -0.01em;
}
.ctb-sep {
    width: 1px;
    height: 16px;
    background: var(--cb-border);
    flex-shrink: 0;
}
.ctb-console-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--cb-text-3);
    letter-spacing: 0.01em;
}
.ctb-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
#ctb-user-info {
    display: none;
    align-items: center;
    gap: 8px;
}
.ctb-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--amber), var(--amber-light));
    color: #1a0e00;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
#ctb-user-email {
    font-size: 0.82rem;
    color: var(--cb-text-2);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#ctb-logout-btn {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 8px;
    color: var(--cb-text-3);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
}
#ctb-logout-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.22);
    color: #dc2626;
}

/* ── Shell wrapper ── */
#console-main-content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    min-height: calc(100vh - 64px);
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ── Loading overlay ── */
#console-loading-screen {
    position: absolute;
    inset: 0;
    z-index: 50;
    background: var(--cb-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
}
#console-loading-screen .cl-spinner {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(245, 158, 11, 0.18);
    border-top-color: var(--amber);
    border-radius: 50%;
    animation: cl-spin 0.75s linear infinite;
}
@keyframes cl-spin { to { transform: rotate(360deg); } }
#console-loading-screen .cl-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--cb-text-3);
    text-transform: uppercase;
    letter-spacing: 0.10em;
}

/* ── Sidebar ── */
.c-sidebar {
    width: 248px;
    min-width: 248px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.88);
    border-right: 1px solid var(--cb-border);
    display: flex;
    flex-direction: column;
    padding: 20px 12px 16px;
    position: sticky;
    top: 64px;
    align-self: flex-start;
    height: calc(100vh - 64px);
    overflow: hidden;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.c-sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(15,23,42,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,23,42,0.018) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}
.c-sidebar > * { position: relative; z-index: 1; }

.c-sidebar-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 16px;
}

.c-sidebar-divider {
    height: 1px;
    background: var(--cb-border-2);
    margin: 14px 0;
}
.s-nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    color: var(--cb-text-2);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
}
.s-nav-btn:hover {
    background: rgba(245, 158, 11, 0.08);
    color: var(--cb-text);
}
.s-nav-btn.s-nav-active {
    background: rgba(245, 158, 11, 0.12);
    color: var(--cb-text);
}
.s-nav-btn .s-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(15, 23, 42, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.c-sidebar-section { margin-bottom: 6px; }
.c-sidebar-title {
    font-size: 0.64rem;
    font-weight: 700;
    color: var(--cb-text-3);
    text-transform: uppercase;
    letter-spacing: 0.11em;
    padding: 0 8px;
    margin-bottom: 7px;
}
.sidebar-add-btn {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 10px;
    background: rgba(245, 158, 11, 0.10);
    color: var(--amber-deep);
    border: 1px solid rgba(245, 158, 11, 0.24);
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background 0.15s;
}
.sidebar-add-btn:hover { background: rgba(245, 158, 11, 0.18); }

/* ── Sidebar logout button ── */
.s-nav-btn-logout {
    color: #f87171;
    margin-top: 4px;
}
.s-nav-btn-logout:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}
.s-nav-btn-logout .s-icon {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.14);
}

/* ── Mobile bottom navigation bar (hidden on desktop) ── */
.c-mobile-nav {
    display: none;
}

.server-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}
.server-item:hover { background: rgba(15, 23, 42, 0.04); }
.server-item.active {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.22);
}

/* ── Main panel ── */
.c-main {
    flex: 1;
    min-width: 0;
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    background: transparent;
}
.c-content {
    flex: 1;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
#console-main-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ── Cards ── */
.dash-card {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.60);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 12px rgba(15,23,42,0.06), 0 1px 3px rgba(15,23,42,0.03), inset 0 1px 0 rgba(255,255,255,0.88);
}
.dash-card-header {
    padding: 13px 20px;
    background: rgba(15, 23, 42, 0.02);
    border-bottom: 1px solid var(--cb-border-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.dash-card-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--cb-text-2);
    text-transform: uppercase;
    letter-spacing: 0.11em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dash-card-body { padding: 20px 22px; }

/* ── Server banner ── */
.server-banner {
    background: rgba(245, 158, 11, 0.03);
    padding: 20px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--cb-border-2);
    position: relative;
}
.server-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(245,158,11,0.38), rgba(217,119,6,0.28), transparent);
}
.server-banner h2 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--cb-text);
    margin: 0;
    letter-spacing: -0.015em;
}
.server-meta {
    font-size: 0.70rem;
    color: var(--cb-text-3);
    margin-top: 3px;
    font-family: 'SFMono-Regular', Consolas, monospace;
}

/* ── Power buttons ── */
.power-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.power-label {
    font-size: 0.63rem;
    color: var(--cb-text-3);
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.pbtn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    font-size: 0.78rem; font-weight: 600;
    cursor: pointer; border-radius: 8px;
    border: 1px solid;
    transition: all 0.18s;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.pbtn-vnc   { background: rgba(245,158,11,0.10); color: var(--amber-deep); border-color: rgba(245,158,11,0.28); }
.pbtn-vnc:hover   { background: rgba(245,158,11,0.18); border-color: rgba(245,158,11,0.48); }
.pbtn-start { background: rgba(34,197,94,0.08); color: #16a34a; border-color: rgba(34,197,94,0.22); }
.pbtn-start:hover { background: rgba(34,197,94,0.14); }
.pbtn-restart { background: rgba(59,130,246,0.08); color: #2563eb; border-color: rgba(59,130,246,0.22); }
.pbtn-restart:hover { background: rgba(59,130,246,0.14); }
.pbtn-stop  { background: rgba(239,68,68,0.07); color: #dc2626; border-color: rgba(239,68,68,0.20); }
.pbtn-stop:hover  { background: rgba(239,68,68,0.13); }
.pbtn:disabled,
.pbtn.pbtn-disabled {
    opacity: 0.36;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Quick action card disabled state (device pending activation) ── */
.quick-action-card.qa-disabled {
    opacity: 0.42;
    cursor: not-allowed;
    pointer-events: none;
}
.quick-action-card.qa-disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ── Terminal (retain dark — inherent terminal aesthetic) ── */
.terminal {
    background: #0d1117;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
}
.terminal-titlebar {
    background: #161b22;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.t-dot { width: 11px; height: 11px; border-radius: 50%; }
.t-title {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.22);
    margin-left: 8px;
    font-family: 'SFMono-Regular', Consolas, monospace;
}
.terminal-body { padding: 16px; display: flex; flex-direction: column; gap: 15px; flex: 1; min-height: 0; }
.t-row { display: flex; flex-direction: column; gap: 5px; }
.t-label {
    font-size: 0.63rem;
    color: rgba(255, 255, 255, 0.26);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.t-value {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.82rem;
    word-break: break-all;
}
.t-value.ip-val  { color: #63b3ed; }
.t-value.pwd-val { color: var(--amber-light); letter-spacing: 0.05em; }
.t-actions { display: flex; gap: 6px; margin-top: 3px; }
.t-btn {
    font-size: 0.64rem;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.36);
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex; align-items: center; gap: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.t-btn:hover {
    background: rgba(245, 158, 11, 0.13);
    color: var(--amber-light);
    border-color: rgba(245, 158, 11, 0.26);
}

/* ── Spec grid ── */
.spec-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}
.spec-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 12px;
    transition: border-color 0.2s;
}
.spec-item:hover { border-color: rgba(245, 158, 11, 0.22); }
.spec-icon {
    width: 34px; height: 34px;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.88rem; flex-shrink: 0;
    margin-top: 1px;
}
.spec-label {
    font-size: 0.63rem;
    color: var(--cb-text-3);
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 600;
}
.spec-val  { font-size: 0.84rem; font-weight: 700; color: var(--cb-text); line-height: 1.25; }
.spec-sub  { font-size: 0.67rem; color: var(--cb-text-3); margin-top: 2px; }

/* ── Quick action cards ── */
.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 20px 12px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 14px;
    transition: all 0.20s;
    cursor: pointer;
}
.quick-action-card:hover {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.22);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15,23,42,0.08), 0 2px 8px rgba(245,158,11,0.08);
}
.qa-icon {
    width: 46px; height: 46px;
    border-radius: 13px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.16);
    display: flex; align-items: center; justify-content: center;
    color: var(--amber-deep);
    transition: background 0.2s;
}
.quick-action-card:hover .qa-icon { background: rgba(245, 158, 11, 0.14); }
.qa-label { font-size: 0.83rem; font-weight: 700; color: var(--cb-text); }
.qa-desc  { font-size: 0.70rem; color: var(--cb-text-3); margin-top: -4px; }

/* ── Usage tips ── */
.tip-item {
    padding: 18px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 12px;
    transition: border-color 0.2s;
}
.tip-item:hover { border-color: rgba(245, 158, 11, 0.18); }
.tip-num {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--amber-light), var(--amber-deep));
    color: #1a0e00;
    font-size: 0.70rem; font-weight: 800;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.22);
}
.tip-title { font-size: 0.87rem; font-weight: 700; color: var(--cb-text); margin-bottom: 6px; }
.tip-body  { font-size: 0.77rem; color: var(--cb-text-2); line-height: 1.65; }
.tip-body code {
    color: var(--amber-deep);
    background: rgba(245, 158, 11, 0.08);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.77rem; font-weight: 600;
}

/* ── Addon items ── */
.addon-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 12px;
    transition: border-color 0.18s;
}
.addon-row:hover { border-color: rgba(245, 158, 11, 0.20); }

/* ── Modals ── */
.m-overlay {
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.m-panel {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.70);
    border-radius: 20px;
    box-shadow: 0 32px 80px rgba(15, 23, 42, 0.18), 0 8px 24px rgba(15,23,42,0.08);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    overflow: hidden;
    width: 100%;
}
.m-head {
    background: rgba(15, 23, 42, 0.02);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--cb-border-2);
}
.m-head-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.90rem; font-weight: 700;
    color: var(--amber-deep);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.m-head-icon {
    width: 32px; height: 32px;
    background: rgba(245, 158, 11, 0.10);
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    color: var(--amber-deep); font-size: 0.85rem;
}
.m-close {
    width: 28px; height: 28px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: 7px;
    color: var(--cb-text-3);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 0.78rem;
    transition: background 0.15s, color 0.15s;
}
.m-close:hover {
    background: rgba(245, 158, 11, 0.10);
    color: var(--amber-deep);
    border-color: rgba(245, 158, 11, 0.24);
}
.m-body { padding: 24px; }
.m-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    border: 1.5px solid var(--cb-border);
    border-radius: 9px;
    padding: 11px 14px;
    color: var(--cb-text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-weight: 500;
}
.m-input:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.10);
}
.m-input::placeholder { color: var(--cb-text-3); }
textarea.m-input { resize: none; }
.m-label {
    font-size: 0.70rem; font-weight: 700; color: var(--cb-text-2);
    display: block; margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.m-btn-primary {
    padding: 11px 22px;
    background: linear-gradient(135deg, var(--amber) 0%, var(--amber-light) 60%, #fde68a 100%);
    color: #1a0e00;
    border: none;
    border-radius: 999px;
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    font-weight: 700; font-size: 0.88rem; cursor: pointer;
    display: inline-flex; align-items: center; gap: 7px;
    text-transform: uppercase; letter-spacing: 0.04em;
    transition: transform 0.2s, box-shadow 0.2s;
}
.m-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
.m-btn-ghost {
    padding: 11px 22px;
    background: rgba(15, 23, 42, 0.04);
    color: var(--cb-text-2);
    border: 1px solid var(--cb-border);
    border-radius: 999px;
    font-weight: 600; font-size: 0.88rem; cursor: pointer;
    text-transform: uppercase; letter-spacing: 0.04em;
    transition: background 0.15s, border-color 0.15s;
}
.m-btn-ghost:hover {
    background: rgba(15, 23, 42, 0.08);
    border-color: rgba(245, 158, 11, 0.24);
}

/* Invoice table */
.bill-table-wrap {
    padding: 16px 0 8px;
    overflow-x: auto;
}
.inv-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.inv-table th {
    padding: 4px 12px 12px; text-align: left;
    color: var(--cb-text-2); font-weight: 700;
    border-bottom: 1.5px solid var(--cb-border);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.inv-table td { padding: 12px; color: var(--cb-text-2); border-bottom: 1px solid var(--cb-border-2); }
.inv-table tbody tr:hover td { background: rgba(245, 158, 11, 0.03); }

/* Gateway items */
.gw-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    border: 1.5px solid var(--cb-border);
    border-radius: 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.65);
    transition: all 0.18s;
}
.gw-item:hover { border-color: rgba(245, 158, 11, 0.28); background: rgba(255, 255, 255, 0.88); }
.gw-item.selected {
    border-color: var(--amber);
    background: rgba(245, 158, 11, 0.05);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.10);
}

/* Ticket items */
.t-ticket {
    padding: 14px 16px;
    border: 1px solid var(--cb-border);
    border-radius: 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.65);
    transition: border-color 0.18s;
}
.t-ticket:hover { border-color: rgba(245, 158, 11, 0.22); }

/* ── Billing panel ── */
.bill-stat-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.bill-stat-card {
    flex: 1;
    min-width: 130px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.60);
    border-radius: 14px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 8px rgba(15,23,42,0.05);
    transition: border-color 0.2s;
}
.bill-stat-card:hover { border-color: rgba(245, 158, 11, 0.22); }
.bill-stat-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.bill-stat-label {
    font-size: 0.64rem; font-weight: 700;
    color: var(--cb-text-3);
    text-transform: uppercase; letter-spacing: 0.07em;
    margin-bottom: 2px;
}
.bill-stat-val {
    font-size: 1.05rem; font-weight: 800;
    color: var(--cb-text);
}
.bill-pay-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #1a0e00;
    border: none;
    border-radius: 999px;
    font-size: 0.72rem; font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(245,158,11,0.22);
    transition: transform 0.15s, box-shadow 0.15s;
}
.bill-pay-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(245,158,11,0.32); }
.bill-view-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.78);
    color: var(--cb-text-2);
    border: 1px solid var(--cb-border);
    border-radius: 999px;
    font-size: 0.72rem; font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.bill-view-btn:hover {
    border-color: rgba(245,158,11,0.30);
    background: rgba(245,158,11,0.06);
    transform: translateY(-1px);
}
.bill-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px;
    font-size: 0.67rem; font-weight: 700;
    border-radius: 999px;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.bill-badge-paid     { background: rgba(34,197,94,0.09);   color: #15803d; }
.bill-badge-unpaid   { background: rgba(245,158,11,0.10);  color: var(--amber-deep); }
.bill-badge-expired  { background: rgba(239,68,68,0.08);   color: #dc2626; }
.bill-badge-refunded { background: rgba(107,114,128,0.09); color: #6b7280; }
.bill-badge-canceled { background: rgba(239,68,68,0.08);   color: #dc2626; }
.bill-spinner {
    width: 28px; height: 28px;
    border: 2px solid rgba(245, 158, 11, 0.15);
    border-top-color: var(--amber);
    border-radius: 50%;
    animation: cl-spin 0.75s linear infinite;
    margin: 0 auto 12px;
}
.btn-spin { animation: cl-spin 0.75s linear infinite; }

/* ── Server info grid ── */
.server-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    padding: 22px;
}

/* ── Quick actions grid ── */
.qa-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 18px;
}

/* ── Usage tips grid ── */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 18px;
}

/* ── Payment modal overlay (no Tailwind required) ── */
.console-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.console-modal-overlay.active { display: flex; }

/* ── Responsive ── */
@media (max-width: 720px) {
    .c-sidebar {
        width: 100%;
        min-width: 0;
        height: auto;
        max-height: none;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid var(--cb-border);
        overflow: visible;
    }
    .c-sidebar-body {
        overflow-y: auto;
        max-height: 42vh;
        padding-bottom: 12px;
    }
    /* Hide account section from sidebar on mobile — shown in bottom nav instead */
    .c-sidebar-divider,
    .c-sidebar-body .c-sidebar-section:last-child {
        display: none;
    }
    #console-main-content { flex-direction: column; align-items: stretch; }
    .c-main {
        min-height: 0;
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 12px);
    }
    /* Mobile bottom navigation bar */
    .c-mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 50;
        background: rgba(255, 255, 255, 0.97);
        border-top: 1px solid var(--cb-border);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.07);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .c-mnav-btn {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 10px 4px;
        background: transparent;
        border: none;
        cursor: pointer;
        color: var(--cb-text-3);
        font-family: inherit;
        transition: color 0.15s, background 0.15s;
        min-width: 0;
    }
    .c-mnav-btn:hover,
    .c-mnav-btn.s-nav-active {
        color: var(--cb-text);
        background: rgba(245, 158, 11, 0.06);
    }
    .c-mnav-btn--logout {
        color: #f87171;
        border-left: 1px solid var(--cb-border-2);
        flex: 0 0 64px;
    }
    .c-mnav-btn--logout:hover {
        color: #ef4444;
        background: rgba(239, 68, 68, 0.07);
    }
    .c-mnav-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 10px;
        background: rgba(15, 23, 42, 0.04);
        border: 1px solid rgba(15, 23, 42, 0.07);
        flex-shrink: 0;
        transition: background 0.15s;
    }
    .c-mnav-btn.s-nav-active .c-mnav-icon {
        background: rgba(245, 158, 11, 0.12);
        border-color: rgba(245, 158, 11, 0.22);
    }
    .c-mnav-btn--logout .c-mnav-icon {
        background: rgba(239, 68, 68, 0.06);
        border-color: rgba(239, 68, 68, 0.14);
    }
    .c-mnav-label {
        font-size: 0.6rem;
        font-weight: 700;
        letter-spacing: 0.01em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        line-height: 1.2;
    }
    .spec-grid { grid-template-columns: 1fr 1fr; }
    .server-info-grid { grid-template-columns: 1fr; }
    .qa-grid { grid-template-columns: repeat(2, 1fr); }
    #ctb-user-email { display: none; }
    .bill-stat-card { min-width: 0; flex: 1 1 0; }
    .bill-stat-row { gap: 8px; flex-wrap: nowrap; }
    .bill-stat-val { font-size: 0.92rem; }
    .bill-stat-icon { width: 30px; height: 30px; flex-shrink: 0; }
}
@media (max-width: 480px) {
    .spec-grid { grid-template-columns: 1fr; }
    .tips-grid { grid-template-columns: 1fr; }
    .power-group { gap: 5px; }
    .pbtn { padding: 6px 10px; font-size: 0.72rem; }
    .bill-stat-card { padding: 10px 10px; gap: 8px; }
    .bill-stat-label { font-size: 0.58rem; }
    .bill-stat-val { font-size: 0.85rem; }
}

/* ── Billing mobile cards ── */
.bill-cards-mobile { display: none; padding: 12px 16px 16px; }
.bill-card {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.70);
    border: 1px solid var(--cb-border);
    border-radius: 13px;
    margin-bottom: 10px;
    transition: border-color 0.18s;
}
.bill-card:last-child { margin-bottom: 0; }
.bill-card:hover { border-color: rgba(245, 158, 11, 0.22); }
.bill-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.bill-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.bill-card-nr {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cb-text-3);
    white-space: nowrap;
}
.bill-card-date {
    font-size: 0.72rem;
    color: var(--cb-text-3);
    white-space: nowrap;
}
.bill-card-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--cb-text-2);
    line-height: 1.45;
    margin-bottom: 8px;
    word-break: break-word;
}
.bill-card-amount {
    font-size: 1.10rem;
    font-weight: 800;
    color: var(--cb-text);
    letter-spacing: -0.01em;
}

@media (max-width: 720px) {
    .bill-table-wrap { display: none !important; }
    .bill-cards-mobile { display: block; }
}

/* ── Tickets panel ── */
.tkt-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
    align-items: start;
}
.tkt-grid > .dash-card:last-child {
    min-width: 0;
}
@media (max-width: 720px) {
    .tkt-grid { grid-template-columns: 1fr; }
    #ticket-messages-container { max-height: 44vh !important; }
}

/* Ticket list item */
.tkt-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--cb-border-2);
    cursor: pointer;
    transition: background 0.12s;
}
.tkt-item:last-child { border-bottom: none; }
.tkt-item:hover { background: rgba(245, 158, 11, 0.04); }
.tkt-item.active {
    background: rgba(245, 158, 11, 0.07);
    border-left: 3px solid var(--amber);
    padding-left: 13px;
}

/* Ticket status badge */
.tkt-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 0.63rem;
    font-weight: 700;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--cb-text-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Ticket message bubbles */
#ticket-messages-container {
    overflow-x: hidden;
}
.tkt-msg-row {
    display: flex;
    gap: 8px;
    min-width: 0;
}
.tkt-msg-row.is-user {
    flex-direction: row-reverse;
}
.tkt-msg-col {
    max-width: 72%;
    min-width: 0;
}
.tkt-msg-meta {
    font-size: 0.70rem;
    color: var(--cb-text-3);
    margin-bottom: 4px;
    font-weight: 600;
}
.tkt-msg-meta.is-user {
    text-align: right;
}
.tkt-msg-bubble {
    padding: 10px 14px;
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--cb-text-2);
    overflow-wrap: anywhere;
    word-break: break-word;
}
.tkt-msg-bubble.is-admin {
    background: var(--cb-surface);
    border: 1px solid var(--cb-border);
    border-radius: 12px 12px 12px 4px;
}
.tkt-msg-bubble.is-user {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 12px 12px 4px 12px;
}
.tkt-msg-text {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ── Panel headers (billing / tickets / password / subscription) ── */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.panel-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--cb-text);
    margin: 0;
    letter-spacing: -0.01em;
}
.panel-subtitle {
    font-size: 0.75rem;
    color: var(--cb-text-3);
    margin-top: 3px;
}

/* ── Sidebar device section title row ── */
.sidebar-section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    margin-bottom: 8px;
}

/* ── Pending device activation banner ── */
#order-pending-banner {
    display: none;
    align-items: center;
    gap: 7px;
    margin-top: 9px;
    padding: 6px 12px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.20);
    border-radius: 999px;
    width: fit-content;
}

/* ── Section label rows (credentials / hardware) ── */
.section-label-row {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
}
.section-label-text {
    font-size: 0.70rem;
    font-weight: 700;
    color: var(--cb-text-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ── Spec section header (hardware spec title bar) ── */
.spec-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

/* ── Apple Silicon badge ── */
.apple-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(245, 158, 11, 0.07);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 8px;
}
.apple-badge-text {
    font-size: 0.67rem;
    font-weight: 700;
    color: var(--amber-light);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ── Terminal inner elements ── */
.terminal-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0 -16px;
}
.terminal-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* ── Refresh button (panel header) ── */
.refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--cb-border);
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--cb-text-2);
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
}
.refresh-btn:hover { border-color: rgba(245, 158, 11, 0.30); }

/* ── Ghost icon button (close / refresh in panels) ── */
.icon-btn-ghost {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--cb-text-3);
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.icon-btn-ghost:hover { color: var(--cb-text); }

/* ── Panel icon box (empty state / feature icons) ── */
.panel-icon-box {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.panel-icon-box--center { margin: 0 auto 16px; }
.panel-icon-box--sm {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    margin: 0 auto 12px;
}
.panel-icon-box--blue {
    background: rgba(147, 197, 253, 0.10);
    border-color: rgba(147, 197, 253, 0.20);
}
.panel-icon-box--green {
    background: rgba(74, 222, 128, 0.10);
    border-color: rgba(74, 222, 128, 0.20);
}
