* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Inter, Arial, sans-serif;
    background: #f4f7fb;
    color: #0f172a;
}

a {
    color: inherit;
    text-decoration: none;
}

.crm {
    min-height: 100vh;
    display: block;
}


/* LOGIN */

.login-body,
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #071226, #1d4ed8);
    padding: 20px;
}

.login-box,
.auth-card {
    width: 420px;
    max-width: 100%;
    background: #fff;
    border-radius: 22px;
    padding: 34px;
    box-shadow: 0 30px 80px rgba(0,0,0,.25);
}

.login-logo,
.auth-logo {
    font-size: 24px;
    font-weight: 800;
    color: #1d4ed8;
    margin-bottom: 20px;
}

.login-box h1,
.auth-card h1 {
    font-size: 26px;
    margin-bottom: 12px;
}

.auth-card p {
    color: #64748b;
    margin-bottom: 24px;
}

.login-box label,
.auth-card label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    color: #475569;
}

.login-box input,
.auth-card input {
    width: 100%;
    height: 48px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0 14px;
    margin-bottom: 16px;
    font-size: 15px;
}

.login-box button,
.auth-card button {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 12px;
    background: #2563eb;
    color: white;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
}

.alert-error,
.alert-danger,
.alert {
    background: #fee2e2;
    color: #b91c1c;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 16px;
}

/* SIDEBAR */

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0b1730, #071226);
    color: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.logo {
    height: 78px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 800;
}

.logo-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: white;
    color: #2563eb;
}

.nav,
.sidebar-menu {
    flex: 1;
    padding: 12px;
}

.nav a,
.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 15px;
    color: #cbd5e1;
    border-radius: 11px;
    margin-bottom: 5px;
    font-size: 15px;
    transition: .2s;
}

.nav a svg,
.sidebar-menu a svg {
    width: 20px;
    height: 20px;
}

.nav a:hover,
.nav a.active,
.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: linear-gradient(135deg, #1d4ed8, #274690);
    color: white;
}

.sidebar-user {
    border-top: 1px solid rgba(255,255,255,.12);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-avatar {
    width: 38px;
    height: 38px;
    background: #2563eb;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.sidebar-user b {
    display: block;
    font-size: 14px;
}

.sidebar-user span {
    display: block;
    font-size: 12px;
    color: #94a3b8;
}

/* TOPBAR */

.topbar {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    margin-left: 0;
    height: 78px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 50;
}

.topbar-search {
    width: 460px;
    max-width: 100%;
    height: 46px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0 18px;
    font-size: 14px;
    outline: none;
    background: #f8fafc;
}

.topbar-search:focus {
    border-color: #2563eb;
    background: #fff;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #475569;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 17px;
}

.topbar-btn.primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.topbar-btn:hover {
    box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}

/* MAIN */

.main {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
    padding-top: 78px;
    background: #f4f7fb;
}


.content {
    padding: 24px 28px 40px;
    width: 100%;
}

.content h1,
.page-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 22px;
}

/* CARDS */

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
    overflow: hidden;
}

.card-title,
.card-header {
    padding: 20px 22px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title h3,
.card-header h3 {
    font-size: 17px;
    font-weight: 800;
}

.card-body {
    padding: 18px 22px 22px;
}

.muted {
    color: #64748b;
}

/* KPI */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.kpi,
.kpi-card {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.kpi-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 28px;
    flex-shrink: 0;
}

.kpi-icon svg {
    width: 28px;
    height: 28px;
}

.blue-soft,
.kpi-blue {
    background: #dbeafe;
    color: #2563eb;
}

.green-soft,
.kpi-green {
    background: #d1fae5;
    color: #16a34a;
}

.purple-soft,
.kpi-purple {
    background: #ede9fe;
    color: #7c3aed;
}

.orange-soft,
.kpi-orange {
    background: #fef3c7;
    color: #f59e0b;
}

.kpi span,
.kpi-card small {
    display: block;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 6px;
}

.kpi h2,
.kpi-card h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 6px;
}

.green-text,
.up {
    color: #16a34a;
    font-size: 13px;
    font-weight: 600;
}

