/* ═══════════════════════════════════════════════════════════════════
   Smart Menu v2 — Admin theme (derived from the SmartConnect "Seller
   Central" theme: navy header, teal accents, orange primary action)
   Mobile-first responsive · tablets · desktop
   ═══════════════════════════════════════════════════════════════════ */
:root {
    --navy: #232f3e; --navy-light: #37475a; --navy-dark: #131a22;
    --teal: #008296; --teal-hover: #006d7e; --teal-bg: #e6f4f6;
    --orange: #ff9900; --orange-hover: #e88b00; --orange-light: #fff3e0;
    --bg: #f0f2f3; --white: #fff;
    --border: #d5d9d9; --border-light: #e7e7e7;
    --text: #0f1111; --text-dim: #565959; --text-link: #007185;
    --success: #067d62; --success-bg: #e6f7f2;
    --warning: #b06000; --warning-bg: #fff8e1;
    --danger: #cc0c39; --danger-bg: #fff0f0;
    --info: #1a73e8; --info-bg: #e8f0fe;
    --purple: #6d28d9; --purple-bg: #f3e8ff;
    --radius: 8px; --radius-sm: 4px; --radius-lg: 14px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 2px 8px rgba(0,0,0,.12);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.18);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --hdr-h: 58px; --nav-h: 42px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--text-link); text-decoration: none; }
a:hover { color: var(--teal); }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { line-height: 1.25; }

