:root {
    --bg: #f4f5f3;
    --bg-elevated: #fafaf8;
    --panel: #ffffff;
    --ink: #121714;
    --ink-soft: #3d4740;
    --muted: #6b756f;
    --line: #e4e7e2;
    --line-strong: #d3d8d1;
    --sidebar: #0e1511;
    --sidebar-hover: rgba(255, 255, 255, 0.05);
    --sidebar-active: rgba(46, 184, 96, 0.14);
    --accent: #1f9d4d;
    --accent-hover: #188740;
    --accent-soft: #edf8f0;
    --accent-ring: rgba(31, 157, 77, 0.18);
    --warn: #b45309;
    --warn-soft: #fff7ed;
    --danger: #c0352b;
    --danger-soft: #fef2f1;
    --info: #0f766e;
    --info-soft: #f0fdfa;
    --shadow-xs: 0 1px 2px rgba(18, 23, 20, 0.04);
    --shadow-sm: 0 1px 2px rgba(18, 23, 20, 0.04), 0 4px 12px rgba(18, 23, 20, 0.04);
    --shadow-md: 0 8px 24px rgba(18, 23, 20, 0.06);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 18px;
    --font: "Manrope", "Segoe UI", sans-serif;
    --display: "Sora", "Manrope", sans-serif;
    --fw-semibold: 600;
    --fw-bold: 700;
    --sidebar-w: 264px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    font-size: 14.5px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
strong { font-weight: 700; }

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

/* ——— Sidebar ——— */
.sidebar {
    background: var(--sidebar);
    color: #d7ddd8;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 18px;
}
.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: linear-gradient(145deg, #2eb860, #178a42);
    display: grid;
    place-items: center;
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    color: #fff;
    flex-shrink: 0;
}
.brand-title {
    font-family: var(--display);
    font-weight: 600;
    font-size: 0.98rem;
    letter-spacing: -0.03em;
    color: #f4f7f5;
}
.brand-sub {
    font-size: 0.72rem;
    color: #7f8b83;
    margin-top: 1px;
}

.nav-section {
    padding: 0 10px 8px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #667269;
}
.nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow: auto;
    padding-right: 2px;
}
.nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: 11px;
    color: #b7c0ba;
    font-weight: 600;
    font-size: 0.92rem;
    transition: background .15s ease, color .15s ease;
}
.nav a:hover {
    background: var(--sidebar-hover);
    color: #f2f5f3;
}
.nav a.active {
    background: var(--sidebar-active);
    color: #fff;
}
.nav a.active .nav-ico {
    color: #57d487;
}
.nav-ico {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #87948c;
    flex-shrink: 0;
}
.nav-ico svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.nav-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #2eb860;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-foot {
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(145deg, #355744, #1d2f25);
    color: #d7ece0;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.78rem;
    flex-shrink: 0;
}
.sidebar-foot .meta-wrap { min-width: 0; flex: 1; }
.sidebar-foot .name {
    font-weight: 600;
    color: #f0f3f1;
    font-size: 0.86rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-foot .meta {
    color: #849188;
    font-size: 0.74rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.logout-btn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    color: #9aa69f;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .15s ease, color .15s ease;
}
.logout-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.logout-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ——— Main ——— */
.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background:
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(31, 157, 77, 0.05), transparent 55%),
        linear-gradient(180deg, #f7f8f6 0%, var(--bg) 180px);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 26px 32px 10px;
}
.page-title h1 {
    margin: 0;
    font-family: var(--display);
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: -0.035em;
    color: var(--ink);
}
.page-title p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.content { padding: 14px 32px 40px; }

.flash {
    margin-bottom: 14px;
    padding: 11px 14px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent-hover);
    border: 1px solid #cfead8;
    font-weight: 600;
    font-size: 0.9rem;
}
.flash-error {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #f3c6c2;
}

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.kpi {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 16px 15px;
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
}
.kpi::after {
    content: "";
    position: absolute;
    inset: auto -20% -40% auto;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(31,157,77,0.08), transparent 70%);
    pointer-events: none;
}
.kpi .label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.kpi .value {
    margin-top: 8px;
    font-family: var(--display);
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: -0.04em;
    color: var(--ink);
}
.kpi .hint {
    margin-top: 5px;
    font-size: 0.75rem;
    color: var(--info);
    font-weight: 600;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}
