:root {
    --bg: #edf4ff;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-strong: rgba(255, 255, 255, 0.94);
    --surface-muted: #eef5ff;
    --border: rgba(15, 84, 191, 0.1);
    --text: #123056;
    --muted: #6a84a8;
    --primary: #0c69dc;
    --primary-dark: #0a4ba1;
    --primary-soft: #ddeaff;
    --primary-accent: #52b3ff;
    --danger: #e24d61;
    --shadow: 0 24px 64px rgba(14, 60, 132, 0.14);
    --shadow-soft: 0 14px 36px rgba(14, 60, 132, 0.1);
    --radius-lg: 30px;
    --radius-md: 20px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(14, 100, 210, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(69, 159, 255, 0.22), transparent 22%),
        linear-gradient(160deg, #f7fbff 0%, #eef5ff 44%, #f9fcff 100%);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.36), transparent 35%),
        radial-gradient(circle at 20% 20%, rgba(82, 179, 255, 0.12), transparent 24%),
        radial-gradient(circle at 80% 0%, rgba(12, 105, 220, 0.1), transparent 18%);
    pointer-events: none;
    z-index: -1;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.login-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    min-height: 100vh;
}

.login-card {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 24px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 36px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.login-intro,
.login-form-panel,
.panel-card,
.stat-card,
.sidebar,
.topbar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
}

.panel-card,
.stat-card,
.summary-card,
.topbar,
.login-intro,
.login-form-panel {
    position: relative;
    overflow: hidden;
}

.panel-card::before,
.stat-card::before,
.summary-card::before,
.topbar::before,
.login-intro::before,
.login-form-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.26), transparent 42%);
    pointer-events: none;
}

.login-intro {
    padding: 42px;
    position: relative;
    overflow: hidden;
}

.login-intro::after {
    content: '';
    position: absolute;
    inset: auto -120px -120px auto;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(14, 100, 210, 0.2), transparent 70%);
}

.pill,
.topbar-kicker,
.section-kicker,
.brand-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: inset 0 0 0 1px rgba(12, 105, 220, 0.06);
}

.login-intro h2 {
    margin: 18px 0 14px;
    font-size: clamp(2.4rem, 5vw, 4.4rem);
    line-height: 0.98;
    font-family: 'Sora', 'Manrope', sans-serif;
    letter-spacing: -0.04em;
}

.login-intro p,
.muted-text,
.sidebar p,
.empty-state,
.subtle-row,
.modal-contact-name {
    color: var(--muted);
}

.login-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 36px;
}

.login-meta-grid article,
.timeline-card,
.user-card {
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(233, 242, 255, 0.8));
    border: 1px solid rgba(14, 100, 210, 0.1);
}

.login-meta-grid strong,
.timeline-card strong,
.user-card strong {
    display: block;
    margin-bottom: 8px;
}

.login-form-panel {
    padding: 34px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

.panel-form,
.compact-form {
    display: grid;
    gap: 16px;
}

.panel-form label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

.panel-form input,
.panel-form select,
.panel-form textarea {
    width: 100%;
    border: 1px solid rgba(14, 100, 210, 0.16);
    border-radius: 14px;
    padding: 14px 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 255, 0.96));
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.panel-form input:focus,
.panel-form select:focus,
.panel-form textarea:focus {
    border-color: rgba(14, 100, 210, 0.5);
    box-shadow: 0 0 0 5px rgba(14, 100, 210, 0.12);
}

.filter-form {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(160px, 0.7fr)) auto;
    gap: 16px;
    align-items: end;
    margin-bottom: 22px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(232, 242, 255, 0.66), rgba(255, 255, 255, 0.62));
    border-radius: 24px;
    border: 1px solid rgba(12, 105, 220, 0.08);
}

.calls-toolbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.toolbar-button-group,
.compact-inline-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.compact-button {
    width: auto;
    min-width: 0;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.2;
}

.filter-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    margin-left: 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--primary-accent));
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.filter-panel {
    margin-bottom: 18px;
}

.filter-panel[hidden] {
    display: none;
}

.filter-panel.is-open {
    display: block;
}

.inline-form {
    margin: 0;
}

.filter-actions,
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.primary-button,
.secondary-button,
.ghost-button,
.mini-button,
.ghost-link {
    border: 0;
    cursor: pointer;
    border-radius: 14px;
    padding: 14px 18px;
    font-weight: 800;
    transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.mini-button:hover,
.ghost-link:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.primary-button {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary), var(--primary-accent));
    color: #fff;
}

.secondary-button,
.ghost-button {
    background: linear-gradient(180deg, #f7fbff, var(--primary-soft));
    color: var(--primary-dark);
    box-shadow: inset 0 0 0 1px rgba(12, 105, 220, 0.06);
}

.ghost-link,
.mini-button.light {
    background: rgba(255, 255, 255, 0.82);
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(12, 105, 220, 0.08);
}

.mini-button {
    width: 100%;
    padding: 11px 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-accent));
    color: #fff;
    font-size: 13px;
}

