:root {
    --crm-bg: #f3eee5;
    --crm-surface: #fffaf4;
    --crm-surface-2: #fffdf9;
    --crm-text: #1d2939;
    --crm-muted: #667085;
    --crm-line: rgba(29, 41, 57, 0.09);
    --crm-accent: #c65d32;
    --crm-sidebar: #223046;
    --crm-sidebar-2: #2d3b50;
    --crm-shadow: 0 18px 48px rgba(27, 39, 51, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--crm-text);
    background:
        radial-gradient(circle at top left, rgba(198, 93, 50, 0.14), transparent 24%),
        radial-gradient(circle at bottom right, rgba(34, 48, 70, 0.12), transparent 24%),
        linear-gradient(180deg, #f6f0e8 0%, #fbf8f2 46%, #edf2f5 100%);
}

.auth-shell {
    background:
        radial-gradient(circle at left top, rgba(198, 93, 50, 0.18), transparent 22%),
        radial-gradient(circle at right bottom, rgba(34, 48, 70, 0.12), transparent 28%),
        linear-gradient(160deg, #f4ede3 0%, #fcf8f1 48%, #eef2f5 100%);
}

.auth-main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.auth-hero {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
    gap: 2rem;
    align-items: center;
}

.auth-copy {
    padding: 1rem 1rem 1rem 0.5rem;
}

.auth-copy-rich {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.auth-brand-lockup {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-brand-mark {
    width: 4rem;
    height: 4rem;
    border-radius: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(198, 93, 50, 1) 0%, rgba(162, 71, 36, 1) 100%);
    box-shadow: 0 18px 36px rgba(198, 93, 50, 0.22);
}

.auth-brand-name {
    font-size: clamp(1.35rem, 3vw, 2rem);
    font-weight: 700;
    line-height: 1.05;
}

.auth-brand-meta {
    color: var(--crm-muted);
    font-size: 0.95rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #a34a23;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.auth-copy h1 {
    font-size: clamp(2.3rem, 4.8vw, 4.8rem);
    line-height: 0.95;
    margin: 0 0 1rem;
    max-width: 11ch;
}

.auth-copy p {
    color: var(--crm-muted);
    font-size: 1.05rem;
    max-width: 56ch;
    margin-bottom: 1.5rem;
}

.auth-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.auth-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    max-width: 44rem;
}

.auth-metric-card {
    background: rgba(255, 250, 244, 0.72);
    border: 1px solid rgba(29, 41, 57, 0.08);
    border-radius: 1.2rem;
    padding: 1rem 1rem 0.95rem;
    box-shadow: 0 14px 30px rgba(27, 39, 51, 0.07);
}

.auth-metric-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #9a4620;
}

.auth-metric-label {
    margin-top: 0.2rem;
    color: var(--crm-muted);
    font-size: 0.92rem;
}

.auth-pills span {
    padding: 0.65rem 0.95rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(29, 41, 57, 0.08);
    font-size: 0.94rem;
}

.auth-contact-card {
    width: min(100%, 36rem);
    display: grid;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(29, 41, 57, 0.08);
    background: rgba(255, 255, 255, 0.58);
    box-shadow: 0 14px 34px rgba(27, 39, 51, 0.06);
}

.auth-contact-card div {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    color: var(--crm-text);
}

.auth-contact-card i {
    color: var(--crm-accent);
    margin-top: 0.15rem;
}

.auth-card,
.topbar,
.panel-card,
.table-panel,
.stat-card {
    background: rgba(255, 250, 244, 0.84);
    border: 1px solid var(--crm-line);
    box-shadow: var(--crm-shadow);
    backdrop-filter: blur(14px);
}

.auth-card {
    width: 100%;
    max-width: 470px;
    border-radius: 1.6rem;
}

.auth-mini-brand {
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(198, 93, 50, 0.1), rgba(34, 48, 70, 0.05));
    border: 1px solid rgba(29, 41, 57, 0.08);
}

.auth-mini-brand-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.auth-mini-brand-subtitle {
    color: var(--crm-muted);
    font-size: 0.92rem;
}

.auth-submit {
    min-height: 3.4rem;
}

.auth-switch {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.95rem;
    color: var(--crm-muted);
}

