:root {
  --navy: #2f5205; --gold: #7cb518; --bg: #f3f6ef; --card: #fff; --text: #1d2433;
  --muted: #6b7280; --line: #e5e7eb; --ok: #16a34a; --bad: #dc2626; --warn: #d97706;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 Inter, system-ui, sans-serif; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { background: #f9fafb; }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.primary:hover { background: #3e6606; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.danger { color: var(--bad); border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), #5b8a12); padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 18px; padding: 32px 28px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-card h1 { margin: 12px 0 4px; font-size: 22px; }
.login-card p { color: var(--muted); margin: 0 0 18px; }
.login-card .f { text-align: left; }
.brand-mark { width: 54px; height: 54px; border-radius: 14px; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-size: 26px; margin: 0 auto; }
.brand-mark.sm { width: 32px; height: 32px; font-size: 16px; border-radius: 9px; margin: 0; }
.err { color: var(--bad) !important; min-height: 20px; margin: 10px 0 0 !important; }
.muted-link { color: var(--muted); font-size: 13px; text-decoration: none; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.side { width: 240px; flex: none; background: var(--navy); color: #cfd6e6; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-head { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav { flex: 1; overflow-y: auto; padding: 10px; }
nav button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; color: inherit; border-radius: 8px; cursor: pointer; text-align: left; font-weight: 500; }
nav button:hover { background: rgba(255,255,255,.06); color: #fff; }
nav button.on { background: var(--gold); color: var(--navy); font-weight: 700; }
nav .badge { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 99px; }
nav button.on .badge { background: var(--navy); }
.side-foot { padding: 12px; display: grid; gap: 8px; }
.side-foot .btn { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.12); }

.main { flex: 1; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: rgba(244,245,248,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 19px; margin: 0; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.dirty { color: var(--warn); font-size: 13px; font-weight: 600; }
.menu-btn { display: none; border: 0; background: #fff; border-radius: 8px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; }
.content { padding: 24px; max-width: 1100px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 18px; }
.card h2 { font-size: 16px; margin: 0 0 4px; }
.card .hint { color: var(--muted); margin: 0 0 16px; font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }

.f { display: block; margin-bottom: 14px; }
.f > span { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.f small { color: var(--muted); font-weight: 400; }
.f input:not([type=checkbox]):not([type=color]), .f select, .f textarea { width: 100%; padding: 9px 11px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; outline: none; }
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(124,181,24,.18); }
.f textarea { min-height: 90px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; cursor: pointer; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--navy); }

.img-field { display: flex; gap: 12px; align-items: center; }
.img-field .preview { width: 72px; height: 72px; border-radius: 10px; border: 1px dashed #cbd5e1; background: #f8fafc center/cover no-repeat; flex: none; }
.img-field .preview.wide { width: 140px; }
.img-field .col { flex: 1; display: grid; gap: 6px; min-width: 0; }

.list-edit .row { display: flex; gap: 8px; margin-bottom: 8px; }
.list-edit .row input { flex: 1; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; min-width: 0; }

.stats-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.stat-card small { color: var(--muted); font-weight: 600; }
.stat-card b { display: block; font-size: 28px; color: var(--navy); }

table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px; border-bottom: 1px solid var(--line); }
.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t tr:last-child td { border: 0; }
.t .thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: #f3f4f6; }
.t .actions { white-space: nowrap; text-align: right; }
.t .actions .btn { margin-left: 4px; }
.table-wrap { overflow-x: auto; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.pill.ok { background: #dcfce7; color: var(--ok); } .pill.warn { background: #fef3c7; color: var(--warn); }
.pill.bad { background: #fee2e2; color: var(--bad); } .pill.mute { background: #f3f4f6; color: var(--muted); }
.stars { color: var(--gold); }

.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.gal-item { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: #f3f4f6; }
.gal-item img { width: 100%; height: 100%; object-fit: cover; }
.gal-item .ops { position: absolute; inset: auto 6px 6px 6px; display: flex; gap: 4px; justify-content: flex-end; }
.gal-item .ops button { border: 0; background: rgba(255,255,255,.95); border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 12px; font-weight: 600; }
.upload-tile { border: 2px dashed #cbd5e1; border-radius: 10px; aspect-ratio: 1; display: grid; place-items: center; cursor: pointer; color: var(--muted); font-weight: 600; text-align: center; background: #fafafa; }
.upload-tile:hover { border-color: var(--gold); color: var(--navy); }

.hours-row { display: grid; grid-template-columns: 110px 90px 1fr 1fr; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.hours-row input[type=time] { padding: 7px; border: 1px solid #d1d5db; border-radius: 8px; width: 100%; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select { padding: 8px 11px; border: 1px solid #d1d5db; border-radius: 8px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.empty { color: var(--muted); text-align: center; padding: 30px; }

.dlg { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.dlg-bg { position: absolute; inset: 0; background: rgba(15,23,42,.5); }
.dlg-card { position: relative; background: #fff; border-radius: 16px; width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; padding: 24px; }
.dlg-card h2 { margin: 0 0 16px; font-size: 18px; }
.dlg-x { position: absolute; top: 10px; right: 12px; border: 0; background: #f3f4f6; width: 32px; height: 32px; border-radius: 50%; font-size: 20px; cursor: pointer; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 99px; opacity: 0; transition: .25s; pointer-events: none; z-index: 200; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); }

.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type=color] { width: 44px; height: 38px; border: 1px solid #d1d5db; border-radius: 8px; padding: 2px; background: #fff; }

@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .25s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .menu-btn { display: block; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .stats-cards { grid-template-columns: 1fr 1fr; }
  .hours-row { grid-template-columns: 1fr 1fr; }
  .t .hide-sm { display: none; }
}
.brand-logo { width: 72px; height: 72px; border-radius: 50%; background: #fff; object-fit: contain; padding: 4px; display: block; margin: 0 auto; }
.brand-logo.sm { width: 34px; height: 34px; padding: 2px; margin: 0; }
nav button.on { color: #fff; }
nav button.on .badge { background: #fff; color: var(--navy); }

/* phone: country dropdown + digits-only number */
.phone-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px; }
.phone-row select { width: 100%; padding: 9px 8px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; }
.phone-num { display: flex; align-items: stretch; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; overflow: hidden; }
.phone-num:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(124,181,24,.18); }
.phone-num .dial { display: grid; place-items: center; padding: 0 10px; background: #f3f6ef; border-right: 1px solid #d1d5db; font-weight: 600; color: var(--navy); white-space: nowrap; }
.phone-num input { flex: 1; min-width: 0; border: 0 !important; box-shadow: none !important; padding: 9px 11px; outline: none; letter-spacing: .04em; }
.phone-row.invalid .phone-num { border-color: var(--bad); }
.phone-hint { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }
.phone-hint.ok { color: var(--ok); }
.phone-hint.bad { color: var(--bad); font-weight: 600; }
@media (max-width: 520px) { .phone-row { grid-template-columns: minmax(0, 1fr); } }

/* product photos */
.pimgs { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)) !important; }
.pimgs .gal-item .ops { inset: auto 4px 4px 4px; gap: 3px; flex-wrap: wrap; }
.pimgs .gal-item .ops button { padding: 3px 6px; }
.main-badge { position: absolute; top: 5px; left: 5px; background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.gal-item.uploading { display: grid; place-items: center; align-content: center; gap: 6px; border: 2px dashed var(--gold); color: var(--muted); }
.spin { width: 26px; height: 26px; border: 3px solid #dfe8cf; border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.upload-tile small { font-size: 12px; font-weight: 600; }

/* editable lists (order steps, FAQ) */
.list-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fbfcf9; }
.list-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; margin-top: 5px; }
.list-fields { flex: 1; min-width: 0; display: grid; gap: 6px; }
.list-fields input, .list-fields textarea { width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; resize: vertical; }
.list-fields input { font-weight: 600; }
.list-ops { display: flex; gap: 4px; flex: none; }
.card h2 .pill { margin-left: 8px; vertical-align: middle; font-size: 11px; }
@media (max-width: 600px) { .list-row { flex-wrap: wrap; } .list-ops { width: 100%; justify-content: flex-end; } }

/* master "log in as client" banner */
.imp-banner { background: #fff3cd; color: #6b4e00; padding: 9px 24px; font-size: 13px; border-bottom: 1px solid #f0d98a; }
.imp-banner a { color: #6b4e00; font-weight: 700; margin-left: 8px; }