/* DASHBOARD */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1.25fr .95fr;
    gap: 16px;
    margin-bottom: 16px;
}

.bottom-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr .95fr;
    gap: 16px;
}

.small-select,
.select-small {
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: 9px;
    font-size: 13px;
    color: #64748b;
    background: #fff;
}

/* FUNNEL */

.funnel-layout,
.funnel-wrap {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 14px 24px 26px;
}

.funnel {
    width: 260px;
    flex-shrink: 0;
}

.funnel-step,
.funnel div {
    height: 50px;
    margin: 0 auto 6px;
    clip-path: polygon(8% 0, 92% 0, 82% 100%, 18% 100%);
}

.funnel-list,
.legend {
    flex: 1;
}

.funnel-row,
.legend-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 16px;
    font-size: 13px;
}

.funnel-row span {
    display: flex;
    align-items: center;
    gap: 9px;
}

.funnel-row i,
.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

/* MANAGERS */

.manager-list {
    padding: 8px 20px 18px;
}

.manager-row,
.manager {
    display: grid;
    grid-template-columns: 38px 1fr 130px 100px;
    align-items: center;
    gap: 12px;
    margin-bottom: 17px;
    font-size: 13px;
}

.mini-avatar,
.face {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dbeafe, #93c5fd);
    display: grid;
    place-items: center;
    color: #2563eb;
    font-weight: 800;
}

.manager-info span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-top: 3px;
}

.progress,
.bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
}

.progress span,
.bar span {
    display: block;
    height: 100%;
    background: #2563eb;
}

/* TASKS */

.task-list {
    padding: 4px 0 8px;
}

.task-row,
.task {
    display: grid;
    grid-template-columns: 22px 1fr 48px;
    gap: 10px;
    padding: 13px 18px;
    border-bottom: 1px solid #eef2f7;
    font-size: 13px;
}

.task-row:last-child,
.task:last-child {
    border-bottom: none;
}

.task-check,
.circle {
    width: 15px;
    height: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    margin-top: 2px;
}

.task-row small,
.task small {
    display: block;
    color: #64748b;
    margin-top: 3px;
}

/* ACTIVITY */

.activity-list {
    padding: 8px 0;
}

.activity-row {
    display: grid;
    grid-template-columns: 40px 1fr 55px;
    gap: 12px;
    padding: 13px 18px;
    font-size: 13px;
    border-bottom: 1px solid #eef2f7;
}

.activity-row:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #2563eb;
    background: #dbeafe;
}

.activity-row small {
    display: block;
    color: #64748b;
    margin-top: 3px;
}

/* REVENUE */

.revenue-block,
.revenue-box {
    padding: 0 22px 20px;
}

.revenue-block h2,
.revenue-box h2 {
    font-size: 28px;
    margin-bottom: 18px;
}

.revenue-block h2 span {
    color: #16a34a;
    font-size: 18px;
}

.fake-chart,
.chart-placeholder {
    height: 200px;
    border-radius: 14px;
    background:
        linear-gradient(to top, rgba(37, 99, 235, .13), transparent),
        repeating-linear-gradient(to top, #e5e7eb 0 1px, transparent 1px 40px);
    position: relative;
    overflow: hidden;
}

.chart-line {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 42px;
    height: 110px;
    border-bottom: 4px solid #2563eb;
    transform: skewY(-18deg);
}

/* CLIENTS MINI */

.client-list,
.client-list-mini {
    padding: 4px 0 10px;
}

.client-row,
.client-mini {
    display: grid;
    grid-template-columns: 36px 1fr 60px;
    gap: 10px;
    padding: 12px 18px;
    border-bottom: 1px solid #eef2f7;
    font-size: 13px;
}

.client-row:last-child,
.client-mini:last-child {
    border-bottom: none;
}

.client-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dbeafe;
    color: #2563eb;
    display: grid;
    place-items: center;
}

.client-row small,
.client-mini small {
    display: block;
    color: #64748b;
    margin-top: 3px;
}

