:root {
  color-scheme: light;
  --ink: #182230;
  --muted: #738092;
  --line: #e6eaf0;
  --surface: #fff;
  --canvas: #f5f7fb;
  --navy: #123d71;
  --blue: #245ca6;
  --blue-soft: #eaf2fc;
  --green: #18865b;
  --red: #c84141;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 14px; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
input, textarea, select { min-width: 0; color: var(--ink); }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid #91b8ed; outline-offset: 2px; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 7px; color: #8290a2; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 0 16px; border: 1px solid transparent; border-radius: 8px; font-weight: 700; transition: background .15s ease, border-color .15s ease; }
.button-primary { color: #fff; background: var(--navy); }
.button-primary:hover { background: #0d315c; }
.button-secondary { color: #465366; background: #fff; border-color: var(--line); }
.button-secondary:hover, .button-subtle:hover { background: #f1f5fa; }
.button-subtle { min-height: 34px; padding: 0 11px; color: var(--blue); background: var(--blue-soft); }
.button-wide { width: 100%; margin-top: 8px; }

.login-view { display: grid; min-height: 100vh; place-items: center; padding: 20px; background: radial-gradient(ellipse at top left, #e6effb 0, transparent 48%), var(--canvas); }
.login-card { width: min(100%, 390px); padding: 38px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 55px #1b345014; }
.brand-mark { display: grid; width: 43px; height: 43px; place-items: center; margin-bottom: 22px; color: white; background: var(--navy); border-radius: 12px; font-size: 24px; font-weight: 800; text-decoration: none; }
.login-card h1 { margin: 0; font-size: 26px; letter-spacing: -.04em; }
.login-card > .muted { margin: 8px 0 27px; }
.login-card > label { display: block; margin: 0 0 7px; font-size: 12px; font-weight: 700; }
.login-card input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #d9e0e9; border-radius: 8px; }
.message { min-height: 18px; margin: 10px 0 0; color: var(--red); font-size: 12px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 2; inset: 0 auto 0 0; display: flex; width: 238px; flex-direction: column; padding: 24px 16px 16px; color: #dce7f5; background: #102b4d; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; margin: 0 4px 42px; color: white; font-size: 14px; font-weight: 700; letter-spacing: .05em; text-decoration: none; }
.sidebar-brand .brand-mark { width: 39px; height: 39px; margin: 0; color: #12365f; background: #fff; border-radius: 10px; font-size: 21px; }
.sidebar-brand b { font-weight: 400; }
.sidebar-brand small { display: block; margin-top: 4px; color: #95aac3; font-size: 9px; letter-spacing: .16em; }
.nav-label { margin: 0 10px 10px; color: #8da3be; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.sidebar nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; color: #c8d6e8; border-radius: 8px; font-weight: 600; text-decoration: none; }
.nav-link > span { width: 18px; text-align: center; font-size: 17px; }
.nav-link:hover, .nav-link.active { color: #fff; background: #ffffff18; }
.sidebar-bottom { display: grid; grid-template-columns: 10px 1fr; align-items: center; gap: 7px; margin-top: auto; padding: 14px 8px 4px; border-top: 1px solid #ffffff20; color: #aec0d5; font-size: 11px; }
.connection-dot { width: 8px; height: 8px; background: #4bd28f; border-radius: 50%; box-shadow: 0 0 0 3px #4bd28f22; }
.logout-button { grid-column: 2; justify-self: start; margin: 8px 0 0; padding: 0; color: #dce7f5; background: transparent; border: 0; font-size: 12px; }
.logout-button:hover { color: #fff; text-decoration: underline; }
.main-area { min-height: 100vh; margin-left: 238px; padding: 30px clamp(20px, 4vw, 54px) 50px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.store-link { color: #516176; font-size: 12px; font-weight: 700; text-decoration: none; }
.store-link:hover { color: var(--blue); }
.global-message { min-height: 0; color: var(--red); font-size: 13px; }
.global-message:not(:empty) { padding: 12px 14px; margin: 14px 0 0; background: #fff0f0; border-radius: 8px; }
.page-view { padding-top: 24px; }
.welcome-row { margin-bottom: 17px; }
.welcome-row h2, .panel-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.welcome-row p, .panel-heading p { margin: 5px 0 0; font-size: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 22px; }
.stat-card { display: flex; min-height: 90px; align-items: center; gap: 14px; padding: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.stat-icon { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; color: #2862a7; background: #eaf2fc; border-radius: 10px; font-size: 19px; font-weight: 700; }
.stat-icon-green { color: #168358; background: #e6f6ef; }
.stat-icon-orange { color: #b17421; background: #fff3df; }
.stat-card p { margin: 0 0 5px; color: var(--muted); font-size: 11px; }
.stat-card strong { font-size: 20px; letter-spacing: -.03em; }
.panel { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.panel-heading { display: flex; min-height: 78px; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; }
.search-box { display: flex; width: min(100%, 260px); height: 38px; align-items: center; gap: 8px; padding: 0 10px; color: #8491a2; border: 1px solid var(--line); border-radius: 7px; }
.search-box > span { font-size: 22px; line-height: 1; }
.search-box input { width: 100%; border: 0; outline: 0; font-size: 12px; }
.table-scroll { width: 100%; overflow-x: auto; }
.products-table { width: 100%; border-collapse: collapse; text-align: left; }
.products-table th { padding: 11px 19px; color: #8490a0; background: #fafbfd; border-top: 1px solid #eff1f4; border-bottom: 1px solid #eff1f4; font-size: 9px; letter-spacing: .09em; white-space: nowrap; }
.products-table td { padding: 13px 19px; border-bottom: 1px solid #eff1f4; color: #4b586a; font-size: 12px; white-space: nowrap; }
.products-table tbody tr:last-child td { border-bottom: 0; }
.product-cell { display: flex; min-width: 200px; align-items: center; gap: 11px; }
.product-thumb { width: 42px; height: 42px; flex: 0 0 auto; object-fit: cover; background: #f1f4f8; border: 1px solid var(--line); border-radius: 7px; }
.product-cell strong { display: block; max-width: 260px; overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; }
.product-cell small { display: block; margin-top: 4px; color: #8b96a5; font-size: 10px; }
.category-pill { display: inline-block; padding: 5px 8px; color: #516d8d; background: #f0f4f8; border-radius: 5px; font-size: 10px; }
.category-manager { margin-bottom: 20px; }
.category-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 0 20px 16px;
}
.category-form .form-field { margin: 0; }
.category-form .button { min-height: 42px; }
.category-form .status-text { grid-column: 1 / -1; margin: 0; }
.category-list {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 18px;
}
.category-list .category-pill { max-width: 100%; overflow-wrap: anywhere; font-size: 11px; }
.category-list-empty { margin: 0; color: var(--muted); font-size: 12px; }
.table-actions { display: flex; gap: 7px; }
.table-action { padding: 6px 9px; color: var(--blue); background: white; border: 1px solid var(--line); border-radius: 6px; font-size: 10px; font-weight: 700; }
.table-action:hover { background: var(--blue-soft); }
.table-action.delete { color: #b94747; }
.table-action.delete:hover { background: #fff0f0; }
.empty-state { padding: 45px 20px; text-align: center; }
.empty-state > span { color: #9eacc0; font-size: 35px; }
.empty-state h3 { margin: 8px 0; font-size: 15px; }
.empty-state p { margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.orders-list { padding: 0 20px 18px; }
.order-card { padding: 15px 0; border-top: 1px solid var(--line); }
.order-card h3 { margin: 0 0 5px; font-size: 14px; }
.order-card p { margin: 4px 0; color: var(--muted); font-size: 12px; }
.order-card ul { margin: 9px 0 0; padding-left: 20px; color: #455368; font-size: 12px; }

.modal-backdrop { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 22px; background: #10243f8c; }
.editor-modal { display: flex; width: min(1120px, 100%); max-height: calc(100vh - 44px); flex-direction: column; overflow: hidden; background: white; border-radius: 14px; box-shadow: 0 25px 90px #0a1a2c45; }
.editor-header { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; padding: 18px 25px; border-bottom: 1px solid var(--line); }
.editor-header h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.icon-button { display: grid; width: 35px; height: 35px; place-items: center; color: #647184; background: white; border: 1px solid var(--line); border-radius: 7px; font-size: 24px; }
#productForm { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.editor-layout { display: grid; min-height: 0; grid-template-columns: minmax(0, 1fr) 260px; gap: 25px; padding: 22px 25px; overflow-y: auto; }
.editor-fields { min-width: 0; }
.form-section { padding: 0 0 22px; margin-bottom: 22px; border-bottom: 1px solid #edf0f4; }
.form-section:last-child { margin-bottom: 0; border-bottom: 0; }
.form-section > h3, .section-title-row h3 { margin: 0; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 15px; }
.form-field { display: grid; align-content: start; gap: 6px; color: #48566a; font-size: 11px; font-weight: 700; }
.form-field input, .form-field textarea, .form-field select { width: 100%; min-height: 38px; padding: 9px 10px; color: #273448; background: white; border: 1px solid #dfe5ec; border-radius: 7px; font-size: 12px; font-weight: 400; }
.form-field textarea { resize: vertical; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #a0a9b5; }
.span-2 { grid-column: span 2; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-title-row .muted { margin: 5px 0 0; font-size: 11px; }
.dynamic-list { display: grid; gap: 8px; margin-top: 12px; }
.dynamic-row { display: flex; align-items: center; gap: 8px; }
.dynamic-row input { min-height: 36px; padding: 8px 10px; border: 1px solid #dfe5ec; border-radius: 7px; font-size: 12px; }
.dynamic-row .feature-input { flex: 1; }
.dynamic-row .spec-key { width: 34%; }
.dynamic-row .spec-value { flex: 1; }
.remove-row { width: 34px; height: 34px; flex: 0 0 auto; color: #ad5050; background: white; border: 1px solid #eadede; border-radius: 7px; font-size: 18px; }
.upload-zone { display: grid; min-height: 112px; align-content: center; justify-items: center; gap: 5px; margin-top: 14px; padding: 14px; color: #44566d; background: #f8fbff; border: 1px dashed #b8c9df; border-radius: 9px; cursor: pointer; text-align: center; }
.upload-zone:hover { background: #f0f6ff; }
.upload-zone > span:not(.upload-icon) { color: #8794a4; font-size: 10px; }
.upload-icon { display: grid; width: 28px; height: 28px; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 8px; font-size: 19px; }
.upload-zone input { width: 1px; height: 1px; position: absolute; overflow: hidden; clip: rect(0, 0, 0, 0); }
.cloudinary-config { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 13px; margin-top: 12px; background: #fafbfd; border: 1px solid #edf0f4; border-radius: 8px; }
.help-text { margin: 0; color: #8794a4; font-size: 10px; line-height: 1.5; }
.manual-image-row { display: flex; align-items: end; gap: 9px; margin-top: 12px; }
.manual-image-row .form-field { flex: 1; }
.image-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 9px; margin-top: 13px; }
.image-item { position: relative; overflow: hidden; aspect-ratio: 1.25; background: #f0f3f7; border: 1px solid var(--line); border-radius: 7px; }
.image-item > img { width: 100%; height: 100%; object-fit: cover; }
.image-item .image-main { position: absolute; bottom: 5px; left: 5px; padding: 4px 6px; color: white; background: #123d71e8; border: 0; border-radius: 4px; font-size: 9px; font-weight: 700; }
.image-item .image-remove { position: absolute; top: 5px; right: 5px; display: grid; width: 23px; height: 23px; place-items: center; color: #752d2d; background: #fff; border: 0; border-radius: 50%; font-size: 15px; }
.image-empty { grid-column: 1 / -1; padding: 13px; color: #8b96a5; background: #fafbfd; border-radius: 7px; font-size: 11px; text-align: center; }
.preview-column { position: sticky; top: 0; align-self: start; }
.preview-card { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 20px #182f4c0a; }
.preview-top { display: flex; align-items: center; justify-content: space-between; padding: 13px; border-bottom: 1px solid #edf0f4; }
.preview-top h3 { margin: 0; font-size: 12px; }
.preview-tag { color: #8a96a5; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.preview-image-wrap { display: grid; height: 175px; place-items: center; background: #f7f9fc; }
.preview-image-wrap img { width: 100%; height: 100%; object-fit: contain; }
.preview-placeholder { color: #a3adba; font-size: 11px; }
.preview-content { padding: 14px; }
.preview-category { color: #73849b; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.preview-content h3 { margin: 7px 0; font-size: 14px; line-height: 1.4; }
.preview-content p { display: -webkit-box; min-height: 32px; overflow: hidden; margin: 0 0 12px; color: #7c8796; font-size: 10px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.preview-price { display: flex; align-items: center; gap: 8px; }
.preview-price strong { color: var(--navy); font-size: 14px; }  
.preview-price s { color: #9ca5b1; font-size: 11px; }
.preview-hint { color: #929eac; font-size: 10px; text-align: center; }
.editor-footer { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 9px; padding: 13px 25px; border-top: 1px solid var(--line); }
.status-text { flex: 1; color: var(--muted); font-size: 11px; }
.status-text.error { color: var(--red); }

@media (max-width: 900px) {
  .sidebar { width: 205px; }
  .main-area { margin-left: 205px; padding-right: 22px; padding-left: 22px; }
  .editor-layout { grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; padding: 18px; }
}
@media (max-width: 680px) {
  .sidebar { position: static; width: 100%; height: auto; padding: 10px 14px; }
  .sidebar-brand { margin: 0 3px 10px; }
  .sidebar-brand .brand-mark { width: 34px; height: 34px; margin: 0; }
  .nav-label, .sidebar-bottom { display: none; }
  .sidebar nav { display: flex; gap: 5px; }
  .nav-link { padding: 8px 11px; font-size: 12px; }
  .main-area { min-height: calc(100vh - 98px); margin-left: 0; padding: 19px 14px 30px; }
  .topbar { align-items: flex-end; padding-bottom: 17px; }
  .topbar h1 { font-size: 22px; }
  .topbar-actions { gap: 9px; }
  .store-link { display: none; }
  .stats-grid { gap: 8px; }
  .stat-card { min-height: 78px; gap: 8px; padding: 10px; }
  .stat-icon { width: 31px; height: 31px; font-size: 15px; }
  .stat-card p { font-size: 9px; line-height: 1.3; }
  .stat-card strong { font-size: 17px; }
  .panel-heading { align-items: flex-start; flex-direction: column; padding: 15px; }
  .search-box { width: 100%; }
  .products-table th, .products-table td { padding-right: 12px; padding-left: 12px; }
  .editor-modal { max-height: calc(100vh - 20px); }
  .modal-backdrop { padding: 10px; }
  .editor-layout { display: flex; flex-direction: column; padding: 16px; }
  .preview-column { position: static; order: -1; }
  .preview-image-wrap { height: 145px; }
  .editor-header { padding: 14px 16px; }
  .editor-footer { flex-wrap: wrap; padding: 11px 16px; }
  .status-text { width: 100%; flex-basis: 100%; }
}
@media (max-width: 420px) {
  .login-card { padding: 28px 22px; }
  .button { min-height: 38px; padding: 0 11px; font-size: 11px; }
  .topbar-actions .button { padding: 0 10px; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 66px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .cloudinary-config { grid-template-columns: 1fr; }
  .cloudinary-config .span-2 { grid-column: auto; }
  .section-title-row { align-items: flex-start; }
  .manual-image-row { align-items: stretch; flex-direction: column; }
}

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(250px, 1fr); align-items: start; gap: 16px; }
.dashboard-stats { margin-bottom: 16px; }
.panel-state { padding: 18px 20px; margin: 0; color: var(--muted); font-size: 12px; }
.panel-state.error { color: var(--red); }
.panel-state.success { color: var(--green); }
.text-button { padding: 6px 0; color: var(--blue); background: transparent; border: 0; font-size: 11px; font-weight: 700; white-space: nowrap; }
.text-button:hover { color: var(--navy); }
.recent-orders { padding: 0 20px 10px; }
.recent-order { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(120px, 1.2fr) auto; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid #eff1f4; }
.recent-order-main strong, .recent-order-main small { display: block; }
.recent-order-main strong { color: var(--ink); font-size: 12px; }
.recent-order-main small, .recent-order-products { margin-top: 4px; color: var(--muted); font-size: 10px; }
.recent-order-products { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-actions-panel .panel-heading { min-height: 73px; }
.quick-actions { padding: 0 16px 10px; }
.quick-action { display: grid; width: 100%; grid-template-columns: 35px minmax(0, 1fr) 16px; align-items: center; gap: 11px; padding: 13px 4px; color: var(--ink); background: transparent; border: 0; border-top: 1px solid #eff1f4; text-align: left; }
.quick-action:hover strong { color: var(--blue); }
.quick-action-icon { display: grid; width: 34px; height: 34px; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 8px; font-size: 17px; }
.quick-action strong, .quick-action small { display: block; }
.quick-action strong { font-size: 11px; }
.quick-action small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.orders-table { width: 100%; border-collapse: collapse; text-align: left; }
.orders-table th { padding: 11px 16px; color: #8490a0; background: #fafbfd; border-top: 1px solid #eff1f4; border-bottom: 1px solid #eff1f4; font-size: 9px; letter-spacing: .09em; white-space: nowrap; }
.orders-table td { padding: 13px 16px; color: #4b586a; border-bottom: 1px solid #eff1f4; font-size: 12px; vertical-align: middle; }
.orders-table tbody tr:last-child td { border-bottom: 0; }
.order-customer-cell strong, .order-customer-cell small, .order-payment-cell strong, .order-payment-cell small { display: block; }
.order-customer-cell strong, .order-payment-cell strong { color: var(--ink); }
.order-customer-cell small, .order-payment-cell small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.orders-table td:nth-child(6), .orders-table td:nth-child(7), .orders-table td:nth-child(8) { white-space: nowrap; }
.order-number { color: var(--ink); font-weight: 700; white-space: nowrap; }
.order-products-summary { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; padding: 5px 8px; color: #59687b; background: #f0f3f7; border-radius: 99px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-pending { color: #986516; background: #fff3dc; }
.status-confirmed, .status-processing { color: #245ca6; background: #eaf2fc; }
.status-shipped, .status-out-for-delivery { color: #6944a0; background: #f1eafd; }
.status-delivered { color: #17774f; background: #e6f6ef; }
.status-cancelled { color: #a53d3d; background: #fff0f0; }
.order-modal { width: min(520px, 100%); max-height: calc(100vh - 44px); overflow-y: auto; background: #fff; border-radius: 14px; box-shadow: 0 25px 90px #0a1a2c45; }
.order-modal-body { padding: 22px 25px 25px; }
.order-detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; background: #f8fafc; border-radius: 8px; }
.order-detail-meta span, .order-detail-meta strong { display: block; }
.order-detail-meta span { margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.order-detail-meta strong { color: var(--ink); font-size: 12px; }
.order-modal-body > h3 { margin: 20px 0 8px; font-size: 13px; }
.order-detail-items { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.order-detail-items li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; color: #4b586a; border-bottom: 1px solid #eff1f4; font-size: 12px; }
.order-history-image { width: 42px; height: 42px; flex: 0 0 42px; object-fit: contain; background: #fff; border: 1px solid #eff1f4; border-radius: 6px; }
.order-history-name { min-width: 0; flex: 1; }
.order-detail-items li strong { color: var(--ink); white-space: nowrap; }
.order-status-form { padding-top: 19px; }
.order-status-form select { width: 100%; }
.order-modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 13px; }
.order-modal-actions .status-text { margin-right: auto; }

@media (max-width: 900px) {
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .dashboard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .recent-order { grid-template-columns: minmax(85px, .7fr) minmax(90px, 1fr); }
  .recent-order .status-pill { grid-column: 2; justify-self: start; }
  .order-modal { max-height: calc(100vh - 20px); }
  .order-modal-body { padding: 17px; }
  .orders-table th, .orders-table td { padding-right: 11px; padding-left: 11px; }
  .category-form { grid-template-columns: minmax(0, 1fr); }
  .category-form .status-text { grid-column: 1; }
}
@media (max-width: 420px) {
  .dashboard-stats { grid-template-columns: 1fr; }
  .recent-order { grid-template-columns: 1fr auto; gap: 6px 10px; }
  .recent-order-products { grid-column: 1; grid-row: 2; }
  .recent-order .status-pill { grid-column: 2; grid-row: 1 / span 2; }
  .panel-state { padding-right: 15px; padding-left: 15px; }
}

.service-requests-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.service-request-card {
  min-width: 0;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.service-request-head,
.service-request-contact,
.service-request-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.service-request-head strong,
.service-request-head small,
.service-request-contact strong,
.service-request-contact span {
  display: block;
  overflow-wrap: anywhere;
}
.service-request-head strong { color: var(--ink); }
.service-request-head small,
.service-request-contact span { margin-top: 4px; color: var(--muted); font-size: .78rem; }
.service-request-contact { justify-content: flex-start; flex-wrap: wrap; margin-top: 13px; }
.service-request-message { padding: 12px; margin: 14px 0; color: #435347; background: #f6f8f6; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.service-request-controls select { min-width: 0; min-height: 40px; padding: 7px 10px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.service-request-controls .button { min-height: 40px; }
.admin-confirm-dialog { width: min(420px, calc(100% - 32px)); padding: 22px; color: var(--ink); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 20px 70px rgba(0,0,0,.24); }
.admin-confirm-dialog::backdrop { background: rgba(15, 25, 19, .5); }
.admin-confirm-dialog h2 { margin: 0 0 8px; font-size: 1.15rem; }
.admin-confirm-dialog p { color: var(--muted); }
.admin-confirm-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.admin-confirm-actions .button-danger { color: #fff; background: #a63d3d; border: 1px solid #a63d3d; }

@media (max-width: 850px) {
  .service-requests-list { grid-template-columns: 1fr; }
}

:root {
  --ink: #1d2923;
  --muted: #68756e;
  --line: #dfe5e0;
  --surface: #fff;
  --canvas: #f6f7f5;
  --navy: #176345;
  --blue: #176345;
  --blue-soft: #eaf3ee;
  --green: #176345;
  font-family: "Segoe UI", Arial, sans-serif;
}

.login-view { background: radial-gradient(ellipse at top left, #eaf3ee 0, transparent 48%), var(--canvas); }
.login-card { border-radius: 7px; box-shadow: 0 8px 26px rgba(24, 43, 32, .08); }
.login-card > .brand-mark {
  display: flex;
  width: 148px;
  height: 54px;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  margin-bottom: 17px;
  background: transparent;
  border-radius: 0;
}
.brand-logo { display: block; width: 100%; height: 100%; object-fit: contain; }
.login-card input { border-radius: 4px; }
.button { border-radius: 4px; }
.sidebar { color: #e5eee8; background: #173c2c; }
.sidebar-brand .brand-mark {
  width: 48px;
  height: 38px;
  margin: 0;
  background: transparent;
  border-radius: 0;
}
.sidebar-brand .brand-mark .brand-logo { filter: brightness(0) invert(1); }
.sidebar-brand small { color: #b7c9bd; }
.nav-link { border-radius: 4px; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.13); }
.main-area { padding-top: 25px; }
.topbar { padding-bottom: 19px; }
.topbar h1 { font-size: 23px; }
.stat-card, .panel, .service-request-card {
  border-color: var(--line);
  border-radius: 6px;
  box-shadow: 0 2px 9px rgba(24, 43, 32, .035);
}
.stat-icon, .category-pill, .quick-action-icon { border-radius: 4px; }
.panel-heading { min-height: 70px; }
.search-box, .search-box input { border-radius: 4px; }
.products-table th, .orders-table th { background: #f7f8f6; }
.products-table th, .orders-table th { color: #748078; }
.product-thumb { border-radius: 4px; }
.category-form input, .form-field input, .form-field textarea, .form-field select,
.search-box input, .service-request-controls select {
  border-color: #d5ded7;
  border-radius: 4px;
}
.category-form .button { border-radius: 4px; }
.quick-action { border-radius: 5px; }
.modal-backdrop { background: rgba(20, 34, 26, .48); }
.editor-modal, .order-modal { border-radius: 7px; }
.editor-header { background: #f8f9f7; border-bottom-color: var(--line); }
.form-section { border-radius: 5px; }
.image-dropzone { border-radius: 5px; }
.status-pill { border-radius: 4px; }

@media (max-width: 760px) {
  .main-area { padding-top: 17px; }
  .topbar h1 { font-size: 20px; }
}

:root {
  --ink: #1d2923;
  --muted: #68756e;
  --line: #dfe7e1;
  --surface: #fff;
  --canvas: #f4f6f4;
  --navy: #123f2e;
  --blue: #176345;
  --blue-soft: #eaf3ee;
  --green: #176345;
  --red: #b43e3e;
}

.button, .button-subtle, .table-action, .icon-button,
.login-card, .panel, .stat-card, .service-request-card,
.preview-card, .editor-modal, .order-modal, .form-field input,
.form-field textarea, .form-field select, .category-form input,
.search-box, .service-request-controls select, .quick-action,
.editor-header, .image-dropzone, .cloudinary-config, .form-section,
.status-pill, .category-pill, .product-thumb, .nav-link {
  border-radius: 12px;
}
.button:hover, .button-secondary:hover, .button-primary:hover { filter: brightness(.97); }
.panel, .stat-card, .service-request-card { box-shadow: 0 3px 14px rgba(24, 43, 32, .045); }
.sidebar { background: #103a2a; }
.nav-link { min-height: 44px; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.14); }
.main-area { min-width: 0; }
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar-actions { min-width: 0; }
.sidebar-toggle {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 19px;
}
.admin-global-search {
  display: flex;
  width: min(230px, 22vw);
  min-width: 145px;
  height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.admin-global-search > span { font-size: 20px; }
.admin-global-search input { width: 100%; border: 0; outline: 0; font-size: 12px; }
.notification-button {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #435248;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 18px;
}
.notification-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.notification-button > span {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 19px;
  padding: 2px 5px;
  color: #fff;
  background: #b43e3e;
  border: 2px solid var(--canvas);
  border-radius: 99px;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  text-align: center;
}
.admin-profile { display: flex; align-items: center; gap: 8px; color: #435248; font-size: 12px; }
.admin-profile-initial { display: grid; width: 34px; height: 34px; place-items: center; color: #fff; background: var(--green); border-radius: 50%; font-weight: 800; }
.dashboard-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dashboard-analytics { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 16px; margin-bottom: 20px; }
.dashboard-top-products { grid-column: 1 / -1; }
.period-filter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.period-filter select, .orders-toolbar > select {
  min-height: 38px;
  padding: 7px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12px;
}
.sales-chart { display: flex; min-height: 230px; align-items: stretch; gap: 10px; padding: 6px 20px 17px; }
.sales-bar-group { display: grid; min-width: 0; flex: 1; grid-template-rows: 20px minmax(90px, 1fr) 25px; justify-items: center; gap: 7px; }
.sales-bar-value { width: 100%; overflow: hidden; color: var(--muted); font-size: 9px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.sales-bar-track { display: flex; width: min(25px, 75%); height: 100%; align-items: flex-end; justify-content: center; overflow: hidden; background: #edf2ee; border-radius: 12px 12px 5px 5px; }
.sales-bar-fill { display: block; width: 100%; min-height: 0; background: linear-gradient(180deg, #5a9a70, #176345); border-radius: 12px 12px 4px 4px; transition: height .2s ease; }
.sales-bar-label { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.category-chart { display: flex; min-height: 205px; align-items: center; justify-content: center; gap: 20px; padding: 12px 20px 20px; }
.category-donut { position: relative; width: 132px; height: 132px; flex: 0 0 auto; border: 1px solid #fff; border-radius: 50%; }
.category-donut::after { position: absolute; inset: 27px; background: #fff; border-radius: 50%; content: ""; }
.category-legend { display: grid; min-width: 0; gap: 10px; }
.category-legend-item { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 7px; color: #516057; font-size: 10px; }
.category-legend-item span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-legend-item b { color: var(--ink); }
.category-swatch { width: 8px; height: 8px; border-radius: 50%; }
.dashboard-top-products .products-table th, .dashboard-top-products .products-table td { padding-top: 10px; padding-bottom: 10px; }
.orders-toolbar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.orders-toolbar .search-box { width: min(220px, 100%); }
.orders-toolbar .button { min-height: 38px; padding-right: 12px; padding-left: 12px; }
.customer-identity { min-width: 180px; }
.customer-identity strong, .customer-identity small { display: block; }
.customer-identity small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.customer-actions { white-space: normal; }
.status-ready { color: #176345; background: #eaf3ee; }
.settings-form { display: grid; max-width: 560px; gap: 15px; padding: 0 20px 22px; }
.settings-form .status-text { min-height: 16px; margin: 0; }
.form-field small { color: var(--muted); font-size: 10px; font-weight: 400; }
.sidebar-scrim { display: none; }

@media (max-width: 1180px) {
  .dashboard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topbar-actions { gap: 8px; }
  .admin-profile b { display: none; }
  .admin-global-search { width: 190px; }
}

@media (max-width: 850px) {
  .dashboard-analytics { grid-template-columns: minmax(0, 1fr); }
  .dashboard-top-products { grid-column: auto; }
  .category-chart { justify-content: flex-start; }
}

@media (max-width: 680px) {
  .sidebar-toggle { display: grid; flex: 0 0 auto; }
  .sidebar {
    position: fixed;
    z-index: 31;
    inset: 0 auto 0 0;
    display: flex;
    width: min(290px, 86vw);
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    padding: 20px 16px 16px;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 10px 0 35px rgba(0,0,0,.16);
  }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-brand { margin: 0 4px 32px; }
  .sidebar-brand .brand-mark { width: 48px; height: 38px; }
  .nav-label { display: block; }
  .sidebar-bottom { display: grid; }
  .sidebar nav { display: grid; gap: 5px; }
  .nav-link { padding: 11px 12px; font-size: 13px; }
  .sidebar-scrim:not([hidden]) { position: fixed; z-index: 30; inset: 0; display: block; width: 100%; height: 100%; background: rgba(10, 25, 16, .45); border: 0; }
  .main-area { margin-left: 0; padding: 14px 14px 30px; }
  .topbar { align-items: center; flex-wrap: wrap; gap: 12px; }
  .topbar-title { flex: 1; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .admin-global-search { width: auto; min-width: 0; flex: 1; }
  .admin-profile { display: none; }
  .store-link { display: inline-flex; }
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { min-width: 0; }
  .stat-card strong { font-size: 17px; }
  .panel-heading { align-items: flex-start; flex-wrap: wrap; }
  .orders-toolbar { width: 100%; justify-content: flex-start; }
  .orders-toolbar .search-box { flex: 1 1 160px; }
  .orders-toolbar > select { flex: 1 1 140px; }
  .sales-chart { gap: 5px; padding-right: 12px; padding-left: 12px; }
  .sales-bar-value { font-size: 8px; }
  .category-chart { flex-wrap: wrap; }
  .service-request-controls { flex-wrap: wrap; }
  .settings-form { padding-right: 15px; padding-left: 15px; }
}

@media (max-width: 420px) {
  .main-area { padding-right: 10px; padding-left: 10px; }
  .topbar h1 { font-size: 19px; }
  .topbar-actions { gap: 6px; }
  .store-link { font-size: 11px; }
  .notification-button { flex: 0 0 40px; }
  .dashboard-stats { gap: 8px; }
  .stat-card { padding: 10px; }
  .stat-icon { width: 30px; height: 30px; }
  .category-chart { gap: 12px; padding-right: 13px; padding-left: 13px; }
  .category-donut { width: 112px; height: 112px; }
  .category-donut::after { inset: 23px; }
}

html,
body,
button,
input,
textarea,
select {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.product-status-tabs {
  display: flex;
  gap: 6px;
  padding: 0 20px 14px;
}

.product-status-tabs button {
  min-height: 34px;
  padding: 0 13px;
  color: #647184;
  background: #f5f7fa;
  border: 1px solid #e6eaf0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.product-status-tabs button.active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.product-status-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.product-status-pill.active {
  color: #13724f;
  background: #e6f6ef;
}

.product-status-pill.archived {
  color: #647184;
  background: #eef1f5;
}

.catalogue-products-table tbody tr.is-archived {
  background: #f5f6f8;
}

.catalogue-products-table tbody tr.is-archived td {
  color: #7d8795;
}

.catalogue-products-table tbody tr.is-archived .product-cell strong {
  color: #6e7887;
}

.catalogue-products-table .table-action:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.delete-help {
  display: block;
  max-width: 210px;
  margin-top: 6px;
  color: #7a5a2a;
  font-size: 10px;
  line-height: 1.4;
  white-space: normal;
}

@media (max-width: 699px) {
  .product-status-tabs {
    padding-right: 14px;
    padding-left: 14px;
  }

  .catalogue-product-table-wrap {
    overflow: visible;
    padding: 0 12px 12px;
  }

  .catalogue-products-table,
  .catalogue-products-table tbody {
    display: block;
    width: 100%;
  }

  .catalogue-products-table thead {
    display: none;
  }

  .catalogue-products-table tbody {
    display: grid;
    gap: 10px;
  }

  .catalogue-products-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 8px 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  .catalogue-products-table tbody tr.is-archived {
    background: #f0f2f5;
    opacity: .78;
  }

  .catalogue-products-table tbody td {
    display: grid;
    grid-template-columns: minmax(72px, .7fr) minmax(0, 1.5fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 8px 0;
    border-bottom: 1px solid #eff1f4;
    font-size: 12px;
    white-space: normal;
  }

  .catalogue-products-table tbody td::before {
    color: #8490a0;
    content: attr(data-label);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .catalogue-products-table tbody td:first-child {
    display: block;
  }

  .catalogue-products-table tbody td:first-child::before {
    display: none;
  }

  .catalogue-products-table tbody td:last-child {
    display: block;
    border-bottom: 0;
  }

  .catalogue-products-table tbody td:last-child::before {
    display: block;
    margin-bottom: 7px;
  }

  .catalogue-products-table .product-cell {
    min-width: 0;
  }

  .catalogue-products-table .product-cell strong {
    max-width: none;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .catalogue-products-table .table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
}
