@font-face {
    font-family: "Ubuntu";
    src: url("/fonts/Ubuntu-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

:root {
    --color-crm-ink: #111827;
    --color-crm-paper: #f6f7fb;
    --color-crm-line: #d7dce5;
    --color-crm-sky: #0369a1;
    --color-crm-primary: #174ea6;
    --color-crm-navy: #0b2d5b;
    --color-crm-muted: #64748b;
    --color-crm-emerald: #047857;
    --color-crm-amber: #b45309;
}

html,
body {
    min-width: 320px;
    min-height: 100%;
    background: #f6f7fb;
    color: #020617;
    font-family: "Ubuntu", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

button,
input,
select,
textarea,
.font-sans,
.font-serif {
    font-family: "Ubuntu", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

button,
a,
summary {
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

:where(button, a, summary, label[for], [role="button"], input[type="button"], input[type="submit"], input[type="reset"]) {
    cursor: pointer;
}

:where(button:disabled, input:disabled, select:disabled, textarea:disabled, [aria-disabled="true"]) {
    cursor: not-allowed;
}

table {
    border-collapse: collapse;
}

/* Zero-pill discipline */
:where(
    button,
    input,
    select,
    textarea,
    summary,
    section,
    article,
    dialog,
    pre,
    .badge,
    [class*="rounded"]
) {
    border-radius: 0 !important;
}

/* Quill & Ubuntu font */
.crm-mail-editor .ql-editor,
.ql-font-ubuntu {
    font-family: "Ubuntu", Arial, Helvetica, sans-serif !important;
}

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="ubuntu"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="ubuntu"]::before {
    content: "Ubuntu";
    font-family: "Ubuntu", Arial, Helvetica, sans-serif !important;
}

.ql-snow .ql-picker.ql-font .ql-picker-label:not([data-value])::before,
.ql-snow .ql-picker.ql-font .ql-picker-item:not([data-value])::before {
    content: "Ubuntu";
}

/* Mobile navigation drawer */
.crm-mobile-nav-toggle {
    position: fixed;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.crm-sidebar {
    transform: translateX(-100%);
}

.crm-mobile-nav-backdrop {
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.crm-mobile-nav-toggle:checked ~ .crm-shell .crm-sidebar {
    transform: translateX(0);
}

.crm-mobile-nav-toggle:checked ~ .crm-shell .crm-mobile-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
}

@supports selector(body:has(.crm-mobile-nav-toggle:checked)) {
    @media (max-width: 1023.98px) {
        body:has(.crm-mobile-nav-toggle:checked) {
            overflow: hidden;
        }
    }
}

@media (min-width: 1024px) {
    .crm-sidebar {
        transform: translateX(0);
    }
}

/* CRM Auth layout */
.crm-auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(3, 105, 161, .07), transparent 42%),
        var(--color-crm-paper);
}

.crm-auth-card {
    display: grid;
    width: min(100%, 880px);
    min-height: 440px;
    grid-template-columns: minmax(220px, .72fr) minmax(0, 1.45fr);
    border: 1px solid #dbe2ea;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .12);
}

.crm-auth-brand {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: #071b35;
    padding: 36px;
    color: #fff;
}

.crm-auth-brand span,
.crm-auth-eyebrow {
    color: #7dd3fc;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.crm-auth-brand strong {
    margin-top: 10px;
    font-size: 30px;
    font-weight: 900;
}

.crm-auth-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(32px, 6vw, 64px);
}

.crm-auth-content h1 {
    margin: 10px 0 0;
    color: #020617;
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 900;
    line-height: 1.15;
}

.crm-auth-description {
    margin: 16px 0 0;
    color: #475569;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
}

.crm-auth-detail {
    margin-top: 20px;
    border-left: 4px solid #0369a1;
    background: #f1f5f9;
    padding: 14px 16px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

.crm-auth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.crm-auth-primary,
.crm-auth-secondary {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
}

.crm-auth-primary {
    border: 1px solid #020617;
    background: #020617;
    color: #fff;
}

.crm-auth-primary:hover {
    background: #1e293b;
    border-color: #1e293b;
}

.crm-auth-secondary {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
}

.crm-auth-secondary:hover {
    background: #f1f5f9;
}

@media (max-width: 680px) {
    .crm-auth-card {
        grid-template-columns: 1fr;
    }

    .crm-auth-brand {
        min-height: 140px;
        padding: 24px;
    }

    .crm-auth-content {
        padding: 28px 20px;
    }
}

/* Blazor validation & error states */
.validation-message {
    color: #dc2626;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.invalid {
    border-color: #dc2626 !important;
}

.valid.modified:not([type=checkbox]) {
    border-color: #16a34a !important;
}

#blazor-error-ui {
    background: #020617;
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
}

#blazor-error-ui .reload {
    color: #7dd3fc;
    margin-left: 0.5rem;
    text-decoration: underline;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.75rem;
}