/* EqlazBook — shared stylesheet. Only the accent differs between editions (data-theme). */
:root {
  --accent: #0f766e;
  --accent-700: color-mix(in srgb, var(--accent) 78%, black);
  --accent-900: color-mix(in srgb, var(--accent) 45%, black);
  --accent-100: color-mix(in srgb, var(--accent) 16%, white);
  --accent-50: color-mix(in srgb, var(--accent) 7%, white);
  --bg: #f3f5f8; --surface: #fff; --text: #1e293b; --muted: #64748b; --border: #e2e8f0;
  --danger: #dc2626; --ok: #16a34a; --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 14px rgba(15, 23, 42, .05);
  --header-h: 56px; --topbar-h: 48px; --sb-w: 250px; --sb-w-c: 68px;
  --sidebar-bg: #111827; --sidebar-text: #cbd5e1;
}
[data-theme="indigo"] { --accent: #4f46e5; }
[data-theme="teal"] { --accent: #0f766e; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent-700); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.1rem; }
.muted { color: var(--muted); }
.icon { flex: none; vertical-align: middle; }

/* ---------- Header ---------- */
.app-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); display: flex; align-items: center; gap: .75rem; padding: 0 1rem; color: #fff;
  background: linear-gradient(100deg, var(--accent-900), var(--accent)); }
.brand { display: flex; align-items: center; gap: .65rem; color: inherit; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; }
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: .2px; }
.brand-tag { font-size: .78rem; opacity: .8; line-height: 1; }
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.header-spacer { flex: 1; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: var(--header-h); z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: .6rem; padding: 0 1rem;
  background: var(--surface); border-bottom: 1px solid var(--border); }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; cursor: pointer; color: var(--text); }
