:root {
    --navy: #243247;
    --navy-strong: #192638;
    --blue: #4773b8;
    --blue-soft: #edf3fb;
    --green: #378d72;
    --green-soft: #eaf5f1;
    --amber: #c58a38;
    --amber-soft: #fbf3e7;
    --red: #c55b62;
    --red-soft: #faecee;
    --purple: #7768ad;
    --bg: #f5f7fa;
    --card: #ffffff;
    --border: #e1e6ed;
    --text: #1d2939;
    --muted: #68768a;
    --shadow: 0 5px 18px rgba(25, 38, 56, .055);
}

html { background: var(--bg); }
body { color: var(--text); background: var(--bg); font-size: 14px; }
button, input, select, textarea { letter-spacing: 0; }

.sidebar {
    width: 250px;
    padding: 20px 14px;
    background: linear-gradient(180deg, #1b2a3e 0%, #223751 100%);
    border-right: 1px solid rgba(255,255,255,.06);
    box-shadow: 8px 0 28px rgba(22, 34, 51, .1);
}

.sidebar-brand {
    min-height: 64px;
    margin: 0 2px 18px;
    padding: 0 8px 18px;
    border-bottom: 1px solid rgba(255,255,255,.09);
}

.sidebar-brand strong { font-size: 16px; font-weight: 750; }
.sidebar-brand small { margin-top: 2px; color: #9fadc0; }
.brand-mark.small-mark {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 10px;
    background: linear-gradient(145deg, #4a91c7, #4969bd 65%, #34518e);
    box-shadow: 0 8px 18px rgba(5, 14, 29, .24);
}
.brand-mark.small-mark span { font-size: 16px; font-weight: 850; }
.brand-mark.small-mark span:last-child { margin-left: -2px; color: #d7f4e8; }

.sidebar nav {
    display: block;
    flex: 1;
    overflow-y: auto;
    padding: 0 2px 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.12) transparent;
}
.nav-group { margin-bottom: 10px; }
.nav-group-title {
    padding: 0 12px 5px;
    color: #8193aa;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
}
.sidebar nav a {
    position: relative;
    display: flex;
    min-height: 38px;
    margin-bottom: 4px;
    padding: 8px 31px 8px 38px;
    border-radius: 7px;
    border: 1px solid rgba(255,255,255,.045);
    background: rgba(255,255,255,.035);
    color: #d1dbea;
    font-size: 13px;
    font-weight: 620;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.sidebar nav a::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8294aa;
    transform: translateY(-50%);
    box-shadow: 0 0 0 4px rgba(130,148,170,.08);
}
.sidebar nav a:hover { color: #fff; border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.085); transform: translateX(2px); }
.sidebar nav a.active {
    background: linear-gradient(100deg, rgba(76,119,185,.96), rgba(75,102,176,.94));
    border-color: rgba(137,177,235,.45);
    color: #fff;
    box-shadow: 0 6px 16px rgba(10, 24, 45, .2);
}
.sidebar nav a.active::before { background: #fff; box-shadow: 0 0 0 5px rgba(255,255,255,.14); }
.sidebar nav a.nav-blue::before { background: #72a7f1; }
.sidebar nav a.nav-cyan::before { background: #58b9cc; }
.sidebar nav a.nav-violet::before { background: #9a87dc; }
.sidebar nav a.nav-amber::before { background: #e0a84f; }
.sidebar nav a.nav-indigo::before { background: #768ddb; }
.sidebar nav a.nav-green::before { background: #5fbe91; }
.sidebar nav a.nav-red::before { background: #dd7b80; }
.sidebar nav a.nav-teal::before { background: #55b5a8; }
.sidebar nav a.nav-purple::before { background: #aa82cc; }
.sidebar nav a.nav-slate::before { background: #9aa9ba; }
.sidebar nav a.active::before { background: #fff; }
.nav-label { flex: 1; }
.nav-arrow {
    position: absolute;
    right: 13px;
    top: 50%;
    color: #7f91a8;
    font-size: 17px;
    font-weight: 400;
    transform: translateY(-52%);
}
.sidebar nav a:hover .nav-arrow,
.sidebar nav a.active .nav-arrow { color: #fff; }
.sidebar-workspace {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 7px 2px 0;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 8px;
    background: linear-gradient(120deg, rgba(255,255,255,.075), rgba(255,255,255,.025));
    color: #e6edf7;
}
.workspace-monogram {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: rgba(87,135,202,.3);
    color: #dcecff;
    font-size: 10px;
    font-weight: 850;
}
.sidebar-workspace strong,
.sidebar-workspace small { display: block; }
.sidebar-workspace strong { font-size: 11px; }
.sidebar-workspace small { margin-top: 2px; color: #91a3b9; font-size: 9px; }

.app-main { margin-left: 250px; }
.topbar {
    height: 70px;
    padding: 0 26px;
    border-color: var(--border);
    background: rgba(255,255,255,.97);
    box-shadow: 0 2px 10px rgba(25,38,56,.035);
}
.topbar-title strong { font-size: 15px; font-weight: 750; }
.topbar-title small { margin-top: 2px; }
.user-box { padding-left: 16px; border-left: 1px solid var(--border); }
.user-box b { font-size: 13px; }
.avatar { width: 36px; height: 36px; background: #526ab7; box-shadow: 0 4px 12px rgba(72,96,170,.2); }
.icon-btn { width: 40px; height: 40px; padding: 10px; }
.icon-btn span { display: block; height: 2px; margin: 4px 0; background: var(--text); border-radius: 4px; }

.content { max-width: 1540px; padding: 24px 26px 34px; }
.page-head { align-items: center; margin-bottom: 18px; }
.page-head h1 { font-size: 23px; font-weight: 760; }
.page-head p { font-size: 13px; }

.welcome-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 122px;
    margin-bottom: 16px;
    padding: 24px 28px;
    overflow: hidden;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    background: linear-gradient(110deg, #fff 0%, #f7f9fc 62%, #edf3fa 100%);
    box-shadow: var(--shadow);
}
.welcome-panel::after { content: ""; position: absolute; right: -42px; bottom: -82px; width: 230px; height: 160px; border: 24px solid rgba(71,115,184,.065); border-radius: 50%; }
.welcome-panel h1 { margin: 5px 0 4px; font-size: 25px; font-weight: 780; }
.welcome-panel p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--blue); font-size: 10px; font-weight: 800; }
.welcome-brand { position: relative; z-index: 1; min-width: 245px; text-align: right; color: var(--blue); font-size: 22px; }
.welcome-brand strong { color: var(--navy); }
.welcome-brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }

.card, .summary-box {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    box-shadow: var(--shadow);
}
.card { padding: 19px; }
.card h3 { margin-top: 0; font-size: 16px; }
.card:hover { border-color: #d7dee8; }
.section-heading b { font-size: 15px; }
.section-heading p { margin: 2px 0 14px; color: var(--muted); font-size: 12px; }

.quick-grid { gap: 12px; }
.quick {
    position: relative;
    min-height: 72px;
    padding: 14px 16px 14px 21px;
    gap: 11px;
    border-color: var(--border);
    box-shadow: 0 2px 8px rgba(25,38,56,.025);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.quick::before { content: ""; position: absolute; left: 0; top: 13px; bottom: 13px; width: 4px; border-radius: 0 4px 4px 0; background: var(--blue); }
.quick-blue { background: linear-gradient(110deg, #fff, #f5f8fd); }
.quick-blue::before { background: #5986ca; }
.quick-green { background: linear-gradient(110deg, #fff, #f3faf7); }
.quick-green::before { background: #43a27f; }
.quick-amber { background: linear-gradient(110deg, #fff, #fdf8f0); }
.quick-amber::before { background: #d59a43; }
.quick-purple { background: linear-gradient(110deg, #fff, #f8f5fc); }
.quick-purple::before { background: #8875bc; }
.quick:hover { border-color: #bdcbe0; box-shadow: 0 7px 17px rgba(25,38,56,.07); }
.quick > span { flex: 1; }
.quick b, .quick small { display: block; }
.quick b { font-size: 13px; }
.quick small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 500; }
.quick i { color: #8290a3; font-size: 21px; font-style: normal; }
.kpi-grid { gap: 14px; }
.kpi { min-height: 128px; padding: 21px 18px 18px; transition: transform .16s ease, box-shadow .16s ease; border-top: 3px solid #7397ca; }
.kpi:nth-child(2) { border-top-color: #8b7ac2; }
.kpi:nth-child(3) { border-top-color: #48a180; }
.kpi:nth-child(4) { border-top-color: #7a8ca3; }
.kpi:nth-child(5) { border-top-color: #42a27d; }
.kpi:nth-child(6) { border-top-color: #5b82c2; }
.kpi:nth-child(7) { border-top-color: #d29a46; }
.kpi:nth-child(8) { border-top-color: #9879bd; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 9px 22px rgba(25,38,56,.075); }
.kpi .label { color: #526175; font-size: 12px; }
.kpi .value { margin: 10px 0 7px; color: #17243a; font-size: 23px; }
.kpi .hint { font-size: 11px; }
.kpi .kicon { width: 40px; height: 40px; right: 15px; top: 15px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); }

.table-wrap { border-radius: 8px; }
.table { font-size: 13px; }
.table th { padding: 11px 12px; background: #f7f9fb; color: #68768a; font-size: 10px; font-weight: 800; }
.table td { padding: 12px; border-color: #edf0f4; vertical-align: middle; }
.table tbody tr:nth-child(even) { background: #fbfcfd; }
.table tbody tr:hover { background: #f3f7fb; }

.btn { min-height: 38px; padding: 8px 14px; border-radius: 7px; font-size: 13px; transition: filter .15s ease, transform .15s ease, box-shadow .15s ease; }
.btn:hover { filter: brightness(.98); transform: translateY(-1px); }
.btn.primary { background: #4773b8; box-shadow: 0 4px 10px rgba(71,115,184,.16); }
.btn.success { background: #378d72; box-shadow: 0 4px 10px rgba(55,141,114,.14); }
.btn.danger { background: #c55b62; }
.btn.outline { color: #405168; border-color: #d6dde6; background: #fff; }
.btn.small { min-height: 31px; padding: 5px 9px; font-size: 11px; }

.badge { border-radius: 5px; padding: 5px 8px; font-size: 10px; }
.badge.pending { background: var(--amber-soft); color: #8f611e; }
.badge.production { background: var(--blue-soft); color: #3d6297; }
.badge.ready { background: var(--green-soft); color: #2d745f; }
.badge.delivered { background: #eef1f5; color: #556477; }
.badge.cancelled { background: var(--red-soft); color: #a4484e; }

.form-grid { gap: 15px 18px; }
.field label { margin-bottom: 6px; color: #36465b; font-size: 12px; font-weight: 700; }
input, select, textarea { min-height: 42px; padding: 9px 11px; border-color: #d5dce5; border-radius: 7px; background: #fff; font-size: 13px; }
textarea { min-height: 92px; }
input:hover, select:hover, textarea:hover { border-color: #bcc8d7; }
input:focus, select:focus, textarea:focus { border-color: #7294c6; outline: 3px solid rgba(71,115,184,.1); }
.summary-box { padding: 19px; background: #fafbfd; }
.metric-row { border-color: #e8ecf1; }
.searchbar { max-width: 560px; }
.alert { border: 1px solid transparent; font-size: 13px; }
.alert.success { border-color: #cce8dd; background: #ebf6f2; color: #2b6f5b; }
.alert.danger { border-color: #f0d4d7; background: #faedef; color: #99464d; }

.login-body {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: #eef2f7;
}
.login-body::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    height: 38%;
    background: linear-gradient(115deg, #1b2a3e, #263d5a);
}
.login-body::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    top: 38%;
    height: 4px;
    background: linear-gradient(90deg, #4d79bd 0 45%, #3b9a7b 45% 72%, #c99040 72% 100%);
}
.login-card {
    position: relative;
    z-index: 1;
    width: min(430px, calc(100% - 32px));
    padding: 36px 40px 25px;
    overflow: hidden;
    border: 1px solid #dbe2eb;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(17, 31, 49, .2);
}
.login-color-line {
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    display: grid;
    grid-template-columns: 2fr 1fr .7fr;
}
.login-color-line span:nth-child(1) { background: #4d79bd; }
.login-color-line span:nth-child(2) { background: #3b9a7b; }
.login-color-line span:nth-child(3) { background: #c99040; }
.login-brand { display: flex; flex-direction: column; align-items: center; text-align: center; }
.login-card .login-mark {
    width: 64px;
    height: 64px;
    margin: 0 0 15px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: linear-gradient(145deg, #4a91c7, #4969bd 65%, #34518e);
    box-shadow: 0 9px 20px rgba(52,81,142,.22);
}
.login-mark span { color: #fff; font-size: 21px; font-weight: 850; }
.login-mark span:last-child { margin-left: -3px; color: #d7f4e8; }
.login-eyebrow { color: #5578aa; font-size: 9px; font-weight: 850; letter-spacing: 1px; }
.login-card h1 { margin: 6px 0 2px; color: #19283d; font-size: 25px; font-weight: 780; }
.login-brand p { margin: 0; color: var(--muted); font-size: 12px; }
.login-form { display: grid; gap: 16px; margin-top: 27px; }
.login-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.login-form .field label { margin: 0; color: #293a50; font-size: 12px; }
.login-label span { color: #929dab; font-size: 9px; font-weight: 600; }
.login-form input { min-height: 48px; padding: 11px 13px; border-color: #cfd8e3; background: #f9fbfd; }
.login-form input:focus { background: #fff; }
.login-form .btn.full {
    min-height: 48px;
    margin-top: 3px;
    justify-content: center;
    padding: 10px 17px;
    background: linear-gradient(100deg, #4773b8, #516db4);
    font-size: 13px;
    box-shadow: 0 8px 18px rgba(71,115,184,.23);
}
.login-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    margin-top: 23px;
    padding-top: 16px;
    border-top: 1px solid #e7ebf0;
    color: #647286;
    font-size: 10px;
}
.login-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #47a17f; box-shadow: 0 0 0 4px #e7f4ef; }

.sidebar-backdrop { display: none; }

@media (max-width: 1100px) {
    .welcome-brand { display: none; }
    .content { padding: 20px; }
}

@media (max-width: 760px) {
    .sidebar { width: 252px; }
    .sidebar.open { box-shadow: 20px 0 50px rgba(10,20,35,.25); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 19; border: 0; background: rgba(15,23,42,.36); }
    .sidebar-backdrop.show { display: block; }
    .app-main { margin-left: 0; }
    .topbar { height: 64px; padding: 0 12px; }
    .user-box { padding-left: 8px; }
    .user-box .btn { padding: 6px 9px; }
    .content { padding: 14px; }
    .welcome-panel { min-height: 116px; padding: 20px; }
    .welcome-panel h1 { font-size: 21px; }
    .quick-grid, .kpi-grid { grid-template-columns: 1fr; }
    .quick { min-height: 66px; }
    .page-head h1 { font-size: 21px; }
    .searchbar { width: 100%; flex-wrap: wrap; }
    .searchbar input { min-width: 0; flex: 1; }
    .login-card { padding: 31px 25px 23px; }
    .login-card .login-mark { width: 54px; height: 54px; }
    .login-card h1 { font-size: 21px; }
}

@media print {
    body { background: #fff; }
    .content { max-width: none; }
    .welcome-panel, .quick-actions-panel { display: none !important; }
}

/* Final professional login workspace */
.login-workspace {
    display: grid;
    grid-template-columns: .92fr 1.08fr;
    width: min(860px, calc(100% - 40px));
    padding: 0;
}
.login-product {
    position: relative;
    min-height: 500px;
    padding: 43px 38px 31px;
    overflow: hidden;
    background: linear-gradient(145deg, #1d2e45 0%, #263e5c 100%);
    color: #fff;
}
.login-product::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -120px;
    bottom: -120px;
    border: 28px solid rgba(255,255,255,.045);
    border-radius: 50%;
}
.login-product-brand { display: flex; align-items: center; gap: 14px; }
.login-workspace .login-mark { width: 58px; height: 58px; margin: 0; }
.login-product .login-eyebrow { color: #9cb9de; }
.login-product h1 { margin: 2px 0 0; color: #fff; font-size: 22px; font-weight: 760; }
.login-product-copy { max-width: 300px; margin: 35px 0 29px; color: #c8d5e5; font-size: 13px; line-height: 1.75; }
.login-benefits { display: grid; gap: 18px; }
.login-benefits > div { display: flex; gap: 12px; align-items: flex-start; }
.benefit-mark { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 5px rgba(255,255,255,.055); }
.benefit-mark.blue { background: #73a8ee; }
.benefit-mark.green { background: #63c39a; }
.benefit-mark.amber { background: #dfaa57; }
.login-benefits p { margin: 0; }
.login-benefits strong, .login-benefits small { display: block; }
.login-benefits strong { color: #f6f9fc; font-size: 12px; }
.login-benefits small { margin-top: 2px; color: #91a5bd; font-size: 10px; line-height: 1.5; }
.login-product-footer { position: absolute; left: 38px; right: 38px; bottom: 28px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,.1); }
.login-product-footer span, .login-product-footer small { display: block; }
.login-product-footer span { color: #dfe8f3; font-size: 10px; font-weight: 700; }
.login-product-footer small { margin-top: 2px; color: #8196af; font-size: 9px; }
.login-access { display: flex; flex-direction: column; justify-content: center; min-height: 500px; padding: 43px 46px 32px; background: #fff; }
.login-access-header { margin-bottom: 27px; }
.login-access-header h2 { margin: 6px 0 3px; color: #19283d; font-size: 26px; font-weight: 780; }
.login-access-header p { margin: 0; color: var(--muted); font-size: 12px; }
.login-workspace .login-form { margin: 0; gap: 17px; }
.login-workspace .login-form .btn.full { background: linear-gradient(100deg, #4773b8, #516db4); }
.login-access-note { display: flex; align-items: center; gap: 10px; margin-top: 25px; padding-top: 17px; border-top: 1px solid #e7ebf0; }
.login-access-note strong, .login-access-note small { display: block; }
.login-access-note strong { color: #526176; font-size: 10px; }
.login-access-note small { margin-top: 1px; color: #929dab; font-size: 9px; }

@media (max-width: 760px) {
    .login-workspace { display: block; width: min(430px, calc(100% - 28px)); }
    .login-product { min-height: auto; padding: 25px; }
    .login-product-copy, .login-benefits, .login-product-footer { display: none; }
    .login-workspace .login-mark { width: 50px; height: 50px; }
    .login-product h1 { font-size: 19px; }
    .login-access { min-height: auto; padding: 29px 25px 24px; }
    .login-access-header { margin-bottom: 23px; }
    .login-access-header h2 { font-size: 23px; }
}
