/* ─────────────────────────────────────────────────────────────────────
 * Spoofbase Call Center — Theme
 * Bright Orange + Nardo Light Grey on deep ink, Share Tech Mono.
 * Hacker / terminal aesthetic — scan lines, glow, mono font, glitch.
 * ───────────────────────────────────────────────────────────────────── */

:root {
    /* Primary accent — Bright Orange */
    --orange:           #ff7a00;
    --orange-light:     #ffa133;
    --orange-dark:      #b85400;
    --orange-glow:      rgba(255,122,0,0.10);
    --orange-glow-strong: rgba(255,122,0,0.25);

    /* Legacy --royale-* aliases mapped onto orange so existing rules pick up
       the new palette without per-rule edits. */
    --royale:           var(--orange);
    --royale-light:     var(--orange-light);
    --royale-dark:      var(--orange-dark);
    --royale-glow:      var(--orange-glow);
    --royale-glow-strong: var(--orange-glow-strong);

    /* Nardo Light Grey — secondary text + chrome */
    --nardo:            #c5cdd9;
    --nardo-light:      #e2e8f0;
    --nardo-dark:       #8b9199;

    /* Surfaces — keep deep ink for the hacker feel */
    --bg:               #0d1014;
    --bg-card:          #181c22;
    --bg-card-2:        #14171c;
    --bg-input:         #1a1e25;
    --border:           #2a2f38;
    --border-royale:    rgba(255,122,0,0.28);

    /* Text */
    --text:             #e2e8f0;
    --text-secondary:   #c5cdd9;
    --text-muted:       #7a818b;

    /* Status */
    --green:            #27ae60;
    --green-bright:     #2ecc71;
    --red:              #ff3b5c;

    /* Hot — for press-1 alerts; magenta-red so it cuts through the
       all-orange theme. */
    --hot:              #ff1f5c;
    --hot-bright:       #ff5078;
}

* { box-sizing: border-box; }

html, body { background: var(--bg); color: var(--text); }

.cc-body {
    min-height: 100vh;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
}

a { color: var(--royale-light); text-decoration: none; }
a:hover { color: var(--royale); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--royale-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--royale); }

/* ── Sidebar ── */
.cc-sidebar {
    width: 240px;
    min-height: 100vh;
    background: var(--bg-card-2);
    border-right: 1px solid var(--border-royale);
    flex-shrink: 0;
    position: relative;
}

.cc-brand-block {
    padding: 1.1rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border-royale);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.cc-brand {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--royale);
    text-shadow: 0 0 10px var(--royale), 0 0 20px rgba(37,71,232,0.35);
    text-transform: uppercase;
}

.cc-brand-sub {
    font-size: 0.55rem;
    letter-spacing: 3px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.cc-nav-label {
    font-size: 0.6rem;
    color: var(--royale-dark);
    text-transform: uppercase;
    letter-spacing: 3px;
    padding: 0.9rem 1.25rem 0.3rem;
    font-weight: 600;
}

.cc-sidebar .nav-link {
    color: var(--text-secondary);
    padding: 0.55rem 1.25rem;
    border-radius: 0;
    border-left: 2px solid transparent;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: background 0.15s, color 0.15s;
}
.cc-sidebar .nav-link i { width: 16px; flex-shrink: 0; }
.cc-sidebar .nav-link:hover {
    color: var(--royale-light);
    background: var(--royale-glow);
    border-left-color: var(--royale-dark);
}
.cc-sidebar .nav-link.active {
    color: var(--royale);
    background: var(--royale-glow-strong);
    border-left-color: var(--royale);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(37,71,232,0.5);
}

.cc-sidebar-footer {
    margin-top: auto;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border);
}
.cc-user-pill {
    padding: 0.6rem 1.25rem;
    color: var(--text-secondary);
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.78rem;
    border-bottom: 1px solid var(--border);
}
.cc-user-pill i { color: var(--royale); font-size: 1rem; }
.cc-role-tag {
    margin-left: auto;
    font-size: 0.6rem;
    padding: 1px 6px;
    border-radius: 2px;
    letter-spacing: 1px;
}
.cc-role-tag.admin {
    background: var(--royale);
    color: #fff;
}
.cc-role-tag.agent {
    background: var(--green);
    color: #fff;
}

.cc-sidebar-footer .cc-logout {
    color: #c0392b !important;
    letter-spacing: 2px;
}
.cc-sidebar-footer .cc-logout:hover {
    background: rgba(192,57,43,0.15) !important;
    border-left-color: #c0392b !important;
    color: #ff4444 !important;
}

/* ── Main ── */
.cc-main {
    flex: 1;
    background: var(--bg);
    min-height: 100vh;
    min-width: 0;
}

