:root {
  /* Marka paleti (koyu tema) */
  color-scheme: dark;
  --bg: #120C08;
  --bg-card: #241811;
  --bg-dark: #0B0705;
  --surface: #1C130D;
  --primary: #FF8A2B;
  --primary-hover: #FF9A3D;
  --pink-light: #FF9A3D; /* koyu zeminde yazı/kenarlık */
  --text-heading: #FFF1E6;
  --text-body: #E3D3C5;
  --white: #FFFFFF;

  /* Bileşenlerin kullandığı türetilmiş değişkenler */
  --accent: #E8650A;
  --accent-dark: #C85000;
  --accent-soft: #33210F;
  --text: var(--text-body);
  --muted: #A8927F;
  --card: var(--bg-card);
  --border: #3D2A1D;
  --ok: #4CAF50;
  --danger: #E5484D;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  --focus-ring: rgba(255, 138, 43, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary);
}

h1,
h2,
h3,
h4 {
  color: var(--text-heading);
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Başlık ---------- */

.hero {
  text-align: center;
  padding: calc(40px + env(safe-area-inset-top, 0px)) 16px 36px;
  background: var(--bg-dark);
  color: var(--white);
}

.hero h1 {
  font-size: 2rem;
  color: var(--pink-light);
  letter-spacing: 2px;
  line-height: 1.2;
}

.hero p {
  max-width: 560px;
  margin: 12px auto 0;
  font-size: 1rem;
  color: var(--white);
}

.hero-small {
  padding-bottom: 24px;
}

.hero-small h1 {
  font-size: 1.6rem;
}

/* Ana sayfa: bulanık banner zemini üzerinde parlayan kart */
.hero-banner {
  position: relative;
  overflow: hidden;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 14px 24px;
}

.hero-banner::before {
  content: "";
  position: absolute;
  inset: -40px;
  background: url("img/banner.jpg") center / cover;
  filter: blur(26px) brightness(0.5);
}

.hero-banner h1 {
  position: relative;
  line-height: 0;
}

.hero-banner img {
  width: 100%;
  height: auto;
  max-width: 820px;
  margin: 0 auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 154, 61, 0.4);
  box-shadow: 0 10px 50px rgba(217, 90, 0, 0.55);
}

.hero-banner .hero-btn {
  position: relative;
}

.hero-btn {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.hero-btn:hover {
  background: var(--accent-dark);
}

/* ---------- Bölümler ---------- */

section {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px;
}

section h2 {
  text-align: center;
  color: var(--text-heading);
  margin-bottom: 8px;
  font-size: 1.5rem;
}

section h3 {
  margin: 24px 0 10px;
  color: var(--text-heading);
  font-size: 1.1rem;
}

.section-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.hint {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 6px;
}

/* ---------- Galeri ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--accent-soft);
}

.card figcaption {
  padding: 6px 10px 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.card-btn {
  margin: 8px;
  padding: 10px 8px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.25;
  min-height: 44px;
}

.card-btn:hover {
  background: var(--accent-dark);
}

/* ---------- Randevu formu ---------- */

.booking,
.panel {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin: 0 12px 32px;
  padding: 24px 16px;
}

.booking h2,
.panel h2 {
  margin-bottom: 20px;
}

.field {
  margin-bottom: 20px;
}

.field label,
.field .label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.req {
  color: var(--danger);
}

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px; /* iOS'ta odaklanınca yakınlaştırmayı önler */
  background: var(--surface);
}

.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
  background: var(--surface);
  resize: vertical;
}

.field .file-input {
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.95rem;
}

.ref-preview {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  max-width: 360px;
}

.ref-preview img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: var(--accent-soft);
  transition: opacity 0.2s;
}

.ref-preview.processing img {
  opacity: 0.5;
}

.ref-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
}

.ref-preview-bar .hint {
  margin-top: 0;
}

.email-suggest {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #3A2808;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.6;
}

.suggest-apply {
  border: none;
  background: none;
  padding: 0;
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  font-size: inherit;
  overflow-wrap: anywhere;
}

