:root {
    --bg-dark: #0a0f12;
    --panel-bg: rgba(22, 33, 40, 0.72);
    --panel-border: rgba(255, 255, 255, 0.1);
    --glass-accent: rgba(45, 212, 191, 0.1);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-dim: #64748b;
    
    --teal: #2dd4bf;
    --teal-glow: rgba(45, 212, 191, 0.4);
    --orange: #fb923c;
    --orange-glow: rgba(251, 146, 60, 0.3);
    --red: #f87171;
    --blue: #38bdf8;
    
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
    
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow: hidden; /* Prevent scrolling */
    height: 100vh;
    width: 100vw;
}

.glow-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vh;
    background: radial-gradient(circle at center, rgba(45, 212, 191, 0.15), transparent 70%);
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
}

.dashboard-container {
    display: grid;
    grid-template-columns: 260px 1fr 340px;
    height: 100vh;
    gap: 12px;
    padding: 12px;
}

.section-glass {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.section-glass-dark {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.brand-area .logo img {
    height: 24px;
    filter: brightness(0) invert(1);
}

.badge {
    font-size: 10px;
    font-weight: 800;
    background: var(--teal);
    color: var(--bg-dark);
    padding: 2px 6px;
    border-radius: 4px;
}

.nav-label {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 16px;
    font-weight: 700;
}

.nav-group {
    margin-bottom: 32px;
}

.mini-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.m-item span {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
}

.m-item strong {
    font-size: 18px;
    font-family: var(--font-mono);
}

.sim-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 12px 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-box:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: var(--teal);
}

.btn-box i {
    font-style: normal;
    font-weight: 800;
    font-size: 14px;
}

.btn-box span {
    font-size: 10px;
    font-weight: 600;
}

.pulse-kt:hover { border-color: #f76707; }
.pulse-lg:hover { border-color: #e6007e; }

.system-status {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--panel-border);
}

.status-item span {
    font-size: 12px;
    color: var(--text-secondary);
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 8px 0;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: var(--teal);
    box-shadow: 0 0 8px var(--teal-glow);
}

.back-link {
    margin-top: 16px;
    font-size: 12px;
    text-decoration: none;
    color: var(--text-dim);
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
}

.title-group h1 {
    font-size: 20px;
    font-weight: 800;
}

.title-group p {
    font-size: 12px;
    color: var(--text-secondary);
}

.live-signal {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(45, 212, 191, 0.1);
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--teal-glow);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--teal);
}

.pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

.live-signal span {
    font-size: 10px;
    font-weight: 800;
    color: var(--teal);
    letter-spacing: 0.05em;
}

.workspace-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 12px;
    min-height: 0; /* Important for flex child scroll */
}

.panel-head {
    padding:  16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--panel-border);
}

.panel-head h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
}

.panel-head .count {
    font-family: var(--font-mono);
    font-size: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

.scroll-area {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
}

.scroll-area::-webkit-scrollbar { width: 6px; }
.scroll-area::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }

/* Call Cards */
.call-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.call-card:hover {
    background: rgba(255, 255, 255, 0.06);
}

.call-card.active {
    border-color: var(--teal);
    background: var(--glass-accent);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.carrier-tag {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.carrier-tag.kt { background: #f767071a; color: #f76707; }
.carrier-tag.lguplus { background: #e6007e1a; color: #e6007e; }
.carrier-tag.skb { background: #ff00001a; color: #ff0000; }

.call-card .time {
    font-size: 11px;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.call-card .phone {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.call-card .meta {
    font-size: 12px;
    color: var(--text-secondary);
}

/* CRM Panel */
.crm-panel {
    display: flex;
    flex-direction: column;
}

.customer-info {
    padding: 32px;
    flex: 1;
    overflow-y: auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.avatar {
    width: 64px;
    height: 64px;
    background: var(--teal);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: var(--bg-dark);
}

.name-box h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.name-box p {
    font-family: var(--font-mono);
    color: var(--teal);
    font-size: 16px;
}

.status-pill {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 999px;
    text-transform: uppercase;
}

.status-pill.success { background: rgba(45, 212, 191, 0.1); color: var(--teal); border: 1px solid var(--teal-glow); }
.status-pill.warning { background: rgba(251, 146, 60, 0.1); color: var(--orange); border: 1px solid var(--orange-glow); }

.meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.meta-box label {
    display: block;
    font-size: 10px;
    color: var(--text-dim);
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}

.meta-box p {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
}

.meta-box.full { grid-column: span 2; }

.timeline-area label {
    display: block;
    font-size: 10px;
    color: var(--text-dim);
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: 0.05em;
}

.timeline {
    list-style: none;
    position: relative;
    padding-left: 16px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--panel-border);
}

.timeline li {
    position: relative;
    padding-bottom: 24px;
}

.t-dot {
    position: absolute;
    left: -16px;
    top: 6px;
    width: 9px;
    height: 9px;
    background: var(--teal);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--teal-glow);
}

.t-con {
    display: flex;
    flex-direction: column;
}

.t-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--teal);
    margin-bottom: 2px;
}

.t-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Ops Panel (Right) */
.ops-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ops-group {
    padding-bottom: 12px;
}

.ops-group .panel-head { border: 0; }

.carrier-list {
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.carrier-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
}

.carrier-item .c-name { font-weight: 800; font-size: 12px; }
.carrier-item .c-status { font-size: 10px; color: var(--text-dim); }

.carrier-item.ok .c-name { color: var(--teal); }
.carrier-item.pending .c-name { color: var(--orange); }

.scroll-area.mini {
    height: 140px;
}

.q-item {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.q-item p { font-size: 10px; color: var(--text-dim); }
.q-item strong { font-size: 11px; }

.q-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.q-item.done .q-badge { background: rgba(45, 212, 191, 0.1); color: var(--teal); }
.q-item.waiting .q-badge { background: rgba(251, 146, 60, 0.1); color: var(--orange); }

.delivery-stats {
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.d-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.d-item span { font-size: 11px; color: var(--text-dim); }
.d-item strong { font-size: 12px; font-weight: 700; }

.text-teal { color: var(--teal); }
.text-orange { color: var(--orange); }
.text-red { color: var(--red); }

.console-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.console-scroll {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: #4ade80;
    display: flex;
    flex-direction: column-reverse; /* New logs at top */
}

.console-scroll div {
    margin-bottom: 4px;
    word-break: break-all;
}

@media (max-width: 1200px) {
    .dashboard-container {
        grid-template-columns: 200px 1fr;
    }
    .ops-panel { display: none; }
}
