@font-face {
    font-family: "Manrope CRM";
    src: url("./manrope-variable.ttf") format("truetype");
    font-weight: 400 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --crm-ink: #172726;
    --crm-ink-soft: #526260;
    --crm-petrol: #123c3b;
    --crm-petrol-deep: #0b2b2a;
    --crm-teal: #1a937d;
    --crm-teal-strong: #107460;
    --crm-teal-soft: #dff3ed;
    --crm-coral: #f16f52;
    --crm-coral-soft: #fff0e9;
    --crm-amber: #dca33c;
    --crm-canvas: #f3f4ee;
    --crm-paper: #fffefa;
    --crm-paper-soft: #f8f9f4;
    --crm-line: #dce3dc;
    --crm-line-strong: #cbd5cd;
    --crm-shadow: 0 18px 48px rgba(20, 48, 44, 0.08);
    --crm-shadow-soft: 0 8px 24px rgba(20, 48, 44, 0.06);
    --crm-radius: 20px;
    --crm-radius-sm: 13px;
}

body.crm-desktop,
body.crm-mobile,
body.crm-login {
    color: var(--crm-ink);
    font-family: "Manrope CRM", "Trebuchet MS", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.crm-desktop button,
body.crm-desktop input,
body.crm-desktop select,
body.crm-desktop textarea,
body.crm-mobile button,
body.crm-mobile input,
body.crm-mobile select,
body.crm-mobile textarea,
body.crm-login button,
body.crm-login input {
    font: inherit;
}

body.crm-desktop :focus-visible,
body.crm-mobile :focus-visible,
body.crm-login :focus-visible {
    outline: 3px solid rgba(241, 111, 82, 0.52);
    outline-offset: 3px;
}

/* Desktop operations shell */
body.crm-desktop {
    --bg-main: var(--crm-canvas);
    --bg-soft: var(--crm-paper-soft);
    --surface: var(--crm-paper);
    --surface-strong: #ffffff;
    --surface-muted: var(--crm-paper-soft);
    --line: var(--crm-line);
    --line-soft: #e9eee9;
    --text-main: var(--crm-ink);
    --text-soft: var(--crm-ink-soft);
    --accent-a: var(--crm-teal);
    --accent-b: var(--crm-teal-strong);
    --accent-c: var(--crm-teal-strong);
    --shadow-soft: var(--crm-shadow-soft);
    --shadow-card: var(--crm-shadow);
    --radius-card: var(--crm-radius);
    --radius-control: var(--crm-radius-sm);
    min-height: 100vh;
    padding-left: 264px;
    background:
        linear-gradient(rgba(18, 60, 59, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(18, 60, 59, 0.025) 1px, transparent 1px),
        radial-gradient(circle at 92% 3%, rgba(241, 111, 82, 0.10), transparent 25%),
        var(--crm-canvas);
    background-size: 28px 28px, 28px 28px, auto, auto;
}

.crm-desktop .header {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 900;
    width: 264px;
    height: 100vh;
    padding: 24px 18px 18px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 18px;
    color: #f4fbf8;
    background:
        radial-gradient(circle at 25% 0%, rgba(74, 190, 159, 0.22), transparent 26%),
        linear-gradient(170deg, var(--crm-petrol) 0%, var(--crm-petrol-deep) 88%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 12px 0 40px rgba(11, 43, 42, 0.13);
    overflow-y: auto;
}

.crm-desktop .brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 6px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.crm-desktop .brand-mark,
.crm-login .brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 15px;
    color: #0b2b2a;
    background: linear-gradient(145deg, #c8f4df 0%, #7dd9bc 58%, #f5a080 130%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 12px 24px rgba(0, 0, 0, 0.18);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.crm-desktop .brand-copy {
    min-width: 0;
}

.crm-desktop .header h2 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.crm-desktop .brand-copy span {
    display: block;
    margin-top: 4px;
    color: rgba(231, 247, 241, 0.62);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.crm-desktop .sidebar-label {
    padding: 0 10px;
    color: rgba(231, 247, 241, 0.45);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.crm-desktop .nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.crm-desktop .nav button {
    position: relative;
    width: 100%;
    min-height: 46px;
    padding: 9px 11px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: rgba(239, 250, 246, 0.72);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 13px;
    box-shadow: none;
    font-size: 13px;
    font-weight: 650;
    text-align: left;
    transform: none;
}

.crm-desktop .nav button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.07);
    transform: none;
}

.crm-desktop .nav button.active {
    color: #0b2b2a;
    background: #f5fbf7;
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 24px rgba(3, 23, 22, 0.23);
}

.crm-desktop .nav-index {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    color: rgba(230, 248, 241, 0.58);
    background: rgba(255, 255, 255, 0.07);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.crm-desktop .nav button.active .nav-index {
    color: #ffffff;
    background: var(--crm-teal);
}

.crm-desktop .sidebar-health {
    margin-top: auto;
    padding: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(237, 249, 245, 0.72);
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    font-size: 11px;
    line-height: 1.4;
}

.crm-desktop .sidebar-health strong {
    display: block;
    color: #ffffff;
    font-size: 11px;
}

.crm-desktop .live-dot,
.crm-desktop .system-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #6ce0b2;
    box-shadow: 0 0 0 5px rgba(108, 224, 178, 0.12);
}

.crm-desktop .live-dot.is-offline,
.crm-desktop .system-dot.is-offline {
    background: var(--crm-coral);
    box-shadow: 0 0 0 5px rgba(241, 111, 82, 0.12);
}

.crm-desktop .header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    width: 100%;
}

.crm-desktop .header-actions .btn {
    min-height: 40px;
    padding: 9px 10px;
    color: rgba(241, 250, 247, 0.78);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 11px;
    box-shadow: none;
    font-size: 11px;
}

.crm-desktop .header-actions .btn:first-child {
    grid-column: 1 / -1;
    color: #0b2b2a;
    background: #c8f4df;
    border-color: #c8f4df;
    font-weight: 800;
}

.crm-desktop .header-actions .btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    transform: none;
}

.crm-desktop .header-actions .btn:first-child:hover {
    color: #0b2b2a;
    background: #d9f8e9;
}

.crm-desktop .container {
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding: 30px clamp(20px, 3vw, 46px) 48px;
}

.crm-desktop .workspace-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 18px;
}

