:root {
    --us-navy: #0D3374;
    --us-navy-dark: #082454;
    --us-blue: #2980E6;
    --us-green: #42B058;
    --us-green-dark: #2F8F45;
    --us-dark: #020D22;
    --us-bg: #F4F7FB;
    --us-text: #172033;

    /* Existing modules still use these aliases. */
    --lk-blue: var(--us-navy);
    --lk-blue-dark: var(--us-navy-dark);
    --lk-green: var(--us-green);
    --lk-bg: var(--us-bg);
    --lk-text: var(--us-text);
}

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

a {
    color: var(--lk-blue);
    font-weight: 600;
}

.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(66, 176, 88, .18), transparent 30%),
        linear-gradient(135deg, #edf4fb, #f8fbff);
}

.auth-card {
    border: 1px solid rgba(11, 59, 111, .08);
    border-radius: 24px;
    box-shadow: 0 22px 70px rgba(11, 59, 111, .12);
}

.auth-brand-panel {
    min-height: 560px;
    color: white;
    background: linear-gradient(150deg, var(--lk-blue), var(--lk-blue-dark));
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--lk-blue);
    font-size: 1.35rem;
    font-weight: 800;
    text-decoration: none;
}

.brand-light {
    color: white;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: white;
    background: var(--lk-green);
    box-shadow: 0 8px 20px rgba(66, 176, 88, .32);
}

.btn-primary {
    --bs-btn-bg: var(--lk-blue);
    --bs-btn-border-color: var(--lk-blue);
    --bs-btn-hover-bg: var(--lk-blue-dark);
    --bs-btn-hover-border-color: var(--lk-blue-dark);
}

.btn-success {
    --bs-btn-bg: var(--lk-green);
    --bs-btn-border-color: var(--lk-green);
    --bs-btn-hover-bg: #2F8F45;
    --bs-btn-hover-border-color: #2F8F45;
}

.form-control, .form-select {
    min-height: 48px;
    border-radius: 12px;
    border-color: #d9e2ec;
}

.form-control:focus, .form-select:focus {
    border-color: var(--lk-green);
    box-shadow: 0 0 0 .2rem rgba(66, 176, 88, .18);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    flex: 0 0 250px;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: 24px;
    overflow-x: hidden;
    overflow-y: auto;
    background: white;
    border-right: 1px solid #e7edf4;
    transition: width .22s ease, flex-basis .22s ease, padding .22s ease;
    scrollbar-width: thin;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 44px;
}

.sidebar-header .platform-brand {
    overflow: hidden;
}

.sidebar-toggle {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--us-navy);
    border: 1px solid #dbe5ef;
    border-radius: 10px;
    background: #fff;
    transition: color .18s ease, background .18s ease, border-color .18s ease;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
    color: #fff;
    border-color: var(--us-navy);
    background: var(--us-navy);
    outline: 0;
}

.sidebar-nav {
    min-width: 202px;
}

.sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 46px;
    padding: 11px 14px;
    margin-bottom: 6px;
    overflow: hidden;
    border-radius: 12px;
    color: #52606d;
    text-decoration: none;
    white-space: nowrap;
    transition: width .22s ease, padding .22s ease, color .18s ease, background .18s ease;
}

.sidebar .nav-item i {
    width: 20px;
    flex: 0 0 20px;
    margin-right: 0 !important;
    font-size: 1.05rem;
    line-height: 1;
    text-align: center;
}

.sidebar .nav-label {
    min-width: 0;
    opacity: 1;
}

.sidebar .nav-item.active {
    color: white;
    background: var(--lk-blue);
}

.sidebar .nav-item.disabled {
    opacity: .55;
}

.content-area {
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 72px;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-bottom: 1px solid #e7edf4;
}

.stat-card {
    height: 100%;
    padding: 24px;
    border-radius: 18px;
    background: white;
    box-shadow: 0 12px 35px rgba(15, 40, 70, .07);
}

.stat-label {
    display: block;
    color: #6b7c93;
}

.stat-value {
    display: block;
    margin: 6px 0;
    color: var(--lk-blue);
    font-size: 2rem;
}

@media (max-width: 991px) {
    .sidebar {
        width: 82px;
        flex-basis: 82px;
        padding: 18px 10px;
    }

    .sidebar-header {
        justify-content: center;
    }

    .sidebar-toggle {
        display: none;
    }

    .sidebar-nav {
        min-width: 0;
    }

    .sidebar .nav-item {
        width: 48px;
        justify-content: center;
        margin-inline: auto;
        padding-inline: 0;
    }

    .sidebar .nav-label {
        display: none;
    }
}

/* Milestone 17: onboarding, notifications and workspace settings */
.setup-hero {
    padding: 30px;
    color: white;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--lk-blue), #0d5c82);
    box-shadow: 0 18px 45px rgba(11, 59, 111, .18);
}

.setup-progress-card {
    width: min(360px, 100%);
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 16px;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(8px);
}

