/* ============================================
   KLİNİK CRM — TASARIM SİSTEMİ
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Renkler */
  --ink: #16232a;
  --ink-soft: #4a5b63;
  --muted: #8a9aa1;
  --bg: #f2f5f4;
  --surface: #ffffff;
  --border: #e2e8e6;

  --primary: #1f4d4d;
  --primary-dark: #143636;
  --primary-soft: #e4efee;

  --accent: #e0973e;
  --accent-soft: #fbeedd;

  --success: #2f9e44;
  --success-soft: #e6f6e9;
  --danger: #e03131;
  --danger-soft: #fdeaea;
  --violet: #7048e8;
  --violet-soft: #eee6fb;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(22,35,42,0.06), 0 4px 16px rgba(22,35,42,0.05);
  --shadow-hover: 0 2px 6px rgba(22,35,42,0.08), 0 8px 24px rgba(22,35,42,0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, Segoe UI, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: 'Outfit', 'Inter', sans-serif;
  color: var(--ink);
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
}
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; color: var(--ink-soft); }

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

/* ============================================
   APP SHELL — Sidebar + İçerik
   ============================================ */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--primary-dark);
  color: #dfeeec;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: #ffffff;
  padding: 0 8px 20px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 16px;
}
.sidebar .brand .isletme-tur {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 12px;
  color: #8fb4b0;
  margin-top: 2px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #cfe4e1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}
.sidebar nav a:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}
.sidebar nav a.active {
  background: var(--accent);
  color: #1f1608;
  font-weight: 600;
}
.sidebar nav .icon { font-size: 16px; width: 18px; text-align: center; }

.nav-dropdown { margin-top: 14px; }
.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 4px 12px 6px;
  border-radius: var(--radius-sm);
  color: #7fa39e;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 2px;
  cursor: pointer;
  transition: color 0.15s;
}
.nav-dropdown-toggle:hover { color: #cfe4e1; }
.nav-dropdown-toggle.active { color: var(--accent); }
.nav-dropdown-arrow {
  margin-left: auto;
  font-size: 10px;
  transition: transform 0.2s ease;
}
.nav-dropdown.open .nav-dropdown-arrow { transform: rotate(180deg); }

.nav-dropdown-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
}
.nav-dropdown.open .nav-dropdown-menu { max-height: 260px; }
.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 20px;
  border-radius: var(--radius-sm);
  color: #cfe4e1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}