.card-link,
.link-center {
    display: block;
    text-align: center;
    padding: 14px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

/* TABLES */

.table-card {
    overflow: hidden;
}

.table-toolbar {
    padding: 18px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
}

.table-search {
    width: 340px;
    height: 42px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 14px;
    outline: none;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb;
}

.table td {
    padding: 15px 18px;
    border-bottom: 1px solid #eef2f7;
    font-size: 14px;
}

.table tr:hover td {
    background: #f8fafc;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-new {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-active {
    background: #dcfce7;
    color: #15803d;
}

.badge-lost {
    background: #fee2e2;
    color: #b91c1c;
}

/* BUTTONS */

.btn {
    border: none;
    border-radius: 10px;
    height: 42px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-light {
    background: #f1f5f9;
    color: #334155;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-sm {
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
}

/* FORMS */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 7px;
    color: #334155;
}

.form-control {
    width: 100%;
    height: 42px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 13px;
    outline: none;
    font-size: 14px;
    background: #fff;
}

textarea.form-control {
    height: 100px;
    padding-top: 12px;
    resize: vertical;
}

.form-control:focus {
    border-color: #2563eb;
}

/* MODAL */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    width: 680px;
    max-width: 100%;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .25);
    overflow: hidden;
}

.modal-header {
    height: 66px;
    padding: 0 22px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    border: none;
    background: #f1f5f9;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
}

.modal-body {
    padding: 22px;
}

.modal-footer {
    padding: 16px 22px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* RESPONSIVE */

@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid,
    .bottom-grid {
        grid-template-columns: 1fr;
    }

    .manager-row,
    .manager {
        grid-template-columns: 38px 1fr;
    }

    .manager-row .progress,
    .manager-row > b,
    .manager .bar,
    .manager > b {
        display: none;
    }
}

@media (max-width: 800px) {
    .sidebar {
        display: none;
    }

    .topbar,
    .main {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        padding: 0 16px;
    }

    .topbar-actions {
        display: none;
    }

    .content {
        padding: 20px 16px 32px;
    }

    .kpi-grid,
    .dashboard-grid,
    .bottom-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .funnel-layout,
    .funnel-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .funnel {
        width: 100%;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .table-search {
        width: 100%;
    }

    .table {
        min-width: 760px;
    }

    .table-card {
        overflow-x: auto;
    }
}


.menu-group {
    margin-bottom: 6px;
}

.menu-parent {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 15px;
    color: #cbd5e1;
    border-radius: 11px;
    cursor: pointer;
}

.menu-parent.active,
.menu-parent:hover {
    background: linear-gradient(135deg, #1d4ed8, #274690);
    color: white;
}

.menu-child {
    display: none;
    padding-left: 40px;
}

.menu-child a {
    display: block;
    padding: 10px 0;
    font-size: 14px;
    color: #94a3b8;
}

.menu-child a.active,
.menu-child a:hover {
    color: white;
}

.menu-group.open .menu-child {
    display: block;
}

.arrow {
    font-size: 12px;
    transition: 0.2s;
}

.menu-group.open .arrow {
    transform: rotate(180deg);
}


.parser-log {
    height: 280px;
    overflow-y: auto;
    background: #0b1220;
    color: #dbeafe;
    border-radius: 14px;
    padding: 14px;
    font-family: Consolas, monospace;
    font-size: 13px;
}

.parser-row {
    display: grid;
    grid-template-columns: 150px 90px 1fr;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.parser-row span {
    color: #93c5fd;
}

.parser-row b {
    text-transform: uppercase;
}

.parser-success b {
    color: #22c55e;
}

.parser-error b {
    color: #ef4444;
}

.parser-warning b {
    color: #f59e0b;
}

.parser-skip b {
    color: #94a3b8;
}

.parser-done b {
    color: #38bdf8;
}


.parser-details {
    margin-top: 6px;
    padding: 8px 10px;
    background: rgba(255,255,255,.06);
    border-radius: 8px;
    color: #bfdbfe;
    white-space: pre-wrap;
    overflow-x: auto;
    font-size: 12px;
}

.parser-debug b {
    color: #a78bfa;
}

.parser-step b {
    color: #60a5fa;
}