.setup-progress-card .progress {
    height: 9px;
    background: rgba(255, 255, 255, .2);
}

.setup-step {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border: 1px solid #e5eaf0;
    border-radius: 16px;
    background: #fff;
}

.setup-step.is-complete {
    border-color: rgba(25, 135, 84, .25);
    background: rgba(25, 135, 84, .035);
}

.setup-step-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    color: var(--lk-blue);
    border-radius: 50%;
    background: rgba(11, 59, 111, .08);
}

.setup-step.is-complete .setup-step-icon {
    color: #198754;
    background: rgba(25, 135, 84, .12);
}

.business-hours-row {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) 120px auto 120px;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eef2f6;
}

.business-hours-row:last-child {
    border-bottom: 0;
}

.business-hours-row .form-control {
    min-height: 42px;
}

.workspace-brand-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding: 18px;
    border-radius: 16px;
    background: #f6f8fb;
}

.workspace-brand-preview .brand-mark {
    background: var(--preview-color);
}

.notification-bell {
    width: 40px;
    height: 34px;
    display: grid;
    place-items: center;
}

.notification-count {
    position: absolute;
    top: -6px;
    right: -7px;
    min-width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    padding: 0 5px;
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #dc3545;
}

.notification-dropdown {
    width: min(390px, calc(100vw - 24px));
    max-height: 520px;
    overflow-y: auto;
    border: 0;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(15, 40, 70, .18);
}

.notification-dropdown-item {
    padding: 14px 16px;
    border-bottom: 1px solid #eef2f6;
    white-space: normal;
}

.notification-dropdown-item.is-unread,
.notification-unread {
    background: rgba(11, 59, 111, .045);
}

.notification-list .list-group-item:last-child {
    border-bottom: 0;
}

.min-w-0 {
    min-width: 0;
}

@media (max-width: 767px) {
    .setup-hero {
        padding: 22px;
    }

    .setup-step {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .business-hours-row {
        grid-template-columns: 1fr 1fr;
    }

    .business-hours-row > span {
        display: none;
    }

    .topbar {
        padding: 0 12px;
    }
}


/* UdyamSync platform branding */
.platform-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    text-decoration: none;
}

.platform-logo-full {
    display: block;
    width: 174px;
    max-width: 100%;
    height: auto;
}

.platform-logo-mark {
    display: none;
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.auth-logo-shell {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 12px 34px rgba(2, 13, 34, .20);
}

.auth-logo-shell .platform-logo-full {
    width: 210px;
}

.auth-brand-panel {
    background:
        radial-gradient(circle at 18% 20%, rgba(41, 128, 230, .34), transparent 32%),
        radial-gradient(circle at 85% 80%, rgba(66, 176, 88, .28), transparent 32%),
        linear-gradient(145deg, var(--us-navy), var(--us-dark));
}

.sidebar {
    box-shadow: 8px 0 30px rgba(13, 51, 116, .035);
}

.sidebar .nav-item.active {
    background: linear-gradient(135deg, var(--us-navy), #155AA6);
    box-shadow: 0 8px 20px rgba(13, 51, 116, .18);
}

.btn-primary {
    --bs-btn-bg: var(--us-navy);
    --bs-btn-border-color: var(--us-navy);
    --bs-btn-hover-bg: #155AA6;
    --bs-btn-hover-border-color: #155AA6;
    --bs-btn-active-bg: var(--us-navy-dark);
    --bs-btn-active-border-color: var(--us-navy-dark);
}

.btn-success {
    --bs-btn-bg: var(--us-green);
    --bs-btn-border-color: var(--us-green);
    --bs-btn-hover-bg: var(--us-green-dark);
    --bs-btn-hover-border-color: var(--us-green-dark);
}

a:hover {
    color: var(--us-blue);
}

@media (max-width: 991px) {
    .platform-logo-full {
        display: none;
    }

    .platform-logo-mark {
        display: block;
    }

    .sidebar .brand {
        justify-content: center;
        width: 100%;
    }
}


/* UdyamSync collapsible icon sidebar */
html.sidebar-collapsed .sidebar {
    width: 82px;
    flex-basis: 82px;
    padding: 18px 10px;
}

html.sidebar-collapsed .sidebar-header {
    justify-content: center;
    flex-direction: column;
    gap: 8px;
}

html.sidebar-collapsed .sidebar-header .platform-brand {
    justify-content: center;
    width: 100%;
}

html.sidebar-collapsed .platform-logo-full { display: none; }
html.sidebar-collapsed .platform-logo-mark { display: block; }

html.sidebar-collapsed .sidebar-nav {
    min-width: 0;
    margin-top: 16px !important;
}

html.sidebar-collapsed .sidebar .nav-item {
    width: 48px;
    justify-content: center;
    margin-inline: auto;
    padding-inline: 0;
}

html.sidebar-collapsed .sidebar .nav-label { display: none; }

@media (prefers-reduced-motion: reduce) {
    .sidebar, .sidebar .nav-item, .sidebar-toggle { transition: none; }
}