.crm-desktop .workspace-kicker {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 8px;
    color: var(--crm-teal-strong);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.crm-desktop .workspace-kicker::before {
    content: "";
    width: 28px;
    height: 2px;
    border-radius: 999px;
    background: var(--crm-coral);
}

.crm-desktop .workspace-head h1 {
    margin: 0;
    color: var(--crm-ink);
    font-size: clamp(30px, 3vw, 46px);
    line-height: 1;
    letter-spacing: -0.055em;
}

.crm-desktop .workspace-head p {
    max-width: 670px;
    margin: 9px 0 0;
    color: var(--crm-ink-soft);
    font-size: 13px;
    line-height: 1.55;
}

.crm-desktop .workspace-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.crm-desktop .command-trigger {
    min-height: 44px;
    padding: 8px 9px 8px 14px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--crm-ink-soft);
    background: rgba(255, 254, 250, 0.82);
    border: 1px solid var(--crm-line-strong);
    border-radius: 13px;
    box-shadow: var(--crm-shadow-soft);
    cursor: pointer;
    font-size: 12px;
}

.crm-desktop kbd {
    padding: 5px 7px;
    color: var(--crm-ink-soft);
    background: #eef1eb;
    border: 1px solid #dce2db;
    border-bottom-width: 2px;
    border-radius: 7px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 800;
}

.crm-desktop .workspace-actions > .btn {
    min-height: 44px;
    padding-inline: 18px;
    background: var(--crm-coral);
    box-shadow: 0 12px 28px rgba(241, 111, 82, 0.22);
}

.crm-desktop .system-ribbon {
    margin-bottom: 18px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--crm-ink-soft);
    background: rgba(255, 254, 250, 0.70);
    border: 1px solid rgba(203, 213, 205, 0.86);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(20, 48, 44, 0.04);
    font-size: 11px;
    overflow-x: auto;
}

.crm-desktop .system-ribbon-item {
    min-height: 32px;
    padding: 7px 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 9px;
    cursor: default;
    white-space: nowrap;
}

.crm-desktop button.system-ribbon-item {
    cursor: pointer;
}

.crm-desktop button.system-ribbon-item:hover {
    color: var(--crm-petrol);
    background: var(--crm-teal-soft);
}