.nav-dropdown-menu a:hover { background: rgba(255,255,255,0.08); color: #ffffff; }
.nav-dropdown-menu a.active { background: var(--accent); color: #1f1608; font-weight: 600; }

.sidebar .sidebar-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.sidebar .sidebar-footer a {
  color: #8fb4b0;
  font-size: 13px;
  text-decoration: none;
}
.sidebar .sidebar-footer a:hover { color: #ffffff; }

.main {
  flex: 1;
  min-width: 0;
  padding: 32px 40px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header .subtitle {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 2px;
}

/* ============================================
   KARTLAR / ÖZET KUTULARI
   ============================================ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat-card .stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}
.stat-card .stat-label {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}
.stat-card.accent { border-left-color: var(--accent); }
.stat-card.success { border-left-color: var(--success); }
.stat-card.violet { border-left-color: var(--violet); }

.card, .form-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

/* ============================================
   BUTONLAR
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #ffffff !important;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn:hover { background: var(--primary-dark); box-shadow: var(--shadow-hover); }
.btn:active { transform: translateY(1px); }

.btn-secondary { background: var(--surface); color: var(--ink) !important; border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: #c97e2c; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b82525; }
.btn-violet { background: var(--violet); }
.btn-violet:hover { background: #5a35c9; }

/* ============================================
   FORMLAR
   ============================================ */

input[type="text"], input[type="email"], input[type="date"],
input[type="time"], input:not([type]), select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  margin-bottom: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
label { font-weight: 600; font-size: 13.5px; color: var(--ink-soft); }

/* ============================================
   TABLOLAR
   ============================================ */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
th {
  background: var(--primary-soft);
  color: var(--primary-dark);
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 11px 14px;
  font-weight: 700;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ============================================
   DURUM ROZETLERİ (Pill Badges)
   ============================================ */

.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.Aranacak { background: var(--accent-soft); color: #8a5a1e; }
.badge.Arandı   { background: var(--primary-soft); color: var(--primary-dark); }
.badge.Tamamlandı { background: var(--success-soft); color: #1f6b2c; }

.musait { background: var(--success-soft); color: #1f6b2c; }
.dolu   { background: var(--danger-soft); color: #a11f1f; }

.badge.durum-musait  { background: var(--success-soft); color: #1f6b2c; }
.badge.durum-mesgul   { background: var(--accent-soft); color: #8a5a1e; }
.badge.durum-nobetci  { background: var(--violet-soft); color: var(--violet); }
.badge.durum-kapali   { background: var(--bg); color: var(--muted); }

/* ============================================
   İŞLETME / PERSONEL DURUM KARTLARI (Panel)
   ============================================ */

.durum-ozet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.acik-kapali-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}
.acik-kapali-pill.acik { background: var(--success-soft); color: #1f6b2c; }
.acik-kapali-pill.kapali { background: var(--bg); color: var(--muted); }
.acik-kapali-pill .nokta {
  width: 8px; height: 8px; border-radius: 50%; background: currentColor;
}

.personel-durum-listesi { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.personel-durum-satir {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: var(--radius-sm); background: var(--bg);
}
.personel-durum-satir .ad { font-weight: 600; font-size: 13.5px; }

.nobetci-notu {
  margin-top: 12px; font-size: 13px; color: var(--ink-soft);
  background: var(--violet-soft); color: var(--violet); font-weight: 600;
  padding: 8px 12px; border-radius: var(--radius-sm);
}
.nobetci-notu.nobetci-notu-uyari {
  background: rgba(217, 140, 15, 0.14); color: #a8690a;
}
.randevu { background: var(--violet-soft); color: #4a2ea3; }

/* ============================================
   TAKVİM
   ============================================ */

.ay-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.gun-basliklar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; font-weight: 700;
  text-align: center; margin-top: 24px; font-size: 12px; color: var(--muted); text-transform: uppercase; }

.gun-hucre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  min-height: 46px;
  text-decoration: none;
  color: var(--ink) !important;
  display: block;
  font-weight: 600;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.gun-hucre:hover { box-shadow: var(--shadow-hover); border-color: var(--primary); }
.gun-hucre.kapali { background: var(--bg); color: var(--muted) !important; cursor: default; font-weight: 400; }
.gun-hucre.kapali:hover { box-shadow: none; border-color: var(--border); }
.gun-hucre.bugun { border: 2px solid var(--accent); }
.gun-hucre.baska-ay { opacity: 0.35; }

.ay-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }

.slot-list { max-width: 420px; margin-top: 16px; }
.slot-item {
  padding: 12px 14px; margin-bottom: 8px; border-radius: var(--radius-sm); cursor: pointer;
  font-weight: 600; box-shadow: var(--shadow); transition: transform 0.1s;
}
.slot-item:hover { transform: translateX(2px); }
.slot-item.musait { background: var(--success-soft); color: #1f6b2c; }
.slot-item.dolu { background: var(--danger-soft); color: #a11f1f; }
.slot-item.randevu { background: var(--violet-soft); color: #4a2ea3; }

/* ============================================
   YARDIMCI SINIFLAR
   ============================================ */

.yardim { font-size: 12.5px; color: var(--muted); margin: -6px 0 10px 0; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 14px; }

/* ============================================
   SIDEBAR AÇ/KAPA — Kenar Tutamacı (Edge Handle)
   ============================================ */

.sidebar {
  transition: margin-left 0.2s ease, opacity 0.15s ease;
}

.sidebar-handle {
  position: fixed;
  top: 96px;
  left: 232px;
  transform: translateX(-50%);
  z-index: 20;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: left 0.2s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.sidebar-handle:hover {
  box-shadow: var(--shadow-hover);
  color: var(--primary);
}
.sidebar-handle-arrow {
  transform: translateX(-1px);
}

.app-shell.sidebar-collapsed .sidebar {
  margin-left: -232px;
  opacity: 0;
  pointer-events: none;
}

.app-shell.sidebar-collapsed .sidebar-handle {
  left: 8px;
  transform: translateX(0);
  background: var(--primary);
  border-color: var(--primary-dark);
  color: #ffffff;
}
.app-shell.sidebar-collapsed .sidebar-handle:hover {
  background: var(--primary-dark);
  color: #ffffff;
}

/* ============================================
   GENEL UYARI BARI (mesai saati vb. kritik durumlar)
   ============================================ */

.uyari-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  background: linear-gradient(135deg, #e8433f, #c92a2a);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
  box-shadow: 0 2px 14px rgba(201, 42, 42, 0.35);
  position: relative;
  z-index: 20;
  animation: uyari-bar-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.uyari-bar-icon {
  font-size: 16px;
  animation: uyari-bar-pulse 2.2s ease-in-out infinite;
}
.uyari-bar a {
  margin-left: auto;
  color: #c92a2a;
  background: #ffffff;
  padding: 5px 14px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.uyari-bar a:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.18); }

.uyari-bar.uyari-bar-info {
  background: linear-gradient(135deg, #f0a020, #d98c0f);
  box-shadow: 0 2px 14px rgba(217, 140, 15, 0.32);
}
.uyari-bar.uyari-bar-info a { color: #d98c0f; }
.uyari-bar.uyari-bar-info .uyari-bar-icon { animation: none; }

.uyari-bar.uyari-bar-kapali {
  background: linear-gradient(135deg, #5c6b73, #3f4b52);
  box-shadow: 0 2px 14px rgba(63, 75, 82, 0.32);
}
.uyari-bar.uyari-bar-kapali a { color: #3f4b52; }
.uyari-bar.uyari-bar-kapali .uyari-bar-icon { animation: none; }

@keyframes uyari-bar-in {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes uyari-bar-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: 0.7; }
}
@media (prefers-reduced-motion: reduce) {
  .uyari-bar { animation: none; }
  .uyari-bar-icon { animation: none; }
}

/* ============================================
   DOSYA EKLERİ (müşteri/personel)
   ============================================ */

.dosya-listesi { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.dosya-satir {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.dosya-ikon { font-size: 16px; }
.dosya-ad { flex: 1; font-weight: 600; font-size: 13.5px; color: var(--ink); text-decoration: none; }
.dosya-ad:hover { text-decoration: underline; }
.dosya-tarih { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ============================================
   HİZMET FİYATLARI (modüler: standart/üyelik/abonelik/kampanya)
   ============================================ */

.fiyat-detay {
  margin: 0 0 4px;
}
.fiyat-detay summary {
  cursor: pointer;
  padding: 6px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  list-style: none;
}
.fiyat-detay summary::-webkit-details-marker { display: none; }
.fiyat-detay[open] summary { color: var(--primary-dark); }

.fiyat-panel {
  padding: 12px 14px;
  margin: 4px 0 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.fiyat-listesi { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.fiyat-satir {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 13px;
}
.fiyat-satir.fiyat-pasif { opacity: 0.55; }
.fiyat-ad { font-weight: 600; }
.fiyat-tutar { font-weight: 700; color: var(--primary-dark); }
.fiyat-tarih-araligi, .fiyat-aciklama { font-size: 11.5px; color: var(--muted); }
.fiyat-aksiyonlar { margin-left: auto; display: flex; gap: 6px; }

.badge.fiyat-standart { background: var(--primary-soft); color: var(--primary-dark); }
.badge.fiyat-uyelik   { background: var(--violet-soft); color: var(--violet); }
.badge.fiyat-abonelik { background: var(--success-soft); color: #1f6b2c; }
.badge.fiyat-kampanya { background: var(--accent-soft); color: #8a5a1e; }
.badge.fiyat-diger    { background: var(--bg); color: var(--muted); }

.fiyat-ekle-form { border-top: 1px solid rgba(0,0,0,0.06); padding-top: 10px; }
.fiyat-ekle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  align-items: center;
}
.fiyat-ekle-grid input, .fiyat-ekle-grid select { margin: 0; }
.fiyat-ekle-grid .fiyat-aciklama-input { grid-column: 1 / -1; }
.fiyat-ekle-grid button { grid-column: 1 / -1; justify-self: start; }

.ek-bilgi-baslik { font-size: 12.5px; font-weight: 700; color: var(--primary-dark); margin-bottom: 6px; }
.ek-bilgi-form { border-bottom: 1px solid rgba(0,0,0,0.06); padding-bottom: 12px; margin-bottom: 12px; }

/* ============================================
   TOAST BİLDİRİMLERİ (işlem onay mesajları)
   ============================================ */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-hover);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  min-width: 240px;
  max-width: 360px;
  animation: toast-in 0.25s ease;
}

.toast-hide { opacity: 0; transform: translateX(20px); transition: opacity 0.3s, transform 0.3s; }

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  font-size: 12px;
  color: #ffffff;
  background: var(--primary);
}

.toast-success .toast-icon { background: var(--success); }
.toast-error .toast-icon { background: var(--danger); }
.toast-warning .toast-icon { background: var(--accent); }

.toast-text { flex: 1; line-height: 1.4; }

.toast-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.toast-close:hover { color: var(--ink); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 720px) {
  .app-shell:not(.sidebar-collapsed) .sidebar {
    position: fixed;
    z-index: 15;
    box-shadow: var(--shadow-hover);
  }
  .main { padding: 24px 20px; }
}
