:root {
    --background: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #e5eaf0;

    --text: #18202b;
    --text-soft: #6f7b8a;

    --primary: #122a56;
    --primary-dark: #0c1e40;
    --accent: #4a7dff;

    --success: #169c62;
    --warning: #d99821;
    --danger: #d94c4c;

    --shadow: 0 12px 35px rgba(22, 34, 51, 0.07);

    --radius: 18px;
}


* {
    box-sizing: border-box;
}


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


body {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--background);
    color: var(--text);
}


button,
input,
textarea,
select {
    font: inherit;
}


button {
    cursor: pointer;
}


.app-shell {
    min-height: 100vh;
}


/* =========================
   SIDEBAR
========================= */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;

    width: 270px;
    height: 100vh;

    background: var(--primary-dark);
    color: white;

    display: flex;
    flex-direction: column;

    padding: 28px 18px;

    z-index: 100;
}


.brand {
    display: flex;
    gap: 12px;
    align-items: center;

    padding: 0 10px 30px;
}


.brand-mark {
    width: 44px;
    height: 44px;

    border-radius: 13px;

    display: grid;
    place-items: center;

    background: white;
    color: var(--primary-dark);

    font-weight: 900;
    font-size: 13px;
}


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


.brand span {
    display: block;
    font-size: 12px;

    margin-top: 3px;

    color: rgba(255,255,255,0.6);
}


.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 7px;
}


.nav-item {
    width: 100%;

    border: 0;
    background: transparent;
    color: rgba(255,255,255,0.68);

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 13px 14px;

    border-radius: 10px;

    text-align: left;
}


.nav-item:hover,
.nav-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
}


.nav-item span {
    width: 22px;
    text-align: center;
}


.sidebar-footer {
    margin-top: auto;
}


.business-card {
    display: flex;
    gap: 10px;
    align-items: center;

    border-top: 1px solid rgba(255,255,255,0.1);

    padding: 20px 8px;
}


.business-avatar,
.user-avatar {
    width: 38px;
    height: 38px;

    border-radius: 50%;

    display: grid;
    place-items: center;

    font-size: 12px;
    font-weight: 700;
}


.business-avatar {
    background: rgba(255,255,255,0.12);
}


.user-avatar {
    background: var(--primary);
    color: white;
}


.business-card strong {
    display: block;
    font-size: 13px;
}


.business-card span {
    display: block;

    margin-top: 3px;

    font-size: 11px;

    color: rgba(255,255,255,0.5);
}


.logout-button {
    width: 100%;

    padding: 11px;

    background: transparent;

    border: 1px solid rgba(255,255,255,0.15);

    border-radius: 9px;

    color: rgba(255,255,255,0.7);
}


/* =========================
   MAIN
========================= */

.main-content {
    margin-left: 270px;

    min-height: 100vh;

    padding: 28px 35px 50px;
}


.topbar {
    display: flex;

    justify-content: space-between;
    align-items: center;

    margin-bottom: 28px;
}


.eyebrow {
    color: var(--accent);

    text-transform: uppercase;

    letter-spacing: 0.1em;

    font-size: 11px;
    font-weight: 800;

    margin: 0 0 5px;
}


.topbar h1 {
    margin: 0;

    font-size: 29px;
}


.topbar-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}


.status-badge {
    display: flex;
    align-items: center;
    gap: 7px;

    background: #eaf8f1;

    color: #12764c;

    border-radius: 999px;

    padding: 9px 13px;

    font-size: 12px;
    font-weight: 700;
}


.status-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--success);
}


.notification-button {
    width: 38px;
    height: 38px;

    border-radius: 50%;

    border: 1px solid var(--border);

    background: var(--surface);
}


/* =========================
   VIEWS
========================= */

.view {
    display: none;
}


.view.active {
    display: block;
}


/* =========================
   WELCOME
========================= */

.welcome-card {
    background:
        linear-gradient(
            120deg,
            var(--primary-dark),
            var(--primary)
        );

    color: white;

    border-radius: 22px;

    padding: 30px;

    display: flex;

    justify-content: space-between;
    align-items: center;

    margin-bottom: 22px;

    overflow: hidden;
}


.welcome-card h2 {
    margin: 5px 0 8px;

    font-size: 27px;
}


.welcome-card p {
    color: rgba(255,255,255,0.72);

    margin-bottom: 0;
}


.ai-orb {
    width: 110px;
    height: 110px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background:
        radial-gradient(
            circle at 35% 30%,
            #ffffff,
            #78a2ff 30%,
            #3155c7 65%,
            #152a75
        );

    box-shadow:
        0 0 55px rgba(99, 145, 255, 0.5);

    font-size: 36px;
}


/* =========================
   STATS
========================= */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 17px;

    margin-bottom: 20px;
}


.stat-card {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    padding: 20px;

    display: flex;
    gap: 14px;

    box-shadow: var(--shadow);
}


