:root {
    --bg: #f4f6fb;
    --panel: #ffffff;
    --text: #182230;
    --muted: #667085;
    --border: #dfe5ef;
    --primary: #2457e6;
    --primary-dark: #1947c8;
    --sidebar: #101828;
    --sidebar-soft: #1d2939;
    --sidebar-text: #d0d5dd;
    --danger: #d92d20;
    --danger-soft: #fff1f0;
    --success: #039855;
    --shadow: 0 12px 30px rgba(16, 24, 40, 0.07);
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
    margin: 0;
}

/* ==========================================================
   AUTH PAGES
========================================================== */

.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(36, 87, 230, 0.14), transparent 32%),
        radial-gradient(circle at bottom right, rgba(16, 24, 40, 0.10), transparent 28%),
        var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.auth-wrapper {
    width: 100%;
    max-width: 480px;
}

.auth-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.login-card {
    max-width: 450px;
    margin: auto;
}

.admin-create-card {
    max-width: 520px;
    margin: auto;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 18px;
}

.brand-badge {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), #5b7cff);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 24px rgba(36, 87, 230, 0.24);
}

.auth-brand h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}

.auth-brand p {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.form-row-inline {
    display: grid;
    grid-template-columns: 105px 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.form-row-inline label {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: #344054;
}

.compact-input {
    min-height: 34px;
    height: 34px;
    border-radius: 9px;
    border-color: var(--border);
    font-size: 13px;
    box-shadow: none !important;
}

.compact-input:focus {
    border-color: var(--primary);
}

.compact-btn {
    height: 38px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    background: var(--primary);
    border-color: var(--primary);
}

.compact-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.compact-alert {
    padding: 10px 12px;
    font-size: 12.5px;
    border-radius: 10px;
}

.auth-footer-note {
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    margin-top: 15px;
}

/* ==========================================================
   APP SHELL
========================================================== */

.app-body {
    min-height: 100vh;
    background: var(--bg);
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.app-sidebar {
    width: 248px;
    min-width: 248px;
    background: var(--sidebar);
    color: var(--sidebar-text);
    transition: all 0.25s ease;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    min-height: 70px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 13px 14px;
    display: flex;
    align-items: center;
    gap: 11px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4169ff, #2148d9);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
}

.sidebar-brand-text h2 {
    margin: 0;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
}

.sidebar-brand-text small {
    color: #98a2b3;
    font-size: 11px;
    white-space: nowrap;
}

.sidebar-menu {
    padding: 12px 10px 18px;
}

.menu-title {
    padding: 8px 10px 5px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #667085;
    white-space: nowrap;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--sidebar-text);
    padding: 9px 10px;
    min-height: 38px;
    border-radius: 10px;
    margin-bottom: 3px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.18s ease;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar-link.active {
    background: linear-gradient(135deg, #2457e6, #4a72f4);
    color: #fff;
    box-shadow: 0 10px 20px rgba(36, 87, 230, 0.25);
}

.sidebar-link.muted-link {
    opacity: 0.82;
}

.menu-icon {
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.menu-text {
    white-space: nowrap;
}

.app-main {
    flex: 1;
    min-width: 0;
}

.app-topbar {
    height: 70px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.18s ease;
}

.sidebar-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.page-title-wrap h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
}

.page-title-wrap small {
    color: var(--muted);
    font-size: 11.5px;
}

.user-chip {
    height: 38px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 12px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
}

.user-chip small {
    background: #eef4ff;
    color: var(--primary);
    border-radius: 999px;
    padding: 3px 7px;
    font-size: 10px;
    font-weight: 800;
}

.user-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.logout-btn {
    height: 38px;
    padding: 0 13px;
    border-radius: 11px;
    background: #fff;
    border: 1px solid var(--border);
    text-decoration: none;
    color: #344054;
    display: inline-flex;
    align-items: center;
    font-size: 12.5px;
    font-weight: 800;
    transition: all 0.18s ease;
}

.logout-btn:hover {
    color: var(--danger);
    border-color: rgba(217, 45, 32, 0.35);
    background: #fff5f4;
}

.content-area {
    padding: 16px 18px 26px;
}

/* ==========================================================
   DASHBOARD
========================================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 12px;
}

.telecaller-grid {
    grid-template-columns: repeat(5, minmax(170px, 1fr));
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 14px 15px;
    box-shadow: 0 8px 22px rgba(16, 24, 40, 0.05);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-card h3 {
    margin: 0;
    font-size: 27px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.stat-card small {
    display: block;
    margin-top: 3px;
    color: #667085;
    font-size: 11.5px;
}

.danger-card {
    border-color: #ffd7d3;
    background: linear-gradient(180deg, #fff, var(--danger-soft));
}

.danger-card h3 {
    color: var(--danger);
}

.panel-grid {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr;
    gap: 12px;
}

.content-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 15px;
    box-shadow: 0 8px 22px rgba(16, 24, 40, 0.05);
    padding: 14px;
}

.panel-head {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}

.panel-head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 850;
}

.module-list {
    display: grid;
    gap: 9px;
}

.module-item {
    border: 1px solid var(--border);
    background: #fbfcfe;
    border-radius: 12px;
    padding: 10px 11px;
}

.module-item strong {
    display: block;
    font-size: 12.5px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 3px;
}

.module-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.compact-note-panel p {
    font-size: 13px;
    color: #475467;
    line-height: 1.55;
    margin: 0;
}

/* ==========================================================
   SIDEBAR COLLAPSED
========================================================== */

.app-shell.sidebar-collapsed .app-sidebar {
    width: 76px;
    min-width: 76px;
}

.app-shell.sidebar-collapsed .sidebar-brand-text,
.app-shell.sidebar-collapsed .menu-title,
.app-shell.sidebar-collapsed .menu-text {
    display: none;
}

.app-shell.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.app-shell.sidebar-collapsed .sidebar-menu {
    padding-left: 8px;
    padding-right: 8px;
}

.app-shell.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width: 1200px) {
    .dashboard-grid,
    .telecaller-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .panel-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        left: -260px;
        z-index: 50;
        transition: left 0.25s ease;
    }

    .app-shell.sidebar-collapsed .app-sidebar {
        left: 0;
        width: 248px;
        min-width: 248px;
    }

    .app-shell.sidebar-collapsed .sidebar-brand-text,
    .app-shell.sidebar-collapsed .menu-title,
    .app-shell.sidebar-collapsed .menu-text {
        display: block;
    }

    .app-shell.sidebar-collapsed .sidebar-brand {
        justify-content: flex-start;
        padding: 13px 14px;
    }

    .app-shell.sidebar-collapsed .sidebar-link {
        justify-content: flex-start;
        padding: 9px 10px;
    }

    .app-topbar {
        padding: 11px 12px;
    }

    .content-area {
        padding: 13px;
    }

    .topbar-right .user-chip {
        display: none;
    }

    .dashboard-grid,
    .telecaller-grid {
        grid-template-columns: 1fr;
    }

    .form-row-inline {
        grid-template-columns: 1fr;
        gap: 5px;
    }
}
/* ==========================================================
   TELECALLER MANAGEMENT PAGE
========================================================== */

.small-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(170px, 240px));
    gap: 12px;
}