.email-suggest .link-btn {
  display: inline;
  margin-left: 6px;
  padding: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
}

.field textarea:focus,
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.selected-design {
  display: flex;
  align-items: center;
  gap: 14px;
}

.selected-design img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid var(--accent);
}

.link-btn {
  background: none;
  border: none;
  color: var(--danger);
  text-decoration: underline;
  padding: 8px 4px;
}

.calendar {
  max-width: 420px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cal-title {
  font-weight: 600;
  font-size: 1.05rem;
}

.cal-nav {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--accent);
}

.cal-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.cal-weekday {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0;
}

.cal-day {
  aspect-ratio: 1 / 1;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  font-size: 0.95rem;
  position: relative;
}

.cal-day.available {
  background: var(--bg-card);
  border-color: var(--pink-light);
  font-weight: 600;
  color: var(--pink-light);
}

.cal-day.available:hover {
  border-color: var(--accent);
}

.cal-day.full {
  color: #7A6654;
  text-decoration: line-through;
  cursor: not-allowed;
}

.cal-day.closed,
.cal-day.outside {
  color: #5A4A3C;
  cursor: not-allowed;
}

.cal-day.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--muted);
}

.cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display: inline-block;
}

.dot.available {
  background: var(--bg-card);
  border: 1px solid var(--pink-light);
}

.dot.full {
  background: #3A2D24;
}

.dot.closed {
  background: var(--surface);
  border: 1px solid var(--border);
}

.time-heading {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  color: var(--muted);
}

.time-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}

.time-picker .hint {
  grid-column: 1 / -1;
  margin-top: 0;
}

.time-btn {
  padding: 12px 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  font-size: 1rem;
  min-height: 44px;
}

.time-btn:hover:not(:disabled) {
  border-color: var(--accent);
}

.time-btn.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.time-btn.closed,
.time-btn.full {
  opacity: 0.45;
  cursor: not-allowed;
}

.time-btn.closed,
.time-btn.full {
  text-decoration: line-through;
}

.primary-btn,
button[type="submit"] {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  min-height: 48px;
}

.primary-btn:hover,
button[type="submit"]:hover {
  background: var(--accent-dark);
}

.primary-btn:disabled,
button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.message {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  display: none;
}

.message.success {
  display: block;
  background: #12301A;
  color: var(--ok);
}

.message.error {
  display: block;
  background: #3A1513;
  color: var(--danger);
}

footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 24px 16px;
  background: var(--bg-dark);
  color: var(--pink-light);
  font-size: 0.9rem;
}

footer a {
  color: inherit;
}

.about {
  padding-bottom: 0;
}

/* ---------- Randevu yönetimi (manage.html) ---------- */

.appt-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.appt-summary > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.appt-summary .hint {
  margin-top: 0;
}

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #3A2D24;
  color: var(--muted);
}

.status-badge.pending {
  background: #3A2808;
  color: #FFB84D;
}

.status-badge.approved {
  background: #12301A;
  color: var(--ok);
}

.status-badge.rejected,
.status-badge.cancelled {
  background: #3A1513;
  color: var(--danger);
}

.manage-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.secondary-btn {
  width: 100%;
  padding: 12px;
  min-height: 48px;
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  background: transparent;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 600;
}

.secondary-btn:hover:not(:disabled) {
  background: rgba(217, 90, 0, 0.06);
}

.on-dark .secondary-btn {
  border-color: var(--pink-light);
  color: var(--pink-light);
}

.secondary-btn.danger {
  color: var(--danger);
  border-color: #6B2A2A;
}

