:root {
    --erp-bg: #f4f7fb;
    --erp-surface: #ffffff;
    --erp-surface-soft: #f8fafc;
    --erp-border: #e5edf7;
    --erp-text: #0f172a;
    --erp-muted: #64748b;
    --erp-blue: #0f6bff;
    --erp-blue-dark: #0f2d68;
    --erp-cyan: #0ea5e9;
    --erp-sidebar: #0f172a;
    --erp-sidebar-2: #111c33;
    --erp-shadow: 0 18px 45px rgba(15, 23, 42, .08);
    --erp-shadow-sm: 0 10px 25px rgba(15, 23, 42, .06);
    --erp-radius: 22px;
    --sidebar-width: 292px;
    --topbar-height: 78px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.erp-body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--erp-text);
    background:
        radial-gradient(circle at top left, rgba(15, 107, 255, .10), transparent 30rem),
        linear-gradient(180deg, #f8fbff 0%, var(--erp-bg) 100%);
}
a { text-decoration: none; }

.app-shell { min-height: 100vh; }
.erp-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background:
        linear-gradient(160deg, rgba(15, 23, 42, .98), rgba(17, 28, 51, .98)),
        radial-gradient(circle at 40% 0%, rgba(15, 107, 255, .35), transparent 20rem);
    color: #fff;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,.08);
    box-shadow: 18px 0 55px rgba(15, 23, 42, .18);
    transition: transform .26s ease;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 18px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-lockup { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand-lockup:hover { color: #fff; }
.brand-mark {
    width: 46px; height: 46px; border-radius: 15px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.08));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-size: 1rem; letter-spacing: .01em; }
