/* =========================================================
   Darzi Pro — app styles
   Idea: a tailor's bench. Teal cloth, tailor's-chalk yellow,
   and a measuring-tape stripe as the one signature detail.
   ========================================================= */

:root {
    --cloth: #0f5f5a;          /* primary: deep teal cloth */
    --cloth-dark: #0a4743;
    --cloth-soft: #e3efed;
    --chalk: #f2c14e;          /* measuring-tape yellow */
    --chalk-dark: #d9a52c;
    --ink: #1d2a2a;
    --ink-2: #4c5b5a;
    --ink-3: #7d8b8a;
    --paper: #f3f5f4;
    --surface: #ffffff;
    --line: #e2e7e6;
    --danger: #c0392b;
    --danger-soft: #fdecea;
    --success: #1e8449;
    --success-soft: #e6f4ec;
    --wa: #1faa59;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(16, 40, 38, .06), 0 2px 8px rgba(16, 40, 38, .05);
    --tab-h: 64px;
    --bar-h: 58px;
    --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-ur: "Noto Naskh Arabic", "Manrope", "Jameel Noori Nastaleeq", "Urdu Typesetting", Tahoma, sans-serif;

    --bs-body-font-family: var(--font);
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--paper);
    --bs-primary: var(--cloth);
    --bs-primary-rgb: 15, 95, 90;
    --bs-link-color: var(--cloth);
    --bs-link-color-rgb: 15, 95, 90;
    --bs-link-hover-color: var(--cloth-dark);
    --bs-border-color: var(--line);
    --bs-border-radius: var(--radius-sm);
    --bs-border-radius-lg: var(--radius-sm);
}

html[dir="rtl"] {
    --bs-body-font-family: var(--font-ur);
}
html[dir="rtl"] body { font-family: var(--font-ur); line-height: 1.75; }
html[dir="rtl"] .form-control, html[dir="rtl"] .form-select, html[dir="rtl"] .btn { font-family: var(--font-ur); }
[dir="ltr"] { font-family: var(--font); }

body { -webkit-tap-highlight-color: transparent; font-variant-numeric: tabular-nums; }
a { text-decoration: none; }
.min-w-0 { min-width: 0; }
.link-plain { color: inherit; }
.link-plain:hover { color: inherit; }
.link-brand { color: var(--cloth); font-weight: 600; }

/* ---------- Focus (keyboard) ---------- */
:focus-visible { outline: 3px solid rgba(242, 193, 78, .9); outline-offset: 2px; }
.form-control:focus, .form-select:focus {
    border-color: var(--cloth);
    box-shadow: 0 0 0 .2rem rgba(15, 95, 90, .15);
}

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: var(--radius-sm); }
.btn-lg { padding: .72rem 1.1rem; font-size: 1.02rem; }
.btn-brand { background: var(--cloth); color: #fff; border: 1px solid var(--cloth); }
.btn-brand:hover, .btn-brand:focus { background: var(--cloth-dark); color: #fff; border-color: var(--cloth-dark); }
.btn-brand:active { transform: translateY(1px); }
.btn-outline-brand { color: var(--cloth); border: 1.5px solid var(--cloth); background: transparent; }
.btn-outline-brand:hover { background: var(--cloth-soft); color: var(--cloth-dark); border-color: var(--cloth); }
.btn-light { background: #edf1f0; border-color: #edf1f0; color: var(--ink); }
.btn-light:hover { background: #e2e8e6; border-color: #e2e8e6; }
.btn-whatsapp { background: var(--wa); color: #fff; border: 1px solid var(--wa); }
.btn-whatsapp:hover { background: #178a48; color: #fff; }
.btn i + span, .btn i { vertical-align: -1px; }

.icon-btn {
    width: 40px; height: 40px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ink); background: transparent; border: 0; font-size: 1.2rem;
    flex-shrink: 0;
}
.icon-btn:hover { background: rgba(15, 95, 90, .08); color: var(--cloth); }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-content {
    width: 100%; max-width: 1080px; margin: 0 auto;
    padding: 16px 16px calc(var(--tab-h) + 32px + env(safe-area-inset-bottom));
}
@media (min-width: 992px) {
    .app-content { padding: 28px 32px 48px; }
}

/* App bar with the measuring-tape stripe underneath */
.app-bar {
    position: sticky; top: 0; z-index: 1020;
    height: var(--bar-h);
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 0 8px 0 16px;
    padding-top: env(safe-area-inset-top);
    background: rgba(243, 245, 244, .92);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
}
[dir="rtl"] .app-bar { padding: 0 16px 0 8px; }
.app-bar::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
    background:
        repeating-linear-gradient(90deg, rgba(29, 42, 42, .55) 0 1px, transparent 1px 8px) bottom / 100% 3px no-repeat,
        repeating-linear-gradient(90deg, rgba(29, 42, 42, .7) 0 1px, transparent 1px 40px) bottom / 100% 5px no-repeat,
        var(--chalk);
    opacity: .95;
}
.app-bar-start, .app-bar-end { display: flex; align-items: center; gap: 8px; min-width: 0; }
.app-title {
    font-size: 1.15rem; font-weight: 700; margin: 0; letter-spacing: -.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html[dir="rtl"] .app-title { letter-spacing: 0; }
@media (min-width: 992px) {
    .app-bar { padding: 0 32px; height: 64px; }
    .app-title { font-size: 1.35rem; }
}

.lang-toggle {
    display: inline-flex; align-items: center; height: 34px; padding: 0 12px;
    border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface);
    color: var(--ink); font-weight: 600; font-size: .9rem;
}
.lang-toggle:hover { border-color: var(--cloth); color: var(--cloth); }

.brand-mark {
    width: 34px; height: 34px; border-radius: 10px;
    background: var(--cloth); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem;
    flex-shrink: 0;
}
.brand-mark-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 1.6rem; }

/* Desktop side nav */
.side-nav {
    width: 248px; flex-shrink: 0; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    padding: 20px 16px; background: var(--surface);
    border-inline-end: 1px solid var(--line);
}
.side-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); margin: 0 4px 20px; }
.brand-logo { width: 38px; height: 38px; object-fit: contain; border-radius: 8px; }
.brand-name { font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.side-links { display: flex; flex-direction: column; gap: 2px; }
.side-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--ink-2); font-weight: 600;
}
.side-link i { font-size: 1.15rem; width: 22px; text-align: center; }
.side-link:hover { background: var(--paper); color: var(--ink); }
.side-link.active { background: var(--cloth-soft); color: var(--cloth); }
.side-footer { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.small-link { font-size: .9rem; font-weight: 500; }

/* Mobile bottom tab bar */
.tab-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--line);
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
}
.tab-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    height: 100%; color: var(--ink-3); font-size: .7rem; font-weight: 600;
    position: relative;
}
.tab-item i { font-size: 1.3rem; line-height: 1; }
.tab-item.active { color: var(--cloth); }
.tab-item.active::before {
    content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px;
    border-radius: 0 0 3px 3px; background: var(--chalk);
}
html[dir="rtl"] .tab-item { font-size: .72rem; }
.tab-fab {
    justify-self: center;
    width: 56px; height: 56px; margin-top: -26px; border-radius: 18px;
    background: var(--chalk); color: var(--ink);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem; font-weight: 700;
    box-shadow: 0 6px 16px rgba(217, 165, 44, .45), 0 0 0 5px var(--surface);
}
.tab-fab:active { transform: scale(.96); }

