/* İşletme paneli */

/* Giriş / kayıt */
.auth { max-width: 440px; margin: 0 auto; padding: calc(28px + env(safe-area-inset-top)) 16px 40px; }
.brandmark { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; text-decoration: none; margin-bottom: 20px; justify-content: center; }
.bm-ico { width: 36px; height: 36px; border-radius: 11px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); padding: 4px; border-radius: 12px; margin-bottom: 18px; }
.auth-tabs button { border: 0; background: none; min-height: 40px; border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.auth-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 700; font-size: 14px; }
.seg input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft); }

/* Uygulama iskeleti */
.shell { min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.head { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--line); }
.head h1 { font-size: 20px; font-weight: 800; }
.head .sub { font-size: 13px; color: var(--ink-3); }
.main { padding: 14px 16px 24px; max-width: 1100px; margin: 0 auto; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 8px; font-size: 11px; font-weight: 700; color: var(--ink-3); text-decoration: none; position: relative; }
.nav a svg { width: 22px; height: 22px; }
.nav a.on { color: var(--brand); }
.nav .badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; display: grid; place-items: center; }

@media (min-width: 960px) {
  .shell { padding: 0 0 0 232px; }
  .nav { top: 0; right: auto; width: 232px; grid-template-columns: 1fr; align-content: start; gap: 2px; padding: 20px 12px; border-top: 0; border-right: 1px solid var(--line); }
  .nav a { flex-direction: row; gap: 12px; padding: 11px 14px; font-size: 14px; border-radius: 10px; }
  .nav a.on { background: var(--brand-soft); }
  .nav .badge { position: static; margin-left: auto; }
  .nav .nav-brand { display: flex !important; }
  .head { padding-left: 24px; padding-right: 24px; }
  .main { padding: 20px 24px 40px; }
}
.nav .nav-brand { display: none; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; padding: 4px 10px 18px; }

/* Takvim üst bölümü */
.daybar { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; flex: 1; }
.wd { border: 0; background: none; border-radius: 12px; padding: 6px 0; cursor: pointer; text-align: center; color: var(--ink-2); }
.wd small { display: block; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.wd b { display: block; font-size: 17px; }
.wd.today b { color: var(--brand); }
.wd.on { background: var(--ink); color: var(--bg); }
.wd.on small, .wd.on b { color: inherit; }
.navbtn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; }
.navbtn svg { width: 18px; height: 18px; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.kpi b { display: block; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.kpi.alert { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); cursor: pointer; }
.kpi.alert b { color: var(--warn); }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.seg2 { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 10px; }
.seg2 button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.seg2 button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* Ajanda listesi */
.ag { display: flex; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; position: relative; overflow: hidden; }
.ag + .ag, .ag + .gap, .gap + .ag { margin-top: 8px; }
.ag::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--brand)); }
.ag .t { width: 52px; flex: none; font-weight: 800; font-variant-numeric: tabular-nums; }
.ag .t small { display: block; font-weight: 600; color: var(--ink-3); font-size: 12px; }
.ag .nm { font-weight: 700; }
.ag .meta { font-size: 13px; color: var(--ink-3); }
.ag.st-cancelled, .ag.st-noshow { opacity: .55; }
.ag.st-cancelled .nm { text-decoration: line-through; }
.ag.st-done { background: color-mix(in srgb, var(--ok) 5%, var(--surface)); }
.ag .qa { display: flex; gap: 6px; margin-top: 8px; }
.gap { padding: 8px 12px; border: 1.5px dashed var(--line); border-radius: 12px; color: var(--ink-3); font-size: 13px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.gap:hover { border-color: var(--brand); color: var(--brand); }
.blk { padding: 10px 12px; border-radius: 12px; background: repeating-linear-gradient(135deg, var(--surface-2) 0 8px, transparent 8px 16px); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.now-line { display: flex; align-items: center; gap: 8px; color: var(--bad); font-size: 12px; font-weight: 800; margin: 8px 0; }
.now-line::after { content: ""; flex: 1; height: 2px; background: var(--bad); border-radius: 1px; }

/* Izgara takvim */
.grid-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); max-height: calc(100dvh - 300px); min-height: 360px; }
.grid { display: grid; position: relative; min-width: 100%; }
.g-head { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 6px; font-weight: 700; font-size: 13px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-corner { position: sticky; left: 0; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.g-times { position: sticky; left: 0; z-index: 2; background: var(--surface); border-right: 1px solid var(--line); }
.g-times div { position: absolute; right: 6px; font-size: 11px; color: var(--ink-3); transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.g-col { position: relative; border-left: 1px solid var(--line); cursor: copy; }
.g-col .hl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.g-col .hl.half { border-top-style: dashed; opacity: .6; }
.g-ev { position: absolute; left: 3px; right: 3px; border-radius: 8px; padding: 4px 6px; font-size: 12px; line-height: 1.25; overflow: hidden; cursor: pointer; color: var(--ink);
  background: color-mix(in srgb, var(--c) 16%, var(--surface)); border-left: 3px solid var(--c); z-index: 1; }
.g-ev b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-ev.st-pending { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--warn) 14%, var(--surface)) 0 6px, var(--surface) 6px 12px); border-left-color: var(--warn); }
.g-ev.st-cancelled, .g-ev.st-noshow { opacity: .45; }
.g-ev.st-done { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.g-blk { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, transparent 6px 12px); z-index: 0; font-size: 11px; color: var(--ink-3); padding: 3px 6px; }
.g-off { position: absolute; left: 0; right: 0; background: var(--surface-2); opacity: .7; }
.g-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 2; pointer-events: none; }