.panel-h {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fcfcfb, #f8f9f7);
}
.panel-h h2 {
    margin: 0;
    font-family: var(--display);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.panel-h a {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.84rem;
}
.panel-h a:hover { text-decoration: underline; }
.panel-b { padding: 8px 6px; }
.panel-b.pad { padding: 18px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 14px;
    border-radius: 11px;
    border: 1px solid transparent;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .12s ease;
    white-space: nowrap;
}
.btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 16px rgba(31, 157, 77, 0.22);
}
.btn:active { transform: translateY(1px); }
.btn-secondary {
    background: #fff;
    color: var(--ink-soft);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
    background: var(--bg-elevated);
    box-shadow: none;
    border-color: #c5ccc3;
}
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #a52c24; box-shadow: 0 6px 16px rgba(192,53,43,.22); }
.btn-sm { padding: 6px 10px; font-size: 0.8rem; border-radius: 9px; }
.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--bg); color: var(--ink); box-shadow: none; }

.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.table th {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #fafbf9;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover td { background: #f7faf7; }
.table a { color: var(--ink); font-weight: 600; }
.table a:hover { color: var(--accent); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    background: #eef1ee;
    color: var(--muted);
    border: 1px solid transparent;
}
.badge-green { background: var(--accent-soft); color: var(--accent-hover); border-color: #d3edd9; }
.badge-amber { background: var(--warn-soft); color: var(--warn); border-color: #fde6c8; }
.badge-red { background: var(--danger-soft); color: var(--danger); border-color: #f5d0cc; }
.badge-teal { background: var(--info-soft); color: var(--info); border-color: #cceee8; }
.badge-dot::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.form-grid { display: grid; gap: 14px; }
.form-row { display: grid; gap: 6px; }
.form-row label {
    font-weight: 600;
    font-size: 0.84rem;
    color: var(--ink-soft);
}
.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 11px;
    border: 1px solid var(--line-strong);
    background: #fff;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: #8fd2a8;
    box-shadow: 0 0 0 4px var(--accent-ring);
}
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.help { color: var(--muted); font-size: 0.8rem; }
.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}
.filters input,
.filters select {
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: #fff;
    min-width: 170px;
}

.split {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 14px;
    min-height: calc(100vh - 160px);
}
.thread-list { max-height: calc(100vh - 170px); overflow: auto; }
.thread-item {
    display: block;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    transition: background .12s ease;
}
.thread-item:hover { background: #f6f9f6; }
.thread-item.active {
    background: linear-gradient(90deg, rgba(31,157,77,0.08), rgba(31,157,77,0.02));
    box-shadow: inset 3px 0 0 var(--accent);
}
.thread-item .who {
    font-weight: 700;
    font-size: 0.92rem;
}
.thread-item .preview {
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.thread-item .meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 7px;
    font-size: 0.74rem;
    color: var(--muted);
}

.chat {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 170px);
}
.chat-head {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fcfcfb, #f8f9f7);
}
.chat-head strong {
    font-family: var(--display);
    font-size: 1.02rem;
    letter-spacing: -0.02em;
}
.chat-body {
    flex: 1;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    background:
        linear-gradient(180deg, rgba(244,245,243,0.7), transparent 80px),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 23px,
            rgba(228, 231, 226, 0.35) 24px
        );
}
.bubble {
    max-width: 68%;
    padding: 11px 13px;
    border-radius: 16px;
    line-height: 1.45;
    font-size: 0.92rem;
}
.bubble.in {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--line);
    border-bottom-left-radius: 6px;
    box-shadow: var(--shadow-xs);
}
.bubble.out {
    align-self: flex-end;
    background: linear-gradient(160deg, #2bb65d, #1f9d4d);
    color: #fff;
    border-bottom-right-radius: 6px;
    box-shadow: 0 8px 18px rgba(31, 157, 77, 0.18);
}
.bubble .meta {
    margin-top: 5px;
    font-size: 0.7rem;
    opacity: 0.72;
}
.chat-compose {
    border-top: 1px solid var(--line);
    padding: 12px 14px 14px;
    display: grid;
    gap: 10px;
    background: #fff;
}
.templates-row { display: flex; gap: 6px; flex-wrap: wrap; }

.kanban {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 12px;
    align-items: start;
}
.kanban-col {
    background: #eef1ee;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px;
    min-height: 360px;
}
.kanban-col h3 {
    margin: 2px 4px 12px;
    font-size: 0.84rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    color: var(--ink-soft);
}
.lead-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-xs);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.lead-card:hover {
    border-color: #c9d4cb;
    box-shadow: var(--shadow-sm);
}
.lead-card .title { font-weight: 700; font-size: 0.92rem; }
.lead-card .sub { color: var(--muted); font-size: 0.8rem; margin-top: 3px; }
.lead-card .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

.list-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #f7faf7; }

.empty {
    padding: 36px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 14px;
}
.pagination a, .pagination span {
    padding: 7px 11px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 0.84rem;
}

/* ——— Login ——— */
.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    background: #0e1511;
}
.login-hero {
    position: relative;
    overflow: hidden;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #e8eee9;
    background:
        radial-gradient(circle at 20% 20%, rgba(46, 184, 96, 0.22), transparent 35%),
        radial-gradient(circle at 80% 70%, rgba(15, 118, 110, 0.18), transparent 30%),
        linear-gradient(160deg, #0e1511 0%, #152019 50%, #101a14 100%);
}
.login-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at 30% 40%, black, transparent 75%);
    pointer-events: none;
}
.login-hero-copy { position: relative; z-index: 1; max-width: 460px; }
.login-hero-copy h1 {
    margin: 28px 0 12px;
    font-family: var(--display);
    font-size: clamp(2rem, 3.2vw, 2.7rem);
    line-height: 1.12;
    letter-spacing: -0.04em;
    font-weight: 600;
    color: #fff;
}
.login-hero-copy p {
    margin: 0;
    color: #9eaaa3;
    font-size: 1.02rem;
    line-height: 1.55;
}
.login-points {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
}
.login-point {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: #c5d0c9;
    font-size: 0.9rem;
}
.login-point span {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: rgba(46,184,96,0.18);
    color: #67d692;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.login-panel {
    display: grid;
    place-items: center;
    padding: 32px;
    background: #f5f6f4;
}
.login-card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
}
.login-card h2 {
    margin: 0 0 6px;
    font-family: var(--display);
    font-size: 1.4rem;
    letter-spacing: -0.03em;
}
.login-card > p {
    margin: 0 0 18px;
    color: var(--muted);
}
.demo-box {
    margin-top: 16px;
    padding: 12px 13px;
    border-radius: 12px;
    background: #f3f7f4;
    border: 1px solid #dce8df;
    color: var(--ink-soft);
    font-size: 0.82rem;
    line-height: 1.5;
}

