/* Quiet, task-first owner workspace. Storefront styles are untouched. */
body.admin-mode { background: #f6f7f9; color: #302e2c; --brown: #514339; --line: #e7e8eb; --muted: #72747a; --danger: #a13d3d; }
body.admin-mode .admin-workspace { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); background: #f6f7f9; }
body.admin-mode .admin-workspace .admin-sidebar { position: sticky; top: 0; height: 100vh; padding: 30px 18px 20px; background: #fff; border-right: 1px solid #e7e8eb; color: #3c3c41; display: flex; flex-direction: column; }
body.admin-mode .admin-brand { display: flex; gap: 12px; padding: 0 10px 30px; margin: 0; color: #514339; }
body.admin-mode .admin-brand > span:first-child { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border: 1px solid #e9ded4; border-radius: 12px; background: #f9f5ee; color: #60483e; font-size: 26px; font-weight: 700; }
body.admin-mode .admin-brand strong { display: block; font-size: 17px; letter-spacing: -.055em; }
body.admin-mode .admin-brand small { display: block; font-size: 10px; margin-top: 3px; color: #89878a; }
body.admin-mode .admin-nav-label { padding: 5px 14px 12px; font-size: 11px; color: #98979b; }
body.admin-mode .admin-workspace .admin-sidebar nav { display: grid; grid-template-columns: 1fr; gap: 6px; padding-top: 0; }
body.admin-mode .admin-workspace .admin-sidebar nav a { display: flex; align-items: center; gap: 13px; padding: 12px 15px; min-height: 48px; color: #68686e; border: 1px solid transparent; border-radius: 9px; font-size: 14px; }
body.admin-mode .admin-sidebar nav a::before, body.admin-mode .admin-sidebar nav a::after { display: none; }
body.admin-mode .admin-workspace .admin-sidebar nav a.active { background: #f3eee7; color: #514339; font-weight: 700; border-color: #ebe2d7; }
body.admin-mode .admin-workspace .admin-sidebar nav a:hover { background: #f7f6f4; color: #514339; }
body.admin-mode .admin-workspace svg, body.admin-mode .admin-dialog svg { display: block; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
body.admin-mode .admin-sidebar-footer { margin-top: auto; padding: 20px 10px 0; border-top: 1px solid #eee; display: grid; gap: 15px; }
body.admin-mode .admin-sidebar-footer > a, body.admin-mode .admin-sidebar-footer > button { padding: 0; color: #77747a; font-size: 12px; background: none; border: 0; text-align: left; }
.owner-card { display: flex; gap: 10px; align-items: center; padding-bottom: 10px; }
.owner-avatar { border-radius: 50%; width: 32px; height: 32px; display: grid; place-items: center; background: #edf2f4; font-size: 12px; }
.owner-card b { font-size: 12px; display: block; }
.owner-card small { color: #919096; font-size: 10px; }
body.admin-mode .admin-workspace .admin-main { min-width: 0; padding: 0 34px 50px; max-width: 1600px; width: 100%; margin: 0 auto; }
.admin-topline { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e5e6e9; color: #88878c; font-size: 11px; margin-bottom: 30px; }
.owner-access { border: 1px solid #e4e6e9; background: #fff; padding: 5px 10px; border-radius: 20px; font-size: 10px; }
body.admin-mode .admin-title { gap: 20px; align-items: center; margin: 0 0 25px; }
body.admin-mode .admin-title h1 { font-size: clamp(24px, 2.4vw, 34px); font-weight: 700; color: #302e2c; margin: 2px 0 7px; line-height: 1.45; letter-spacing: -.025em; }
body.admin-mode .admin-title p { color: #7c7b82; font-size: 12px; margin: 0; }
body.admin-mode .admin-title .admin-eyebrow { font-size: 9px; letter-spacing: .16em; color: #9b9290; margin-bottom: 6px; }
body.admin-mode .admin-workspace .button, body.admin-mode .admin-dialog .button { min-height: 42px; font-size: 12px; padding: 9px 14px; border: 1px solid #dedfe4; background: #fff; border-radius: 7px; color: #4f5055; box-shadow: 0 1px 2px rgb(25 25 30 / 3%); white-space: nowrap; }
body.admin-mode .admin-workspace .button:hover, body.admin-mode .admin-dialog .button:hover { background: #f7f7f9; border-color: #c1c3ca; }
body.admin-mode .admin-workspace .button.primary, body.admin-mode .admin-dialog .button.primary { background: #514339; color: #fff; border-color: #514339; }
body.admin-mode .admin-workspace .button.primary:hover, body.admin-mode .admin-dialog .button.primary:hover { background: #3d322a; }
body.admin-mode .button.danger { color: #a13d3d; border-color: #ecd7d7; background: #fffafa; }
body.admin-mode .button.small { font-size: 11px; min-height: 33px; padding: 6px 10px; }
body.admin-mode .admin-workspace .button:disabled { cursor: not-allowed; opacity: .4; }
body.admin-mode .admin-workspace .actions { gap: 8px; }
body.admin-mode .admin-workspace .panel { padding: 24px; border: 1px solid #e5e7eb; border-radius: 11px; box-shadow: 0 2px 4px rgb(30 30 40 / 2%); background: #fff; }
body.admin-mode .admin-workspace h2 { color: #39383c; font-size: 17px; margin: 0 0 18px; }
body.admin-mode .admin-workspace h3 { color: #49484c; font-size: 14px; }
body.admin-mode .admin-workspace .stats { gap: 16px; margin-bottom: 25px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.admin-mode .admin-workspace .stats article { min-height: 135px; padding: 20px; border: 1px solid #e5e7eb; box-shadow: 0 2px 4px rgb(30 30 40 / 2%); border-radius: 10px; background: #fff; }
body.admin-mode .admin-workspace .stats article > a { display: block; }
body.admin-mode .admin-workspace .stats span { color: #77777f; font-size: 12px; }
body.admin-mode .admin-workspace .stats b { display: block; color: #383438; font-size: clamp(24px, 2.2vw, 32px); margin: 7px 0; line-height: 1.25; }
body.admin-mode .admin-workspace .stats small { color: #9a989e; font-size: 10px; }
.admin-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; align-items: start; gap: 22px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
body.admin-mode .section-heading h2 { margin-bottom: 3px; }
.section-heading p, .section-heading > span, .section-heading small { margin: 0; font-size: 11px; color: #969399; }
.section-heading > a { font-size: 12px; white-space: nowrap; }
.admin-shortcut { display: flex; gap: 13px; align-items: center; padding: 18px 0; border-bottom: 1px solid #eeeff1; }
.admin-shortcut > svg:first-child { color: #7b7974; }
.admin-shortcut > svg:last-child { width: 14px; margin-left: auto; color: #aaa5a2; }
.admin-shortcut b { display: block; font-size: 13px; }
.admin-shortcut small { color: #97959b; display: block; font-size: 11px; margin-top: 3px; }
.admin-note { background: #f8f7f4; border: 1px solid #edeae3; border-radius: 7px; padding: 14px; color: #898078; font-size: 11px; line-height: 1.9; margin-top: 20px; }
body.admin-mode .admin-workspace .table-wrap { background: transparent; border: 0; box-shadow: none; border-radius: 0; margin: 0; max-width: 100%; overflow-x: auto; }
body.admin-mode .admin-data-table { width: 100%; border-collapse: collapse; min-width: 620px; font-size: 12px; }
body.admin-mode .admin-data-table th { padding: 12px 14px; background: #f8f9fb; color: #95939b; text-align: left; font-size: 11px; font-weight: 400; border-top: 1px solid #eeeff2; border-bottom: 1px solid #eeeff2; white-space: nowrap; }
body.admin-mode .admin-data-table td { vertical-align: middle; padding: 17px 14px; border-bottom: 1px solid #eeeff2; color: #63616a; }
body.admin-mode .admin-data-table tbody tr:hover { background: #fdfcfb; }
body.admin-mode .admin-data-table td b { font-size: 12px; color: #49474b; }
body.admin-mode .admin-data-table td small { display: block; font-size: 10px; color: #a09ba2; margin-top: 5px; }
body.admin-mode .admin-data-table .numeric { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }
.row-actions { display: flex; align-items: center; gap: 6px; }
.order-number { font-size: 11px; color: #5b5651; font-weight: 700; white-space: nowrap; text-decoration: underline; text-decoration-color: #d9d3cc; text-underline-offset: 4px; }
.admin-product-cell { display: flex; align-items: center; gap: 12px; min-width: 185px; max-width: 330px; }
.admin-product-cell img { width: 44px; height: 56px; flex-shrink: 0; border-radius: 5px; object-fit: cover; background: #f2f3f4; }
body.admin-mode .admin-workspace .status { font-size: 10px; border: 1px solid transparent; padding: 5px 9px; border-radius: 5px; white-space: nowrap; }
body.admin-mode .status.paid, body.admin-mode .status.shipped { color: #52766a; background: #edf5f0; border-color: #dcebe2; }
body.admin-mode .status.waiting_verification { background: #fdf6e9; color: #957344; border-color: #f2e9d4; }
body.admin-mode .status.preparing { background: #eef3fa; color: #5f789c; border-color: #dde7f4; }
body.admin-mode .status.awaiting_payment { background: #f5f3ef; color: #8a7a61; }
body.admin-mode .status.cancelled, body.admin-mode .status.expired { background: #f6f1f1; color: #9b7474; }
.admin-summary-line { display: flex; gap: 26px; flex-wrap: wrap; font-size: 12px; color: #88848b; margin: -2px 0 20px; }
.admin-summary-line b { color: #4f4844; margin-right: 5px; }
.admin-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.admin-filters label { flex: 1 1 130px; }
.admin-filters label:first-child { flex: 2 1 200px; }
.shipping-label-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; margin: -4px 0 8px; border: 1px solid #e8e2db; border-radius: 8px; background: #faf8f5; color: #635b55; font-size: 12px; }
.shipping-label-toolbar b { color: #403832; font-variant-numeric: tabular-nums; }
.order-backup-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.shipping-label-hint { margin: 0 0 18px; }
.order-select-cell { width: 42px; padding-inline: 10px !important; text-align: center; }
body.admin-mode .admin-workspace .order-select-cell input { width: 17px; min-height: 17px; margin: 0; accent-color: #514339; }
/* ใบปะหน้าถูกย้ายไปพิมพ์จากหน้ารายการคำสั่งซื้อ */
body.admin-mode .admin-workspace a[href$="/shipping-label.pdf"] { display: none; }
body.admin-mode .admin-workspace label, body.admin-mode .admin-dialog label { color: #6e6870; font-size: 12px; font-weight: 400; }
body.admin-mode .admin-workspace input, body.admin-mode .admin-workspace select, body.admin-mode .admin-workspace textarea, body.admin-mode .admin-dialog input, body.admin-mode .admin-dialog select, body.admin-mode .admin-dialog textarea { border-color: #dedee4; font-family: inherit; font-size: 13px; font-weight: 400; border-radius: 6px; min-height: 42px; background: #fff; color: #49434a; width: 100%; }
body.admin-mode .admin-workspace input::placeholder, body.admin-mode .admin-dialog input::placeholder { color: #aaa6ad; }
body.admin-mode .admin-dialog input[type=checkbox] { width: 18px; min-height: 18px; }
.admin-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 11px; color: #949098; padding-top: 20px; }
.admin-empty { text-align: center; padding: 65px 20px; }
body.admin-mode .admin-empty svg { width: 32px; height: 32px; color: #bbb4ac; margin: 0 auto 15px; }
.admin-empty p { color: #9f98a0; font-size: 12px; margin: 0; }
.admin-footnote { color: #97909a; font-size: 11px; margin: 18px 0 0; }
.admin-back { display: inline-block; font-size: 12px; color: #8e8790; margin-bottom: 15px; }
.admin-order-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, 1fr); gap: 22px; }
.admin-order-grid .stack { gap: 22px; }
.admin-totals { margin: 20px 0 0 auto; max-width: 300px; font-size: 13px; }
.admin-totals > div { display: flex; align-items: baseline; justify-content: space-between; padding: 9px 0; gap: 15px; }
.admin-totals dd, .admin-details dd { margin: 0; }
.admin-totals .grand-total { margin-top: 8px; padding-top: 15px; border-top: 1px solid #e8e6e8; font-weight: 700; font-size: 17px; }
.order-action-stack { display: grid; gap: 10px; margin-bottom: 16px; }
.admin-ship-form { display: grid; gap: 12px; }
.admin-details { font-size: 12px; }
.admin-details > div { display: grid; grid-template-columns: 75px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0eef0; }
.admin-details dt { color: #a29ca4; }
.admin-details dd, .customer-address { overflow-wrap: anywhere; color: #736a75; }
.customer-address { font-size: 13px; }
.admin-history { padding: 0; list-style: none; }
.admin-history li { display: flex; gap: 16px; position: relative; padding: 0 0 25px; }
.admin-history li > span { width: 9px; height: 9px; border: 2px solid #c4b7ac; border-radius: 50%; flex-shrink: 0; margin-top: 7px; background: #fff; z-index: 1; }
.admin-history li:not(:last-child)::after { content: ''; width: 1px; position: absolute; top: 12px; bottom: 0; left: 4px; background: #eae5e0; }
.admin-history b { font-size: 12px; }
.admin-history small { display: block; font-size: 10px; color: #a29aa4; margin-top: 5px; }
.report-controls { margin-bottom: 22px; }
.admin-tabs { display: inline-flex; gap: 4px; background: #f5f5f7; border: 1px solid #eeeef1; border-radius: 8px; padding: 4px; margin-bottom: 20px; }
.admin-tabs button { border: 0; background: transparent; padding: 8px 19px; border-radius: 5px; font-size: 12px; color: #8b858f; }
.admin-tabs button.active { background: #fff; box-shadow: 0 1px 5px #0000000c; color: #4b413b; font-weight: 700; }
.admin-date-range { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.admin-date-range label { flex: 1; max-width: 240px; min-width: 130px; }
.sales-table meter { width: 100%; height: 9px; display: block; border: 0; background: #f5f2ee; border-radius: 5px; }
.sales-table meter::-webkit-meter-bar { background: #f5f2ee; border: 0; }
.sales-table meter::-webkit-meter-optimum-value { background: #b7a696; border-radius: 5px; }
.sales-table td:nth-child(2) { width: 55%; }
.sales-chart-card { margin-bottom: 22px; }
.sales-chart { min-height: 260px; display: flex; align-items: end; gap: 12px; padding: 28px 12px 0; border-bottom: 1px solid #e4e1dd; overflow-x: auto; }
.sales-chart-column { min-width: 64px; flex: 1; height: 220px; display: grid; grid-template-rows: 26px 1fr 28px; align-items: end; text-align: center; }
.sales-chart-value { color: #6b625b; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sales-chart-column i { width: min(46px, 74%); min-height: 10px; justify-self: center; border-radius: 7px 7px 0 0; background: linear-gradient(180deg, #8a6a59, #514339); box-shadow: 0 4px 12px rgba(81,67,57,.14); }
.sales-chart-column svg { width: min(46px, 74%); height: 100%; justify-self: center; align-self: end; overflow: visible; }
.sales-chart-column rect { fill: #60483e; }
.sales-chart-column small { padding-top: 8px; color: #8d8580; font-size: 10px; }
.admin-settings-form { display: grid; gap: 22px; }
.admin-settings-form .form-grid { gap: 20px; }
.admin-settings-form .admin-bank-row { padding: 20px; margin: 16px 0 0; border: 1px solid #ece8e5; border-radius: 8px; }
.admin-bank-row legend { padding: 0 8px; font-size: 12px; color: #a0948b; }
.admin-bank-row .link { margin-top: 15px; font-size: 11px; }
.admin-bank-row .bank-number-help { display: block; margin-top: 5px; color: #8a817b; font-size: 11px; }
.admin-bank-row .field-error { display: block; margin-top: 4px; color: #a43e3e; font-size: 11px; }
.admin-bank-row [aria-invalid="true"] { border-color: #c65b5b; box-shadow: 0 0 0 2px #fae7e7; }
.admin-contact-row { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(190px, 1.5fr) auto; align-items: end; gap: 14px; padding: 15px; margin-top: 12px; border: 1px solid #ece8e5; border-radius: 8px; background: #faf9f8; }
.admin-contact-row .link { margin-bottom: 8px; font-size: 11px; }
[data-contact-empty][hidden] { display: none !important; }
[data-bank-add][hidden] { display: none !important; }
.settings-savebar { position: sticky; bottom: 12px; display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-radius: 9px; border: 1px solid #e4e1dd; background: #fff; box-shadow: 0 3px 20px #00000008; z-index: 2; }
.settings-savebar > span { font-size: 11px; color: #a099a0; }
body.admin-mode .admin-workspace .backup { margin-top: 30px; }
.backup > p { font-size: 12px; color: #928b93; }
.backup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-email-outbox { margin-top: 22px; }
.email-log-list { display: grid; gap: 0; }
.email-log-list article { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 15px 0; border-top: 1px solid var(--admin-border, #ece8e5); }
.email-log-list article:first-child { border-top: 0; }
.email-log-list .email-status { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #24623d; background: #e9f5ed; font-weight: 900; }
.email-log-list b,.email-log-list p,.email-log-list small { display: block; }
.email-log-list p { margin: 3px 0; color: #746b65; font-size: 12px; }
.email-log-list small { color: #9b918a; }
.email-log-list a { color: #5c463b; font-size: 11px; font-weight: 800; }
.backup-grid article { padding: 20px; border: 1px solid #ece9e7; border-radius: 8px; }
.backup-grid p { font-size: 12px; color: #948a91; }
body.admin-mode .admin-dialog { color: #484048; width: min(950px, calc(100vw - 40px)); max-height: calc(100dvh - 50px); padding: 0; border: 1px solid #ddd; border-radius: 13px; background: #fff; box-shadow: 0 25px 80px #0002; margin: auto; }
.admin-dialog::backdrop { background: rgb(31 27 26 / 40%); backdrop-filter: blur(2px); }
.dialog-heading { position: sticky; top: 0; background: #fff; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 22px 28px; border-bottom: 1px solid #eae7e5; }
.dialog-heading h2 { font-size: 20px; margin: 0; }
.dialog-heading .icon-button { font-size: 22px; border: 0; background: transparent; width: 34px; height: 34px; }
.admin-editor { padding: 24px 28px 0; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 28px; }
.editor-layout h3 { font-size: 14px; margin: 0 0 20px; }
.editor-layout .form-grid { gap: 17px; }
.editor-layout > aside { border-left: 1px solid #eee9e6; padding-left: 25px; }
.editor-layout > aside > label { margin-top: 18px; }
.admin-image-preview { width: 100%; max-height: 200px; object-fit: contain; background: #f6f6f6; border: 1px solid #eee; border-radius: 8px; }
.admin-image-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.admin-image-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: -10px 0 12px; }
.admin-image-heading p { margin: 0; color: #756c67; font-size: 11px; }
.admin-image-heading strong { white-space: nowrap; color: #60483e; font-size: 11px; }
body.admin-mode .admin-dialog .admin-image-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.admin-image-tile { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border: 1px solid #e6e1dc; border-radius: 10px; background: #f7f6f4; }
.admin-image-tile img { width: 100%; height: 100%; display: block; object-fit: cover; }
.admin-image-tile.admin-image-empty img { object-fit: contain; padding: 12px; background: #f7f3ed; }
.admin-image-tile span { position: absolute; left: 5px; right: 5px; bottom: 5px; padding: 3px 5px; color: #fff; background: rgb(45 39 35 / 68%); border-radius: 5px; font-size: 9px; text-align: center; }
.admin-image-delete { position: absolute; top: 5px; right: 5px; width: 23px; height: 23px; display: grid; place-items: center; padding: 0; color: #514339; background: #fff; border: 1px solid #e4d8ce; border-radius: 50%; font-size: 17px; line-height: 1; cursor: pointer; box-shadow: 0 2px 6px #0002; }
.admin-image-delete:hover { color: #a13d3d; background: #fff5f3; border-color: #e2b6ae; }
.admin-image-dropzone { position: relative; display: grid !important; place-items: center; gap: 4px; min-height: 104px; margin-top: 14px; padding: 15px; color: #635a55; background: linear-gradient(145deg, #fff 0%, #fbf7f2 100%); border: 1px dashed #cdbdaf; border-radius: 12px; text-align: center; cursor: pointer; }
.admin-image-dropzone:hover { border-color: #9d8374; background: #fffaf5; }
.admin-image-dropzone strong { font-size: 12px; }
.admin-image-dropzone small { color: #958a83; font-size: 10px; }
.admin-image-dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; opacity: 0; cursor: pointer; }
.admin-image-dropzone[hidden] { display: none !important; }
.admin-image-dropzone:focus-within { outline: 2px solid #60483e; outline-offset: 2px; }
.admin-upload-symbol { width: 28px; height: 28px; display: grid; place-items: center; color: #60483e; background: #f4e1a6; border-radius: 50%; font-size: 21px; line-height: 1; }
.editor-footer { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end; background: #fff; border-top: 1px solid #eee9e6; padding: 18px 0; margin-top: 24px; z-index: 2; }
.admin-confirm { padding: 5px 28px 0; }
.admin-dialog:has(.admin-confirm) { max-width: 490px; }
.admin-confirm > p { font-size: 14px; line-height: 1.9; color: #817480; }
.admin-confirm > label { margin-top: 20px; }
.admin-editor > .form-message, .admin-confirm > .form-message { margin-top: 20px; }
/* Neutralize legacy sidebar/table rules and keep secondary text readable. */
body.admin-mode .admin-workspace .admin-brand { border-bottom: 0; }
body.admin-mode .admin-workspace .admin-brand small, body.admin-mode .admin-workspace .owner-card small { color: #77717a; padding: 0; border: 0; }
body.admin-mode .admin-data-table td .button { text-decoration: none; margin: 0; }
body.admin-mode .admin-data-table th, body.admin-mode .admin-data-table td small,
.admin-workspace .admin-footnote, .admin-workspace .admin-pagination,
.admin-workspace .section-heading p, .admin-workspace .stats small,
.admin-workspace .admin-nav-label { color: #74707a; }
@media (max-width: 1250px) {
  body.admin-mode .admin-workspace { grid-template-columns: 210px minmax(0, 1fr); }
  body.admin-mode .admin-workspace .admin-main { padding-inline: 24px; }
  .admin-dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-dashboard-grid > aside { display: none; }
  body.admin-mode .admin-title { align-items: flex-start; }
  body.admin-mode .admin-title > .actions { flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 900px) {
  body.admin-mode .admin-workspace { grid-template-columns: 1fr; }
  body.admin-mode .admin-workspace .admin-sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid #e4e5e8; padding: 15px 20px 10px; display: block; }
  body.admin-mode .admin-brand { padding: 0 0 13px; }
  body.admin-mode .admin-workspace .admin-sidebar nav { display: flex; overflow-x: auto; gap: 6px; }
  body.admin-mode .admin-workspace .admin-sidebar nav a { flex-shrink: 0; padding: 9px 12px; min-height: 40px; font-size: 12px; }
  body.admin-mode .admin-sidebar nav a svg { width: 16px; }
  .admin-nav-label { display: none; }
  body.admin-mode .admin-sidebar-footer { display: flex; position: absolute; right: 25px; top: 27px; margin: 0; padding: 0; border: 0; gap: 18px; }
  .owner-card { display: none; }
  .admin-order-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-order-grid > aside { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 650px) {
  body.admin-mode .admin-workspace .admin-main { padding-inline: 16px; }
  .admin-topline { margin-bottom: 22px; font-size: 10px; }
  .owner-access { display: none; }
  body.admin-mode .admin-title { flex-direction: column; gap: 16px; }
  body.admin-mode .admin-title > .actions { justify-content: flex-start; }
  body.admin-mode .admin-workspace .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.admin-mode .admin-workspace .stats article { padding: 15px; min-height: 125px; }
  body.admin-mode .admin-workspace .stats b { font-size: 24px; }
  body.admin-mode .admin-workspace .panel { padding: 18px 14px; }
  .admin-summary-line { font-size: 10px; gap: 12px; }
  .admin-pagination { align-items: flex-start; flex-direction: column; }
  .admin-filters { gap: 10px; }
  .admin-filters label:first-child { flex-basis: 100%; }
  .shipping-label-toolbar { align-items: flex-start; flex-direction: column; }
  .order-backup-actions { width: 100%; flex-direction: column; }
  .shipping-label-toolbar .button { width: 100%; }
  .admin-order-grid > aside { display: grid; grid-template-columns: 1fr; }
  .admin-tabs { display: flex; }
  .admin-tabs button { flex: 1; padding-inline: 8px; }
  .admin-date-range label { max-width: none; }
  .admin-date-range .button { width: 100%; }
  .sales-chart { gap: 8px; padding-inline: 4px; }
  .sales-chart-column { min-width: 52px; }
  .sales-chart-value { font-size: 9px; }
  .backup-grid, .editor-layout { grid-template-columns: 1fr; }
  .email-log-list article { grid-template-columns: 28px 1fr; }
  .email-log-list article > a { grid-column: 2; }
  .admin-contact-row { grid-template-columns: 1fr; gap: 10px; }
  .admin-contact-row .link { justify-self: start; margin-bottom: 0; }
  .settings-savebar { padding: 12px; flex-direction: column; align-items: stretch; gap: 10px; }
  .settings-savebar > span { display: none; }
  .settings-savebar .actions { justify-content: flex-end; }
  .editor-layout > aside { border-left: 0; padding-left: 0; border-top: 1px solid #eee; padding-top: 20px; }
  .admin-editor { padding: 18px 18px 0; }
  .dialog-heading { padding: 18px; }
  .dialog-heading h2 { font-size: 17px; }
  body.admin-mode .admin-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .admin-confirm { padding-inline: 18px; }
  body.admin-mode .admin-sidebar-footer { right: 16px; top: 24px; }
  body.admin-mode .admin-sidebar-footer > a { display: none; }
  .section-heading { flex-wrap: wrap; }
}

/* Owner workspace v3 — clear hierarchy, comfortable density, responsive controls. */
body.admin-mode {
  --admin-bg: #f5f7fa;
  --admin-surface: #fff;
  --admin-soft: #f8f9fb;
  --admin-text: #302b29;
  --admin-muted: #70747c;
  --admin-border: #e2e6eb;
  --admin-border-strong: #d4d9e0;
  --admin-accent: #60483e;
  --admin-accent-dark: #4d3931;
  --admin-accent-soft: #f3ebe7;
  --admin-info: #eaf4f8;
  --admin-warning: #fff7df;
  --admin-success: #2f7048;
  --admin-danger: #a43e3e;
  --admin-shadow: 0 8px 24px rgba(38, 44, 54, .06);
  color: var(--admin-text);
  background: var(--admin-bg);
  font-size: 15px;
}

/* Navigation and page shell */
body.admin-mode .admin-workspace {
  grid-template-columns: 272px minmax(0, 1fr);
  color: var(--admin-text);
  background: var(--admin-bg);
}
body.admin-mode .admin-workspace .admin-sidebar {
  width: 272px;
  height: 100vh;
  padding: 18px 14px;
  color: #f7f4f2;
  background: #2d2826;
  border-right: 1px solid rgba(255,255,255,.06);
  z-index: 30;
}
body.admin-mode .admin-workspace .admin-brand {
  min-height: 64px;
  gap: 12px;
  padding: 8px 10px 18px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
body.admin-mode .admin-brand > span:first-child {
  width: 42px;
  height: 42px;
  color: #2d2826;
  background: #f4e1a6;
  border: 0;
  border-radius: 12px;
  font-size: 16px;
}
body.admin-mode .admin-brand strong { color: #fff; font-size: 16px; letter-spacing: -.025em; }
body.admin-mode .admin-workspace .admin-brand small { margin-top: 2px; color: #bdb4af; font-size: 11px; }
body.admin-mode .admin-nav-label {
  padding: 22px 12px 8px;
  color: #958b86;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
body.admin-mode .admin-workspace .admin-sidebar nav { gap: 5px; }
body.admin-mode .admin-workspace .admin-sidebar nav a {
  min-height: 46px;
  padding: 11px 12px;
  color: #c9c1bd;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
body.admin-mode .admin-workspace .admin-sidebar nav a:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
  transform: translateX(2px);
}
body.admin-mode .admin-workspace .admin-sidebar nav a.active {
  color: #2d2826;
  background: #f4e1a6;
  border-color: transparent;
  box-shadow: 0 7px 18px rgba(0,0,0,.16);
}
body.admin-mode .admin-sidebar-footer {
  gap: 13px;
  padding: 18px 8px 4px;
  color: #b9b0ac;
  border-color: rgba(255,255,255,.1);
}
body.admin-mode .owner-card { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 0; }
body.admin-mode .owner-avatar {
  width: 36px;
  height: 36px;
  color: #2d2826;
  background: #cbe3ee;
  font-weight: 900;
}
body.admin-mode .owner-card b { color: #fff; font-size: 13px; }
body.admin-mode .admin-workspace .owner-card small { margin-top: 1px; color: #948b86; font-size: 10px; }
body.admin-mode .admin-sidebar-footer > a { color: #f4e1a6; font-weight: 700; }
body.admin-mode .admin-sidebar-footer > button {
  min-height: 36px;
  padding: 7px 10px;
  color: #ded8d5;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
}
body.admin-mode .admin-sidebar-footer > button:hover { color: #fff; background: rgba(255,255,255,.08); }
body.admin-mode .admin-workspace .admin-main {
  max-width: 1680px;
  padding: 26px clamp(22px, 3vw, 48px) 64px;
}
body.admin-mode .admin-topline {
  min-height: 38px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  color: var(--admin-muted);
  border-color: var(--admin-border);
  font-size: 12px;
}
body.admin-mode .owner-access {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  color: var(--admin-success);
  background: #edf7f1;
  border-color: #cfe8d8;
  font-weight: 800;
}
body.admin-mode .owner-access::before {
  width: 7px;
  height: 7px;
  content: "";
  background: #4c9a68;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(76,154,104,.13);
}
body.admin-mode .admin-title { align-items: center; margin-bottom: 24px; }
body.admin-mode .admin-title > div:first-child { max-width: 760px; }
body.admin-mode .admin-title h1 {
  margin: 3px 0 6px;
  color: var(--admin-text);
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.18;
  letter-spacing: -.035em;
}
body.admin-mode .admin-title p { color: var(--admin-muted); font-size: 13px; }
body.admin-mode .admin-title .admin-eyebrow { color: var(--admin-accent); font-size: 10px; font-weight: 900; }

/* Controls, cards and readable data density */
body.admin-mode .admin-workspace .button,
body.admin-mode .admin-dialog .button {
  min-height: 40px;
  padding: 8px 14px;
  color: var(--admin-text);
  background: var(--admin-surface);
  border-color: var(--admin-border-strong);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
body.admin-mode .admin-workspace .button:hover,
body.admin-mode .admin-dialog .button:hover {
  color: var(--admin-text);
  background: var(--admin-soft);
  border-color: #b8c0ca;
  box-shadow: 0 3px 10px rgba(26,32,44,.07);
}
body.admin-mode .admin-workspace .button:active,
body.admin-mode .admin-dialog .button:active { transform: translateY(1px); }
body.admin-mode .admin-workspace .button.primary,
body.admin-mode .admin-dialog .button.primary {
  color: #fff;
  background: var(--admin-accent);
  border-color: var(--admin-accent);
}
body.admin-mode .admin-workspace .button.primary:hover,
body.admin-mode .admin-dialog .button.primary:hover { color: #fff; background: var(--admin-accent-dark); }
body.admin-mode .button.danger {
  color: var(--admin-danger);
  background: #fff3f3;
  border-color: #efc9c9;
}
body.admin-mode .button.danger:hover { background: #ffe8e8; border-color: #dca7a7; }
body.admin-mode .button.small { min-height: 34px; padding: 6px 10px; font-size: 12px; }
body.admin-mode .admin-workspace .panel {
  padding: 22px;
  background: var(--admin-surface);
  border-color: var(--admin-border);
  border-radius: 14px;
  box-shadow: var(--admin-shadow);
}
body.admin-mode .admin-workspace h2 { color: var(--admin-text); font-size: 19px; }
body.admin-mode .admin-workspace h3 { color: var(--admin-text); font-size: 15px; }
body.admin-mode .section-heading { margin-bottom: 18px; }
body.admin-mode .section-heading p,
body.admin-mode .section-heading > span,
body.admin-mode .section-heading small { color: var(--admin-muted); font-size: 12px; }
body.admin-mode .section-heading > a { color: var(--admin-accent); font-weight: 800; }
body.admin-mode .admin-workspace .stats { gap: 14px; margin-bottom: 20px; }
body.admin-mode .admin-workspace .stats article {
  min-height: 132px;
  padding: 19px;
  background: var(--admin-surface);
  border-color: var(--admin-border);
  border-top: 1px solid var(--admin-border);
  border-radius: 14px;
  box-shadow: var(--admin-shadow);
  position: relative;
  overflow: hidden;
}
body.admin-mode .admin-workspace .stats article::before {
  width: 4px;
  content: "";
  background: #cbe3ee;
  position: absolute;
  inset: 0 auto 0 0;
}
body.admin-mode .stats article:nth-child(4n+2)::before { background: #f5d4e0; }
body.admin-mode .stats article:nth-child(4n+3)::before { background: #f4e1a6; }
body.admin-mode .stats article:nth-child(4n)::before { background: var(--admin-accent); }
body.admin-mode .admin-workspace .stats span { color: var(--admin-muted); font-weight: 700; }
body.admin-mode .admin-workspace .stats b { color: var(--admin-text); font-size: clamp(24px,2.3vw,31px); }
body.admin-mode .admin-workspace .stats small { color: var(--admin-muted); font-size: 11px; }
body.admin-mode .admin-dashboard-grid {
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, .75fr);
  gap: 18px;
}
body.admin-mode .admin-shortcut {
  display: grid;
  grid-template-columns: 38px 1fr 18px;
  gap: 11px;
  padding: 13px 4px;
  border-color: var(--admin-border);
}
body.admin-mode .admin-shortcut > svg:first-child {
  width: 38px;
  height: 38px;
  padding: 9px;
  color: var(--admin-accent);
  background: var(--admin-accent-soft);
  border-radius: 10px;
}
body.admin-mode .admin-shortcut > svg:last-child { width: 17px; margin: 0; }
body.admin-mode .admin-shortcut b { color: var(--admin-text); }
body.admin-mode .admin-shortcut small { color: var(--admin-muted); }
body.admin-mode .admin-shortcut:hover { background: var(--admin-soft); }
body.admin-mode .admin-note {
  padding: 13px 14px;
  color: #675927;
  background: var(--admin-warning);
  border-color: #eadca8;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.65;
}

/* Forms, filters and tables */
body.admin-mode .admin-workspace label,
body.admin-mode .admin-dialog label { color: #555a63; font-size: 12px; font-weight: 800; }
body.admin-mode .admin-workspace input,
body.admin-mode .admin-workspace select,
body.admin-mode .admin-workspace textarea,
body.admin-mode .admin-dialog input,
body.admin-mode .admin-dialog select,
body.admin-mode .admin-dialog textarea {
  min-height: 42px;
  padding: 9px 11px;
  color: var(--admin-text);
  background: #fff;
  border-color: var(--admin-border-strong);
  border-radius: 8px;
  box-shadow: inset 0 1px 2px rgba(27,31,38,.025);
}
body.admin-mode .admin-workspace input:focus,
body.admin-mode .admin-workspace select:focus,
body.admin-mode .admin-workspace textarea:focus,
body.admin-mode .admin-dialog input:focus,
body.admin-mode .admin-dialog select:focus,
body.admin-mode .admin-dialog textarea:focus {
  border-color: #8e756a;
  box-shadow: 0 0 0 3px rgba(203,227,238,.7);
}
body.admin-mode .admin-summary-line {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 12px;
  margin: 0 0 18px;
}
body.admin-mode .admin-summary-line > span {
  padding: 12px 15px;
  color: var(--admin-muted);
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
}
body.admin-mode .admin-summary-line b { color: var(--admin-text); font-size: 20px; }
body.admin-mode .admin-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(165px,1fr));
  align-items: end;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--admin-soft);
  border: 1px solid var(--admin-border);
  border-radius: 11px;
}
body.admin-mode .admin-filters label,
body.admin-mode .admin-filters label:first-child { min-width: 0; }
body.admin-mode .admin-filters .button { width: 100%; }
body.admin-mode .admin-workspace .table-wrap {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 11px;
  overflow-x: auto;
}
body.admin-mode .admin-data-table { font-size: 13px; }
body.admin-mode .admin-data-table th {
  padding: 13px 15px;
  color: #656b74;
  background: #f7f8fa;
  border-color: #edf0f3;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .025em;
}
body.admin-mode .admin-data-table td {
  padding: 14px 15px;
  color: #535760;
  border-color: #edf0f3;
}
body.admin-mode .admin-data-table tbody tr:hover { background: #fbfcfd; }
body.admin-mode .admin-data-table td b { color: var(--admin-text); font-size: 13px; }
body.admin-mode .admin-data-table td small { color: var(--admin-muted); font-size: 11px; }
body.admin-mode .admin-product-cell { min-width: 220px; gap: 11px; }
body.admin-mode .admin-product-cell img {
  width: 54px;
  height: 66px;
  background: var(--admin-info);
  border: 1px solid var(--admin-border);
  border-radius: 9px;
}
body.admin-mode .row-actions { flex-wrap: nowrap; gap: 7px; }
body.admin-mode .order-number { color: var(--admin-accent); font-size: 12px; font-weight: 900; }
body.admin-mode .admin-workspace .status {
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
body.admin-mode .admin-pagination { padding-top: 16px; color: var(--admin-muted); font-size: 12px; }
body.admin-mode .admin-footnote { color: var(--admin-muted); }
body.admin-mode .admin-empty { min-height: 220px; padding: 28px; }
body.admin-mode .admin-empty svg {
  width: 44px;
  height: 44px;
  padding: 10px;
  color: var(--admin-accent);
  background: var(--admin-accent-soft);
  border-radius: 12px;
}
body.admin-mode .admin-empty h3 { margin: 8px 0 0; }
body.admin-mode .admin-empty p { color: var(--admin-muted); }

/* Orders, reports and settings */
body.admin-mode .admin-back { color: var(--admin-accent); font-size: 13px; font-weight: 800; }
body.admin-mode .admin-order-grid { grid-template-columns: minmax(0,1.55fr) minmax(320px,.75fr); gap: 18px; }
body.admin-mode .admin-order-grid .stack { gap: 18px; }
body.admin-mode .admin-totals > div,
body.admin-mode .admin-details > div { padding: 9px 0; border-color: var(--admin-border); }
body.admin-mode .admin-totals dt,
body.admin-mode .admin-details dt { color: var(--admin-muted); }
body.admin-mode .admin-totals dd,
body.admin-mode .admin-details dd { color: var(--admin-text); font-weight: 800; text-align: right; }
body.admin-mode .admin-totals .grand-total { border-color: var(--admin-border-strong); }
body.admin-mode .admin-history li > span { background: #cbe3ee; border: 3px solid #fff; box-shadow: 0 0 0 1px #a9c9d7; }
body.admin-mode .admin-history li:not(:last-child)::after { background: var(--admin-border); }
body.admin-mode .order-action-stack .button { width: 100%; }
body.admin-mode .customer-address {
  padding: 12px 14px;
  color: var(--admin-text);
  background: var(--admin-soft);
  border: 1px solid var(--admin-border);
  border-radius: 9px;
}
body.admin-mode .report-controls { margin-bottom: 18px; }
body.admin-mode .admin-tabs { background: #f0f2f5; border: 0; border-radius: 10px; }
body.admin-mode .admin-tabs button { min-height: 36px; color: var(--admin-muted); border-radius: 7px; font-weight: 800; }
body.admin-mode .admin-tabs button.active { color: var(--admin-text); background: #fff; box-shadow: 0 2px 7px rgba(27,31,38,.08); }
body.admin-mode .admin-date-range { display: grid; grid-template-columns: minmax(170px,1fr) minmax(170px,1fr) auto; }
body.admin-mode .admin-date-range label { max-width: none; }
body.admin-mode .admin-bank-row {
  padding: 16px;
  background: var(--admin-soft);
  border-color: var(--admin-border);
  border-radius: 11px;
}
body.admin-mode .admin-bank-row legend { color: var(--admin-text); font-weight: 900; }
body.admin-mode .settings-savebar {
  padding: 15px 17px;
  border-color: var(--admin-border-strong);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(27,31,38,.08);
}
body.admin-mode .backup-grid { gap: 14px; }
body.admin-mode .backup-grid article {
  padding: 17px;
  background: var(--admin-soft);
  border-color: var(--admin-border);
  border-radius: 11px;
}

/* Product editor and confirmation dialogs */
body.admin-mode .admin-dialog {
  width: min(980px,calc(100% - 32px));
  max-height: min(90vh,900px);
  color: var(--admin-text);
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(27,31,38,.2);
}
body.admin-mode .admin-dialog::backdrop { background: rgba(27,24,23,.58); backdrop-filter: blur(3px); }
body.admin-mode .dialog-heading {
  min-height: 68px;
  padding: 16px 22px;
  background: rgba(255,255,255,.96);
  border-color: var(--admin-border);
  backdrop-filter: blur(12px);
}
body.admin-mode .dialog-heading h2 { color: var(--admin-text); font-size: 21px; }
body.admin-mode .dialog-heading .icon-button {
  width: 38px;
  height: 38px;
  color: var(--admin-muted);
  background: #f4f5f7;
  border: 1px solid var(--admin-border);
  border-radius: 9px;
}
body.admin-mode .admin-editor { padding: 22px; }
body.admin-mode .editor-layout { grid-template-columns: minmax(0,1.45fr) minmax(280px,.65fr); gap: 24px; }
body.admin-mode .editor-layout > section,
body.admin-mode .editor-layout > aside {
  min-width: 0;
  padding: 18px;
  background: var(--admin-soft);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
}
body.admin-mode .editor-layout > aside { border-left: 1px solid var(--admin-border); }
body.admin-mode .editor-layout h3 { color: var(--admin-text); font-size: 17px; }
body.admin-mode .editor-footer { padding-top: 17px; border-color: var(--admin-border); }
body.admin-mode .admin-confirm { display: grid; gap: 16px; padding: 22px; }
body.admin-mode .admin-confirm > p { margin: 0; color: var(--admin-text); }
body.admin-mode .admin-image-tile { aspect-ratio: 1; background: #eef2f5; border-color: var(--admin-border); }
body.admin-mode .admin-image-delete {
  width: 28px;
  height: 28px;
  color: #fff;
  background: rgba(155,48,48,.9);
  border: 2px solid #fff;
}
body.admin-mode .admin-image-delete:hover { color: #fff; background: #8f2d2d; }
body.admin-mode .admin-image-dropzone {
  min-height: 136px;
  background: #fff;
  border-color: #bec5cf;
}
body.admin-mode .admin-image-dropzone:hover { background: var(--admin-info); border-color: #8eb4c4; }
body.admin-mode .admin-upload-symbol { width: 38px; height: 38px; font-size: 24px; }
body.admin-mode .hint { color: var(--admin-muted); }

/* Login */
body.admin-mode .admin-login {
  background: radial-gradient(circle at 18% 15%,rgba(203,227,238,.8),transparent 31%), radial-gradient(circle at 82% 82%,rgba(244,225,166,.75),transparent 30%), #f7f5f3;
}
body.admin-mode .admin-login form {
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(45,40,38,.14);
}
body.admin-mode .admin-login h1 { font-size: 30px; }
body.admin-mode .admin-login .login-brand { font-size: 21px; text-align: left; text-decoration: none; }

@media (max-width: 1180px) {
  body.admin-mode .admin-workspace { grid-template-columns: 230px minmax(0,1fr); }
  body.admin-mode .admin-workspace .admin-sidebar { width: 230px; }
  body.admin-mode .admin-dashboard-grid,
  body.admin-mode .admin-order-grid { grid-template-columns: 1fr; }
  body.admin-mode .admin-dashboard-grid > aside { display: block; }
  body.admin-mode .admin-order-grid > aside { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  body.admin-mode .admin-workspace .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  body.admin-mode .admin-workspace { display: block; }
  body.admin-mode .admin-workspace .admin-sidebar {
    width: 100%;
    height: auto;
    padding: 10px 12px 9px;
    border-right: 0;
    position: sticky;
    top: 0;
    z-index: 40;
  }
  body.admin-mode .admin-workspace .admin-brand { min-height: 44px; padding: 2px 4px 8px; border: 0; }
  body.admin-mode .admin-brand > span:first-child { width: 34px; height: 34px; border-radius: 9px; font-size: 14px; }
  body.admin-mode .admin-brand strong { font-size: 14px; }
  body.admin-mode .admin-brand small,
  body.admin-mode .admin-nav-label,
  body.admin-mode .owner-card { display: none; }
  body.admin-mode .admin-workspace .admin-sidebar nav {
    display: flex;
    gap: 5px;
    padding: 0 0 3px;
    overflow-x: auto;
  }
  body.admin-mode .admin-workspace .admin-sidebar nav a {
    min-width: max-content;
    min-height: 40px;
    flex-shrink: 0;
    padding: 8px 10px;
    font-size: 12px;
  }
  body.admin-mode .admin-workspace .admin-sidebar nav a:hover { transform: none; }
  body.admin-mode .admin-sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 0;
    padding: 7px 3px 0;
    border-top: 1px solid rgba(255,255,255,.1);
    position: static;
  }
  body.admin-mode .admin-sidebar-footer > a { display: block; }
  body.admin-mode .admin-sidebar-footer > button { min-height: 30px; padding: 4px 8px; }
  body.admin-mode .admin-workspace .admin-main { padding: 20px 16px 46px; }
  body.admin-mode .editor-layout { grid-template-columns: 1fr; }
  body.admin-mode .editor-layout > aside { padding: 18px; border-top: 1px solid var(--admin-border); }
}
@media (max-width: 620px) {
  body.admin-mode .admin-workspace .admin-main { padding-inline: 12px; }
  body.admin-mode .admin-topline > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.admin-mode .owner-access { display: inline-flex; flex: 0 0 auto; font-size: 10px; }
  body.admin-mode .admin-title { align-items: stretch; }
  body.admin-mode .admin-title > .actions { width: 100%; }
  body.admin-mode .admin-title > .actions .button { flex: 1; }
  body.admin-mode .admin-workspace .stats,
  body.admin-mode .admin-summary-line,
  body.admin-mode .backup-grid { grid-template-columns: 1fr; }
  body.admin-mode .admin-workspace .stats article { min-height: 112px; }
  body.admin-mode .admin-workspace .panel { padding: 16px; border-radius: 12px; }
  body.admin-mode .admin-filters { grid-template-columns: 1fr; padding: 13px; }
  body.admin-mode .admin-pagination,
  body.admin-mode .settings-savebar { align-items: stretch; flex-direction: column; }
  body.admin-mode .admin-pagination .actions,
  body.admin-mode .settings-savebar .actions { width: 100%; }
  body.admin-mode .admin-pagination .button,
  body.admin-mode .settings-savebar .button { flex: 1; }
  body.admin-mode .section-heading { align-items: flex-start; flex-direction: column; }
  body.admin-mode .admin-order-grid > aside { grid-template-columns: 1fr; }
  body.admin-mode .admin-date-range { grid-template-columns: 1fr; }
  body.admin-mode .admin-date-range .button { width: 100%; }
  body.admin-mode .admin-tabs { width: 100%; display: grid; grid-template-columns: repeat(2,1fr); }
  body.admin-mode .admin-image-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body.admin-mode .admin-dialog { width: calc(100% - 16px); max-height: 94vh; border-radius: 13px; }
  body.admin-mode .dialog-heading { padding: 13px 15px; }
  body.admin-mode .admin-editor,
  body.admin-mode .admin-confirm { padding: 14px; }
  body.admin-mode .editor-layout > section,
  body.admin-mode .editor-layout > aside { padding: 14px; }
  body.admin-mode .editor-footer {
    margin-inline: -14px;
    margin-bottom: -14px;
    padding: 12px 14px;
    background: rgba(255,255,255,.96);
  }
  body.admin-mode .editor-footer .button { flex: 1; }
  body.admin-mode .row-actions { flex-direction: column; }
  body.admin-mode .admin-login { padding: 14px; }
  body.admin-mode .admin-login form { padding: 22px 18px; }
}

/* Mobile owner workspace — compact top bar and thumb-friendly bottom navigation. */
@media (max-width: 900px) {
  body.admin-mode { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }

  body.admin-mode .admin-workspace .admin-sidebar {
    min-height: 60px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    box-shadow: 0 6px 20px rgba(28, 24, 22, .16);
  }
  body.admin-mode .admin-workspace .admin-brand {
    min-width: 0;
    min-height: 44px;
    flex: 1 1 auto;
    gap: 9px;
    padding: 0;
  }
  body.admin-mode .admin-brand > span:last-child { min-width: 0; }
  body.admin-mode .admin-brand strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.admin-mode .admin-sidebar-footer {
    flex: 0 0 auto;
    gap: 7px;
    margin: 0;
    padding: 0;
    border: 0;
  }
  body.admin-mode .admin-sidebar-footer > a,
  body.admin-mode .admin-sidebar-footer > button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 9px;
    font-size: 12px;
    white-space: nowrap;
  }
  body.admin-mode .admin-sidebar-footer > a { color: #f4e1a6; }

  body.admin-mode .admin-workspace .admin-sidebar nav {
    height: calc(72px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 6px 7px calc(6px + env(safe-area-inset-bottom));
    overflow: visible;
    color: var(--admin-muted);
    background: rgba(255,255,255,.97);
    border-top: 1px solid var(--admin-border);
    box-shadow: 0 -10px 28px rgba(28, 34, 44, .1);
    position: fixed;
    inset: auto 0 0;
    z-index: 80;
    backdrop-filter: blur(16px);
  }
  body.admin-mode .admin-workspace .admin-sidebar nav a {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 3px;
    color: #73777f;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
  }
  body.admin-mode .admin-workspace .admin-sidebar nav a svg {
    width: 21px;
    height: 21px;
  }
  body.admin-mode .admin-workspace .admin-sidebar nav a span {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
  }
  body.admin-mode .admin-workspace .admin-sidebar nav a:hover {
    color: var(--admin-accent);
    background: var(--admin-accent-soft);
  }
  body.admin-mode .admin-workspace .admin-sidebar nav a.active {
    color: var(--admin-accent);
    background: #fff7d9;
    border-color: #eadca8;
    box-shadow: none;
  }
  body.admin-mode .admin-workspace .admin-main {
    padding-top: 18px;
    padding-bottom: 32px;
  }
  body.admin-mode .settings-savebar {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
  body.admin-mode .table-wrap {
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }
  body.admin-mode .admin-dialog { z-index: 120; }
}

@media (max-width: 620px) {
  body.admin-mode .admin-sidebar-footer > a { display: none; }
  body.admin-mode .admin-topline { display: none; }
  body.admin-mode .admin-workspace .admin-main { padding: 16px 12px 28px; }
  body.admin-mode .admin-title {
    gap: 14px;
    margin-bottom: 18px;
  }
  body.admin-mode .admin-title h1 { font-size: 28px; }
  body.admin-mode .admin-title p { font-size: 13px; line-height: 1.55; }
  body.admin-mode .admin-title .admin-eyebrow { font-size: 10px; }
  body.admin-mode .admin-title > .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.admin-mode .admin-title > .actions:has(> :only-child) { grid-template-columns: 1fr; }
  body.admin-mode .admin-title > .actions .button {
    width: 100%;
    min-height: 44px;
  }
  body.admin-mode .admin-workspace .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  body.admin-mode .admin-workspace .stats article {
    min-height: 108px;
    padding: 15px;
  }
  body.admin-mode .admin-workspace .stats b { font-size: clamp(22px, 7vw, 28px); }
  body.admin-mode .admin-workspace .stats small { font-size: 12px; line-height: 1.35; }
  body.admin-mode .admin-summary-line { gap: 8px; }
  body.admin-mode .admin-summary-line > span { padding: 11px 13px; font-size: 13px; }
  body.admin-mode .admin-workspace label,
  body.admin-mode .admin-dialog label { font-size: 14px; }
  body.admin-mode .admin-workspace input,
  body.admin-mode .admin-workspace select,
  body.admin-mode .admin-workspace textarea,
  body.admin-mode .admin-dialog input,
  body.admin-mode .admin-dialog select,
  body.admin-mode .admin-dialog textarea {
    min-height: 46px;
    font-size: 16px;
  }
  body.admin-mode .admin-workspace .button,
  body.admin-mode .admin-dialog .button { min-height: 44px; font-size: 14px; }
  body.admin-mode .admin-filters { gap: 14px; }
  body.admin-mode .admin-pagination { gap: 12px; }
  body.admin-mode .admin-pagination > span { font-size: 13px; }
  body.admin-mode .admin-pagination .actions { display: grid; grid-template-columns: 1fr auto 1fr; }
  body.admin-mode .admin-pagination .actions > span { align-self: center; text-align: center; }
  body.admin-mode .admin-workspace .admin-sidebar nav a { font-size: 12px; }

  body.admin-mode .admin-dialog {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  body.admin-mode .dialog-heading { min-height: 58px; }
  body.admin-mode .dialog-heading h2 { font-size: 19px; }
  body.admin-mode .admin-image-dropzone { min-height: 120px; }
  body.admin-mode .editor-footer {
    bottom: 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  body.admin-mode .toast {
    right: 12px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    left: 12px;
    max-width: none;
  }
}

@media (max-width: 350px) {
  body.admin-mode .admin-workspace .admin-sidebar nav a { gap: 2px; font-size: 11px; }
  body.admin-mode .admin-workspace .admin-sidebar nav a svg { width: 20px; height: 20px; }
  body.admin-mode .admin-workspace .stats { grid-template-columns: 1fr; }
  body.admin-mode .admin-workspace .stats article { min-height: 100px; }
}

/* Keep payment accounts compact and easy to scan on wide settings pages. */
body.admin-mode [data-bank-rows] { display: grid; gap: 14px; }
body.admin-mode .admin-bank-row { margin: 0; padding: 14px 18px 18px; background: #fff; }
body.admin-mode .admin-bank-row legend { padding: 0 8px; font-size: 13px; }
body.admin-mode .admin-bank-row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; color: var(--admin-muted); font-size: 12px; }
body.admin-mode .admin-bank-row-head .link { margin: 0; white-space: nowrap; }
body.admin-mode .admin-bank-row .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
body.admin-mode .admin-bank-row .form-grid label { min-width: 0; }
body.admin-mode .admin-bank-row .form-grid :is(input, select) { width: 100%; }
@media (max-width: 1050px) {
  body.admin-mode .admin-bank-row .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.admin-mode .admin-bank-row .form-grid label:last-child { grid-column: 1 / -1; }
}
@media (max-width: 650px) {
  body.admin-mode .admin-bank-row .form-grid { grid-template-columns: minmax(0, 1fr); }
  body.admin-mode .admin-bank-row .form-grid label:last-child { grid-column: auto; }
body.admin-mode .admin-bank-row-head { align-items: flex-start; }
}

body.admin-mode .slip-check { display: grid; gap: 4px; margin-bottom: 13px; padding: 11px 12px; border-radius: 9px; font-size: 12px; }
body.admin-mode .slip-check small { font-size: 11px; line-height: 1.5; }
body.admin-mode .slip-check.verified { color: #216747; background: #ecf8f1; border: 1px solid #c9e8d7; }
body.admin-mode .slip-check.pending { color: #805913; background: #fff8e8; border: 1px solid #efdfbb; }
body.admin-mode .admin-dialog:has(.admin-slip-preview) { width: min(760px, calc(100vw - 32px)); }
body.admin-mode .admin-slip-preview { display: grid; justify-items: center; gap: 15px; padding: 20px; }
body.admin-mode .admin-slip-preview img { display: block; max-width: 100%; max-height: min(70dvh, 780px); object-fit: contain; border-radius: 7px; }
