:root {
  --sidebar-width: 260px;
  --ink: #172033;
  --muted: #68758a;
  --line: #dfe5ee;
  --canvas: #f4f6fa;
  --surface: #fff;
  --sidebar: #111827;
  --sidebar-soft: #1f2937;
  --primary: #3759d7;
  --primary-dark: #2947b8;
  --primary-soft: #eef2ff;
  --green: #07875f;
  --amber: #c66708;
  --danger: #c63c4b;
  --shadow-sm: 0 2px 8px rgba(22, 34, 55, .045), 0 1px 2px rgba(22, 34, 55, .035);
  --shadow: 0 14px 34px rgba(22, 34, 55, .075);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: .9375rem; line-height: 1.5; }
a { text-decoration: none; }

.auth-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(circle at top, #eef2ff, var(--canvas) 48%); }
.auth-card { width: 100%; max-width: 430px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand > div { display: flex; flex-direction: column; color: var(--ink); line-height: 1.05; }
.auth-brand strong { font-size: 1.1rem; }
.auth-brand small { margin-top: 5px; color: var(--muted); font-size: .65rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

/* CoreUI admin shell */
.admin-sidebar {
  --cui-sidebar-width: var(--sidebar-width);
  --cui-sidebar-bg: #212631;
  --cui-sidebar-brand-bg: #1d222c;
  --cui-sidebar-nav-link-active-bg: rgba(88, 86, 214, .9);
  --cui-sidebar-nav-link-hover-bg: rgba(255,255,255,.07);
  width: var(--sidebar-width);
}
.admin-sidebar .sidebar-header { min-height: 72px; padding: 0 20px; }
.admin-sidebar .sidebar-brand { display: flex; align-items: center; justify-content: flex-start; gap: 11px; color: #fff; }
.admin-sidebar .sidebar-brand-full { display: flex; flex-direction: column; line-height: 1.05; }
.admin-sidebar .sidebar-brand strong { font-size: 1.05rem; letter-spacing: -.02em; }
.admin-sidebar .sidebar-brand small { margin-top: 5px; color: #8d96a5; font-size: .62rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; color: #fff; background: #5856d6; border-radius: 9px; font-weight: 800; box-shadow: 0 8px 20px rgba(50,48,172,.35); }
.admin-sidebar .sidebar-nav { padding: 18px 12px; }
.admin-sidebar .nav-title { margin-top: 10px; color: #737e90; font-size: .62rem; letter-spacing: .12em; }
.admin-sidebar .nav-link { min-height: 42px; margin: 3px 0; padding: 10px 12px; border-radius: 8px; font-size: .875rem; font-weight: 600; transition: background-color .16s ease, color .16s ease, transform .16s ease; }
.admin-sidebar .nav-link:hover { transform: translateX(2px); }
.admin-sidebar .nav-link.active { box-shadow: 0 5px 14px rgba(16, 14, 100, .22); }
.admin-sidebar .sidebar-footer { padding: 12px; }
.sidebar-action { padding: .55rem .75rem; font-size: .78rem; }
.local-status { display: flex; align-items: center; gap: 10px; padding: 11px 12px; background: rgba(255,255,255,.04); border-radius: 9px; }
.local-status div { display: flex; flex-direction: column; }
.local-status strong { color: #dce3ef; font-size: .76rem; }
.local-status small { margin-top: 2px; color: #748095; font-size: .65rem; }
.status-dot { flex: 0 0 auto; width: 7px; height: 7px; background: #2dcc8e; border-radius: 50%; box-shadow: 0 0 0 3px rgba(45,204,142,.13); }
.admin-page { min-height: 100vh; background: var(--canvas); }
.admin-topbar { min-height: 66px; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.admin-topbar .container-fluid { display: flex; align-items: center; min-height: 66px; }
.header-toggler { display: grid; place-items: center; width: 38px; height: 38px; color: #536076; background: transparent; border: 0; border-radius: 7px; }
.header-toggler:hover { color: var(--primary); background: #f0f2f7; }
.header-toggler i { font-size: 1.3rem; }
.topbar-label { color: #8793a6; font-size: .6875rem; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.topbar-context { margin-top: 1px; color: #28344a; font-size: .9375rem; font-weight: 680; }
.local-pill { align-items: center; gap: 8px; padding: 7px 11px; color: #526078; background: #f7f9fc; border: 1px solid var(--line); border-radius: 999px; font-size: .72rem; font-weight: 650; }
.topbar-action { display: inline-flex; align-items: center; gap: 6px; }
.admin-content { min-height: calc(100vh - 118px); padding: 30px 32px 42px; }
.admin-container { width: 100%; max-width: 1600px; margin-inline: auto; }
.admin-footer { min-height: 52px; color: #8b96a8; background: #fff; border-top: 1px solid var(--line); font-size: .7rem; }
.admin-alert { border: 0; border-radius: 10px; box-shadow: var(--shadow-sm); }

/* Shared admin components */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-eyebrow { margin-bottom: 5px; color: var(--primary); font-size: .66rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-title { margin: 0; color: #182236; font-size: clamp(1.65rem, 2vw, 1.875rem); font-weight: 760; line-height: 1.2; letter-spacing: -.035em; }
.page-subtitle { margin: 7px 0 0; color: var(--muted); font-size: .9rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-sm); }
.card-header { padding: 17px 20px; background: #fff; border-bottom: 1px solid var(--line); border-radius: 13px 13px 0 0 !important; }
.section-title { margin: 0; font-size: 1rem; font-weight: 730; }
.section-help { margin-top: 3px; color: var(--muted); font-size: .79rem; }
.btn { min-height: 40px; padding: .5rem .8rem; border-radius: 8px; font-weight: 650; font-size: .875rem; }
.btn-sm { min-height: 34px; padding: .35rem .625rem; font-size: .8rem; }
.btn i { margin-right: 5px; }
.btn-icon { display: inline-grid; place-items: center; width: 34px; min-width: 34px; padding: 0; }
.btn-icon i { margin: 0; }
.btn-primary { background: var(--primary); border-color: var(--primary); box-shadow: 0 4px 11px rgba(55,89,215,.17); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-soft { color: var(--primary); background: var(--primary-soft); border: 1px solid #dce4ff; }
.btn-soft:hover { color: #263fa3; background: #e3e9ff; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.form-label { margin-bottom: 7px; color: #334057; font-size: .8125rem; font-weight: 700; }
.form-control { min-height: 44px; padding: .55rem .75rem; color: var(--ink); background: #fff; border-color: #cbd4e1; border-radius: 8px; font-size: .9rem; }
.form-control:focus { border-color: #8196e7; box-shadow: 0 0 0 .2rem rgba(55,89,215,.11); }
.form-hint { margin-top: 5px; color: var(--muted); font-size: .72rem; }
.errorlist { margin: 6px 0 0; padding-left: 18px; color: #b42f40; font-size: .78rem; }
.table { --cui-table-bg: transparent; --bs-table-bg: transparent; }
.table thead th { padding: 12px 16px; color: #778399; background: #f8fafc; border-bottom-width: 1px; font-size: .6875rem; font-weight: 790; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.table tbody td { padding: 14px 16px; border-color: #e9eef5; }
.table tbody tr:hover { background: #fafbfe; }
code { color: #6441ba; }
.empty-state { padding: 54px 20px; text-align: center; color: var(--muted); }
.empty-state i { display: block; margin-bottom: 9px; color: #aeb9cb; font-size: 1.8rem; }

/* Dashboard */
.metric-card { position: relative; height: 100%; overflow: hidden; }
.metric-card .card-body { padding: 18px; }
.metric-icon { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 18px; color: var(--primary); background: var(--primary-soft); border-radius: 9px; font-size: 1rem; }
.metric-icon.success { color: var(--green); background: #e6f8f1; }
.metric-icon.warning { color: var(--amber); background: #fff3df; }
.metric-label { color: var(--muted); font-size: .72rem; font-weight: 650; }
.metric-value { margin-top: 4px; color: #1d293d; font-size: 1.75rem; font-weight: 770; line-height: 1; letter-spacing: -.04em; }
.quick-panel { overflow: hidden; border: 0; background: linear-gradient(115deg, #26396f, #3156c5); color: #fff; box-shadow: var(--shadow); }
.quick-panel .text-secondary { color: rgba(255,255,255,.67) !important; }
.dashboard-chart-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.chart-range-summary { display: flex; align-items: flex-end; flex-direction: column; color: var(--muted); font-size: .72rem; }
.chart-range-summary strong { margin-top: 2px; color: var(--ink); font-size: .95rem; }
.dashboard-chart-filter, .report-filter-grid { display: grid; grid-template-columns: minmax(170px, 220px) max-content; align-items: end; justify-content: end; gap: 14px; }
.dashboard-chart-filter.is-custom-range, .report-filter-grid.is-custom-range { grid-template-columns: minmax(170px, 220px) repeat(2, minmax(165px, 210px)) max-content; }
.date-filter-custom[hidden] { display: none !important; }
.date-filter-errors { grid-column: 1 / -1; color: var(--danger); font-size: .78rem; }
.date-filter-errors .errorlist { margin-bottom: 0; }
.chart-shell { position: relative; height: 340px; margin-top: 24px; }

/* Reports */
.report-filter .card-body { padding: 20px; }
.report-metric-text { margin-top: 5px; color: #1d293d; font-size: 1.05rem; font-weight: 740; }
.report-table { min-width: 760px; }
.report-table th:first-child, .report-table td:first-child { padding-left: 20px; }
.report-table th:last-child, .report-table td:last-child { padding-right: 20px; }
.report-quantity { color: var(--primary); font-size: 1rem; font-variant-numeric: tabular-nums; font-weight: 780; }

/* Products */
.search-card { padding: 14px; margin-bottom: 14px; }
.product-thumb { width: 52px; height: 52px; object-fit: contain; background: #f2f4f8; border: 1px solid #e8edf4; border-radius: 8px; }
.detail-image { width: 100%; max-height: 430px; object-fit: contain; background: #f3f5f8; border: 1px solid var(--line); border-radius: 10px; }
.detail-label { margin-bottom: 4px; color: var(--muted); font-size: .68rem; font-weight: 720; letter-spacing: .06em; text-transform: uppercase; }
.detail-value { color: #263249; font-weight: 620; }
.form-card { max-width: 820px; }
.delete-card { max-width: 600px; margin: 8vh auto 0; }
.danger-icon { display: grid; place-items: center; width: 48px; height: 48px; color: var(--danger); background: #fff0f1; border-radius: 50%; font-size: 1.2rem; }
.profile-avatar { display: grid; place-items: center; width: 64px; height: 64px; color: var(--primary); background: var(--primary-soft); border-radius: 50%; font-size: 1.7rem; }
.history-actions { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; }
.history-actions .btn { white-space: nowrap; }
.history-actions form { margin: 0; }
.history-filter { box-shadow: var(--shadow-sm); }
.history-filter .card-body { padding: 20px; }
.history-filter-grid { display: grid; grid-template-columns: minmax(320px, 1fr) repeat(2, minmax(180px, 220px)) max-content; gap: 16px; align-items: end; }
.history-filter-errors { grid-column: 1 / -1; }
.history-filter .input-group .form-control { border-inline-start: 0; }
.history-filter .input-group-text { min-width: 44px; justify-content: center; color: var(--muted); background: #fff; border-color: #cbd4e1; }
.history-filter-actions { display: flex; justify-content: flex-end; gap: 8px; }
.history-filter-actions .btn { min-height: 44px; }
.history-card { box-shadow: 0 4px 14px rgba(22, 34, 55, .055); }
.history-table { min-width: 1060px; }
.history-table th:first-child, .history-table td:first-child { padding-left: 20px; }
.history-table th:last-child, .history-table td:last-child { min-width: 270px; padding-right: 20px; }
.history-table tbody tr { transition: background-color .14s ease; }
.history-date { min-width: 205px; color: #526078; white-space: nowrap; }
.history-date > span { font-variant-numeric: tabular-nums; }
.history-date small { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: var(--primary); font-size: .75rem; }
.history-file { display: flex; align-items: center; min-width: 220px; gap: 10px; }
.history-file-icon { display: grid; flex: 0 0 auto; place-items: center; width: 32px; height: 32px; color: #d64050; background: #fff0f2; border-radius: 8px; }
.history-filename { overflow: hidden; max-width: 390px; color: #202c42; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.history-count { color: #364258; font-variant-numeric: tabular-nums; font-weight: 620; }
.pagination-shell { display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 14px 18px; gap: 20px; background: linear-gradient(180deg, #fff, #fbfcfe); border-top: 1px solid var(--line); }
.pagination-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; color: var(--muted); font-size: .8rem; }
.pagination-results strong { color: #344054; font-variant-numeric: tabular-nums; font-weight: 750; }
.pagination-page-status { padding: 4px 9px; color: #536078; background: #f1f4f8; border: 1px solid #e0e5ed; border-radius: 999px; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.pagination-nav { flex: 0 0 auto; }
.pagination-pages { display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; }
.pagination-shell .page-item { margin: 0; }
.pagination-shell .page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 7px 11px; gap: 7px; color: #46536a; background: #fff; border: 1px solid #d8dee8; border-radius: 9px !important; font-size: .8rem; font-variant-numeric: tabular-nums; font-weight: 680; line-height: 1; box-shadow: 0 1px 2px rgba(25, 36, 55, .035); transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.pagination-shell a.page-link:hover { z-index: 1; color: var(--primary); background: #f5f7ff; border-color: #aab9eb; box-shadow: 0 3px 9px rgba(55, 89, 215, .1); transform: translateY(-1px); }
.pagination-shell a.page-link:focus-visible { z-index: 2; outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(55, 89, 215, .15); }
.pagination-shell .page-item.active .page-link { color: #fff; background: var(--primary); border-color: var(--primary); box-shadow: 0 4px 10px rgba(55, 89, 215, .2); }
.pagination-shell .page-item.disabled .page-link { color: #a2aaba; background: #f7f8fa; border-color: #e5e8ee; box-shadow: none; cursor: not-allowed; opacity: 1; }
.pagination-shell .pagination-ellipsis .page-link { min-width: 24px; padding-inline: 2px; background: transparent; border-color: transparent; }
.pagination-nav-link { min-width: 96px !important; }

/* PO upload and result */
.upload-shell { max-width: 760px; margin: 0 auto; }
.upload-card { overflow: hidden; border: 0; box-shadow: var(--shadow); }
.upload-accent { height: 4px; background: linear-gradient(90deg, var(--primary), #7a5adc); }
.order-format-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.order-format-option { position: relative; display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 12px; min-height: 82px; padding: 14px; background: #fff; border: 1px solid #d6deea; border-radius: 11px; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease; }
.order-format-option:has(input:checked) { background: #f5f7ff; border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.order-format-option .form-check-input { margin: 0; }
.order-format-icon { display: grid; place-items: center; width: 38px; height: 38px; color: var(--primary); background: var(--primary-soft); border-radius: 9px; font-size: 1rem; }
.order-format-option > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.order-format-option strong { color: var(--ink); }
.order-format-option small { margin-top: 2px; color: var(--muted); font-size: .74rem; line-height: 1.35; }
.drop-zone { position: relative; padding: 34px 20px; text-align: center; background: #f8faff; border: 1.5px dashed #b7c3e8; border-radius: 11px; cursor: pointer; outline: 0; transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.drop-zone:hover, .drop-zone:focus-visible { background: #f2f5ff; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(55,89,215,.09); }
.drop-zone.is-dragging { background: #edf1ff; border-color: var(--primary); border-style: solid; box-shadow: 0 0 0 5px rgba(55,89,215,.11); transform: translateY(-2px); }
.drop-zone.is-dragging::after { content: "Drop PDF to upload"; position: absolute; inset: 8px; display: grid; place-items: center; color: var(--primary); background: rgba(244,247,255,.96); border-radius: 8px; font-weight: 720; }
.drop-zone.has-file { background: #f4fbf8; border-color: #49aa88; }
.drop-zone.has-error { background: #fff7f7; border-color: #dc6672; }
.upload-symbol { display: grid; place-items: center; width: 50px; height: 50px; margin: 0 auto 13px; color: var(--primary); background: var(--primary-soft); border-radius: 12px; font-size: 1.25rem; }
.upload-help { color: var(--muted); font-size: .76rem; }
.selected-file { align-items: center; justify-content: center; gap: 10px; color: #176848; }
.selected-file:not([hidden]) { display: flex; }
.selected-file > i { font-size: 1.25rem; }
.selected-file > span { display: flex; flex-direction: column; max-width: 80%; text-align: left; }
.selected-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.selected-file small { color: #5c7f70; font-size: .68rem; }
.upload-feedback { min-height: 18px; font-size: .76rem; }
.processing-state { display: none; }
.is-submitting .form-state { display: none; }
.is-submitting .processing-state { display: block; }
.result-hero { padding: 22px; color: #fff; background: linear-gradient(125deg, #1d2d5e, #2c4ca9); border: 0; box-shadow: var(--shadow); }
.result-hero .page-eyebrow, .result-hero .page-subtitle { color: rgba(255,255,255,.7); }
.result-hero .page-title { color: #fff; }
.result-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.result-actions .btn { display: inline-flex; align-items: center; min-height: 40px; }
.result-metric { height: 100%; padding: 12px 14px; background: rgba(255,255,255,.085); border: 1px solid rgba(255,255,255,.12); border-radius: 9px; }
.result-metric-label { color: rgba(255,255,255,.66); font-size: .68rem; }
.result-metric-value { margin-top: 2px; font-size: 1.35rem; font-weight: 760; }
.print-layout-card { overflow: hidden; }
.print-layout-card .card-body { padding: 18px 20px 20px; }
.layout-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.layout-option { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; min-height: 86px; padding: 15px 16px; color: var(--ink); text-align: left; background: #fff; border: 1px solid #d6deea; border-radius: 11px; transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease, transform .16s ease; }
.layout-option:hover { background: #fafbff; border-color: #aab9eb; transform: translateY(-1px); }
.layout-option:focus-visible { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 .22rem rgba(55,89,215,.13); }
.layout-option.is-active { background: #f5f7ff; border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary), 0 7px 18px rgba(55,89,215,.09); }
.layout-option-icon { display: grid; place-items: center; width: 42px; height: 42px; color: #66738a; background: #f0f3f8; border-radius: 10px; font-size: 1.1rem; }
.layout-option.is-active .layout-option-icon { color: var(--primary); background: #e6ebff; }
.layout-option-copy { display: flex; min-width: 0; flex-direction: column; }
.layout-option-copy strong { color: #202b40; font-size: .925rem; }
.layout-option-copy small { margin-top: 3px; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.layout-option-check { display: grid; place-items: center; width: 22px; height: 22px; color: transparent; background: #fff; border: 1px solid #cbd4e1; border-radius: 50%; font-size: .75rem; }
.layout-option.is-active .layout-option-check { color: #fff; background: var(--primary); border-color: var(--primary); }
.compact-density { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; align-items: center; gap: 20px; margin-top: 16px; padding: 16px; background: #f8faff; border: 1px solid #dce4f3; border-radius: 11px; }
.compact-density-help { color: var(--muted); font-size: .78rem; }
.density-stepper { display: grid; grid-template-columns: 40px 72px 40px; overflow: hidden; background: #fff; border: 1px solid #cbd4e1; border-radius: 9px; }
.density-stepper button { display: grid; place-items: center; min-height: 42px; padding: 0; color: #536078; background: #fff; border: 0; }
.density-stepper button:hover { color: var(--primary); background: #f0f3ff; }
.density-stepper button:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--primary); outline-offset: -2px; }
.density-stepper .form-control { min-height: 42px; padding: .4rem; text-align: center; border-top: 0; border-bottom: 0; border-color: #d9e0ea; border-radius: 0; font-size: 1rem; font-weight: 750; appearance: textfield; }
.density-stepper .form-control::-webkit-inner-spin-button, .density-stepper .form-control::-webkit-outer-spin-button { margin: 0; appearance: none; }
.compact-preview-status { display: flex; align-items: center; justify-content: flex-end; min-width: 150px; gap: 9px; color: #4d5a70; font-size: .78rem; font-weight: 650; }
.compact-preview-status .status-dot { background: #20a575; }
.compact-preview-status.is-updating .status-dot { background: var(--primary); animation: preview-pulse 1s ease-in-out infinite; }
@keyframes preview-pulse { 50% { opacity: .35; transform: scale(.8); } }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: .68rem; font-weight: 740; white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.status-matched { color: #087653; background: #def8ec; }
.status-missing { color: #a45208; background: #fff0d2; }
.preview-card { overflow: hidden; border: 0; box-shadow: var(--shadow); }
.preview-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 13px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.preview-frame-shell { padding: 10px; background: #dce3ed; }
.pdf-preview { display: block; width: 100%; height: min(78vh, 920px); min-height: 580px; background: #fff; border: 0; border-radius: 5px; }
.preview-mobile-note { display: none; }

@media (min-width: 992px) {
  .admin-page { margin-left: var(--sidebar-width); }
}
@media (max-width: 1199.98px) {
  .history-filter-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .history-filter-search, .history-filter-actions, .history-filter-errors { grid-column: 1 / -1; }
  .history-filter-actions { justify-content: flex-start; }
  .dashboard-chart-filter.is-custom-range, .report-filter-grid.is-custom-range { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .admin-sidebar { z-index: 1040; }
  .admin-sidebar .btn-close { flex: 0 0 auto; min-width: 44px; min-height: 44px; margin-left: auto; touch-action: manipulation; }
  .admin-topbar { z-index: 1030; }
  .header-toggler { position: relative; z-index: 1; min-width: 44px; min-height: 44px; cursor: pointer; touch-action: manipulation; }
  .sidebar-backdrop { z-index: 1039; }
  .admin-content { padding: 22px 18px; }
  .admin-footer { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 767.98px) {
  .page-header { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .admin-content { padding: 18px 13px 28px; }
  .admin-footer { flex-direction: column; gap: 3px; }
  .result-actions { width: 100%; }
  .result-actions .btn { flex: 1; justify-content: center; }
  .print-layout-card .card-body { padding: 14px; }
  .layout-options { grid-template-columns: 1fr; }
  .layout-option { min-height: 80px; }
  .compact-density { grid-template-columns: 1fr auto; gap: 14px; }
  .compact-preview-status { grid-column: 1 / -1; justify-content: flex-start; }
  .preview-frame-shell { padding: 4px; }
  .pdf-preview { height: 70vh; min-height: 500px; }
  .preview-mobile-note { display: block; }
  .history-filter .card-body { padding: 16px; }
  .history-filter-grid { grid-template-columns: 1fr; gap: 14px; }
  .history-filter-search, .history-filter-actions, .history-filter-errors { grid-column: auto; }
  .history-filter-actions { justify-content: stretch; }
  .history-filter-actions .btn:first-child { flex: 1; }
  .order-format-options { grid-template-columns: 1fr; }
  .dashboard-chart-header { align-items: flex-start; flex-direction: column; }
  .chart-range-summary { align-items: flex-start; }
  .dashboard-chart-filter, .dashboard-chart-filter.is-custom-range, .report-filter-grid, .report-filter-grid.is-custom-range { grid-template-columns: 1fr; justify-content: stretch; }
  .date-filter-errors { grid-column: auto; }
  .chart-shell { height: 280px; }
  .pagination-shell { align-items: stretch; flex-direction: column; gap: 12px; }
  .pagination-summary { justify-content: space-between; }
  .pagination-nav, .pagination-pages { width: 100%; }
  .pagination-pages { justify-content: flex-end; }
}
@media (max-width: 575.98px) {
  .pagination-shell { min-height: 0; padding: 13px; }
  .pagination-summary { justify-content: center; }
  .pagination-results { width: 100%; text-align: center; }
  .pagination-pages { justify-content: space-between; }
  .pagination-number:not(.active), .pagination-ellipsis { display: none; }
  .pagination-nav-item { flex: 1 1 0; }
  .pagination-nav-item:last-child { display: flex; justify-content: flex-end; }
  .pagination-nav-link { width: 100%; min-width: 0 !important; }
  .pagination-number.active .page-link { min-width: 42px; }
}
@media (max-width: 479.98px) {
  .compact-density { grid-template-columns: 1fr; }
  .density-stepper { width: 152px; }
  .compact-preview-status { grid-column: auto; }
}
