* {
    box-sizing: border-box;
}

:root {
    --navy-1: #04162b;
    --navy-2: #072441;
    --navy-3: #0a3157;
    --blue: #087df5;
    --blue-2: #1294ff;
    --green: #03d477;
    --red: #ff4141;
    --orange: #ff8b0a;
    --purple: #6335f6;
    --text: #101a2d;
    --muted: #64748b;
    --border: #dce4ee;
    --bg: #eef3f9;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;

    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.amx-app {
    width: 100%;
    height: 100vh;
    display: flex;
}

.sidebar {
    width: 205px;
    min-width: 205px;
    height: 100vh;
    background:
        linear-gradient(
            180deg,
            #031428,
            #06213e
        );

    color: white;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-bottom:
        1px solid rgba(255,255,255,.05);
}

.sidebar-logo img {
    max-width: 125px;
    max-height: 56px;
}

.logo-fallback {
    display: none;
    font-size: 31px;
    font-weight: 900;
    font-style: italic;
    color: #10a1ff;
}

.menu {
    padding: 8px 10px;
    flex: 1;
}

.menu-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: #e5edf7;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-radius: 8px;
    padding: 0 14px;
    margin: 2px 0;
    position: relative;
}

.menu-item:hover {
    background: rgba(255,255,255,.06);
}

.menu-item.active {
    background:
        linear-gradient(
            90deg,
            #0679f4,
            #118cff
        );

    color: white;
}

.menu-icon {
    width: 20px;
    text-align: center;
    font-size: 19px;
}

.menu-badge {
    margin-left: auto;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: #ff3131;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

.ramal-card {
    margin: 12px;
    padding: 12px;
    border-radius: 9px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ramal-status-dot {
    width: 17px;
    height: 17px;
    background: var(--green);
    border-radius: 50%;
}

.ramal-card div:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
}

.ramal-card span {
    font-size: 10px;
    color: #a8bdd3;
}

.ramal-arrow {
    margin-left: auto;
}

.main {
    flex: 1;
    min-width: 0;
    height: 100vh;
    overflow: hidden;
}

.topbar {
    height: 72px;
    background:
        linear-gradient(
            90deg,
            #06192d,
            #062544
        );

    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    color: white;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    border: 0;
    background: transparent;
    color: white;
    font-size: 26px;
}

.global-search {
    width: 390px;
    height: 40px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 10px;
}

.global-search input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    color: white;
}

.global-search input::placeholder {
    color: #a2b4c7;
}

.presence-wrapper {
    position: relative;
}

.presence-button {
    height: 40px;
    min-width: 145px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 8px;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.presence-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.presence-dot.online {
    background: var(--green);
}

.presence-dot.busy {
    background: var(--orange);
}

.presence-dot.dnd {
    background: var(--red);
}

.presence-dot.away {
    background: #ffd431;
}

.presence-menu {
    display: none;
    position: absolute;
    top: 47px;
    right: 0;
    width: 180px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0,0,0,.22);
    overflow: hidden;
    z-index: 100;
}

.presence-menu.show {
    display: block;
}

.presence-menu button {
    width: 100%;
    border: 0;
    background: white;
    padding: 11px 14px;
    text-align: left;
}

.presence-menu button:hover {
    background: #f2f6fb;
}

.profile {
    padding-left: 16px;
    border-left: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: 11px;
}

