/* ==========================================================================
   360 TELECOM — Design tokens
   Direction: a night-network control room. Deep signal-navy canvas, a live
   radar/coverage-ping animation standing in for "the network is alive",
   cyan/blue signal light as the accent, amber for pending states (SIM-gold),
   emerald for money/success. Monospace for anything numeric (prices, phone
   numbers, order IDs) so the interface reads like real telecom tooling.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
    /* Color */
    --void: #070b14;
    --panel: #0c1322;
    --panel-2: #101a2e;
    --surface: #131f36;
    --surface-hover: #182746;
    --line: #223151;
    --line-soft: #182746;

    --signal-cyan: #22d3ee;
    --signal-blue: #3b82f6;
    --signal-blue-dim: #1d4ed8;
    --amber: #f5a524;
    --emerald: #2dd4a7;
    --red: #f8555f;

    --text-hi: #eef3fb;
    --text-mid: #a9b8d4;
    --text-low: #6c7ea3;

    /* Type */
    --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

    /* Radius / shadow */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 20px;
    --shadow-lift: 0 20px 50px -20px rgba(0,0,0,0.6);
    --glow-cyan: 0 0 0 1px rgba(34,211,238,0.25), 0 0 24px rgba(34,211,238,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; }

body {
    font-family: var(--font-body);
    background: var(--void);
    color: var(--text-hi);
    min-height: 100vh;
    position: relative;
}

/* ---------------------------------------------------------------------
   Live signal background — fixed canvas + a faint coverage dot-grid
   --------------------------------------------------------------------- */
#bgCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 60% at 85% -10%, rgba(34,211,238,0.10), transparent 60%),
        radial-gradient(ellipse 60% 50% at 0% 100%, rgba(59,130,246,0.08), transparent 60%),
        var(--void);
}
.dot-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(139,164,209,0.16) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, black 30%, transparent 85%);
    mask-image: radial-gradient(ellipse 90% 80% at 50% 20%, black 30%, transparent 85%);
}

.page-shell { position: relative; z-index: 1; }

a { color: inherit; }

::selection { background: rgba(34,211,238,0.25); }

/* ---------------------------------------------------------------------
   Top navigation
   --------------------------------------------------------------------- */
.navbar {
    background: rgba(7,11,20,0.72);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-soft);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}
.brand-identity { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-logo-emblem {
    width: 38px; height: 38px; border-radius: 50%;
    object-fit: cover; display: block;
    box-shadow: var(--glow-cyan);
}
.logo-text {
    font-family: var(--font-display);
    font-size: 1.28rem; font-weight: 700; letter-spacing: -0.02em;
    color: var(--text-hi); text-decoration: none;
}
.logo-text span { color: var(--signal-cyan); }
.nav-links { display: flex; gap: 14px; align-items: center; }

.btn { font-family: var(--font-body); font-weight: 600; border: none; border-radius: var(--r-sm);
    cursor: pointer; font-size: 0.88rem; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn:active { transform: translateY(1px); }

.btn-auth-state {
    background: linear-gradient(135deg, var(--signal-blue), var(--signal-blue-dim));
    color: white; padding: 9px 18px; text-decoration: none; display: inline-block;
    box-shadow: 0 8px 20px -8px rgba(59,130,246,0.6);
}
.btn-auth-state.logged-in {
    background: transparent; border: 1px solid var(--line); color: var(--text-mid); padding: 8px 16px;
}
.btn-auth-state.logged-in:hover { border-color: var(--signal-cyan); color: var(--text-hi); }

/* ---------------------------------------------------------------------
   Layout
   --------------------------------------------------------------------- */
.dashboard-container {
    max-width: 1240px; margin: 24px auto; padding: 0 20px;
    display: grid; grid-template-columns: 1fr; gap: 22px;
}
@media (min-width: 992px) { .dashboard-container { grid-template-columns: 300px 1fr; } }

/* Hero */
.hero-band {
    max-width: 1240px; margin: 28px auto 0; padding: 0 20px;
}
.hero-inner {
    border: 1px solid var(--line-soft); border-radius: var(--r-lg);
    background: linear-gradient(135deg, rgba(19,31,54,0.9), rgba(12,19,34,0.9));
    padding: 34px 30px; position: relative; overflow: hidden;
}
.hero-eyebrow {
    font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--signal-cyan); display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 0 rgba(45,212,167,0.6);
    animation: pulseDot 2s infinite; }
@keyframes pulseDot { 0% { box-shadow: 0 0 0 0 rgba(45,212,167,0.55);} 70% { box-shadow: 0 0 0 8px rgba(45,212,167,0); } 100% { box-shadow: 0 0 0 0 rgba(45,212,167,0); } }
.hero-title { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; letter-spacing: -0.02em; max-width: 620px; }
.hero-sub { color: var(--text-mid); margin-top: 10px; max-width: 520px; font-size: 0.95rem; line-height: 1.55; }

/* Sidebar */
.sidebar-card {
    background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-lg);
    padding: 22px; height: fit-content;
}
.balance-display h3 {
    margin: 0; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-low); font-weight: 700;
}
.balance-display .balance-amount {
    font-family: var(--font-mono); font-size: 2rem; font-weight: 600; color: var(--text-hi); margin: 8px 0 4px;
}
.balance-sub { font-size: 0.78rem; color: var(--text-low); margin-bottom: 16px; }

