/* ==========================================================================
   💎 ORG PBX & TELECOM CLOUD - MASTER DUAL-THEME ENTERPRISE DESIGN SYSTEM (V3.5)
   Pixel-Perfect Light Mode + Dark Mode Support Across All Pages, Sidebars & Forms
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens (CSS Custom Properties)
   -------------------------------------------------------------------------- */

/* Default Light Mode Theme Tokens */
:root {
    --cp-bg: #f8fafc;
    --cp-canvas: #f8fafc;
    --cp-surface: #ffffff;
    --cp-surface-card: #ffffff;
    --cp-surface-elevated: #f1f5f9;
    --cp-surface-hover: #f8fafc;
    
    --cp-border: #e2e8f0;
    --cp-border-light: #f1f5f9;
    --cp-border-hover: #cbd5e1;
    --cp-border-active: rgba(16, 185, 129, 0.5);
    
    --cp-text-primary: #0f172a;
    --cp-text-secondary: #334155;
    --cp-text-muted: #64748b;
    
    --cp-sidebar-bg: #ffffff;
    --cp-sidebar-border: #e2e8f0;
    --cp-sidebar-label: #64748b;
    --cp-sidebar-item: #334155;
    --cp-sidebar-item-hover: #f1f5f9;
    --cp-sidebar-item-active-bg: rgba(16, 185, 129, 0.12);
    --cp-sidebar-item-active-text: #065f46;
    --cp-sidebar-icon: #64748b;
    --cp-sidebar-icon-active: #059669;
    
    --cp-topbar-bg: rgba(255, 255, 255, 0.95);
    --cp-topbar-border: #e2e8f0;
    
    --cp-card-bg: #ffffff;
    --cp-card-border: #e2e8f0;
    --cp-card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
    
    --cp-table-bg: #ffffff;
    --cp-table-th-bg: #f8fafc;
    --cp-table-th-text: #475569;
    --cp-table-td-text: #0f172a;
    --cp-table-border: #f1f5f9;
    --cp-table-hover: #f8fafc;
    --cp-table-code-bg: #e0f2fe;
    --cp-table-code-text: #0369a1;
    --cp-table-code-border: #bae6fd;
    
    --cp-input-bg: #ffffff;
    --cp-input-border: #cbd5e1;
    --cp-input-text: #0f172a;
    --cp-input-placeholder: #94a3b8;
    
    --cp-emerald: #10b981;
    --cp-emerald-bright: #059669;
    --cp-cyan: #0284c7;
    --cp-indigo: #4f46e5;
    --cp-indigo-bright: #4338ca;
    --cp-rose: #e11d48;
    --cp-amber: #d97706;
    --cp-purple: #7e22ce;

    --phone-bezel-bg: #ffffff;
    --phone-bezel-border: #cbd5e1;
    --phone-bezel-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.12);
    --phone-screen-bg: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    --phone-key-bg: #ffffff;
    --phone-key-border: #e2e8f0;
    --phone-key-color: #0f172a;
    --phone-key-letters: #64748b;
    --phone-key-hover: #f1f5f9;
}