.brand-copy small { color: rgba(255,255,255,.58); margin-top: 4px; }
.sidebar-icon-btn,
.topbar-icon-btn {
    border: 0;
    width: 42px; height: 42px;
    border-radius: 14px;
    display: inline-grid; place-items: center;
    background: rgba(255,255,255,.1);
    color: #fff;
}
.sidebar-search-wrap {
    margin: 18px;
    height: 44px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.08);
    color: rgba(255,255,255,.55);
}
.sidebar-search-wrap input {
    width: 100%; border: 0; outline: 0; background: transparent;
    color: #fff; font-size: .92rem;
}
.sidebar-search-wrap input::placeholder { color: rgba(255,255,255,.45); }
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 14px 18px;
}
.nav-section { margin-bottom: 18px; }
.nav-section-label {
    padding: 10px 10px 8px;
    color: rgba(255,255,255,.38);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.erp-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 10px 12px;
    margin: 4px 0;
    border-radius: 16px;
    color: rgba(255,255,255,.76);
    font-weight: 700;
    transition: all .18s ease;
}
.erp-nav-link:hover { color: #fff; background: rgba(255,255,255,.08); transform: translateX(2px); }
.erp-nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, var(--erp-blue), #0ea5e9);
    box-shadow: 0 12px 28px rgba(14, 165, 233, .25);
}
.nav-icon {
    width: 32px; height: 32px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: rgba(255,255,255,.08);
}
.erp-nav-link.active .nav-icon { background: rgba(255,255,255,.18); }
.sidebar-footer { padding: 16px 18px 22px; }
.mini-status-card {
    display: flex; align-items: center; gap: 10px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.08);
}
.mini-status-card strong { display: block; font-size: .85rem; }
.mini-status-card small { color: rgba(255,255,255,.55); }
.pulse-dot { width: 10px; height: 10px; border-radius: 999px; background: #22c55e; box-shadow: 0 0 0 6px rgba(34,197,94,.12); }

.workspace-main { margin-left: var(--sidebar-width); min-height: 100vh; }
.erp-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 26px;
    background: rgba(255,255,255,.84);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(226, 232, 240, .9);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .04);
}
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-icon-btn { background: #fff; color: var(--erp-text); border: 1px solid var(--erp-border); box-shadow: var(--erp-shadow-sm); }
.topbar-title strong { display: block; font-size: .98rem; }
.topbar-title span { display: block; color: var(--erp-muted); font-size: .82rem; margin-top: 2px; }
.topbar-center { flex: 1; max-width: 560px; }
.global-search {
    width: 100%; height: 48px; border-radius: 18px;
    display: flex; align-items: center; gap: 12px;
    padding: 0 14px;
    background: #f8fafc;
    border: 1px solid var(--erp-border);
}
.global-search input { flex: 1; border: 0; outline: 0; background: transparent; }
.global-search kbd { background: #e2e8f0; color: #475569; border-radius: 8px; font-size: .72rem; }
.quick-action-btn {
    height: 44px; border-radius: 15px;
    border: 0;
    background: linear-gradient(135deg, var(--erp-blue), #0ea5e9);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(14, 165, 233, .20);
}
.quick-action-btn:hover { color: #fff; filter: brightness(.98); }
.user-chip {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid var(--erp-border);
    background: #fff;
    border-radius: 18px;
    padding: 6px 10px 6px 6px;
    box-shadow: var(--erp-shadow-sm);
}
.avatar-circle {
    width: 38px; height: 38px; border-radius: 14px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #0f2d68, #0f6bff);
    color: #fff; font-weight: 900;
}
.user-chip-text { flex-direction: column; text-align: left; line-height: 1.2; }
.user-chip-text small { color: var(--erp-muted); }
.enterprise-dropdown {
    border: 1px solid var(--erp-border);
    border-radius: 18px;
    box-shadow: var(--erp-shadow);
    overflow: hidden;
    min-width: 230px;
}
.enterprise-dropdown .dropdown-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.dropdown-profile { padding: 14px; display: flex; flex-direction: column; }
.dropdown-profile small { color: var(--erp-muted); }
.notification-dropdown { width: min(390px, calc(100vw - 30px)); }
.dropdown-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--erp-border); }
.dropdown-head a { font-size: .84rem; font-weight: 800; }
.notification-item { display: flex; gap: 10px; padding: 14px 16px; color: var(--erp-text); border-bottom: 1px solid var(--erp-border); }
.notification-item:hover { background: #f8fafc; color: var(--erp-text); }
.notification-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--erp-blue); margin-top: 8px; flex: 0 0 auto; }
.notification-item span span, .notification-item small, .notification-item em { display: block; }
.notification-item small { color: var(--erp-muted); margin-top: 3px; }
.notification-item em { color: #94a3b8; font-size: .75rem; margin-top: 5px; font-style: normal; }
.notif-badge {
    position: absolute; top: -5px; right: -5px;
    min-width: 18px; height: 18px; border-radius: 999px;
    padding: 0 5px; display: grid; place-items: center;
    background: #ef4444; color: #fff; font-size: .68rem; font-weight: 900;
}
.empty-dropdown { padding: 28px; text-align: center; color: var(--erp-muted); }
.workspace-content { padding: 26px; }

.dashboard-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 22px;
    padding: 30px;
    border-radius: 28px;
    color: #fff;
    background:
        radial-gradient(circle at 90% 0%, rgba(14,165,233,.42), transparent 22rem),
        linear-gradient(135deg, #0f172a 0%, #12316f 52%, #0f6bff 100%);
    box-shadow: var(--erp-shadow);
    margin-bottom: 22px;
    overflow: hidden;
    position: relative;
}
.dashboard-hero::after {
    content: ""; position: absolute; inset: auto -120px -160px auto;
    width: 360px; height: 360px; border-radius: 999px;
    background: rgba(255,255,255,.10);
}
.dashboard-hero > * { position: relative; z-index: 1; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 900; color: rgba(255,255,255,.65); }
.dashboard-hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 950; margin: 8px 0 6px; }
.dashboard-hero p { max-width: 720px; color: rgba(255,255,255,.74); margin: 0; font-size: 1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-btn { border-radius: 16px; font-weight: 900; padding: 11px 15px; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.kpi-card {
    min-height: 132px;
    padding: 18px;
    border-radius: var(--erp-radius);
    background: var(--erp-surface);
    box-shadow: var(--erp-shadow-sm);
    border: 1px solid rgba(226, 232, 240, .8);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    overflow: hidden;
    position: relative;
}
.kpi-card::after { content: ""; position: absolute; inset: auto -60px -70px auto; width: 150px; height: 150px; border-radius: 999px; opacity: .11; background: currentColor; }
.kpi-icon { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.kpi-copy span { color: var(--erp-muted); font-weight: 800; font-size: .9rem; }
.kpi-copy strong { display: block; font-size: 2rem; line-height: 1.1; margin: 5px 0; }
.kpi-copy small { color: #94a3b8; }
.tone-blue { color: #0f6bff; } .tone-blue .kpi-icon { background: #0f6bff; }
.tone-indigo { color: #4f46e5; } .tone-indigo .kpi-icon { background: #4f46e5; }
.tone-cyan { color: #0ea5e9; } .tone-cyan .kpi-icon { background: #0ea5e9; }
.tone-emerald { color: #10b981; } .tone-emerald .kpi-icon { background: #10b981; }
.tone-violet { color: #8b5cf6; } .tone-violet .kpi-icon { background: #8b5cf6; }
.tone-rose { color: #ef4444; } .tone-rose .kpi-icon { background: #ef4444; }
.tone-amber { color: #f59e0b; } .tone-amber .kpi-icon { background: #f59e0b; }
.tone-slate { color: #334155; } .tone-slate .kpi-icon { background: #334155; }

.analytics-grid, .workspace-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}
.enterprise-card {
    background: var(--erp-surface);
    border: 1px solid rgba(226, 232, 240, .82);
    box-shadow: var(--erp-shadow-sm);
    border-radius: var(--erp-radius);
    padding: 20px;
    min-width: 0;
}
.card-head { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.card-head h2 { font-size: 1.1rem; margin: 0 0 4px; font-weight: 900; }
.card-head p { margin: 0; color: var(--erp-muted); font-size: .88rem; }
.card-head > i { width: 42px; height: 42px; border-radius: 15px; display: grid; place-items: center; background: #eff6ff; color: var(--erp-blue); }
.card-head.compact { align-items: flex-start; }
.card-head.compact a { color: var(--erp-blue); font-weight: 900; font-size: .86rem; }
.status-list { display: grid; gap: 10px; }
.status-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px;
    border-radius: 15px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}
.status-row span { color: #475569; font-weight: 750; }
.status-row strong { font-size: 1.05rem; }
.entity-list { display: grid; gap: 10px; }
.entity-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px;
    border-radius: 17px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    color: var(--erp-text);
    transition: transform .16s ease, background .16s ease;
}
.entity-row:hover { color: var(--erp-text); background: #fff; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(15,23,42,.06); }
.entity-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: #eaf2ff; color: var(--erp-blue); flex: 0 0 auto; }
.entity-copy { min-width: 0; flex: 1; }
.entity-copy strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entity-copy small { color: var(--erp-muted); }
.status-pill, .money-pill {
    flex: 0 0 auto;
    font-style: normal;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: .74rem;
    font-weight: 900;
    white-space: nowrap;
}
.status-success { background: #dcfce7; color: #166534; }
.status-warning { background: #fef3c7; color: #92400e; }
.status-danger { background: #fee2e2; color: #991b1b; }
.status-muted { background: #e2e8f0; color: #334155; }
.money-pill { background: #ecfeff; color: #0e7490; }
.empty-state {
    min-height: 120px;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--erp-muted);
    border-radius: 18px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    padding: 24px;
}
.empty-state i { display: block; font-size: 1.8rem; margin-bottom: 8px; color: #94a3b8; }

.card { border-radius: var(--erp-radius); border: 1px solid var(--erp-border); box-shadow: var(--erp-shadow-sm); }
.table { vertical-align: middle; }
.table thead th { color: #475569; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.btn { font-weight: 800; }
.form-control, .form-select { border-radius: 14px; border-color: var(--erp-border); }
.form-control:focus, .form-select:focus { box-shadow: 0 0 0 .2rem rgba(15,107,255,.12); border-color: rgba(15,107,255,.55); }
.sidebar-backdrop { display: none; }

@media (max-width: 1399.98px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1199.98px) {
    .erp-sidebar { transform: translateX(-105%); }
    .erp-sidebar.show { transform: translateX(0); }
    .workspace-main { margin-left: 0; }
    .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1045; backdrop-filter: blur(3px); }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .analytics-grid, .workspace-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767.98px) {
    :root { --topbar-height: 68px; }
    .erp-topbar { padding: 12px 14px; }
    .workspace-content { padding: 16px; }
    .dashboard-hero { padding: 22px; align-items: flex-start; flex-direction: column; border-radius: 24px; }
    .hero-actions { width: 100%; }
    .hero-actions .btn { flex: 1; }
    .kpi-grid, .analytics-grid, .workspace-grid { grid-template-columns: 1fr; }
    .kpi-card { min-height: 118px; }
    .user-chip { padding: 5px; }
    .quick-action-btn span { display: none; }
}
@media (max-width: 420px) {
    .erp-sidebar { width: min(92vw, 292px); }
    .entity-row { align-items: flex-start; flex-wrap: wrap; }
    .status-pill, .money-pill { margin-left: 54px; }
}
/* ==========================================================
   Auth UI — ERP Kohler
   Responsive login + first setup experience
   ========================================================== */
.auth-screen {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(13, 110, 253, 0.16), transparent 34rem),
        radial-gradient(circle at bottom right, rgba(32, 201, 151, 0.12), transparent 28rem),
        linear-gradient(135deg, #f7faff 0%, #eef3fb 100%);
    display: flex;
    align-items: center;
    padding: 32px 0;
}

.auth-container {
    position: relative;
    z-index: 2;
}

.auth-bg-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(12px);
    opacity: 0.55;
    pointer-events: none;
}

.auth-bg-orb-1 {
    width: 260px;
    height: 260px;
    left: -80px;
    top: 12%;
    background: rgba(13, 110, 253, 0.16);
}

.auth-bg-orb-2 {
    width: 340px;
    height: 340px;
    right: -120px;
    bottom: -80px;
    background: rgba(32, 201, 151, 0.14);
}

.auth-shell {
    max-width: 1040px;
    margin: 0 auto;
    min-height: 650px;
    border-radius: 32px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(20px);
}

.auth-hero-panel {
    position: relative;
    align-items: stretch;
    background:
        linear-gradient(135deg, rgba(8, 28, 75, 0.96), rgba(13, 110, 253, 0.92)),
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.24), transparent 18rem);
    color: #fff;
    padding: 56px;
}

.auth-hero-panel::after {
    content: "";
    position: absolute;
    inset: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 26px;
    pointer-events: none;
}

.auth-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-mark,
.auth-logo {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-mark {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1.55rem;
}

.auth-logo {
    background: linear-gradient(135deg, #0d6efd, #0aa2c0);
    color: #fff;
    box-shadow: 0 18px 38px rgba(13, 110, 253, 0.24);
    font-size: 1.45rem;
}

.auth-kicker {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.86;
}

.auth-title {
    max-width: 480px;
    font-size: clamp(2rem, 4vw, 3.35rem);
    line-height: 1.04;
    font-weight: 800;
}

.auth-copy {
    max-width: 440px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.02rem;
    line-height: 1.8;
}

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

.auth-feature-card {
    min-height: 88px;
    border-radius: 20px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    font-weight: 700;
}

.auth-feature-card i {
    opacity: 0.9;
}

.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px 28px;
    background: rgba(255, 255, 255, 0.9);
}

.auth-card {
    width: min(100%, 420px);
}

.auth-setup-card {
    width: 100%;
    padding: 34px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(20px);
}

.auth-alert {
    font-weight: 600;
}

.auth-input-group {
    min-height: 54px;
    display: flex;
    align-items: center;
    border: 1px solid #dce4f2;
    background: #f9fbff;
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-input-group:focus-within {
    border-color: rgba(13, 110, 253, 0.65);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
    background: #fff;
}

.auth-input-group > span {
    width: 50px;
    text-align: center;
    color: #6b778d;
    flex: 0 0 50px;
}

.auth-input-group .form-control {
    min-height: 54px;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding-left: 0;
    font-weight: 600;
}

.auth-password-toggle {
    width: 48px;
    height: 48px;
    margin-right: 4px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #64748b;
    transition: background 0.2s ease, color 0.2s ease;
}

.auth-password-toggle:hover {
    background: rgba(13, 110, 253, 0.08);
    color: #0d6efd;
}

.auth-submit {
    min-height: 54px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #0d6efd, #0aa2c0);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 18px 34px rgba(13, 110, 253, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-submit:hover,
.auth-submit:focus {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 22px 42px rgba(13, 110, 253, 0.28);
}

.auth-footer-note {
    color: #718096;
    font-size: 0.88rem;
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .auth-screen {
        align-items: flex-start;
        padding: 22px 0;
    }

    .auth-shell {
        max-width: 560px;
        min-height: auto;
        border-radius: 28px;
    }

    .auth-form-panel {
        padding: 34px 22px;
    }
}

@media (max-width: 575.98px) {
    .auth-screen {
        padding: 0;
        background: #fff;
    }

    .auth-container {
        padding: 0;
    }

    .auth-shell,
    .auth-setup-card {
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none !important;
        border: 0;
    }

    .auth-form-panel,
    .auth-setup-card {
        padding: 28px 18px;
    }

    .auth-input-group {
        min-height: 52px;
    }

    .auth-input-group .form-control {
        min-height: 52px;
    }
}