.mini-button.secondary {
    background: #2083f3;
}

.mini-button.danger {
    background: var(--danger);
}

.full-width {
    width: 100%;
}

.default-login-box {
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(233, 242, 255, 0.92), rgba(255, 255, 255, 0.96));
    border: 1px solid rgba(14, 100, 210, 0.12);
}

.default-login-box span {
    display: block;
    font-size: 13px;
    color: var(--muted);
}

.default-login-box strong {
    display: block;
    margin-top: 8px;
    font-size: 20px;
}

.flash {
    padding: 14px 18px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.login-flash {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 30;
}

.flash-success {
    background: rgba(20, 152, 102, 0.12);
    border-color: rgba(20, 152, 102, 0.18);
    color: #0f6b47;
}

.flash-error {
    background: rgba(226, 77, 97, 0.12);
    border-color: rgba(226, 77, 97, 0.18);
    color: #9f2e40;
}

.app-shell {
    min-height: 100vh;
    padding: 24px;
}

.sidebar {
    position: fixed;
    top: 24px;
    left: 24px;
    bottom: 24px;
    width: 320px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(226, 239, 255, 0.82));
}

.sidebar h1,
.topbar h2,
.section-heading h3,
.modal-header h3 {
    margin: 14px 0 0;
    font-family: 'Sora', 'Manrope', sans-serif;
    letter-spacing: -0.03em;
}

.nav-menu {
    display: grid;
    gap: 10px;
    margin: 30px 0;
}

.nav-menu a {
    position: relative;
    padding: 15px 16px;
    border-radius: 16px;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    overflow: hidden;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 999px;
    background: transparent;
    transition: background 0.2s ease;
}

.nav-menu a.active,
.nav-menu a:hover {
    background: linear-gradient(135deg, rgba(14, 100, 210, 0.12), rgba(82, 179, 255, 0.24));
    color: var(--primary-dark);
}

.nav-menu a.active::before,
.nav-menu a:hover::before {
    background: linear-gradient(180deg, var(--primary), var(--primary-accent));
}

.sidebar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid rgba(14, 100, 210, 0.1);
}

.sidebar-user-name,
.sidebar-user-role {
    display: block;
}

.sidebar-user-role {
    color: var(--muted);
    font-size: 14px;
}

.main-content {
    margin-left: 344px;
    display: grid;
    gap: 24px;
    min-width: 0;
}

.topbar,
.panel-card {
    padding: 24px;
}

.topbar {
    position: sticky;
    top: 20px;
    z-index: 20;
    background: rgba(255, 255, 255, 0.72);
}

.stats-grid,
.content-grid,
.import-grid,
.summary-grid {
    display: grid;
    gap: 18px;
}

.stats-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stat-card {
    padding: 24px;
}

.interactive-card,
.interactive-chart-row {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.interactive-card:hover,
.interactive-chart-row:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: rgba(12, 105, 220, 0.18);
}

.stat-card span,
.section-heading p,
.table-wrap table td,
.table-wrap table th,
.timeline-card span,
.timeline-card small,
.user-card span,
.user-card small {
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin: 10px 0;
    font-size: 38px;
}

.stat-card.highlighted {
    background: linear-gradient(135deg, rgba(10, 75, 161, 0.98), rgba(12, 105, 220, 0.92), rgba(82, 179, 255, 0.86));
    color: #fff;
}

.stat-card.highlighted span,
.stat-card.highlighted p {
    color: rgba(255, 255, 255, 0.82);
}

.two-columns,
.import-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card {
    padding: 22px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(233, 242, 255, 0.82));
    border: 1px solid rgba(14, 100, 210, 0.1);
    box-shadow: var(--shadow);
}

.summary-card span {
    color: var(--muted);
}

.summary-card strong {
    display: block;
    margin: 10px 0;
    font-size: 34px;
}

.chart-card {
    min-height: 340px;
}

.distribution-chart {
    display: grid;
    gap: 18px;
}

.distribution-row {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(12, 105, 220, 0.06);
}

.distribution-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.distribution-track {
    position: relative;
    height: 14px;
    border-radius: 999px;
    background: rgba(14, 100, 210, 0.08);
    overflow: hidden;
}

.distribution-fill {
    display: block;
    height: 100%;
    min-width: 10px;
    border-radius: inherit;
}