/* Dark Mode Theme Tokens (Activated via .dark on <html>) */
html.dark,
.dark {
    --cp-bg: #070a12;
    --cp-canvas: #070a12;
    --cp-surface: #0e1424;
    --cp-surface-card: rgba(14, 20, 36, 0.85);
    --cp-surface-elevated: #162035;
    --cp-surface-hover: rgba(255, 255, 255, 0.04);
    
    --cp-border: rgba(255, 255, 255, 0.08);
    --cp-border-light: rgba(255, 255, 255, 0.05);
    --cp-border-hover: rgba(255, 255, 255, 0.18);
    --cp-border-active: rgba(16, 185, 129, 0.4);
    
    --cp-text-primary: #f8fafc;
    --cp-text-secondary: #94a3b8;
    --cp-text-muted: #64748b;
    
    --cp-sidebar-bg: #060911;
    --cp-sidebar-border: rgba(255, 255, 255, 0.08);
    --cp-sidebar-label: #64748b;
    --cp-sidebar-item: #94a3b8;
    --cp-sidebar-item-hover: rgba(255, 255, 255, 0.06);
    --cp-sidebar-item-active-bg: linear-gradient(90deg, rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0.02) 100%);
    --cp-sidebar-item-active-text: #ffffff;
    --cp-sidebar-icon: #64748b;
    --cp-sidebar-icon-active: #34d399;
    
    --cp-topbar-bg: rgba(6, 9, 17, 0.94);
    --cp-topbar-border: rgba(255, 255, 255, 0.08);
    
    --cp-card-bg: linear-gradient(145deg, rgba(17, 24, 39, 0.85) 0%, rgba(13, 19, 33, 0.95) 100%);
    --cp-card-border: rgba(255, 255, 255, 0.08);
    --cp-card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.45), inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
    
    --cp-table-bg: rgba(13, 19, 33, 0.9);
    --cp-table-th-bg: #090e1c;
    --cp-table-th-text: #94a3b8;
    --cp-table-td-text: #f8fafc;
    --cp-table-border: rgba(255, 255, 255, 0.05);
    --cp-table-hover: rgba(255, 255, 255, 0.04);
    --cp-table-code-bg: rgba(56, 189, 248, 0.1);
    --cp-table-code-text: #38bdf8;
    --cp-table-code-border: rgba(56, 189, 248, 0.2);
    
    --cp-input-bg: rgba(15, 23, 42, 0.8);
    --cp-input-border: rgba(255, 255, 255, 0.12);
    --cp-input-text: #ffffff;
    --cp-input-placeholder: #64748b;
    
    --cp-emerald: #10b981;
    --cp-emerald-bright: #34d399;
    --cp-cyan: #38bdf8;
    --cp-indigo: #6366f1;
    --cp-indigo-bright: #818cf8;
    --cp-rose: #f43f5e;
    --cp-amber: #f59e0b;
    --cp-purple: #a855f7;

    --phone-bezel-bg: #0b0f19;
    --phone-bezel-border: rgba(255, 255, 255, 0.08);
    --phone-bezel-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 28px 60px -18px rgba(0, 0, 0, 0.8);
    --phone-screen-bg: linear-gradient(180deg, #0e1424 0%, #070a12 100%);
    --phone-key-bg: rgba(255, 255, 255, 0.06);
    --phone-key-border: rgba(255, 255, 255, 0.08);
    --phone-key-color: #ffffff;
    --phone-key-letters: #94a3b8;
    --phone-key-hover: rgba(255, 255, 255, 0.12);
}

/* --------------------------------------------------------------------------
   2. Global Viewport & Ambient Canvas
   -------------------------------------------------------------------------- */
html,
body,
.fi-html,
.fi-body,
.fi-layout {
    background-color: var(--cp-bg) !important;
    color: var(--cp-text-primary);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

/* Ambient Canvas Gradients */
.fi-layout {
    background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(16, 185, 129, 0.04), transparent 70%),
                var(--cp-bg) !important;
    min-height: 100vh !important;
}

html.dark .fi-layout {
    background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(16, 185, 129, 0.08), transparent 70%),
                radial-gradient(ellipse 60% 40% at 90% 90%, rgba(99, 102, 241, 0.05), transparent 70%),
                var(--cp-bg) !important;
}

.fi-main-ctn {
    background: transparent !important;
    max-width: 100% !important;
    padding: 1rem 1.35rem !important;
}

.fi-main {
    background: transparent !important;
    max-width: 100% !important;
}

.fi-page-header,
.fi-header {
    margin-bottom: 0.85rem !important;
    border-bottom: 1px solid var(--cp-border) !important;
    padding-bottom: 0.65rem !important;
}

.fi-header-heading {
    color: var(--cp-text-primary) !important;
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
}

.fi-header-subheading {
    color: var(--cp-text-muted) !important;
    font-size: 0.78rem !important;
}

.fi-breadcrumbs {
    margin-bottom: 0.45rem !important;
}

.fi-breadcrumbs-item-label {
    color: var(--cp-text-muted) !important;
    font-size: 0.74rem !important;
}

.fi-breadcrumbs-item-label:hover {
    color: var(--cp-text-primary) !important;
}

/* --------------------------------------------------------------------------
   3. Sidebar Navigation (Complete Dual-Theme Engine)
   -------------------------------------------------------------------------- */
aside.fi-sidebar,
.fi-sidebar {
    background: var(--cp-sidebar-bg) !important;
    border-right: 1px solid var(--cp-sidebar-border) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.03) !important;
    transition: background-color 200ms ease, border-color 200ms ease, width 200ms ease !important;
}

html.dark aside.fi-sidebar,
html.dark .fi-sidebar {
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45) !important;
}

.fi-sidebar-header {
    background: var(--cp-sidebar-bg) !important;
    border-bottom: 1px solid var(--cp-sidebar-border) !important;
    padding: 0.85rem 1.25rem !important;
}

.fi-sidebar-nav {
    background: transparent !important;
    padding: 0.65rem 0.65rem !important;
}