.secondary-btn.danger-solid {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.secondary-btn:disabled,
.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.confirm-box {
  padding: 16px;
  border: 1px solid #6B2A2A;
  background: #2A1210;
  border-radius: var(--radius);
}

.confirm-box p {
  margin-bottom: 14px;
}

.back-link {
  text-align: center;
  margin-top: 20px;
}

.back-link a {
  color: var(--accent);
}

/* ---------- Yönetim paneli ---------- */

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab-btn {
  flex: 0 0 auto;
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  font-size: 0.95rem;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tab-btn.logout {
  margin-left: auto;
  color: var(--danger);
}

.filter-bar,
.closure-form,
.upload-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input,
.filter-bar button,
.closure-form input,
.closure-form select,
.closure-form button {
  flex: 1 1 140px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 16px;
  min-height: 44px;
}

.upload-form {
  margin-bottom: 0;
}

.upload-form input[type="file"] {
  flex: 1 1 220px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface);
  min-width: 0;
}

.upload-form .primary-btn {
  flex: 0 0 auto;
  width: auto;
  padding: 10px 24px;
}

.appt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: var(--surface);
  flex-wrap: wrap;
}

.appt-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.appt-info {
  display: flex;
  flex-direction: column;
  flex: 1 1 200px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.appt-info .hint {
  margin-top: 2px;
}

.appt-actions {
  display: flex;
  gap: 8px;
  flex: 1 1 100%;
}

.appt-actions:empty {
  display: none;
}

.appt-actions button {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  min-height: 44px;
}

.appt-note {
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--bg);
  border-left: 3px solid var(--accent-soft);
  border-radius: 6px;
  white-space: pre-wrap;
  font-size: 0.9rem;
}

.appt-media {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.thumb-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.75rem;
}

.appt-actions .wa-btn {
  flex: 0 0 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 8px;
  background: #25d366;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.sched-info .wa-link {
  color: #128c4b;
  font-weight: 600;
}

.appt-row.clickable {
  cursor: pointer;
}

.appt-row.clickable:hover {
  border-color: var(--accent);
}

.btn-review {
  background: var(--accent);
}

.btn-ok {
  background: var(--ok);
}

.btn-danger,
.card-btn.btn-danger {
  background: var(--danger);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.weekday-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.weekday-table th,
.weekday-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
}

.weekday-table tr > th:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--bg);
}

.weekday-table input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  vertical-align: middle;
}

.weekday-row,
.closure-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.weekday-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.closure-row button {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
}

/* ---------- Geniş ekranlar ---------- */

@media (min-width: 640px) {
  .hero {
    padding: calc(64px + env(safe-area-inset-top, 0px)) 20px 56px;
  }

  .hero h1 {
    font-size: 2.6rem;
  }

  .hero-banner {
    padding: calc(32px + env(safe-area-inset-top, 0px)) 20px 36px;
  }

  .hero-small {
    padding: calc(40px + env(safe-area-inset-top, 0px)) 20px 32px;
  }

  .hero-small h1 {
    font-size: 2rem;
  }

  section {
    padding: 40px 20px;
  }

  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .admin-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .booking,
  .panel {
    margin: 0 auto 40px;
    padding: 32px;
    max-width: 720px;
  }

  .card-btn {
    font-size: 0.9rem;
  }

  .appt-actions {
    flex: 0 0 auto;
  }

  .appt-actions button {
    flex: 0 0 auto;
  }

  .manage-actions {
    flex-direction: row;
  }
}

/* ---------- Admin uyarıları ---------- */

.notify-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: #3A2808;
  font-size: 0.9rem;
}

.notify-bar.on {
  background: #12301A;
}

.notify-bar.unsupported,
.notify-bar.denied {
  background: #2A1E16;
  color: var(--muted);
}

.notify-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.notify-bar button {
  padding: 8px 14px;
  min-height: 40px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}

.notify-bar button.notify-secondary {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}

.toasts {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px 40px 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border-left: 5px solid var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  animation: toast-in 0.25s ease-out;
}

.toast.created {
  border-left-color: var(--ok);
}

.toast.changed {
  border-left-color: #e69500;
}

.toast.cancelled {
  border-left-color: var(--danger);
}

.toast span {
  font-size: 0.9rem;
  color: var(--muted);
}

.toast-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 1.3rem;
  color: var(--muted);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 640px) {
  .toasts {
    left: auto;
    width: 360px;
  }
}

/* ---------- Program (admin) ---------- */

.schedule-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.seg-btn {
  padding: 10px 16px;
  border: none;
  background: var(--surface);
  min-height: 44px;
}

