/* ============================================================
   Turuncu Randevu — Tasarım Sistemi
   Tek kaynak: CSS değişkenleri (light + dark). Tailwind renkleri
   bu değişkenlere bağlı (tailwind-config.js), böylece tema tek
   yerden değişir.
   ============================================================ */

:root {
  --brand: #F97316;
  --brand-hover: #EA580C;
  --brand-strong: #C2410C;
  --brand-subtle: #FFF7ED;
  --brand-ring: rgba(249, 115, 22, 0.18);
  --on-brand: #FFFFFF;

  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --surface-hover: #F8FAFC;
  --sidebar: #0F172A;
  --sidebar-2: #1E293B;
  --sidebar-text: #CBD5E1;
  --sidebar-muted: #64748B;
  --sidebar-active: rgba(249, 115, 22, 0.16);

  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --text-2: #334155;
  --muted: #64748B;
  --faint: #94A3B8;

  --accent: #3B82F6;
  --accent-subtle: #EFF6FF;

  --success: #16A34A;
  --success-subtle: #F0FDF4;
  --warning: #D97706;
  --warning-subtle: #FFFBEB;
  --danger: #DC2626;
  --danger-subtle: #FEF2F2;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 32px -8px rgba(15, 23, 42, 0.18);
  --shadow-pop: 0 16px 40px -12px rgba(234, 88, 12, 0.32);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  color-scheme: light;
}

html.dark {
  --brand: #FB923C;
  --brand-hover: #F97316;
  --brand-strong: #FDBA74;
  --brand-subtle: rgba(249, 115, 22, 0.14);
  --brand-ring: rgba(251, 146, 60, 0.24);
  --on-brand: #0F172A;

  --bg: #0B1120;
  --surface: #111827;
  --surface-2: #1E293B;
  --surface-hover: #1E293B;
  --sidebar: #020617;
  --sidebar-2: #0F172A;
  --sidebar-text: #CBD5E1;
  --sidebar-muted: #64748B;
  --sidebar-active: rgba(251, 146, 60, 0.18);

  --border: #1F2937;
  --border-strong: #334155;
  --text: #F1F5F9;
  --text-2: #CBD5E1;
  --muted: #94A3B8;
  --faint: #64748B;

  --accent: #60A5FA;
  --accent-subtle: rgba(96, 165, 250, 0.12);

  --success: #22C55E;
  --success-subtle: rgba(34, 197, 94, 0.12);
  --warning: #FBBF24;
  --warning-subtle: rgba(251, 191, 36, 0.12);
  --danger: #F87171;
  --danger-subtle: rgba(248, 113, 113, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px -8px rgba(0, 0, 0, 0.6);
  --shadow-pop: 0 16px 40px -12px rgba(0, 0, 0, 0.6);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { min-height: 100vh; }

h1, h2, h3, h4 { letter-spacing: -0.018em; font-weight: 600; margin: 0; }
.tnum { font-variant-numeric: tabular-nums; }

::selection { background: var(--brand-ring); }

/* Scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; font-family: inherit;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
  text-decoration: none;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-brand { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-sm); }
.btn-brand:hover:not(:disabled) { background: var(--brand-hover); }
.btn-dark { background: var(--text); color: var(--surface); }
.btn-dark:hover:not(:disabled) { opacity: .9; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--border-strong); }
.btn-soft { background: var(--surface-2); color: var(--text); }
.btn-soft:hover:not(:disabled) { background: var(--border); }
.btn-danger { background: var(--danger-subtle); color: var(--danger); border-color: transparent; }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { filter: brightness(.95); }
.btn-block { width: 100%; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-icon { width: 40px; height: 40px; padding: 0; }

/* ---------- Inputs ---------- */
.field { display: block; }
.field + .field { margin-top: 14px; }
.field-label {
  display: block; font-size: 13px; font-weight: 500; color: var(--text-2);
  margin-bottom: 6px;
}
.input, .select, textarea.input {
  width: 100%; height: 42px; padding: 0 13px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 14px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 96px; padding: 11px 13px; line-height: 1.5; resize: vertical; }
.input::placeholder { color: var(--faint); }
.input:hover { border-color: var(--border-strong); }
.input:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-subtle); }
.field-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.field-error { display: block; margin-top: 6px; font-size: 12px; font-weight: 500; color: var(--danger); }

.input-otp { text-align: center; font-size: 26px; letter-spacing: 14px; font-weight: 700; height: 58px; }
.input-code { text-align: center; font-size: 20px; letter-spacing: 8px; font-weight: 700; text-transform: uppercase; }

/* ---------- Card ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-hover { transition: border-color .15s, box-shadow .15s, transform .1s; cursor: pointer; }
.card-hover:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }

/* ---------- KPI ---------- */
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.kpi-label { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 30px; font-weight: 700; margin-top: 6px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- Badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.4;
}
.badge-brand   { background: var(--brand-subtle); color: var(--brand-strong); }
.badge-success { background: var(--success-subtle); color: var(--success); }
.badge-warning { background: var(--warning-subtle); color: var(--warning); }
.badge-danger  { background: var(--danger-subtle); color: var(--danger); }
.badge-info    { background: var(--accent-subtle); color: var(--accent); }
.badge-muted   { background: var(--surface-2); color: var(--muted); }
.badge-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

/* ---------- Chip (filter) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand-strong); }
.chip.active { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .03em; padding: 10px 14px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface);
}
.table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-hover); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-state svg { width: 44px; height: 44px; margin: 0 auto 14px; color: var(--faint); display: block; }
.empty-state h3 { font-size: 16px; color: var(--text); margin-bottom: 6px; }

/* ---------- Modal / Drawer ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(2px); z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 16px;
}
.overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  max-width: 520px; width: 100%; max-height: 86vh; overflow: hidden;
  display: flex; flex-direction: column;
}
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(440px, 92vw);
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg); z-index: 101; transform: translateX(100%);
  transition: transform .22s ease; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }

/* ---------- Misc layout helpers ---------- */
.muted { color: var(--muted); }
.divider { height: 1px; background: var(--border); border: none; margin: 0; }
.spinner {
  display: inline-block; width: 18px; height: 18px; border-radius: 999px;
  border: 2px solid var(--border); border-top-color: var(--brand); animation: spin .7s linear infinite;
}
.spinner-light { border-color: rgba(255,255,255,.4); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

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