.fi-sidebar-footer {
    background: var(--cp-sidebar-bg) !important;
    border-top: 1px solid var(--cp-sidebar-border) !important;
    padding: 0.65rem 1rem !important;
}

/* Sidebar Navigation Groups */
.fi-sidebar-group {
    margin-bottom: 0.65rem !important;
}

.fi-sidebar-group-btn,
.fi-sidebar-group-button {
    padding: 0.35rem 0.5rem !important;
}

.fi-sidebar-group-label {
    color: var(--cp-sidebar-label) !important;
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    padding: 0.25rem 0.5rem !important;
}

/* Sidebar Navigation Items */
.fi-sidebar-item {
    margin-bottom: 2px !important;
}

.fi-sidebar-item-btn,
.fi-sidebar-item-button,
a.fi-sidebar-item-btn,
a.fi-sidebar-item-button {
    border-radius: 8px !important;
    padding: 0.45rem 0.75rem !important;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.65rem !important;
    text-decoration: none !important;
}

.fi-sidebar-item-btn:hover,
.fi-sidebar-item-button:hover,
a.fi-sidebar-item-btn:hover,
a.fi-sidebar-item-button:hover {
    background: var(--cp-sidebar-item-hover) !important;
}

.fi-sidebar-item-label {
    color: var(--cp-sidebar-item) !important;
    transition: color 150ms ease !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
}

.fi-sidebar-item-icon,
.fi-sidebar .fi-icon,
.fi-sidebar svg {
    color: var(--cp-sidebar-icon) !important;
    transition: all 150ms ease !important;
    width: 17px !important;
    height: 17px !important;
    flex-shrink: 0 !important;
}

.fi-sidebar-item-btn:hover .fi-sidebar-item-label,
.fi-sidebar-item-button:hover .fi-sidebar-item-label {
    color: var(--cp-text-primary) !important;
}

.fi-sidebar-item-btn:hover .fi-sidebar-item-icon,
.fi-sidebar-item-btn:hover svg,
.fi-sidebar-item-button:hover svg {
    color: var(--cp-emerald) !important;
    transform: scale(1.06);
}

/* Active Navigation Item High-Contrast Indicator */
.fi-sidebar-item-active,
.fi-sidebar-item.fi-active,
.fi-sidebar-item.fi-active .fi-sidebar-item-btn,
.fi-sidebar-item.fi-active .fi-sidebar-item-button,
a.fi-sidebar-item-active,
a.fi-sidebar-item-btn[aria-current='page'],
a.fi-sidebar-item-button[aria-current='page'],
li.fi-sidebar-item-active > a {
    background: var(--cp-sidebar-item-active-bg) !important;
    border-left: 3px solid var(--cp-emerald) !important;
    border-radius: 0 8px 8px 0 !important;
}

.fi-sidebar-item-active .fi-sidebar-item-label,
.fi-sidebar-item.fi-active .fi-sidebar-item-label,
a.fi-sidebar-item-btn[aria-current='page'] .fi-sidebar-item-label,
a.fi-sidebar-item-button[aria-current='page'] .fi-sidebar-item-label,
li.fi-sidebar-item-active .fi-sidebar-item-label {
    color: var(--cp-sidebar-item-active-text) !important;
    font-weight: 800 !important;
}

.fi-sidebar-item-active .fi-sidebar-item-icon,
.fi-sidebar-item-active svg,
.fi-sidebar-item.fi-active svg,
a.fi-sidebar-item-btn[aria-current='page'] svg,
a.fi-sidebar-item-button[aria-current='page'] svg {
    color: var(--cp-sidebar-icon-active) !important;
}

/* Sidebar Item Badges */
.fi-sidebar-item-badge {
    border-radius: 6px !important;
    font-size: 0.68rem !important;
    font-weight: 750 !important;
    padding: 0.1rem 0.45rem !important;
    background: rgba(16, 185, 129, 0.15) !important;
    color: var(--cp-emerald-bright) !important;
}

/* --------------------------------------------------------------------------
   4. Topbar & Telemetry
   -------------------------------------------------------------------------- */
.fi-topbar {
    background: var(--cp-topbar-bg) !important;
    backdrop-filter: blur(16px) !important;
    border-bottom: 1px solid var(--cp-topbar-border) !important;
}

.pbx-topbar-telemetry {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.pbx-topbar-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    background: var(--cp-surface-elevated);
    border: 1px solid var(--cp-border);
    font-size: 0.76rem;
    color: var(--cp-text-primary);
    text-decoration: none;
    transition: all 150ms ease;
}