.crm-desktop .system-ribbon-item.has-warning {
    color: #9d3425;
    background: var(--crm-coral-soft);
}

.crm-desktop .system-ribbon-spacer {
    flex: 1 1 auto;
}

.crm-desktop .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.crm-desktop .card {
    background: rgba(255, 254, 250, 0.92);
    border: 1px solid var(--crm-line);
    border-radius: var(--crm-radius);
    box-shadow: var(--crm-shadow);
    backdrop-filter: blur(14px);
}

.crm-desktop .stats .card {
    position: relative;
    min-height: 128px;
    margin: 0;
    padding: 19px 20px;
    overflow: hidden;
}

.crm-desktop .stats .card::after {
    content: "";
    position: absolute;
    right: -25px;
    bottom: -38px;
    width: 96px;
    height: 96px;
    border: 18px solid rgba(26, 147, 125, 0.055);
    border-radius: 50%;
}

.crm-desktop .stats .card:nth-child(2)::after { border-color: rgba(241, 111, 82, 0.07); }
.crm-desktop .stats .card:nth-child(3)::after { border-color: rgba(220, 163, 60, 0.08); }

.crm-desktop .stat-label {
    margin: 0 0 19px;
    color: var(--crm-ink-soft);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.crm-desktop .stat-value {
    min-height: 0;
    color: var(--crm-ink);
    font-size: clamp(27px, 3vw, 38px);
    font-weight: 760;
    letter-spacing: -0.06em;
}

.crm-desktop .stats .card:last-child .stat-value {
    color: var(--crm-teal-strong);
    font-size: clamp(20px, 2vw, 27px);
}

.crm-desktop .btn {
    color: #ffffff;
    background: var(--crm-teal);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(26, 147, 125, 0.18);
    font-weight: 720;
}

.crm-desktop .btn:hover {
    opacity: 1;
    background: var(--crm-teal-strong);
    box-shadow: 0 13px 30px rgba(16, 116, 96, 0.22);
}

.crm-desktop .btn-sm {
    border-radius: 9px;
}

.crm-desktop .calendar-status-board {
    gap: 8px;
}

.crm-desktop .calendar-status-card,
.crm-desktop .calendar-toolbar,
.crm-desktop .calendar-side-panel,
.crm-desktop .report-card,
.crm-desktop .report-kpi-card,
.crm-desktop .ai-ops-card,
.crm-desktop .review-card,
.crm-desktop .poster-status {
    background: rgba(255, 254, 250, 0.92);
    border-color: var(--crm-line);
    box-shadow: var(--crm-shadow-soft);
}

.crm-desktop .calendar-status-card {
    min-height: 96px;
    padding: 12px;
    border-radius: 14px;
}

.crm-desktop .calendar-toolbar {
    position: sticky;
    top: 12px;
    z-index: 20;
    margin: 0;
    padding: 11px 12px;
    flex-wrap: wrap;
    border-radius: 15px;
    backdrop-filter: blur(16px);
}

.crm-desktop .calendar-toolbar-group {
    min-width: 0;
    flex-wrap: wrap;
}

.crm-desktop .calendar-toolbar select,
.crm-desktop .calendar-toolbar input,
.crm-desktop .toolbar-inline input,
.crm-desktop .toolbar-inline select,
.crm-desktop #reports select,
.crm-desktop .form-group input,
.crm-desktop .form-group select,
.crm-desktop .form-group textarea,
.crm-desktop .ai-log-toolbar input,
.crm-desktop .ai-log-toolbar select {
    min-height: 42px;
    color: var(--crm-ink);
    background: #fffefa;
    border-color: var(--crm-line-strong);
    border-radius: 11px;
}

.crm-desktop .calendar-ops-layout {
    grid-template-columns: minmax(0, 1.78fr) minmax(310px, 0.72fr);
    gap: 14px;
    min-width: 0;
}

.crm-desktop .calendar-shell {
    min-width: 0;
    max-width: 100%;
    padding: 18px;
    background: rgba(255, 254, 250, 0.94);
    border-color: var(--crm-line);
    border-radius: 18px;
    box-shadow: var(--crm-shadow);
}

.crm-desktop .calendar-side-panel {
    position: sticky;
    top: 78px;
    min-width: 0;
    max-width: 100%;
    padding: 17px;
    border-radius: 18px;
}

.crm-desktop .calendar-focus-card,
.crm-desktop .calendar-queue-item,
.crm-desktop .report-list-item,
.crm-desktop .ai-ops-stream-item,
.crm-desktop .ai-log-item,
.crm-desktop .ai-dialog-bubble,
.crm-desktop .poster-metric-card,
.crm-desktop .poster-side-card {
    background: var(--crm-paper-soft);
    border-color: var(--crm-line);
}

.crm-desktop .fc .fc-button-primary {
    background: var(--crm-petrol) !important;
    border-color: var(--crm-petrol) !important;
    border-radius: 9px !important;
    box-shadow: none !important;
}

.crm-desktop .fc .fc-button-primary:not(:disabled):hover,
.crm-desktop .fc .fc-button-primary:not(:disabled).fc-button-active {
    background: var(--crm-teal) !important;
    border-color: var(--crm-teal) !important;
}

.crm-desktop .fc .fc-toolbar-title {
    color: var(--crm-ink);
    font-size: 22px !important;
    letter-spacing: -0.045em;
}

.crm-desktop .fc-theme-standard td,
.crm-desktop .fc-theme-standard th,
.crm-desktop .fc-theme-standard .fc-scrollgrid {
    border-color: #e4e9e3;
}

.crm-desktop .report-grid {
    gap: 12px;
}

.crm-desktop .report-card,
.crm-desktop .report-kpi-card,
.crm-desktop .ai-ops-card,
.crm-desktop .review-card {
    border-radius: 16px;
}

.crm-desktop .report-card h4,
.crm-desktop .poster-status strong {
    color: var(--crm-teal-strong);
}

.crm-desktop .ai-command-layout {
    grid-template-columns: minmax(0, 1.08fr) minmax(350px, 0.92fr);
}

.crm-desktop table {
    overflow: hidden;
    border: 1px solid var(--crm-line);
    border-radius: 14px;
}

.crm-desktop th {
    color: var(--crm-ink-soft);
    background: #f1f4ee;
}

.crm-desktop tr:hover td {
    background: #f4faf6;
}

.crm-desktop .modal {
    background: rgba(7, 29, 28, 0.48);
}

.crm-desktop .modal-content {
    background: var(--crm-paper);
    border-color: rgba(255, 255, 255, 0.72);
    border-radius: 20px;
    box-shadow: 0 32px 90px rgba(7, 29, 28, 0.28);
}

.crm-desktop .poster-preview-box {
    color: var(--crm-ink);
    background: var(--crm-paper-soft);
    border-color: var(--crm-line);
}

/* Command palette */
.crm-command-palette {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: min(14vh, 120px) 18px 24px;
    background: rgba(7, 29, 28, 0.56);
    backdrop-filter: blur(12px);
}

.crm-command-palette.show {
    display: flex;
    animation: crm-fade-in 160ms ease-out both;
}

.crm-command-box {
    width: min(680px, 100%);
    overflow: hidden;
    background: var(--crm-paper);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    box-shadow: 0 34px 100px rgba(4, 26, 24, 0.34);
}

.crm-command-input-wrap {
    padding: 14px;
    border-bottom: 1px solid var(--crm-line);
}

.crm-command-input-wrap input {
    width: 100%;
    min-height: 50px;
    padding: 0 15px;
    color: var(--crm-ink);
    background: #f3f5f0;
    border: 1px solid var(--crm-line);
    border-radius: 13px;
    outline: none;
}

.crm-command-list {
    max-height: min(56vh, 480px);
    padding: 8px;
    overflow-y: auto;
}

.crm-command-item {
    width: 100%;
    padding: 12px 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--crm-ink);
    background: transparent;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
}