.icon-btn:hover { background: var(--accent-50); border-color: var(--accent-100); }
.crumb { font-weight: 600; }
.topbar .spacer { flex: 1; }
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.lang-switch a { padding: .28rem .6rem; font-size: .8rem; font-weight: 600; text-decoration: none; color: var(--muted); }
.lang-switch a.on { background: var(--accent); color: #fff; }
.user-chip { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-100); color: var(--accent-700); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.user-chip .who { line-height: 1.1; } .user-chip small { color: var(--muted); display: block; font-size: .72rem; }

/* ---------- Shell / sidebar ---------- */
.shell { flex: 1; display: flex; align-items: stretch; min-width: 0; }
.sidebar { width: var(--sb-w); flex: none; background: var(--sidebar-bg); color: var(--sidebar-text); padding: .8rem .6rem; transition: width .2s ease;
  overflow-x: hidden; }
.sb-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: .9rem .75rem .3rem; white-space: nowrap; }
.sb-link { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-radius: 8px; color: inherit; text-decoration: none; white-space: nowrap; margin-bottom: 2px; }
.sb-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sb-link.active { background: var(--accent); color: #fff; }
body.sb-collapsed .sidebar { width: var(--sb-w-c); }
body.sb-collapsed .sb-text, body.sb-collapsed .sb-label { display: none; }
body.sb-collapsed .sb-link { justify-content: center; padding-inline: 0; }
.sb-backdrop { display: none; }
.content { flex: 1; min-width: 0; padding: 1rem 1.25rem; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ---------- Footer ---------- */
.app-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: .5rem 1.25rem; font-size: .82rem; color: var(--muted); background: var(--surface); border-top: 1px solid var(--border); }

/* ---------- Generic UI ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 1rem 1.15rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .7rem; }
.page-head p { margin: 0; color: var(--muted); }
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .95rem; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--accent) 28%, white); background: var(--accent-100); color: var(--accent-700);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: color-mix(in srgb, var(--accent) 24%, white); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-700); }
.btn-danger { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.btn-danger:hover { background: #fecaca; }
/* Cancel / Close in dialogs: light grey, clearly different from the page and from the primary action */
.modal-foot .btn:not(.btn-primary):not(.btn-danger) { background: #e5e7eb; border-color: #d1d5db; color: #374151; }
.modal-foot .btn:not(.btn-primary):not(.btn-danger):hover { background: #d1d5db; }
.btn-sm { padding: .3rem .65rem; font-size: .85rem; }
.btn[disabled] { opacity: .6; cursor: wait; }
.field { margin-bottom: .85rem; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .25rem; }
.field input, .field select, .field textarea { width: 100%; padding: .55rem .7rem; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; background: #fff; color: var(--text); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent-100); border-color: var(--accent); }
.field input[type="color"] { padding: .15rem; height: 40px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
/* Badges are read-only labels: neutral slate, no border, lighter weight. Buttons are the accent-tinted, bordered elements. */
.badge { display: inline-block; padding: .1rem .6rem; border-radius: 99px; border: 1px solid transparent; font-size: .75rem; font-weight: 500; background: #e8edf3; color: #475569; cursor: default; }
.badge.off { background: transparent; border: 1px dashed #cbd5e1; color: var(--muted); } .badge.bad { background: #fee2e2; color: var(--danger); } .badge.ok { background: #dcfce7; color: #166534; }
.alert { padding: .65rem .85rem; border-radius: 8px; margin-bottom: .85rem; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; font-size: .9rem; }
.alert.ok { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert { display: flex; align-items: center; gap: .75rem; padding: .4rem .85rem .4rem .6rem; min-height: 46px; }
.alert[hidden] { display: none; }
.alert::before { content: ""; flex: none; align-self: stretch; width: 40px; background: currentColor;
  -webkit-mask: var(--alert-icon) center / contain no-repeat; mask: var(--alert-icon) center / contain no-repeat;
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); }
.alert.ok::before { --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E"); }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: .65rem .85rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f8fafc; }
.tbl tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .4rem; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; }
.room-card { overflow: hidden; } .room-card .strip { height: 6px; }
.room-card .body { padding: 1rem 1.1rem; } .room-card dl { margin: .6rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; font-size: .9rem; }
.room-card dt { color: var(--muted); } .room-card dd { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { padding: 1rem 1.15rem; } .stat b { display: block; font-size: 1.8rem; color: var(--accent-700); } .stat span { color: var(--muted); font-size: .88rem; }
.bar { height: 8px; background: #eef2f6; border-radius: 99px; overflow: hidden; min-width: 120px; } .bar i { display: block; height: 100%; background: var(--accent); }

/* ---------- Calendar ---------- */
.cal-tools { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .32rem .8rem; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; color: var(--text); }
.pill:hover { border-color: var(--accent); }
.pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill .dot { margin: 0; }
.cal-nav { display: flex; align-items: center; gap: .5rem; }
.cal-month { font-size: 1.15rem; font-weight: 700; min-width: 11ch; text-align: center; text-transform: capitalize; }
.cal { overflow: hidden; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: .55rem .5rem; text-align: center; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f8fafc; border-bottom: 1px solid var(--border); }
.cal-cell { min-height: 80px; padding: .25rem .35rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: pointer; background: var(--surface); position: relative; transition: background .12s; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:hover { background: var(--accent-50); }
.cal-cell.other { background: #fafbfc; } .cal-cell.other .num { color: #b6c0cc; }
.cal-cell.weekend:not(.other) { background: #fcfcfd; }
.cal-cell.past .num { color: #94a3b8; }
.cal-cell .num { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 99px; font-size: .85rem; font-weight: 600; }
.cal-cell.today .num { background: var(--accent); color: #fff; }
.chip { display: flex; gap: .35rem; align-items: center; margin-top: 2px; padding: 1px 6px; border-radius: 5px; font-size: .74rem; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--c) 14%, white); border-left: 3px solid var(--c); color: #1e293b; cursor: pointer; border-top: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; font-family: inherit; }
.chip b { font-weight: 700; } .chip.mine { background: color-mix(in srgb, var(--c) 28%, white); } .chip.cancelled { text-decoration: line-through; opacity: .5; }
.chip span { overflow: hidden; text-overflow: ellipsis; }
.more { font-size: .72rem; color: var(--muted); margin-top: 3px; padding-left: 4px; font-weight: 600; }
.cal-loading { opacity: .55; pointer-events: none; }

/* ---------- Modal ---------- */
dialog.modal { border: 0; border-radius: 14px; padding: 0; width: min(520px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); box-shadow: 0 24px 60px rgba(15, 23, 42, .35); color: var(--text); overflow: hidden; }
dialog.modal[open] { display: flex; flex-direction: column; animation: pop .16s ease-out; }
dialog.modal::backdrop { background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; background: linear-gradient(100deg, var(--accent-900), var(--accent)); color: #fff; }
.modal-head h2 { margin: 0; color: #fff; }
.modal-head .x { background: transparent; border: 0; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; opacity: .85; }
.modal-body { padding: 1.1rem 1.2rem; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .85rem 1.2rem; border-top: 1px solid var(--border); background: #f8fafc; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
.checks { max-height: 130px; overflow: auto; border: 1px solid #cbd5e1; border-radius: 8px; padding: .3rem .5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; }
.checks label { display: flex; align-items: center; gap: .4rem; font-weight: 400; font-size: .86rem; margin: 0; padding: .2rem 0; }
.checks input { width: auto; }
.slots { font-size: .84rem; background: var(--accent-50); border: 1px dashed var(--accent-100); border-radius: 8px; padding: .55rem .75rem; margin-bottom: .85rem; }
.slots ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.hint { background: var(--accent-50); border-radius: 8px; padding: .55rem .75rem; font-size: .88rem; margin-bottom: .85rem; }
.demo { font-size: .8rem; color: var(--muted); margin-top: .5rem; } .demo code { background: #f1f5f9; padding: 0 .3rem; border-radius: 4px; }
.detail dl { display: grid; grid-template-columns: 110px 1fr; gap: .45rem .75rem; margin: 0; } .detail dt { color: var(--muted); } .detail dd { margin: 0; }
.toast-wrap { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; display: grid; gap: .5rem; }
.toast { background: #111827; color: #fff; padding: .65rem 1rem; border-radius: 8px; box-shadow: var(--shadow); animation: pop .18s ease-out; max-width: 340px; }
.toast.err { background: var(--danger); } .toast.ok { background: var(--accent-700); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: calc(var(--header-h) + var(--topbar-h)); bottom: 0; height: auto; z-index: 60; width: var(--sb-w) !important; transform: translateX(-100%); transition: transform .2s; }
  body.sb-open .sidebar { transform: none; }
  body.sb-open .sb-backdrop { display: block; position: fixed; inset: calc(var(--header-h) + var(--topbar-h)) 0 0 0; background: rgba(15, 23, 42, .45); z-index: 55; }
  body.sb-collapsed .sb-text, body.sb-collapsed .sb-label { display: initial; }
  body.sb-collapsed .sb-link { justify-content: flex-start; padding-inline: .75rem; }
  .content { padding: .85rem; } .brand-tag, .user-chip .who { display: none; }
}
@media (max-width: 640px) {
  .cal-cell { min-height: 74px; padding: .2rem; } .chip { padding: 1px 3px; font-size: .62rem; } .chip b { display: none; } .more { font-size: .62rem; }
  .cal-head div { padding: .4rem 0; font-size: .65rem; } .checks { grid-template-columns: 1fr; }
}

/* ---------- Long bookings ---------- */
[hidden] { display: none !important; }
.toggle { display: flex; align-items: center; gap: .5rem; margin-bottom: .85rem; font-weight: 600; font-size: .9rem; cursor: pointer; }
.toggle input { width: auto; }
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .85rem; font-size: .85rem; }
.chip.multi { box-shadow: inset 0 -2px 0 var(--c); }

/* ---------- Room photos ---------- */
.room-photo { position: relative; display: block; width: 100%; height: 170px; padding: 0; border: 0; background: #e9eef3; cursor: zoom-in; overflow: hidden; }
.room-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.room-photo:hover img { transform: scale(1.04); }
.photo-count { position: absolute; right: .6rem; bottom: .6rem; display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 99px; background: rgba(15, 23, 42, .72); color: #fff; font-size: .75rem; font-weight: 600; }
.upload-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.upload-form input[type="file"] { padding: .4rem; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.img-tile { margin: 0; padding: .5rem; display: flex; flex-direction: column; gap: .5rem; }
.img-tile img { width: 100%; height: 130px; object-fit: cover; border-radius: 6px; display: block; background: #eef2f6; }
.img-tile form { display: flex; justify-content: flex-end; }
dialog.modal.lightbox { width: min(900px, calc(100vw - 2rem)); }
.lightbox .modal-body { padding: 0; background: #0b1220; display: grid; place-items: center; min-height: 240px; }
.lightbox .modal-body img { max-width: 100%; max-height: calc(100vh - 14rem); display: block; }
.lightbox .modal-foot { align-items: center; }
.lightbox .count { margin-right: auto; color: var(--muted); font-size: .88rem; }

/* ---------- Menu master data ---------- */
.item-picker { max-height: 260px; overflow: auto; border: 1px solid #cbd5e1; border-radius: 8px; padding: .4rem .7rem .6rem; margin-bottom: .3rem; }
.picker-cat { margin: .6rem 0 .2rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-700); }
.item-picker label { display: flex; align-items: center; gap: .5rem; margin: 0; padding: .22rem 0; font-weight: 400; font-size: .9rem; }
.item-picker input { width: auto; }
/* ---------- Required marker (all forms) ---------- */
.field:has(:required) > label::after, th.req::after { content: " *"; color: var(--danger); font-weight: 700; }
.req-note { margin: 0 .35rem 0 0; align-self: center; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.req-note b { color: var(--danger); font-size: 1rem; }
.invalid { border-color: var(--danger) !important; outline: 2px solid #fecaca !important; }

/* ---------- Booking form: diary tabs ---------- */
dialog.modal.wide { width: min(1020px, calc(100vw - 2rem)); }
.tabs { display: flex; gap: 4px; margin: 0 0 .9rem; padding: 0 .15rem; overflow-x: auto; border-bottom: 3px solid var(--accent); }
.tab { --tint: 100%; position: relative; flex: none; display: inline-flex; align-items: center; gap: .45rem; margin-top: 8px; padding: .5rem .95rem .45rem;
  border: 1px solid var(--border); border-top: 4px solid color-mix(in srgb, var(--accent) var(--tint), white); border-bottom: 0; border-radius: 10px 10px 0 0;
  background: var(--accent-50); color: var(--muted); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s; }
.tab:nth-child(2) { --tint: 78%; } .tab:nth-child(3) { --tint: 60%; } .tab:nth-child(4) { --tint: 45%; } .tab:nth-child(5) { --tint: 32%; }
.tab:hover { background: var(--accent-100); color: var(--text); }
.tab.on { margin-top: 0; padding-top: .65rem; background: var(--surface); color: var(--accent-700); border-color: var(--accent); border-top-color: var(--accent); box-shadow: 0 3px 0 var(--surface); z-index: 1; }
.tab-chip { min-width: 1.25rem; padding: 0 .35rem; border-radius: 99px; background: var(--accent); color: #fff; font-size: .72rem; line-height: 1.25rem; text-align: center; }
.line-note { margin: 0 0 .6rem; font-size: .85rem; }
.line-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; margin-bottom: .6rem; }
table.lines { min-width: 760px; }
.lines th { white-space: nowrap; }
.lines td { padding: .35rem .4rem; vertical-align: middle; }
.lines input { width: 100%; padding: .4rem .5rem; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; font-size: .88rem; background: #fff; }
.lines input:focus { outline: 2px solid var(--accent-100); border-color: var(--accent); }
.lines .c-name { min-width: 200px; } .lines .c-quantity { width: 100px; } .lines .c-unit_cost { width: 130px; } .lines .c-extra { width: 140px; }
.lines .c-total { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 90px; }
.line-empty { padding: .2rem .2rem .7rem; font-size: .86rem; }
.line-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.group-sel { padding: .3rem .5rem; border-radius: 8px; font: inherit; font-size: .85rem; }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 6px; }
.modal-foot .cost-box { margin-right: auto; display: grid; gap: .1rem; min-width: 220px; }
.cost-val { font-size: 1.15rem; color: var(--accent-700); }
.cost-break { color: var(--muted); font-size: .75rem; }
.detail-lines { margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed var(--border); font-size: .88rem; }
.detail-lines h3 { font-size: .95rem; }
.detail-lines ul { margin: .2rem 0 .6rem; padding-left: 1.1rem; }
.dl-total { font-weight: 700; color: var(--accent-700); }
@media (max-width: 640px) { .cost-break { display: none; } .modal-foot .cost-box { min-width: 100%; } }

/* ---------- Line tables: full borders, empty state inside the table, button-like group picker ---------- */
table.lines { border-collapse: collapse; }
table.lines th, table.lines td { border: 1px solid var(--border); }
table.lines thead th { background: #f1f5f9; }
table.lines td.muted { padding: 1rem; text-align: center; font-size: .88rem; }
.line-wrap { border: 1px solid var(--border); }
.group-sel { appearance: auto; cursor: pointer; font-weight: 600; }

/* ---------- Toggle (status) and radio groups (2-3 choices) ---------- */
.field .switch { display: inline-flex; align-items: center; gap: .6rem; margin: 0; font-weight: 500; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { position: relative; flex: none; width: 42px; height: 24px; border-radius: 99px; background: #cbd5e1; transition: background .15s; }
.switch .slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .35); transition: transform .15s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::after { transform: translateX(18px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent-100); outline-offset: 2px; }
.switch .on, .switch .off { font-size: .9rem; }
.switch .off { color: var(--muted); } .switch input:checked ~ .off { display: none; }
.switch .on { color: var(--accent-700); font-weight: 600; } .switch input:not(:checked) ~ .on { display: none; }
.radio-group { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; padding: .45rem 0; }
.field .radio { display: inline-flex; align-items: center; gap: .45rem; margin: 0; font-weight: 400; font-size: .92rem; cursor: pointer; }
.radio input { width: auto; margin: 0; accent-color: var(--accent); }

/* ---------- White dropdown list (replaces browser popups in the line tables) ---------- */
.combo-list { position: fixed; z-index: 2000; max-height: 250px; overflow-y: auto; padding: .25rem; background: #fff; color: var(--text);
  border: 1px solid #cbd5e1; border-radius: 8px; box-shadow: 0 10px 30px rgba(15, 23, 42, .22); }
.combo-opt { display: flex; justify-content: space-between; gap: 1rem; padding: .42rem .65rem; border-radius: 6px; font-size: .9rem; cursor: pointer; }
.combo-opt small { color: var(--muted); white-space: nowrap; }
.combo-opt:hover, .combo-opt.on { background: var(--accent-100); color: var(--accent-700); }
input.combo { padding-right: 1.7rem; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .5rem center; }
.btn.has-caret::after { content: ""; width: 0; height: 0; margin-left: .2rem; border: 4px solid transparent; border-top-color: currentColor; border-bottom: 0; }

/* ---------- Pagination ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.1rem; padding: .7rem 1rem; border-top: 1px solid var(--border); background: #f8fafc; font-size: .85rem; border-radius: 0 0 var(--radius) var(--radius); }
.pager .info { margin-right: auto; color: var(--muted); }
.pager .size { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); }
.pager .size select { padding: .25rem .4rem; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; background: #fff; }
.pager .pages { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.pager .pg { min-width: 2rem; justify-content: center; }
.pager .pg[disabled] { opacity: .45; cursor: not-allowed; }
.pager .gap { padding: 0 .25rem; color: var(--muted); }
.pager.mobile { justify-content: center; text-align: center; }
.pager.mobile .info { margin: 0; flex-basis: 100%; }
.pager.mobile .size, .pager.mobile .pages { display: none; }
.pager-sentinel { height: 1px; }

/* ---------- Mobile: compact tables (scroll sideways instead of wrapping) and a tidy topbar ---------- */
.topbar .btn, .topbar .crumb { white-space: nowrap; }
.topbar .crumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) {
  .tbl td, .tbl th { white-space: nowrap; padding: .55rem .7rem; font-size: .88rem; }
  .tbl td small { white-space: normal; }
  .topbar { gap: .4rem; padding: 0 .6rem; }
}

/* Admin photo grid: thumbnails open the lightbox */
.thumb-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 6px; overflow: hidden; }
.thumb-btn img { transition: transform .2s; }
.thumb-btn:hover img { transform: scale(1.04); }

/* ---------- Drag & drop upload ---------- */
.upload-form { display: grid; gap: .9rem; }
.upload-form > .btn { justify-self: end; }
.dz-field { position: relative; }
input.dz-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone { padding: 1.6rem 1rem; border: 2px dashed #94a3b8; border-radius: 12px; background: var(--accent-50); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone:focus-visible, .dropzone.drag { border-color: var(--accent); background: var(--accent-100); outline: none; }
.dropzone.drag { border-style: solid; }
.dz-icon { width: 44px; height: 44px; margin: 0 auto .4rem; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 14.9A7 7 0 1 1 15.7 8h1.8a4.5 4.5 0 0 1 2.5 8.2'/%3E%3Cpath d='M12 12v9M8 16l4-4 4 4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 14.9A7 7 0 1 1 15.7 8h1.8a4.5 4.5 0 0 1 2.5 8.2'/%3E%3Cpath d='M12 12v9M8 16l4-4 4 4'/%3E%3C/svg%3E") center / contain no-repeat; }
.dz-title { font-weight: 700; font-size: 1.02rem; }
.dz-sub { color: var(--muted); font-size: .9rem; }
.dz-sub u { color: var(--accent-700); font-weight: 600; }
.dz-field .alert { margin: .7rem 0 0; }
.dz-count { grid-column: 1 / -1; font-size: .85rem; font-weight: 600; color: var(--accent-700); }
.dz-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-top: .7rem; }
.dz-list:empty { display: none; }
.dz-item { position: relative; display: flex; flex-direction: column; gap: .15rem; padding: .35rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.dz-item img { width: 100%; height: 90px; object-fit: cover; border-radius: 6px; background: #eef2f6; }
.dz-name { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-x { position: absolute; top: .55rem; right: .55rem; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: rgba(15, 23, 42, .75); color: #fff; font-size: 1rem; line-height: 1; cursor: pointer; }
.dz-x:hover { background: var(--danger); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Single image on a form (menu items) ---------- */
.current-image { display: flex; align-items: center; gap: .9rem; margin-bottom: .7rem; padding: .5rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.current-image img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; background: #eef2f6; }
.field .current-image label { display: inline-flex; align-items: center; gap: .45rem; margin: 0; font-weight: 500; font-size: .9rem; cursor: pointer; }
.current-image input { width: auto; accent-color: var(--danger); }
.mi-name { display: flex; align-items: center; gap: .7rem; }
.mi-thumb { flex: none; width: 52px; height: 40px; object-fit: cover; border-radius: 6px; background: #eef2f6; border: 1px solid var(--border); }
.mi-thumb.none { display: grid; place-items: center; color: #94a3b8; }