/* ─── TOP HEADER ───────────────────────────────────────────── */
.top-header { background: var(--navy); color: #fff; height: var(--hdr-h); display: flex; align-items: center; padding: 0 16px; gap: 14px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 4px rgba(0,0,0,.25); }
.top-header-brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; color: #fff; }
.top-header-brand:hover { color: #fff; }
.brand-icon { width: 30px; height: 30px; }
.top-header-brand h1 { font-size: 20px; font-weight: 800; letter-spacing: -.3px; line-height: 1; }
.top-header-brand h1 .brand-smart { font-weight: 500; color: rgba(255,255,255,.65); }
.top-header-brand h1 { color: var(--orange); }
.top-header-store { display: flex; align-items: center; gap: 8px; min-width: 0; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.15); }
.top-header-store .store-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.top-header-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top-header-user .user-info { text-align: right; line-height: 1.25; }
.top-header-user .user-name { font-size: 13px; font-weight: 600; color: #fff; }
.top-header-user .user-role { font-size: 11px; color: #aab; }
.btn-hdr { background: none; border: 1px solid transparent; color: #ddd; padding: 6px 8px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; gap: 6px; font-size: 12px; position: relative; }
.btn-hdr:hover { color: #fff; background: rgba(255,255,255,.1); }
.btn-logout-header { background: none; border: 1px solid #556; color: #ccc; padding: 5px 12px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; white-space: nowrap; }
.btn-logout-header:hover { border-color: #aaa; color: #fff; }
.btn-logout-header .hdr-ico { display: none; }
.notif-badge { position: absolute; top: -2px; right: -2px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 10px; min-width: 16px; text-align: center; line-height: 1.4; }

/* ─── SUB NAV ──────────────────────────────────────────────── */
.sub-nav { background: var(--navy-light); display: flex; align-items: center; padding: 0 10px; min-height: var(--nav-h); overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid rgba(255,255,255,.08); position: sticky; top: var(--hdr-h); z-index: 99; }
.sub-nav::-webkit-scrollbar { display: none; }
.sub-nav a { color: #ddd; font-size: 13px; padding: 10px 13px; white-space: nowrap; border-bottom: 2px solid transparent; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.sub-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.sub-nav a.active { color: #fff; border-bottom-color: var(--orange); font-weight: 600; }
.nav-count { background: var(--orange); color: var(--navy-dark); font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 10px; line-height: 1.4; }

/* ─── LAYOUT ───────────────────────────────────────────────── */
.page-wrap { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 14px 16px 30px; }
.page-wrap-full { max-width: none; padding: 10px 12px; }
.page-title-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.page-title-bar h2 { font-size: 22px; font-weight: 700; }
.page-title-bar .sub { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.app-footer { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; font-size: 11px; color: #888; border-top: 1px solid #e3e3e3; background: #fafafa; flex-wrap: wrap; gap: 8px; }
.app-footer a { margin-left: 10px; color: var(--teal); font-weight: 600; }

/* ─── CARDS ────────────────────────────────────────────────── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; }
.card-header { padding: 11px 16px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fafafa; border-radius: var(--radius) var(--radius) 0 0; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 700; }
.card-subtitle { font-size: 12px; color: var(--text-dim); margin-top: 1px; }
.card-body { padding: 14px 16px; }
.card-footer { padding: 10px 16px; border-top: 1px solid var(--border-light); background: #fafafa; border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card[onclick] { cursor: pointer; } .stat-card[onclick]:hover { border-color: #aaa; box-shadow: var(--shadow-md); }
.stat-card-value { font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat-card-label { font-size: 11px; color: var(--text-dim); margin-top: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.stat-card-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--teal); }
.stat-card.c-orange::before { background: var(--orange); } .stat-card.c-green::before { background: var(--success); }
.stat-card.c-red::before { background: var(--danger); } .stat-card.c-purple::before { background: var(--purple); } .stat-card.c-blue::before { background: var(--info); }

/* ─── TABLES ───────────────────────────────────────────────── */
.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; width: 100%; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th { background: #f8f8f8; padding: 9px 12px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .3px; border-bottom: 2px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
.tbl tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border-light); font-size: 13px; vertical-align: middle; }
.tbl tbody tr:hover { background: #f4f9fb; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-empty { padding: 36px; text-align: center; color: var(--text-dim); }
.empty-state { text-align: center; padding: 40px 16px; color: var(--text-dim); }
.empty-state .ico { font-size: 40px; margin-bottom: 8px; opacity: .5; }
.empty-state h4 { font-size: 15px; color: var(--text); margin-bottom: 4px; }

/* ─── TABS / CHIPS ─────────────────────────────────────────── */
.tab-bar { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tab-bar::-webkit-scrollbar { display: none; }
.tab-bar button, .tab-bar a { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; padding: 9px 16px; font-size: 13px; font-weight: 500; color: var(--text-dim); white-space: nowrap; }
.tab-bar button:hover, .tab-bar a:hover { color: var(--teal); }
.tab-bar button.active, .tab-bar a.active { color: var(--teal); border-bottom-color: var(--teal); font-weight: 600; }
.tab-count { background: #e8e8e8; color: var(--text-dim); font-size: 11px; padding: 1px 7px; border-radius: 10px; margin-left: 6px; font-weight: 600; }
.active .tab-count { background: var(--teal); color: #fff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 20px; background: #fff; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--text); user-select: none; }
.chip:hover { border-color: var(--teal); color: var(--teal); }
.chip.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.chip input { display: none; }
.chips-scroll { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll .chip { flex-shrink: 0; }

/* ─── BADGES ───────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 12px; white-space: nowrap; line-height: 1.4; background: #eee; color: var(--text-dim); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-teal { background: var(--teal-bg); color: var(--teal); }
.badge-orange { background: var(--orange-light); color: #b25f00; }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-navy { background: var(--navy); color: #fff; }

/* ─── BUTTONS ──────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid transparent; transition: .15s; white-space: nowrap; line-height: 1.3; text-decoration: none; min-height: 36px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #ffb84d 0%, var(--orange) 100%); color: var(--navy-dark); border-color: #c77600; }
.btn-primary:hover { background: linear-gradient(180deg, var(--orange) 0%, #e88b00 100%); color: var(--navy-dark); }
.btn-teal { background: var(--teal); color: #fff; border-color: var(--teal-hover); }
.btn-teal:hover { background: var(--teal-hover); color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: #056650; }
.btn-success:hover { background: #056650; color: #fff; }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-warning { background: #fff; color: var(--warning); border-color: var(--warning); }
.btn-warning:hover { background: var(--warning); color: #fff; }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: #f7f7f7; border-color: #aaa; color: var(--text); }
.btn-ghost { background: none; color: var(--text-link); border-color: transparent; }
.btn-ghost:hover { background: var(--teal-bg); }
.btn-navy { background: var(--navy); color: #fff; border-color: var(--navy-dark); }
.btn-navy:hover { background: var(--navy-dark); color: #fff; }
.btn-sm { font-size: 12px; padding: 5px 10px; min-height: 30px; }
.btn-xs { font-size: 11px; padding: 3px 8px; min-height: 26px; }
.btn-lg { font-size: 15px; padding: 11px 24px; min-height: 44px; }
.btn-block { width: 100%; }
.btn-icon { padding: 6px; min-width: 32px; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ─── FORMS ────────────────────────────────────────────────── */
.form-stack { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.form-label { font-size: 12px; font-weight: 700; color: var(--text); }
.form-label .req { color: var(--danger); }
.form-hint { font-size: 11px; color: var(--text-dim); }
.form-control { padding: 9px 11px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 14px; outline: none; width: 100%; min-width: 0; transition: .15s; }
.form-control:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,130,150,.15); }
.form-control:disabled { background: #f3f3f3; color: #777; }
select.form-control { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
textarea.form-control { resize: vertical; min-height: 68px; }
input[type=color].form-control { padding: 2px; height: 40px; width: 70px; }
input[type=range] { width: 100%; accent-color: var(--teal); }
.input-group { display: flex; } .input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); } .input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--teal); }
/* switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .sl { position: absolute; inset: 0; background: #ccc; border-radius: 24px; transition: .2s; }
.switch .sl::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .sl { background: var(--success); }
.switch input:checked + .sl::before { transform: translateX(18px); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.switch-row:last-child { border-bottom: none; }
.switch-row .lbl { font-weight: 600; font-size: 13px; } .switch-row .hint { font-size: 11px; color: var(--text-dim); }
.file-drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--text-dim); font-size: 13px; cursor: pointer; background: #fafafa; position: relative; }
.file-drop:hover { border-color: var(--teal); color: var(--teal); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-drop img { max-height: 140px; border-radius: 6px; display: block; margin: 0 auto 8px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .form-control { width: auto; }
.toolbar .grow { flex: 1; min-width: 160px; }
.search-box { position: relative; }
.search-box .form-control { padding-left: 32px; }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #999; }

/* ─── MODAL / DRAWER ───────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,17,17,.55); z-index: 500; display: flex; align-items: center; justify-content: center; animation: fadeIn .15s; padding: 16px; }
.modal-box { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); max-height: 92vh; display: flex; flex-direction: column; width: 560px; max-width: 100%; animation: slideUp .2s; }
.modal-box.modal-lg { width: 860px; } .modal-box.modal-sm { width: 400px; } .modal-box.modal-xl { width: 1100px; }
.modal-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #fafafa; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 24px; color: var(--text-dim); width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; line-height: 1; }
.modal-close:hover { background: #eee; color: var(--text); }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; background: #fafafa; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ─── TOASTS / ALERTS ──────────────────────────────────────── */
.toast-container { position: fixed; top: calc(var(--hdr-h) + 10px); right: 16px; z-index: 700; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { padding: 11px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-md); animation: slideRight .2s; display: flex; align-items: center; gap: 8px; border-left: 4px solid; background: #fff; }
.toast-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.toast-error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.toast-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }
.toast-info { background: var(--info-bg); color: var(--info); border-color: var(--info); }
.alert { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 12px; border-left: 4px solid; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: var(--info); }
.alerts-panel { position: fixed; top: calc(var(--hdr-h) + 4px); right: 10px; width: 340px; max-width: calc(100vw - 20px); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 650; max-height: 70vh; overflow: auto; }
.alerts-panel .ap-head { padding: 10px 14px; font-weight: 700; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; }
.alerts-panel .ap-item { padding: 10px 14px; border-bottom: 1px solid var(--border-light); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.alerts-panel .ap-item .t { font-size: 11px; color: var(--text-dim); }

/* ─── LOGIN ────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, var(--navy) 0%, var(--navy) 42%, var(--bg) 42%); padding: 20px; }
.login-box { width: 420px; max-width: 100%; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.login-header { text-align: center; padding: 28px 30px 16px; }
.login-header h1 { font-size: 28px; font-weight: 800; color: var(--orange); }
.login-header h1 .brand-smart { color: var(--text-dim); font-weight: 500; }
.login-header p { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.login-body { padding: 0 30px 28px; }
.login-foot { text-align: center; font-size: 12px; color: var(--text-dim); margin-top: 14px; }

/* ─── PRODUCT GRID (admin) ─────────────────────────────────── */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.pcard { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; position: relative; transition: .15s; }
.pcard:hover { box-shadow: var(--shadow-md); border-color: #aaa; }
.pcard .pimg { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #eee; display: block; }
.pcard .pbody { padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.pcard .pname { font-weight: 700; font-size: 14px; }
.pcard .pmeta { font-size: 11px; color: var(--text-dim); }
.pcard .pprice { font-weight: 800; color: var(--teal); font-size: 15px; }
.pcard .pstrike { text-decoration: line-through; color: var(--danger); font-weight: 500; font-size: 12px; margin-right: 5px; }
.pcard .pactions { display: flex; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--border-light); background: #fafafa; flex-wrap: wrap; }
.pcard .pflag { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; }
.pcard.off .pimg { opacity: .4; filter: grayscale(1); }
.pcard .ptoggle { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.95); border-radius: 20px; padding: 4px 8px; font-size: 11px; font-weight: 700; display: flex; align-items: center; gap: 6px; }

/* ─── ORDER CARD / STEPPER ─────────────────────────────────── */
.order-progress { display: flex; align-items: center; padding: 8px 0; }
.progress-step { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.progress-dot { width: 22px; height: 22px; border-radius: 50%; background: #e8e8e8; border: 2px solid #d5d5d5; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #999; z-index: 1; }
.progress-step.done .progress-dot { background: var(--success); border-color: var(--success); color: #fff; }
.progress-step.active .progress-dot { background: var(--teal); border-color: var(--teal); color: #fff; animation: pulse 2s infinite; }
.progress-step.cancelled .progress-dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.progress-label { font-size: 10px; color: var(--text-dim); margin-top: 4px; text-transform: uppercase; font-weight: 600; text-align: center; }
.progress-step.done .progress-label { color: var(--success); } .progress-step.active .progress-label { color: var(--teal); }
.progress-line { flex: 1; height: 2px; background: #e0e0e0; margin-top: -14px; }
.progress-line.done { background: var(--success); }
.order-card { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; margin-bottom: 10px; overflow: hidden; }
.order-card .oc-head { padding: 10px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; background: #fff; }
.order-card .oc-head:hover { background: #f7fafb; }
.order-card .oc-body { display: none; padding: 12px 14px; border-top: 1px solid var(--border-light); background: #fcfcfc; }
.order-card.open .oc-body { display: block; }
.order-card .oc-num { font-weight: 800; font-family: 'SF Mono', Consolas, monospace; }
.order-card .oc-total { margin-left: auto; font-weight: 800; color: var(--teal); white-space: nowrap; }
.oi-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-light); flex-wrap: wrap; }
.oi-row:last-child { border-bottom: none; }
.oi-row .oi-name { flex: 1; min-width: 140px; font-weight: 600; }
.oi-row .oi-opt { font-size: 11px; color: var(--text-dim); font-weight: 400; display: block; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.kv b { color: var(--text-dim); font-weight: 600; }
.st-Order.Placed, .st-placed { background: var(--info-bg); color: var(--info); }

/* ─── POS ──────────────────────────────────────────────────── */
.pos-layout { display: grid; grid-template-columns: 1fr 360px; gap: 12px; align-items: start; }
.pos-menu { }
.pos-cart { position: sticky; top: calc(var(--hdr-h) + var(--nav-h) + 10px); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - var(--hdr-h) - var(--nav-h) - 20px); }
.pos-cart .pc-head { padding: 10px 14px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fafafa; border-radius: var(--radius) var(--radius) 0 0; }
.pos-cart .pc-items { flex: 1; overflow: auto; padding: 6px 14px; }
.pos-cart .pc-foot { border-top: 1px solid var(--border); padding: 10px 14px; background: #fafafa; border-radius: 0 0 var(--radius) var(--radius); }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.pos-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; min-height: 120px; transition: .1s; user-select: none; }
.pos-item:active { transform: scale(.97); } .pos-item:hover { border-color: var(--teal); box-shadow: var(--shadow-md); }
.pos-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #eee; }
.pos-item .pi-name { font-size: 12px; font-weight: 600; padding: 6px 8px 0; line-height: 1.25; flex: 1; }
.pos-item .pi-price { font-size: 12px; font-weight: 800; color: var(--teal); padding: 2px 8px 7px; }
.pos-item.na { opacity: .45; }
.cart-line { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.cart-line .cl-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; }
.cart-line .cl-sub { font-size: 11px; color: var(--text-dim); font-weight: 400; }
.cart-line .cl-tot { font-weight: 700; white-space: nowrap; font-size: 13px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; }
.qty button { width: 30px; height: 30px; border: none; background: #fff; font-size: 17px; font-weight: 700; color: var(--teal); display: flex; align-items: center; justify-content: center; }
.qty button:hover { background: var(--teal-bg); }
.qty span { min-width: 26px; text-align: center; font-weight: 700; font-size: 13px; }
.sum-row { display: flex; justify-content: space-between; font-size: 13px; padding: 2px 0; }
.sum-row.total { font-size: 17px; font-weight: 800; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; }
.pos-cart-fab { display: none; }

/* ─── KITCHEN (KDS) ────────────────────────────────────────── */
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ticket { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; border-top: 5px solid var(--info); }
.ticket.t-progress { border-top-color: var(--orange); } .ticket.t-ready { border-top-color: var(--success); } .ticket.t-late { border-top-color: var(--danger); animation: blinkBorder 1.2s infinite; }
.ticket .tk-head { padding: 9px 12px; display: flex; justify-content: space-between; align-items: center; background: #fafafa; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.ticket .tk-head b { font-size: 15px; }
.ticket .tk-timer { font-family: 'SF Mono', Consolas, monospace; font-weight: 700; }
.ticket .tk-items { padding: 6px 12px; flex: 1; }
.ticket .tk-item { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border-light); align-items: flex-start; }
.ticket .tk-item:last-child { border-bottom: none; }
.ticket .tk-qty { font-weight: 800; font-size: 16px; min-width: 28px; color: var(--navy); }
.ticket .tk-name { flex: 1; font-weight: 600; font-size: 14px; }
.ticket .tk-note { font-size: 12px; color: var(--danger); font-weight: 600; }
.ticket .tk-opt { font-size: 12px; color: var(--text-dim); }
.ticket .tk-item.done { opacity: .45; text-decoration: line-through; }
.ticket .tk-foot { padding: 8px 12px; display: flex; gap: 6px; border-top: 1px solid var(--border-light); background: #fafafa; }
.ticket .tk-foot .btn { flex: 1; }

/* ─── TABLES FLOOR ─────────────────────────────────────────── */
.floor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.tbl-tile { border: 2px solid var(--border); border-radius: var(--radius-lg); background: #fff; padding: 12px 10px; text-align: center; cursor: pointer; transition: .15s; position: relative; min-height: 104px; display: flex; flex-direction: column; justify-content: center; }
.tbl-tile:hover { box-shadow: var(--shadow-md); }
.tbl-tile .tt-num { font-size: 22px; font-weight: 800; }
.tbl-tile .tt-meta { font-size: 11px; color: var(--text-dim); }
.tbl-tile .tt-amt { font-size: 13px; font-weight: 700; margin-top: 4px; }
.tbl-tile.free { border-color: var(--success); background: #f3fbf8; }
.tbl-tile.occupied { border-color: var(--orange); background: #fff8ec; }
.tbl-tile.reserved { border-color: var(--purple); background: #f8f3ff; }
.tbl-tile.cleaning { border-color: #999; background: #f3f3f3; }
.tbl-tile .tt-st { position: absolute; top: 6px; right: 8px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.tbl-tile.free .tt-st { color: var(--success); } .tbl-tile.occupied .tt-st { color: var(--orange-hover); } .tbl-tile.reserved .tt-st { color: var(--purple); }
.tbl-tile .tt-call { position: absolute; top: 6px; left: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 10px; animation: pulse 1.5s infinite; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend .l-free::before { background: var(--success); } .legend .l-occ::before { background: var(--orange); } .legend .l-res::before { background: var(--purple); } .legend .l-cln::before { background: #999; }

/* ─── CHARTS (CSS only) ────────────────────────────────────── */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 10px; }
.bars .bar { flex: 1; background: var(--teal); border-radius: 3px 3px 0 0; position: relative; min-width: 6px; opacity: .85; }
.bars .bar:hover { opacity: 1; }
.bars .bar .v { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 700; color: var(--text-dim); white-space: nowrap; margin-bottom: 2px; }
.bars-lbl { display: flex; gap: 4px; font-size: 10px; color: var(--text-dim); margin-top: 4px; }
.bars-lbl span { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; }
.hbar { display: grid; grid-template-columns: 140px 1fr 70px; gap: 8px; align-items: center; font-size: 12px; padding: 4px 0; }
.hbar .track { background: #eee; border-radius: 4px; height: 10px; overflow: hidden; }
.hbar .fill { background: var(--orange); height: 100%; border-radius: 4px; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hbar .val { text-align: right; font-weight: 700; }

/* ─── MISC ─────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-0 { margin-bottom: 0 !important; }
.text-dim { color: var(--text-dim); } .text-danger { color: var(--danger); } .text-success { color: var(--success); } .text-teal { color: var(--teal); } .text-right { text-align: right; } .text-center { text-align: center; }
.fw600 { font-weight: 600; } .fw700 { font-weight: 700; } .fw800 { font-weight: 800; } .small { font-size: 12px; } .tiny { font-size: 11px; } .mono { font-family: 'SF Mono', Consolas, monospace; }
.strike { text-decoration: line-through; color: var(--danger); }
.hide { display: none !important; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--teal); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }
.thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: #eee; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--border-light); font-size: 12px; color: var(--text-dim); flex-wrap: wrap; gap: 8px; }
.pagination-btns { display: flex; gap: 4px; }
.pagination-btns button { padding: 5px 11px; border: 1px solid var(--border); background: #fff; border-radius: var(--radius-sm); font-size: 12px; }
.pagination-btns button.active { background: var(--teal); color: #fff; border-color: var(--teal); }
.pagination-btns button:disabled { opacity: .4; }
.loading-center { display: flex; justify-content: center; align-items: center; min-height: 160px; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; }
.qr-box { background: #fff; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); display: inline-block; }
.qr-box canvas, .qr-box img { display: block; }
.copy-field { display: flex; gap: 6px; } .copy-field .form-control { font-size: 12px; font-family: monospace; }
.sticky-save { position: sticky; bottom: 12px; z-index: 10; display: flex; justify-content: center; }
.sticky-save .btn { box-shadow: var(--shadow-lg); }
.star { color: #f5a623; letter-spacing: 1px; }
.hours-row { display: grid; grid-template-columns: 56px 1fr 1fr auto; gap: 8px; align-items: center; padding: 5px 0; }
.sortable-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-light); border-radius: 6px; background: #fff; margin-bottom: 6px; }
.sortable-row .drag { cursor: grab; color: #aaa; font-size: 18px; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px) } to { opacity: 1; transform: translateY(0) } }
@keyframes slideRight { from { opacity: 0; transform: translateX(30px) } to { opacity: 1; transform: translateX(0) } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(0,130,150,.35) } 50% { box-shadow: 0 0 0 7px rgba(0,130,150,0) } }
@keyframes blinkBorder { 50% { border-top-color: #ffb3b3 } }
.fade-in { animation: fadeIn .25s; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: #c5c5c5; border-radius: 4px; }

/* ─── PRINT (bills / KOT) ──────────────────────────────────── */
.print-only { display: none; }
@media print {
    body { background: #fff; }
    .top-header, .sub-nav, .app-footer, .toast-container, .no-print, .page-actions { display: none !important; }
    .page-wrap { padding: 0; max-width: none; }
    .print-only { display: block; }
    .modal-overlay { position: static; background: none; padding: 0; } .modal-box { box-shadow: none; max-height: none; width: 100% !important; }
    .modal-header, .modal-footer { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .pos-layout { grid-template-columns: 1fr 320px; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
}
/* Tablet */
@media (max-width: 900px) {
    .top-header-store .store-name { max-width: 140px; }
    .grid-2-1, .grid-3 { grid-template-columns: 1fr; }
    .hbar { grid-template-columns: 100px 1fr 60px; }
    /* POS: cart becomes a bottom sheet */
    .pos-layout { grid-template-columns: 1fr; }
    .pos-cart { position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 82vh; border-radius: 16px 16px 0 0; transform: translateY(100%); transition: transform .25s; z-index: 400; box-shadow: 0 -6px 30px rgba(0,0,0,.25); }
    .pos-cart.open { transform: translateY(0); }
    .pos-cart-fab { display: flex; position: fixed; bottom: 14px; left: 14px; right: 14px; z-index: 390; justify-content: space-between; align-items: center; background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 700; border: none; font-size: 14px; }
    .pos-cart-fab .fab-badge { background: var(--orange); color: var(--navy-dark); border-radius: 12px; padding: 2px 9px; font-size: 12px; }
}
/* Phone */
@media (max-width: 768px) {
    :root { --hdr-h: 52px; }
    .top-header { padding: 0 10px; gap: 8px; }
    .top-header-brand h1 { font-size: 17px; } .brand-icon { width: 26px; height: 26px; }
    .top-header-store { padding-left: 8px; }
    .top-header-store .store-name { display: none; }
    .top-header-user .user-info { display: none; }
    .btn-logout-header .hdr-txt, .btn-hdr .hdr-txt { display: none; }
    .btn-logout-header .hdr-ico { display: block; }
    .btn-logout-header { padding: 6px 8px; }
    .sub-nav a { padding: 10px 11px; font-size: 12px; }
    .page-wrap { padding: 10px 10px 24px; }
    .page-title-bar h2 { font-size: 18px; }
    .card-header { padding: 10px 12px; } .card-body { padding: 12px; }
    .form-row, .form-row-3, .grid-2 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card-value { font-size: 20px; }
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal-box { width: 100% !important; max-height: 94vh; border-radius: 16px 16px 0 0; }
    .modal-header { border-radius: 16px 16px 0 0; } .modal-footer { border-radius: 0; }
    .modal-body { padding: 14px; }
    .toast-container { right: 10px; left: 10px; }
    .tbl thead th { padding: 8px; font-size: 10px; } .tbl tbody td { padding: 8px; font-size: 12px; }
    /* Stacked tables: rows become cards when the table carries .tbl-stack */
    .tbl-stack thead { display: none; }
    .tbl-stack, .tbl-stack tbody, .tbl-stack tr, .tbl-stack td { display: block; width: 100%; }
    .tbl-stack tr { border: 1px solid var(--border-light); border-radius: 8px; margin-bottom: 8px; padding: 6px 10px; background: #fff; }
    .tbl-stack td { border: none; padding: 4px 0; display: flex; justify-content: space-between; gap: 10px; text-align: right; }
    .tbl-stack td::before { content: attr(data-l); font-weight: 700; color: var(--text-dim); font-size: 11px; text-transform: uppercase; text-align: left; }
    .tbl-stack td.num { text-align: right; }
    .tbl-stack td.no-l::before { display: none; } .tbl-stack td.no-l { justify-content: flex-start; text-align: left; }
    .progress-label { font-size: 8px; }
    .order-progress { padding: 4px 0; }
    .hours-row { grid-template-columns: 48px 1fr 1fr auto; gap: 4px; }
    .pgrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
    .floor-grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 8px; }
    .kds-grid { grid-template-columns: 1fr; }
    .pos-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .pagination { justify-content: center; }
    .toolbar .form-control { width: 100%; }
    .btn-lg { min-height: 46px; }
    .hbar { grid-template-columns: 90px 1fr 56px; }
}
@media (max-width: 420px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .pgrid { grid-template-columns: 1fr 1fr; }
    .page-actions .btn { flex: 1; }
}
@media (hover: none) and (pointer: coarse) {
    .btn { min-height: 40px; } .btn-sm { min-height: 34px; } .btn-xs { min-height: 30px; }
    .form-control { font-size: 16px; } /* no iOS zoom */
    .tbl tbody tr:hover { background: transparent; }
    .sub-nav a { min-height: 44px; }
    .qty button { width: 36px; height: 36px; }
}