.seg-btn.active {
  background: var(--accent);
  color: #fff;
}

.schedule-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.today-btn {
  padding: 10px 14px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.sched-title {
  margin-bottom: 0;
}

#sched-summary {
  margin-bottom: 12px;
}

.sched-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.sched-time {
  flex: 0 0 52px;
  font-weight: 700;
  color: var(--accent);
  padding-top: 2px;
}

.sched-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.sched-row.empty .sched-time,
.sched-row.empty .sched-body {
  color: var(--muted);
  font-weight: 400;
}

.sched-appt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #12301A;
  border-left: 4px solid var(--ok);
}

.sched-media {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.sched-thumb-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.7rem;
}

.sched-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-card);
}

.sched-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-wrap: anywhere;
}

.sched-info a {
  color: var(--text);
  font-size: 0.9rem;
}

.sched-empty {
  color: var(--muted);
  padding: 8px 0;
}

.schedule-week {
  display: grid;
  gap: 10px;
}

.sched-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px 4px;
}

.sched-col.today {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.sched-col.no-appts .sched-empty {
  display: none;
}

.sched-col-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border: none;
  background: none;
  font-weight: 600;
  text-align: left;
}

.sched-count {
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--pink-light);
  text-align: center;
  font-size: 0.85rem;
}

.sched-col .sched-row:last-child {
  border-bottom: none;
}

@media (min-width: 900px) {
  .schedule-week {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .sched-col-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .sched-col .sched-row {
    flex-direction: column;
    gap: 4px;
  }

  .sched-col .sched-appt {
    flex-direction: column;
    align-items: flex-start;
  }

  .sched-col.no-appts .sched-empty {
    display: block;
    font-size: 0.85rem;
  }
}
/* ---------- Başvuru detay penceresi ---------- */

body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
}

.modal-box {
  position: relative;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
}

.modal-box h3 {
  margin: 0 40px 4px 0;
  color: var(--accent);
}

.modal-box h4 {
  margin: 16px 0 6px;
  font-size: 0.95rem;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  font-size: 1.6rem;
  color: var(--muted);
}

.review-when {
  font-weight: 700;
  font-size: 1.1rem;
}

.appt-note.empty {
  color: var(--muted);
  font-style: italic;
}

.review-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.review-images figure {
  margin: 0;
}

.review-images img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--accent-soft);
}

.review-images figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.review-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.review-actions > * {
  flex: 1 1 120px;
  min-height: 48px;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
}

.review-actions .wa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #25d366;
  text-decoration: none;
}

.ref-badge {
  align-self: flex-start;
  margin-top: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #3A2808;
  color: #FFB84D;
  font-size: 0.8rem;
  font-weight: 600;
}

@media (min-width: 640px) {
  .modal {
    align-items: center;
  }

  .modal-box {
    max-width: 600px;
    border-radius: 18px;
    padding: 24px;
  }
}

/* ---------- Başvuru gönderildi penceresi ---------- */

.modal-center {
  align-items: center;
  padding: 16px;
}

.modal-center .modal-box {
  max-width: 400px;
  border-radius: 18px;
}

.success-box {
  text-align: center;
  padding: 28px 20px 20px;
  animation: pop-in 0.25s ease-out;
}

.success-box h3 {
  margin: 12px 0 8px;
  color: var(--ok);
  font-size: 1.5rem;
}

.success-box p {
  margin-bottom: 20px;
  color: var(--text);
}

.success-check {
  width: 84px;
  height: 84px;
  stroke: var(--ok);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success-check circle {
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: draw 0.5s ease-out forwards;
}

.success-check path {
  stroke-width: 4;
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  animation: draw 0.35s 0.45s ease-out forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Tarih kartı (onay pencereleri) ---------- */

.date-card {
  display: flex;
  align-items: stretch;
  margin: 12px 0 8px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--accent);
  text-align: left;
}

.date-card-day {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 10px 12px;
  background: var(--accent);
  color: #fff;
}

.dc-num {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
}

.dc-month {
  font-size: 0.85rem;
  margin-top: 4px;
  white-space: nowrap;
}

.date-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 14px;
  background: var(--bg-card);
}

