/* =====================================================================
   Rezervasyon defteri, hesap ekranı ve müşteri ekranları.
   Anadolu temasının üzerine: köşeli kartlar, petrol/turuncu/hardal.
   ===================================================================== */

/* ---------- Defter başlığı ---------- */
.desk-head { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .6rem; }
.dh-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; }
.dh-title { display: flex; align-items: baseline; gap: .2rem .7rem; flex-wrap: wrap; min-width: 0; }
.dh-title h1 { font-size: clamp(1.3rem, 1.8vw, 1.6rem); line-height: 1.1; }
.dh-title p { color: var(--muted); margin: 0; font-size: .86rem; }
.dh-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Gün şeridi tek satır: gün adı, tarih ve randevu sayısı yan yana. */
.dh-days { display: flex; align-items: center; gap: .35rem; }
.dh-strip { display: grid; grid-template-columns: repeat(7, minmax(46px, 1fr)); gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.dh-strip::-webkit-scrollbar { display: none; }
.dh-strip button { position: relative; display: flex; align-items: baseline; justify-content: center; gap: .35rem; padding: .3rem .3rem; min-height: 36px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; min-width: 46px; }
.dh-strip button small { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.dh-strip button strong { font-size: 1rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dh-strip button i { font-style: normal; font-size: .68rem; font-weight: 800; color: var(--accent); }
.dh-strip button.we { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.dh-strip button.off { background: var(--surface-2); }
.dh-strip button.off strong { color: var(--muted); }
.dh-strip button.today { border-color: var(--accent); }
.dh-strip button.on { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 3px 3px 0 rgba(11,73,71,.25); }
.dh-strip button.on strong { color: #fff; }
.dh-strip button.on small, .dh-strip button.on i { color: var(--yellow); }
.dh-date { width: auto; min-height: 36px; padding-block: .25rem; }
.dh-days .icon-btn { width: 32px; height: 32px; }

.dh-tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-left: auto; }
.dh-tools .segmented button { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem; }
.dh-search { flex: 1 1 220px; max-width: 300px; margin: 0; }
.dh-alert { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }

.desk-found { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .6rem .8rem; background: var(--info-soft); margin-bottom: .8rem; font-size: .88rem; }
.desk-found button { border: 1px solid var(--line-strong); background: var(--surface); font: inherit; padding: .3rem .6rem; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
.desk-found button span { font-weight: 800; color: var(--primary); }

/* ---------- Defter gövdesi ---------- */
.desk { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: .75rem; align-items: start; }
.desk.list-only { grid-template-columns: minmax(0, 860px); }
.desk-side { display: flex; flex-direction: column; gap: .4rem; max-height: calc(100vh - 290px); overflow-y: auto; padding-right: 4px; position: sticky; top: 1rem; }
.desk.list-only .desk-side { max-height: none; position: static; overflow: visible; }
.desk-main { min-width: 0; }
/* Çizelgenin yanındaki liste dar ve sıkıdır: takvim öndedir. Liste görünümünde olağan boyutuna döner. */
.desk:not(.list-only) .bk { grid-template-columns: 40px minmax(0, 1fr); gap: .1rem .45rem; padding: .4rem .5rem; border-left-width: 3px; font-size: .86rem; }
.desk:not(.list-only) .bk-time { font-size: .86rem; }
.desk:not(.list-only) .bk-time small { display: block; font-size: .66rem; }
.desk:not(.list-only) .bk-meta .tag:not(.warn):not(.hot) { display: none; } /* personel, kanal, oda: çizelgede zaten görünür */
.desk:not(.list-only) .bk-meta { margin-top: 1px; }
.desk:not(.list-only) .bk-meta .tag { font-size: .66rem; }
.desk:not(.list-only) .bk-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .74rem; }
.desk:not(.list-only) .bk-act .btn { padding: .2rem .5rem; font-size: .76rem; min-height: 28px; }
.desk:not(.list-only) .bk-group { margin-top: .5rem; font-size: .66rem; }
.desk:not(.list-only) .bk-empty { padding: 1rem .6rem; gap: .35rem; font-size: .86rem; }
.desk-hint { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .8rem; margin-top: .5rem; }

.bk-group { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin: .7rem 0 .15rem; font-size: .72rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; color: var(--primary); border: 0; background: none; padding: 0; font-family: inherit; }
.bk-group span { color: var(--muted); font-weight: 700; letter-spacing: .02em; text-transform: none; font-size: .78rem; }
.bk-group:first-child { margin-top: 0; }
.bk-group.pending { color: var(--warn); }
.bk-group.seated { color: var(--accent); }
.bk-group.done, .bk-group.closed { color: var(--muted); }
button.bk-group { cursor: pointer; justify-content: flex-start; }

.bk { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: .15rem .6rem; align-items: start; padding: .6rem .7rem; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--info); cursor: pointer; transition: box-shadow .12s, border-color .12s; }
.bk:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.bk.sel { box-shadow: 0 0 0 2px var(--primary); }
.bk.pending { border-left-color: var(--warn); }
.bk.confirmed { border-left-color: var(--info); }
.bk.seated { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.bk.completed { border-left-color: var(--ok); opacity: .7; }
.bk.cancelled, .bk.noshow { border-left-color: var(--muted); opacity: .5; }
.bk.late { border-left-color: var(--danger); }
.bk-time { font-weight: 900; font-size: 1.02rem; font-variant-numeric: tabular-nums; line-height: 1.15; }
.bk-time small { font-weight: 600; font-size: .7rem; }
.bk-main { min-width: 0; }
.bk-line { display: flex; align-items: center; gap: .5rem; }
.bk-line strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-party { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; color: var(--primary); font-size: .85rem; white-space: nowrap; }
.bk-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; align-items: center; }
.bk-table { font-size: .78rem; font-weight: 800; color: var(--primary); }
.bk-table.none { color: var(--danger); }
.bk-warn { font-size: .74rem; font-weight: 800; color: var(--danger); }
.bk-note { margin: 4px 0 0; font-size: .8rem; color: var(--ink); background: var(--warn-soft); padding: 2px 6px; }
.bk-act { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: .3rem; }
.bk-act:empty { display: none; }
.desk.list-only .bk { grid-template-columns: 60px minmax(0, 1fr) auto; }
.desk.list-only .bk-act { grid-column: 3; grid-row: 1; margin-top: 0; justify-content: flex-end; }
.bk-act .btn { white-space: nowrap; }
.bk-assign { min-height: 32px; padding: .25rem .4rem; font-size: .78rem; width: 132px; }
.bk-empty { display: flex; flex-direction: column; align-items: center; gap: .45rem; text-align: center; padding: 2rem 1rem; color: var(--muted); border: 1px dashed var(--line-strong); }
.bk-empty strong { color: var(--ink); }

.tag { display: inline-flex; align-items: center; gap: 3px; font-size: .7rem; font-weight: 700; padding: 1px 6px; background: var(--surface-2); color: var(--ink); white-space: nowrap; }
.tag.new { background: var(--info-soft); color: var(--info); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.hot { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.src { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); }

/* ---------- Masa zaman çizelgesi ---------- */
.tl-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); max-height: calc(100vh - 300px); }
.tl { --label: 116px; --row: 46px; position: relative; min-width: calc(var(--label) + var(--mins) * var(--ppm)); }
.tl-head { display: flex; position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line-strong); height: 34px; }
.tl-corner { width: var(--label); flex-shrink: 0; position: sticky; left: 0; background: var(--surface); z-index: 6; font-size: .68rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; padding-left: .7rem; border-right: 1px solid var(--line-strong); }
.tl-hours { position: relative; flex: 1; }
.tl-hours span { position: absolute; top: 0; height: 100%; display: flex; align-items: center; padding-left: 5px; font-size: .74rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; border-left: 1px solid var(--line); }
.tl-now-head { position: absolute; top: 4px; transform: translateX(-50%); background: var(--accent); color: #fff; font-style: normal; font-size: .68rem; font-weight: 800; padding: 1px 5px; z-index: 2; }
.tl-area { display: flex; align-items: baseline; gap: .6rem; position: sticky; left: 0; padding: .45rem .7rem .3rem; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.tl-area small { font-size: .72rem; letter-spacing: 0; text-transform: none; font-weight: 600; }
.tl-row { display: flex; height: var(--row); border-bottom: 1px solid var(--line); }
.tl-row.unassigned { height: calc(var(--lanes) * 40px + 8px); background: color-mix(in srgb, var(--warn) 7%, transparent); }
.tl-row.drop .tl-lane { background-color: color-mix(in srgb, var(--primary) 8%, transparent); }
.tl-label { width: var(--label); flex-shrink: 0; position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: 1px solid var(--line-strong); display: flex; flex-direction: column; justify-content: center; padding: 0 .7rem; }
.tl-label strong { font-size: .95rem; line-height: 1.1; }
.tl-label small { font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-row.unassigned .tl-label strong { color: var(--warn); }
.tl-lane { position: relative; flex: 1; cursor: cell;
  background-image: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px calc(60 * var(--ppm))),
                    repeating-linear-gradient(90deg, color-mix(in srgb, var(--line) 45%, transparent) 0 1px, transparent 1px calc(15 * var(--ppm))); }
.tl-lane:hover { background-color: color-mix(in srgb, var(--primary) 4%, transparent); }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 2; pointer-events: none; }
.tl-block { position: absolute; top: calc(4px + var(--lane, 0) * 40px); height: calc(var(--row) - 8px); max-height: 36px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 0; padding: 0 7px; overflow: hidden; border: 1px solid var(--info); border-left-width: 4px; background: var(--info-soft); color: var(--ink); font: inherit; text-align: left; cursor: grab; z-index: 1; min-width: 20px; }
.tl-block strong { font-size: .8rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tl-block small { display: flex; align-items: center; gap: 4px; font-size: .68rem; font-weight: 700; color: var(--ink); white-space: nowrap; line-height: 1.2; }
.tl-block small span { color: var(--muted); font-weight: 600; }
.tl-block:hover { box-shadow: 3px 3px 0 rgba(11,73,71,.18); z-index: 4; }
.tl-block.pending { border-color: var(--warn); border-style: dashed; border-left-style: solid; background: var(--warn-soft); }
.tl-block.seated { border-color: var(--accent); background: var(--accent); color: #fff; }
.tl-block.seated small, .tl-block.seated small span { color: rgba(255,255,255,.88); }
.tl-block.completed { border-color: var(--ok); background: var(--ok-soft); opacity: .65; cursor: pointer; }
.tl-block.sale { border-color: var(--primary); background: repeating-linear-gradient(135deg, var(--primary) 0 8px, color-mix(in srgb, var(--primary) 88%, #000) 8px 16px); color: #fff; cursor: pointer; }
.tl-block.sale small { color: rgba(255,255,255,.85); }
.tl-block.sale.bill { border-color: var(--accent); background: var(--accent); animation: pulse 1.6s infinite; }
.tl-block.sel { box-shadow: 0 0 0 2px var(--ink); z-index: 4; }
.tl-block.tight::after { content: "!"; position: absolute; top: 2px; right: 4px; font-weight: 900; color: var(--danger); }
.tl.dragging .tl-block, .tl.dragging .tl-now { pointer-events: none; }
.tl.dragging .tl-block { opacity: .75; }

/* Personel gün görünümü: sürüklerken hücreler olayı yutmasın. */
.cal.dragging .cal-cell, .cal.dragging .cal-appt, .cal.dragging .now-line { pointer-events: none; }
.cal-appt.sel { box-shadow: 0 0 0 2px var(--ink); z-index: 4; }
.cal-appt[draggable=true] { cursor: grab; }
.cal-staff .badge { margin-left: auto; }
.cal-staff { min-width: 0; }
.cal-staff .grow { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Kısa randevular tek satır: saat + ad, yanında hizmet (15 dk); 30 dk'da iki satır sıkı. */
.cal-appt { margin-top: 1px; }
.cal-appt.segment-short { display: flex; align-items: center; gap: .35rem; padding: 0 6px; line-height: 1.15; }
.cal-appt.segment-short strong { flex: none; max-width: 100%; font-size: 11.5px; }
.cal-appt.segment-short small { display: block; flex: 1 1 auto; min-width: 0; font-size: 11px; opacity: .8; }
.cal-appt.segment-mid { padding: 2px 7px; line-height: 1.2; }
.cal-appt.segment-mid small { display: block; }
/* Personel renkleri: her sütunun kendi rengi (sütun başındaki şerit + randevular). Palet dataviz doğrulayıcısından geçti
   (açık/koyu zeminde renk körlüğünde ayrışır); yazı her zaman metin renginde kalır, kimlik sütun başındaki addan da okunur.
   Durum renge değil simgeye ve dokuya bağlı: onay bekleyen çizgili, tamamlanan soluk, gelmeyen üstü çizili. */
:root { --st0: #2a78d6; --st1: #eb6834; --st2: #1baf7a; --st3: #eda100; --st4: #e87ba4; --st5: #008300; --st6: #6250d6; --st7: #e34948; }
:root[data-theme="gece"] { --st0: #3987e5; --st1: #d95926; --st2: #199e70; --st3: #c98500; --st4: #d55181; --st5: #008300; --st6: #9085e9; --st7: #e66767; }
.st-0 { --c: var(--st0); } .st-1 { --c: var(--st1); } .st-2 { --c: var(--st2); } .st-3 { --c: var(--st3); }
.st-4 { --c: var(--st4); } .st-5 { --c: var(--st5); } .st-6 { --c: var(--st6); } .st-7 { --c: var(--st7); }
.cal-staff[class*="st-"] { box-shadow: inset 0 3px 0 var(--c); background: linear-gradient(color-mix(in srgb, var(--c) 9%, var(--surface)), color-mix(in srgb, var(--c) 9%, var(--surface))); }
.cal-staff[class*="st-"] .avatar { background: color-mix(in srgb, var(--c) 24%, var(--surface)); color: var(--ink); }
.cal-staff[class*="st-"] .badge { background: color-mix(in srgb, var(--c) 24%, var(--surface)); color: var(--ink); }
.cal-col[class*="st-"] .cal-appt:not(.class-session) { border-left-color: var(--c); background: color-mix(in srgb, var(--c) 17%, var(--surface)); color: var(--ink); }
.cal-col[class*="st-"] .cal-appt:not(.class-session) small { color: color-mix(in srgb, var(--ink) 72%, transparent); }
.cal-col[class*="st-"] .cal-appt:not(.class-session):hover { background: color-mix(in srgb, var(--c) 26%, var(--surface)); }
.cal-col[class*="st-"] .cal-appt.warn { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 9%, var(--surface)) 0 6px, color-mix(in srgb, var(--c) 20%, var(--surface)) 6px 12px); outline: 1px dashed var(--c); outline-offset: -1px; }
.cal-col[class*="st-"] .cal-appt.accent { background: color-mix(in srgb, var(--c) 30%, var(--surface)); border-left-width: 6px; }
.cal-col[class*="st-"] .cal-appt.ok { background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.cal-col[class*="st-"] .cal-appt.ok strong { color: color-mix(in srgb, var(--ink) 75%, transparent); }
.cal-col[class*="st-"] .cal-appt.muted { opacity: .6; background: var(--surface-2); }
.cal-col[class*="st-"] .cal-appt.muted strong { text-decoration: line-through; }
/* Soldaki günlük liste de randevunun personel rengini taşır; çizelgeyle eşleşir. */
.bk[class*="st-"]:not(.late) { border-left-color: var(--c); }
.cal-st { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-right: 4px; vertical-align: -2px; border-radius: 50%; background: var(--surface); color: var(--ink); }
.cal-appt.warn .cal-st { color: var(--warn); }
.cal-appt.ok .cal-st { color: var(--ok); }
.cal-appt.muted .cal-st { color: var(--danger); }
/* Yoğunluk düğmeleri: saat sütununun tepesindeki boş köşe */
.cal-corner { display: flex; align-items: center; justify-content: center; }
.cal-zoom { display: inline-flex; border: 1px solid var(--line); background: var(--surface); }
.cal-zoom button { width: 22px; height: 24px; display: inline-grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.cal-zoom button + button { border-left: 1px solid var(--line); }
.cal-zoom button:hover:not(:disabled) { background: var(--primary-soft); color: var(--primary); }
.cal-zoom button:disabled { opacity: .35; cursor: default; }
@media (max-width: 860px) { .cal-zoom button { width: 19px; height: 22px; } }

/* ---------- Rezervasyon paneli ---------- */
.desk-panel-backdrop { position: fixed; inset: 0; background: rgba(10, 25, 25, .35); z-index: 90; animation: fade .15s; }
.desk-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); z-index: 91; background: var(--surface); border-left: 1px solid var(--primary); box-shadow: -10px 0 0 rgba(11,73,71,.12); display: flex; flex-direction: column; animation: slide-in .18s ease-out; }
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } }
.dp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; padding: 1rem 1.1rem .7rem; border-bottom: 1px solid var(--line); }
.dp-head .kicker { margin-bottom: 4px; }
.dp-head h2 { font-family: var(--display); font-weight: 400; font-size: 1.35rem; letter-spacing: -.02em; margin: 0; }
.dp-body { flex: 1; overflow-y: auto; padding: .4rem 1.1rem 1rem; }
.dp-actions { display: flex; flex-wrap: wrap; gap: .4rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.dp-sec { padding: .7rem 0 .2rem; border-bottom: 1px dashed var(--line); }
.dp-sec:last-child { border-bottom: 0; }
.dp-sec h4 { margin: 0 0 .5rem; font-size: .7rem; font-weight: 900; letter-spacing: .1em; color: var(--primary); }
.dp-sec label { margin-bottom: .5rem; }
.dp-guest { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; background: var(--primary-soft); }
.dp-guest small { font-size: .8rem; }
.dp-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.dp-matches { list-style: none; margin: -.3rem 0 .6rem; padding: 0; border: 1px solid var(--line-strong); }
.dp-matches li + li { border-top: 1px solid var(--line); }
.dp-matches button { width: 100%; display: flex; align-items: center; gap: .55rem; padding: .45rem .6rem; background: var(--surface); border: 0; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.dp-matches button:hover { background: var(--primary-soft); }
.dp-matches small { font-size: .78rem; }
.dp-pick { font-size: .74rem; font-weight: 900; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.dp-party { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.dp-party button, .dp-days button, .dp-times button, .dp-chips button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.dp-party button { min-height: 40px; font-weight: 800; font-size: 1rem; }
.dp-party input { min-height: 40px; grid-column: span 2; text-align: center; font-weight: 800; }
.dp-party button.on, .dp-days button.on, .dp-times button.on, .dp-chips button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.dp-days { display: grid; grid-template-columns: repeat(7, 1fr) 1.6fr; gap: 4px; }
.dp-days button { display: flex; flex-direction: column; align-items: center; padding: .3rem 0; }
.dp-days button small { font-size: .62rem; font-weight: 800; text-transform: uppercase; color: inherit; opacity: .75; }
.dp-days button strong { font-size: 1.05rem; }
.dp-days input { min-height: 46px; padding: .2rem .3rem; font-size: .8rem; }
.dp-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 4px; max-height: 196px; overflow-y: auto; margin-bottom: .6rem; }
.dp-times button { display: flex; flex-direction: column; align-items: center; padding: .3rem 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.dp-times button small { font-size: .62rem; font-weight: 700; color: var(--ok); }
.dp-times button.full { color: var(--muted); background: repeating-linear-gradient(135deg, transparent 0 5px, color-mix(in srgb, var(--line) 50%, transparent) 5px 7px); }
.dp-times button.full small { color: var(--danger); }
.dp-times button.on small { color: var(--yellow); }
.dp-inline { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.dp-area { display: block; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: .4rem 0 .25rem; }
.dp-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 5px; margin-bottom: .3rem; }
.dt { display: flex; flex-direction: column; align-items: flex-start; padding: .4rem .5rem; border: 1px solid var(--line-strong); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; text-align: left; min-height: 50px; }
.dt strong { font-size: .95rem; }
.dt small { font-size: .66rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dt.free { border-color: var(--ok); }
.dt.small { opacity: .6; }
.dt.busy { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface) 6px 12px); color: var(--muted); cursor: not-allowed; }
.dt.on { background: var(--primary); border-color: var(--primary); color: #fff; opacity: 1; }
.dt.on small { color: rgba(255,255,255,.85); }
.link-btn.on { color: var(--accent); }
.dp-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: .6rem; }
.dp-chips button { padding: .3rem .6rem; font-size: .78rem; font-weight: 700; }
.dp-foot { display: flex; align-items: center; gap: .5rem; padding: .8rem 1.1rem; border-top: 1px solid var(--line); background: var(--surface); }

/* ---------- Salon ekranı ---------- */
.dot.seated { background: var(--warn); }
.table-tile.seated { border-color: var(--warn); background: var(--warn-soft); }
.table-choice { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .8rem .9rem; margin-top: .5rem; border: 1px solid var(--line-strong); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.table-choice:hover { border-color: var(--primary); background: var(--primary-soft); }
.table-choice .icon { color: var(--accent); }
.table-choice strong { display: block; }

/* ---------- Hesap ekranı ---------- */
.bill-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .9rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line-strong); }
.bill-head h1 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); }
.bill-head p { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .88rem; margin-top: .2rem; }
.bill-customer { display: flex; align-items: center; gap: .3rem; }
.bill-guest { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; }
.ticket-lines li.new { background: color-mix(in srgb, var(--yellow) 18%, transparent); }
.ticket-lines li.changed { background: color-mix(in srgb, var(--info) 8%, transparent); }
.line-flag { font-style: normal; font-size: .62rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-left: .3rem; }
.pay-amount { display: flex; align-items: center; gap: .3rem; }
.pay-amount input { font-size: 1.1rem; font-weight: 800; min-height: 48px; }
.pay-split { margin: .1rem 0 .1rem; }
.pay-btn { flex-direction: column; gap: 0; line-height: 1.15; }
.pay-btn small { color: rgba(255,255,255,.85); font-size: .78rem; font-weight: 700; }
.pay-more { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.save-bar { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; padding-top: .7rem; margin-top: .6rem; border-top: 1px solid var(--line-strong); }
.save-bar .btn.primary { grid-column: 1 / -1; min-height: 48px; }
.pay-btn.cash, .pay-btn.cash:hover { background: var(--ok); border-color: var(--ok); color: #fff; }
.pay-btn.card, .pay-btn.card:hover { background: var(--info); border-color: var(--info); color: #fff; }
.pay-btn:hover { filter: brightness(1.08); }
.product.has-img { padding-top: 0; overflow: hidden; }
.product img { width: calc(100% + 1.2rem); margin: 0 -.6rem .3rem; aspect-ratio: 16/10; object-fit: cover; display: block; }

/* ---------- Üst arama ---------- */
.gsearch { position: relative; display: flex; align-items: center; gap: .45rem; margin-left: 1.2rem; flex: 0 1 360px; min-width: 0; border: 1px solid var(--line-strong); background: var(--surface); padding: 0 .65rem; }
.gsearch .icon { color: var(--muted); }
.gsearch input { border: 0; background: transparent; min-height: 38px; padding: 0; box-shadow: none !important; }
.gs-backdrop { position: fixed; inset: 0; z-index: 60; }
.gs-results { position: absolute; top: calc(100% + 4px); left: -1px; right: -1px; min-width: 320px; z-index: 61; background: var(--surface); border: 1px solid var(--primary); box-shadow: 8px 8px 0 rgba(11,73,71,.15); padding: .3rem; max-height: 70vh; overflow-y: auto; }
.gs-title { display: block; font-size: .66rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: .45rem .5rem .2rem; }
.gs-results button { width: 100%; display: flex; align-items: center; gap: .55rem; padding: .45rem .5rem; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.gs-results button:hover { background: var(--primary-soft); }
.gs-results small { font-size: .76rem; }
.gs-none { padding: .6rem .5rem; color: var(--muted); font-size: .88rem; }
.gs-results .gs-all { justify-content: center; font-weight: 800; color: var(--primary); border-top: 1px solid var(--line); margin-top: .2rem; }

/* ---------- Müşteriler ---------- */
.cu-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; flex-wrap: wrap; }
.cu-head h1 { font-size: clamp(1.8rem, 2.8vw, 2.5rem); }
.cu-search { display: flex; align-items: center; gap: .6rem; border: 2px solid var(--primary); background: var(--surface); padding: 0 .9rem; margin-bottom: .8rem; box-shadow: 4px 4px 0 rgba(11,73,71,.1); }
.cu-search .icon { color: var(--primary); }
.cu-search input { border: 0; background: transparent; min-height: 54px; font-size: 1.08rem; box-shadow: none !important; padding: 0; }
.cu-filters { display: flex; align-items: flex-end; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.cu-segments { display: flex; gap: 4px; flex-wrap: wrap; }
.cu-segments button { border: 1px solid var(--line-strong); background: transparent; font: inherit; font-size: .8rem; font-weight: 800; padding: .38rem .7rem; cursor: pointer; color: var(--ink); display: inline-flex; gap: .35rem; align-items: center; }
.cu-segments button span { font-weight: 700; color: var(--muted); font-size: .74rem; }
.cu-segments button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.cu-segments button.on span { color: var(--yellow); }
.cu-sort { margin: 0; flex-direction: row; align-items: center; gap: .4rem; }
.cu-sort select { width: auto; min-height: 36px; padding: .3rem .5rem; }
.cu-table { background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); margin-bottom: .8rem; }
.cu-row { display: grid; grid-template-columns: minmax(240px, 2.4fr) 1fr .7fr .9fr 1.1fr 84px; gap: .8rem; align-items: center; padding: .6rem .9rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.cu-row:last-child { border-bottom: 0; }
.cu-row:hover { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.cu-th { cursor: default; font-size: .68rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding-top: .5rem; padding-bottom: .5rem; background: var(--surface-2); }
.cu-th:hover { background: var(--surface-2); }
.cu-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.cu-row em { font-style: normal; font-size: .76rem; }
.cu-who { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.cu-who strong { display: block; }
.cu-who small { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cu-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.cu-cell { font-size: .88rem; }
.cu-quick { display: flex; justify-content: flex-end; gap: 2px; }
/* İlgilenilecekler panosu (AttentionBoard): müşteri ekranının başı; kişiler neden + tek dokunuş işlemle gelir. */
.att { margin: 0 0 1.1rem; }
.att-head { display: flex; justify-content: space-between; align-items: flex-end; gap: .5rem 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.att-head h2 { margin: 0; font-size: 1.15rem; display: flex; align-items: center; gap: .45rem; }
.att-head p { margin: .2rem 0 0; color: var(--muted); font-size: .86rem; }
.att-progress { display: inline-flex; gap: .35rem; align-items: center; font-size: .82rem; font-weight: 800; color: var(--ok); }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .7rem; }
.att-card { --tone: var(--muted); --tone-soft: var(--surface-2); position: relative; display: flex; flex-direction: column; gap: .45rem; padding: .75rem .85rem .8rem; background: var(--surface); border: 1px solid var(--line-strong); border-top: 4px solid var(--tone); box-shadow: var(--shadow); min-width: 0; }
.att-card.danger { --tone: var(--danger); --tone-soft: var(--danger-soft, var(--warn-soft)); }
.att-card.warn { --tone: var(--warn); --tone-soft: var(--warn-soft); }
.att-card.info { --tone: var(--info); --tone-soft: var(--info-soft); }
.att-card.ok { --tone: var(--ok); --tone-soft: var(--ok-soft); }
.att-card.hot { --tone: var(--accent); --tone-soft: color-mix(in srgb, var(--yellow) 30%, transparent); }
.att-why { display: flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--tone); }
.att-why em { margin-left: auto; font-style: normal; letter-spacing: 0; text-transform: none; font-size: .76rem; padding: .1rem .45rem; background: var(--tone-soft); color: var(--tone); }
.att-who { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none !important; min-width: 0; }
.att-who strong { display: block; font-size: 1.02rem; }
.att-who small { display: block; color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-who:hover strong { text-decoration: underline; }
.att-text { margin: 0; font-size: .9rem; line-height: 1.4; }
.att-last { margin: 0; font-size: .78rem; color: var(--muted); display: flex; gap: .3rem; align-items: flex-start; }
.att-act { display: flex; flex-wrap: nowrap; gap: .35rem; align-items: center; margin-top: auto; padding-top: .2rem; }
.att-act .btn.primary { margin-left: auto; }
.att-more { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; }
.att-why em + .att-more { margin-left: .2rem; }
.att-more > summary.icon-btn { width: 28px; height: 28px; min-height: 0; margin: -4px -6px -4px 0; color: var(--muted); }
.att-more .more-pop { min-width: 230px; }
.att-more .more-pop button { display: grid; grid-template-columns: 22px 1fr; column-gap: .5rem; text-align: left; padding: .55rem .6rem; border: 0; background: none; border-radius: 8px; font: inherit; font-weight: 700; font-size: .88rem; color: var(--ink); cursor: pointer; }
.att-more .more-pop button small { grid-column: 2; color: var(--muted); font-weight: 400; font-size: .76rem; }
.att-more .more-pop button:hover { background: var(--surface-2); }
.att-doneline { display: flex; align-items: center; gap: .6rem; color: var(--ok); }
.att-doneline strong { display: block; color: var(--ink); }
.att-doneline small { display: block; color: var(--muted); font-size: .8rem; }
.att-card:has(.att-doneline) { border-top-color: var(--ok); background: var(--surface-2); box-shadow: none; }
.att-all { margin-top: .6rem; }
.att-calm { display: flex; gap: .5rem; align-items: center; margin: 0 0 1rem; padding: .6rem .8rem; border: 1px dashed var(--line-strong); color: var(--muted); font-size: .88rem; }
.att-calm svg { color: var(--ok); }
.att-loading { min-height: 120px; }
/* Ritim çubuğu: son ziyaret → beklenen dönüş (çizgi) → bugün; çizgiyi geçen kısım gecikmedir. */
.rh-track { position: relative; display: block; height: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.rh-track i { position: absolute; top: 0; bottom: 0; }
.rh-ok { left: 0; width: min(var(--now), var(--due)); background: var(--primary); }
.rh-late { left: var(--due); width: max(0%, calc(var(--now) - var(--due))); background: var(--warn); }
.rh-track b { position: absolute; top: -4px; bottom: -4px; left: var(--due); width: 2px; margin-left: -1px; background: var(--ink); }
/* Menü rozeti: ilgilenilecek kişi sayısı */
/* Temalar .nav-item sütunlarını kendisi tanımlar; rozet ızgaraya girmez, satırın sağ ucuna oturur. */
.nav-item { position: relative; }
.nav-badge { min-width: 20px; height: 18px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.nav-item .nav-badge { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); }
.bottom-item { position: relative; }
.bottom-item .nav-badge { position: absolute; top: 4px; left: calc(50% + 5px); min-width: 17px; height: 16px; font-size: 10px; padding: 0 4px; box-shadow: 0 0 0 2px var(--surface, #fff); }
.cu-mobile { display: none !important; }
.cu-back { display: inline-flex; align-items: center; gap: .2rem; font-size: .85rem; margin-bottom: .6rem; }

.cx-hero { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); margin-bottom: 1rem; }
.cx-hero h1 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); }
.cx-contact { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: .4rem 0; font-size: .9rem; align-items: center; }
.cx-contact a, .cx-contact span { display: inline-flex; align-items: center; gap: .3rem; }
.cx-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.cx-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
.cx-grid > * { min-width: 0; }
.cx-tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line-strong); margin-bottom: .4rem; overflow-x: auto; }
.cx-tabs .tab { border: 0; border-radius: 0; min-height: 0; border-bottom: 3px solid transparent; background: none; font: inherit; font-weight: 800; padding: .6rem .8rem; cursor: pointer; color: var(--muted); white-space: nowrap; }
.cx-tabs .tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.cx-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line-strong); }
.cx-list:empty { display: none; }
.cx-list li { display: flex; align-items: center; gap: .8rem; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
.cx-list li:last-child { border-bottom: 0; }
.cx-list strong { display: block; }
.cx-list a.grow { color: inherit; }
.cx-date { min-width: 86px; font-weight: 800; font-variant-numeric: tabular-nums; font-size: .88rem; }
.cx-date small { font-weight: 600; }
.cx-empty { padding: 1rem .2rem; }
.cx-side .card { margin-bottom: .8rem; }
.cf-consent { margin-top: 1.4rem; }
.cf-newtag { display: flex; gap: .4rem; margin-bottom: .8rem; }
.cf-newtag input { min-height: 34px; }

/* ---------- Telefon ---------- */
@media (max-width: 1100px) {
  .desk { grid-template-columns: 208px minmax(0, 1fr); }
  .cu-row { grid-template-columns: minmax(200px, 2fr) 1fr .6fr .8fr 84px; }
  .cu-row > :nth-child(5) { display: none; }
  .cx-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .gsearch { margin-left: .4rem; flex: 1 1 auto; }
  .gs-results { min-width: 0; position: fixed; top: 58px; left: 8px; right: 8px; }
  .dh-top { align-items: flex-start; }
  .dh-actions { width: 100%; flex-wrap: nowrap; gap: .35rem; }
  .dh-actions .btn { flex: 1 1 0; min-width: 0; padding: .45rem .4rem; font-size: .8rem; }
  .dh-actions .btn .lg { display: none; }
  .topbar .crumb { display: none; }
  .cx-list li { flex-wrap: wrap; }
  .dh-strip { grid-template-columns: repeat(7, 1fr); }
  .dh-strip button { flex-direction: column; align-items: center; gap: 0; padding: .25rem .1rem; min-width: 0; }
  .dh-strip button small { font-size: .6rem; letter-spacing: .02em; }
  .dh-date { display: none; }
  .dh-search { max-width: none; flex-basis: 100%; }
  .desk, .desk.list-only { grid-template-columns: minmax(0, 1fr); }
  .desk:not(.list-only) .desk-side { display: none; }
  .desk-side { max-height: none; position: static; overflow: visible; }
  .tl { --label: 78px; }
  .tl-wrap { max-height: calc(100dvh - 330px); }
  .bk, .desk.list-only .bk { grid-template-columns: 48px minmax(0, 1fr); }
  .bk-act, .desk.list-only .bk-act { grid-column: 1 / -1; grid-row: auto; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; margin-top: .3rem; }
  .bk-act .btn { flex: 0 1 auto; min-width: 104px; }
  .bk-assign { flex: 1; }
  .desk-panel { width: 100vw; border-left: 0; }
  .dp-days { grid-template-columns: repeat(7, 1fr); }
  .dp-days input { grid-column: 1 / -1; }
  .save-bar .btn.primary { order: -1; min-height: 50px; }
  .cu-search input { min-height: 48px; font-size: 1rem; }
  .cu-th { display: none; }
  .cu-row { grid-template-columns: minmax(0, 1fr) auto; gap: .3rem .6rem; }
  .cu-row > .cu-cell { display: none; }
  .cu-mobile { display: block !important; color: var(--primary); font-weight: 600; }
  .dh-tools .segmented { flex: 1 1 0; flex-wrap: nowrap; }
  .dh-tools .segmented button { flex: 1; justify-content: center; padding: .4rem .3rem; font-size: .8rem; }
  .cu-quick { grid-row: 1; grid-column: 2; }
  .att-grid { grid-template-columns: minmax(0, 1fr); }
  .att-act .btn { flex: 1 1 auto; justify-content: center; }
  .att-act .btn.primary { margin-left: 0; }
  .cx-actions { width: 100%; }
  .cx-actions .btn { flex: 1 1 auto; }
  .cx-date { min-width: 70px; }
}

/* Takvim sayfası geniş ekranı sonuna kadar kullanır, üst boşluk kısadır. */
@media (min-width: 861px) {
  .content:has(> .desk-head) { max-width: none; padding-top: .9rem; }
}
.cal-closed-note { position: sticky; left: 0; z-index: 5; display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .45rem .8rem; background: var(--surface-2); color: var(--muted); font-size: .84rem; font-weight: 700; border-bottom: 1px solid var(--line); }

/* Takvim ekrana sığar: kutu yüksekliği konumundan ekranın altına kadardır (fit.js); sayfa kaymaz, yalnız takvim kayar. */
.cal-scroll[data-fit], .tl-wrap[data-fit] { max-height: var(--fit-h, calc(100vh - 220px)); overscroll-behavior: contain; }
.tl-wrap[data-fit] { --fit-gap: 52px; } /* altındaki ipucu satırı */
@media (min-width: 861px) {
  .desk:not(.list-only) .desk-side[data-fit] { max-height: var(--fit-h, calc(100vh - 290px)); overscroll-behavior: contain; }
  .content:has(.desk:not(.list-only) [data-fit]) { padding-bottom: 0; }
}
@media (max-width: 860px) {
  /* Alttaki sekme çubuğu ve sayfa boşluğu kadar yer bırakılır. */
  .cal-scroll[data-fit], .tl-wrap[data-fit] { --fit-gap: calc(100px + env(safe-area-inset-bottom)); }
}

/* Geçmiş saat hücreleri: yeni randevu açmaz. */
.cal-cell.past { cursor: default; }
.cal-cell.past:not(.closed) { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.cal-cell.past:hover:not(.closed) { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