.btn-deposit-trigger {
    width: 100%; background: linear-gradient(135deg, var(--emerald), #189779);
    color: #04241c; border: none; padding: 12px; border-radius: var(--r-sm);
    font-weight: 700; font-size: 0.9rem; cursor: pointer; box-shadow: 0 10px 22px -10px rgba(45,212,167,0.55);
}

.menu-stack { display: flex; flex-direction: row; gap: 8px; margin-top: 22px; overflow-x: auto; padding-bottom: 4px; }
@media (min-width: 992px) { .menu-stack { flex-direction: column; overflow-x: visible; padding-bottom: 0; } }
.menu-link {
    display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: var(--panel-2);
    border-radius: var(--r-sm); border: 1px solid transparent; color: var(--text-mid); font-weight: 600;
    font-size: 0.87rem; text-align: left; cursor: pointer; white-space: nowrap;
    transition: all .15s ease;
}
.menu-link.active, .menu-link:hover { background: rgba(34,211,238,0.08); border-color: rgba(34,211,238,0.35); color: var(--text-hi); }
.menu-link:disabled { opacity: .4; cursor: not-allowed; }

.sidebar-support {
    margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft);
}
.sidebar-support a {
    display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text-low);
    font-size: 0.82rem; font-weight: 600;
}
.sidebar-support a:hover { color: var(--signal-cyan); }

/* Category tabs */
.category-tabs-wrapper { display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 8px; }
.tab-btn {
    background: var(--panel-2); color: var(--text-mid); border: 1px solid var(--line-soft);
    padding: 8px 16px; border-radius: 30px; font-size: 0.82rem; font-weight: 600; cursor: pointer;
    white-space: nowrap; transition: all .15s ease;
}
.tab-btn.selected, .tab-btn:hover { background: var(--signal-cyan); border-color: var(--signal-cyan); color: #04222a; }

.section-title { font-family: var(--font-display); font-size: 1.2rem; color: var(--text-hi); margin-bottom: 15px;
    padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); font-weight: 600; }

/* Service cards */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 15px; }
.telecom-card {
    background: var(--panel); border-radius: var(--r-md); border: 1px solid var(--line-soft);
    padding: 18px; display: flex; flex-direction: column; gap: 14px; position: relative;
    transition: border-color .15s ease, transform .15s ease;
}
.telecom-card:hover { border-color: rgba(34,211,238,0.4); transform: translateY(-2px); }
.card-icon-row { display: flex; justify-content: space-between; align-items: flex-start; }
.card-icon {
    width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    background: rgba(34,211,238,0.1); color: var(--signal-cyan);
}
.card-tag { font-size: 0.68rem; background: var(--panel-2); color: var(--text-low); padding: 4px 9px;
    border-radius: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; border: 1px solid var(--line-soft); }