/* ── Mobile topbar ── */
.cc-mobile-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 50px;
    background: var(--bg-card-2);
    border-bottom: 1px solid var(--border-royale);
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    z-index: 1100;
}
.cc-sidebar-toggle {
    background: none;
    border: 1px solid var(--border-royale);
    color: var(--royale);
    font-size: 1.1rem;
    padding: 3px 9px;
    cursor: pointer;
}
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1040;
}
#sidebar-overlay.active { display: block; }

@media (max-width: 767.98px) {
    .cc-mobile-topbar { display: flex; }
    .cc-sidebar {
        position: fixed !important;
        left: -260px;
        top: 0;
        height: 100vh;
        z-index: 1050;
        transition: left 0.25s ease;
        width: 240px;
        overflow-y: auto;
    }
    .cc-sidebar.mobile-open { left: 0 !important; }
    .cc-main {
        padding-top: 4rem !important;
        margin-left: 0 !important;
    }
}

/* ── Page header ── */
.cc-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.cc-page-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #eee;
    display: flex; align-items: center; gap: 0.5rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}
.cc-page-header h4 i { color: var(--royale); }

/* ── Stat cards ── */
.cc-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-royale);
    border-radius: 4px;
    padding: 1rem 1.25rem;
    position: relative;
    overflow: hidden;
}
.cc-stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--royale), transparent);
    opacity: 0.6;
}
.cc-stat-label {
    color: var(--text-muted);
    font-size: 0.65rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.cc-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--royale);
    text-shadow: 0 0 12px rgba(37,71,232,0.4);
    line-height: 1.1;
}
.cc-stat-value.green { color: var(--green-bright); text-shadow: 0 0 12px rgba(46,204,113,0.4); }
.cc-stat-value.orange { color: var(--orange); text-shadow: 0 0 12px rgba(243,156,18,0.4); }
.cc-stat-value.hot { color: var(--hot-bright); text-shadow: 0 0 14px rgba(255,180,0,0.5); }

/* ── Tables ── */
.table {
    --bs-table-bg: var(--bg-card);
    --bs-table-striped-bg: #181f2a;
    --bs-table-hover-bg: rgba(37,71,232,0.06);
    --bs-table-border-color: var(--border);
    color: var(--text);
}
.table thead th {
    background: var(--bg-card-2);
    color: var(--royale);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-royale);
    padding: 0.7rem 0.75rem;
}
.table tbody td {
    border-color: var(--border);
    vertical-align: middle;
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border-color: var(--border-royale);
    border-radius: 4px;
}
.card-header {
    background: var(--bg-card-2);
    border-bottom: 1px solid var(--border-royale);
    color: var(--royale);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.78rem;
    font-weight: 700;
}

/* ── Forms ── */
.form-control, .form-select {
    background: var(--bg-input);
    border-color: var(--border);
    color: var(--text);
    border-radius: 3px;
}
.form-control:focus, .form-select:focus {
    background: var(--bg-input);
    border-color: var(--royale-dark);
    box-shadow: 0 0 0 3px var(--royale-glow);
    color: #fff;
}
.form-label {
    color: var(--text-secondary);
    font-size: 0.72rem;
    margin-bottom: 0.3rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}
textarea.form-control { font-family: 'Share Tech Mono', monospace; }