.crm-command-item:hover,
.crm-command-item.active {
    background: var(--crm-teal-soft);
}

.crm-command-code {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #ffffff;
    background: var(--crm-petrol);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 800;
}

.crm-command-item strong,
.crm-command-item small {
    display: block;
}

.crm-command-item strong {
    font-size: 13px;
}

.crm-command-item small {
    margin-top: 3px;
    color: var(--crm-ink-soft);
    font-size: 11px;
}

.crm-command-empty {
    padding: 28px;
    color: var(--crm-ink-soft);
    text-align: center;
}

/* Login */
body.crm-login {
    min-height: 100vh;
    height: auto;
    margin: 0;
    padding: 24px;
    display: grid;
    place-items: center;
    background:
        linear-gradient(rgba(213, 243, 233, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(213, 243, 233, 0.045) 1px, transparent 1px),
        radial-gradient(circle at 18% 12%, rgba(57, 165, 137, 0.28), transparent 30%),
        linear-gradient(145deg, #123c3b 0%, #0a2928 65%, #071f1e 100%);
    background-size: 32px 32px, 32px 32px, auto, auto;
}

.crm-login .login-shell {
    width: min(1060px, 100%);
    min-height: 610px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    overflow: hidden;
    background: rgba(255, 254, 250, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 28px;
    box-shadow: 0 38px 110px rgba(0, 18, 17, 0.42);
}

.crm-login .login-story {
    position: relative;
    padding: clamp(38px, 6vw, 72px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #effaf6;
    background:
        radial-gradient(circle at 88% 12%, rgba(241, 111, 82, 0.32), transparent 24%),
        linear-gradient(155deg, #164b47 0%, #0b302e 100%);
    isolation: isolate;
}

.crm-login .login-story::after {
    content: "";
    position: absolute;
    right: -110px;
    bottom: -130px;
    z-index: -1;
    width: 340px;
    height: 340px;
    border: 52px solid rgba(135, 226, 193, 0.08);
    border-radius: 50%;
}

.crm-login .login-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.crm-login .login-brand strong,
.crm-login .login-brand span {
    display: block;
}

.crm-login .login-brand strong {
    color: #ffffff;
    font-size: 18px;
    letter-spacing: -0.035em;
}

.crm-login .login-brand span {
    margin-top: 3px;
    color: rgba(230, 248, 241, 0.58);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.crm-login .login-message {
    margin: 70px 0 50px;
}

.crm-login .login-eyebrow {
    color: #88dfbf;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.crm-login .login-message h1 {
    max-width: 560px;
    margin: 15px 0 18px;
    color: #ffffff;
    font-size: clamp(38px, 5vw, 64px);
    line-height: 0.98;
    letter-spacing: -0.065em;
}

.crm-login .login-message p {
    max-width: 520px;
    margin: 0;
    color: rgba(234, 249, 243, 0.69);
    font-size: 14px;
    line-height: 1.7;
}

.crm-login .login-points {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.crm-login .login-point {
    padding: 8px 11px;
    color: rgba(239, 250, 246, 0.78);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

.crm-login .login-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(231, 247, 241, 0.64);
    font-size: 11px;
}

.crm-login .login-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #79ddb8;
    box-shadow: 0 0 0 5px rgba(121, 221, 184, 0.12);
}

.crm-login .login-panel {
    padding: clamp(34px, 5vw, 64px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--crm-paper);
}

.crm-login .login-panel h2 {
    margin: 0;
    color: var(--crm-ink);
    font-size: 30px;
    letter-spacing: -0.05em;
}

.crm-login .login-panel-copy {
    margin: 8px 0 28px;
    color: var(--crm-ink-soft);
    font-size: 13px;
    line-height: 1.55;
}

.crm-login .login-field {
    display: block;
    margin-bottom: 17px;
}

.crm-login .login-field > span,
.crm-login .login-field > label {
    display: block;
    margin-bottom: 7px;
    color: var(--crm-ink);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.crm-login .login-field-wrap {
    position: relative;
}

.crm-login input {
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 0 14px;
    color: var(--crm-ink);
    background: #f5f6f1;
    border: 1px solid var(--crm-line-strong);
    border-radius: 13px;
    box-sizing: border-box;
}

.crm-login input:focus {
    border-color: var(--crm-teal);
    box-shadow: 0 0 0 4px rgba(26, 147, 125, 0.12);
}

.crm-login .password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    width: auto;
    min-height: 36px;
    padding: 0 10px;
    transform: translateY(-50%);
    color: var(--crm-teal-strong);
    background: transparent;
    border: 0;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 800;
}

.crm-login .login-submit {
    width: 100%;
    min-height: 52px;
    margin-top: 4px;
    padding: 0 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
    background: var(--crm-coral);
    border: 0;
    border-radius: 13px;
    box-shadow: 0 14px 28px rgba(241, 111, 82, 0.22);
    cursor: pointer;
    font-weight: 800;
}

.crm-login .login-submit:hover {
    background: #df5d42;
}

.crm-login .login-submit:disabled {
    opacity: 0.62;
    cursor: wait;
}

.crm-login .error {
    margin: -4px 0 15px;
    padding: 11px 12px;
    color: #9d3425;
    background: var(--crm-coral-soft);
    border: 1px solid #ffd4c8;
    border-radius: 11px;
    font-size: 12px;
}

.crm-login .login-security {
    margin: 17px 0 0;
    color: #7a8784;
    font-size: 10px;
    line-height: 1.55;
    text-align: center;
}

/* Mobile operations shell */
body.crm-mobile {
    --bg: var(--crm-canvas);
    --surface: var(--crm-paper);
    --surface-soft: var(--crm-paper-soft);
    --line: var(--crm-line);
    --text: var(--crm-ink);
    --muted: var(--crm-ink-soft);
    --primary: var(--crm-teal);
    --primary-strong: var(--crm-teal-strong);
    --danger: #c95045;
    --warn: var(--crm-amber);
    --success: var(--crm-teal);
    --shadow: var(--crm-shadow);
    --radius: var(--crm-radius);
    background:
        radial-gradient(circle at 90% 0%, rgba(241, 111, 82, 0.11), transparent 26%),
        var(--crm-canvas);
}

.crm-mobile .mobile-shell {
    max-width: 780px;
    padding: 12px 12px 30px;
}

.crm-mobile .mobile-header {
    margin: 0 -12px 12px;
    padding: 16px 14px 14px;
    background: rgba(243, 244, 238, 0.92);
    border-bottom-color: var(--crm-line);
}

.crm-mobile .mobile-title strong {
    color: var(--crm-ink);
    font-size: 25px;
    letter-spacing: -0.05em;
}

.crm-mobile .mobile-title span {
    color: var(--crm-ink-soft);
}

.crm-mobile .primary-btn {
    color: #ffffff;
    background: var(--crm-coral);
    box-shadow: 0 12px 26px rgba(241, 111, 82, 0.20);
}

.crm-mobile .ghost-btn {
    color: var(--crm-teal-strong);
    background: var(--crm-teal-soft);
    border-color: #c9e9df;
}

.crm-mobile .soft-btn {
    color: var(--crm-ink);
    background: #f1f3ee;
    border-color: var(--crm-line);
}

.crm-mobile .hero-card,
.crm-mobile .panel,
.crm-mobile .sheet-content {
    background: rgba(255, 254, 250, 0.96);
    border-color: var(--crm-line);
    border-radius: 18px;
    box-shadow: var(--crm-shadow-soft);
}

.crm-mobile .hero-card {
    position: relative;
    overflow: hidden;
}

.crm-mobile .hero-card::after {
    content: "";
    position: absolute;
    right: -48px;
    top: -54px;
    width: 140px;
    height: 140px;
    border: 22px solid rgba(26, 147, 125, 0.07);
    border-radius: 50%;
}

.crm-mobile .kpi-card,
.crm-mobile .quick-action,
.crm-mobile .item-card,
.crm-mobile .link-row,
.crm-mobile .checkbox-item {
    background: var(--crm-paper-soft);
    border-color: var(--crm-line);
    border-radius: 14px;
}

.crm-mobile .quick-action {
    min-height: 94px;
}

.crm-mobile .status-chip {
    border: 1px solid transparent;
}

.crm-mobile .tabbar {
    gap: 4px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 254, 250, 0.94);
    border-top-color: var(--crm-line);
}

.crm-mobile .tabbar button {
    min-height: 49px;
    padding: 7px 4px;
    color: var(--crm-ink-soft);
    background: transparent;
    border-radius: 12px;
}

.crm-mobile .tabbar button::before {
    display: block;
    margin-bottom: 3px;
    color: #8c9995;
    font-size: 9px;
    letter-spacing: 0.08em;
}

.crm-mobile .tabbar button[data-section="today"]::before { content: "01"; }
.crm-mobile .tabbar button[data-section="calendar"]::before { content: "02"; }
.crm-mobile .tabbar button[data-section="clients"]::before { content: "03"; }
.crm-mobile .tabbar button[data-section="ai"]::before { content: "04"; }
.crm-mobile .tabbar button[data-section="more"]::before { content: "05"; }

.crm-mobile .tabbar button.active {
    color: #ffffff;
    background: var(--crm-petrol);
}

.crm-mobile .tabbar button.active::before {
    color: #8de0c3;
}

.crm-mobile .sheet {
    background: rgba(7, 29, 28, 0.48);
}

.crm-mobile .sheet-content {
    border-radius: 22px 22px 14px 14px;
}

.crm-mobile .sheet-close {
    color: var(--crm-teal-strong);
    background: var(--crm-teal-soft);
}

.crm-mobile .toolbar input,
.crm-mobile .toolbar select,
.crm-mobile .form-grid input,
.crm-mobile .form-grid select,
.crm-mobile .form-grid textarea {
    color: var(--crm-ink);
    background: #fffefa;
    border-color: var(--crm-line-strong);
    border-radius: 12px;
}

@keyframes crm-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes crm-rise-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.crm-desktop .workspace-head,
.crm-desktop .system-ribbon,
.crm-desktop .stats,
.crm-desktop .tab-content.active,
.crm-mobile .section.active {
    animation: crm-rise-in 320ms ease-out both;
}

@media (max-width: 1180px) {
    .crm-desktop .calendar-status-board {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .crm-desktop .calendar-ops-layout,
    .crm-desktop .ai-command-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .crm-desktop .calendar-side-panel {
        position: static;
    }
}

@media (max-width: 900px) {
    body.crm-desktop {
        padding-left: 0;
        padding-bottom: 90px;
    }

    .crm-desktop .header {
        position: sticky;
        inset: 0 auto auto;
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 12px 14px;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        overflow: visible;
    }

    .crm-desktop .brand-lockup {
        padding: 0;
        border: 0;
    }

    .crm-desktop .brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .crm-desktop .brand-copy span,
    .crm-desktop .sidebar-label,
    .crm-desktop .sidebar-health,
    .crm-desktop .header .nav {
        display: none;
    }

    .crm-desktop .header-actions {
        margin-left: auto;
        display: flex;
        justify-content: flex-end;
        width: auto;
    }

    .crm-desktop .header-actions .btn {
        display: none;
        width: auto;
        min-width: 0;
    }

    .crm-desktop .header-actions .btn:first-child {
        display: inline-flex;
        grid-column: auto;
    }

    .crm-desktop .container {
        padding: 20px 14px 30px;
    }

    .crm-desktop .workspace-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .crm-desktop .workspace-head h1 {
        font-size: 34px;
    }

    .crm-desktop .workspace-actions {
        width: 100%;
        justify-content: stretch;
    }

    .crm-desktop .command-trigger,
    .crm-desktop .workspace-actions > .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .crm-desktop .system-ribbon-spacer,
    .crm-desktop #shellClock {
        display: none;
    }

    .crm-desktop .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crm-desktop .calendar-toolbar {
        position: static;
    }

    .crm-desktop .calendar-shell {
        overflow-x: auto;
    }
}

@media (max-width: 680px) {
    body.crm-login {
        padding: 12px;
        place-items: stretch;
    }

    .crm-login .login-shell {
        min-height: calc(100vh - 24px);
        grid-template-columns: 1fr;
        border-radius: 22px;
    }

    .crm-login .login-story {
        min-height: 230px;
        padding: 28px 24px;
    }

    .crm-login .login-message {
        margin: 38px 0 22px;
    }

    .crm-login .login-message h1 {
        max-width: 470px;
        font-size: 40px;
    }

    .crm-login .login-message p,
    .crm-login .login-points,
    .crm-login .login-status {
        display: none;
    }

    .crm-login .login-panel {
        padding: 32px 24px 38px;
    }

    .crm-desktop .calendar-status-board,
    .crm-desktop .stats,
    .crm-desktop .report-kpi-grid,
    .crm-desktop .ai-ops-grid,
    .crm-desktop .poster-metrics-grid {
        grid-template-columns: 1fr;
    }

    .crm-desktop .workspace-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .crm-desktop .calendar-toolbar-group {
        width: 100%;
    }

    .crm-desktop .calendar-toolbar select,
    .crm-desktop .calendar-toolbar input,
    .crm-desktop .calendar-toolbar .btn {
        width: 100%;
        min-width: 0;
    }

    .crm-mobile .mobile-header-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .crm-mobile .header-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 0.8fr 1.2fr;
    }

    .crm-mobile .quick-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
