:root {
    --bg: #fff7ed;
    --bg-2: #ecfeff;
    --surface: #ffffff;
    --surface-soft: #fffaf3;
    --surface-cool: #f0fdfa;
    --text: #172033;
    --muted: #64748b;
    --line: #e7edf5;
    --primary: #0f9f9a;
    --primary-dark: #087f7a;
    --secondary: #f97316;
    --secondary-dark: #ea580c;
    --violet: #7c3aed;
    --rose: #e11d48;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0284c7;
    --sidebar: #102033;
    --sidebar-2: #1d2545;
    --shadow: 0 18px 45px rgba(25, 39, 67, .09);
    --shadow-soft: 0 12px 30px rgba(25, 39, 67, .06);
    --radius: 8px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(249, 115, 22, .16), transparent 30%),
        radial-gradient(circle at 85% 12%, rgba(15, 159, 154, .18), transparent 28%),
        linear-gradient(135deg, var(--bg), var(--bg-2) 58%, #f8fafc);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: 280px;
    background:
        linear-gradient(165deg, rgba(249, 115, 22, .24), transparent 32%),
        linear-gradient(25deg, rgba(20, 184, 166, .22), transparent 38%),
        linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
    color: #dbeafe;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 18px 0 45px rgba(15, 23, 42, .24);
}
.brand, .login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand { padding: 4px 8px 22px; border-bottom: 1px solid rgba(255,255,255,.11); }
.brand-mark, .avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: #fff;
    font-weight: 900;
    box-shadow: 0 14px 30px rgba(15, 159, 154, .28);
}
.brand strong, .login-brand strong { display: block; color: #fff; font-size: 17px; }
.brand small, .login-brand small { color: #b9c7dc; }
.nav { display: grid; gap: 5px; padding: 18px 0; overflow-y: auto; }
.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 43px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: #c7d2e5;
    font-weight: 720;
}
.nav a:hover, .nav a.active {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.14);
    color: #fff;
}
.nav-icon {
    width: 27px;
    height: 27px;
    border-radius: 7px;
    display: inline-grid;
    place-items: center;
    background: rgba(255,255,255,.12);
    color: #fde68a;
    font-size: 11px;
    font-weight: 900;
}
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); }
.main { margin-left: 280px; width: calc(100% - 280px); min-height: 100vh; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 78px;
    padding: 16px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: rgba(255,255,255,.82);
    border-bottom: 1px solid rgba(231,237,245,.9);
    backdrop-filter: blur(18px);
}
.topbar h1 { margin: 0; font-size: 24px; letter-spacing: 0; }
.eyebrow { margin: 0 0 3px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255,255,255,.82);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}
.user-chip strong, .user-chip small { display: block; white-space: nowrap; }
.user-chip small { color: var(--muted); }
.content { padding: 28px 30px 42px; }