.pbx-topbar-pill:hover {
    border-color: var(--cp-border-hover);
}

.pbx-pulse-dot {
    position: relative;
    display: inline-flex;
    height: 8px;
    width: 8px;
}

.pbx-pulse-dot span {
    position: absolute;
    display: inline-flex;
    height: 100%;
    width: 100%;
    border-radius: 9999px;
    background-color: var(--cp-emerald);
    opacity: 0.8;
    animation: pbxPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.pbx-pulse-dot .dot-core {
    position: relative;
    display: inline-flex;
    border-radius: 9999px;
    height: 8px;
    width: 8px;
    background-color: var(--cp-emerald);
    box-shadow: 0 0 8px var(--cp-emerald);
}

@keyframes pbxPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(2.3); opacity: 0; }
}

/* Theme Toggle Button */
.pbx-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--cp-surface-elevated);
    border: 1px solid var(--cp-border);
    color: var(--cp-text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 150ms ease;
}

.pbx-theme-toggle:hover {
    color: var(--cp-text-primary);
    border-color: var(--cp-border-hover);
    transform: scale(1.05);
}

/* User Account Dropdown */
.pbx-account {
    position: relative;
    z-index: 70;
}

.pbx-account-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    list-style: none;
}

.pbx-account-btn::-webkit-details-marker {
    display: none;
}

.pbx-account-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    z-index: 100;
    animation: pbxFadeIn 150ms ease-out;
}

html.dark .pbx-account-panel {
    background: #0e1424;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.pbx-account-panel a,
.pbx-account-panel button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 0.65rem;
    border-radius: 0.45rem;
    font-size: 0.76rem;
    color: var(--cp-text-primary);
    text-decoration: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: background 120ms ease;
    text-align: left;
}

.pbx-account-panel a:hover,
.pbx-account-panel button:hover {
    background: var(--cp-surface-elevated);
}

@keyframes pbxFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   5. Master Cards & Containers (Dual Theme)
   -------------------------------------------------------------------------- */
.ops-home {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

/* Master Glass Card */
.pbx-card {
    border-radius: 0.85rem;
    border: 1px solid var(--cp-card-border);
    background: var(--cp-card-bg);
    backdrop-filter: blur(16px);
    padding: 1.1rem 1.35rem;
    box-shadow: var(--cp-card-shadow);
    position: relative;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.pbx-card:hover {
    border-color: var(--cp-border-hover);
}

.pbx-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--cp-border);
    padding-bottom: 0.65rem;
    margin-bottom: 0.85rem;
}

.pbx-card-title {
    font-size: 0.88rem;
    font-weight: 750;
    color: var(--cp-text-primary);
    letter-spacing: -0.01em;
}

.pbx-card-desc {
    font-size: 0.72rem;
    color: var(--cp-text-muted);
    margin-top: 0.1rem;
}

/* Executive Hero Header Banner */
.pbx-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    border-radius: 0.85rem;
    border: 1px solid var(--cp-card-border);
    background: var(--cp-card-bg);
    backdrop-filter: blur(20px);
    padding: 0.85rem 1.35rem;
    box-shadow: var(--cp-card-shadow);
}

html:not(.dark) .pbx-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
}

html.dark .pbx-hero {
    background: linear-gradient(135deg, rgba(16, 24, 39, 0.95) 0%, rgba(10, 16, 28, 0.98) 100%);
}

.pbx-hero-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--cp-text-primary);
    letter-spacing: -0.02em;
}

.pbx-hero-sub {
    font-size: 0.74rem;
    color: var(--cp-text-muted);
    font-family: 'JetBrains Mono', monospace;
    margin-top: 0.15rem;
}

.pbx-hero-sub strong {
    color: var(--cp-text-primary);
}

