/* =====================================================================
   Mandalian Orders Portal - styles & themes
   Each theme sets a few variables; everything else is derived from them.
   ===================================================================== */

html[data-theme] {
  --brand: #3456d1; --brand-rgb: 52, 86, 209; --brand-contrast: #fff;
  --app-bg: #f3f5fa; --surface: #ffffff; --surface-2: #f7f8fc; --border: #e3e7f0;
  --text: #1c2333; --muted: #6b7489;
  --sidebar-bg: #1d2740; --sidebar-fg: #c9d1e4; --sidebar-muted: #8591ad; --sidebar-active: rgba(255,255,255,.10);
  --photo-bg: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 14px rgba(16,24,40,.06);
}
html[data-theme="gold"]     { --brand: #a8812a; --brand-rgb: 168, 129, 42; --app-bg: #faf7f0; --surface-2: #fbf8f1; --border: #ece4d3; --sidebar-bg: #2b2418; --sidebar-fg: #e6dcc6; --sidebar-muted: #a99a7b; --text: #2b2418; }
html[data-theme="emerald"]  { --brand: #0f8a63; --brand-rgb: 15, 138, 99;  --app-bg: #f1f8f5; --surface-2: #f4faf7; --border: #dbece4; --sidebar-bg: #103a2d; --sidebar-fg: #cfe8de; --sidebar-muted: #86b3a2; }
html[data-theme="rose"]     { --brand: #b76e79; --brand-rgb: 183, 110, 121; --app-bg: #fbf4f4; --surface-2: #fcf7f7; --border: #f0e0e2; --sidebar-bg: #3d2327; --sidebar-fg: #f1dadd; --sidebar-muted: #b8939a; }
html[data-theme="ocean"]    { --brand: #0b84a5; --brand-rgb: 11, 132, 165; --app-bg: #eff7fa; --surface-2: #f3f9fb; --border: #d8e9ef; --sidebar-bg: #0d3446; --sidebar-fg: #cde6ef; --sidebar-muted: #84aebd; }
html[data-theme="midnight"] { --brand: #6d8cff; --brand-rgb: 109, 140, 255; --brand-contrast: #0b1020; --app-bg: #0f1320; --surface: #171c2c; --surface-2: #1c2235; --border: #2a3249; --text: #e3e8f5; --muted: #95a0bd; --sidebar-bg: #0a0d17; --sidebar-fg: #c9d1e4; --sidebar-muted: #6f7a97; --photo-bg: #f4f5f8; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35); }
html[data-theme="onyx"]     { --brand: #d4af37; --brand-rgb: 212, 175, 55; --brand-contrast: #111; --app-bg: #121212; --surface: #1c1c1c; --surface-2: #232323; --border: #333; --text: #ece7da; --muted: #a39c8c; --sidebar-bg: #000; --sidebar-fg: #e8dfc4; --sidebar-muted: #8c8573; --photo-bg: #f5f3ee; --shadow: 0 1px 2px rgba(0,0,0,.5), 0 6px 18px rgba(0,0,0,.45); }

/* ---- Bootstrap bridge ---- */
html[data-theme] {
  --bs-primary: var(--brand); --bs-primary-rgb: var(--brand-rgb);
  --bs-link-color: var(--brand); --bs-link-color-rgb: var(--brand-rgb); --bs-link-hover-color: var(--brand);
  --bs-body-bg: var(--app-bg); --bs-body-color: var(--text); --bs-border-color: var(--border);
  --bs-secondary-color: var(--muted); --bs-tertiary-bg: var(--surface-2);
  --bs-primary-bg-subtle: rgba(var(--brand-rgb), .12); --bs-primary-text-emphasis: var(--brand); --bs-primary-border-subtle: rgba(var(--brand-rgb), .35);
  --bs-focus-ring-color: rgba(var(--brand-rgb), .25);
}
body { background: var(--app-bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-tap-highlight-color: transparent; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-color: var(--brand-contrast);
  --bs-btn-hover-bg: color-mix(in srgb, var(--brand) 86%, #000); --bs-btn-hover-border-color: color-mix(in srgb, var(--brand) 86%, #000); --bs-btn-hover-color: var(--brand-contrast);
  --bs-btn-active-bg: color-mix(in srgb, var(--brand) 78%, #000); --bs-btn-active-border-color: color-mix(in srgb, var(--brand) 78%, #000); --bs-btn-active-color: var(--brand-contrast);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); --bs-btn-disabled-color: var(--brand-contrast); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-hover-color: var(--brand-contrast);
  --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand); --bs-btn-active-color: var(--brand-contrast); }
.form-control, .form-select, .input-group-text { background-color: var(--surface); color: var(--text); border-color: var(--border); }
.form-control[readonly] { background-color: var(--surface-2); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: rgba(var(--brand-rgb), .6); box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .2); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--brand); --bs-nav-pills-link-active-color: var(--brand-contrast); }
.pagination { --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-color: var(--brand); }
.card, .list-group-item, .modal-content, .dropdown-menu, .offcanvas, .form-control, .form-select, .input-group-text { --bs-card-bg: var(--surface); --bs-list-group-bg: var(--surface); }
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.card-header { background: transparent; border-bottom-color: var(--border); font-weight: 600; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--border); }
.table > thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.text-muted { color: var(--muted) !important; }
a { text-decoration: none; }
.list-group-item-action { color: var(--text); }
.list-group-item-action:hover { background: var(--surface-2); color: var(--text); }

/* ---- App shell ---- */
.app { display: flex; min-height: 100vh; }
.app-sidebar, .app-sidebar.offcanvas-lg { width: 260px; flex: 0 0 260px; background: var(--sidebar-bg) !important; color: var(--sidebar-fg); }
@media (min-width: 992px) {
  .app-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
.app-sidebar.offcanvas-lg { --bs-offcanvas-bg: var(--sidebar-bg); --bs-offcanvas-color: var(--sidebar-fg); --bs-offcanvas-width: 280px; }
.app-sidebar .brand { display: flex; align-items: center; gap: .65rem; padding: 1.15rem 1.25rem; color: #fff; font-weight: 700; letter-spacing: .02em; }
.app-sidebar .brand .logo { width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: var(--brand-contrast); display: grid; place-items: center; font-size: 1.15rem; }
.app-sidebar .brand small { display: block; font-weight: 400; font-size: .72rem; color: var(--sidebar-muted); letter-spacing: .06em; text-transform: uppercase; }
.side-nav { list-style: none; margin: 0; padding: .25rem .75rem 1rem; }
.side-nav .section { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--sidebar-muted); padding: 1rem .75rem .35rem; }
.side-nav a { display: flex; align-items: center; gap: .75rem; padding: .62rem .75rem; border-radius: 10px; color: var(--sidebar-fg); font-weight: 500; }
.side-nav a i { font-size: 1.1rem; width: 1.3rem; text-align: center; opacity: .9; }
.side-nav a:hover { background: var(--sidebar-active); color: #fff; }
.side-nav a.active { background: var(--brand); color: var(--brand-contrast); }
.side-nav .badge { margin-left: auto; }
.side-user { margin: .5rem .75rem 1rem; padding: .75rem; border-radius: 12px; background: var(--sidebar-active); font-size: .85rem; }
.side-user .name { color: #fff; font-weight: 600; }
.side-user .sub { color: var(--sidebar-muted); font-size: .75rem; }

.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .5rem; padding: .6rem 1rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); min-height: 60px; }
.app-topbar .page-title { font-size: 1.1rem; font-weight: 650; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-topbar .btn-icon { width: 42px; height: 42px; border-radius: 12px; display: inline-grid; place-items: center; position: relative; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.app-topbar .btn-icon .count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 10px; padding: 0 5px; font-size: .7rem; font-weight: 700; display: grid; place-items: center; background: #e5484d; color: #fff; }
.app-content { padding: 1.25rem; flex: 1 1 auto; }
@media (max-width: 575.98px) { .app-content { padding: .85rem; } }
.client-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 999px; background: rgba(var(--brand-rgb), .12); color: var(--brand); font-weight: 600; font-size: .85rem; max-width: 40vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.45rem; font-weight: 700; margin: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---- Auth pages ---- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(var(--brand-rgb), .25), transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(var(--brand-rgb), .18), transparent 60%), var(--app-bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .logo { width: 64px; height: 64px; border-radius: 18px; background: var(--brand); color: var(--brand-contrast); display: grid; place-items: center; font-size: 1.8rem; margin: 0 auto 1rem; box-shadow: 0 8px 24px rgba(var(--brand-rgb), .35); }

/* ---- Stats ---- */
.stat { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; }
.stat .ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.45rem; background: rgba(var(--brand-rgb), .12); color: var(--brand); flex: 0 0 auto; }
.stat .num { font-size: 1.7rem; font-weight: 750; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: .85rem; margin-top: .25rem; }
a.card-link-wrap { color: inherit; display: block; transition: transform .12s ease; }
a.card-link-wrap:hover { transform: translateY(-2px); }

/* ---- Kiosk / self-service ---- */
.kiosk-actions { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.kiosk-btn { display: flex; flex-direction: column; justify-content: space-between; min-height: 150px; padding: 1.35rem; border-radius: 20px; color: var(--brand-contrast);
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000)); box-shadow: 0 10px 24px rgba(var(--brand-rgb), .28); transition: transform .12s ease, box-shadow .12s ease; }
.kiosk-btn:hover { color: var(--brand-contrast); transform: translateY(-3px); box-shadow: 0 14px 30px rgba(var(--brand-rgb), .35); }
.kiosk-btn i { font-size: 2.3rem; }
.kiosk-btn .t { font-size: 1.35rem; font-weight: 700; }
.kiosk-btn .s { opacity: .85; font-size: .9rem; }
.kiosk-btn.alt { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); }
.kiosk-btn.alt i { color: var(--brand); }
@media (max-width: 575.98px) {
  .kiosk-actions { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .kiosk-btn { min-height: 128px; padding: 1rem; border-radius: 16px; }
  .kiosk-btn i { font-size: 1.8rem; }
  .kiosk-btn .t { font-size: 1.05rem; }
  .kiosk-btn .s { font-size: .78rem; }
}

.steps { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.steps > a, .steps > span { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .9rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-weight: 600; font-size: .9rem; }
.steps .n { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .75rem; line-height: 1; background: var(--surface-2); color: var(--muted); }
.steps .done { color: var(--text); }
.steps .done .n { background: rgba(var(--brand-rgb), .15); color: var(--brand); }
.steps .current { background: var(--brand); color: var(--brand-contrast); border-color: var(--brand); }
.steps .current .n { background: rgba(255,255,255,.25); color: inherit; }
.steps .n i { font-size: .85rem; line-height: 1; }
.steps .sep { color: var(--muted); padding: 0; border: 0; background: none; }

.tile-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
@media (max-width: 575.98px) { .tile-grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; } }
.tile { position: relative; display: block; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); transition: transform .12s ease, box-shadow .12s ease; }
.tile:hover { transform: translateY(-3px); color: var(--text); box-shadow: 0 12px 26px rgba(16,24,40,.14); }
.tile .ph { aspect-ratio: 1 / 1; background: var(--photo-bg); display: grid; place-items: center; }
.tile .ph img { width: 100%; height: 100%; object-fit: contain; padding: 8%; }
.tile .ph .empty { font-size: 3rem; color: rgba(var(--brand-rgb), .45); }
.tile .cap { padding: .8rem .95rem; display: flex; align-items: center; gap: .5rem; border-top: 1px solid var(--border); }
.tile .cap .t { font-weight: 700; font-size: 1.02rem; line-height: 1.2; }
.tile .cap .c { margin-left: auto; font-size: .78rem; font-weight: 700; background: rgba(var(--brand-rgb), .12); color: var(--brand); padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; }

.choice-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
@media (max-width: 575.98px) { .choice-grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; } }
.choice { --c1: var(--brand); --c2: color-mix(in srgb, var(--brand) 62%, #000);
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: .75rem;
  min-height: 120px; padding: 1.15rem 1.2rem; border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 8px 20px rgba(var(--brand-rgb), .22);
  transition: transform .12s ease, box-shadow .12s ease; }
.choice:hover, .choice:focus { color: #fff; transform: translateY(-3px); box-shadow: 0 14px 28px rgba(var(--brand-rgb), .32); }
.choice:active { transform: scale(.98); }
.choice .name { position: relative; z-index: 1; font-size: 1.3rem; font-weight: 750; line-height: 1.2; letter-spacing: .01em; word-break: break-word; }
.choice .meta { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .2rem; align-self: flex-start;
  font-size: .82rem; font-weight: 700; background: rgba(255,255,255,.2); padding: .25rem .65rem; border-radius: 999px; }
.choice .meta i { font-size: 1.1rem; }
.choice .deco { position: absolute; right: -10px; bottom: -18px; font-size: 5.5rem; opacity: .14; }
.choice.tone-1 { --c1: color-mix(in srgb, var(--brand) 80%, #6b3b00); }
.choice.tone-2 { --c1: color-mix(in srgb, var(--brand) 70%, var(--sidebar-bg)); }
.choice.tone-3 { --c1: color-mix(in srgb, var(--brand) 85%, #fff); --c2: var(--brand); }
.choice.tone-4 { --c1: color-mix(in srgb, var(--brand) 60%, #7a1f2b); }
.choice.tone-5 { --c1: color-mix(in srgb, var(--brand) 75%, #1f4d3a); }
@media (max-width: 575.98px) { .choice { min-height: 100px; padding: 1rem; } .choice .name { font-size: 1.1rem; } }
.need-input { background: rgba(var(--brand-rgb), .08); border: 1px dashed rgba(var(--brand-rgb), .45); border-radius: 12px; padding: .55rem .6rem; }
.need-input .form-control:invalid:not(:placeholder-shown), .need-input .is-invalid { border-color: #e5484d; }
.qty.big { display: flex; width: 100%; height: 52px; }
.qty.big button { flex: 0 0 64px; width: 64px; font-size: 1.35rem; background: rgba(var(--brand-rgb), .12); color: var(--brand); }
.qty.big button:hover { background: rgba(var(--brand-rgb), .2); }
.qty.big input { flex: 1 1 0; width: 0; min-width: 0; font-size: 1.35rem; }
.product-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (max-width: 575.98px) { .product-grid { grid-template-columns: 1fr; } }
.product { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.product .ph { position: relative; aspect-ratio: 4 / 3; background: var(--photo-bg); cursor: zoom-in; }
.product .ph img { width: 100%; height: 100%; object-fit: contain; padding: 4%; }
.product .ph .pid { position: absolute; left: .6rem; top: .6rem; background: rgba(0,0,0,.6); color: #fff; font-size: .72rem; font-weight: 700; padding: .2rem .5rem; border-radius: 6px; letter-spacing: .03em; }
.product .ph .more { position: absolute; right: .6rem; top: .6rem; background: rgba(0,0,0,.6); color: #fff; font-size: .72rem; padding: .2rem .5rem; border-radius: 6px; }
.product .body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .55rem; flex: 1 1 auto; }
.product .desc { font-weight: 650; font-size: 1.02rem; line-height: 1.3; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { font-size: .78rem; padding: .22rem .55rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); white-space: nowrap; }
.chip b { color: var(--muted); font-weight: 600; margin-right: .2rem; }
.product .remarks { font-size: .85rem; color: var(--muted); }
.product .order-zone { margin-top: auto; display: grid; gap: .5rem; padding-top: .35rem; }

.qty { display: inline-flex; align-items: stretch; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.qty button { width: 46px; border: 0; background: var(--surface-2); color: var(--text); font-size: 1.25rem; font-weight: 700; }
.qty button:active { background: rgba(var(--brand-rgb), .15); }
.qty input { min-width: 0; width: 64px; border: 0; text-align: center; font-weight: 700; font-size: 1.1rem; background: transparent; color: var(--text); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty.sm button { width: 36px; font-size: 1rem; } .qty.sm input { width: 48px; font-size: .95rem; }
.qty.lg { height: calc(1.5em + 1rem + 2px); } .qty.lg button { width: 54px; } .qty.lg input { font-size: 1.2rem; }
.btn-xl { padding: .8rem 1.2rem; font-size: 1.05rem; font-weight: 650; border-radius: 14px; }

.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; padding: .65rem 1rem calc(.65rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -6px 20px rgba(0,0,0,.08); display: none; }
.cart-bar.show { display: block; }
@media (min-width: 992px) { .cart-bar { left: 260px; } }
.has-cart-bar .app-content { padding-bottom: 6rem; }

.cart-line { display: grid; grid-template-columns: 96px 1fr; gap: 1rem; padding: 1rem; border-bottom: 1px solid var(--border); }
.cart-line:last-child { border-bottom: 0; }
.cart-line .thumb { width: 96px; height: 96px; border-radius: 12px; background: var(--photo-bg); border: 1px solid var(--border); overflow: hidden; display: grid; place-items: center; }
.cart-line .thumb img { width: 100%; height: 100%; object-fit: contain; }
.cart-line .thumb i { font-size: 2rem; color: rgba(var(--brand-rgb), .5); }
@media (max-width: 575.98px) { .cart-line { grid-template-columns: 72px 1fr; } .cart-line .thumb { width: 72px; height: 72px; } }

/* ---- Catalog admin ---- */
.cat-card { display: flex; flex-direction: column; height: 100%; }
.cat-card .ph { aspect-ratio: 4 / 3; background: var(--photo-bg); border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; display: grid; place-items: center; }
.cat-card .ph img { width: 100%; height: 100%; object-fit: contain; padding: 5%; }
.cat-card .ph i { font-size: 2.5rem; color: rgba(var(--brand-rgb), .4); }
.inactive-ribbon { position: absolute; top: .5rem; right: .5rem; }

.photo-strip { display: flex; flex-wrap: wrap; gap: .75rem; }
.photo { position: relative; width: 120px; height: 120px; border-radius: 12px; overflow: hidden; border: 2px solid var(--border); background: var(--photo-bg); }
.photo img { width: 100%; height: 100%; object-fit: contain; }
.photo.main { border-color: var(--brand); }
.photo .tag { position: absolute; left: 4px; bottom: 4px; font-size: .65rem; font-weight: 700; background: var(--brand); color: var(--brand-contrast); padding: .1rem .35rem; border-radius: 5px; }
.photo .acts { position: absolute; right: 4px; top: 4px; display: flex; gap: 4px; }
.photo .acts button { width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; font-size: .85rem; }
.photo.removed { opacity: .35; border-style: dashed; }
.photo.new { border-color: #2f9e44; }
.photo-add { width: 120px; height: 120px; border-radius: 12px; border: 2px dashed rgba(var(--brand-rgb), .45); display: grid; place-items: center; text-align: center; color: var(--brand); cursor: pointer; background: rgba(var(--brand-rgb), .05); font-weight: 600; font-size: .82rem; }
.photo-add i { font-size: 1.6rem; display: block; }

.grid-editor td { vertical-align: middle; }
.grid-editor .form-control, .grid-editor .form-select { min-width: 110px; }
@media (max-width: 767.98px) {
  .grid-editor thead { display: none; }
  .grid-editor tr { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
  .grid-editor td { border: 0; padding: 0; }
  .grid-editor td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--muted); }
  .grid-editor td.wide { grid-column: span 2; }
}

.status-badge { font-weight: 600; padding: .4em .7em; border-radius: 999px; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 1rem 1.6rem; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: -6px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .2); }

.theme-swatch { width: 100%; border: 2px solid var(--border); border-radius: 14px; overflow: hidden; background: none; padding: 0; text-align: left; color: var(--text); }
.theme-swatch.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .25); }
.theme-swatch .pv { display: grid; grid-template-columns: 26% 1fr; height: 64px; }
.theme-swatch .pv .sb { height: 100%; }
.theme-swatch .pv .ct { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.theme-swatch .pv .bar { height: 10px; border-radius: 4px; }
.theme-swatch .nm { padding: .45rem .6rem; font-size: .85rem; font-weight: 600; }
.theme-dot { width: 18px; height: 18px; border-radius: 50%; display: inline-block; border: 2px solid rgba(255,255,255,.7); box-shadow: 0 0 0 1px rgba(0,0,0,.15); }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state i { font-size: 3rem; display: block; margin-bottom: .75rem; color: rgba(var(--brand-rgb), .5); }

.lightbox .modal-content { background: #000; }
.lightbox img { max-height: 80vh; object-fit: contain; background: var(--photo-bg); }

.report-table { font-size: .9rem; }
.report-table td.num, .report-table th.num { text-align: right; }

.toast-container { z-index: 1090; top: 64px !important; }

/* ---- Print (order sheet / reports) ---- */
@media print {
  .app-sidebar, .app-topbar, .no-print, .cart-bar, .toast-container { display: none !important; }
  .app-content { padding: 0 !important; }
  body, .card { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .card { border: 1px solid #ccc !important; break-inside: avoid; }
  a { color: #000 !important; }
}
.print-page { max-width: 1000px; margin: 0 auto; }

/* list groups follow the theme (Setup lists menu) */
.list-group { --bs-list-group-active-bg: var(--brand); --bs-list-group-active-border-color: var(--brand); --bs-list-group-active-color: var(--brand-contrast); }

/* ---------- company logo + "Powered by" ---------- */
.app-sidebar .brand.brand-img { flex-direction: column; align-items: flex-start; gap: .35rem; padding: 1.1rem 1.25rem .9rem; }
.app-sidebar .brand.brand-img img { width: 100%; max-width: 205px; height: auto; display: block; }
.app-sidebar .brand.brand-img small { padding-left: 2px; }
.auth-logo { margin: 0 auto .6rem; text-align: center; }
.auth-logo img { width: 100%; max-width: 330px; height: auto; }
.auth-logo .for-dark { display: none; }
[data-bs-theme="dark"] .auth-logo .for-light { display: none; }
[data-bs-theme="dark"] .auth-logo .for-dark { display: inline; }
.app-main { display: flex; flex-direction: column; min-height: 100vh; }
.app-main > .app-content { flex: 1 0 auto; }
.app-footer { padding: .75rem 1rem 1.25rem; }
.powered-by { text-align: center; font-size: .78rem; color: var(--muted, #8a8f98); letter-spacing: .02em; }
.powered-by a, .powered-by b { color: inherit; font-weight: 600; text-decoration: none; }
.powered-by a:hover { color: var(--brand); text-decoration: underline; }
.auth-card .powered-by { margin-top: .35rem; }
body.has-cart-bar .app-footer { padding-bottom: 5.5rem; }
@media print { .app-footer { display: none; } }

/* phone / tablet: the menu opens as a panel - let it scroll so the lower items (Users, Notifications…) can be reached */
@media (max-width: 991.98px) {
  .app-sidebar.offcanvas-lg { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
                              padding-bottom: env(safe-area-inset-bottom); }
  .app-sidebar.offcanvas-lg > * { flex-shrink: 0; }
}

/* WhatsApp click-to-send */
.btn-whatsapp { --bs-btn-bg: #25d366; --bs-btn-border-color: #25d366; --bs-btn-color: #fff; --bs-btn-hover-bg: #1ebe5b; --bs-btn-hover-border-color: #1ebe5b;
                --bs-btn-hover-color: #fff; --bs-btn-active-bg: #19a94f; --bs-btn-active-color: #fff; text-align: left; }
.btn-outline-whatsapp { --bs-btn-color: #128c4a; --bs-btn-border-color: #25d366; --bs-btn-hover-bg: #25d366; --bs-btn-hover-border-color: #25d366; --bs-btn-hover-color: #fff; }
.wa-preview { white-space: pre-wrap; background: #e7f8ee; color: #1f3b2c; border-radius: 12px 12px 12px 2px; padding: .65rem .8rem; }