.distribution-new {
    background: linear-gradient(135deg, #0e64d2, #57abff);
}

.distribution-meeting {
    background: linear-gradient(135deg, #109868, #51c78f);
}

.distribution-callback {
    background: linear-gradient(135deg, #ff9f1c, #ffc14d);
}

.distribution-no-answer {
    background: linear-gradient(135deg, #6f88ab, #9fb4d2);
}

.trend-chart {
    height: 250px;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.trend-bar-item {
    display: grid;
    gap: 10px;
    justify-items: center;
    height: 100%;
    padding: 12px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(12, 105, 220, 0.06);
}

.trend-value {
    font-weight: 800;
    color: var(--primary-dark);
}

.trend-bar-track {
    position: relative;
    width: 100%;
    height: 180px;
    display: flex;
    align-items: end;
    justify-content: center;
    border-radius: 18px 18px 8px 8px;
    background: linear-gradient(180deg, rgba(14, 100, 210, 0.05), rgba(14, 100, 210, 0.12));
    padding: 10px;
}

.trend-bar-fill {
    display: block;
    width: 100%;
    border-radius: 12px 12px 6px 6px;
    background: linear-gradient(180deg, #74bcff, #0e64d2);
}

.section-heading,
.split-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.stack-list,
.action-stack {
    display: grid;
    gap: 12px;
}

.table-toolbar {
    display: grid;
    gap: 8px;
    justify-items: end;
}

.column-toggle-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.column-toggle-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.column-toggle-chip {
    border: 1px solid rgba(12, 105, 220, 0.1);
    background: rgba(255, 255, 255, 0.82);
    color: var(--muted);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.column-toggle-chip:hover {
    transform: translateY(-1px);
}

.column-toggle-chip.is-active {
    background: linear-gradient(135deg, rgba(12, 105, 220, 0.14), rgba(82, 179, 255, 0.24));
    color: var(--primary-dark);
    border-color: rgba(12, 105, 220, 0.18);
}

.table-counter {
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 700;
}

.table-wrap {
    overflow: auto;
    max-width: 100%;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(243, 248, 255, 0.92));
    border: 1px solid rgba(12, 105, 220, 0.08);
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

tbody tr {
    transition: background 0.18s ease;
}

tbody tr:hover {
    background: rgba(12, 105, 220, 0.04);
}

.calls-table {
    min-width: 0;
}

.calls-table .col-index {
    width: 52px;
}

.calls-table .col-title {
    width: 20%;
}

.calls-table .col-phone {
    width: 12%;
}

.calls-table .col-status {
    width: 11%;
}

.calls-table .col-plan {
    width: 15%;
}

.calls-table .col-note {
    width: 18%;
}

.calls-table .col-actions {
    width: 24%;
}

.is-hidden-column {
    display: none;
}

th,
td {
    padding: 16px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(14, 100, 210, 0.08);
    vertical-align: top;
    overflow-wrap: anywhere;
}

th {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.subtle-row {
    display: block;
    margin-top: 6px;
    font-size: 13px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.status-new,
.neutral {
    background: rgba(14, 100, 210, 0.12);
    color: var(--primary-dark);
}

.status-meeting {
    background: rgba(20, 152, 102, 0.14);
    color: #0f6b47;
}

.status-callback {
    background: rgba(255, 167, 38, 0.18);
    color: #a05c00;
}

.status-no_answer {
    background: rgba(100, 129, 168, 0.16);
    color: #4f6178;
}

.empty-cell {
    text-align: center;
    color: var(--muted);
    padding: 34px;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(9, 25, 53, 0.42);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 40;
}

.modal.is-open {
    display: flex;
}

.modal-dialog {
    position: relative;
    width: min(560px, 100%);
    padding: 28px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 0;
    background: var(--primary-soft);
    color: var(--primary-dark);
    cursor: pointer;
    font-size: 24px;
}

.users-layout {
    align-items: start;
}

.users-table {
    min-width: 720px;
}

.inline-button {
    width: auto;
    min-width: 104px;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 11px 14px;
    border-radius: 14px;
    background: rgba(14, 100, 210, 0.08);
    color: var(--primary-dark);
    font-weight: 800;
}

.pagination-link.active {
    background: linear-gradient(135deg, var(--primary), #44a2ff);
    color: #fff;
}

.pagination-arrow {
    padding-inline: 16px;
}

.user-card,
.user-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .calls-toolbar-row {
        align-items: stretch;
        flex-direction: column;
    }

    .sidebar {
        position: static;
        width: auto;
        margin-bottom: 24px;
    }

    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 920px) {
    .login-card,
    .two-columns,
    .import-grid,
    .summary-grid,
    .login-meta-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-footer,
    .section-heading,
    .split-heading,
    .table-toolbar,
    .user-card,
    .user-card-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .login-intro,
    .login-form-panel,
    .topbar,
    .panel-card,
    .sidebar {
        padding: 22px;
    }

    .filter-form {
        grid-template-columns: 1fr;
    }

    .calls-toolbar-row,
    .toolbar-button-group,
    .compact-inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .column-toggle-row {
        align-items: flex-start;
    }

    .filter-actions,
    .inline-actions,
    .distribution-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .trend-chart {
        grid-template-columns: repeat(7, minmax(64px, 1fr));
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .calls-table {
        min-width: 760px;
    }
}