/* ---------- Alerts ---------- */
.app-alert { border: 0; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.alert { border-radius: var(--radius-sm); }

/* ---------- Dashboard ---------- */
.greeting-hello { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
html[dir="rtl"] .greeting-hello { letter-spacing: 0; }
.greeting-date { color: var(--ink-3); font-weight: 500; }

.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.qa {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 6px; color: var(--ink); font-weight: 600; font-size: .78rem; text-align: center;
    line-height: 1.25; min-height: 86px;
}
.qa i { font-size: 1.45rem; color: var(--cloth); }
.qa:hover { border-color: var(--cloth); color: var(--ink); }
.qa-primary { background: var(--cloth); border-color: var(--cloth); color: #fff; }
.qa-primary i { color: var(--chalk); }
.qa-primary:hover { background: var(--cloth-dark); color: #fff; }
@media (min-width: 576px) { .qa { font-size: .88rem; flex-direction: row; min-height: 60px; gap: 10px; } }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 768px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
.stat-card {
    background: var(--surface); border-radius: var(--radius); padding: 14px;
    color: var(--ink); border: 1px solid transparent; box-shadow: var(--shadow);
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
}
.stat-card:hover { border-color: var(--line); color: var(--ink); }
.stat-icon {
    grid-row: span 2; width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.stat-num { font-size: 1.55rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: .8rem; color: var(--ink-2); font-weight: 600; line-height: 1.3; }
.stat-alert { border-color: rgba(192, 57, 43, .35); background: #fff8f7; }
.stat-alert .stat-num { color: var(--danger); }

.bg-soft-slate { background: #eef1f1; color: #4c5b5a; }
.bg-soft-blue { background: #e8f1fb; color: #2463a6; }
.bg-soft-purple { background: #f0ebfa; color: #6a42b8; }
.bg-soft-green { background: var(--success-soft); color: var(--success); }
.bg-soft-amber { background: #fdf3dc; color: #a06d06; }
.bg-soft-red { background: var(--danger-soft); color: var(--danger); }
.badge.bg-soft-blue { font-weight: 600; }

.money-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.money-card { border-radius: var(--radius); padding: 14px 16px; }
.money-in { background: var(--cloth); color: #fff; }
.money-due { background: var(--surface); box-shadow: var(--shadow); }
.money-label { font-size: .82rem; font-weight: 600; opacity: .85; }
.money-value { font-size: 1.3rem; font-weight: 800; margin-top: 2px; }
.money-in .money-value { color: var(--chalk); }
.money-due .money-value { color: var(--danger); }

/* ---------- Section heads & lists ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 10px; gap: 8px; }
.section-head h2 { font-size: 1.05rem; font-weight: 800; margin: 0; }
.section-head a:not(.btn) { font-weight: 600; font-size: .9rem; }

.list-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list-row {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px; color: var(--ink);
    border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #fafbfb; color: var(--ink); }
.row-late { box-shadow: inset 4px 0 0 var(--danger); }
[dir="rtl"] .row-late { box-shadow: inset -4px 0 0 var(--danger); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: .84rem; color: var(--ink-2); margin-top: 1px; }
.row-meta { color: var(--ink-2); flex-shrink: 0; }
.order-no {
    flex-shrink: 0; min-width: 54px; padding: 6px 8px; border-radius: 10px;
    background: var(--cloth-soft); color: var(--cloth); font-weight: 800; font-size: .85rem; text-align: center;
    font-family: var(--font);
}

.avatar {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
    background: var(--cloth-soft); color: var(--cloth);
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.05rem;
}
.avatar-lg { width: 58px; height: 58px; font-size: 1.4rem; }

.empty-state {
    background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--radius);
    padding: 32px 20px; text-align: center; color: var(--ink-2);
}
.empty-state > i { font-size: 2.2rem; color: var(--ink-3); display: block; margin-bottom: 6px; }
.empty-state p { margin-bottom: 12px; }
.small-empty { padding: 18px; margin-bottom: 20px; }

/* ---------- Status chips ---------- */
.status-chip {
    display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
    padding: 4px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700;
    white-space: nowrap; border: 0; line-height: 1.5;
}
.status-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-received  { background: #e8f1fb; color: #2463a6; }
.st-cutting   { background: #fdf3dc; color: #946300; }
.st-stitching { background: #f0ebfa; color: #6a42b8; }
.st-finishing { background: #fbe9f2; color: #a8336f; }
.st-ready     { background: var(--success-soft); color: var(--success); }
.st-delivered { background: #eef1f1; color: #4c5b5a; }
.st-cancelled { background: var(--danger-soft); color: var(--danger); }

/* ---------- Toolbar / search / filters ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; }
.search-box { position: relative; }
.search-box > i { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 14px; color: var(--ink-3); pointer-events: none; z-index: 2; }
.search-box .form-control { padding-inline-start: 40px; height: 46px; border-radius: 12px; background: var(--surface); }
.search-box .form-control-lg { height: 52px; }

.filter-chips, .tab-chips {
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
    scrollbar-width: none; margin-inline: -16px; padding-inline: 16px;
}
.filter-chips::-webkit-scrollbar, .tab-chips::-webkit-scrollbar { display: none; }
@media (min-width: 992px) { .filter-chips, .tab-chips { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; } }
.fchip {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line);
    color: var(--ink-2); font-weight: 600; font-size: .88rem; white-space: nowrap;
}
.fchip:hover { color: var(--ink); border-color: #c9d2d0; }
.fchip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.fchip-sm { padding: 4px 11px; font-size: .82rem; }
.fchip-count { background: rgba(29, 42, 42, .08); border-radius: 999px; padding: 0 7px; font-size: .78rem; }
.fchip.active .fchip-count { background: rgba(255, 255, 255, .18); }
.fchip-danger:not(.active) { border-color: rgba(192, 57, 43, .4); color: var(--danger); }
button.fchip { cursor: pointer; }

.pager { display: flex; justify-content: center; align-items: center; gap: 12px; }

/* ---------- Forms ---------- */
.form-card {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 18px 16px;
}
@media (min-width: 768px) { .form-card { padding: 22px 24px; } }
.form-card + .form-card { margin-top: 12px; }
.form-label { font-weight: 600; color: var(--ink); font-size: .92rem; }
.form-label.req::after { content: " *"; color: var(--danger); }
.opt { color: var(--ink-3); font-weight: 500; font-size: .82rem; }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: #d6dddc; background-color: var(--surface); }
.form-control::placeholder { color: #a3aead; }
.form-control-lg, .form-select-lg { border-radius: 12px; font-size: 1.05rem; }
.card-h { font-size: 1rem; font-weight: 800; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.card-h i { color: var(--cloth); }

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.form-actions .btn { flex: 1 1 auto; }
.sticky-actions {
    position: sticky; bottom: calc(var(--tab-h) + 8px + env(safe-area-inset-bottom)); z-index: 5;
    background: var(--surface); padding: 10px; border-radius: var(--radius);
    box-shadow: 0 -2px 16px rgba(16, 40, 38, .1); margin-top: 16px;
}
@media (min-width: 992px) { .sticky-actions { bottom: 16px; } }

.chip-select { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    padding: 9px 15px; border-radius: 12px; border: 1.5px solid #d6dddc; background: var(--surface);
    font-weight: 600; cursor: pointer; user-select: none; color: var(--ink-2);
}
.chip-select-sm .chip { padding: 6px 12px; font-size: .88rem; border-radius: 10px; }
.btn-check:checked + .chip { background: var(--cloth); border-color: var(--cloth); color: #fff; }
.btn-check:focus-visible + .chip { outline: 3px solid rgba(242, 193, 78, .9); outline-offset: 2px; }

/* Order form steps — the steps really are a sequence */
.step-card { margin-bottom: 12px; }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step-head h2 { font-size: 1.05rem; font-weight: 800; margin: 0; }
.step-no {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    background: var(--chalk); color: var(--ink); font-weight: 800; font-size: .9rem;
    display: inline-flex; align-items: center; justify-content: center; font-family: var(--font);
}

.seg-toggle { display: grid; grid-template-columns: 1fr 1fr; background: #edf1f0; border-radius: 12px; padding: 4px; gap: 4px; }
.seg-btn { border: 0; background: transparent; padding: 9px 8px; border-radius: 9px; font-weight: 600; color: var(--ink-2); }
.seg-btn.active { background: var(--surface); color: var(--cloth); box-shadow: var(--shadow); }

.picked-customer {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 12px; background: var(--cloth-soft);
}
.search-results { margin-top: 6px; }
.sr-item {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: start;
    padding: 10px 12px; border: 0; background: transparent; border-radius: 10px; color: var(--ink);
}
.sr-item:hover, .sr-item:focus { background: var(--paper); }
.sr-item .avatar { width: 36px; height: 36px; font-size: .95rem; }
.sr-empty { padding: 10px 12px; color: var(--ink-2); font-size: .92rem; }

.stepper { display: flex; gap: 4px; }
.stepper .btn { width: 44px; font-size: 1.2rem; padding: 0; flex-shrink: 0; }
.stepper .form-control { padding-left: 4px; padding-right: 4px; -moz-appearance: textfield; }
.stepper .form-control::-webkit-outer-spin-button, .stepper .form-control::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.measure-pick { display: flex; flex-direction: column; gap: 8px; }
.mp-item { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.mp-item input { margin-top: 4px; accent-color: var(--cloth); width: 18px; height: 18px; flex-shrink: 0; }
.mp-item:has(input:checked) { border-color: var(--cloth); background: var(--cloth-soft); }
.mp-body { display: flex; flex-direction: column; min-width: 0; }
.mp-title { font-weight: 700; }
.mp-sub { font-size: .82rem; color: var(--ink-2); }

.quick-days { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.balance-strip {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 12px 14px; border-radius: 12px; background: var(--paper);
    border: 1.5px dashed #c9d2d0; font-weight: 600;
}
.balance-strip strong { font-size: 1.2rem; color: var(--danger); }
.balance-strip.is-clear strong { color: var(--success); }

/* ---------- Measurements ---------- */
.size-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 576px) { .size-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px) { .size-grid { grid-template-columns: repeat(5, 1fr); } }
.size-field {
    background: var(--paper); border-radius: 12px; padding: 8px 10px 10px;
    border-bottom: 3px solid var(--chalk);
}
.size-field label { display: block; font-size: .8rem; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
.size-field .form-control { background: var(--surface); font-weight: 700; font-size: 1.15rem; }
.size-field.is-hidden { display: none; }

.measure-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; height: 100%; }
.measure-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.measure-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.mg-item { background: var(--paper); border-radius: 9px; padding: 6px 8px; display: flex; flex-direction: column; }
.mg-item span { font-size: .72rem; color: var(--ink-2); font-weight: 600; }
.mg-item strong { font-size: 1.05rem; font-family: var(--font); }
.mini-customer { font-weight: 600; color: var(--ink-2); }

.note-box { background: #fffaf0; border-inline-start: 3px solid var(--chalk); border-radius: 8px; padding: 8px 12px; font-size: .92rem; }
.note-private { background: #f3f4f6; border-inline-start-color: #9aa5a4; }

/* ---------- Customer profile ---------- */
.profile-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.profile-name { font-size: 1.25rem; font-weight: 800; }
.contact-actions { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; }
.contact-actions .btn { padding-left: 6px; padding-right: 6px; white-space: nowrap; font-size: .9rem; }

/* ---------- Order view ---------- */
.success-hero {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    background: var(--success-soft); color: #155d34; border-radius: var(--radius); padding: 14px 16px;
}
.success-hero > i { font-size: 1.8rem; }
.success-hero > div:nth-child(2) { flex: 1; min-width: 180px; }

.order-hero {
    background: var(--cloth); color: #fff; border-radius: var(--radius); padding: 18px 16px 16px;
    position: relative; overflow: hidden;
}
.order-hero::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
    background:
        repeating-linear-gradient(90deg, rgba(29, 42, 42, .6) 0 1px, transparent 1px 8px) bottom / 100% 3px no-repeat,
        repeating-linear-gradient(90deg, rgba(29, 42, 42, .75) 0 1px, transparent 1px 40px) bottom / 100% 6px no-repeat,
        var(--chalk);
}
.order-hero .status-chip { background: rgba(255, 255, 255, .95); }
.order-hero-no { font-size: 1.9rem; font-weight: 800; line-height: 1; font-family: var(--font); letter-spacing: -.02em; }
.order-hero-outfit { opacity: .9; margin-top: 6px; font-weight: 500; }
.order-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; margin-bottom: 6px; }
.order-hero-grid span { display: block; font-size: .78rem; opacity: .75; }
.order-hero-grid strong { font-size: 1.02rem; }
.order-hero .text-danger { color: #ffd2cc !important; }
.order-hero.is-late { background: #7a2a22; }
.late-tag { display: inline-block; margin: 4px 0 6px; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: .82rem; font-weight: 600; }

.action-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.status-picker { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-top: 8px; }
.status-picker .status-chip { padding: 7px 13px; font-size: .84rem; cursor: pointer; }
.status-picker .status-chip.current { outline: 2px solid currentColor; outline-offset: 2px; }

.icon-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ia {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: var(--surface); border-radius: var(--radius); padding: 12px 4px;
    color: var(--ink); font-weight: 600; font-size: .8rem; box-shadow: var(--shadow);
}
.ia i { font-size: 1.35rem; color: var(--cloth); }
.ia:hover { color: var(--cloth); }
.ia-wa i { color: var(--wa); }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
    content: ""; position: absolute; inset-inline-start: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line);
}
.timeline li:last-child::before { display: none; }
.timeline li.done::before { background: var(--cloth); }
.timeline li.current::before { background: var(--line); }
.tl-dot {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    border: 2px solid var(--line); background: var(--surface); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: .9rem; position: relative; z-index: 1;
}
.timeline li.done .tl-dot { background: var(--cloth); border-color: var(--cloth); }
.timeline li.current .tl-dot { box-shadow: 0 0 0 5px rgba(242, 193, 78, .45); }
.tl-title { font-weight: 700; color: var(--ink-3); padding-top: 2px; }
.timeline li.done .tl-title { color: var(--ink); }
.tl-time { font-size: .8rem; color: var(--ink-3); }

.pay-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.pay-summary > div { background: var(--paper); border-radius: 10px; padding: 9px 10px; }
.pay-summary span { display: block; font-size: .74rem; color: var(--ink-2); font-weight: 600; }
.pay-summary strong { font-size: 1rem; }
.pay-summary .due { background: var(--danger-soft); }
.pay-summary .due strong { color: var(--danger); }
.pay-summary .clear { background: var(--success-soft); }
.pay-summary .clear strong { color: var(--success); }
.pay-list { border-top: 1px solid var(--line); }
.pay-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.3rem; font-weight: 700; letter-spacing: .12em; color: var(--cloth); }

/* ---------- Deliveries ---------- */
.delivery-list { display: grid; gap: 10px; }
@media (min-width: 768px) { .delivery-list { grid-template-columns: 1fr 1fr; } }
.delivery-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.delivery-card.is-late { box-shadow: var(--shadow), inset 0 4px 0 var(--danger); }
.dc-main { padding: 14px 14px 10px; display: block; }
.dc-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: .86rem; color: var(--ink-2); }
.dc-actions { display: flex; gap: 8px; padding: 10px 14px; background: #fafbfb; border-top: 1px solid var(--line); margin-top: auto; }
.dc-actions .btn-sm { min-height: 36px; }

/* ---------- Settings ---------- */
.logo-preview { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; background: var(--paper); padding: 4px; }
.form-switch .form-check-input { width: 2.6em; height: 1.4em; }
.form-check-input:checked { background-color: var(--cloth); border-color: var(--cloth); }

/* ---------- Public pages (login / tracking) ---------- */
.public-body {
    min-height: 100vh;
    background:
        radial-gradient(1200px 500px at 50% -200px, rgba(15, 95, 90, .16), transparent 70%),
        var(--paper);
}
.public-top { display: flex; justify-content: flex-end; padding: 14px 16px; }
.public-wrap { max-width: 440px; margin: 0 auto; padding: 0 16px 48px; }
.auth-card { background: var(--surface); border-radius: 20px; box-shadow: 0 6px 30px rgba(16, 40, 38, .08); padding: 26px 20px; position: relative; overflow: hidden; }
@media (min-width: 576px) { .auth-card { padding: 32px 30px; } }
.public-brand { text-align: center; margin-bottom: 16px; }
.public-logo { max-width: 120px; max-height: 70px; object-fit: contain; }
.public-shop-name { font-size: 1.25rem; font-weight: 800; margin-top: 8px; }
.public-shop-phone { color: var(--ink-2); font-size: .9rem; }
.auth-title { font-size: 1.3rem; font-weight: 800; text-align: center; margin: 8px 0 4px; }

.track-hello { text-align: center; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; }
.track-status { border-radius: 16px; padding: 18px; text-align: center; }
.ts-label { font-size: .82rem; font-weight: 600; opacity: .8; }
.ts-value { font-size: 1.6rem; font-weight: 800; line-height: 1.3; }
.ts-msg { font-size: .92rem; margin-top: 4px; color: var(--ink); opacity: .85; }
.track-details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.track-details > div { background: var(--paper); border-radius: 10px; padding: 9px 11px; }
.track-details span { display: block; font-size: .76rem; color: var(--ink-2); font-weight: 600; }
.track-details strong { font-size: .98rem; }

/* ---------- Small screens ---------- */
@media (max-width: 380px) {
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
    .pay-summary { grid-template-columns: 1fr; }
    .contact-actions { grid-template-columns: 1fr 1fr; }
    .contact-actions .btn-brand { grid-column: span 2; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
    .tab-bar, .side-nav, .app-bar { display: none !important; }
}

/* =========================================================
   v2 additions
   ========================================================= */
.text-brand { color: var(--cloth) !important; }

/* Super admin brand + side user */
.brand-mark-super { background: var(--ink); color: var(--chalk); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-sub { font-size: .75rem; color: var(--ink-3); font-weight: 600; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; margin-top: 8px; border-top: 1px solid var(--line); font-weight: 600; font-size: .9rem; }
.avatar-sm { width: 32px; height: 32px; font-size: .85rem; }

.impersonate-bar {
    position: sticky; top: 0; z-index: 1040;
    display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
    padding: 8px 12px; background: var(--ink); color: #fff; font-size: .88rem; font-weight: 600;
}
.impersonate-bar i { color: var(--chalk); }
.impersonate-bar ~ .app-shell .app-bar { top: 0; }

/* Dashboard call to action */
.hero-cta {
    display: flex; align-items: center; gap: 14px;
    padding: 16px; border-radius: var(--radius); background: var(--cloth); color: #fff;
    box-shadow: 0 6px 18px rgba(15, 95, 90, .22); position: relative; overflow: hidden;
}
.hero-cta:hover { color: #fff; background: var(--cloth-dark); }
.hero-cta-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--chalk); color: var(--ink); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.hero-cta-title { display: block; font-weight: 800; font-size: 1.15rem; }
.hero-cta-sub { display: block; font-size: .85rem; opacity: .85; }

.stat-grid-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .stat-grid-4 { grid-template-columns: repeat(4, 1fr); } }
.stat-warn { border-color: rgba(217, 165, 44, .5); background: #fffbf0; }

/* 14-day bars */
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 140px; padding-top: 8px; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; }
.bar { width: 100%; max-width: 28px; background: var(--cloth); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.bar-col:last-child .bar { background: var(--chalk); }
.bar-n { font-size: .68rem; font-weight: 700; color: var(--ink-2); min-height: 1em; }
.bar-d { font-size: .66rem; color: var(--ink-3); }

/* Shops */
.shop-grid { display: grid; gap: 12px; }
@media (min-width: 768px) { .shop-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .shop-grid { grid-template-columns: 1fr 1fr 1fr; } }
.shop-card { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; color: var(--ink); border: 1px solid transparent; }
.shop-card:hover { border-color: var(--line); color: var(--ink); }
.shop-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.shop-nums div { background: var(--paper); border-radius: 9px; padding: 7px 6px; text-align: center; }
.shop-nums strong { display: block; font-size: 1.05rem; font-family: var(--font); }
.shop-nums span { font-size: .7rem; color: var(--ink-2); font-weight: 600; }
.shop-nums .is-bad { background: var(--danger-soft); }
.shop-nums .is-bad strong { color: var(--danger); }
.shop-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: .78rem; color: var(--ink-3); }

.shop-hero { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 18px 16px; }
.shop-hero .avatar { background: rgba(255, 255, 255, .12); color: var(--chalk); }
.shop-hero .status-chip { background: rgba(255, 255, 255, .95); }
.shop-hero-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
@media (min-width: 768px) { .shop-hero-grid { grid-template-columns: repeat(4, 1fr); } }
.shop-hero-grid span { display: block; font-size: .75rem; opacity: .65; }
.shop-hero-grid strong { font-size: .95rem; }

.cred-card { background: #fffbea; border: 1.5px dashed var(--chalk-dark); border-radius: var(--radius); padding: 14px 16px; }
.cred-grid { display: grid; gap: 8px; }
@media (min-width: 768px) { .cred-grid { grid-template-columns: 2fr 1fr 1fr; } }
.cred-grid div { background: #fff; border-radius: 9px; padding: 8px 10px; min-width: 0; }
.cred-grid span { display: block; font-size: .74rem; color: var(--ink-2); font-weight: 600; }
.cred-grid b { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }

.danger-zone { border: 1.5px solid rgba(192, 57, 43, .25); border-radius: var(--radius); padding: 16px; background: #fffafa; }
.danger-zone .card-h i { color: var(--danger); }

/* Segmented toggle with radios */
.seg-toggle .btn-check:checked + .seg-btn { background: var(--surface); color: var(--cloth); box-shadow: var(--shadow); }
label.seg-btn { display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; margin: 0; }

/* Order form */
.step-icon {
    width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
    background: var(--cloth-soft); color: var(--cloth);
    display: inline-flex; align-items: center; justify-content: center; font-size: 1rem;
}
.step-head .ms-auto { margin-inline-start: auto !important; margin-left: 0; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.pill-returning { background: var(--success-soft); color: var(--success); }
.pill-new { background: #fdf3dc; color: #946300; }

.input-icon { position: relative; }
.input-icon > i { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 14px; color: var(--ink-3); pointer-events: none; z-index: 2; }
.input-icon .form-control { padding-inline-start: 40px; }

.suggest-box {
    position: absolute; left: 12px; right: 12px; top: 100%; z-index: 30; margin-top: 4px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 12px 30px rgba(16, 40, 38, .16); overflow: hidden; max-height: 320px; overflow-y: auto;
}
.sg-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: transparent; text-align: start; color: var(--ink); border-bottom: 1px solid var(--line); }
.sg-item:last-child { border-bottom: 0; }
.sg-item:hover, .sg-item:focus { background: var(--cloth-soft); }
.sg-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sg-main span { font-size: .85rem; color: var(--ink-2); }
.sg-meta { font-size: .76rem; color: var(--ink-3); text-align: end; }

.cust-info { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--cloth-soft); font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.saved-sets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.saved-sets .fchip.active { background: var(--cloth); border-color: var(--cloth); color: #fff; }
.prefill-note { font-size: .84rem; color: #155d34; background: var(--success-soft); border-radius: 10px; padding: 7px 10px; margin-bottom: 10px; }

.submit-bar {
    position: sticky; bottom: calc(var(--tab-h) + 8px + env(safe-area-inset-bottom)); z-index: 6;
    display: flex; align-items: center; gap: 12px;
    background: var(--surface); padding: 10px 10px 10px 14px; border-radius: var(--radius);
    box-shadow: 0 -2px 18px rgba(16, 40, 38, .14); margin-top: 16px;
}
[dir="rtl"] .submit-bar { padding: 10px 14px 10px 10px; }
.submit-sum { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.submit-sum strong { font-size: 1.2rem; color: var(--danger); font-family: var(--font); }
.submit-bar.is-clear .submit-sum strong { color: var(--success); }
.submit-bar .btn { flex: 1.3; }
@media (min-width: 992px) { .submit-bar { bottom: 16px; } }

/* Media picker */
.photo-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-strip:not(:empty) { margin-bottom: 10px; }
.photo-thumb { position: relative; width: 84px; height: 84px; border-radius: 12px; overflow: hidden; background: var(--paper); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb button { position: absolute; top: 4px; inset-inline-end: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: .75rem; display: flex; align-items: center; justify-content: center; }
.photo-size { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0, 0, 0, .45); color: #fff; font-size: .62rem; text-align: center; font-family: var(--font); }
.media-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.media-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    padding: 12px 6px; border-radius: 12px; border: 1.5px dashed #c9d2d0; background: var(--paper);
    color: var(--ink-2); font-weight: 600; font-size: .82rem; cursor: pointer; margin: 0;
}
.media-btn i { font-size: 1.35rem; color: var(--cloth); }
.media-btn:hover { border-color: var(--cloth); color: var(--ink); }
.rec-box { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--danger-soft); }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); animation: recpulse 1s infinite; }
.rec-time { font-weight: 800; font-family: var(--font); min-width: 3em; }
@keyframes recpulse { 50% { opacity: .3; } }
.voice-preview, .voice-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 10px; border-radius: 12px; background: var(--paper); }
.voice-preview audio, .voice-row audio { flex: 1; min-width: 0; height: 40px; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 576px) { .photo-grid { grid-template-columns: repeat(4, 1fr); } }
.photo-cell { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--paper); }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-cell form { position: absolute; top: 6px; inset-inline-end: 6px; }
.photo-del { width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: .8rem; }
.photo-modal { background: #000; border: 0; border-radius: 14px; overflow: hidden; position: relative; }
.photo-modal img { width: 100%; max-height: 80vh; object-fit: contain; }
.photo-close { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; }
.photo-nav { display: flex; justify-content: space-between; align-items: center; padding: 10px; }

/* Order page */
.order-hero-cust { margin-top: 8px; font-size: .9rem; opacity: .9; }
.order-hero-grid { grid-template-columns: repeat(3, 1fr); }
.detail-list { margin: 0; }
.detail-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { font-weight: 600; color: var(--ink-2); font-size: .88rem; }
.detail-list dd { margin: 0; text-align: end; font-weight: 600; }
.code-sm { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; color: var(--cloth); }
.measure-grid-lg { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.measure-grid-lg .mg-item strong { font-size: 1.25rem; }

.row-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--paper); }

/* Activity feed */
.act-row { align-items: flex-start; }
.act-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--paper); color: var(--cloth); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.act-text { font-weight: 600; font-size: .92rem; line-height: 1.4; }

/* Tracking list */
.track-list { display: grid; gap: 8px; }
.track-item { display: block; padding: 12px; border-radius: 12px; background: var(--paper); color: var(--ink); border: 1.5px solid transparent; }
.track-item:hover { border-color: var(--cloth); color: var(--ink); }
.track-details .span-2 { grid-column: span 2; }

/* Steps on very small screens */
@media (max-width: 380px) {
    .media-actions { grid-template-columns: 1fr 1fr; }
    .media-actions .media-btn:last-child { grid-column: span 2; }
    .order-hero-grid { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   v3: order items, expenses, reports
   ========================================================= */
/* Item cards in the order form */
.item-card { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; background: #fcfdfd; }
.item-card.is-removed { display: none; }
.item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.item-no { width: 28px; height: 28px; border-radius: 50%; background: var(--chalk); color: var(--ink); font-weight: 800; font-size: .85rem; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: var(--font); }
.item-title { font-weight: 800; }
.item-amount { font-weight: 800; color: var(--cloth); font-family: var(--font); white-space: nowrap; }
.item-head .ms-auto { margin-inline-start: auto !important; margin-left: 0; }
.item-measure { background: var(--surface); border-radius: 12px; padding: 10px; border: 1px dashed #d6dddc; }
.size-grid-sm { gap: 8px; }
.size-grid-sm .size-field { padding: 6px 8px 8px; }
.size-grid-sm .size-field .form-control { font-size: 1.05rem; padding: .35rem .25rem; }
@media (min-width: 992px) { .size-grid-sm { grid-template-columns: repeat(5, 1fr); } }

.bill-lines > div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.bill-lines > div:last-child { border-bottom: 0; }
.bill-lines strong { font-family: var(--font); }
.bl-total strong { font-size: 1.15rem; color: var(--cloth); }
.submit-sum b { color: var(--ink); font-family: var(--font); }

/* Items on the order page */
.item-list { display: grid; gap: 10px; }
.iv-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.iv-row.is-cancelled { opacity: .55; }
.iv-row.is-cancelled .fw-bold { text-decoration: line-through; }
.iv-head { display: flex; align-items: flex-start; gap: 10px; }
.for-tag { display: inline-flex; align-items: center; gap: 3px; margin-inline-start: 6px; padding: 1px 8px; border-radius: 999px; background: var(--cloth-soft); color: var(--cloth); font-size: .75rem; font-weight: 700; }
.iv-sizes { margin-top: 10px; }
.iv-sizes summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.iv-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 10px; }
.part-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #fdf3dc; color: #946300; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.track-items { display: grid; gap: 6px; }
.ti-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; background: var(--paper); border-radius: 10px; font-weight: 600; }

/* Month navigation */
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); border-radius: var(--radius); padding: 6px; box-shadow: var(--shadow); }
.month-title { font-weight: 800; font-size: 1.1rem; text-align: center; flex: 1; }
.month-title .form-control { max-width: 220px; margin: 0 auto; border: 0; font-weight: 700; }
.icon-btn.disabled { opacity: .3; pointer-events: none; }

/* Profit / loss blocks */
.pnl-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pnl-strip > div { background: var(--surface); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); min-width: 0; }
.pnl-strip span { display: block; font-size: .74rem; color: var(--ink-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pnl-strip strong { font-size: 1.05rem; font-family: var(--font); white-space: nowrap; }
.pnl-strip .is-profit { background: var(--success-soft); }
.pnl-strip .is-profit strong { color: var(--success); }
.pnl-strip .is-loss { background: var(--danger-soft); }
.pnl-strip .is-loss strong { color: var(--danger); }

.pnl-hero { border-radius: var(--radius); padding: 18px 16px; color: #fff; background: var(--cloth); position: relative; overflow: hidden; }
.pnl-hero.is-loss { background: #7a2a22; }
.pnl-hero-label { font-weight: 600; opacity: .85; }
.pnl-hero-value { font-size: 2.1rem; font-weight: 800; color: var(--chalk); font-family: var(--font); line-height: 1.15; }
.pnl-hero.is-loss .pnl-hero-value { color: #ffd2cc; }
.pnl-hero-sub { font-size: .85rem; opacity: .85; margin-top: 2px; }
.pnl-calc { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.pnl-calc > div:not(.op) { flex: 1; background: rgba(255, 255, 255, .1); border-radius: 10px; padding: 8px 10px; }
.pnl-calc span { display: block; font-size: .75rem; opacity: .75; }
.pnl-calc b { font-family: var(--font); }
.pnl-calc .op { font-size: 1.4rem; font-weight: 800; opacity: .7; }

.pnl-dash { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: stretch; }
.pnl-mini { display: flex; flex-direction: column; border-radius: var(--radius); padding: 12px 14px; color: var(--ink); border: 1.5px solid transparent; }
.pnl-mini span { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.pnl-mini strong { font-size: 1.35rem; font-family: var(--font); }
.pnl-mini small { color: var(--ink-2); font-size: .76rem; }
.pnl-mini.is-profit { background: var(--success-soft); }
.pnl-mini.is-profit strong { color: var(--success); }
.pnl-mini.is-loss { background: var(--danger-soft); }
.pnl-mini.is-loss strong { color: var(--danger); }
.pnl-mini:hover { color: var(--ink); border-color: rgba(15, 95, 90, .25); }
.add-exp-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .85rem; }
.add-exp-btn i { font-size: 1.3rem; color: var(--cloth); }

/* Expense form */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 576px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 992px) { .cat-grid { grid-template-columns: repeat(6, 1fr); } }
.cat-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px 4px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); text-align: center; cursor: pointer; font-size: .76rem; font-weight: 600; color: var(--ink-2); line-height: 1.2; min-height: 72px; margin: 0; }
.cat-chip i { font-size: 1.3rem; color: var(--cloth); }
.btn-check:checked + .cat-chip { background: var(--cloth); border-color: var(--cloth); color: #fff; }
.btn-check:checked + .cat-chip i { color: var(--chalk); }
.btn-check:focus-visible + .cat-chip { outline: 3px solid rgba(242, 193, 78, .9); outline-offset: 2px; }
.cat-grid.is-invalid .cat-chip { border-color: rgba(192, 57, 43, .45); }
.bill-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; border: 1.5px dashed #c9d2d0; background: var(--paper); font-weight: 600; font-size: .88rem; color: var(--ink-2); cursor: pointer; margin: 0; }
.bill-btn.has-file { border-color: var(--cloth); color: var(--cloth); background: var(--cloth-soft); }

.day-head { display: flex; justify-content: space-between; font-weight: 700; font-size: .85rem; color: var(--ink-2); margin: 4px 4px 6px; }
.hbar { margin-bottom: 10px; }
.hbar-top { display: flex; justify-content: space-between; gap: 8px; font-size: .88rem; margin-bottom: 4px; }
.hbar-top i { color: var(--cloth); }
.hbar-top b { font-family: var(--font); white-space: nowrap; }
.hbar-track { height: 8px; background: var(--paper); border-radius: 99px; overflow: hidden; }
.hbar-track span { display: block; height: 100%; background: var(--cloth); border-radius: 99px; }
.hbar-red .hbar-track span { background: #d4705f; }
.rec-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rec-row.is-off { opacity: .5; }
.cat-edit { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.icon-select { max-width: 110px; }

/* More page */
.more-grid { display: grid; gap: 8px; }
.more-item { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); }
.more-item:hover { color: var(--ink); }
.more-item b { display: block; }
.more-item small { color: var(--ink-2); }
.more-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--cloth-soft); color: var(--cloth); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }

/* Reports */
.report-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg-3 { grid-template-columns: repeat(3, 1fr); min-width: 260px; }
a.seg-btn { text-align: center; display: block; color: var(--ink-2); }
a.seg-btn.active { color: var(--cloth); }
.kv-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv-row:last-child { border-bottom: 0; }
.kv-row b { font-family: var(--font); white-space: nowrap; }
.stat-num-sm { font-size: 1.1rem; }
.report-table { font-size: .9rem; }
.report-table td, .report-table th { white-space: nowrap; }
.legend { font-size: .78rem; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.lg-in { background: var(--cloth); }
.lg-out { background: #d4705f; margin-inline-start: 6px; }
.bars2 { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 160px; align-items: end; }
.bar2-col { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; }
.bar2-pair { display: flex; gap: 2px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bar2 { width: 45%; max-width: 14px; border-radius: 4px 4px 1px 1px; min-height: 2px; }
.bar2-in { background: var(--cloth); }
.bar2-out { background: #d4705f; }
.print-only { display: none; }

@media print {
    .no-print, .submit-bar, .impersonate-bar { display: none !important; }
    .print-only { display: block !important; }
    .print-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 10px; }
    .app-content { padding: 0 !important; max-width: none; }
    .form-card, .stat-card, .pnl-strip > div, .month-nav { box-shadow: none !important; border: 1px solid #ddd; }
    .pnl-hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a { color: inherit !important; text-decoration: none !important; }
}
@media (max-width: 380px) {
    .pnl-strip strong { font-size: .92rem; }
    .cat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   v4: stock
   ========================================================= */
.stat-grid-3 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .stat-grid-3 { grid-template-columns: repeat(3, 1fr); } }
.stock-qty { text-align: end; line-height: 1.1; flex-shrink: 0; }
.stock-qty b { display: block; font-size: 1.2rem; font-family: var(--font); }
.stock-qty span { font-size: .75rem; color: var(--ink-2); font-weight: 600; }
.stock-qty.is-low b { color: var(--danger); }
.stock-hero { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 18px 16px; }
.stock-hero.is-low { background: #7a2a22; }
.stock-hero-name { font-size: 1.25rem; font-weight: 800; }
.stock-hero-qty { margin-top: 10px; }
.stock-hero-qty b { font-size: 2.4rem; font-weight: 800; color: var(--chalk); font-family: var(--font); }
.stock-hero-qty span { font-size: 1rem; opacity: .8; }
.stock-hero .status-chip { background: rgba(255, 255, 255, .95); }
.seg-4 { grid-template-columns: repeat(4, 1fr); }
.seg-4 .seg-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; font-size: .8rem; }
.seg-4 .seg-btn i { font-size: 1.1rem; }
.calc-box { height: 48px; border-radius: 12px; background: var(--paper); display: flex; align-items: center; padding: 0 12px; font-weight: 800; font-family: var(--font); color: var(--cloth); }
.move-in { color: var(--success); background: var(--success-soft); }
.move-out { color: #6a42b8; background: #f0ebfa; }
.move-sold { color: #2463a6; background: #e8f1fb; }
.move-adjust { color: #946300; background: #fdf3dc; }


/* =========================================================
   v4: professional polish (typography, cards, inputs)
   ========================================================= */
:root {
    --line: #e4e9e8;
    --shadow: 0 1px 2px rgba(16, 40, 38, .04), 0 4px 14px rgba(16, 40, 38, .045);
    --radius: 16px;
}
body { font-size: 15.5px; letter-spacing: -.003em; font-feature-settings: "tnum" 1, "lnum" 1; -webkit-font-smoothing: antialiased; }
html[dir="rtl"] body { letter-spacing: 0; font-size: 16px; }
h1, h2, h3, .app-title, .greeting-hello, .row-title, .stat-num, .money-value, .profile-name { font-weight: 800; }
.app-title { font-size: 1.12rem; letter-spacing: -.015em; }
.greeting-hello { font-size: 1.5rem; letter-spacing: -.025em; }
html[dir="rtl"] .greeting-hello, html[dir="rtl"] .app-title { letter-spacing: 0; }

/* Cards: hairline border + soft shadow, one consistent look */
.form-card, .list-card, .stat-card, .measure-card, .profile-card, .action-card, .shop-card,
.delivery-card, .money-due, .ia, .more-item, .month-nav, .pnl-strip > div, .qa {
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.form-card { padding: 18px; }
@media (min-width: 768px) { .form-card { padding: 22px 24px; } }
.card-h { font-size: 1rem; letter-spacing: -.01em; }
.step-head h2 { font-size: 1.02rem; letter-spacing: -.01em; }
.section-head h2 { font-size: 1.02rem; letter-spacing: -.01em; }
.stat-card { padding: 14px 14px; }
.stat-num { letter-spacing: -.02em; }
.stat-label { color: var(--ink-3); font-weight: 700; font-size: .76rem; }
.stat-icon { border-radius: 12px; }
.list-row { padding: 14px 16px; }
.row-sub { color: var(--ink-3); }
.money-card { border-radius: var(--radius); }

/* Inputs: calmer, taller, clear focus */
.form-control, .form-select { border-color: #d9e0df; border-radius: 12px; min-height: 46px; }
.form-control-sm, .form-select-sm { min-height: 36px; border-radius: 10px; }
textarea.form-control { min-height: 0; }
.form-control-lg { min-height: 52px; font-size: 1.04rem; }
.form-control::placeholder { color: #a8b2b1; }
.form-label { font-size: .86rem; font-weight: 700; color: var(--ink-2); margin-bottom: .35rem; }
.input-group-text { background: var(--paper); border-color: #d9e0df; color: var(--ink-2); font-weight: 700; font-size: .9rem; }
.btn { border-radius: 12px; letter-spacing: -.005em; }
.btn-lg { min-height: 52px; }
.btn-brand { box-shadow: 0 2px 6px rgba(15, 95, 90, .18); }
.chip { border-radius: 11px; font-weight: 700; font-size: .9rem; }
.fchip { font-weight: 700; }
.status-chip { font-weight: 800; letter-spacing: .005em; }

/* Item card in the order form: clearer separation */
.item-card { background: var(--surface); border-color: #dfe6e5; box-shadow: 0 1px 2px rgba(16, 40, 38, .04); }
.item-measure { background: #fafcfb; }

/* Tab bar + app bar */
.tab-bar { box-shadow: 0 -1px 0 var(--line), 0 -6px 18px rgba(16, 40, 38, .05); border-top: 0; }
.tab-item { font-weight: 700; }
.side-link { font-weight: 700; }

/* Calmer empty states */
.empty-state { border-style: dashed; border-color: #d6dedd; background: rgba(255, 255, 255, .6); }
/* Item header wraps on narrow phones */
.item-head { flex-wrap: wrap; row-gap: 6px; }
.item-head .item-title { min-width: 0; flex: 1 1 auto; }
.item-head .item-amount { margin-inline-start: auto; }
.iv-head { flex-wrap: wrap; }

/* ---- v5: outfit groups (gents / ladies) ---- */
.outfit-groups { display: flex; flex-direction: column; gap: .5rem; }
.outfit-group { display: flex; flex-direction: column; gap: .3rem; }
.og-head { font-size: .75rem; font-weight: 700; color: var(--ink-3); letter-spacing: .02em; }

/* =========================================================
   v6: calmer panel, footer, login, home page, website settings
   ========================================================= */
/* One colour for icon tiles instead of a rainbow */
.stat-icon.bg-soft-blue, .stat-icon.bg-soft-purple, .stat-icon.bg-soft-amber,
.stat-icon.bg-soft-slate, .stat-icon.bg-soft-green { background: var(--cloth-soft); color: var(--cloth); }
.hero-cta { box-shadow: none; }

/* "Developed by" footer */
.credit-footer {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px;
    font-size: .8rem; color: var(--ink-3); padding: 18px 16px;
}
.credit-footer a { color: var(--cloth); font-weight: 700; text-decoration: none; }
.credit-footer a:hover { text-decoration: underline; }
.credit-app { border-top: 1px solid var(--line); margin: 8px 16px 0; padding: 14px 0 calc(var(--tab-h) + 18px + env(safe-area-inset-bottom)); }
@media (min-width: 992px) { .credit-app { margin: 8px 32px 0; padding-bottom: 20px; } }
.credit-public, .credit-login { justify-content: center; text-align: center; }
.credit-site { max-width: 1080px; margin: 0 auto; padding: 16px 20px 18px; }

/* Dashboard */
.dash-greet { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.dash-hello { font-size: 1.35rem; font-weight: 800; }
.dash-date { color: var(--ink-3); font-weight: 600; font-size: .92rem; }
.board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.board-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 4px; }
.board-head h2 { font-size: .95rem; font-weight: 800; margin: 0; }
.board-head a { font-size: .85rem; font-weight: 700; color: var(--cloth); text-decoration: none; }
.flow { display: flex; align-items: center; padding: 6px 8px 12px; }
.flow-step { flex: 1; text-align: center; padding: 10px 4px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.flow-step:hover { background: var(--paper); color: var(--ink); }
.flow-step b { display: block; font-size: 1.9rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.flow-step span { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.flow-step.is-ready b { color: var(--success); }
.flow-arrow { color: var(--ink-3); font-size: .9rem; }
.board-foot { display: flex; border-top: 1px solid var(--line); }
.board-foot a { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; font-size: .88rem; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.board-foot a + a { border-inline-start: 1px solid var(--line); }
.board-foot b { color: var(--ink); font-size: 1.05rem; }
.board-foot a.is-late, .board-foot a.is-late b { color: var(--danger); }
.money-board { display: grid; grid-template-columns: 1fr 1fr; }
.mb-cell { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); text-decoration: none; min-width: 0; }
.mb-cell span { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.mb-cell strong { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.mb-cell small { font-size: .75rem; color: var(--ink-3); }
.mb-cell + .mb-cell { border-inline-start: 1px solid var(--line); }
.mb-link { grid-column: 1 / -1; border-inline-start: 0 !important; border-top: 1px solid var(--line); }
.mb-link:hover { background: var(--paper); color: var(--ink); }
.text-due { color: var(--danger); }
.text-profit { color: var(--success); }
.text-loss { color: var(--danger); }
@media (min-width: 768px) {
    .money-board { grid-template-columns: 1fr 1fr 1.3fr; }
    .mb-link { grid-column: auto; border-top: 0; border-inline-start: 1px solid var(--line) !important; }
}

/* Login */
.login-body { margin: 0; background: var(--paper); min-height: 100vh; }
.login-shell { min-height: 100vh; display: grid; }
.login-side { display: none; }
.login-main { display: flex; flex-direction: column; min-height: 100vh; }
.login-top { display: flex; align-items: center; gap: 12px; padding: 16px; }
.login-mobile-brand, .login-side-brand, .home-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; color: inherit; text-decoration: none; }
.login-form { width: 100%; max-width: 400px; margin: 0 auto; padding: 24px 20px 32px; flex: 1; }
.login-title { font-size: 1.7rem; font-weight: 800; margin: 12px 0 6px; }
.login-sub { color: var(--ink-2); margin-bottom: 28px; }
@media (min-width: 992px) {
    .login-shell { grid-template-columns: minmax(380px, 44%) 1fr; }
    .login-side {
        display: flex; flex-direction: column; background: var(--cloth); color: #fff; padding: 40px 48px; position: relative;
    }
    .login-side .brand-mark { background: var(--chalk); color: var(--ink); }
    .login-side-line { font-size: 2.1rem; font-weight: 800; line-height: 1.2; margin: auto 0 28px; max-width: 14ch; }
    .login-side-points { list-style: none; padding: 0; margin: 0 0 auto; display: grid; gap: 12px; opacity: .9; }
    .login-side-points li::before { content: ""; display: inline-block; width: 14px; height: 2px; background: var(--chalk); vertical-align: middle; margin-inline-end: 12px; }
    .login-tape {
        position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: 14px;
        background:
            repeating-linear-gradient(180deg, rgba(29, 42, 42, .6) 0 1px, transparent 1px 10px) right / 5px 100% no-repeat,
            repeating-linear-gradient(180deg, rgba(29, 42, 42, .75) 0 1px, transparent 1px 50px) right / 9px 100% no-repeat,
            var(--chalk);
    }
    [dir="rtl"] .login-tape { background-position: left, left, 0 0; }
    .login-form { margin: auto; flex: none; }
}

/* Home page */
.home-body { margin: 0; background: var(--paper); color: var(--ink); }
.home-wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.home-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.home-head-in { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 64px; }
.home-hero { padding: 56px 0 48px; }
.home-hero h1 { font-size: clamp(2rem, 6vw, 3.3rem); font-weight: 800; line-height: 1.12; letter-spacing: -.02em; max-width: 18ch; margin: 0 0 16px; }
[dir="rtl"] .home-hero h1 { line-height: 1.5; letter-spacing: 0; }
.home-lead { font-size: 1.12rem; color: var(--ink-2); max-width: 52ch; margin: 0 0 28px; }
.home-sec { padding: 40px 0 56px; }
.home-sec-alt { background: var(--surface); border-top: 1px solid var(--line); }
.home-h2 { font-size: 1.4rem; font-weight: 800; margin: 0 0 24px; }
.home-features { display: grid; gap: 28px; }
.home-feature i { font-size: 1.5rem; color: var(--cloth); }
.home-feature h3 { font-size: 1.05rem; font-weight: 800; margin: 8px 0 6px; }
.home-feature p { color: var(--ink-2); margin: 0; max-width: 40ch; }
.home-shops { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.home-shops a { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); background: var(--paper); }
.home-shops a:hover { border-color: var(--cloth); }
.home-shops span { color: var(--ink-3); }
@media (min-width: 768px) {
    .home-hero { padding: 88px 0 72px; }
    .home-features { grid-template-columns: repeat(4, 1fr); }
    .home-shops { grid-template-columns: repeat(3, 1fr); }
}

/* My website (settings) */
.site-link-card { background: var(--cloth); color: #fff; border-radius: var(--radius); padding: 18px 16px 16px; }
.site-link-card.is-off { background: var(--ink-2); }
.slc-label { font-size: .85rem; font-weight: 600; opacity: .85; }
.slc-url { display: block; color: #fff; font-weight: 800; font-size: 1.15rem; margin: 2px 0 14px; word-break: break-all; text-decoration: none; }
.slc-url:hover { color: var(--chalk); }
.slc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.slc-actions .btn { flex: 1 1 auto; }
.rate-inputs { display: grid; grid-template-columns: 1fr; gap: 8px; }
.rate-input { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 6px 6px 6px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 600; }
[dir="rtl"] .rate-input { padding: 6px 14px 6px 6px; }
.rate-input .form-control { max-width: 140px; text-align: end; }
@media (min-width: 576px) { .rate-inputs { grid-template-columns: 1fr 1fr; } }
.site-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.site-thumb { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; font-size: .8rem; cursor: pointer; }
.site-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.site-thumb span { display: flex; gap: 6px; align-items: center; padding: 6px 8px; }
.theme-pick { display: flex; flex-wrap: wrap; gap: 10px; }
.theme-swatch { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border: 2px solid var(--line); border-radius: 999px; font-weight: 600; cursor: pointer; }
.theme-swatch .sw { width: 28px; height: 28px; border-radius: 50%; position: relative; overflow: hidden; }
.theme-swatch .sw i { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; }
.btn-check:checked + .theme-swatch { border-color: var(--cloth); background: var(--cloth-soft); }
.btn-check:focus-visible + .theme-swatch { outline: 3px solid var(--chalk); }
.public-shop-name a { color: inherit; text-decoration: none; }

/* ---- v7: footer sits at the bottom, sidebar scrolls on short screens ---- */
.app-content { flex: 1 0 auto; padding-bottom: 24px; }
@media (min-width: 992px) { .app-content { padding-bottom: 32px; } }
.side-nav { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.side-links .side-link { padding-top: 8px; padding-bottom: 8px; }
@media (max-height: 760px) {
    .side-brand { margin-bottom: 12px; }
    .side-nav .btn-lg { padding-top: 8px; padding-bottom: 8px; font-size: 1rem; }
    .side-links .side-link { padding-top: 6px; padding-bottom: 6px; }
}
.credit-app {
    width: 100%; max-width: 1080px; margin: 0 auto; border-top: 0;
    flex-direction: column; align-items: center; text-align: center; gap: 2px;
    padding: 12px 16px calc(var(--tab-h) + 14px + env(safe-area-inset-bottom));
    font-size: .78rem;
}
@media (min-width: 992px) {
    .credit-app { flex-direction: row; justify-content: center; gap: 6px; padding: 16px 32px 20px; }
    .credit-app .credit-dev::before { content: "·"; margin-inline-end: 6px; color: var(--line); }
}

/* ---- v7: connection state, offline orders, toast ---- */
.net-state {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: .8rem; font-weight: 700; text-decoration: none;
}
.net-state:hover { color: var(--ink); }
.net-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); flex: none; }
.net-state.is-off .net-dot, .net-dot.is-off { background: #9aa5a4; box-shadow: 0 0 0 3px #e6eaea; }
.net-state.is-off { color: var(--ink); background: #eef1f1; }
.net-state.is-syncing .net-dot { background: var(--chalk-dark); box-shadow: 0 0 0 3px #fdf3dc; animation: netPulse 1s ease-in-out infinite; }
@keyframes netPulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .net-state.is-syncing .net-dot { animation: none; } }
.net-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--chalk); color: var(--ink); font-size: .72rem; display: inline-flex; align-items: center; justify-content: center; }
.net-count.is-failed { background: var(--danger); color: #fff; }
.offline-banner {
    display: flex; align-items: center; gap: 8px; justify-content: center;
    background: #2b3433; color: #fff; font-size: .86rem; font-weight: 600; padding: 8px 16px; text-align: center;
}
.off-toast {
    position: fixed; left: 50%; bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
    background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 600; font-size: .9rem;
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 1060; max-width: calc(100% - 32px); text-align: center;
}
.off-toast.show { opacity: 1; transform: translate(-50%, 0); }
.off-toast.good { background: var(--success); }
.off-toast.bad { background: var(--danger); }
@media (min-width: 992px) { .off-toast { bottom: 24px; } }

.sync-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.sync-state { display: flex; align-items: center; gap: 12px; }
.sync-state b { display: block; }
.sync-state small { color: var(--ink-3); }
.sync-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sync-counts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sc { font-size: .82rem; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.sc b { color: var(--ink); }
.sc-failed b { color: var(--danger); }
.sc-synced b { color: var(--success); }
.offline-note { display: flex; gap: 12px; align-items: flex-start; background: #2b3433; color: #fff; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.offline-note i { font-size: 1.3rem; }
.offline-note span { display: block; opacity: .85; font-size: .9rem; }
.outbox-list { display: grid; gap: 10px; }
.ob-card { background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--chalk); border-radius: var(--radius); padding: 12px 14px; }
.ob-card.ob-synced { border-inline-start-color: var(--success); }
.ob-card.ob-failed { border-inline-start-color: var(--danger); }
.ob-card.ob-syncing { border-inline-start-color: var(--cloth); }
.ob-card.is-new { box-shadow: 0 0 0 3px var(--cloth-soft); }
.ob-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ob-who b { display: block; }
.ob-who span { font-size: .85rem; color: var(--ink-3); }
.ob-status { font-size: .78rem; font-weight: 700; white-space: nowrap; color: var(--ink-2); }
.ob-failed .ob-status { color: var(--danger); }
.ob-synced .ob-status { color: var(--success); }
.ob-items { font-weight: 600; margin-top: 6px; }
.ob-meta, .ob-time { font-size: .82rem; color: var(--ink-2); margin-top: 2px; }
.ob-time { color: var(--ink-3); }
.ob-errors { margin: 8px 0 0; padding: 8px 12px 8px 28px; background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-sm); font-size: .84rem; }
[dir="rtl"] .ob-errors { padding: 8px 28px 8px 12px; }
.ob-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.draft-note { margin-bottom: 16px; }
.garment-row.is-off .row-title { color: var(--ink-3); }
.install-card .card-h i { color: var(--cloth); }
html.is-offline .needs-net { opacity: .5; pointer-events: none; }
/* Narrow phones: keep the top bar on one line (settings is also under More) */
.app-bar-start { flex: 1 1 auto; }
.app-bar-end { flex: none; }
@media (max-width: 400px) {
    .area-shop .app-bar-end .icon-btn.d-lg-none { display: none; }
    .net-state { padding: 0 8px; }
}

/* =========================================================
   v8: styles & own sizes, karigars, plans, onboarding
   ========================================================= */
.chip-select-sm { gap: 6px; }
.chip-sm { padding: 5px 12px; font-size: .82rem; min-height: 32px; }
.style-groups { display: grid; gap: 10px; margin: 6px 0 4px; padding-top: 10px; border-top: 1px dashed var(--line); }
.style-groups.is-hidden, .style-group.is-hidden { display: none; }
.style-group { display: grid; gap: 4px; }
.sg-label { font-size: .78rem; font-weight: 700; color: var(--ink-2); }
.xrows { display: grid; gap: 6px; margin-top: 4px; }
.xrow { display: grid; grid-template-columns: 1fr 96px 36px; gap: 6px; align-items: center; }
.xrow .icon-btn { width: 36px; height: 36px; }
.item-karigar .form-select { max-width: 320px; }
.iv-karigar { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.iv-karigar .form-select { width: auto; min-width: 160px; }
.chip-removable { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.chip-removable:hover { border-color: var(--danger); color: var(--danger); }
.sz-edit { border-top: 1px solid var(--line); padding: 10px 0; }
.sz-edit summary { cursor: pointer; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.style-cfg.is-off { opacity: .7; }

/* Locked feature */
.locked-box { text-align: center; max-width: 460px; margin: 40px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 24px; }
.locked-icon { width: 56px; height: 56px; border-radius: 16px; background: #fdf3dc; color: #a06d06; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 14px; }
.locked-box h2 { font-size: 1.3rem; font-weight: 800; }

/* My plan */
.plan-current { padding: 18px; }
.pc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.pc-label { font-size: .8rem; font-weight: 700; color: var(--ink-3); }
.pc-head h2 { font-size: 1.5rem; font-weight: 800; margin: 0; }
.pc-price { font-size: 1.3rem; font-weight: 800; white-space: nowrap; }
.pc-price small { font-size: .8rem; color: var(--ink-3); font-weight: 600; }
.pc-usage { display: grid; gap: 12px; }
.pu-row { font-size: .92rem; }
.pu-bar { height: 8px; border-radius: 999px; background: var(--paper); margin-top: 6px; overflow: hidden; }
.pu-bar i { display: block; height: 100%; background: var(--cloth); border-radius: 999px; }
.pu-bar i.is-full { background: var(--danger); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg a { padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: .88rem; color: var(--ink-2); text-decoration: none; }
.seg a.active { background: var(--cloth); color: #fff; }
.plan-cards { display: grid; gap: 14px; }
.plan-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; }
.plan-card.is-popular { border: 2px solid var(--cloth); }
.plan-card.is-mine { background: var(--cloth-soft); }
.plan-card h3 { font-size: 1.15rem; font-weight: 800; margin: 0; }
.pl-price { font-size: 1.6rem; font-weight: 800; margin: 4px 0 10px; }
.pl-price small { font-size: .82rem; color: var(--ink-3); font-weight: 600; }
.pl-list { padding-inline-start: 1.1em; margin: 0 0 14px; font-size: .92rem; flex: 1; display: grid; gap: 4px; }
@media (min-width: 768px) { .plan-cards { grid-template-columns: repeat(3, 1fr); } }

/* Super admin shop cards with actions */
.shop-card-wrap { display: flex; flex-direction: column; }
.shop-card-wrap .shop-card { border-bottom-left-radius: 0; border-bottom-right-radius: 0; flex: 1; }
.shop-card-actions { display: flex; gap: 6px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }

/* Onboarding */
.onboard .board-head h2 .opt { font-weight: 600; }
.ob-steps { list-style: none; margin: 0; padding: 4px 8px 10px; display: grid; gap: 2px; }
.ob-steps a { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; color: var(--ink); font-weight: 600; text-decoration: none; }
.ob-steps a:hover { background: var(--paper); }
.ob-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--cloth-soft); color: var(--cloth); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ob-steps .is-done a { color: var(--ink-3); text-decoration: line-through; }
.ob-steps .is-done .ob-ic { background: var(--success-soft); color: var(--success); }

/* Karigar area */
.area-karigar .tab-bar { grid-template-columns: repeat(3, 1fr); }
.k-stats { grid-template-columns: repeat(2, 1fr) !important; }
.k-stats .mb-cell:nth-child(3) { border-inline-start: 0; border-top: 1px solid var(--line); }
.k-stats .mb-cell:nth-child(4) { border-top: 1px solid var(--line); }
@media (min-width: 768px) { .k-stats { grid-template-columns: repeat(4, 1fr) !important; } .k-stats .mb-cell:nth-child(n) { border-top: 0; } .k-stats .mb-cell:nth-child(n+2) { border-inline-start: 1px solid var(--line); } }
.k-list { display: grid; gap: 10px; }
.k-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.k-main { display: block; padding: 14px 16px 10px; color: var(--ink); text-decoration: none; }
.k-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.k-title { font-size: 1.1rem; font-weight: 800; }
.k-sub { color: var(--ink-2); font-size: .9rem; }
.k-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--paper); }
.due-chip { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--paper); color: var(--ink-2); }
.due-chip.is-today { background: #fdf3dc; color: #8a5d00; }
.due-chip.is-late { background: var(--danger-soft); color: var(--danger); }
.k-steps { display: grid; gap: 8px; }
.k-step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; text-align: start; color: var(--ink); }
.k-step span { width: 28px; height: 28px; border-radius: 50%; background: var(--paper); display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; flex: none; }
.k-step.is-done { color: var(--ink-3); }
.k-step.is-done span { background: var(--success-soft); color: var(--success); }
.k-step.is-now { border-color: var(--cloth); background: var(--cloth-soft); color: var(--cloth-dark); opacity: 1; }
.k-step.is-now span { background: var(--cloth); color: #fff; }
.k-step:not(:disabled):hover { border-color: var(--cloth); }
@media (min-width: 768px) { .k-steps { grid-template-columns: repeat(5, 1fr); } .k-step { flex-direction: column; text-align: center; } }
.login-shown .kv-row b { user-select: all; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: #178f4a; color: #fff; }
.msg-list .is-unread { border-inline-start: 4px solid var(--chalk); }
.list-row.is-off .row-title { color: var(--ink-3); }
