:root {
    --ink: #102238;
    --muted: #6e7f90;
    --line: #e4eaf0;
    --surface: #fff;
    --canvas: #f4f7fa;
    --nav: #0c1728;
    --primary: #15a786;
    --primary-dark: #0b856b;
    --danger: #ed5b61;
    --shadow: 0 16px 45px rgba(24, 45, 73, .08);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, "Segoe UI", Arial, sans-serif; }
button, input, textarea, select { font: inherit; }
.d-none { display: none !important; }

.global-loader { position: fixed; z-index: 3000; inset: 0; display: grid; place-content: center; text-align: center; color: #dce9f0; background: radial-gradient(circle at 50% 40%, #19344a, var(--nav) 60%); transition: opacity .28s ease; }
.global-loader.is-hidden { opacity: 0; pointer-events: none; }
.loader-mark { height: 48px; display: flex; justify-content: center; align-items: end; gap: 6px; }
.loader-mark span { width: 8px; border-radius: 6px; background: #2bd2ad; animation: loader-bars .85s ease-in-out infinite alternate; }
.loader-mark span:nth-child(1) { height: 18px; }
.loader-mark span:nth-child(2) { height: 32px; animation-delay: .15s; }
.loader-mark span:nth-child(3) { height: 46px; animation-delay: .3s; }
@keyframes loader-bars { to { height: 10px; opacity: .45; } }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 20% 20%, rgba(39, 210, 170, .15), transparent 35%), radial-gradient(circle at 80% 70%, rgba(68, 102, 210, .18), transparent 35%), var(--nav); }
.login-card { width: min(100%, 460px); padding: 44px; background: rgba(255, 255, 255, .98); border: 1px solid rgba(255, 255, 255, .35); border-radius: 26px; box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.login-card h1 { font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 750; letter-spacing: -.045em; line-height: 1.05; margin: 0 0 16px; }
.login-kicker { color: var(--primary); letter-spacing: .18em; text-transform: uppercase; font-size: .72rem; font-weight: 800; margin: 32px 0 10px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: #fff; font-size: 1.35rem; font-weight: 800; letter-spacing: -.03em; text-decoration: none; }
.brand-login { color: var(--ink); }
.brand-glyph { width: 39px; height: 39px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(145deg, #2ed5ae, #129177); color: white; box-shadow: 0 8px 22px rgba(21,167,134,.35); }
.secure-note { display: flex; gap: 8px; justify-content: center; align-items: center; color: var(--muted); font-size: .8rem; margin-top: 24px; }
.form-control, .form-select { border-color: #d8e1e8; border-radius: 12px; min-height: 48px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(21,167,134,.13); }
.btn { border-radius: 11px; font-weight: 650; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary-dark); --bs-btn-hover-border-color: var(--primary-dark); --bs-btn-active-bg: var(--primary-dark); --bs-btn-active-border-color: var(--primary-dark); }
.btn-soft { background: #fff; border: 1px solid var(--line); color: var(--ink); padding: .65rem 1rem; }
.btn-soft:hover { color: var(--primary-dark); border-color: #a9d7cc; background: #f9fffd; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 1020; inset: 0 auto 0 0; width: 250px; padding: 30px 20px 20px; display: flex; flex-direction: column; background: var(--nav); color: #fff; }
.sidebar .brand { margin: 0 13px 42px; }
.app-nav { display: grid; gap: 6px; }
.app-nav .nav-link { width: 100%; display: flex; align-items: center; gap: 14px; padding: 13px 15px; color: #8fa2b6; background: transparent; border: 0; border-radius: 12px; font-weight: 650; text-align: left; transition: .18s ease; }
.app-nav .nav-link i { font-size: 1.08rem; }
.app-nav .nav-link:hover { color: white; background: rgba(255,255,255,.055); }
.app-nav .nav-link.active { color: white; background: linear-gradient(100deg, rgba(39,210,170,.22), rgba(39,210,170,.05)); box-shadow: inset 3px 0 #29d0aa; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: 18px; display: flex; align-items: center; justify-content: space-between; }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: .86rem; }
.user-chip small { font-size: .7rem; color: #7e91a7; }
.user-avatar { flex: 0 0 auto; width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: #25374b; color: #33d2ad; font-weight: 800; }
.btn-icon { width: 40px; height: 40px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.push-button.active { color: #08745c; border-color: #b8e2d8; background: #e9f8f3; }
.push-button.warning { color: #a16a13; border-color: #ead5ac; background: #fff7e8; }
.push-button.error { color: #b64049; border-color: #f0c2c5; background: #fff0f1; }
.spin { animation: button-spin .75s linear infinite; }
@keyframes button-spin { to { transform: rotate(360deg); } }
.sidebar .btn-icon { background: transparent; color: #90a4b9; border-color: rgba(255,255,255,.1); }
.main-column { min-height: 100vh; margin-left: 250px; padding: 0 34px 52px; }
.topbar { min-height: 98px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar h2 { margin: 0; font-size: 1.55rem; font-weight: 750; letter-spacing: -.03em; }
.eyebrow { color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.mode-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #eadfbf; background: #fffaf0; color: #816829; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa8b6; box-shadow: 0 0 0 4px rgba(154,168,182,.15); }
.status-dot.green { background: #26c291; box-shadow: 0 0 0 4px rgba(38,194,145,.14); }
.status-dot.amber { background: #eba83e; box-shadow: 0 0 0 4px rgba(235,168,62,.14); }
.connection-alert { padding: 11px 15px; margin-bottom: 18px; border-radius: 10px; background: #fff1f1; color: #a73b44; border: 1px solid #f2c8cb; }
.call-event-alert { position: relative; display: flex; align-items: center; gap: 14px; margin: 0 0 20px; padding: 16px 18px; color: #6f2028; background: linear-gradient(100deg, #fff0f1, #fff9f9); border: 1px solid #f2bfc3; border-radius: 15px; box-shadow: 0 10px 28px rgba(151, 50, 59, .09); }
.call-event-icon { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; color: #fff; background: var(--danger); border-radius: 13px; font-size: 1.15rem; }
.call-event-content { min-width: 0; display: grid; gap: 2px; }
.call-event-content strong { font-size: .93rem; }
.call-event-content span { color: #8c333b; font-size: .84rem; overflow-wrap: anywhere; }
.call-event-content small { color: #a7656b; font-size: .7rem; }
.call-event-alert .btn-close { margin-left: auto; flex: 0 0 auto; }
.page { display: none; animation: page-in .2s ease; }
.page.active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } }
.hero-panel { min-height: 200px; position: relative; overflow: hidden; padding: 36px 40px; display: flex; justify-content: space-between; align-items: center; border-radius: 23px; color: white; background: linear-gradient(120deg, #10253b, #143951 65%, #136b64); box-shadow: var(--shadow); }
.hero-panel:before { content: ""; position: absolute; width: 340px; height: 340px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; right: -80px; top: -170px; }
.hero-panel h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 760; letter-spacing: -.045em; margin: 8px 0 8px; }
.hero-panel p { color: #aec2ce; margin: 0; }
.hero-label { display: inline-flex; align-items: center; gap: 8px; color: #44dab7; font-size: .74rem; text-transform: uppercase; font-weight: 800; letter-spacing: .14em; }
.hero-label:before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #44dab7; box-shadow: 0 0 0 5px rgba(68,218,183,.12); }
.hero-orbit { width: 110px; height: 110px; position: relative; z-index: 1; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); font-size: 2.6rem; color: #4ce0be; }
.hero-orbit span { position: absolute; inset: -14px; border: 1px solid rgba(76,224,190,.18); border-radius: 50%; animation: pulse-ring 2.5s ease-out infinite; }
@keyframes pulse-ring { 70%,100% { transform: scale(1.18); opacity: 0; } }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 17px; margin: 20px 0 38px; }
.stat-card { display: flex; align-items: center; gap: 14px; padding: 18px; min-width: 0; background: #fff; border: 1px solid #edf1f4; border-radius: 17px; box-shadow: 0 7px 25px rgba(29,55,83,.045); }
.stat-icon { flex: 0 0 auto; width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; font-size: 1.15rem; }
.stat-icon.green { background: #e7f8f3; color: #0e9a78; }.stat-icon.violet { background: #f1edff; color: #7154d8; }.stat-icon.blue { background: #eaf3ff; color: #3276c8; }.stat-icon.orange { background: #fff3df; color: #d58d22; }
.stat-card strong, .stat-card small { display: block; }
.stat-card strong { font-size: 1.45rem; line-height: 1.1; }
.stat-card small { color: var(--muted); font-size: .72rem; margin-top: 4px; white-space: nowrap; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 0 0 17px; }
.section-heading h3 { font-size: 1.35rem; font-weight: 760; letter-spacing: -.03em; margin: 3px 0 0; }
.modem-list { display: grid; gap: 8px; }
.modem-row { min-width: 0; display: grid; grid-template-columns: 54px minmax(190px, 1.35fr) minmax(170px, 1fr) minmax(130px, .75fr) auto minmax(170px, auto); align-items: center; gap: 16px; padding: 12px 15px; background: var(--surface); border: 1px solid #e5ebef; border-radius: 13px; transition: background .16s ease, border-color .16s ease; }
.modem-row:hover { background: #fbfffe; border-color: #c8e3dc; }
.modem-row.offline { background: #fafbfc; color: #84909c; }
.slot-badge { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; color: #0a8b70; background: #e7f8f3; font-weight: 800; }
.offline .slot-badge { color: #84909c; background: #eef1f3; }
.online-pill, .offline-pill { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 5px 8px; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.online-pill { color: #0a886b; background: #e8f8f3; }.offline-pill { color: #7d8995; background: #edf0f2; }
.modem-name { font-size: .91rem; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 0 2px; }
.modem-number { font-size: .91rem; font-weight: 650; letter-spacing: .01em; margin: 0; }
.modem-equipment, .modem-network { min-width: 0; }
.modem-equipment small, .modem-network small { display: block; color: var(--muted); font-size: .64rem; margin-bottom: 2px; }
.modem-equipment strong, .modem-network > span:first-of-type { display: block; color: #405468; font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modem-network { position: relative; padding-right: 22px; }
.modem-network .signal-bars { position: absolute; right: 0; bottom: 1px; }
.signal-bars { display: flex; align-items: end; gap: 2px; height: 14px; }
.signal-bars i { display: block; width: 3px; background: var(--primary); border-radius: 2px; }.signal-bars i:nth-child(1){height:4px}.signal-bars i:nth-child(2){height:7px}.signal-bars i:nth-child(3){height:10px}.signal-bars i:nth-child(4){height:13px}
.modem-actions { display: flex; justify-content: flex-end; gap: 7px; }
.modem-actions .btn { min-width: 78px; padding: 7px 10px; font-size: .72rem; }
.modem-unavailable { display: inline-block; min-width: 94px; color: #7c8792; font-size: .72rem; text-align: center; }
.device-list { display: grid; gap: 12px; }
.device-row { display: grid; grid-template-columns: 64px minmax(150px,1.2fr) minmax(160px,1fr) minmax(140px,1fr) auto; gap: 18px; align-items: center; padding: 17px 20px; border: 1px solid #e6ecef; background: #fff; border-radius: 15px; }
.device-row:hover { background: #fbfffe; border-color: #cde5df; }
.device-row small { display: block; color: var(--muted); font-size: .69rem; margin-bottom: 3px; }.device-row strong { font-size: .86rem; }.device-capabilities { display:flex; gap:6px; flex-wrap:wrap; }.cap-pill { border:1px solid var(--line); padding:4px 7px; border-radius:999px; color:var(--muted); font-size:.66rem; }.cap-pill.on { border-color:#bfe5db; color:#0b876c; background:#f3fbf9; }
.table-card { overflow: hidden; background: #fff; border: 1px solid #e7ecef; border-radius: 18px; box-shadow: var(--shadow); padding: 16px; }
.table-card .table { margin-bottom: 0; }.table-card table.dataTable tbody tr { transition: background .14s ease; }.table-card table.dataTable tbody tr:hover { background: #f0fbf8 !important; }.table-card th { color: #657788; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; border-bottom-color: var(--line); }.table-card td { color: #293d50; font-size: .82rem; padding-top: .82rem; padding-bottom: .82rem; border-bottom-color: #eef2f5; }.column-filters input { width: 100%; min-width: 70px; padding: 5px 7px; border: 1px solid #dfe6eb; border-radius: 7px; font-size: .68rem; text-transform: none; letter-spacing: normal; }.dataTables_wrapper .dataTables_filter input { border: 1px solid #d8e1e8; border-radius: 9px; padding: 7px 10px; margin-left: 7px; }.dataTables_wrapper .dataTables_length select { border-radius: 8px; }.table-action { width: 31px; height: 31px; display: grid; place-items: center; padding: 0; border-radius: 9px; border: 1px solid var(--line); background: white; color: var(--ink); }.direction-badge, .state-badge { padding: 4px 7px; border-radius: 7px; font-size: .67rem; font-weight: 750; }.direction-badge.incoming { color:#4c55a8;background:#eeeeff}.direction-badge.outgoing {color:#08745c;background:#e9f8f3}.state-badge { color:#5f7182;background:#eef2f5}.state-badge.connected,.state-badge.sent {color:#08745c;background:#e7f8f2}.state-badge.failed {color:#b64049;background:#ffeaeb}.state-badge.ringing,.state-badge.dialing {color:#a16a13;background:#fff4df}
.modal-content { border: 0; border-radius: 20px; box-shadow: 0 25px 70px rgba(12,23,40,.24); }.modal-header,.modal-footer { border-color: var(--line); padding: 20px 22px; }.modal-body { padding: 22px; }.modal-title { font-weight: 760; letter-spacing: -.025em; }.call-avatar { width: 74px; height: 74px; margin: 0 auto 16px; display:grid;place-items:center;border-radius:50%;background:#edf6f5;color:#16987b;font-size:2rem}.call-avatar.large{width:96px;height:96px;font-size:2.7rem;background:rgba(255,255,255,.12);color:#65e4c5}.btn-call { width:62px;height:62px;border-radius:50%;background:#20bd8e;color:#fff;font-size:1.45rem;box-shadow:0 10px 25px rgba(32,189,142,.35)}.btn-call:hover{background:#149f77;color:#fff}.active-call { overflow:hidden;color:#fff;background:linear-gradient(160deg,#102b41,#0d1726 70%)}.active-call .modal-body{padding:56px 24px 30px}.active-call h3{font-weight:760;margin:14px 0 5px}.active-call p{color:#8faaba}.call-direction{font-size:.72rem;text-transform:uppercase;letter-spacing:.13em;color:#4bd9b7;font-weight:800;margin-bottom:22px}.call-timer{font-variant-numeric:tabular-nums;color:#d7e5eb;margin:18px 0 10px}.audio-status{display:flex;justify-content:center;gap:7px;color:#89a2ae;font-size:.68rem}.active-call canvas{max-width:100%;height:38px;margin:8px auto 14px}.call-actions{display:flex;justify-content:center;gap:17px}.call-control,.hangup-control,.answer-control{width:52px;height:52px;display:grid;place-items:center;border-radius:50%;color:#fff;background:rgba(255,255,255,.13);border:1px solid rgba(255,255,255,.1)}.hangup-control{background:#ed5b61;border-color:#ed5b61}.answer-control{background:#20bd8e;border-color:#20bd8e}.signal-rings span{position:absolute;z-index:0;width:160px;height:160px;left:50%;top:120px;transform:translate(-50%,-50%);border:1px solid rgba(84,223,190,.15);border-radius:50%;animation:ring-wave 2.2s linear infinite}.signal-rings span:nth-child(2){animation-delay:.7s}.signal-rings span:nth-child(3){animation-delay:1.4s}@keyframes ring-wave{from{width:90px;height:90px;opacity:1}to{width:290px;height:290px;opacity:0}}.toast-dot{width:9px;height:9px;background:var(--primary);border-radius:50%}.mobile-only{display:none}
.push-permission-icon { width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 17px; color: #0b8c70; background: #e6f8f3; border-radius: 50%; font-size: 1.65rem; box-shadow: 0 0 0 10px #f4fbf9; }
.push-permission-status { padding: 11px 12px; color: #526779; background: #f3f7f9; border-radius: 10px; font-size: .76rem; line-height: 1.45; }
.push-permission-modal .modal-footer { display: grid; grid-template-columns: auto 1fr; }

@media (max-width: 1180px) { .stats-grid { grid-template-columns: repeat(2, 1fr); }.modem-row { grid-template-columns: 50px minmax(170px,1.2fr) minmax(150px,1fr) auto minmax(160px,auto); }.modem-network { display:none; }.device-row { grid-template-columns: 52px 1fr 1fr; }.device-row > :nth-child(4), .device-row > :nth-child(5) { grid-column: auto; } }
@media (max-width: 760px) { .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 12px 0 40px rgba(0,0,0,.25); }.sidebar.open { transform: translateX(0); }.main-column { margin-left: 0; padding: 0 16px 35px; }.topbar { min-height: 80px; }.mobile-only { display: inline-grid; }.topbar > div:first-of-type .eyebrow { display:none; }.mode-badge { font-size:0; padding:10px; }.mode-badge .status-dot { margin:0; }.hero-panel { padding: 28px 24px; min-height: 185px; }.hero-orbit { display:none; }.stats-grid { gap:10px; margin-bottom:28px; }.stat-card { padding:13px; }.stat-card small { white-space:normal; }.section-heading { align-items:center; }.modem-list { gap: 0; border: 1px solid #e3e9ed; border-radius: 14px; overflow: hidden; background: #fff; }.modem-row { grid-template-columns: 44px minmax(0,1fr) auto; gap: 10px; padding: 13px 12px; border: 0; border-bottom: 1px solid #e8edf0; border-radius: 0; background: #fff; }.modem-row:last-child { border-bottom: 0; }.modem-row:hover { background: #f8fcfb; }.modem-row.offline { background: #fafbfc; }.modem-row .slot-badge { width: 40px; height: 40px; border-radius: 11px; font-size: .76rem; }.modem-equipment, .modem-network { display:none; }.modem-row > .online-pill, .modem-row > .offline-pill { align-self: start; font-size: 0; padding: 7px; }.modem-row > .online-pill .status-dot, .modem-row > .offline-pill .status-dot { margin: 0; }.modem-actions { grid-column: 2 / 4; justify-content: stretch; margin-top: 1px; }.modem-actions .btn { flex: 1; min-width: 0; }.modem-unavailable { width: 100%; min-width: 0; padding: 5px 0; text-align: left; }.device-row { grid-template-columns: 46px 1fr; gap:12px; }.device-row > :nth-child(n+3) { grid-column: 2; }.table-card { overflow-x:auto; }.login-card { padding:30px 24px; }.dataTables_wrapper { min-width: 720px; }.push-permission-modal .modal-footer { grid-template-columns: 1fr; }.push-permission-modal .modal-footer .btn { width: 100%; } }