.page-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-end;
    margin-bottom: 20px;
    padding: 24px;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,255,255,.76)),
        linear-gradient(120deg, rgba(249, 115, 22, .18), rgba(20, 184, 166, .2), rgba(124, 58, 237, .12));
    box-shadow: var(--shadow);
}
.page-hero h2 { margin: 0; font-size: 25px; }
.page-hero p { margin: 7px 0 0; color: var(--muted); line-height: 1.55; max-width: 720px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(231,237,245,.92);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.card-header h2, .card-header h3 { margin: 0; font-size: 17px; }
.card-body { padding: 20px; }
.stat-card {
    position: relative;
    overflow: hidden;
    padding: 18px;
    min-height: 132px;
}
.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.stat-card::after {
    content: "";
    position: absolute;
    right: -26px;
    top: -30px;
    width: 95px;
    height: 95px;
    border-radius: 999px;
    background: rgba(15, 159, 154, .11);
}
.stat-card span { display: block; color: var(--muted); font-weight: 800; }
.stat-card strong { display: block; margin-top: 8px; font-size: 27px; line-height: 1.15; }
.stat-card small { display: block; margin-top: 8px; color: var(--muted); line-height: 1.45; }
.stat-orange::before { background: linear-gradient(90deg, #f97316, #facc15); }
.stat-teal::before { background: linear-gradient(90deg, #14b8a6, #22c55e); }
.stat-violet::before { background: linear-gradient(90deg, #7c3aed, #38bdf8); }
.stat-rose::before { background: linear-gradient(90deg, #e11d48, #f97316); }
.mt-18 { margin-top: 18px; }

.orders-hero {
    background:
        linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,255,255,.76)),
        linear-gradient(120deg, rgba(249, 115, 22, .22), rgba(20, 184, 166, .22), rgba(56, 189, 248, .16));
}
.order-pipeline {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}
.pipeline-step {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 70px;
    padding: 14px;
    border: 1px solid rgba(231,237,245,.94);
    border-radius: var(--radius);
    background: rgba(255,255,255,.9);
    box-shadow: var(--shadow-soft);
}
.pipeline-step strong {
    font-size: 25px;
    line-height: 1;
}
.pipeline-step.active {
    border-color: rgba(20,184,166,.5);
    box-shadow: 0 14px 34px rgba(20,184,166,.16);
}
.order-card-header .eyebrow { margin-bottom: 4px; }
.order-result-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 999px;
    background: #f0fdfa;
    color: #0f766e;
    font-weight: 850;
}
.filter-panel {
    background: linear-gradient(135deg, #fff, #fffaf3);
}
.order-filter {
    display: grid;
    grid-template-columns: minmax(280px, 1.5fr) minmax(190px, .7fr) auto;
    gap: 14px;
    align-items: end;
}
.filter-actions {
    min-height: 61px;
    align-content: end;
}
.orders-table td:first-child strong,
.orders-table td:nth-child(2) strong {
    color: #0f172a;
}
.payment-meter {
    width: 100%;
    height: 7px;
    margin: 8px 0 5px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}
.payment-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #22c55e);
}
.empty-state {
    display: grid;
    justify-items: center;
    gap: 9px;
    padding: 34px 18px;
    text-align: center;
}
.empty-state strong { font-size: 18px; }
.empty-state span { color: var(--muted); }
.order-mobile-list {
    display: none;
    padding: 14px;
    gap: 12px;
}
.order-card-mobile {
    display: grid;
    gap: 12px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-soft);
}
.order-mobile-top,
.order-mobile-total {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.order-mobile-top strong,
.order-mobile-top span,
.order-mobile-total span,
.order-mobile-total strong {
    display: block;
}
.order-mobile-top > div > span,
.order-mobile-meta {
    color: var(--muted);
}
.order-mobile-meta {
    display: grid;
    gap: 4px;
    font-size: 13px;
}
.order-mobile-total strong {
    text-align: right;
    font-size: 18px;
}
.order-create-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}
.order-form-main {
    display: grid;
    gap: 18px;
}
.form-section .card-header {
    background: linear-gradient(135deg, rgba(255,250,243,.8), rgba(240,253,250,.7));
}
.toggle-field {
    grid-template-columns: auto 1fr;
    align-items: center;
    min-height: 72px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}
.toggle-field input {
    width: 18px;
    height: 18px;
}
.toggle-field strong,
.toggle-field small {
    display: block;
}
.toggle-field small {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.45;
}
.order-summary-panel {
    min-width: 0;
}
.sticky-card {
    position: sticky;
    top: 96px;
}
.summary-lines {
    display: grid;
    gap: 12px;
}
.summary-lines div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.summary-lines span {
    color: var(--muted);
    font-weight: 780;
}
.summary-lines strong {
    text-align: right;
}
.summary-lines .summary-total strong {
    font-size: 24px;
    color: #0f766e;
}
.summary-note {
    margin: 16px 0;
    padding: 12px;
    border-radius: var(--radius);
    background: #fff7ed;
    color: #9a3412;
    line-height: 1.55;
    font-weight: 700;
}
.detail-list {
    display: grid;
    gap: 12px;
}
.detail-list div {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.detail-list span {
    color: var(--muted);
    font-weight: 780;
}
.detail-list strong {
    min-width: 0;
    overflow-wrap: anywhere;
}
.payment-entry-card .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.payment-progress {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f8fffd;
}
.payment-progress div:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-weight: 760;
}
.payment-progress strong {
    color: var(--text);
}
.timeline-list {
    display: grid;
    gap: 14px;
}
.timeline-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 12px;
}
.timeline-item > span {
    width: 12px;
    height: 12px;
    margin-top: 4px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    box-shadow: 0 0 0 5px rgba(20,184,166,.12);
}
.timeline-item strong,
.timeline-item small {
    display: block;
}
.timeline-item p {
    margin: 4px 0;
    color: var(--text);
}
.timeline-item small {
    color: var(--muted);
}
.production-hero {
    background:
        linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,255,255,.78)),
        linear-gradient(120deg, rgba(20,184,166,.24), rgba(249,115,22,.2), rgba(124,58,237,.12));
}
.production-card-list,
.product-card-list {
    display: grid;
    gap: 14px;
    padding: 16px;
}
.production-card,
.mini-record-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-soft);
}
.production-card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}
.production-card-top strong,
.production-card-top span {
    display: block;
}
.production-card-top > div > span {
    color: var(--muted);
    margin-top: 3px;
}
.production-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.production-meta div {
    padding: 10px;
    border-radius: var(--radius);
    background: #f8fafc;
}
.production-meta span,
.production-meta strong {
    display: block;
}
.production-meta span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}
.production-meta strong {
    margin-top: 4px;
    overflow-wrap: anywhere;
}
.production-stage {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
}
.production-stage span {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
}
.production-stage span.done {
    background: linear-gradient(90deg, var(--secondary), var(--primary));
}
.mini-record-card > div:first-child strong,
.mini-record-card > div:first-child span {
    display: block;
}
.mini-record-card > div:first-child span {
    margin-top: 4px;
    color: var(--muted);
}
.mini-record-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.mini-record-grid span {
    padding: 9px 10px;
    border-radius: var(--radius);
    background: #f8fafc;
    color: #334155;
    font-weight: 760;
}
.product-row-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 240px;
}
.product-row-main strong,
.product-row-main small {
    display: block;
}
.product-row-main small {
    margin-top: 3px;
    color: var(--muted);
}
.product-thumb {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    overflow: hidden;
    display: inline-grid;
    place-items: center;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 900;
}
.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.modal-open { overflow: hidden; }
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(15,23,42,.48);
    backdrop-filter: blur(8px);
}
.modal-backdrop[hidden] { display: none; }
.modal-panel {
    width: min(100%, 980px);
    max-height: min(92vh, 920px);
    overflow: auto;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 30px 90px rgba(15,23,42,.28);
}
.modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(12px);
}
.modal-header h2 { margin: 0; font-size: 18px; }
.icon-only {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    cursor: pointer;
    font-weight: 900;
}
.product-modal-panel form { padding: 20px; }
.product-modal-grid {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 18px;
}
.product-image-uploader {
    display: grid;
    gap: 12px;
    align-content: start;
}
.product-image-uploader img,
.product-image-uploader > span {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #f8fafc;
}
.product-image-uploader img {
    object-fit: cover;
}
.product-image-uploader > span {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 800;
}
.image-remove-field {
    min-height: auto;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.order-product-preview {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f8fffd;
}
.order-product-preview[hidden] { display: none; }
.order-product-preview img,
.order-product-preview .preview-empty {
    width: 86px;
    height: 86px;
    border-radius: var(--radius);
    object-fit: cover;
    background: #e2e8f0;
}
.order-product-preview strong,
.order-product-preview span {
    display: block;
}
.order-product-preview span {
    margin-top: 5px;
    color: var(--muted);
}
.role-guide-list {
    display: grid;
    gap: 12px;
}
.role-guide-list div {
    display: grid;
    gap: 7px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}
.role-guide-list strong,
.role-guide-list small {
    display: block;
}
.role-guide-list small {
    color: var(--muted);
    line-height: 1.45;
}
.report-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.report-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255,255,255,.9);
    color: #334155;
    font-weight: 800;
    box-shadow: var(--shadow-soft);
}
.report-tabs a.active {
    border-color: rgba(20,184,166,.5);
    background: #f0fdfa;
    color: #0f766e;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { padding: 14px 15px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #fff7ed; color: #475467; font-size: 12px; text-transform: uppercase; letter-spacing: 0; }
tr:hover td { background: #f8fffd; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 800;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), #22c55e); color: #fff; box-shadow: 0 12px 24px rgba(15, 159, 154, .2); }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), #16a34a); }
.btn-secondary { background: linear-gradient(135deg, var(--secondary), #facc15); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-light { background: #fff; color: #1f2937; border-color: var(--line); box-shadow: var(--shadow-soft); }
.btn-ghost { background: rgba(255,255,255,.09); color: #fff; border-color: rgba(255,255,255,.14); }
.btn-block { width: 100%; }
.btn-sm { min-height: 32px; padding: 6px 10px; font-size: 12px; }

.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.badge-muted { background: #f1f5f9; color: #475569; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #ffe4e6; color: #be123c; }
.muted { color: var(--muted); }

.form-stack { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label { display: grid; gap: 7px; color: #344054; font-weight: 760; }
input, select, textarea {
    width: 100%;
    border: 1px solid #d7dfeb;
    border-radius: var(--radius);
    background: #fff;
    padding: 10px 12px;
    color: var(--text);
    outline: none;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #5eead4; box-shadow: 0 0 0 4px rgba(20,184,166,.15); }
.alert { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 800; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #ffe4e6; color: #be123c; }
.alert-info { background: #e0f2fe; color: #0369a1; }

.login-body {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 12% 12%, rgba(249, 115, 22, .22), transparent 30%),
        radial-gradient(circle at 85% 16%, rgba(20, 184, 166, .24), transparent 31%),
        radial-gradient(circle at 50% 90%, rgba(124, 58, 237, .13), transparent 28%),
        #fff7ed;
}
.login-card {
    width: min(100%, 460px);
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(255,255,255,.78);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: 0 30px 80px rgba(25,39,67,.17);
}
.login-card h1 { margin: 28px 0 8px; font-size: 30px; }
.login-card p { margin: 0 0 20px; color: var(--muted); line-height: 1.6; }
.login-brand .brand-mark { width: 48px; height: 48px; }
.login-brand strong { color: var(--text); }
.login-brand small { color: var(--muted); }
.login-note {
    display: block;
    margin-top: 16px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: var(--surface-cool);
    color: #0f766e;
    font-weight: 760;
}

.icon-btn {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}
.icon-btn span { display: block; width: 18px; height: 2px; margin: 4px auto; background: var(--text); }

@media (max-width: 1080px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .order-create-layout { grid-template-columns: 1fr; }
    .sticky-card { position: static; }
    .order-pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .order-filter { grid-template-columns: 1fr 1fr; }
    .filter-actions { min-height: 0; }
}
@media (max-width: 820px) {
    .sidebar { transform: translateX(-102%); transition: transform .2s ease; }
    .sidebar.is-open { transform: translateX(0); }
    .main { margin-left: 0; width: 100%; }
    .topbar { padding: 14px 18px; align-items: flex-start; }
    .content { padding: 18px; }
    .icon-btn { display: inline-block; flex: 0 0 auto; }
    .user-chip { display: none; }
    .page-hero { align-items: flex-start; flex-direction: column; padding: 20px; }
    .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
    .detail-list div { grid-template-columns: 1fr; gap: 4px; }
    .payment-entry-card .form-grid { grid-template-columns: 1fr; }
    .production-meta,
    .mini-record-grid { grid-template-columns: 1fr; }
    .product-modal-grid,
    .order-product-preview { grid-template-columns: 1fr; }
    .modal-backdrop { padding: 10px; align-items: stretch; }
    .modal-panel { max-height: calc(100vh - 20px); }
    .production-card-top { flex-direction: column; }
    .order-pipeline { grid-template-columns: 1fr; }
    .order-filter { grid-template-columns: 1fr; }
    .card-header { align-items: flex-start; flex-direction: column; }
    table { min-width: 680px; }
    .orders-table { display: none; }
    .orders-table + .order-mobile-list,
    .order-mobile-list { display: grid; }
}
