:root{--bg:#f6f8fb;--card:#fff;--text:#172033;--muted:#64748b;--line:#e5eaf1;--accent:#0f5f6d;--accent2:#0b4a55}body{background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif}.erp-shell{display:flex;min-height:100vh}.erp-sidebar{width:270px;background:#fff;border-right:1px solid var(--line);padding:22px;position:sticky;top:0;height:100vh}.brand{display:flex;align-items:center;gap:12px}.brand-mark{width:44px;height:44px;border-radius:14px;background:var(--accent);color:#fff;display:grid;place-items:center;font-weight:800}.brand span{display:block;color:var(--muted);font-size:12px}.nav-link{color:#334155;border-radius:12px;padding:10px 12px;margin:2px 0}.nav-link:hover{background:#eef7f8;color:var(--accent)}.erp-main{flex:1;min-width:0}.erp-topbar{height:86px;background:#fff;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;padding:0 28px}.erp-topbar h1{font-size:22px;margin:0}.erp-topbar p{margin:3px 0 0;color:var(--muted)}.user-pill{display:flex;align-items:center;gap:10px;background:#f8fafc;border:1px solid var(--line);border-radius:18px;padding:8px 12px}.user-pill small{color:var(--muted)}.user-pill a{color:var(--accent);text-decoration:none}.page-head{display:flex;justify-content:space-between;margin-bottom:18px}.page-head h2{font-weight:800}.page-head p{color:var(--muted)}.kpi-card,.panel{background:var(--card);border:1px solid var(--line);border-radius:20px;box-shadow:0 10px 30px rgba(15,23,42,.04)}.kpi-card{padding:20px}.kpi-card span{color:var(--muted);font-size:13px}.kpi-card strong{display:block;font-size:27px;margin:8px 0}.kpi-card p{margin:0;color:var(--text);font-weight:600}.panel{padding:22px}.panel h3{font-size:17px;margin-bottom:16px}.list-line{border-bottom:1px solid var(--line);padding:10px 0}.list-line b,.list-line span{display:block}.list-line span{color:var(--muted);font-size:13px}.auth-body{min-height:100vh;background:linear-gradient(135deg,#f6f8fb,#eaf5f6);display:grid;place-items:center}.login-wrap{width:100%;max-width:430px;padding:20px}.login-card{background:#fff;border:1px solid var(--line);border-radius:28px;padding:34px;box-shadow:0 24px 80px rgba(15,23,42,.12)}.btn-accent{background:var(--accent);color:#fff}.btn-accent:hover{background:var(--accent2);color:#fff}.demo-note{color:var(--muted);font-size:12px;text-align:center;margin-top:18px}@media(max-width:900px){.erp-sidebar{display:none}.erp-topbar{height:auto;padding:18px;align-items:flex-start;gap:12px;flex-direction:column}}
/* Patch: scrollable sidebar */
.erp-sidebar{
    height:100vh !important;
    max-height:100vh !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    position:sticky !important;
    top:0 !important;
    scrollbar-width:thin;
    scrollbar-color:#cbd5e1 transparent;
}
.erp-sidebar::-webkit-scrollbar{width:8px;}
.erp-sidebar::-webkit-scrollbar-track{background:transparent;}
.erp-sidebar::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:999px;}
.erp-sidebar::-webkit-scrollbar-thumb:hover{background:#94a3b8;}
.erp-sidebar .nav{padding-bottom:32px;}
.nav-section{
    margin:18px 0 6px;
    padding:0 12px;
    color:#94a3b8;
    font-size:11px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.08em;
}
@media(max-width:900px){
    .erp-sidebar{
        display:none !important;
    }
}
/* Patch: ERP UI responsive, accessible, light-theme alignment */
:root{
    --bg:#f6f8fb;
    --surface:#ffffff;
    --surface-soft:#f8fafc;
    --text:#172033;
    --text-soft:#334155;
    --muted:#64748b;
    --line:#e5eaf1;
    --line-strong:#cbd5e1;
    --accent:#0f5f6d;
    --accent-hover:#0b4a55;
    --accent-soft:#e7f4f6;
    --success:#16a34a;
    --warning:#d97706;
    --danger:#dc2626;
    --info:#2563eb;
    --radius:18px;
    --shadow:0 12px 32px rgba(15,23,42,.06);
    --focus:0 0 0 .22rem rgba(15,95,109,.22);
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
    background:var(--bg) !important;
    color:var(--text) !important;
    font-size:15px;
    line-height:1.55;
    -webkit-font-smoothing:antialiased;
    text-rendering:optimizeLegibility;
}
a{color:var(--accent);}
a:hover{color:var(--accent-hover);}
img{max-width:100%;height:auto;}

.erp-shell{display:flex;min-height:100vh;width:100%;}
.erp-main{flex:1;min-width:0;width:calc(100% - 270px);}
.container-fluid{max-width:1680px;}

.erp-sidebar{
    width:270px;
    flex:0 0 270px;
    background:var(--surface) !important;
    border-right:1px solid var(--line);
    height:100vh !important;
    max-height:100vh !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    position:sticky !important;
    top:0 !important;
    z-index:1030;
    scrollbar-width:thin;
    scrollbar-color:var(--line-strong) transparent;
}
.erp-sidebar::-webkit-scrollbar{width:8px;}
.erp-sidebar::-webkit-scrollbar-track{background:transparent;}
.erp-sidebar::-webkit-scrollbar-thumb{background:var(--line-strong);border-radius:999px;}
.erp-sidebar .brand{margin-bottom:18px;}
.erp-sidebar .nav{padding-bottom:42px;}
.nav-section{
    margin:18px 0 6px;
    padding:0 12px;
    color:#94a3b8;
    font-size:11px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.08em;
}
.nav-link{
    color:var(--text-soft) !important;
    border-radius:13px;
    padding:10px 12px;
    margin:2px 0;
    font-weight:650;
    min-height:42px;
    display:flex;
    align-items:center;
    transition:background .15s ease,color .15s ease,transform .15s ease;
}
.nav-link:hover,.nav-link:focus{
    background:var(--accent-soft) !important;
    color:var(--accent) !important;
    transform:translateX(2px);
    outline:none;
}

.erp-topbar{
    min-height:86px;
    height:auto !important;
    background:rgba(255,255,255,.94) !important;
    backdrop-filter:blur(10px);
    border-bottom:1px solid var(--line);
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    padding:18px 28px !important;
    position:sticky;
    top:0;
    z-index:1010;
}
.erp-topbar h1{font-size:clamp(18px,2vw,23px);line-height:1.2;font-weight:850;margin:0;}
.erp-topbar p{color:var(--muted);font-size:13px;margin:4px 0 0;}
.user-pill{max-width:100%;flex-wrap:wrap;justify-content:flex-end;}

.mobile-menu-btn{
    display:none;
    border:1px solid var(--line);
    background:var(--surface);
    color:var(--text);
    border-radius:12px;
    padding:9px 12px;
    font-weight:800;
}
.sidebar-backdrop{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(15,23,42,.42);
    z-index:1020;
}

.page-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
    margin-bottom:20px;
}
.page-head h2{font-size:clamp(22px,2.6vw,32px);font-weight:850;margin:0;letter-spacing:-.025em;}
.page-head p{color:var(--muted);margin:6px 0 0;max-width:760px;}