.mini-stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 13px 15px;
    box-shadow: 0 8px 22px rgba(16, 24, 40, 0.05);
}

.mini-stat-card span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 4px;
}

.mini-stat-card h3 {
    margin: 0;
    font-size: 26px;
    font-weight: 900;
}

.success-mini {
    background: linear-gradient(180deg, #fff, #f0fff7);
    border-color: #c7efd9;
}

.success-mini h3 {
    color: #039855;
}

.danger-mini {
    background: linear-gradient(180deg, #fff, #fff3f2);
    border-color: #ffd3cf;
}

.danger-mini h3 {
    color: #d92d20;
}

.telecaller-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 12px;
    align-items: start;
}

.compact-field-row {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 10px;
    align-items: center;
}

.compact-field-row label {
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    color: #344054;
}

.single-column-form {
    display: grid;
    gap: 10px;
}

.table-count-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
}

.compact-table-wrap {
    border: 1px solid var(--border);
    border-radius: 13px;
    overflow: hidden;
}

.compact-data-table {
    margin: 0;
    font-size: 12px;
}

.compact-data-table thead th {
    background: #f7f9fc;
    color: #344054;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
    padding: 10px 10px;
    white-space: nowrap;
}

.compact-data-table tbody td {
    padding: 9px 10px;
    border-color: #edf1f6;
    color: #344054;
    white-space: nowrap;
}

