* {
    box-sizing: border-box;
}

:root {
    --ink: #07101f;
    --navy: #0b1530;
    --blue: #123b74;
    --violet: #7057ff;
    --cyan: #2fd4ff;
    --coral: #f4866a;
    --paper: #f5f7fb;
    --card: #ffffff;
    --line: #e3eaf5;
    --muted: #667085;
    --green: #18a06f;
    --red: #d94747;
    --amber: #d48a1f;
}

body {
    background: var(--paper);
    color: #172134;
    font-family: "Lexend", Arial, sans-serif;
    letter-spacing: 0;
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

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

input,
select,
textarea {
    background: #f8fbff;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: #172134;
    min-height: 44px;
    padding: 11px 12px;
    width: 100%;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

button {
    cursor: pointer;
}

.at-login {
    align-items: center;
    background:
        radial-gradient(circle at 82% 12%, rgb(112 87 255 / 28%), transparent 28%),
        radial-gradient(circle at 18% 82%, rgb(47 212 255 / 20%), transparent 28%),
        linear-gradient(135deg, #07101f, #101a3b 54%, #123b74);
    display: flex;
    min-height: 100vh;
    padding: 24px;
}

.at-login-card {
    background: rgb(255 255 255 / 96%);
    border: 1px solid rgb(255 255 255 / 45%);
    border-radius: 24px;
    box-shadow: 0 34px 120px rgb(0 0 0 / 35%);
    margin: auto;
    max-width: 480px;
    padding: 42px;
    width: 100%;
}

.at-login-card h1 {
    color: var(--navy);
    font-size: 36px;
    line-height: 1.08;
    margin: 26px 0 12px;
}

.at-login-card p,
.at-muted,
.at-section-head p,
.at-card p {
    color: var(--muted);
    line-height: 1.65;
}

.at-login-logo,
.at-brand {
    color: var(--ink);
    display: block;
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
}

.at-login-logo span,
.at-brand span {
    color: var(--coral);
    display: block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-top: 8px;
    text-transform: uppercase;
}

.at-login-card form,
.at-form,
.at-grid-form,
.at-stack {
    display: grid;
    gap: 14px;
}

.at-alert {
    background: #fff0ed;
    border: 1px solid #ffd1c6;
    border-radius: 14px;
    color: #9b3929;
    margin: 18px 0;
    padding: 12px 14px;
}

.at-success {
    background: #e9fbf4;
    border: 1px solid #a7ebcf;
    border-radius: 14px;
    color: #0b6d45;
    margin: 0 0 14px;
    padding: 12px 14px;
}

.at-app {
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
    min-height: 100vh;
}

.at-sidebar {
    background:
        radial-gradient(circle at 80% 0%, rgb(112 87 255 / 24%), transparent 30%),
        linear-gradient(180deg, #07101f, #101a3b);
    color: #fff;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 26px;
    position: sticky;
    top: 0;
}

.at-sidebar .at-brand {
    color: #fff;
    margin-bottom: 28px;
}

.at-sidebar nav {
    display: grid;
    gap: 8px;
}

.at-sidebar nav a,
.at-profile a {
    border-radius: 14px;
    color: #d8e2f4;
    display: block;
    font-size: 14px;
    font-weight: 700;
    padding: 13px 14px;
}

.at-sidebar nav a.active,
.at-sidebar nav a:hover {
    background: rgb(255 255 255 / 11%);
    color: #fff;
}

.at-sidebar nav a.active {
    box-shadow: inset 4px 0 0 var(--coral);
}

.at-profile {
    background: rgb(255 255 255 / 8%);
    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: 18px;
    display: grid;
    gap: 5px;
    margin-top: auto;
    padding: 16px;
}

.at-profile strong {
    color: #fff;
}

.at-profile span {
    color: var(--cyan);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.at-profile a {
    background: #fff;
    color: var(--navy);
    margin-top: 8px;
    text-align: center;
}

.at-main {
    display: grid;
    gap: 24px;
    padding: 26px;
}

.at-topbar,
.at-card,
.at-section,
.at-kpi,
.at-table-card,
.at-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 16px 44px rgb(11 21 48 / 6%);
}

.at-topbar {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 20px 22px;
}

.at-topbar span,
.at-section-head span,
.at-card-head span,
.at-small-label {
    color: var(--coral);
    display: block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.at-topbar h1,
.at-section-head h2,
.at-card-head h2 {
    color: var(--navy);
    font-size: 34px;
    line-height: 1.1;
    margin: 0;
}

.at-top-actions {
    align-items: center;
    display: flex;
    gap: 10px;
}

.at-primary,
.at-ghost,
.at-danger,
.at-app button,
.at-login-card button {
    align-items: center;
    border: 0;
    border-radius: 12px;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    min-height: 42px;
    padding: 11px 16px;
}

.at-primary,
.at-app button,
.at-login-card button {
    background: linear-gradient(135deg, var(--coral), #ff9e7d);
    box-shadow: 0 12px 28px rgb(244 134 106 / 22%);
    color: #fff;
}

.at-ghost {
    background: #eef3fa;
    color: var(--navy);
}

.at-danger {
    background: #fff0ed;
    color: var(--red);
}

.at-menu {
    display: none;
}

.at-filter,
.at-kpi-grid,
.at-chart-grid,
.at-two-col,
.at-three-col,
.at-pipeline,
.at-form-grid {
    display: grid;
    gap: 16px;
}

.at-filter {
    align-items: end;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.at-filter label,
.at-field {
    display: grid;
    gap: 7px;
}

.at-filter label span,
.at-field span {
    color: #475467;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.at-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.at-kpi {
    padding: 20px;
}

.at-kpi span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.at-kpi strong {
    color: var(--navy);
    display: block;
    font-size: 30px;
    margin: 8px 0;
}

.at-kpi small {
    color: var(--muted);
}

.at-section,
.at-card,
.at-table-card,
.at-panel {
    padding: 22px;
}

.at-hero-panel {
    background:
        radial-gradient(circle at 88% 14%, rgb(47 212 255 / 18%), transparent 30%),
        linear-gradient(135deg, #ffffff, #f8fbff);
}

.at-section-head,
.at-card-head {
    margin-bottom: 20px;
}

.at-chart-grid {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.45fr);
}

.at-two-col {
    align-items: start;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.42fr);
}

.at-three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.at-bar-list,
.at-mini-list {
    display: grid;
    gap: 13px;
}

.at-bar-row {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 140px minmax(160px, 1fr) 104px;
}

.at-bar-row label {
    color: #344057;
    font-size: 13px;
    font-weight: 800;
}

.at-bar-row div {
    background: #edf3fa;
    border-radius: 999px;
    height: 13px;
    overflow: hidden;
}

.at-bar-row i {
    background: linear-gradient(90deg, var(--violet), var(--cyan));
    border-radius: inherit;
    display: block;
    height: 100%;
    min-width: 4px;
}

.at-bar-row strong {
    color: var(--navy);
    font-size: 13px;
    text-align: right;
}

.at-pipeline {
    grid-template-columns: repeat(5, minmax(210px, 1fr));
    overflow-x: auto;
    padding-bottom: 6px;
}

.at-stage {
    background: #f8fbff;
    border: 1px solid var(--line);
    border-radius: 18px;
    min-height: 220px;
    padding: 14px;
}

.at-stage header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.at-stage header strong {
    color: var(--navy);
}

.at-stage header span,
.at-badge {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--coral);
    font-size: 12px;
    font-weight: 800;
    padding: 5px 10px;
}

.at-deal-card,
.at-mini-list > div {
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 16px;
    display: grid;
    gap: 7px;
    margin-bottom: 10px;
    padding: 14px;
}

.at-deal-card strong,
.at-mini-list strong,
.at-table-card strong {
    color: var(--navy);
}

.at-deal-card span,
.at-mini-list span {
    color: var(--muted);
    font-size: 13px;
}

.at-deal-card a {
    color: var(--coral);
    font-size: 13px;
    font-weight: 800;
}

.at-doc-link {
    color: var(--blue);
    font-size: 13px;
    font-weight: 800;
}

.at-metric-card span {
    color: var(--coral);
    display: block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.at-metric-card strong {
    color: var(--navy);
    display: block;
    font-size: 34px;
    margin-bottom: 10px;
}

.at-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.at-table-wrap {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    min-width: 980px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid #edf2f7;
    padding: 14px;
    text-align: left;
    vertical-align: top;
}

th {
    color: #475467;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

td {
    color: #344057;
}

td small {
    color: var(--muted);
    display: block;
    font-size: 12px;
    line-height: 1.5;
    margin-top: 5px;
}

.at-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.at-status-new {
    color: var(--blue);
}

.at-status-lead,
.at-status-opportunity {
    color: var(--amber);
}

.at-status-sale,
.at-status-paid,
.at-status-active {
    color: var(--green);
}

.at-status-lost,
.at-status-overdue {
    color: var(--red);
}

.at-note {
    background: #f8fbff;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--muted);
    line-height: 1.65;
    padding: 14px;
}

.at-footer {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 13px;
    gap: 12px;
    justify-content: space-between;
    padding: 8px 4px 20px;
}

@media (max-width: 1180px) {
    .at-app {
        grid-template-columns: 250px minmax(0, 1fr);
    }

    .at-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .at-filter,
    .at-chart-grid,
    .at-two-col,
    .at-three-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .at-app {
        grid-template-columns: 1fr;
    }

    .at-sidebar {
        bottom: 0;
        box-shadow: 18px 0 60px rgb(0 0 0 / 24%);
        height: 100vh;
        left: 0;
        max-width: 310px;
        position: fixed;
        top: 0;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        width: 86%;
        z-index: 20;
    }

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

    .at-menu {
        display: inline-flex;
    }

    .at-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .at-top-actions,
    .at-top-actions a {
        width: 100%;
    }

    .at-form-grid,
    .at-kpi-grid,
    .at-bar-row {
        grid-template-columns: 1fr;
    }

    .at-main,
    .at-section,
    .at-card,
    .at-table-card {
        padding: 18px;
    }

    .at-topbar h1,
    .at-section-head h2,
    .at-card-head h2 {
        font-size: 28px;
    }
}

/* Panelix-inspired premium CRM shell */
:root {
    --panel-purple: #6d38f5;
    --panel-purple-2: #8f63ff;
    --panel-purple-soft: #eee7ff;
    --panel-blue: #5d64ff;
    --panel-orange: #ff9800;
    --panel-cyan: #00b9d6;
    --panel-border: #dfe7f2;
    --panel-text: #1c2638;
    --panel-muted: #8190aa;
    --panel-bg: #f6f8fb;
}

body {
    background: var(--panel-bg);
    color: var(--panel-text);
}

.at-app {
    grid-template-columns: 260px minmax(0, 1fr);
}

.at-sidebar {
    background: #ffffff;
    border-right: 1px solid var(--panel-border);
    color: var(--panel-text);
    padding: 18px 8px;
}

.at-sidebar .at-brand {
    align-items: center;
    color: var(--panel-text);
    display: flex;
    font-size: 24px;
    gap: 12px;
    margin: 0 10px 32px;
}

.at-sidebar .at-brand:before {
    align-items: center;
    background: linear-gradient(135deg, var(--panel-purple), var(--panel-purple-2));
    border-radius: 12px;
    color: #fff;
    content: "A";
    display: inline-flex;
    flex: 0 0 40px;
    font-size: 20px;
    height: 40px;
    justify-content: center;
}

.at-sidebar .at-brand span {
    display: none;
}

.at-sidebar nav {
    gap: 6px;
}

.at-sidebar nav:before,
.at-sidebar nav:after {
    color: #98a6bc;
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 12px 12px 6px;
    text-transform: uppercase;
}

.at-sidebar nav:before {
    content: "Main";
}

.at-sidebar nav a,
.at-profile a {
    border-radius: 8px;
    color: #3d4b63;
    font-size: 14px;
    margin: 0;
    padding: 12px 18px 12px 56px;
    position: relative;
}

.at-sidebar nav a:before {
    color: #98a6bc;
    content: "•";
    font-size: 22px;
    left: 28px;
    position: absolute;
    top: 7px;
}

.at-sidebar nav a.active,
.at-sidebar nav a:hover {
    background: var(--panel-purple-soft);
    box-shadow: none;
    color: var(--panel-purple);
}

.at-sidebar nav a.active:before,
.at-sidebar nav a:hover:before {
    color: var(--panel-purple);
}

.at-profile {
    background: #f8faff;
    border-color: var(--panel-border);
    color: var(--panel-text);
    margin: auto 12px 8px;
}

.at-profile strong {
    color: var(--panel-text);
}

.at-profile span {
    color: var(--panel-purple);
}

.at-profile a {
    background: var(--panel-purple-soft);
    color: var(--panel-purple);
    padding: 10px 12px;
}

.at-main {
    gap: 24px;
    padding: 16px 24px 24px;
}

.at-topbar {
    background: #ffffff;
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    border-top: 0;
    box-shadow: none;
    margin: -16px -24px 4px;
    padding: 16px 24px;
}

.at-topbar h1 {
    font-size: 30px;
}

.at-topbar span {
    color: #8390a7;
    font-size: 13px;
    letter-spacing: 0;
    margin: 8px 0 0;
    text-transform: none;
}

.at-menu,
.at-top-actions .at-ghost {
    background: #f6f8fb;
    border: 1px solid var(--panel-border);
    color: #526079;
}

.at-primary,
.at-app button,
.at-login-card button {
    background: linear-gradient(135deg, var(--panel-purple), #7434db);
    box-shadow: 0 10px 24px rgb(109 56 245 / 20%);
}

.at-card,
.at-section,
.at-kpi,
.at-table-card,
.at-panel {
    border-color: var(--panel-border);
    border-radius: 12px;
    box-shadow: 0 8px 22px rgb(32 46 73 / 5%);
}

.at-dashboard-control {
    padding: 18px;
}

.at-filter {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.at-card-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.at-card-head h2 {
    color: #2e2bd9;
    font-size: 18px;
}

.at-card-head span {
    background: var(--panel-purple-soft);
    border-radius: 999px;
    color: var(--panel-purple);
    letter-spacing: 0;
    margin: 0;
    padding: 6px 12px;
    text-transform: none;
}

.at-panelix-kpis .at-kpi {
    border-top: 3px solid var(--panel-purple);
    display: grid;
    gap: 8px;
    min-height: 192px;
    padding: 22px;
}

.at-panelix-kpis .at-kpi i {
    align-items: center;
    background: var(--panel-purple-soft);
    border-radius: 10px;
    color: var(--panel-purple);
    display: inline-flex;
    font-style: normal;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.at-panelix-kpis .at-kpi strong {
    font-size: 30px;
    margin: 6px 0 0;
}

.at-panelix-kpis .at-kpi span {
    color: #8190aa;
    font-size: 14px;
    text-transform: none;
}

.at-panelix-kpis .at-kpi small {
    align-items: center;
    color: var(--panel-purple);
    display: flex;
    font-weight: 800;
    justify-content: space-between;
}

.at-panelix-kpis .at-kpi small em {
    color: var(--panel-blue);
    font-style: normal;
}

.at-panelix-kpis .accent-violet {
    border-top-color: #a079ff;
}

.at-panelix-kpis .accent-orange {
    border-top-color: var(--panel-orange);
}

.at-panelix-kpis .accent-orange i {
    background: #fff6df;
    color: var(--panel-orange);
}

.at-panelix-kpis .accent-cyan {
    border-top-color: var(--panel-cyan);
}

.at-panelix-kpis .accent-cyan i {
    background: #e7fcff;
    color: var(--panel-cyan);
}

.at-panelix-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.48fr);
}

.at-deal-widget-body {
    align-items: center;
    display: grid;
    gap: 28px;
    grid-template-columns: 1fr 1fr;
    min-height: 360px;
}

.at-pipeline-gauge {
    align-items: end;
    display: flex;
    height: 210px;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.at-pipeline-gauge span {
    --size: var(--gauge);
    border: 16px solid #eaf0ff;
    border-bottom: 0;
    border-radius: 999px 999px 0 0;
    bottom: 0;
    height: var(--size);
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    width: calc(var(--size) * 1.9);
}

.at-pipeline-gauge span:nth-child(1),
.at-pipeline-gauge span:nth-child(2),
.at-pipeline-gauge span:nth-child(3) {
    border-left-color: #a78bfa;
    border-top-color: #7c58f4;
}

.at-pipeline-gauge span:nth-child(4),
.at-pipeline-gauge span:nth-child(5) {
    border-left-color: #3f37d6;
    border-top-color: #5d64ff;
}

.at-stage-list {
    display: grid;
    gap: 8px;
}

.at-stage-list > div {
    align-items: center;
    background: #fff;
    border: 1px solid var(--panel-border);
    border-left: 4px solid var(--panel-purple-2);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    padding: 13px 16px;
}

.at-stage-list small {
    color: var(--panel-muted);
    display: block;
    font-size: 12px;
    margin-top: 5px;
}

.at-stage-list b {
    color: var(--panel-blue);
    font-size: 18px;
}

.at-source-list,
.at-follow-list,
.at-team-bars {
    display: grid;
    gap: 10px;
}

.at-source-row {
    align-items: center;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    display: grid;
    gap: 14px;
    grid-template-columns: 48px 1fr;
    padding: 14px;
}

.at-source-row i,
.at-follow-list i {
    align-items: center;
    background: #eff4ff;
    border-radius: 10px;
    color: var(--panel-purple);
    display: inline-flex;
    font-style: normal;
    font-weight: 800;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.at-source-row strong {
    align-items: center;
    color: var(--panel-text);
    display: flex;
    justify-content: space-between;
}

.at-source-row b {
    color: var(--panel-blue);
    font-size: 13px;
}

.at-source-row span {
    background: #eef2fb;
    border-radius: 999px;
    display: block;
    height: 6px;
    margin-top: 8px;
    overflow: hidden;
}

.at-source-row em {
    background: linear-gradient(90deg, var(--panel-purple), var(--panel-purple-2));
    border-radius: inherit;
    display: block;
    height: 100%;
}

.at-team-row {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 110px 1fr;
}

.at-team-row label {
    color: #3d4b63;
    font-weight: 800;
}

.at-team-row span {
    align-items: center;
    display: flex;
    gap: 0;
}

.at-team-row i,
.at-team-row em {
    display: block;
    height: 16px;
}

.at-team-row i {
    background: #5d64ff;
    border-radius: 8px 0 0 8px;
    min-width: 5px;
}

.at-team-row em {
    background: #a579f7;
    border-radius: 0 8px 8px 0;
    min-width: 5px;
}

.at-trend-visual {
    background-image:
        linear-gradient(#edf2fb 1px, transparent 1px),
        linear-gradient(90deg, #edf2fb 1px, transparent 1px);
    background-size: 25% 25%;
    border-radius: 12px;
    padding: 16px;
}

.at-trend-visual svg {
    display: block;
    height: 250px;
    width: 100%;
}

.at-trend-visual path {
    fill: none;
    stroke-linecap: round;
    stroke-width: 4;
}

.at-trend-visual .line-a {
    stroke: #3f37d6;
}

.at-trend-visual .line-b {
    stroke: #5d64ff;
}

.at-trend-visual .line-c {
    stroke: #8f63ff;
}

.at-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-top: 16px;
}

.at-legend span {
    align-items: center;
    color: #526079;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    gap: 6px;
}

.at-legend i,
.at-legend em,
.at-legend b {
    background: #5d64ff;
    display: inline-block;
    height: 10px;
    width: 10px;
}

.at-legend em {
    background: #a579f7;
}

.at-legend b {
    background: #8f63ff;
}

.at-follow-list > div {
    align-items: center;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    display: grid;
    gap: 12px;
    grid-template-columns: 46px 1fr auto;
    padding: 12px;
}

.at-follow-list strong {
    display: grid;
    gap: 4px;
}

.at-follow-list small {
    color: var(--panel-muted);
}

.at-follow-list span {
    color: var(--panel-purple);
    font-size: 12px;
    font-weight: 800;
}

.at-table-card table {
    min-width: 760px;
}

th {
    color: #2e2bd9;
}

@media (max-width: 1180px) {
    .at-panelix-grid,
    .at-deal-widget-body {
        grid-template-columns: 1fr;
    }
}