.panel,.kpi-card,.login-card,.detail-box{
    background:var(--surface) !important;
    border:1px solid var(--line) !important;
    border-radius:var(--radius) !important;
    box-shadow:var(--shadow);
}
.panel{padding:clamp(16px,2vw,24px);overflow:hidden;}
.kpi-card{padding:20px;min-height:126px;color:var(--text);}
.kpi-card:hover{border-color:#bfdde2 !important;box-shadow:0 18px 44px rgba(15,95,109,.10);}
.kpi-card span{display:block;color:var(--muted);font-size:13px;font-weight:700;margin-bottom:8px;}
.kpi-card strong{display:block;color:var(--text);font-size:clamp(20px,2.6vw,30px);line-height:1.15;word-break:break-word;}
.kpi-card p{color:var(--text-soft);font-weight:650;margin:8px 0 0;}
.detail-box{padding:16px;min-height:94px;}
.detail-box span{display:block;color:var(--muted);font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;margin-bottom:6px;}
.detail-box strong{font-size:16px;color:var(--text);font-weight:750;}

.table-responsive{
    width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    border-radius:14px;
}
.table{margin-bottom:0;vertical-align:middle;color:var(--text);}
.table th{
    background:var(--surface-soft) !important;
    color:var(--text-soft);
    font-size:12px;
    font-weight:850;
    text-transform:uppercase;
    letter-spacing:.035em;
    border-bottom:1px solid var(--line) !important;
    white-space:nowrap;
}
.table td{border-color:var(--line) !important;color:var(--text-soft);}
.table-hover tbody tr:hover{background:#f9fcfd;}
.table .btn{white-space:nowrap;}

.form-label,label{color:var(--text-soft);font-weight:750;margin-bottom:6px;}
.form-control,.form-select,textarea.form-control{
    border:1px solid var(--line-strong) !important;
    border-radius:12px !important;
    min-height:42px;
    color:var(--text) !important;
    background-color:#fff !important;
}
.form-control:focus,.form-select:focus,textarea.form-control:focus,.btn:focus,.form-check-input:focus,a:focus-visible{
    border-color:var(--accent) !important;
    box-shadow:var(--focus) !important;
    outline:none !important;
}
.form-control::placeholder{color:#94a3b8;}
.form-check-input:checked{background-color:var(--accent);border-color:var(--accent);}

.btn{border-radius:12px;font-weight:750;min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:6px;}
.btn-sm{min-height:32px;border-radius:10px;}
.btn-accent{background:var(--accent) !important;border-color:var(--accent) !important;color:#fff !important;}
.btn-accent:hover,.btn-accent:focus{background:var(--accent-hover) !important;border-color:var(--accent-hover) !important;color:#fff !important;}
.btn-outline-secondary{border-color:var(--line-strong);color:var(--text-soft);}
.btn-outline-secondary:hover{background:var(--surface-soft);color:var(--text);border-color:#94a3b8;}
.badge{border-radius:999px;padding:.45em .7em;font-weight:800;}
.alert{border-radius:14px;border:1px solid var(--line);}

.login-wrap{width:100%;max-width:440px;padding:22px;}
.auth-body{background:radial-gradient(circle at top left,#e7f4f6,transparent 34%),linear-gradient(135deg,#f6f8fb,#edf6f7) !important;}

/* Make generated older pages consistent */
.panel > table,.panel form > table{display:block;overflow-x:auto;width:100%;-webkit-overflow-scrolling:touch;}
.panel > table tbody,.panel form > table tbody,.panel > table thead,.panel form > table thead{display:table;width:100%;}
.panel h3,.panel h4{font-weight:850;color:var(--text);}
.text-muted{color:var(--muted) !important;}

@media(max-width:1200px){
    .erp-sidebar{width:245px;flex-basis:245px;}
    .erp-main{width:calc(100% - 245px);}
    .erp-topbar{padding:16px 20px !important;}
}
@media(max-width:900px){
    .mobile-menu-btn{display:inline-flex;}
    .erp-shell{display:block;}
    .erp-main{width:100%;}
    .erp-sidebar{
        display:block !important;
        position:fixed !important;
        left:0;
        top:0;
        transform:translateX(-105%);
        transition:transform .22s ease;
        box-shadow:24px 0 60px rgba(15,23,42,.22);
    }
    body.sidebar-open .erp-sidebar{transform:translateX(0);}
    body.sidebar-open .sidebar-backdrop{display:block;}
    .erp-topbar{position:sticky;top:0;align-items:flex-start;}
    .erp-topbar > div:first-child{width:100%;}
    .user-pill{width:100%;justify-content:space-between;}
    .page-head{flex-direction:column;align-items:stretch;}
    .page-head .btn,.page-head a.btn,.page-head button{width:100%;}
    .panel{padding:16px;}
    .kpi-card{min-height:auto;}
    .row.g-3>[class*="col-"],.row.g-4>[class*="col-"]{margin-bottom:0;}
}
@media(max-width:640px){
    body{font-size:14px;}
    main.container-fluid{padding-left:12px !important;padding-right:12px !important;}
    .erp-topbar{padding:14px 12px !important;}
    .brand-mark{width:38px;height:38px;border-radius:12px;}
    .table{font-size:13px;}
    .table th,.table td{white-space:nowrap;padding:.65rem .7rem;}
    .btn,.form-control,.form-select{width:100%;}
    .d-flex.gap-2,.d-flex.gap-3{flex-direction:column;align-items:stretch !important;}
    form.d-inline{display:block !important;margin-top:6px;}
    .text-end{text-align:left !important;}
    .login-card{padding:24px;border-radius:22px;}
}

@media print{
    body{background:#fff !important;color:#000 !important;}
    .erp-sidebar,.erp-topbar,.btn,.page-head a,.sidebar-backdrop,.mobile-menu-btn{display:none !important;}
    .erp-main{width:100% !important;}
    .panel,.kpi-card{box-shadow:none !important;border:1px solid #ddd !important;break-inside:avoid;}
    .container-fluid{max-width:none !important;padding:0 !important;}
    .table th{background:#f3f4f6 !important;color:#000 !important;}
}

@media(prefers-reduced-motion:reduce){
    *,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;scroll-behavior:auto !important;transition-duration:.01ms !important;}
}
/* Patch: LeatherEdge brand sizing */
.erp-topbar h1{
    letter-spacing:-.035em;
}
.erp-sidebar .brand strong{
    font-size:16px;
    letter-spacing:-.02em;
}
.erp-sidebar .brand span{
    max-width:170px;
    line-height:1.35;
}
/* Patch: final sidebar/header branding */
.erp-sidebar .brand strong{
    font-size:17px !important;
    font-weight:850 !important;
    letter-spacing:-.025em;
    color:#172033;
}
.erp-sidebar .brand span{
    display:block;
    max-width:180px;
    color:#64748b;
    font-size:12px !important;
    line-height:1.35;
    font-weight:650;
}
.erp-topbar h1{
    color:#172033;
    font-weight:850;
    letter-spacing:-.035em;
}
.erp-topbar p{
    color:#64748b;
    font-weight:500;
}
/* Patch: premium login page */
.auth-body{
    min-height:100vh;
    display:block !important;
    background:
        radial-gradient(circle at 8% 12%, rgba(15,95,109,.14), transparent 28%),
        radial-gradient(circle at 88% 88%, rgba(37,99,235,.10), transparent 30%),
        linear-gradient(135deg,#f6f8fb,#edf6f7) !important;
}
.login-premium-shell{
    min-height:100vh;
    display:grid;
    grid-template-columns:minmax(0,1.08fr) minmax(420px,.92fr);
    gap:28px;
    padding:28px;
}
.login-hero-panel,
.login-form-panel{
    border-radius:32px;
}
.login-hero-panel{
    position:relative;
    overflow:hidden;
    background:
        linear-gradient(145deg,rgba(15,95,109,.96),rgba(11,74,85,.94)),
        url('https://placehold.co/1200x900/e7f4f6/0f5f6d?text=LeatherEdge');
    color:#fff;
    padding:34px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    box-shadow:0 28px 90px rgba(15,95,109,.22);
}
.login-hero-panel:before{
    content:"";
    position:absolute;
    inset:auto -120px -180px auto;
    width:420px;
    height:420px;
    border-radius:999px;
    background:rgba(255,255,255,.10);
}
.login-hero-panel:after{
    content:"";
    position:absolute;
    inset:90px auto auto -140px;
    width:280px;
    height:280px;
    border-radius:999px;
    background:rgba(255,255,255,.08);
}
.login-brand-row{
    position:relative;
    z-index:1;
    display:flex;
    align-items:center;
    gap:14px;
}
.login-brand-row strong{
    display:block;
    font-size:22px;
    letter-spacing:-.035em;
}
.login-brand-row span{
    display:block;
    color:rgba(255,255,255,.78);
    font-size:13px;
    margin-top:2px;
}
.brand-mark-lg{
    width:54px !important;
    height:54px !important;
    border-radius:18px !important;
    background:#fff !important;
    color:#0f5f6d !important;
    box-shadow:0 12px 30px rgba(0,0,0,.12);
}
.login-hero-content{
    position:relative;
    z-index:1;
    max-width:760px;
    margin:60px 0;
}
.eyebrow{
    display:inline-flex;
    align-items:center;
    gap:8px;
    font-size:12px;
    font-weight:850;
    letter-spacing:.12em;
    text-transform:uppercase;
    color:#0f5f6d;
    background:#e7f4f6;
    padding:7px 10px;
    border-radius:999px;
}
.login-hero-content .eyebrow{
    color:#fff;
    background:rgba(255,255,255,.14);
}
.login-hero-content h1{
    font-size:clamp(34px,5vw,64px);
    line-height:.98;
    letter-spacing:-.06em;
    font-weight:900;
    margin:20px 0;
}
.login-hero-content p{
    font-size:17px;
    line-height:1.7;
    color:rgba(255,255,255,.82);
    max-width:680px;
}
.login-feature-grid{
    position:relative;
    z-index:1;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
}
.login-feature-grid div,
.login-mini-stats div{
    background:rgba(255,255,255,.12);
    border:1px solid rgba(255,255,255,.18);
    border-radius:18px;
    padding:16px;
    backdrop-filter:blur(10px);
}
.login-feature-grid b,
.login-feature-grid span,
.login-mini-stats strong,
.login-mini-stats span{
    display:block;
}
.login-feature-grid b{
    color:#fff;
    font-size:15px;
    margin-bottom:5px;
}
.login-feature-grid span,
.login-mini-stats span{
    color:rgba(255,255,255,.76);
    font-size:13px;
}
.login-mini-stats{
    position:relative;
    z-index:1;
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:14px;
    margin-top:18px;
}
.login-mini-stats strong{
    font-size:24px;
    color:#fff;
    line-height:1;
    margin-bottom:6px;
}
.login-form-panel{
    display:grid;
    place-items:center;
    padding:20px;
}
.login-card-premium{
    width:100%;
    max-width:480px;
    padding:38px !important;
    border-radius:30px !important;
    box-shadow:0 24px 90px rgba(15,23,42,.12) !important;
}
.login-card-head h2{
    font-size:30px;
    font-weight:900;
    letter-spacing:-.045em;
    margin:16px 0 8px;
}
.login-card-head p{
    color:#64748b;
    margin-bottom:26px;
}
.login-form-meta{
    display:flex;
    justify-content:space-between;
    align-items:center;
    color:#64748b;
    font-size:13px;
    margin:4px 0 20px;
}
.login-security-note{
    margin-top:20px;
    padding:14px;
    border-radius:16px;
    background:#f8fafc;
    border:1px solid #e5eaf1;
    color:#64748b;
    font-size:13px;
    line-height:1.5;
}
.login-security-note b{color:#172033;}
.demo-note{
    color:#64748b;
    font-size:12px;
    text-align:center;
    margin-top:18px;
    line-height:1.6;
}
@media(max-width:1000px){
    .login-premium-shell{
        grid-template-columns:1fr;
        padding:18px;
    }
    .login-hero-panel{
        min-height:auto;
    }
    .login-hero-content{
        margin:38px 0;
    }
}
@media(max-width:640px){
    .login-premium-shell{padding:10px;gap:12px;}
    .login-hero-panel{padding:22px;border-radius:24px;}
    .login-feature-grid,.login-mini-stats{grid-template-columns:1fr;}
    .login-form-panel{padding:0;}
    .login-card-premium{padding:24px !important;border-radius:24px !important;}
    .login-form-meta{align-items:flex-start;flex-direction:column;gap:8px;}
}