.stat-icon {
    width: 42px;
    height: 42px;

    border-radius: 12px;

    background: #edf3ff;

    color: var(--primary);

    display: grid;
    place-items: center;
}


.stat-card span,
.stat-card small {
    display: block;

    color: var(--text-soft);
}


.stat-card span {
    font-size: 12px;
}


.stat-card strong {
    display: block;

    margin: 3px 0;

    font-size: 25px;
}


.stat-card small {
    font-size: 11px;
}


/* =========================
   PANELS
========================= */

.dashboard-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.6fr)
        minmax(300px, 0.8fr);

    gap: 20px;

    margin-bottom: 20px;
}


.panel {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    overflow: hidden;
}


.panel-header {
    display: flex;

    justify-content: space-between;
    align-items: center;

    padding: 21px 22px;

    border-bottom: 1px solid var(--border);
}


.panel-header h3 {
    margin: 0 0 5px;

    font-size: 16px;
}


.panel-header p {
    margin: 0;

    font-size: 12px;

    color: var(--text-soft);
}


.text-button {
    border: 0;
    background: transparent;

    color: var(--accent);

    font-weight: 700;
}


/* =========================
   CALL ITEMS
========================= */

.call-item {
    display: grid;

    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 13px;

    padding: 16px 22px;

    border-bottom: 1px solid var(--border);

    cursor: pointer;
}


.call-item:last-child {
    border-bottom: 0;
}


.call-item:hover {
    background: var(--surface-soft);
}


.caller-avatar {
    width: 40px;
    height: 40px;

    border-radius: 50%;

    display: grid;
    place-items: center;

    background: #edf3ff;

    color: var(--primary);

    font-weight: 800;
    font-size: 12px;
}


.call-main strong {
    display: block;

    font-size: 13px;
}


.call-main span {
    display: block;

    margin-top: 4px;

    font-size: 11px;

    color: var(--text-soft);
}


.call-meta {
    text-align: right;
}


.call-meta time {
    display: block;

    color: var(--text-soft);

    font-size: 11px;
}


.outcome-badge {
    display: inline-block;

    margin-top: 5px;

    padding: 5px 8px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 700;
}


.outcome-completed {
    background: #edf4ff;
    color: #3564bd;
}


.outcome-appointment {
    background: #e9f8f0;
    color: #14764c;
}


.outcome-follow-up {
    background: #fff4df;
    color: #9f6c11;
}


/* =========================
   ACTIVITY
========================= */

.activity-item {
    display: grid;

    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto;

    gap: 12px;

    align-items: center;

    padding: 16px 22px;

    border-bottom: 1px solid var(--border);
}


.activity-item:last-child {
    border-bottom: 0;
}


.activity-icon {
    width: 34px;
    height: 34px;

    border-radius: 9px;

    display: grid;
    place-items: center;

    background: var(--surface-soft);
}


.activity-item strong {
    display: block;

    font-size: 12px;
}


.activity-item span,
.activity-item time {
    font-size: 11px;

    color: var(--text-soft);
}


.status-list {
    padding: 8px 22px 16px;
}


.status-list > div {
    display: flex;

    justify-content: space-between;

    padding: 14px 0;

    border-bottom: 1px solid var(--border);

    font-size: 12px;
}


.status-list > div:last-child {
    border-bottom: 0;
}


.status-list span {
    color: var(--text-soft);
}


.online-text {
    color: var(--success);
}


/* =========================
   TABLE
========================= */

.call-filters {
    display: flex;
    gap: 9px;
}


.call-filters input,
.call-filters select {
    border: 1px solid var(--border);

    border-radius: 9px;

    padding: 10px 12px;

    background: white;

    outline: none;
}


.table-wrapper {
    overflow-x: auto;
}


table {
    width: 100%;

    border-collapse: collapse;
}


th,
td {
    text-align: left;

    padding: 15px 20px;

    border-bottom: 1px solid var(--border);

    font-size: 12px;
}


th {
    background: #fafbfd;

    color: var(--text-soft);

    font-size: 10px;

    text-transform: uppercase;

    letter-spacing: 0.04em;
}


td strong {
    display: block;
}


td span {
    display: block;

    margin-top: 3px;

    color: var(--text-soft);

    font-size: 11px;
}


.table-action {
    border: 1px solid var(--border);

    background: white;

    border-radius: 7px;

    padding: 7px 10px;
}


/* =========================
   MESSAGES
========================= */

.message-card {
    padding: 18px 22px;

    border-bottom: 1px solid var(--border);
}


.message-card:last-child {
    border-bottom: 0;
}


.message-card-header {
    display: flex;

    justify-content: space-between;

    margin-bottom: 8px;
}


.message-card strong {
    font-size: 13px;
}


.message-card time {
    color: var(--text-soft);

    font-size: 11px;
}


.message-card p {
    margin: 0 0 10px;

    color: #465364;

    line-height: 1.6;

    font-size: 13px;
}


/* =========================
   FORMS
========================= */