.compact-data-table tbody tr:hover {
    background: #fbfcff;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.active-badge {
    background: #ecfdf3;
    color: #027a48;
    border: 1px solid #abefc6;
}

.inactive-badge {
    background: #fef3f2;
    color: #b42318;
    border: 1px solid #fecdca;
}

.table-action-row {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.tiny-btn {
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    border: 1px solid transparent;
}

.edit-btn {
    background: #eef4ff;
    color: #2457e6;
    border-color: #c9d7ff;
}

.reset-btn {
    background: #f4f3ff;
    color: #5925dc;
    border-color: #d9d6fe;
}

.deactivate-btn {
    background: #fff4f3;
    color: #d92d20;
    border-color: #fecdca;
}

.activate-btn {
    background: #ecfdf3;
    color: #027a48;
    border-color: #abefc6;
}

.empty-row {
    padding: 25px !important;
    font-size: 13px;
    color: var(--muted) !important;
}

.compact-modal .modal-content {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(16, 24, 40, 0.20);
}

.compact-modal .modal-header,
.compact-modal .modal-footer {
    border-color: var(--border);
    padding: 14px 16px;
}

.compact-modal .modal-body {
    padding: 16px;
}

.compact-modal .modal-title {
    font-size: 15px;
    font-weight: 900;
}

.compact-btn-alt {
    min-height: 36px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    padding-left: 14px;
    padding-right: 14px;
}

.small-helper-note {
    background: #f8fafc;
    border: 1px solid var(--border);
    color: #475467;
    padding: 10px 12px;
    border-radius: 11px;
    font-size: 12px;
}

@media (max-width: 1200px) {
    .telecaller-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .small-stats-grid {
        grid-template-columns: 1fr;
    }

    .compact-field-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .compact-data-table {
        min-width: 900px;
    }
}
/* ==========================================================
   CUSTOM FIELDS + IMPORT DATA PAGE
========================================================== */

.import-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 12px;
    align-items: start;
}

.upload-dropbox {
    border: 1.5px dashed #c7d2e5;
    background: #f8fbff;
    border-radius: 15px;
    padding: 18px;
    text-align: center;
    position: relative;
}

.upload-dropbox input[type="file"] {
    width: 100%;
    font-size: 12px;
    color: #475467;
}

.upload-dropbox label {
    display: block;
    margin-top: 12px;
}

.upload-dropbox label strong {
    display: block;
    font-size: 14px;
    font-weight: 900;
    color: #182230;
}

.upload-dropbox label span {
    display: block;
    font-size: 12px;
    color: #667085;
    margin-top: 3px;
}

.import-summary-grid {
    display: grid;
    grid-template-columns: 1.6fr 0.7fr 0.7fr;
    gap: 10px;
}

.import-summary-card {
    min-height: 67px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fbfcff;
    padding: 11px 12px;
}

.import-summary-card span {
    display: block;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 800;
    margin-bottom: 4px;
}

.import-summary-card strong {
    display: block;
    font-size: 13px;
    font-weight: 900;
    color: #182230;
    word-break: break-word;
}

.columns-chip-wrap {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.column-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef4ff;
    border: 1px solid #c9d7ff;
    color: #2457e6;
    font-size: 11px;
    font-weight: 800;
}

.column-chip b {
    min-width: 21px;
    height: 21px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2457e6;
    color: #fff;
    font-size: 10px;
}

.panel-subheading {
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 900;
    color: #344054;
}

.preview-data-table {
    min-width: 900px;
}

.preview-data-table thead th {
    vertical-align: top;
}

.preview-data-table thead th small {
    display: block;
    color: #667085;
    font-size: 10px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    margin-top: 2px;
}

.preview-data-table tbody td {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-preview-box {
    min-height: 270px;
    border: 1.5px dashed var(--border);
    background: #fbfcfe;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #667085;
    text-align: center;
    padding: 24px;
}

.empty-preview-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.empty-preview-box strong {
    display: block;
    color: #344054;
    font-size: 15px;
    font-weight: 900;
}

.empty-preview-box span {
    display: block;
    font-size: 12.5px;
    margin-top: 4px;
}

.disabled-next-step {
    opacity: 0.65;
    pointer-events: none;
}

@media (max-width: 1200px) {
    .import-layout {
        grid-template-columns: 1fr;
    }

    .import-summary-grid {
        grid-template-columns: 1fr;
    }
}