/* RandevuPro — ortak tema (açık + koyu) */
:root {
  color-scheme: light;       /* native time/date kontrolleri açık tema */
  --bg: #f5f6fb;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, #eceaff 0%, transparent 55%),
             radial-gradient(900px 500px at -10% 110%, #e6fbf4 0%, transparent 50%), #f5f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --line: #e7e9f2;
  --line-soft: #eef0f7;
  --brand: #5b5bf6;
  --brand-2: #8a6cff;
  --brand-dark: #4a45e0;
  --brand-soft: #ecebff;
  --text: #181b27;
  --muted: #6c7283;
  --green: #12a150;
  --green-bg: #e4f6ec;
  --red: #e23b4e;
  --red-bg: #fdeaec;
  --amber: #b8730a;
  --amber-bg: #fbf1df;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20,24,50,.04), 0 8px 24px rgba(20,24,50,.06);
  --shadow-lg: 0 24px 60px rgba(20,24,50,.18);
}

:root[data-theme="dark"] {
  color-scheme: dark;        /* native time/date kontrolleri koyu tema */
  --bg: #0d0f17;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, #1d1a3a 0%, transparent 55%),
             radial-gradient(900px 500px at -10% 110%, #0e2a24 0%, transparent 50%), #0d0f17;
  --surface: #161922;
  --surface-2: #1c2030;
  --line: #2a2f42;
  --line-soft: #232838;
  --brand: #7b7bff;
  --brand-2: #9b7cff;
  --brand-dark: #6a6aff;
  --brand-soft: #21243a;
  --text: #e9ebf5;
  --muted: #969cb3;
  --green: #34d27b;
  --green-bg: #16301f;
  --red: #ff6b7a;
  --red-bg: #361a1f;
  --amber: #f0b15a;
  --amber-bg: #332813;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg-grad); background-attachment: fixed;
  color: var(--text); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s, color .25s;
}
a { color: var(--brand); }
.hidden { display: none !important; }

/* --- Tema düğmesi --- */
.theme-toggle {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; transition: .15s;
}
.theme-toggle:hover { border-color: var(--brand); }

/* --- Butonlar --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 9px 16px; font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; background: var(--surface); color: var(--text); transition: all .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 4px 14px rgba(91,91,246,.3); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(91,91,246,.4); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* --- Formlar --- */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 11px 13px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field input::placeholder { color: var(--muted); opacity: .7; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* --- Seçilebilir etiket (sadakat, özel paket vb.) --- */
.chip-check { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-2, var(--surface)); font-size: 13px; cursor: pointer; user-select: none; transition: .15s; }
.chip-check:hover { border-color: var(--brand); }
.chip-check input { accent-color: var(--brand); width: 16px; height: 16px; cursor: pointer; }
.chip-check:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); font-weight: 600; }
:root[data-theme="dark"] .chip-check:has(input:checked) { color: var(--brand); }
.custom-pkg { border: 1px dashed var(--brand); border-radius: 10px; padding: 14px; margin: 4px 0 14px; background: var(--brand-soft); }

/* --- Admin filtre çubuğu --- */
.biz-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.biz-filters input, .biz-filters select {
  padding: 9px 11px; font-size: 13.5px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--text); font-family: inherit; cursor: pointer;
}
.biz-filters .f-search { flex: 1 1 220px; min-width: 160px; cursor: text; }
.biz-filters select:focus, .biz-filters input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.biz-count { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
@media (max-width: 680px) {
  .biz-filters select, .biz-filters input { flex: 1 1 calc(50% - 4px); }
}

/* --- Rozetler --- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-brand { background: var(--brand-soft); color: var(--brand-dark); }
:root[data-theme="dark"] .badge-brand { color: var(--brand); }

/* --- Giriş ekranı --- */
.login-view { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  background: var(--surface); width: 100%; max-width: 390px;
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 36px;
  position: relative;
}
.login-card .logo-mark {
  width: 46px; height: 46px; border-radius: 13px; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; font-weight: 800;
  box-shadow: 0 6px 18px rgba(91,91,246,.35);
}
.login-card h1 { font-size: 23px; margin: 0 0 4px; letter-spacing: -.4px; }
.login-card .sub { color: var(--muted); margin: 0 0 24px; font-size: 14px; }
.login-card .theme-toggle { position: absolute; top: 22px; right: 22px; }
.login-error { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 10px; }

/* --- Uygulama kabuğu --- */
.app-header {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); padding: 13px 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.3px; }
.brand .dot { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 3px 8px rgba(91,91,246,.4); }
.app-main { max-width: 1100px; margin: 0 auto; padding: 26px 24px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.toolbar h2 { margin: 0; font-size: 20px; letter-spacing: -.3px; }

/* --- Kart / Tablo --- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 16px; font-size: 14px; }
th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
tr + tr td { border-top: 1px solid var(--line-soft); }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
td .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.empty { padding: 44px; text-align: center; color: var(--muted); }

/* --- Modal --- */
.modal-overlay { position: fixed; inset: 0; background: rgba(12,15,28,.55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; animation: fade .15s; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: pop .18s; }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-size: 18px; letter-spacing: -.3px; }
.modal-body { padding: 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.x-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* --- Toast --- */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #11141f; color: #fff; padding: 12px 18px; border-radius: 11px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: slideup .22s; }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }
@keyframes slideup { from { opacity: 0; transform: translateY(10px); } }

/* --- Admin özet kartları --- */
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 15px 16px; }
.stat-val { font-size: 23px; font-weight: 800; letter-spacing: -.5px; }
.stat-val.v-green { color: var(--green); }
.stat-val.v-amber { color: var(--amber); }
.stat-val.v-brand { color: var(--brand-dark); }
:root[data-theme="dark"] .stat-val.v-brand { color: var(--brand); }
.stat-key { color: var(--muted); font-size: 13px; margin-top: 2px; }
@media (max-width: 640px) { .admin-stats { grid-template-columns: repeat(2, 1fr); } }

/* --- Yükleniyor --- */
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--muted); }
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .row2 { grid-template-columns: 1fr; }
  .app-main { padding: 14px; }
  .app-header { padding: 11px 14px; }
  .brand { font-size: 16px; gap: 8px; }
  .brand .dot { width: 18px; height: 18px; }
  #adminName { display: none; }            /* başlık daralmasın */
  .toolbar h2, .content h2 { font-size: 18px; }

  /* iOS odaklanınca zoom yapmasın diye input'lar 16px */
  .field input, .field select { font-size: 16px; }

  /* Geniş veri tabloları kırılmak yerine yatay kaydırılsın */
  .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 480px; }
  th, td { padding: 11px 12px; }

  /* Dokunması rahat butonlar + modal */
  .btn-sm { padding: 8px 12px; }
  .modal-body { padding: 18px; }
  .modal-head, .modal-foot { padding: 14px 18px; }
  #toast { left: 12px; right: 12px; transform: none; }
  .toast { text-align: center; }
}