.dc-weekday {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--pink-light);
}

.dc-time {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.date-card.is-today::after,
.date-card.is-soon::after {
  align-self: flex-start;
  margin: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.date-card.is-today::after {
  content: 'BUGÜN';
  background: var(--danger);
  color: #fff;
}

.date-card.is-soon::after {
  content: 'YARIN';
  background: #e69500;
  color: #fff;
}

.date-card.is-today .date-card-info,
.date-card.is-soon .date-card-info {
  padding-right: 0;
}

/* ---------- Uygulama yükleme çubuğu ---------- */

.install-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 960px;
  margin: 12px auto 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--bg-card);
  font-size: 0.9rem;
}

.install-bar[hidden] {
  display: none !important;
}

.install-bar img {
  border-radius: 10px;
  flex: 0 0 auto;
}

.install-bar span {
  flex: 1;
}

.install-bar #install-btn {
  padding: 8px 16px;
  min-height: 40px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.install-dismiss {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  font-size: 1.3rem;
  color: var(--muted);
}

@media (max-width: 999px) {
  .install-bar {
    margin: 12px 12px 0;
  }
}

/* ---------- Kapatmalar sekmesi koruması ---------- */

.tab-guard {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
}

.tab-guard-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation; /* hızlı dokunuşlarda çift dokunma yakınlaştırmasını engeller */
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Uyarı / hata popup ---------- */

.alert-box {
  text-align: center;
  padding: 28px 20px 20px;
  animation: pop-in 0.2s ease-out;
}

.alert-box h3 {
  margin: 10px 0 8px;
  color: var(--text-heading);
  font-size: 1.3rem;
}

.alert-box p {
  margin-bottom: 20px;
  color: var(--text);
  white-space: pre-line;
}

.alert-icon {
  width: 64px;
  height: 64px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
}

.alert-icon path {
  stroke-width: 4;
}

.alert-icon .dot {
  fill: var(--primary);
  stroke: none;
}


.sched-appt.clickable {
  cursor: pointer;
}

.sched-appt.past,
.appt-row.past {
  opacity: 0.45;
}

.avail-cal {
  max-width: 420px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
  margin-top: 16px;
}

.avail-day {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: none;
  font-size: 0.95rem;
}

.avail-day.available { color: var(--pink-light); font-weight: 600; }
.avail-day.full { color: #7A6654; text-decoration: line-through; }
.avail-day.closed { color: #5A4A3C; }

.avail-day.selected {
  border-color: var(--accent);
}

.avail-day .half {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
}

.avail-day .half:nth-child(1) { top: 0; }
.avail-day .half:nth-child(2) { top: 50%; }

.avail-day span {
  position: relative;
}

.half.available { background: var(--accent-soft); }
.half.full { background: #3A2D24; opacity: 0.6; }
.half.closed { background: none; }

.date-wrap {
  position: relative;
  flex: 1 1 140px;
  display: flex;
}

.date-wrap input {
  flex: 1 1 auto;
  width: 100%;
  padding-right: 64px;
}

.filter-bar .date-wrap .date-clear {
  position: absolute;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  flex: none;
  width: 22px;
  height: 22px;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--pink-light);
  font-size: 0.9rem;
  line-height: 1;
}

@media (min-width: 1000px) {
  #admin-section:has(#panel-schedule:not([hidden])) {
    max-width: 1280px;
  }

  .schedule-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 24px;
    align-items: start;
  }

  .schedule-layout .avail-cal {
    margin-top: 0;
    position: sticky;
    top: 16px;
  }
}

.appt-actions .btn-danger {
  flex: 0 0 auto;
  padding: 6px 12px;
  min-height: 34px;
  font-size: 0.85rem;
}

.sched-info .wa-link {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 6px;
}

@media (max-width: 599px) {
  .appt-actions {
    margin-top: 10px;
  }

  .sched-info .wa-link {
    margin-top: 8px;
  }
}

.resched-form {
  margin-top: 14px;
}

.resched-form h4 {
  margin-bottom: 6px;
}
