/* Salon Randevunu Oluştur — ortak tasarım sistemi
   Fikir: salonun "boya kartelası". Her uzman bir boya rengidir; takvimde, randevu
   sayfasında ve özetlerde aynı renk onu temsil eder. Geri kalan her şey sakin kalır. */

:root {
    --paper: #FAF4F9;
    --surface: #FFFFFF;
    --ink: #2A1245;
    --ink-2: #5B4A72;
    --ink-3: #7A6893;
    --line: #E8DBF0;
    --line-2: #F1E8F6;

    --accent: #E0185F;
    --accent-ink: #FFFFFF;
    --accent-2: color-mix(in srgb, var(--accent) 52%, #5B21B6);
    --accent-text: color-mix(in srgb, var(--accent) 80%, #1A0A2E);
    --accent-soft: color-mix(in srgb, var(--accent) 10%, white);
    --accent-line: color-mix(in srgb, var(--accent) 34%, white);
    --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
    --grad-deep: linear-gradient(155deg, var(--ink) 0%, color-mix(in srgb, var(--ink) 56%, var(--accent)) 100%);

    --teal: #0B7A69;
    --teal-soft: #D7F5EE;
    --henna: #9A4506;
    --henna-soft: #FFEBD0;
    --danger: #C4231A;
    --danger-soft: #FEE4E2;
    --done: #4B3F72;
    --done-soft: #E9E3F7;

    --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
    --f-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --r-s: 6px;
    --r-m: 10px;
    --r-l: 18px;
    --tap: 44px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 15px/1.45 var(--f-ui);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 650; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--accent-text); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num, .time { font-variant-numeric: tabular-nums; }

.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 0.86rem; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.hstack { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.right { margin-left: auto; }
.center { text-align: center; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 16px; height: 16px; }

/* ---------- Düğmeler ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--tap); padding: 0 18px;
    border: 1px solid transparent; border-radius: var(--r-m);
    background: var(--accent); color: var(--accent-ink);
    font-weight: 600; text-decoration: none; white-space: nowrap;
    transition: filter .12s, background .12s, transform .06s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--line-2); filter: none; }
.btn.soft { background: var(--accent-soft); color: var(--accent-text); }
.btn.soft:hover { background: color-mix(in srgb, var(--accent) 16%, white); filter: none; }
.btn.teal { background: var(--teal); }
.btn.danger { background: var(--danger); }
.btn.danger.soft { background: var(--danger-soft); color: var(--danger); }
.btn.ink { background: var(--ink); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 0.9rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.icon { padding: 0; width: var(--tap); }
.btn.icon.sm { width: 36px; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .lbl { font-weight: 600; font-size: 0.88rem; color: var(--ink-2); }
.hint { font-size: 0.82rem; color: var(--ink-3); }
.input, .select, .textarea {
    width: 100%; min-height: var(--tap); padding: 9px 12px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
    transition: border-color .12s, box-shadow .12s;
}
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.input::placeholder { color: var(--ink-3); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2385798D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 420px) { .grid3 { grid-template-columns: 1fr 1fr; } }

.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 44px; height: 26px; border-radius: 999px; background: #CDBFE0; position: relative; flex: none; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.switch-row:last-child { border-bottom: 0; }
.switch-row .t { font-weight: 600; }

/* seçilebilir çipler (hizmet, saat) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    position: relative; display: inline-flex; align-items: center; gap: 8px;
    min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--surface); font-weight: 500; cursor: pointer; user-select: none;
    transition: background .1s, border-color .1s;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:hover { border-color: var(--accent-line); }
.chip:has(input:checked), .chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip .sw { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--ink-3)); }

.seg { display: inline-flex; padding: 3px; background: var(--line-2); border-radius: 12px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 0 14px; min-height: 36px; border-radius: 9px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.seg button[aria-pressed="true"], .seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(42,18,69,.14); }

/* ---------- Durum etiketleri ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 650; white-space: nowrap; background: var(--done-soft); color: var(--done); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.bekliyor { background: var(--henna-soft); color: var(--henna); }
.pill.onaylandi { background: var(--teal-soft); color: var(--teal); }
.pill.tamamlandi { background: var(--done-soft); color: var(--done); }
.pill.iptal { background: #EEE6F5; color: var(--ink-3); }
.pill.gelmedi { background: var(--danger-soft); color: var(--danger); }
.pill.plain::before { display: none; }

/* ---------- Avatar / boya şeridi ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; flex: none; }
.dye { display: inline-block; width: 6px; align-self: stretch; min-height: 28px; border-radius: 3px; background: var(--c, var(--ink-3)); flex: none; }

/* ---------- Açılır pencere (alttan sayfa / ortada kutu) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(42, 18, 69, .46); z-index: 80; animation: fade .16s ease-out; }
.sheet {
    position: fixed; z-index: 81; left: 0; right: 0; bottom: 0;
    max-height: 94vh; max-height: 94dvh; display: flex; flex-direction: column;
    background: var(--surface); border-radius: 20px 20px 0 0;
    box-shadow: 0 -12px 40px rgba(42,18,69,.22);
    animation: rise .22s cubic-bezier(.2,.8,.2,1);
}
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 10px; }
.sheet-head h2 { flex: 1; font-size: 1.15rem; }
.sheet-body { padding: 6px 18px 18px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 18px calc(12px + var(--safe-b)); border-top: 1px solid var(--line-2); background: var(--surface); }
.sheet-foot .btn { flex: 1; }
.sheet-foot .btn.fixed { flex: none; }
@media (min-width: 720px) {
    .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 540px; max-width: calc(100vw - 32px); max-height: 88vh; border-radius: var(--r-l); transform: translate(-50%, -50%); animation: pop .18s cubic-bezier(.2,.8,.2,1); }
    .sheet.wide { width: 720px; }
}
@keyframes rise { from { transform: translateY(40px); opacity: .6; } }
@keyframes pop { from { transform: translate(-50%, -48%) scale(.98); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Bildirim ---------- */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 24px); pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 28px; } }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-weight: 550; box-shadow: 0 8px 24px rgba(42,18,69,.28); animation: rise .2s ease-out; pointer-events: auto; max-width: 420px; }
.toast.err { background: var(--danger); }
.toast.ok::before { content: "✓  "; }

/* ---------- Boş durum, yükleme ---------- */
.empty { text-align: center; padding: 36px 20px; color: var(--ink-2); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; margin: 36px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert { padding: 12px 14px; border-radius: var(--r-m); background: var(--henna-soft); color: #6B3C06; font-weight: 500; }
.alert.err { background: var(--danger-soft); color: #7A1913; }
.alert.ok { background: var(--teal-soft); color: #0F4A43; }

.center-note { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 24px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
