/* لوحة الإدارة: نفس الألوان والخطوط، بس أهدى وأكثف لأنها أداة شغل */
body.admin::before { display: none; }
body.admin { background: var(--ink); }

.login { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: var(--gut); }
.login-card { width: min(380px, 100%); display: grid; gap: 16px; text-align: center; }
.login-mark { margin: 0; font-family: var(--f-display); font-weight: 900; font-size: 84px; line-height: 1; }
.login-sub { margin: -6px 0 12px; font-family: var(--f-accent); color: var(--brass); font-size: 22px; }
.login-card .field { text-align: start; }
.login-card input { text-align: center !important; font-size: 24px; letter-spacing: .4em; }
.login-back { color: var(--muted); font-size: 14px; }

.a-top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 12px var(--gut);
  background: rgba(20,17,15,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 4px; margin-inline-start: auto; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid transparent;
  background: none; color: var(--muted); cursor: pointer; white-space: nowrap; font-size: 15px;
}
.tabs button[aria-selected="true"] { background: var(--ink-3); color: var(--bone); border-color: var(--line); }
.a-main { max-width: 1100px; margin: 0 auto; padding: 28px var(--gut) 80px; }
.demo-note { margin: 0 0 20px; padding: 12px 16px; border-radius: var(--r-sm); background: #2b2217; border: 1px solid rgba(201,162,92,.35); color: #e9d6b0; font-size: 14px; }
.panel h2 { font-family: var(--f-display); font-weight: 800; font-size: 28px; margin: 0; }
.panel-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 8px; }
.hint { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.sub-h { font-family: var(--f-display); font-weight: 600; font-size: 19px; margin: 36px 0 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: end; margin-top: 20px; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%);
  background-position: 18px 22px, 12px 22px; background-size: 6px 6px; background-repeat: no-repeat; }
.field input[type="date"], .field input[type="time"] { color-scheme: dark; }

/* إحصائيات */
.stats { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin-bottom: 26px; }
.stat { border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; background: var(--ink-2); }
.stat:first-child { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.stat:first-child small { color: #6b6358; }
.stat small { display: block; color: var(--muted); font-size: 13px; }
.stat b { font-family: var(--f-display); font-weight: 800; font-size: 30px; line-height: 1.3; }
.stat span { display: block; font-size: 13px; color: var(--muted); }
.stat:first-child span { color: #6b6358; }

/* شريط اليوم */
.day-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.day-bar-mid { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; justify-content: center; }
.day-bar h2 { font-size: 22px; }
.day-bar input[type="date"] { height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--ink-2); padding: 0 8px; color-scheme: dark; }

/* الأجندة */
.agenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ag {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 16px; align-items: center; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--ink-2); border-inline-start: 3px solid var(--brass);
}
.ag.done { border-inline-start-color: #6fbf73; }
.ag.no_show, .ag.cancelled { opacity: .5; border-inline-start-color: var(--red); }
.ag.cancelled .ag-who b { text-decoration: line-through; }
.ag.blocked { border-inline-start-color: var(--muted); background: repeating-linear-gradient(-45deg, var(--ink-2) 0 10px, var(--ink) 10px 20px); }
.ag.gap { border-style: dashed; border-inline-start: 1px dashed var(--line); background: none; padding: 8px 16px; color: var(--muted); font-size: 14px; grid-template-columns: 92px 1fr; }
.ag-time { font-variant-numeric: tabular-nums; font-weight: 600; line-height: 1.3; }
.ag-time small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.ag-who b { font-weight: 600; }
.ag-who div { color: var(--muted); font-size: 14px; }
.ag-who .tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line-2); margin-inline-start: 6px; color: var(--muted); }
.ag-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: end; }
.ag-actions .icon-btn { width: 36px; height: 36px; text-decoration: none; }
.ag-actions .icon-btn:hover { border-color: var(--bone); }
.ag-actions .ok:hover { background: #6fbf73; border-color: #6fbf73; color: var(--ink); }
.ag-actions .bad:hover { background: var(--red); border-color: var(--red); }
.empty { color: var(--muted); padding: 40px 0; text-align: center; border: 1px dashed var(--line); border-radius: var(--r); }

/* الخدمات */
.svc-list { display: grid; gap: 10px; }
.svc-row {
  display: grid; grid-template-columns: 1.3fr 1.8fr 110px 110px auto; gap: 10px; align-items: end; padding: 14px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--ink-2);
}
.svc-row.off { opacity: .55; }
.svc-row .field input { height: 44px; }
.price-in { position: relative; }
.price-in::after { content: '₪'; position: absolute; left: 12px; bottom: 11px; color: var(--brass); pointer-events: none; }
.svc-row-actions { display: flex; gap: 6px; align-items: center; height: 44px; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.switch input { accent-color: var(--brass); width: 18px; height: 18px; }

/* الدوام */
.hours-edit { display: grid; gap: 8px; margin-top: 14px; }
.h-row { display: grid; grid-template-columns: 110px 1fr 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ink-2); }
.h-row.closed input[type="time"] { opacity: .3; }
.h-row input[type="time"] { height: 42px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--ink); padding: 0 10px; color-scheme: dark; width: 100%; }
.daysoff-add { display: flex; gap: 10px; flex-wrap: wrap; }
.daysoff-add input { height: 42px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--ink-2); padding: 0 10px; color-scheme: dark; }
.daysoff { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.daysoff li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 14px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 14px; }
.daysoff button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--ink-3); cursor: pointer; display: grid; place-items: center; }