/* ── Buttons ── */
.btn-primary {
    background: var(--royale);
    border-color: var(--royale);
    color: #fff;
    font-weight: 700;
    letter-spacing: 1px;
}
.btn-primary:hover {
    background: var(--royale-light);
    border-color: var(--royale-light);
    color: #fff;
    box-shadow: 0 0 14px var(--royale-glow-strong);
}
.btn-outline-primary {
    border-color: var(--border-royale);
    color: var(--royale);
}
.btn-outline-primary:hover {
    background: var(--royale-glow);
    border-color: var(--royale);
    color: var(--royale-light);
}
.btn-outline-success { border-color: rgba(39,174,96,0.4); color: var(--green-bright); }
.btn-outline-success:hover { background: rgba(39,174,96,0.1); border-color: var(--green-bright); color: var(--green-bright); }
.btn-outline-danger  { border-color: rgba(255,84,112,0.4); color: var(--red); }
.btn-outline-danger:hover { background: rgba(255,84,112,0.08); border-color: var(--red); color: var(--red); }
.btn-outline-secondary { border-color: var(--border); color: var(--text-secondary); }
.btn-outline-secondary:hover { background: #232b38; border-color: var(--nardo); color: var(--text); }

.btn-success {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
    font-weight: 700;
}
.btn-success:hover {
    background: var(--green-bright);
    border-color: var(--green-bright);
    color: #fff;
    box-shadow: 0 0 14px rgba(39,174,96,0.4);
}

.btn-hot {
    background: var(--hot);
    border-color: var(--hot);
    color: #fff;
    font-weight: 700;
    letter-spacing: 1px;
    animation: pulseHot 1.6s infinite;
}
.btn-hot:hover {
    background: var(--hot-bright);
    border-color: var(--hot-bright);
    color: #1a1a1a;
}
@keyframes pulseHot {
    0%,100% { box-shadow: 0 0 0 0 rgba(255,138,0,0.7); }
    50%     { box-shadow: 0 0 0 8px rgba(255,138,0,0); }
}

.btn-sm { font-size: 0.75rem; padding: 0.3rem 0.7rem; letter-spacing: 0.5px; }

/* ── Badges ── */
.badge { font-weight: 600; letter-spacing: 1px; }
.badge.bg-success-soft { background: rgba(39,174,96,0.15); color: var(--green-bright); border: 1px solid rgba(39,174,96,0.3); }
.badge.bg-danger-soft  { background: rgba(255,84,112,0.15); color: var(--red); border: 1px solid rgba(255,84,112,0.3); }
.badge.bg-warning-soft { background: rgba(243,156,18,0.12); color: var(--orange); border: 1px solid rgba(243,156,18,0.3); }
.badge.bg-info-soft    { background: rgba(52,152,219,0.15); color: #3498db; border: 1px solid rgba(52,152,219,0.3); }
.badge.bg-royale-soft  { background: rgba(37,71,232,0.12); color: var(--royale); border: 1px solid var(--border-royale); }
.badge.bg-secondary-soft { background: #232b38; color: var(--nardo); border: 1px solid var(--border); }
.badge.bg-hot         { background: var(--hot); color: #1a1a1a; }

/* ── Wallboard live row ── */
.cc-live-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) 110px 110px 1fr 1fr 220px;
    gap: 0.75rem;
    align-items: center;
    padding: 0.7rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.cc-live-row.pressed {
    border-color: var(--hot);
    box-shadow: 0 0 0 1px rgba(255,138,0,0.4), 0 0 24px rgba(255,138,0,0.18);
    background: linear-gradient(90deg, rgba(255,138,0,0.08), var(--bg-card));
}
.cc-live-row.transferred {
    border-color: var(--green-bright);
    background: linear-gradient(90deg, rgba(46,204,113,0.06), var(--bg-card));
}
.cc-live-row.dialing { opacity: 0.6; }

@media (max-width: 991px) {
    .cc-live-row {
        grid-template-columns: 1fr 1fr;
    }
}

.cc-status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 0.4rem;
    background: var(--text-muted);
    vertical-align: middle;
}
.cc-status-dot.online  { background: var(--green-bright); box-shadow: 0 0 8px rgba(46,204,113,0.6); }
.cc-status-dot.busy    { background: var(--orange); box-shadow: 0 0 8px rgba(243,156,18,0.5); }
.cc-status-dot.offline { background: var(--text-muted); }
.cc-status-dot.hot     { background: var(--hot-bright); box-shadow: 0 0 10px rgba(255,180,0,0.6); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

/* ── Login ── */
.cc-login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: radial-gradient(ellipse at top, rgba(37,71,232,0.08), transparent 60%), var(--bg);
}
.cc-login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-royale);
    border-radius: 6px;
    padding: 2.5rem 2rem 2rem;
    box-shadow: 0 0 40px rgba(37,71,232,0.12);
}
.cc-login-card h1 {
    color: var(--royale);
    font-size: 1.4rem;
    letter-spacing: 4px;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(37,71,232,0.5);
    margin-bottom: 0.25rem;
}
.cc-login-card .sub {
    color: var(--text-muted);
    font-size: 0.65rem;
    letter-spacing: 3px;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

/* ── Flash ── */
.cc-flash-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    min-width: 300px;
    max-width: 420px;
}
.alert {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 4px;
    font-size: 0.85rem;
}
.alert-success { border-left: 3px solid var(--green); }
.alert-danger  { border-left: 3px solid var(--red); }
.alert-warning { border-left: 3px solid var(--orange); }
.alert-info    { border-left: 3px solid #3498db; }
.btn-close { filter: invert(0.7); }

/* ── Misc ── */
.cc-section { margin-bottom: 2rem; }
.cc-section h5 {
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--royale);
    border-bottom: 1px solid var(--border-royale);
    padding-bottom: 0.4rem;
    margin-bottom: 1rem;
}
.cc-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border: 1px dashed var(--border);
    border-radius: 4px;
}
hr { border-color: var(--border-royale); opacity: 0.3; }
code {
    background: #0d141d;
    color: var(--royale-light);
    padding: 0.1em 0.4em;
    border-radius: 3px;
    font-size: 0.82em;
    border: 1px solid var(--border);
}

.cc-pulse {
    display: inline-block;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--green-bright);
    animation: pulseLive 1.4s infinite;
    margin-right: 0.4rem;
}
@keyframes pulseLive {
    0%,100% { box-shadow: 0 0 0 0 rgba(46,204,113,0.6); }
    50%     { box-shadow: 0 0 0 6px rgba(46,204,113,0); }
}

.text-muted { color: var(--text-muted) !important; }
.text-royale { color: var(--royale) !important; }
.text-hot { color: var(--hot-bright) !important; }