.fab { position: fixed; right: 18px; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 55; width: 58px; height: 58px; border-radius: 18px; border: 0; background: var(--brand); color: var(--brand-ink); box-shadow: 0 10px 28px color-mix(in srgb, var(--brand) 45%, transparent); display: grid; place-items: center; cursor: pointer; }
.fab svg { width: 26px; height: 26px; }
@media (min-width: 960px) { .fab { bottom: 28px; right: 28px; } }

/* Listeler */
.list .item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.list .item:last-child { border-bottom: 0; }
.list .item .t1 { font-weight: 700; }
.list .item .t2 { font-size: 13px; color: var(--ink-3); }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); }
.search .input { padding-left: 42px; }

.section-h { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; }
.section-h:first-child { margin-top: 0; }
.section-h h2 { font-size: 17px; font-weight: 800; }
.cols { display: grid; gap: 14px; }
@media (min-width: 960px) { .cols.two { grid-template-columns: 1fr 1fr; align-items: start; } }

/* Rapor */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stat span { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; }
.stat b { display: block; font-size: 24px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat small { color: var(--ink-3); }
.bars .b { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }
.bars .b .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .b .track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bars .b .fill { height: 100%; background: var(--c, var(--brand)); border-radius: 5px; }
.bars .b .v { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 8px; }
.spark i { flex: 1; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; position: relative; }
.spark i:hover { opacity: 1; }
.hours-heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; }
.hours-heat div { aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: color-mix(in srgb, var(--brand) calc(var(--p) * 1%), var(--surface-2)); color: var(--ink); }

/* Ayarlar */
.share-card { background: linear-gradient(150deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000)); color: #fff; border-radius: 18px; padding: 18px; }
.share-card .url { background: rgba(255, 255, 255, .14); border-radius: 10px; padding: 10px 12px; font-weight: 700; word-break: break-all; margin: 10px 0 12px; font-size: 14px; }
.share-card .btn { background: #fff; color: var(--brand); }
.share-card .btn.ghost { background: rgba(255, 255, 255, .14); color: #fff; border-color: transparent; }
.qr-box { background: #fff; padding: 12px; border-radius: 14px; display: inline-block; }
.qr-box img, .qr-box canvas { width: 168px !important; height: 168px !important; }
.hours-edit .hr { display: grid; grid-template-columns: 72px 1fr; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hours-edit .hr:last-child { border-bottom: 0; }
.hours-edit .times { display: grid; grid-template-columns: 34px minmax(0, 1fr) 8px minmax(0, 1fr); gap: 6px; align-items: center; }
.hours-edit .times > span { font-size: 12px; color: var(--ink-3); }
.hours-edit .times input[type=time] { min-height: 40px; padding: 6px 4px; width: 100%; min-width: 0; font-size: 15px; text-align: center; }
/* Dar ekranda saat simgesi değeri kırpmasın (dokununca seçici yine açılır) */
@media (max-width: 520px) {
  .hours-edit .times input[type=time]::-webkit-calendar-picker-indicator { display: none; }
  .hours-edit .times input[type=time]::-webkit-datetime-edit { padding: 0; }
}
.hours-edit .closed .times input { opacity: .35; pointer-events: none; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label input { position: absolute; opacity: 0; }
.swatches label span { display: block; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatches label input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.daypick { display: flex; gap: 6px; flex-wrap: wrap; }
.daypick label input { position: absolute; opacity: 0; }
.daypick label span { display: grid; place-items: center; min-width: 46px; height: 38px; border-radius: 10px; border: 1.5px solid var(--line); font-weight: 700; font-size: 13px; cursor: pointer; }
.daypick label input:checked + span { background: var(--bad); color: #fff; border-color: var(--bad); }
.svc-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.svc-pick label input { position: absolute; opacity: 0; }
.svc-pick label span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 600; font-size: 14px; cursor: pointer; }
.svc-pick label input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.slot-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 6px; max-height: 190px; overflow-y: auto; }
.slot-pick > span { grid-column: 1 / -1; }
.toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
@media (min-width: 960px) { .toast { bottom: 28px; } }
.slot-pick button { min-height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.slot-pick button.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 5; overflow: hidden; }
.ac-list button { display: flex; justify-content: space-between; width: 100%; padding: 12px 14px; border: 0; background: none; text-align: left; cursor: pointer; border-bottom: 1px solid var(--line); }
.ac-list button:last-child { border-bottom: 0; }
.ac-list button:hover { background: var(--surface-2); }
.status-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.status-row .btn.on { outline: 2px solid var(--ink); outline-offset: 1px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--ink-3); }
.kv span:last-child { font-weight: 700; text-align: right; }
.sent { opacity: .5; }
