:root {
    --brand: #29abe0;
    --brand-dark: #138dbe;
    --brand-soft: #e7f7fd;
    --navy: #0c2d48;
    --navy-2: #163f5e;
    --ink: #17324a;
    --muted: #6e8395;
    --line: #dce7ee;
    --surface: #ffffff;
    --canvas: #f4f8fb;
    --success: #1f9d78;
    --success-soft: #e9f8f2;
    --warning: #d98b20;
    --warning-soft: #fff5e6;
    --danger: #df5b5b;
    --danger-soft: #fff0f0;
    --shadow: 0 12px 34px rgba(13, 47, 72, .08);
    --radius: 18px;
    --sidebar-width: 252px;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: Tahoma, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg.icon { width: 20px; height: 20px; flex: 0 0 auto; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    z-index: 40;
    inset: 0 0 0 auto;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--navy);
    color: #fff;
    padding: 24px 16px 18px;
}

.sidebar-brand, .login-brand, .mobile-login-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.sidebar-brand { padding: 0 6px 26px; }
.sidebar-brand strong, .login-brand strong { display: block; font-size: 15px; }
.sidebar-brand small, .login-brand small { display: block; color: #a9c0d1; font-size: 11px; margin-top: 2px; }
.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: var(--brand);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(41,171,224,.28);
}
.brand-mark.large { width: 54px; height: 54px; border-radius: 17px; font-size: 28px; }
.sidebar-close { display: none !important; margin-right: auto; color: #fff !important; }
.sidebar-nav { display: grid; gap: 5px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 12px;
    color: #bdd0dd;
    font-weight: 600;
    transition: .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.active { background: var(--brand); color: #fff; box-shadow: 0 9px 24px rgba(0,0,0,.16); }
.sidebar-user {
    margin-top: auto;
    display: grid;
    grid-template-columns: 38px 1fr 34px;
    gap: 9px;
    align-items: center;
    padding: 14px 9px 0;
    border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-user .avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(41,171,224,.2); color: #80d6f6; font-weight: 800; }
.sidebar-user strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user small { display: block; color: #91a9ba; font-size: 10px; }
.sidebar-user .icon-button { color: #a9c0d1; }
.sidebar-backdrop { display: none; }

.app-main { margin-right: var(--sidebar-width); min-height: 100vh; }
.topbar {
    height: 82px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 25;
    backdrop-filter: blur(10px);
}
.topbar-title { display: flex; align-items: center; gap: 10px; }
.topbar h1 { margin: 1px 0 0; font-size: 20px; line-height: 1.2; }
.topbar-kicker { color: var(--muted); font-size: 10px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.menu-button { display: none !important; }
.notification-button { position: relative; }
.notification-button span { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; top: 6px; right: 6px; }
.page-content { max-width: 1540px; margin: auto; padding: 28px 30px 60px; }

.button, .icon-button {
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: .18s ease;
}
.button { min-height: 43px; padding: 0 18px; border-radius: 12px; font-weight: 700; }
.button.primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(41,171,224,.22); }
.button.primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.button.secondary { color: var(--brand-dark); background: var(--brand-soft); border: 1px solid #c4eaf9; }
.button.ghost { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.button.wide { width: 100%; }
.button.small { min-height: 36px; padding: 0 12px; font-size: 12px; }
.button.large-button, .large-button { min-height: 50px; }
.button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.icon-button { width: 38px; height: 38px; border-radius: 11px; background: transparent; color: var(--muted); padding: 0; }
.icon-button:hover { background: var(--brand-soft); color: var(--brand-dark); }

.eyebrow { color: var(--brand-dark); font-weight: 800; font-size: 10px; letter-spacing: .03em; }
.welcome-row, .page-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}
.welcome-row h2, .page-heading-row h2 { margin: 5px 0 3px; font-size: 22px; color: var(--navy); }
.welcome-row p, .page-heading-row p { margin: 0; color: var(--muted); }
.sync-status { color: var(--muted); font-size: 11px; background: #fff; border: 1px solid var(--line); padding: 8px 12px; border-radius: 999px; }
.sync-status span { width: 7px; height: 7px; display: inline-block; background: var(--success); border-radius: 50%; margin-left: 6px; }
.page-heading-row.compact { align-items: flex-start; }
.back-link { color: var(--brand-dark); font-size: 12px; font-weight: 700; }
.title-with-status { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.title-with-status h2 { margin: 0; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.metric-card {
    display: flex;
    gap: 14px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    min-height: 116px;
    box-shadow: 0 7px 20px rgba(13,47,72,.035);
}
.metric-card > div:last-child { min-width: 0; }
.metric-card span { color: var(--muted); font-size: 11px; display: block; }
.metric-card strong { display: block; color: var(--navy); font-size: 24px; line-height: 1.3; margin: 3px 0; white-space: nowrap; }
.metric-card small { color: var(--muted); font-size: 10px; }
.metric-icon { width: 47px; height: 47px; border-radius: 15px; display: grid; place-items: center; flex: 0 0 auto; }
.metric-icon.blue, .mini-icon.blue { background: var(--brand-soft); color: var(--brand-dark); }
.metric-icon.red { background: var(--danger-soft); color: var(--danger); }
.metric-icon.green { background: var(--success-soft); color: var(--success); }
.metric-icon.amber, .mini-icon.amber { background: var(--warning-soft); color: var(--warning); }
.metric-icon.navy { background: #edf2f6; color: var(--navy); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(310px,.85fr); gap: 16px; margin-bottom: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 8px 25px rgba(13,47,72,.035); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.panel-heading h3, .section-heading h3 { margin: 2px 0 0; font-size: 16px; color: var(--navy); }
.text-link { display: inline-flex; align-items: center; gap: 3px; color: var(--brand-dark); font-size: 11px; font-weight: 700; }
.text-link .icon { width: 15px; height: 15px; }
.danger-text { color: var(--danger) !important; }
.success-text { color: var(--success) !important; }
.urgent-list { display: grid; }
.urgent-item { display: grid; grid-template-columns: minmax(180px,1.1fr) minmax(180px,1fr) minmax(105px,.5fr); align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid #edf2f5; }
.urgent-item:first-child { border-top: 0; padding-top: 2px; }
.item-identity, .table-primary { display: flex; align-items: center; gap: 10px; }
.item-identity strong, .table-primary strong { display: block; font-size: 12px; color: var(--ink); }
.item-identity small, .table-primary small { display: block; font-size: 9px; color: var(--muted); }
.item-code { min-width: 48px; display: inline-flex; justify-content: center; direction: ltr; padding: 4px 7px; border-radius: 7px; background: #eef4f7; color: #597083; font: 700 9px "Segoe UI",sans-serif; white-space: nowrap; }
.stock-meter > div:first-child { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; margin-bottom: 6px; }
.progress-track { height: 6px; border-radius: 999px; background: #edf2f5; overflow: hidden; }
.progress-track span { display: block; height: 100%; background: var(--danger); border-radius: inherit; }
.progress-track.green span { background: var(--success); }
.suggested-order small { color: var(--muted); font-size: 9px; display: block; }
.suggested-order strong { font-size: 12px; color: var(--brand-dark); white-space: nowrap; }
.timeline-list { display: grid; }
.timeline-item { display: grid; grid-template-columns: 15px 1fr auto; align-items: center; gap: 10px; padding: 13px 0; border-top: 1px solid #edf2f5; }
.timeline-item:first-child { border-top: 0; padding-top: 2px; }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.timeline-dot.late { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.timeline-item strong { display: block; font-size: 11px; }
.timeline-item small { display: block; color: var(--muted); font-size: 9px; }
.timeline-date { text-align: left; }
.timeline-date strong { font-size: 10px; }
.timeline-date small { color: var(--brand-dark); }
.activity-panel { padding-bottom: 16px; }
.activity-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.activity-item { display: flex; align-items: center; gap: 10px; padding: 11px; background: #f8fafc; border-radius: 12px; }
.activity-item > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--brand-dark); background: var(--brand-soft); }
.activity-item strong { display: block; font-size: 10px; }
.activity-item small { display: block; color: var(--muted); font-size: 8px; }

.alert { display: flex; justify-content: space-between; gap: 15px; align-items: center; padding: 12px 15px; border-radius: 12px; margin-bottom: 14px; border: 1px solid; }
.alert button { border: 0; background: transparent; font-size: 20px; color: inherit; cursor: pointer; }
.alert.success { background: var(--success-soft); color: #14775b; border-color: #c3ecde; }
.alert.error { background: var(--danger-soft); color: #b33d3d; border-color: #f4cccc; }
.alert.warning { background: var(--warning-soft); color: #946014; border-color: #f5deb9; }

.filter-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.search-box { height: 44px; max-width: 500px; flex: 1; display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
.search-box .icon { color: var(--muted); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; }
.search-box button { border: 0; color: var(--brand-dark); font-weight: 700; background: transparent; cursor: pointer; }
.result-count { margin-right: auto; color: var(--muted); font-size: 11px; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel > .panel-heading { padding: 20px 20px 0; }
.responsive-table { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 790px; }
th { padding: 12px 15px; text-align: right; background: #f7fafc; color: #6c8191; font-size: 10px; font-weight: 700; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 15px; border-bottom: 1px solid #edf2f5; font-size: 11px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfe; }
.cell-note { display: block; color: var(--muted); font-size: 8px; margin-top: 2px; }
.method-badge { display: inline-block; padding: 5px 8px; border-radius: 8px; background: #f0f6f9; color: #496779; font-size: 9px; }
.status-badge { display: inline-flex; align-items: center; justify-content: center; min-height: 25px; padding: 0 9px; border-radius: 999px; background: #eef3f6; color: #607687; font-size: 9px; font-weight: 700; white-space: nowrap; }
.status-badge.success, .status-badge.status-received { background: var(--success-soft); color: var(--success); }
.status-badge.danger { background: var(--danger-soft); color: var(--danger); }
.status-badge.warning, .status-badge.status-partial { background: var(--warning-soft); color: var(--warning); }
.status-badge.status-ordered { background: var(--brand-soft); color: var(--brand-dark); }
.status-badge.neutral { background: #edf2f5; color: #637888; }

.supplier-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.supplier-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.supplier-card-head { display: flex; gap: 12px; align-items: center; margin-bottom: 17px; }
.supplier-card-head h3 { margin: 0 0 4px; font-size: 14px; }
.supplier-avatar { width: 45px; height: 45px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.supplier-contact { display: grid; gap: 9px; padding: 13px 0; border-block: 1px solid #edf2f5; }
.supplier-contact > span { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 7px; }
.supplier-contact .icon { width: 16px; color: var(--muted); }
.supplier-contact span span { color: var(--muted); font-size: 9px; }
.supplier-contact strong { font-size: 10px; }
.supplier-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; padding-top: 14px; }
.supplier-stats div { text-align: center; border-left: 1px solid #edf2f5; }
.supplier-stats div:last-child { border: 0; }
.supplier-stats strong { display: block; color: var(--navy); font-size: 15px; }
.supplier-stats small { color: var(--muted); font-size: 8px; }
.user-dot { width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; }
.permission-mark { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 8px; font-size: 9px; font-weight: 700; }
.permission-mark.allowed { background: var(--success-soft); color: var(--success); }
.permission-mark.denied { background: #f1f4f6; color: #7d8f9c; }
.permission-options { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: 15px; }

.filter-tabs { display: flex; gap: 5px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 2px; }
.filter-tabs a { padding: 8px 13px; border-radius: 10px; color: var(--muted); white-space: nowrap; font-size: 11px; font-weight: 700; }
.filter-tabs a.active { color: var(--brand-dark); background: var(--brand-soft); }

.form-section { margin-bottom: 14px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-heading > div { display: flex; align-items: center; gap: 9px; }
.step-badge { width: 27px; height: 27px; display: inline-grid; place-items: center; border-radius: 9px; background: var(--brand-soft); color: var(--brand-dark); font-size: 11px; font-weight: 800; }
.form-grid { display: grid; gap: 13px; }
.form-grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.form-grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.span-2 { grid-column: span 2; }
label { display: grid; gap: 6px; color: #405a6e; font-size: 10px; font-weight: 700; }
label small { color: var(--muted); font-size: 8px; font-weight: 400; }
input, select, textarea { width: 100%; border: 1px solid #cfdee7; border-radius: 10px; color: var(--ink); background: #fff; outline: none; transition: .15s ease; }
input, select { height: 42px; padding: 0 11px; }
textarea { resize: vertical; padding: 10px 11px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(41,171,224,.12); }
.order-items { display: grid; gap: 10px; }
.order-item-row { display: grid; grid-template-columns: 28px minmax(230px,1.3fr) minmax(110px,.5fr) minmax(140px,.65fr) 36px; gap: 10px; align-items: end; padding: 13px; border-radius: 13px; background: #f7fafc; border: 1px solid #e8eff3; }
.row-number { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--brand-dark); background: var(--brand-soft); font-size: 10px; margin-bottom: 8px; }
.remove-row { color: var(--danger); margin-bottom: 2px; }
.sticky-submit { position: sticky; bottom: 15px; z-index: 12; display: flex; justify-content: flex-end; gap: 9px; background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 14px; padding: 10px; box-shadow: var(--shadow); backdrop-filter: blur(8px); }

.order-summary-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 14px; }
.product-title { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.product-title .item-code { min-width: 64px; min-height: 40px; align-items: center; }
.product-title h2 { margin: 0; }
.product-movements { margin-top: 14px; }
.movement-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.movement-card { display: flex; align-items: center; gap: 9px; padding: 11px; border-radius: 11px; background: #f8fafc; }
.movement-card strong,.movement-card small { display: block; }
.movement-card strong { font-size: 10px; }
.movement-card small { color: var(--muted); font-size: 8px; }
.movement-sign { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 900; }
.movement-sign.positive { background: var(--success-soft); color: var(--success); }
.movement-sign.negative { background: var(--danger-soft); color: var(--danger); }
.summary-card { padding: 15px; border-radius: 15px; background: #fff; border: 1px solid var(--line); }
.summary-card span, .summary-card small { display: block; color: var(--muted); font-size: 9px; }
.summary-card strong { display: block; margin: 3px 0; color: var(--navy); font-size: 14px; }
.order-note, .calculation-note { border-radius: 14px; padding: 15px 17px; margin: 14px 0; background: var(--brand-soft); border: 1px solid #caeafa; color: #35677f; }
.order-note strong, .calculation-note strong { color: var(--navy); font-size: 11px; }
.order-note p, .calculation-note p { margin: 3px 0 0; font-size: 10px; }
.receipt-log { display: grid; gap: 10px; }
.receipt-log-item { display: flex; gap: 11px; padding: 12px; background: #f8fafc; border-radius: 12px; }
.receipt-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--success-soft); color: var(--success); }
.receipt-icon.discrepant { background: var(--warning-soft); color: var(--warning); }
.receipt-log-item strong { display: block; font-size: 11px; }
.receipt-log-item small { color: var(--muted); font-size: 9px; }
.receipt-log-item p { margin: 4px 0 0; font-size: 10px; }

.stock-actions-grid, .report-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; margin-bottom: 15px; }
.action-panel { padding: 22px; }
.blue-panel { border-top: 3px solid var(--brand); }
.panel-description { color: var(--muted); font-size: 10px; margin: -6px 0 16px; }
.report-list { display: grid; }
.report-item { display: grid; grid-template-columns: minmax(140px,1fr) 100px minmax(120px,.7fr); align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid #edf2f5; }
.report-item:first-child { border-top: 0; padding-top: 2px; }
.report-item > div:first-child strong, .report-item > div:first-child small { display: block; }
.report-item strong { font-size: 11px; }
.report-item small, .report-measure span, .report-progress span { color: var(--muted); font-size: 8px; }
.report-measure strong { display: block; color: var(--navy); }
.report-progress > div:first-child { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.report-item.product-report { grid-template-columns: minmax(160px,1fr) 120px; }

.empty-state { display: flex; align-items: center; justify-content: center; gap: 13px; min-height: 145px; color: var(--muted); text-align: right; }
.empty-state > span { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: #f0f5f8; color: #8aa0af; }
.empty-state strong { color: var(--ink); font-size: 12px; }
.empty-state p { margin: 2px 0 0; font-size: 9px; }

.app-dialog { border: 0; padding: 0; border-radius: 20px; width: min(680px, calc(100% - 24px)); max-height: calc(100vh - 28px); background: transparent; overflow: visible; }
.app-dialog.wide-dialog { width: min(950px, calc(100% - 24px)); }
.app-dialog::backdrop { background: rgba(5,25,40,.55); backdrop-filter: blur(4px); }
.dialog-card { max-height: calc(100vh - 28px); overflow-y: auto; background: #fff; padding: 22px; border-radius: 20px; box-shadow: 0 25px 80px rgba(3,27,43,.25); }
.dialog-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.dialog-heading h3 { margin: 2px 0 0; font-size: 19px; color: var(--navy); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #edf2f5; }
.privacy-note { display: flex; gap: 9px; align-items: center; margin-top: 14px; border-radius: 10px; background: var(--brand-soft); color: #3d7894; padding: 10px 12px; font-size: 9px; }
.receive-items { display: grid; gap: 12px; margin-top: 17px; }
.receive-item { border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.receive-item-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.receive-item-title strong, .receive-item-title small { display: block; }
.receive-item-title small { color: var(--muted); font-size: 9px; }
.receive-fields { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.12fr .88fr; background: #fff; }
.login-visual { position: relative; overflow: hidden; min-height: 100vh; background: var(--navy); color: #fff; padding: 48px 7vw; display: flex; flex-direction: column; }
.login-visual::before { content: ""; position: absolute; width: 420px; height: 420px; border: 80px solid rgba(41,171,224,.07); border-radius: 50%; left: -160px; bottom: -160px; }
.login-visual::after { content: ""; position: absolute; width: 190px; height: 190px; border-radius: 50%; background: rgba(41,171,224,.08); top: 13%; left: 13%; }
.login-brand { position: relative; z-index: 1; }
.login-copy { position: relative; z-index: 1; margin: auto 0; max-width: 560px; }
.login-copy .eyebrow { color: #75d3f6; }
.login-copy h1 { font-size: clamp(34px,4vw,60px); line-height: 1.45; margin: 12px 0 13px; font-weight: 800; letter-spacing: -.04em; }
.login-copy h1 em { color: var(--brand); font-style: normal; }
.login-copy p { color: #b8cad6; font-size: 14px; max-width: 440px; }
.login-mini-cards { position: relative; z-index: 1; display: flex; gap: 12px; }
.login-mini-cards article { display: flex; align-items: center; gap: 10px; min-width: 170px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); padding: 12px; border-radius: 14px; }
.mini-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.login-mini-cards strong, .login-mini-cards small { display: block; }
.login-mini-cards strong { font-size: 12px; }
.login-mini-cards small { color: #9fb5c4; font-size: 8px; }
.login-form-side { display: grid; place-items: center; padding: 35px; }
.login-card { width: min(410px,100%); }
.login-card h2 { color: var(--navy); font-size: 28px; margin: 5px 0 2px; }
.login-card > p { margin: 0 0 24px; color: var(--muted); }
.stack-form { display: grid; gap: 13px; }
.input-with-icon { position: relative; }
.input-with-icon > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #97aab8; font-weight: 800; }
.input-with-icon input { padding-left: 36px; }
.login-help { text-align: center; color: var(--muted); font-size: 9px; margin-top: 18px !important; }
.mobile-login-brand { display: none; }

.install-page { min-height: 100vh; background: var(--navy); padding: 35px; }
.install-shell { width: min(1120px,100%); margin: auto; min-height: calc(100vh - 70px); display: grid; grid-template-columns: .78fr 1.22fr; background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.install-intro { padding: 50px; color: #fff; background: var(--navy-2); display: flex; flex-direction: column; justify-content: center; }
.install-intro .eyebrow { color: #72d1f5; margin-top: 26px; }
.install-intro h1 { font-size: 35px; margin: 6px 0 7px; }
.install-intro p { color: #bfd1dd; }
.install-features { display: grid; gap: 9px; margin-top: 25px; color: #dce9f0; font-size: 11px; }
.install-card { padding: 38px; overflow-y: auto; }
.install-card fieldset { padding: 0; margin: 0 0 18px; border: 0; }
.install-card legend { width: 100%; color: var(--navy); font-weight: 800; font-size: 12px; border-bottom: 1px solid var(--line); padding-bottom: 7px; margin-bottom: 12px; }
.check-row { grid-template-columns: 20px 1fr; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.check-row input { width: 18px; height: 18px; }
.check-row strong, .check-row small { display: block; }
.success-state { min-height: 440px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.success-icon { width: 70px; height: 70px; display: grid; place-items: center; border-radius: 22px; background: var(--success-soft); color: var(--success); font-size: 32px; }
.success-state h2 { font-size: 24px; color: var(--navy); margin: 18px 0 3px; }
.success-state p { color: var(--muted); margin: 0 0 20px; }
.mobile-nav { display: none; }

@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(2,1fr); }
    .supplier-grid { grid-template-columns: repeat(2,1fr); }
    .activity-strip { grid-template-columns: repeat(2,1fr); }
    .order-summary-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 920px) {
    :root { --sidebar-width: 234px; }
    .page-content { padding-inline: 20px; }
    .topbar { padding-inline: 20px; }
    .dashboard-grid, .report-grid { grid-template-columns: 1fr; }
    .urgent-item { grid-template-columns: 1fr 1fr; }
    .suggested-order { grid-column: 2; }
    .form-grid.three { grid-template-columns: repeat(2,1fr); }
    .receive-fields { grid-template-columns: repeat(2,1fr); }
    .login-page { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .mobile-login-brand { display: flex; margin-bottom: 45px; }
    .login-form-side { min-height: 100vh; background: var(--canvas); }
}

@media (max-width: 740px) {
    body { font-size: 13px; }
    .sidebar { transform: translateX(105%); transition: transform .22s ease; width: min(290px,86vw); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-close { display: inline-flex !important; }
    .sidebar-backdrop { position: fixed; z-index: 35; inset: 0; background: rgba(5,25,40,.5); }
    body.sidebar-open .sidebar-backdrop { display: block; }
    .app-main { margin-right: 0; }
    .topbar { height: 68px; padding: 0 14px; }
    .topbar h1 { font-size: 16px; }
    .topbar-kicker { font-size: 8px; }
    .menu-button { display: inline-flex !important; }
    .desktop-action { display: none; }
    .page-content { padding: 18px 13px 96px; }
    .welcome-row, .page-heading-row { align-items: flex-start; }
    .welcome-row h2, .page-heading-row h2 { font-size: 19px; }
    .sync-status { display: none; }
    .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
    .metric-card { padding: 13px; min-height: 105px; gap: 9px; align-items: flex-start; }
    .metric-card .metric-icon { width: 34px; height: 34px; border-radius: 10px; }
    .metric-card .metric-icon .icon { width: 17px; }
    .metric-card strong { font-size: 18px; }
    .metric-card small { display: none; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .panel { padding: 16px; border-radius: 15px; }
    .urgent-item { grid-template-columns: 1fr; gap: 9px; }
    .suggested-order { grid-column: auto; display: flex; justify-content: space-between; align-items: center; background: var(--brand-soft); padding: 8px 10px; border-radius: 9px; }
    .activity-strip { grid-template-columns: 1fr; }
    .activity-item:nth-child(n+5) { display: none; }
    .supplier-grid, .stock-actions-grid { grid-template-columns: 1fr; }
    .permission-options { grid-template-columns: 1fr; }
    .supplier-card { border-radius: 15px; }
    .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
    .order-item-row { grid-template-columns: 28px 1fr 35px; }
    .order-item-row label { grid-column: 2; }
    .order-item-row .remove-row { grid-column: 3; grid-row: 1; }
    .order-item-row .row-number { grid-row: 1; }
    .order-summary-grid { grid-template-columns: repeat(2,1fr); gap: 8px; }
    .movement-cards { grid-template-columns: 1fr; }
    .summary-card { padding: 12px; }
    .receive-fields { grid-template-columns: 1fr 1fr; }
    .report-item { grid-template-columns: 1fr 90px; }
    .report-progress { grid-column: 1 / -1; }
    .page-heading-row > .button { min-height: 39px; padding: 0 12px; white-space: nowrap; }
    .filter-bar { align-items: stretch; flex-direction: column; }
    .result-count { margin-right: 0; }
    .mobile-nav { position: fixed; z-index: 30; right: 10px; left: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); height: 65px; display: flex; justify-content: space-around; align-items: center; background: rgba(12,45,72,.97); border: 1px solid rgba(255,255,255,.12); border-radius: 19px; padding: 5px 8px; box-shadow: 0 13px 35px rgba(4,28,45,.34); backdrop-filter: blur(12px); }
    .mobile-nav-item { min-width: 48px; height: 51px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; color: #9eb7c8; font-size: 8px; }
    .mobile-nav-item .icon { width: 19px; }
    .mobile-nav-item.active { color: #fff; }
    .mobile-create { width: 53px; height: 53px; transform: translateY(-14px); border-radius: 17px; background: var(--brand); color: #fff; box-shadow: 0 9px 18px rgba(41,171,224,.4); }
    .mobile-create span { display: none; }
    .mobile-create .icon { width: 24px; height: 24px; }
    .sticky-submit { bottom: 82px; }
    .app-dialog { width: calc(100% - 14px); max-height: calc(100vh - 14px); }
    .dialog-card { max-height: calc(100vh - 14px); padding: 17px; border-radius: 17px; }
    .install-page { padding: 0; background: #fff; }
    .install-shell { min-height: 100vh; border-radius: 0; grid-template-columns: 1fr; }
    .install-intro { display: none; }
    .install-card { padding: 24px 16px; }
}

@media (max-width: 420px) {
    .metric-card { display: block; }
    .metric-card .metric-icon { margin-bottom: 8px; }
    .metric-card span { font-size: 9px; }
    .order-summary-grid { grid-template-columns: 1fr 1fr; }
    .receive-fields { grid-template-columns: 1fr; }
    .page-heading-row { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