/* KPI Tiles Grid */
.pbx-kpi-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 0.85rem;
}
@media (min-width: 640px) {
    .pbx-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (min-width: 1024px) {
    .pbx-kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.pbx-kpi-tile {
    border-radius: 0.85rem;
    border: 1px solid var(--cp-card-border);
    background: var(--cp-card-bg);
    backdrop-filter: blur(16px);
    padding: 0.95rem 1.15rem;
    box-shadow: var(--cp-card-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.pbx-kpi-tile:hover {
    transform: translateY(-2px);
    border-color: var(--cp-emerald);
}

.pbx-kpi-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}
.pbx-kpi-tile.accent-emerald::before { background: linear-gradient(90deg, #10b981, #34d399); }
.pbx-kpi-tile.accent-sky::before { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.pbx-kpi-tile.accent-indigo::before { background: linear-gradient(90deg, #4f46e5, #818cf8); }
.pbx-kpi-tile.accent-amber::before { background: linear-gradient(90deg, #d97706, #fbbf24); }
.pbx-kpi-tile.accent-rose::before { background: linear-gradient(90deg, #e11d48, #fb7185); }
.pbx-kpi-tile.accent-purple::before { background: linear-gradient(90deg, #9333ea, #c084fc); }

.pbx-kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pbx-kpi-label {
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cp-text-muted);
}

.pbx-kpi-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
}

.pbx-kpi-val {
    margin-top: 0.35rem;
    font-size: 1.95rem;
    font-weight: 800;
    color: var(--cp-text-primary);
    letter-spacing: -0.03em;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

.pbx-kpi-foot {
    margin-top: 0.45rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--cp-text-secondary);
}

/* Bento Containers */
.pbx-bento {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}
@media (min-width: 1024px) {
    .pbx-bento.split-60-40 {
        grid-template-columns: 1.4fr 1fr;
    }
    .pbx-bento.split-40-60 {
        grid-template-columns: 1fr 1.4fr;
    }
    .pbx-bento.split-50-50 {
        grid-template-columns: 1fr 1fr;
    }
}

/* --------------------------------------------------------------------------
   6. Data Tables (Custom + Filament Native Overrides)
   -------------------------------------------------------------------------- */
.pbx-table-wrap {
    background: var(--cp-table-bg);
    border: 1px solid var(--cp-border);
    border-radius: 0.65rem;
    overflow-x: auto;
    box-shadow: var(--cp-card-shadow);
}

.pbx-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.8rem;
}

.pbx-table th {
    background: var(--cp-table-th-bg);
    color: var(--cp-table-th-text);
    font-size: 0.67rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--cp-border);
}

.pbx-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--cp-table-border);
    color: var(--cp-table-td-text);
    vertical-align: middle;
}

.pbx-table tbody tr {
    transition: background 120ms ease;
}

.pbx-table tbody tr:hover {
    background: var(--cp-table-hover);
}

.pbx-table code {
    background: var(--cp-table-code-bg);
    color: var(--cp-table-code-text);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.76rem;
    font-weight: 700;
    border: 1px solid var(--cp-table-code-border);
}

/* Filament Native Resource Tables */
.fi-ta-ctn {
    background: var(--cp-surface-card) !important;
    border: 1px solid var(--cp-border) !important;
    border-radius: 0.85rem !important;
    box-shadow: var(--cp-card-shadow) !important;
    overflow: hidden !important;
}

.fi-ta-header-ctn {
    background: var(--cp-surface) !important;
    border-bottom: 1px solid var(--cp-border) !important;
    padding: 0.75rem 1rem !important;
}

.fi-ta-header-toolbar {
    background: transparent !important;
}

.fi-ta-header-cell {
    background: var(--cp-table-th-bg) !important;
    color: var(--cp-table-th-text) !important;
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    border-bottom: 1px solid var(--cp-border) !important;
    padding: 0.65rem 0.85rem !important;
}

.fi-ta-row {
    background: var(--cp-surface) !important;
    border-bottom: 1px solid var(--cp-table-border) !important;
    transition: background-color 120ms ease !important;
}

.fi-ta-row:hover {
    background: var(--cp-table-hover) !important;
}

.fi-ta-cell {
    color: var(--cp-table-td-text) !important;
    font-size: 0.8rem !important;
    padding: 0.65rem 0.85rem !important;
}

.fi-ta-text-item-label {
    color: var(--cp-table-td-text) !important;
}

.fi-ta-pagination {
    background: var(--cp-surface) !important;
    border-top: 1px solid var(--cp-border) !important;
    padding: 0.65rem 1rem !important;
}

.fi-ta-empty-state {
    background: var(--cp-surface) !important;
    padding: 2.5rem 1rem !important;
}

.fi-ta-empty-state-heading {
    color: var(--cp-text-primary) !important;
    font-weight: 750 !important;
}

.fi-ta-empty-state-description {
    color: var(--cp-text-muted) !important;
}

/* --------------------------------------------------------------------------
   7. Buttons (Dual Theme)
   -------------------------------------------------------------------------- */
.pbx-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 0.55rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    padding: 0.42rem 0.9rem;
    font-size: 0.76rem;
    font-weight: 750;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    transition: all 160ms cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: 0;
    cursor: pointer;
}
.pbx-btn-primary:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
    color: #ffffff !important;
}

.pbx-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 0.55rem;
    border: 1px solid var(--cp-border);
    background: var(--cp-surface);
    backdrop-filter: blur(10px);
    padding: 0.42rem 0.8rem;
    font-size: 0.76rem;
    font-weight: 650;
    color: var(--cp-text-primary) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: all 160ms ease;
    text-decoration: none;
    cursor: pointer;
}
.pbx-btn-secondary:hover {
    background: var(--cp-surface-elevated);
    border-color: var(--cp-border-hover);
    transform: translateY(-1px);
    color: var(--cp-text-primary) !important;
}

.pbx-btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(244, 63, 94, 0.3);
    background: rgba(244, 63, 94, 0.12);
    padding: 0.42rem 0.8rem;
    font-size: 0.76rem;
    font-weight: 650;
    color: #e11d48 !important;
    transition: all 160ms ease;
    cursor: pointer;
    text-decoration: none;
}
html.dark .pbx-btn-danger {
    color: #fb7185 !important;
}
.pbx-btn-danger:hover {
    background: #e11d48;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.4);
}

/* Filament Native Action Buttons */
.fi-btn-color-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    border-radius: 0.55rem !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.fi-btn-color-gray {
    background: var(--cp-surface) !important;
    border: 1px solid var(--cp-border) !important;
    color: var(--cp-text-primary) !important;
    border-radius: 0.55rem !important;
}

/* --------------------------------------------------------------------------
   8. Status Pills & Badges (Dual Theme)
   -------------------------------------------------------------------------- */
.pbx-pill-emerald {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 9999px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.15rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 750;
    color: #059669;
}
html.dark .pbx-pill-emerald {
    color: #34d399;
}

.pbx-pill-amber {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 9999px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 0.15rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 750;
    color: #d97706;
}
html.dark .pbx-pill-amber {
    color: #fbbf24;
}

.pbx-pill-rose {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 9999px;
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.3);
    padding: 0.15rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 750;
    color: #e11d48;
}
html.dark .pbx-pill-rose {
    color: #fb7185;
}

.pbx-pill-indigo {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 9999px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 0.15rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 750;
    color: #4f46e5;
}
html.dark .pbx-pill-indigo {
    color: #a5b4fc;
}

.pbx-pill-sky {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 9999px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 0.15rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 750;
    color: #0284c7;
}
html.dark .pbx-pill-sky {
    color: #38bdf8;
}

.pbx-pill-slate {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 9999px;
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 0.15rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 650;
    color: var(--cp-text-secondary);
}

/* --------------------------------------------------------------------------
   9. Forms & Inputs (Custom + Filament Native Overrides)
   -------------------------------------------------------------------------- */
.pbx-settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 900px;
}

.pbx-form-group {
    border-radius: 0.85rem;
    border: 1px solid var(--cp-card-border);
    background: var(--cp-card-bg);
    backdrop-filter: blur(16px);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--cp-card-shadow);
}

.pbx-form-group legend {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--cp-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 0.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pbx-input-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}

.pbx-input-field label {
    font-size: 0.75rem;
    font-weight: 650;
    color: var(--cp-text-secondary);
}

.pbx-input-field input,
.pbx-input-field select,
.pbx-input-field textarea {
    background: var(--cp-input-bg);
    border: 1px solid var(--cp-input-border);
    border-radius: 0.55rem;
    padding: 0.55rem 0.85rem;
    color: var(--cp-input-text);
    font-size: 0.82rem;
    outline: none;
    transition: all 150ms ease;
}

.pbx-input-field input:focus,
.pbx-input-field select:focus,
.pbx-input-field textarea:focus {
    border-color: var(--cp-emerald);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.pbx-input-field small {
    font-size: 0.7rem;
    color: var(--cp-text-muted);
    margin-top: 0.15rem;
}

/* Filament Native Form Sections */
.fi-section,
.fi-card {
    background: var(--cp-surface-card) !important;
    border: 1px solid var(--cp-border) !important;
    border-radius: 0.85rem !important;
    box-shadow: var(--cp-card-shadow) !important;
}

.fi-section-header-heading {
    color: var(--cp-text-primary) !important;
    font-weight: 800 !important;
}

.fi-section-header-description {
    color: var(--cp-text-muted) !important;
}

.fi-fo-field-wrp-label {
    color: var(--cp-text-secondary) !important;
    font-weight: 650 !important;
    font-size: 0.78rem !important;
}

.fi-fo-field-wrp-helper-text,
.fi-fo-field-wrp-hint {
    color: var(--cp-text-muted) !important;
    font-size: 0.72rem !important;
}

/* Filament Native Inputs & Selects */
.fi-input-wrp {
    background-color: var(--cp-input-bg) !important;
    border: 1px solid var(--cp-input-border) !important;
    border-radius: 0.55rem !important;
    box-shadow: none !important;
}

.fi-input-wrp:focus-within {
    border-color: var(--cp-emerald) !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25) !important;
}

.fi-input,
.fi-select-input,
.fi-fo-text-input input,
.fi-fo-textarea textarea {
    background-color: transparent !important;
    color: var(--cp-input-text) !important;
    font-size: 0.82rem !important;
}

/* Tabs */
.fi-tabs {
    border-bottom: 1px solid var(--cp-border) !important;
}

.fi-tabs-item {
    color: var(--cp-text-muted) !important;
    font-weight: 650 !important;
    font-size: 0.8rem !important;
}

.fi-tabs-item-active {
    color: var(--cp-emerald) !important;
    border-bottom: 2px solid var(--cp-emerald) !important;
}

/* --------------------------------------------------------------------------
   10. Modals & Dialogs (Dual Theme)
   -------------------------------------------------------------------------- */
.fi-modal-window {
    background-color: var(--cp-surface) !important;
    border: 1px solid var(--cp-border) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    border-radius: 1rem !important;
}

html.dark .fi-modal-window {
    background-color: #0e1424 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7) !important;
}

.fi-modal-header {
    border-bottom: 1px solid var(--cp-border) !important;
    padding: 1rem 1.35rem !important;
}

.fi-modal-heading {
    color: var(--cp-text-primary) !important;
    font-weight: 800 !important;
}

.fi-modal-description {
    color: var(--cp-text-muted) !important;
}

.fi-modal-content {
    padding: 1.25rem 1.35rem !important;
}

.fi-modal-footer {
    border-top: 1px solid var(--cp-border) !important;
    background-color: var(--cp-surface-elevated) !important;
    padding: 0.85rem 1.35rem !important;
}

/* --------------------------------------------------------------------------
   11. Dropdowns & Popovers
   -------------------------------------------------------------------------- */
.fi-dropdown-panel {
    background-color: var(--cp-surface) !important;
    border: 1px solid var(--cp-border) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
    border-radius: 0.75rem !important;
    padding: 0.4rem !important;
}

html.dark .fi-dropdown-panel {
    background-color: #0e1424 !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6) !important;
}

.fi-dropdown-list-item {
    color: var(--cp-text-primary) !important;
    border-radius: 0.45rem !important;
    padding: 0.45rem 0.75rem !important;
    font-size: 0.78rem !important;
}

.fi-dropdown-list-item:hover {
    background-color: var(--cp-surface-elevated) !important;
}

/* --------------------------------------------------------------------------
   12. Softphone Master Dual-Theme Styles
   -------------------------------------------------------------------------- */
.fi-page:has(.phone-stage) .fi-header {
    display: none !important;
}

.fi-page:has(.phone-stage) .fi-page-content {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: calc(100dvh - 5.5rem) !important;
    padding-block: 1rem !important;
}

.phone-stage {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-shell {
    position: relative;
}

.phone-bezel {
    width: min(22.5rem, calc(100vw - 3.5rem));
    height: min(46.5rem, calc(100dvh - 6.5rem));
    background: var(--phone-bezel-bg);
    border: 1px solid var(--phone-bezel-border);
    border-radius: 2.85rem;
    padding: 0.7rem;
    position: relative;
    box-shadow: var(--phone-bezel-shadow);
    transition: all 200ms ease;
}

.phone-island {
    position: absolute;
    top: 1.05rem;
    left: 50%;
    z-index: 3;
    width: 6.4rem;
    height: 1.55rem;
    transform: translateX(-50%);
    background: #000000;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.phone-screen {
    height: 100%;
    border-radius: 2.25rem;
    background: var(--phone-screen-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.35rem 1.15rem 1.15rem;
    overflow: hidden;
    position: relative;
    transition: all 200ms ease;
}

.phone-carrier {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cp-emerald);
}

.phone-agent {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cp-text-muted);
}

.phone-timer {
    margin: 0.15rem 0 0;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    font-variant-numeric: tabular-nums;
    color: var(--cp-emerald);
}

.phone-number {
    width: 100%;
    margin-top: 0.85rem;
    border: 0;
    background: transparent;
    text-align: center;
    font-size: 1.85rem;
    font-weight: 750;
    font-family: 'JetBrains Mono', monospace;
    color: var(--cp-text-primary);
    outline: none;
}

.phone-number::placeholder {
    color: var(--cp-text-muted);
    opacity: 0.6;
}

.phone-keys {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.55rem;
    width: 100%;
    margin-top: 0.85rem;
}

.phone-key {
    background: var(--phone-key-bg);
    border: 1px solid var(--phone-key-border);
    border-radius: 1.15rem;
    height: 3.65rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 120ms ease;
    user-select: none;
}

.phone-key:hover {
    background: var(--phone-key-hover);
    transform: scale(1.03);
}

.phone-key:active {
    transform: scale(0.96);
}

.phone-key-digit {
    font-size: 1.45rem;
    font-weight: 750;
    font-family: 'JetBrains Mono', monospace;
    color: var(--phone-key-color);
    line-height: 1;
}

.phone-key-letters {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--phone-key-letters);
    margin-top: 1px;
}