.settings-form {
    max-width: 700px;

    padding: 24px;
}


.settings-form label {
    display: block;

    margin-bottom: 20px;

    font-size: 12px;
    font-weight: 700;
}


.settings-form input[type="text"],
.settings-form input[type="email"],
.settings-form input[type="tel"],
.settings-form input[type="time"],
.settings-form textarea {
    width: 100%;

    display: block;

    margin-top: 8px;

    padding: 12px;

    border: 1px solid var(--border);

    border-radius: 10px;

    outline: none;

    background: white;
}


.settings-form textarea {
    resize: vertical;
}


.settings-form input:focus,
.settings-form textarea:focus {
    border-color: var(--accent);
}


.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 15px;
}


.toggle-row {
    display: flex !important;

    justify-content: space-between;
    align-items: center;

    border: 1px solid var(--border);

    border-radius: 12px;

    padding: 15px;
}


.toggle-row span {
    display: block;

    margin-top: 4px;

    color: var(--text-soft);

    font-weight: 400;
}


.primary-button,
.secondary-button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    border-radius: 9px;

    padding: 11px 16px;

    text-decoration: none;

    font-weight: 700;

    border: 0;
}


.primary-button {
    background: var(--primary);
    color: white;
}


.primary-button:hover {
    background: var(--primary-dark);
}


.secondary-button {
    background: white;

    border: 1px solid var(--border);

    color: var(--text);
}


/* =========================
   EMPTY
========================= */

.empty-state {
    text-align: center;

    padding: 70px 25px;
}


.empty-icon {
    width: 55px;
    height: 55px;

    margin: 0 auto 15px;

    display: grid;
    place-items: center;

    border-radius: 14px;

    background: #edf3ff;

    color: var(--primary);

    font-size: 22px;
}


.empty-state h3 {
    margin-bottom: 7px;
}


.empty-state p {
    max-width: 480px;

    margin: auto;

    color: var(--text-soft);

    line-height: 1.6;
}


/* =========================
   MODAL
========================= */

.modal-backdrop {
    position: fixed;

    inset: 0;

    display: none;

    align-items: center;
    justify-content: center;

    background: rgba(7, 14, 25, 0.6);

    padding: 20px;

    z-index: 1000;
}


.modal-backdrop.open {
    display: flex;
}


.modal {
    position: relative;

    width: min(620px, 100%);

    background: white;

    border-radius: 20px;

    padding: 28px;

    box-shadow: 0 30px 80px rgba(0,0,0,0.25);
}


.modal-close {
    position: absolute;

    right: 18px;
    top: 15px;

    border: 0;

    background: transparent;

    font-size: 28px;

    color: var(--text-soft);
}


.modal h2 {
    margin: 0;
}


.modal-phone {
    margin-top: 5px;

    color: var(--text-soft);
}


.call-detail-grid {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 12px;

    margin: 22px 0;
}


.call-detail-grid div {
    background: var(--surface-soft);

    border-radius: 10px;

    padding: 13px;
}


.call-detail-grid span {
    display: block;

    font-size: 10px;

    color: var(--text-soft);

    margin-bottom: 5px;
}


.call-detail-grid strong {
    font-size: 12px;
}


.summary-box {
    background: #f7f9fc;

    border: 1px solid var(--border);

    border-radius: 13px;

    padding: 17px;

    margin-bottom: 20px;
}


.summary-box span {
    display: block;

    font-size: 11px;
    font-weight: 800;

    margin-bottom: 7px;
}


.summary-box p {
    margin: 0;

    line-height: 1.6;

    color: #48576a;

    font-size: 13px;
}


.modal-actions {
    display: flex;
    gap: 10px;
}


/* =========================
   MOBILE
========================= */

.mobile-menu-button {
    display: none;
}


@media (max-width: 1100px) {

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

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

}


@media (max-width: 760px) {

    .sidebar {
        transform: translateX(-100%);

        transition: transform 0.25s ease;
    }


    .sidebar.open {
        transform: translateX(0);
    }


    .main-content {
        margin-left: 0;

        padding: 20px;
    }


    .mobile-menu-button {
        display: inline-block;

        border: 0;

        background: transparent;

        font-size: 22px;

        margin-right: 10px;
    }


    .topbar {
        align-items: flex-start;
    }


    .status-badge {
        display: none;
    }


    .welcome-card {
        padding: 23px;
    }


    .ai-orb {
        width: 70px;
        height: 70px;

        font-size: 23px;
    }


    .welcome-card h2 {
        font-size: 21px;
    }


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


    .stacked-mobile {
        align-items: flex-start;

        flex-direction: column;

        gap: 14px;
    }


    .call-filters {
        width: 100%;

        flex-direction: column;
    }


    .call-filters input,
    .call-filters select {
        width: 100%;
    }


    .form-grid,
    .call-detail-grid {
        grid-template-columns: 1fr;
    }


    .modal-actions {
        flex-direction: column;
    }

}