/* Yönetim paneli, giriş ve kurulum ekranları */
:root {
  --p: #14A38B; --a: #FF8A6B;
  --ink: #14302B; --muted: #5B716C; --bg: #F3F8F6; --line: #DDE8E5;
  --p-soft: color-mix(in srgb, var(--p) 11%, white);
  --p-deep: color-mix(in srgb, var(--p) 76%, black);
  --display: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 .95rem/1.5 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2 { font-family: var(--display); letter-spacing: -.02em; line-height: 1.15; margin: 0; }
h1 { font-size: 1.7rem; font-weight: 700; }
h2 { font-size: 1.12rem; font-weight: 700; margin-bottom: 12px; }
a { color: var(--p-deep); text-underline-offset: 3px; }
code { background: var(--p-soft); padding: 2px 6px; border-radius: 6px; font-size: .86em; word-break: break-all; }
code.block { display: block; padding: 10px 12px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--p) 50%, white); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Yerleşim */
.side { position: fixed; inset: 0 auto 0 0; width: 232px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 14px; z-index: 10; }
.side-brand { font: 700 1.2rem var(--display); color: var(--ink); text-decoration: none; padding: 0 10px 18px; letter-spacing: -.02em; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 600; transition: background .2s, color .2s; }
.side nav a:hover { background: var(--bg); color: var(--ink); }
.side nav a.on { background: var(--p-soft); color: var(--p-deep); }
.dot { margin-left: auto; background: var(--a); color: #fff; font-size: .74rem; min-width: 21px; height: 21px; border-radius: 99px; display: grid; place-items: center; padding: 0 6px; animation: nudge 2.4s infinite; }
@keyframes nudge { 0%, 88%, 100% { transform: none; } 92% { transform: scale(1.22); } }
.side-foot { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; font-size: .88rem; }
.side-foot > a, .side-foot .link { padding: 4px 10px; color: var(--muted); text-decoration: none; }
.who { display: flex !important; align-items: center; gap: 10px; color: var(--ink) !important; font-weight: 600; }
.who small { display: block; font-weight: 400; color: var(--muted); }
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--p); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; overflow: hidden; }
.av.lg { width: 54px; height: 54px; font-size: 1.05rem; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.main { margin-left: 232px; padding: 28px 32px 80px; max-width: 1240px; }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.head-r { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sub { color: var(--muted); margin: 0 0 18px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px 22px; margin-top: 18px; }
.panel.narrow { max-width: 520px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.empty { color: var(--muted); text-align: center; padding: 22px 8px; margin: 0; }
.dim { color: var(--muted); }
.hint { color: var(--muted); font-size: .88rem; margin: 6px 0 12px; }

/* Düğmeler */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 99px; padding: 10px 18px; background: var(--ink); color: #fff; font: 700 .92rem var(--body); text-decoration: none; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s, background .2s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -12px var(--ink); }
.btn:active { transform: scale(.97); }
.btn.sm { padding: 7px 13px; font-size: .84rem; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { background: var(--bg); }
.btn.danger, .link.danger { color: #B3261E; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--p-deep); cursor: pointer; text-align: left; }
.link:hover { text-decoration: underline; }
.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.row-btn { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 0; }
.row-btn.end { align-self: end; margin: 0; }
.danger-zone { margin: 22px 4px 0; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 99px; background: var(--bg); font-size: .84rem; text-decoration: none; color: var(--ink); margin: 2px 0; }
.chip.wa { background: #E7F8EC; color: #136C39; font-weight: 600; }

/* Bildirim kutuları */
.note { padding: 12px 16px; border-radius: 14px; margin: 14px 0 0; font-weight: 500; background: var(--p-soft); color: var(--p-deep); }
.note.ok { background: var(--p-soft); color: var(--p-deep); }
.note.bad { background: #FDECEA; color: #A2281F; }
.note.warn { background: #FFF3D6; color: #7A4F00; }
.note.flash { animation: drop .5s var(--ease); margin: 0 0 16px; }
@keyframes drop { from { opacity: 0; transform: translateY(-12px); } }

/* Durum rozetleri */
.st { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 700; background: #EEF2F1; color: var(--muted); vertical-align: middle; white-space: nowrap; }
.st-pending { background: #FFF3D6; color: #7A4F00; }
.st-approved { background: var(--p-soft); color: var(--p-deep); }
.st-done { background: #E6F0FF; color: #1D4E9E; }
.st-cancelled, .st-noshow { background: #FDECEA; color: #A2281F; }

/* Özet kutuları */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; text-decoration: none; color: var(--ink); transition: transform .25s var(--ease), box-shadow .25s; }
a.tile:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -22px var(--p); }
.tile b { display: block; font: 700 1.7rem var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: .86rem; }
.setup { background: linear-gradient(135deg, var(--p-soft), #fff); }
.setup ol { margin: 0; padding-left: 20px; line-height: 1.9; font-weight: 600; }

/* Randevu satırları */
.aps { list-style: none; margin: 0; padding: 0; }
.ap { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ap:last-child { border-bottom: 0; }
.ap-time { flex: none; width: 78px; text-align: center; text-decoration: none; color: var(--ink); border-left: 4px solid var(--c); padding-left: 8px; line-height: 1.2; }
.ap-time strong { display: block; font: 700 1.15rem var(--display); font-variant-numeric: tabular-nums; }
.ap-time small { display: block; color: var(--muted); font-size: .76rem; }
.ap-body { flex: 1; min-width: 0; }
.ap-body a { text-decoration: none; color: var(--ink); }
.ap-body p { margin: 1px 0 0; font-size: .9rem; }
.ap-act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* Formlar */
.form label, .auth-card label, .filters label, .dlg label { display: block; font-weight: 600; font-size: .86rem; margin-top: 12px; }
.opt { font-weight: 400; color: var(--muted); font-size: .8rem; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: inherit; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--p); box-shadow: 0 0 0 4px var(--p-soft); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: 2px 0 0; padding: 0; flex: none; accent-color: var(--p); display: inline-block; }
input[type=color] { padding: 4px; height: 44px; }
input[type=file] { padding: 8px; }
textarea { resize: vertical; }
label.check, .check { display: flex !important; gap: 9px; align-items: flex-start; font-weight: 400 !important; font-size: .92rem !important; margin-top: 10px; }
.check.mini { font-size: .8rem !important; margin-top: 6px; align-items: center; }
.check.mini input { width: 15px; height: 15px; margin: 0; }
fieldset { border: 0; padding: 0; margin: 16px 0 0; }
legend { font-weight: 600; font-size: .86rem; padding: 0; }
.grid2, .grid3, .grid4 { display: grid; gap: 0 14px; grid-template-columns: repeat(2, 1fr); }
.grid3 { grid-template-columns: repeat(3, 1fr); }
.grid4 { grid-template-columns: repeat(4, 1fr); }
.checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 10px; }
.filters label { margin: 0; min-width: 140px; }
.quick { display: flex; gap: 12px; font-size: .88rem; padding-bottom: 10px; }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 35%); padding: 18px 0 14px; margin-top: 4px; z-index: 5; }
.live { margin: 12px 0 0; padding: 9px 13px; border-radius: 12px; background: var(--p-soft); color: var(--p-deep); font-weight: 600; font-size: .9rem; }
.live.bad { background: #FDECEA; color: #A2281F; }
.live.warn { background: #FFF3D6; color: #7A4F00; }
.w80 { width: 80px; }
.grow { flex: 1; min-width: 0; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.swatches label { margin: 0; cursor: pointer; }
.swatches input { position: absolute; opacity: 0; }
.swatches i { display: block; width: 34px; height: 34px; border-radius: 50%; transition: transform .2s var(--ease); }
.swatches input:checked + i { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); transform: scale(1.08); }
.presets { display: flex; flex-wrap: wrap; gap: 10px; }
.presets button { border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 8px 12px 8px 8px; display: flex; align-items: center; gap: 8px; font: 600 .88rem var(--body); cursor: pointer; transition: transform .2s; }
.presets button:hover { transform: translateY(-2px); }
.presets i { width: 26px; height: 26px; border-radius: 50%; }
.thumb { max-width: 120px; max-height: 90px; border-radius: 12px; border: 1px solid var(--line); }

/* Tablolar ve listeler */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.off td { opacity: .55; }
.tbl.small td { font-size: .86rem; }
.tbl a { text-decoration: none; }
.hours-edit input[type=time] { margin: 0; min-width: 104px; }
.hours-edit td { padding: 6px 8px 6px 0; border: 0; }
.hours-edit .check { margin: 0; }
.rows { list-style: none; margin: 0 0 6px; padding: 0; }
.rows li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows a { text-decoration: none; color: var(--ink); }
.rows input { margin: 0; }
.rows.stack li { align-items: flex-start; }
.people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.people a { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: transform .25s var(--ease), box-shadow .25s; }
.people a:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -20px var(--p); }
.people small { display: block; color: var(--muted); }
.people .off { opacity: .55; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 14px 0 0; }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; }
.tabs a { padding: 8px 14px; border-radius: 99px; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs a.on { background: var(--ink); color: #fff; }
.seg { display: inline-flex; background: #fff; border: 1.5px solid var(--line); border-radius: 99px; padding: 3px; }
.seg a { padding: 6px 14px; border-radius: 99px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .88rem; }
.seg a.on { background: var(--p-soft); color: var(--p-deep); }

/* Çubuk grafik */
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: minmax(90px, 150px) 1fr auto; gap: 10px; align-items: center; padding: 5px 0; font-size: .88rem; }
.b-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-t { height: 12px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.b-t i { display: block; height: 100%; border-radius: 6px; background: var(--p); transform-origin: left; animation: growx .8s var(--ease) both; }
@keyframes growx { from { transform: scaleX(0); } }
.b-v { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Randevu ayrıntısı */
.detail-top { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: flex-start; }
.detail-act { display: flex; flex-wrap: wrap; gap: 8px; }
.when { margin: 8px 0 0; color: var(--muted); }
.clock { margin: 0; font: 700 2.3rem var(--display); letter-spacing: -.03em; }
.clock span { font: 400 1rem var(--body); color: var(--muted); letter-spacing: 0; }
.kv { margin: 14px 0 0; }
.kv div { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.kv dt { width: 110px; flex: none; color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; flex: 1; }
.kv small { display: block; }

/* Takvim */
.cal-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.cal-nav strong { font: 700 1.05rem var(--display); margin: 0 4px; }
.cal-nav input, .cal-nav select { margin: 0; padding: 7px 10px; width: auto; }
.cal-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 20px; }
.cal { min-width: calc(56px + var(--cols) * 128px); }
.cal-head, .cal-body { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(0, 1fr)); }
.cal-head { position: sticky; top: 0; background: #fff; z-index: 3; border-bottom: 1px solid var(--line); border-radius: 20px 20px 0 0; }
.cal-th { padding: 11px 8px; font-weight: 700; font-size: .88rem; text-align: center; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-th i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.cal-th a { color: inherit; text-decoration: none; }
.cal-th.today { color: var(--p-deep); background: var(--p-soft); }
.cal-body { height: var(--h); position: relative; margin: 10px 0 14px; }
.cal-gut { position: relative; }
.cal-gut span { position: absolute; right: 8px; transform: translateY(-50%); font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-left: 1px solid var(--line); cursor: copy; background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 69px); }
.cal-off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, #F1F5F4 0 6px, #FAFCFB 6px 12px); pointer-events: none; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--a); 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(--a); }
.ev { position: absolute; border-radius: 9px; padding: 3px 7px; overflow: hidden; text-decoration: none; font-size: .76rem; line-height: 1.25; color: var(--ink); background: color-mix(in srgb, var(--c) 20%, white); border-left: 4px solid var(--c); z-index: 1; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s; }
.ev:hover { transform: scale(1.02); box-shadow: 0 10px 20px -10px rgba(20, 48, 43, .5); z-index: 4; }
.ev b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev span { display: block; opacity: .8; }
.ev-pending { background: repeating-linear-gradient(135deg, #FFF3D6 0 7px, #FFFAEB 7px 14px); border-left-color: #E2A21B; }
.ev-done { opacity: .6; }
.ev-noshow { background: #F1F1F1; border-left-color: #9A9A9A; text-decoration: line-through; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; color: var(--muted); font-size: .84rem; margin: 12px 4px 0; }
.legend span { position: static; padding: 2px 9px; border-radius: 7px; border-left: 4px solid var(--p); background: var(--p-soft); color: var(--ink); text-decoration: none; opacity: 1; }
.legend .ev-pending { border-left-color: #E2A21B; background: #FFF3D6; }
.legend .ev-done { opacity: .6; }
.legend .ev-noshow { background: #F1F1F1; border-left-color: #9A9A9A; }

/* Pencere */
.dlg { border: 0; border-radius: 24px; padding: 26px; width: min(440px, calc(100vw - 28px)); box-shadow: 0 40px 80px -30px rgba(20, 48, 43, .6); }
.dlg[open] { animation: pop .35s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.96); } }
.dlg::backdrop { background: rgba(20, 48, 43, .4); backdrop-filter: blur(3px); }
.dlg-who { color: var(--muted); margin: 4px 0 10px; }
.dlg-srv { list-style: none; margin: 0; padding: 10px 14px; background: var(--bg); border-radius: 14px; font-size: .9rem; }
.dlg-srv .tot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; font-weight: 700; }
.dlg-end { font-weight: 700; margin: 10px 0 0; }
.stepper { display: flex; gap: 8px; margin-top: 5px; }
.stepper input { margin: 0; text-align: center; font: 700 1.2rem var(--display); }
.stepper button { flex: none; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 0 14px; font: 700 .9rem var(--body); cursor: pointer; }
.stepper button:hover { background: var(--p-soft); }

/* Giriş ve kurulum */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(60vmax 60vmax at 0 0, color-mix(in srgb, var(--p) 24%, white), transparent 70%), radial-gradient(50vmax 50vmax at 100% 100%, color-mix(in srgb, var(--a) 22%, white), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: rgba(255, 255, 255, .9); backdrop-filter: blur(14px); border-radius: 28px; padding: 32px 28px; box-shadow: 0 30px 70px -36px var(--p); animation: pop .6s var(--ease); }
.auth-card.wide { max-width: 640px; }
.auth-card h2 { margin-top: 24px; }
.checks { list-style: none; padding: 0; margin: 14px 0; font-size: .9rem; }
.checks .ok { color: var(--p-deep); }
.checks .bad { color: #A2281F; font-weight: 700; }

@media (max-width: 900px) {
  .side { position: sticky; top: 0; inset: auto; width: auto; flex-direction: row; align-items: center; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); gap: 6px; overflow-x: auto; }
  .side-brand { display: none; }
  .side nav { flex-direction: row; flex: none; }
  .side nav a { padding: 8px 10px; flex-direction: column; gap: 2px; font-size: .68rem; position: relative; }
  .side nav .dot { position: absolute; top: 0; right: 0; margin: 0; }
  .side-foot { flex-direction: row; border: 0; padding: 0; align-items: center; white-space: nowrap; margin-left: auto; }
  .who span:last-child { display: none; }
  .main { margin: 0; padding: 18px 14px 70px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .grid3, .grid4 { grid-template-columns: 1fr 1fr; }
  .cols2 { grid-template-columns: 1fr; }
  .ap { flex-wrap: wrap; }
  .ap-act { width: 100%; justify-content: flex-start; padding-left: 92px; }
  .panel { padding: 16px; border-radius: 18px; }
}
@media (max-width: 520px) {
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  h1 { font-size: 1.4rem; }
  .ap-act { padding-left: 0; }
  .kv div { flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