.auth-switch a {
    color: #9a4620;
    text-decoration: none;
    font-weight: 600;
}

.app-layout {
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(180deg, var(--crm-sidebar) 0%, var(--crm-sidebar-2) 100%);
    color: #fff;
}

.sidebar-desktop {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    overflow-y: auto;
    z-index: 1030;
}

.sidebar-mobile {
    width: min(84vw, 320px);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.92rem 1rem;
    border-radius: 1rem;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateX(2px);
}

.sidebar-brand-title {
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.app-main {
    margin-left: 280px;
    min-width: 0;
    padding: 1.1rem;
}

.mobile-bar {
    display: none;
}

.hamburger-btn {
    width: 48px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: #1f2d40;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 0;
}

.hamburger-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 999px;
}

.topbar {
    border-radius: 1.4rem;
    padding: 1.1rem 1.3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.topbar-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-content {
    padding: 0.15rem 0 1.5rem;
}

.panel-card,
.table-panel,
.stat-card {
    border-radius: 1.35rem;
}

.panel-card,
.table-panel {
    padding: 1.35rem;
}

.stat-card {
    padding: 1.25rem;
    height: 100%;
}

.stat-icon {
    width: 3.15rem;
    height: 3.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: rgba(198, 93, 50, 0.12);
    color: var(--crm-accent);
}

.table-responsive {
    overflow-x: auto;
}

.section-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.section-jump a {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--crm-text);
    background: rgba(255, 250, 244, 0.84);
    border: 1px solid var(--crm-line);
    box-shadow: 0 10px 24px rgba(27, 39, 51, 0.05);
}

.analytics-bars {
    display: grid;
    gap: 1rem;
}

.analytics-bar-row {
    display: grid;
    gap: 0.45rem;
}

.analytics-bar-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.95rem;
}

.analytics-bar-track {
    width: 100%;
    height: 0.8rem;
    background: rgba(34, 48, 70, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.analytics-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #c65d32 0%, #ea9b56 100%);
}

.analytics-bar-fill-alt {
    background: linear-gradient(90deg, #223046 0%, #4e6a8a 100%);
}

.analytics-mini-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--crm-line);
}

.analytics-mini-stat:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.analytics-mini-stat strong {
    font-size: 1.05rem;
}

.table th {
    white-space: nowrap;
    color: var(--crm-muted);
    font-weight: 600;
    font-size: 0.88rem;
}

.gallery-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 1rem;
}

.mobile-brand {
    min-width: 0;
}

.list-group-item {
    border-color: rgba(29, 41, 57, 0.08) !important;
}

.offcanvas.sidebar-mobile .offcanvas-header,
.offcanvas.sidebar-mobile .offcanvas-body {
    background: linear-gradient(180deg, var(--crm-sidebar) 0%, var(--crm-sidebar-2) 100%);
    color: #fff;
}

.invoice-print {
    background: #fff;
}

@media (max-width: 991.98px) {
    .auth-hero {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .auth-copy {
        padding: 0.5rem 0.5rem 0;
    }

    .auth-copy h1 {
        max-width: 100%;
    }

    .auth-metrics {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .sidebar-desktop {
        display: none;
    }

    .app-main {
        margin-left: 0;
        padding: 0.8rem;
    }

    .mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.9rem;
        margin-bottom: 0.9rem;
    }

    .topbar {
        padding: 1rem 1.05rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-meta {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 575.98px) {
    .auth-main {
        padding: 0.9rem;
    }

    .auth-brand-lockup {
        align-items: flex-start;
    }

    .auth-brand-mark {
        width: 3.5rem;
        height: 3.5rem;
        font-size: 1.3rem;
    }

    .auth-card,
    .panel-card,
    .table-panel,
    .stat-card,
    .topbar {
        border-radius: 1rem;
    }

    .panel-card,
    .table-panel {
        padding: 1rem;
    }

    .topbar h1,
    .h4 {
        font-size: 1.45rem;
    }

    .gallery-thumb {
        height: 132px;
    }
}

@media print {
    .sidebar,
    .mobile-bar,
    .topbar,
    .no-print {
        display: none !important;
    }

    body {
        background: #fff;
    }
}