.profile-avatar {
    width: 43px;
    height: 43px;
    border-radius: 50%;
    background:
        linear-gradient(
            135deg,
            #168cff,
            #005ed3
        );

    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.profile-info {
    display: flex;
    flex-direction: column;
    font-size: 13px;
}

.profile-info span {
    color: #bfd0df;
    font-size: 11px;
}

.open-dialer {
    width: 58px;
    height: 52px;
    border: 2px solid transparent;
    border-radius: 8px;
    background:
        linear-gradient(
            135deg,
            #008bff,
            #0768e8
        );

    color: white;
    font-size: 25px;
    box-shadow: 0 4px 18px rgba(0,110,255,.28);
}

.open-dialer.active {
    border-color: #ff3737;
}

.page {
    display: none;
    height:
        calc(100vh - 72px);
    overflow: auto;
    padding: 20px;
}

.page.active {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.stat-card {
    height: 83px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(35,55,80,.08);
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 13px 18px;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 25px;
}

.stat-icon.green {
    background: var(--green);
}

.stat-icon.blue {
    color: #087df5;
    background: #e7f1ff;
}

.stat-icon.orange {
    background: var(--orange);
}

.stat-icon.purple {
    background: var(--purple);
}

.stat-card strong {
    display: block;
    font-size: 25px;
    margin-bottom: 3px;
}

.stat-card span {
    color: #365176;
    font-size: 13px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns:
        1.2fr
        1.1fr
        .8fr;
    gap: 12px;
}

.panel {
    background: white;
    border-radius: 8px;
    min-height: 370px;
    padding: 12px;
    box-shadow: 0 3px 12px rgba(35,55,80,.06);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
}

.panel-header h2 {
    font-size: 15px;
    margin: 0;
}

.text-link {
    border: 0;
    background: transparent;
    color: #007bff;
    font-size: 11px;
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.tab {
    border: 0;
    border-radius: 5px;
    background: #f0f4f9;
    color: #4c6078;
    padding: 8px 13px;
    font-size: 10px;
}

.tab.active {
    background: #087df5;
    color: white;
}

.panel-search {
    height: 36px;
    background: #f1f5f9;
    border-radius: 5px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.panel-search input {
    border: 0;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 11px;
}

.contact-row,
.history-row,
.queue-row {
    min-height: 50px;
    border-bottom: 1px solid #edf1f5;
    display: flex;
    align-items: center;
}

.contact-row {
    justify-content: space-between;
}

.contact-main {
    display: flex;
    align-items: center;
    gap: 9px;
}

.contact-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 12px;
}

.contact-data {
    display: flex;
    flex-direction: column;
    font-size: 11px;
}

.contact-data strong {
    font-size: 12px;
}

.contact-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
}

.status-mini {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.contact-actions {
    display: flex;
    gap: 7px;
}

.icon-action {
    border: 0;
    background: transparent;
    color: #087df5;
    font-size: 17px;
}

.history-row {
    display: grid;
    grid-template-columns:
        28px
        1fr
        auto;
    gap: 8px;
    font-size: 11px;
}

.history-icon {
    font-size: 20px;
}

.history-name {
    display: flex;
    flex-direction: column;
}

.history-time {
    color: #526a87;
    text-align: right;
}

.queue-row {
    display: grid;
    grid-template-columns:
        38px
        1fr
        20px;
    gap: 8px;
}

.queue-icon {
    width: 36px;
    height: 36px;
    background: #edf4fc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.queue-data {
    display: flex;
    flex-direction: column;
    font-size: 10px;
}

.queue-data strong {
    font-size: 11px;
}

.page-title {
    margin-bottom: 18px;
}

.page-title h1 {
    margin: 0;
    font-size: 24px;
}

.page-title p {
    margin: 4px 0 0;
    color: var(--muted);
}

.content-card,
.settings-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 3px 15px rgba(30,50,80,.07);
}

.module-placeholder {
    padding: 30px 0;
    color: var(--muted);
}

.primary-button {
    border: 0;
    background: #087df5;
    color: white;
    padding: 11px 20px;
    border-radius: 7px;
}

.primary-button.full {
    width: 100%;
}

.chat-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    height: 70vh;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.chat-users {
    border-right: 1px solid var(--border);
    padding: 10px;
}

.chat-users button {
    width: 100%;
    border: 0;
    padding: 12px;
    background: transparent;
    text-align: left;
}

.chat-window {
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

.message {
    max-width: 65%;
    padding: 10px 13px;
    border-radius: 10px;
    margin-bottom: 7px;
}

.message.other {
    background: #eef3f8;
}

.message.mine {
    background: #087df5;
    color: white;
    margin-left: auto;
}

.chat-compose {
    height: 60px;
    display: flex;
    border-top: 1px solid var(--border);
}

.chat-compose input {
    flex: 1;
    border: 0;
    padding: 0 16px;
    outline: none;
}

.chat-compose button {
    width: 100px;
    border: 0;
    background: #087df5;
    color: white;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.small-button {
    border: 0;
    border-radius: 50%;
    width: 32px;
    height: 32px;
}

.voicemail {
    display: grid;
    grid-template-columns:
        45px
        1fr
        45px;
    align-items: center;
    gap: 12px;
}

.voicemail button {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
}

.voicemail div {
    display: flex;
    flex-direction: column;
}

.voicemail span {
    color: var(--muted);
    font-size: 12px;
}

.setting-row {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.setting-row div {
    display: flex;
    flex-direction: column;
}

.setting-row span {
    font-size: 12px;
    color: var(--muted);
}

.switch input {
    display: none;
}

.switch span {
    width: 42px;
    height: 22px;
    border-radius: 20px;
    display: block;
    background: #c6cfda;
    position: relative;
}

.switch span::after {
    content: "";
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: .2s;
}

.switch input:checked + span {
    background: #087df5;
}

.switch input:checked + span::after {
    left: 22px;
}

/* DISCARDOR */

.dialer-panel {
    position: fixed;
    right: 0;
    top: 127px;
    width: 415px;
    height: 410px;
    z-index: 500;
    border: 1px solid #5b7087;
    background: #071b31;
    border-radius: 8px 0 0 8px;
    color: white;
    display: none;
    grid-template-columns: 280px 135px;
    box-shadow: 0 18px 50px rgba(0,0,0,.30);
}

.dialer-panel.show {
    display: grid;
}

.dialer-main {
    padding: 13px;
}

.dialer-options {
    border-left: 1px solid #31455d;
    padding: 13px 8px;
}

.dialer-header,
.options-header {
    height: 31px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dialer-header h2 {
    font-size: 16px;
    margin: 0;
}

.close-button {
    border: 0;
    background: transparent;
    color: white;
    font-size: 22px;
}

.dial-number {
    width: 100%;
    height: 42px;
    border: 1px solid #27405a;
    background: #0c2743;
    border-radius: 6px;
    outline: none;
    color: white;
    padding: 0 12px;
    margin: 8px 0;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 5px;
}

.keypad button {
    height: 52px;
    border: 0;
    border-radius: 5px;
    color: white;
    background: #102d49;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.keypad button:hover {
    background: #174064;
}

.keypad strong {
    font-size: 18px;
}

.keypad small {
    font-size: 9px;
    color: #b8c6d6;
}

.call-button {
    height: 54px;
    width: 100%;
    margin-top: 10px;
    border: 0;
    border-radius: 6px;
    background:
        linear-gradient(
            90deg,
            #02cf72,
            #00e886
        );

    color: white;
    font-size: 27px;
}

.option-button {
    width: 100%;
    height: 78px;
    background: transparent;
    border: 0;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
}

.option-icon {
    width: 42px;
    height: 42px;
    background: #102d49;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.option-button.active .option-icon {
    background: #087df5;
}

.active-call {
    text-align: center;
    padding-top: 15px;
}

.call-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #1d93e7;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.call-name {
    font-size: 17px;
    font-weight: 700;
    margin-top: 10px;
}

.call-number {
    font-size: 13px;
    color: #bdd0e0;
}

.call-timer {
    color: #13a1ff;
    margin-top: 5px;
}

.active-actions {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 6px;
    margin-top: 15px;
}

.active-action {
    min-height: 55px;
    border: 0;
    border-radius: 7px;
    background: #102d49;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.active-action.active {
    background: #087df5;
}

.active-action span {
    font-size: 9px;
}

.hangup-button {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 0;
    margin-top: 14px;
    background: #ff3e3e;
    color: white;
    font-size: 25px;
    transform: rotate(135deg);
}

.hidden {
    display: none !important;
}

/* MODAL */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(1,12,25,.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    width: 380px;
    background: white;
    border-radius: 12px;
    padding: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.modal-header button {
    border: 0;
    background: transparent;
    font-size: 23px;
}

.modal input {
    width: 100%;
    height: 42px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin: 18px 0;
}

/* RESPONSIVO */

@media(max-width:1200px) {

    .stats-grid {
        grid-template-columns:
            repeat(2,1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-grid .panel:last-child {
        grid-column: 1 / -1;
    }
}

@media(max-width:850px) {

    .sidebar {
        width: 68px;
        min-width: 68px;
    }

    .sidebar-logo img {
        max-width: 50px;
    }

    .menu-item span:not(.menu-icon):not(.menu-badge),
    .ramal-card div,
    .ramal-arrow {
        display: none;
    }

    .global-search {
        width: 230px;
    }

    .profile-info {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   AMX WEBRTC
   ========================================================= */

.amx-sip-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: rgba(2,14,29,.88);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.amx-sip-login {
    width: min(390px, calc(100vw - 32px));
    background: #071b31;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 16px;
    padding: 28px;
    color: #fff;
    box-shadow: 0 24px 70px rgba(0,0,0,.38);
}

.amx-sip-login img {
    display: block;
    max-width: 145px;
    max-height: 64px;
    margin: 0 auto 16px;
}

.amx-sip-login h2 {
    margin: 0 0 6px;
    text-align: center;
}

.amx-sip-login p {
    margin: 0 0 22px;
    text-align: center;
    color: #aabed2;
    font-size: 13px;
}

.amx-sip-login label {
    display: block;
    margin: 12px 0 6px;
    font-size: 12px;
    color: #c4d4e4;
}

.amx-sip-login input {
    width: 100%;
    height: 44px;
    border: 1px solid #28425e;
    border-radius: 8px;
    background: #0b2846;
    color: #fff;
    outline: none;
    padding: 0 12px;
}

.amx-sip-login input:focus {
    border-color: #168cff;
}

.amx-sip-login button {
    width: 100%;
    height: 45px;
    border: 0;
    border-radius: 8px;
    margin-top: 14px;
    background: linear-gradient(90deg,#087df5,#1294ff);
    color: #fff;
    font-weight: 700;
}

.amx-sip-login button:disabled {
    opacity: .55;
}

.amx-sip-error {
    min-height: 18px;
    margin-top: 10px;
    color: #ff9191;
    font-size: 12px;
}

.amx-incoming-call {
    position: fixed;
    right: 24px;
    top: 92px;
    z-index: 3500;
    width: 310px;
    border-radius: 14px;
    background: #071b31;
    color: #fff;
    padding: 20px;
    box-shadow: 0 20px 55px rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.10);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.amx-incoming-title {
    color: #12a2ff;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.amx-incoming-call strong {
    font-size: 18px;
}

.amx-incoming-call > span {
    color: #aec0d1;
    font-size: 13px;
}

.amx-incoming-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.amx-incoming-actions button {
    height: 42px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    font-weight: 700;
}

.amx-incoming-actions .reject {
    background: #ff4141;
}

.amx-incoming-actions .answer {
    background: #03c976;
}

.amx-transfer-modal {
    width: 430px;
}

.amx-transfer-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 16px;
}

.amx-transfer-tabs button {
    height: 39px;
    border: 1px solid #d8e1ec;
    border-radius: 7px;
    background: #f1f5f9;
}

.amx-transfer-tabs button.active {
    background: #087df5;
    border-color: #087df5;
    color: #fff;
}

.amx-transfer-status {
    min-height: 40px;
    padding: 10px 12px;
    margin: -6px 0 12px;
    border-radius: 7px;
    background: #f5f8fc;
    color: #566b83;
    font-size: 12px;
}

.amx-transfer-consult-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.amx-transfer-consult-actions button {
    min-height: 41px;
    border: 1px solid #d8e1ec;
    border-radius: 7px;
    background: #f4f7fb;
}

.amx-transfer-consult-actions .primary-button {
    grid-column: 1 / -1;
    border: 0;
    background: #087df5;
    color: #fff;
}

.amx-transfer-consult-actions .primary-button:disabled {
    opacity: .45;
}