/* الصور */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.photo-grid figure { margin: 0; position: relative; aspect-ratio: 3/4; border-radius: var(--r-sm); overflow: hidden; background: var(--ink-2); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid figcaption { position: absolute; inset: auto 0 0; padding: 20px 10px 8px; font-size: 13px; background: linear-gradient(transparent, rgba(12,10,9,.85)); }
.photo-grid .icon-btn { position: absolute; top: 8px; left: 8px; background: rgba(20,17,15,.8); }

/* نافذة الحجز اليدوي */
.a-dlg { border: 0; padding: 0; background: transparent; color: var(--bone); width: min(560px, calc(100vw - 24px)); }
.a-dlg::backdrop { background: rgba(10,8,7,.75); backdrop-filter: blur(4px); }
.a-dlg-in { background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 18px; padding: 24px; display: grid; gap: 16px; }
.a-dlg h3 { margin: 0; font-family: var(--f-display); font-size: 22px; }
.a-dlg-actions { display: flex; gap: 10px; justify-content: end; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; border: 1px solid var(--line-2); width: max-content; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 6px 16px; border-radius: 999px; font-size: 14px; color: var(--muted); }
.seg input:checked + span { background: var(--bone); color: var(--ink); }
.seg input:focus-visible + span { outline: 2px solid var(--brass); }
.a-dlg.is-blocked [data-only="confirmed"] { display: none; }

.toast {
  position: fixed; z-index: 90; bottom: 20px; left: 50%; translate: -50% 0; padding: 12px 20px; border-radius: 999px;
  background: var(--bone); color: var(--ink); font-weight: 600; box-shadow: 0 16px 40px rgba(0,0,0,.4); animation: pop .4s var(--ease-out);
}
.toast.err { background: #f09a8f; }

@media (max-width: 820px) {
  .a-top { flex-wrap: wrap; }
  .tabs { order: 3; width: 100%; margin: 0; }
  .tabs button span { display: inline; }
  #logout { margin-inline-start: auto; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:first-child { grid-column: 1 / -1; }
  .ag { grid-template-columns: 70px 1fr; }
  .ag-actions { grid-column: 1 / -1; justify-content: start; }
  .svc-row { grid-template-columns: 1fr 1fr; }
  .svc-row .field:nth-child(2) { grid-column: 1 / -1; order: 5; }
  .svc-row-actions { grid-column: 1 / -1; order: 6; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .h-row { grid-template-columns: 80px 1fr 1fr; }
  .h-row .switch { grid-column: 1 / -1; }
  .day-bar-mid { order: -1; width: 100%; justify-content: space-between; }
}