/* ——— AI Seller ——— */
.ai-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: stretch;
    padding: 22px 22px;
    border-radius: 20px;
    border: 1px solid #cfe6d6;
    background:
        radial-gradient(circle at 90% 10%, rgba(46, 184, 96, 0.16), transparent 35%),
        linear-gradient(135deg, #122019 0%, #183224 45%, #1a3a28 100%);
    color: #e8f2ea;
    box-shadow: var(--shadow-sm);
}
.ai-hero h2 {
    margin: 10px 0 8px;
    font-family: var(--display);
    font-size: 1.45rem;
    letter-spacing: -0.03em;
    color: #fff;
}
.ai-hero p {
    margin: 0;
    max-width: 520px;
    color: #a7b9ae;
    line-height: 1.5;
}
.ai-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(46, 184, 96, 0.18);
    border: 1px solid rgba(87, 212, 135, 0.35);
    color: #8be4ad;
    font-size: 0.75rem;
    font-weight: 700;
}
.ai-chip::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #57d487;
    box-shadow: 0 0 0 4px rgba(87, 212, 135, 0.18);
}
.ai-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(90px, 1fr));
    gap: 10px;
    min-width: 320px;
}
.ai-stats > div {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 12px 14px;
}
.ai-stats .label {
    color: #8f9f96;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ai-stats .value {
    margin-top: 6px;
    font-family: var(--display);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: #fff;
}
.ai-toggles {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    background: #f5f8f5;
    border: 1px solid var(--line);
}
.ai-preview {
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, #f7fbf8, #fff);
    border: 1px solid #d7eadc;
}
.ai-preview-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-preview-bubble {
    padding: 14px 15px;
    border-radius: 16px;
    background: linear-gradient(160deg, #2bb65d, #1f9d4d);
    color: #fff;
    line-height: 1.45;
    box-shadow: 0 10px 24px rgba(31, 157, 77, 0.18);
}
.ai-inline {
    padding: 12px;
    border-radius: 14px;
    background: #f3faf5;
    border: 1px solid #d3ead9;
}
.ai-inline-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.ai-inline-text {
    font-size: 0.9rem;
    color: var(--ink-soft);
    line-height: 1.45;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
.kpi, .panel, .login-card, .ai-hero { animation: rise .35s ease both; }

@media (max-width: 1200px) {
    .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: relative; height: auto; }
    .login-page { grid-template-columns: 1fr; }
    .login-hero { min-height: 280px; padding: 28px; }
    .grid-6, .grid-4, .grid-3, .grid-2, .split, .kanban { grid-template-columns: 1fr; }
    .topbar, .content { padding-left: 16px; padding-right: 16px; }
    .ai-hero, .ai-stats { grid-template-columns: 1fr; display: grid; min-width: 0; }
}
