/* Yönetici paneli */
body { min-height: 100dvh; }

/* ---------- Giriş ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login__card { width: min(100%, 380px); text-align: center; }
.login__card img { width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 16px; }
.login__card h1 { font-size: 32px; margin-bottom: 6px; }
.login__card form { display: grid; gap: 12px; margin-top: 24px; text-align: left; }
.login__card .btn { min-height: 50px; }

/* ---------- Kabuk ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; border-right: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; padding: 18px 14px; }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; text-decoration: none; color: var(--ink); }
.side__brand img { width: 40px; height: 40px; border-radius: 50%; }
.side__brand b { font-family: var(--f-display); font-size: 21px; font-weight: 600; line-height: 1; }
.side__brand small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink); font-size: 15px; font-weight: 500; transition: background-color .15s; }
.nav a:hover { background: var(--bg-alt); }
.nav a[aria-current="page"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--action-hover); }
.nav svg { width: 20px; height: 20px; flex: none; }
.nav .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-size: 12px; display: grid; place-items: center; }
.side__foot { margin-top: auto; display: grid; gap: 4px; }

.main { min-width: 0; padding: 24px clamp(16px, 3vw, 36px) 48px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 34px; }
.page-head .tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.mobile-bar { display: none; }

/* ---------- Kartlar ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; min-width: 0; }
.card > h2, .card__title { font-family: var(--f-ui); font-size: 15px; font-weight: 600; margin: 0 0 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; letter-spacing: 0; }
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; }
.kpi span { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi b { display: block; font-family: var(--f-ui); font-size: 26px; font-weight: 500; line-height: 1.2; margin-top: 4px; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -0.01em; }
.kpi small { font-size: 13px; color: var(--muted); }
.kpi--pos b { color: var(--ok); }
.kpi--neg b { color: var(--danger); }

/* ---------- Tablolar / listeler ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
.t th { text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t .r { text-align: right; }
.t tbody tr.click { cursor: pointer; transition: background-color .12s; }
.t tbody tr.click:hover { background: var(--bg); }
.t tr.low td { background: var(--danger-bg); }
.t input.input, .t select.select { min-height: 38px; padding: 6px 10px; font-size: 15px; }

.list { list-style: none; padding: 0; margin: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 500; }
.list .meta { font-size: 13px; color: var(--muted); }
.time-pill { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 52px; }
.empty { padding: 20px; text-align: center; color: var(--muted); font-size: 15px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); }

.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; background: var(--surface); gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; padding: 0 14px; min-height: 34px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 160px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--action); }

/* ---------- Takvim ---------- */
.cal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-head h2 { font-family: var(--f-display); font-size: 24px; margin: 0 8px; min-width: 210px; }
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.cal__days { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 3; }
.cal__day-h { padding: 10px 8px; text-align: center; border-left: 1px solid var(--line); cursor: pointer; }
.cal__day-h span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.cal__day-h b { font-family: var(--f-display); font-size: 24px; font-weight: 600; line-height: 1.1; }
.cal__day-h.today b { color: #fff; background: var(--action); border-radius: 50%; width: 36px; height: 36px; display: inline-grid; place-items: center; font-size: 20px; }
.cal__day-h small { display: block; font-size: 12px; color: var(--muted); }
.cal__body { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(0, 1fr)); position: relative; }
.cal__gutter { position: relative; }
.cal__gutter span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal__col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% var(--hour); cursor: crosshair; }
.cal__col.closed { background-color: #f4eeeb; cursor: default; }
.cal__off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(59,37,41,.06) 0 6px, transparent 6px 12px); pointer-events: none; }
.cal__block { position: absolute; left: 2px; right: 2px; background: repeating-linear-gradient(135deg, rgba(160,53,53,.10) 0 6px, rgba(160,53,53,.03) 6px 12px); border: 1px dashed rgba(160,53,53,.35); border-radius: 6px; font-size: 12px; color: var(--danger); padding: 4px 6px; overflow: hidden; pointer-events: none; }
.cal__now { position: absolute; left: 0; right: 0; height: 2px; background: var(--action); z-index: 2; pointer-events: none; }
.cal__now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--action); }
.ev { position: absolute; left: 3px; right: 3px; border-radius: 8px; padding: 4px 8px; font-size: 13px; line-height: 1.3; overflow: hidden; cursor: pointer; border-left: 3px solid currentColor; transition: transform .12s var(--ease), box-shadow .12s; z-index: 1; text-align: left; border-top: 0; border-right: 0; border-bottom: 0; font: inherit; font-size: 13px; }
.ev:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(59,37,41,.14); z-index: 2; }
.ev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.ev.st-iptal { text-decoration: line-through; opacity: .6; }
.ev.st-talep { box-shadow: inset 0 0 0 1px currentColor; }
.cal-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.week-strip { display: none; }

/* ---------- Dialog ---------- */
dialog.modal { border: 0; padding: 0; border-radius: var(--r-lg); width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(59,37,41,.3); }
dialog.modal--wide { width: min(880px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(43, 25, 29, .42); }
dialog.modal[open] { animation: pop .2s var(--ease); display: flex; flex-direction: column; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 26px; }
.modal__body { padding: 20px 22px; overflow: auto; }
.modal__foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--bg); }
.modal__foot .left { margin-right: auto; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--bg-alt); }
.icon-btn svg { width: 20px; height: 20px; }

