/* Tulasi Mane — admin panel */
:root {
  --bg: #f6f1e7;
  --panel: #fffdf8;
  --ink: #2b1d14;
  --ink-2: #5a4636;
  --ink-3: #8a7461;
  --line: #e8dcc8;
  --line-2: #f0e7d7;
  --leaf: #23402a;
  --leaf-2: #2f5636;
  --leaf-soft: #e3ecdc;
  --gold: #d4952a;
  --gold-soft: #f8e9c9;
  --red: #b0392b;
  --red-soft: #f8e1dc;
  --blue: #2e5f8a;
  --blue-soft: #e1ecf5;
  --veg: #1f8a3b;
  --nonveg: #a5281b;
  --shadow: 0 1px 2px rgba(43, 29, 20, .05), 0 6px 18px -10px rgba(43, 29, 20, .2);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; }
p { margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* ---------- Buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--leaf); border-color: var(--leaf); color: #fff8ea; }
.btn.primary:hover { background: var(--leaf-2); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; height: 44px; }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn { width: 34px; height: 34px; padding: 0; }

.fld { display: flex; flex-direction: column; gap: 5px; }
.fld > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.fld input, .fld select, .fld textarea, .input { height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 12px; width: 100%; }
.fld textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 149, 42, .18); }
.fld .hint { font-size: 12px; color: var(--ink-3); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.span2 { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--leaf); }