.card-title { font-size: 1rem; font-weight: 700; color: var(--text-hi); line-height: 1.3; }
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.card-price { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 600; color: var(--emerald); }
.action-trigger-btn {
    background: var(--signal-blue); color: white; border: none; padding: 9px 16px; font-size: 0.83rem;
    font-weight: 700; border-radius: var(--r-sm); cursor: pointer;
}
.action-trigger-btn:hover { background: var(--signal-blue-dim); }

.empty-state {
    grid-column: 1/-1; background: var(--panel); border: 1px dashed var(--line);
    padding: 44px; border-radius: var(--r-lg); text-align: center; color: var(--text-low);
}

/* Tables */
.table-card { background: var(--panel); border-radius: var(--r-lg); border: 1px solid var(--line-soft); overflow-x: auto; padding: 4px; }
table { width: 100%; border-collapse: collapse; text-align: left; min-width: 560px; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line-soft); font-size: 0.86rem; }
th { color: var(--text-low); font-weight: 700; text-transform: uppercase; font-size: 0.68rem; letter-spacing: 0.06em; }
tr:last-child td { border-bottom: none; }
td.mono, .mono { font-family: var(--font-mono); }

.badge { padding: 4px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; display: inline-block; }
.badge.Pending { background: rgba(245,165,36,0.14); color: var(--amber); }
.badge.Completed { background: rgba(45,212,167,0.14); color: var(--emerald); }
.badge.Cancelled { background: rgba(248,85,95,0.14); color: var(--red); }
.badge.Accepted { background: rgba(45,212,167,0.14); color: var(--emerald); }
.badge.Declined { background: rgba(248,85,95,0.14); color: var(--red); }

.btn-invoice { background: var(--panel-2); color: var(--text-mid); border: 1px solid var(--line-soft); padding: 6px 12px;
    border-radius: var(--r-sm); font-size: 0.78rem; cursor: pointer; font-weight: 600; }
.btn-invoice:hover { color: var(--text-hi); border-color: var(--signal-cyan); }

/* Toasts */
.msg-toast { padding: 13px 16px; border-radius: var(--r-sm); font-weight: 500; font-size: 0.88rem;
    margin-bottom: 15px; display: none; border: 1px solid transparent; }
.msg-toast.success { background: rgba(45,212,167,0.1); color: var(--emerald); border-color: rgba(45,212,167,0.35); display: block; }
.msg-toast.error { background: rgba(248,85,95,0.1); color: var(--red); border-color: rgba(248,85,95,0.35); display: block; }

/* Modals */
.dialog-overlay { display: none; position: fixed; inset: 0; background: rgba(4,7,14,0.6); backdrop-filter: blur(6px);
    justify-content: center; align-items: center; padding: 15px; z-index: 1000; }
.dialog-pane { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-lg); width: 100%;
    max-width: 400px; padding: 24px; box-shadow: var(--shadow-lift); }
.dialog-pane h3 { font-family: var(--font-display); font-weight: 700; margin-bottom: 4px; }
.form-control-input {
    width: 100%; padding: 11px 12px; background: var(--panel-2); border: 1px solid var(--line-soft); color: var(--text-hi);
    border-radius: var(--r-sm); font-size: 0.92rem; outline: none; margin-top: 8px; margin-bottom: 16px; font-family: var(--font-mono);
}
.form-control-input:focus { border-color: var(--signal-cyan); box-shadow: var(--glow-cyan); }
label.field-label { font-size: 0.78rem; font-weight: 600; color: var(--text-low); }
.pane-actions { display: flex; justify-content: flex-end; gap: 10px; }
.btn-dismiss { background: var(--panel-2); color: var(--text-mid); border: 1px solid var(--line-soft); padding: 9px 16px;
    border-radius: var(--r-sm); font-weight: 600; cursor: pointer; }

/* WhatsApp floating button */
.floating-support-btn {
    position: fixed; bottom: 20px; right: 20px; background: #1fb855; color: white; text-decoration: none;
    padding: 13px 20px; border-radius: 50px; font-weight: 700; box-shadow: 0 10px 24px -8px rgba(31,184,85,0.6);
    font-size: 0.86rem; z-index: 999; display: flex; align-items: center; gap: 8px;
}

/* Focus visibility */
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--signal-cyan); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .pulse-dot { animation: none; }
}