.svc-list { display: grid; gap: 6px; }
.svc-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 70px 110px; gap: 10px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.svc-row.on { border-color: var(--rose-line); background: #fdf5f6; }
.svc-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--action); }
.svc-row .input { min-height: 36px; padding: 4px 8px; }
.svc-row small { color: var(--muted); }
.slot-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.slot-chips button { min-height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; }
.slot-chips button:hover { border-color: var(--ink); }
.slot-chips button[aria-pressed="true"] { background: var(--action); color: #fff; border-color: var(--action); }
.picker { position: relative; }
.picker__list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); max-height: 240px; overflow: auto; z-index: 5; box-shadow: 0 12px 30px rgba(59,37,41,.15); }
.picker__list button { display: flex; justify-content: space-between; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: transparent; cursor: pointer; font-size: 15px; }
.picker__list button:hover, .picker__list button.active { background: var(--bg-alt); }
.chosen { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--rose-line); background: #fdf5f6; border-radius: var(--r-sm); }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; font-size: 15px; margin-top: 4px; }
.totals .big { font-family: var(--f-display); font-size: 24px; font-weight: 600; }
.status-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.status-btns button { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 500; }
.status-btns button[aria-pressed="true"].st-talep { background: var(--warn); color: #fff; border-color: var(--warn); }
.status-btns button[aria-pressed="true"].st-gelecek { background: var(--action); color: #fff; border-color: var(--action); }
.status-btns button[aria-pressed="true"].st-geldi { background: var(--ok); color: #fff; border-color: var(--ok); }
.status-btns button[aria-pressed="true"].st-gelmedi { background: #5d4a4d; color: #fff; border-color: #5d4a4d; }
.status-btns button[aria-pressed="true"].st-iptal { background: #6c6264; color: #fff; border-color: #6c6264; }
.code-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r-md); background: var(--bg); border: 1px dashed var(--rose-line); }
.code-box code { font-size: 22px; letter-spacing: .12em; font-weight: 600; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.info-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 15px; }
.info-dl dt { color: var(--muted); font-size: 14px; }
.info-dl dd { margin: 0; }
.section-title { font-size: 13px; font-weight: 500; color: var(--muted); margin: 20px 0 8px; }

/* ---------- Grafikler ---------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 8px; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; position: relative; min-width: 0; }
.bars .b i { display: block; border-radius: 3px 3px 0 0; min-height: 1px; }
.bars .b i.in { background: var(--action); }
.bars .b i.out { background: #d9b8a8; }
.bars .b:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: pre; z-index: 4; pointer-events: none; }
.bars-x { display: flex; gap: 3px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.bars-x span { flex: 1; text-align: center; min-width: 0; overflow: hidden; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.meter { height: 8px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--action); border-radius: inherit; }

.hours-grid { display: grid; grid-template-columns: 120px auto 1fr 1fr; gap: 8px 12px; align-items: center; }
.policy-edit { display: grid; gap: 8px; }
.policy-edit .row-p { display: flex; gap: 8px; }

@media print {
  .side, .mobile-bar, .page-head .tools, .no-print { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .card, .kpi { break-inside: avoid; }
  body { background: #fff; }
}

@media (max-width: 1100px) {
  .grid--3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .mobile-bar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); overflow-x: auto; }
  .page-head .tools { width: 100%; }
  .page-head .tools .input { flex: 1; width: auto !important; }
  .segmented { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .segmented button { white-space: nowrap; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px; }
  .kpi b { font-size: 20px; }
  .mobile-bar a { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; font-size: 11px; font-weight: 500; color: var(--muted); text-decoration: none; border-radius: var(--r-sm); position: relative; }
  .mobile-bar a[aria-current="page"] { color: var(--action-hover); background: var(--bg-alt); }
  .mobile-bar svg { width: 22px; height: 22px; }
  .mobile-bar a { font-size: 10.5px; padding: 6px 0; white-space: nowrap; }
  .mobile-bar .count { position: absolute; top: 2px; right: 10px; min-width: 18px; height: 18px; border-radius: 999px; background: var(--warn); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 4px; }
  .main { padding: 16px 14px 96px; }
  .page-head h1 { font-size: 28px; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 10px; }
  .week-strip button { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 6px 0; cursor: pointer; text-align: center; }
  .week-strip button span { display: block; font-size: 11px; color: var(--muted); }
  .week-strip button b { font-size: 17px; }
  .week-strip button i { display: block; width: 5px; height: 5px; border-radius: 50%; margin: 2px auto 0; background: transparent; }
  .week-strip button i.has { background: var(--action); }
  .week-strip button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
  .week-strip button[aria-pressed="true"] span { color: rgba(255,255,255,.8); }
  .cal-head h2 { font-size: 20px; min-width: 0; }
  .svc-row { grid-template-columns: 22px minmax(0, 1fr) 56px 90px; gap: 6px; padding: 6px; font-size: 14px; }
  .hours-grid { grid-template-columns: 1fr auto; }
  .hours-grid .hg-time { grid-column: span 1; }
  dialog.modal { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .modal__body { padding: 16px; }
  .modal__head, .modal__foot { padding: 12px 16px; }
}