.phone-dock {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.15rem;
    width: 100%;
    margin-top: auto;
    padding-top: 0.65rem;
    position: relative;
}

.phone-fab {
    width: 3.65rem;
    height: 3.65rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    transition: all 150ms ease;
}

.phone-fab.is-call {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.phone-fab.is-call:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.phone-fab.is-hang {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(244, 63, 94, 0.4);
}

.phone-fab.is-hang:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.6);
}

.phone-fab.is-ghost {
    background: var(--phone-key-bg);
    border: 1px solid var(--phone-key-border);
    color: var(--cp-text-primary);
    width: 3rem;
    height: 3rem;
}

.phone-fab.is-ghost:hover {
    background: var(--phone-key-hover);
    transform: scale(1.05);
}

.phone-backspace {
    position: absolute;
    right: 0.5rem;
    background: transparent;
    border: 0;
    color: var(--cp-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    transition: color 150ms ease;
}

.phone-backspace:hover {
    color: var(--cp-text-primary);
}

.phone-homebar {
    width: 7.5rem;
    height: 4px;
    border-radius: 999px;
    background: var(--cp-text-muted);
    opacity: 0.3;
    margin-top: 0.65rem;
}

/* --------------------------------------------------------------------------
   13. Atlas Platform Multi-Tenant Views
   -------------------------------------------------------------------------- */
.atlas-home {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.atlas-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-radius: 0.85rem;
    border: 1px solid var(--cp-card-border);
    background: var(--cp-card-bg);
    backdrop-filter: blur(20px);
    padding: 1rem 1.5rem;
    box-shadow: var(--cp-card-shadow);
}

.atlas-kicker {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--cp-indigo);
    margin-bottom: 0.2rem;
}