.toggle { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; user-select: none; }
.toggle input { appearance: none; -webkit-appearance: none; margin: 0; width: 38px; height: 22px; border-radius: 999px; background: #dccfb9; position: relative; cursor: pointer; transition: background .2s; flex: none; }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.toggle input:checked { background: var(--leaf-2); }
.toggle input:checked::after { transform: translateX(16px); }
.toggle.gold input:checked { background: var(--gold); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #fff7e6, transparent 50%), var(--bg); }
.login-card { width: min(400px, 100%); background: var(--panel); border-radius: 22px; padding: 34px; box-shadow: 0 30px 60px -30px rgba(43, 29, 20, .4); display: grid; gap: 14px; }
.login-card h1 { font-size: 28px; }
.error { color: var(--red); font-size: 14px; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--leaf); color: #e9e2cf; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 20px; }
.side-brand b { font-family: var(--serif); font-size: 19px; font-weight: 600; color: #fff8ea; display: block; line-height: 1.1; }
.side-brand span { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 500; color: #d9d2bf; }
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav a.active { background: rgba(255, 255, 255, .12); color: #fff; }
.side-nav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side-nav em { margin-left: auto; font-style: normal; background: var(--gold); color: var(--ink); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.side-foot { margin-top: auto; display: grid; gap: 2px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .1); }
.side-link { text-align: left; background: none; border: 0; color: #d9d2bf; padding: 8px 12px; border-radius: 8px; cursor: pointer; text-decoration: none; font-size: 14px; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-foot .muted { color: #9fae99; padding: 6px 12px 0; overflow: hidden; text-overflow: ellipsis; }

.main { padding: 26px 32px 60px; min-width: 0; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.top h1 { font-size: 32px; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Cards, KPIs ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.card-head h2 { font-size: 19px; }
.card-body { padding: 18px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; }
.kpi span { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.kpi b { display: block; font-family: var(--serif); font-size: 34px; font-weight: 500; line-height: 1.1; margin-top: 4px; }
.kpi small { color: var(--ink-2); font-size: 13px; }
.dash { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }
/* Grid children default to min-width:auto, which lets one-line ellipsis text widen the column. */
.dash > *, .stack > *, .row .who { min-width: 0; }
.empty { padding: 28px 18px; text-align: center; color: var(--ink-3); }

/* ---------- Lists ---------- */
.rows { display: grid; }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.row:last-child { border-bottom: 0; }
.row:hover { background: #fffaf0; }
.row .when { text-align: center; min-width: 56px; }
.row .when b { display: block; font-size: 16px; font-weight: 700; }
.row .when span { font-size: 12px; color: var(--ink-3); }
.row .who b { font-weight: 600; }
.row .who p { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .right { display: flex; align-items: center; gap: 8px; }
.unread { box-shadow: inset 3px 0 0 var(--gold); }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.new { background: var(--gold-soft); color: #7a4f08; }
.pill.confirmed { background: var(--leaf-soft); color: var(--leaf); }
.pill.completed { background: #ece7de; color: var(--ink-2); }
.pill.cancelled { background: var(--red-soft); color: var(--red); }
.pill.type { background: var(--blue-soft); color: var(--blue); }

/* ---------- Filters bar ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.seg { display: inline-flex; background: var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.seg button em { font-style: normal; color: var(--ink-3); font-weight: 500; margin-left: 3px; }
.filters .input { width: auto; height: 36px; }
.filters .search { flex: 1; min-width: 180px; }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbf7ef; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: #fffaf0; }
.tbl .sub { font-size: 13px; color: var(--ink-3); }

/* ---------- Menu manager ---------- */
.menu-wrap { display: grid; grid-template-columns: 230px 1fr; gap: 18px; align-items: start; }
.cats { position: sticky; top: 20px; }
.cats button.cat { display: flex; justify-content: space-between; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.cats button.cat:hover { background: var(--line-2); }
.cats button.cat.on { background: var(--leaf); color: #fff8ea; }
.cats button.cat em { font-style: normal; opacity: .7; font-weight: 500; }
.item-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.item-row:last-child { border-bottom: 0; }
.item-row img, .item-row .noimg { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--line-2); }
.item-row.off img { filter: grayscale(1); opacity: .6; }
.item-row h3 { font-family: var(--sans); font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.item-row .meta { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.item-toggles { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.mark { display: inline-grid; place-items: center; width: 14px; height: 14px; border: 1.5px solid var(--veg); border-radius: 3px; flex: none; }
.mark::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--veg); }
.mark.nv { border-color: var(--nonveg); }
.mark.nv::after { background: var(--nonveg); border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }

/* ---------- Outlets / gallery ---------- */
.outlet-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.outlet-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px 16px 0 0; display: block; }
.outlet-card .card-body { display: grid; gap: 10px; }
.outlet-card h3 { font-size: 19px; }
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.gal-item { overflow: hidden; }
.gal-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.gal-item .card-body { padding: 10px; display: grid; gap: 8px; }
.gal-item .acts { display: flex; gap: 4px; justify-content: space-between; }
.drop { border: 2px dashed var(--line); border-radius: 14px; padding: 22px; text-align: center; color: var(--ink-3); cursor: pointer; transition: border-color .15s, background .15s; display: grid; place-items: center; min-height: 160px; }
.drop:hover, .drop.over { border-color: var(--gold); background: #fffaf0; color: var(--ink-2); }

/* ---------- Image picker ---------- */
.img-pick { display: flex; gap: 14px; align-items: center; }
.img-pick img, .img-pick .ph { width: 120px; height: 90px; border-radius: 12px; object-fit: cover; background: var(--line-2); flex: none; border: 1px solid var(--line); }

/* ---------- Settings ---------- */
.settings { display: grid; gap: 18px; max-width: 920px; }
.settings .card-body { display: grid; gap: 14px; }
.repeater { display: grid; gap: 10px; }
.rep-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: #fffaf2; }
.rep-row .grid2, .rep-row .grid3 { gap: 10px; }
.save-bar { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; gap: 10px; padding: 12px; background: rgba(255, 253, 248, .95); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .3); backdrop-filter: blur(8px); }

/* ---------- Sheet (side drawer / modal) ---------- */
dialog.sheet { border: 0; padding: 0; margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(560px, 100vw); max-width: 100vw; background: var(--panel); color: var(--ink); box-shadow: -20px 0 50px -20px rgba(0, 0, 0, .35); }
dialog.sheet[open] { animation: slideIn .22s ease-out; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
dialog.sheet::backdrop { background: rgba(30, 22, 14, .45); }
.sheet-inner { display: flex; flex-direction: column; height: 100%; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line-2); }
.sheet-head h2 { font-size: 24px; }
.sheet-body { padding: 20px 22px; overflow: auto; flex: 1; display: grid; gap: 16px; align-content: start; }
.sheet-foot { display: flex; gap: 8px; justify-content: space-between; padding: 14px 22px; border-top: 1px solid var(--line-2); background: #fbf7ef; flex-wrap: wrap; }
.sheet-foot .r { display: flex; gap: 8px; margin-left: auto; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--ink-3); font-weight: 600; }
.kv dd { margin: 0; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.msg { background: #fbf6ec; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; font-size: 14px; white-space: pre-wrap; }
.status-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.status-btns button.on { background: var(--ink); color: #fff8ea; border-color: var(--ink); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: var(--ink); color: #fff8ea; padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--red); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; align-items: center; padding: 8px 10px; gap: 8px; overflow-x: auto; scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .side-brand { padding: 0 6px 0 0; }
  .side-brand div { display: none; }
  .side-nav { display: flex; gap: 2px; }
  .side-nav a { padding: 8px 10px; white-space: nowrap; font-size: 14px; gap: 6px; }
  .side-nav a span { display: none; }
  .side-nav a.active span { display: inline; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; }
  .side-foot .muted, .side-foot #reset-demo, .side-foot #site-link { display: none; }
  .side-link { white-space: nowrap; }
  .main { padding: 18px 14px 80px; }
  .top h1 { font-size: 26px; }
  .menu-wrap { grid-template-columns: 1fr; }
  .cats { position: static; display: flex; overflow-x: auto; gap: 4px; padding: 6px !important; }
  .cats .card-head { display: none; }
  .cats button.cat { width: auto; white-space: nowrap; gap: 6px; }
  .tbl thead { display: none; }
  .tbl tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
  .tbl td { border: 0; padding: 2px 0; }
  .tbl td.hide-sm { display: none; }
  .item-row { grid-template-columns: 52px 1fr; }
  .item-row img, .item-row .noimg { width: 52px; height: 52px; }
  .item-toggles { grid-column: 1 / -1; justify-content: flex-start; gap: 14px; }
}
@media (max-width: 560px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .kpi b { font-size: 28px; }
  .row { grid-template-columns: auto 1fr; }
  .row .right { grid-column: 2; }
  .filters .search { min-width: 100%; }
}