.atlas-hero h1 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--cp-text-primary);
    letter-spacing: -0.02em;
    margin: 0;
}

.atlas-sub {
    font-size: 0.76rem;
    color: var(--cp-text-muted);
    margin-top: 0.2rem;
}

.atlas-hero-status {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: var(--cp-surface-elevated);
    padding: 0.45rem 0.85rem;
    border-radius: 0.65rem;
    border: 1px solid var(--cp-border);
}

.atlas-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: #94a3b8;
}

.atlas-dot.is-up {
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
}

.atlas-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 0.85rem;
}
@media (min-width: 640px) {
    .atlas-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (min-width: 1024px) {
    .atlas-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.atlas-stat {
    border-radius: 0.85rem;
    border: 1px solid var(--cp-card-border);
    background: var(--cp-card-bg);
    backdrop-filter: blur(16px);
    padding: 0.95rem 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--cp-card-shadow);
}

.atlas-stat span {
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cp-text-muted);
}

.atlas-stat strong {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--cp-text-primary);
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
    margin-top: 0.3rem;
}

.atlas-stat em {
    font-style: normal;
    font-size: 0.7rem;
    color: var(--cp-text-secondary);
    margin-top: 0.35rem;
}

.atlas-stat.is-accent strong {
    color: var(--cp-indigo);
}

.atlas-companies {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.atlas-company {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    background: var(--cp-surface-elevated);
    border: 1px solid var(--cp-border);
    border-radius: 0.55rem;
    text-decoration: none;
    transition: all 140ms ease;
}

.atlas-company:hover {
    border-color: var(--cp-indigo);
}

.atlas-company-slug {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--cp-indigo);
    background: rgba(99, 102, 241, 0.12);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.atlas-company strong {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--cp-text-primary);
    display: block;
}

.atlas-company small {
    font-size: 0.7rem;
    color: var(--cp-text-muted);
}

/* --------------------------------------------------------------------------
   14. Custom Scrollbars & Utilities
   -------------------------------------------------------------------------- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.3); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.5); }
