:root{
  --bg1:#020617;
  --bg2:#0b1220;

  --card:rgba(255,255,255,.06);
  --border:rgba(255,255,255,.10);
  --muted:rgba(255,255,255,.65);
  --muted2:rgba(255,255,255,.45);
  --white:#fff;

  --wa:#25D366;
  --wa2:#22c55e;
  --waSoft:rgba(37,211,102,.14);
  --waSoft2:rgba(37,211,102,.22);
  --waBorder:rgba(37,211,102,.38);
  --ring:rgba(37,211,102,.18);

  --shadow:0 10px 30px rgba(0,0,0,.28);
  --shadow2:0 14px 40px rgba(0,0,0,.38);

  --ease:160ms cubic-bezier(.2,.8,.2,1);
}

*{ box-sizing:border-box; }
html,body{ width:100%; overflow-x:hidden; }

body{
  margin:0;
  font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial;
  color:var(--white);
  background:
    radial-gradient(1200px 600px at 18% 0%, rgba(37,211,102,.07), transparent 55%),
    radial-gradient(900px 500px at 82% 10%, rgba(255,255,255,.05), transparent 55%),
    linear-gradient(180deg,var(--bg1),var(--bg2));
}

.container{
  max-width:1180px;
  margin:0 auto;
  padding:24px;
}

.card{
  background:linear-gradient(180deg, var(--card), rgba(255,255,255,.04));
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  padding:16px;
  box-shadow:var(--shadow);
  backdrop-filter: blur(10px);
  position:relative;
  overflow:hidden;
}

.card:hover{ box-shadow:var(--shadow2); }

.row{ display:flex; gap:12px; flex-wrap:wrap; }
.kpi{ flex:1; min-width:240px; min-height:92px; }
.kpi .title{ font-size:12px; color:var(--muted); }
.kpi .value{ font-size:34px; font-weight:800; margin-top:8px; letter-spacing:-0.6px; }

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

h1{ margin:0; font-size:22px; letter-spacing:-0.3px; }
.sub{ margin-top:6px; font-size:13px; color:var(--muted2); }

.tabs{ display:flex; gap:8px; margin-top:16px; flex-wrap:wrap; }

.tab{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  cursor:pointer;
  font-size:13px;
  transition: transform var(--ease), background var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.tab:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.16);
}

.tab.active{
  background: var(--waSoft);
  border-color: var(--waBorder);
  box-shadow: 0 10px 25px rgba(37,211,102,.12);
}

.btn{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color:var(--white);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  transition: transform var(--ease), background var(--ease), border-color var(--ease), box-shadow var(--ease), filter var(--ease);
  user-select:none;
}

.btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 12px 22px rgba(0,0,0,.22);
}

.btn:active{ transform: translateY(0); filter: brightness(.98); }
.btn:disabled{ opacity:.6; cursor:not-allowed; transform:none; box-shadow:none; }

.btn.whatsapp{
  background: linear-gradient(180deg, var(--wa), var(--wa2));
  color:#07130b;
  font-weight:900;
  border-color: rgba(0,0,0,.10);
  box-shadow: 0 12px 30px rgba(37,211,102,.22);
}
.btn.whatsapp:hover{ box-shadow: 0 16px 40px rgba(37,211,102,.28); }

.btn.icon{
  display:inline-flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
}
.btn .dot{
  width:10px;
  height:10px;
  border-radius:999px;
  background: rgba(7,19,11,.55);
  box-shadow: 0 0 0 4px rgba(0,0,0,.08) inset;
}

.tablewrap{ overflow-x:auto; margin-top:10px; }
table{ width:100%; border-collapse:collapse; font-size:13px; }
th,td{ text-align:left; padding:10px 8px; border-bottom:1px solid rgba(255,255,255,.06); }
th{ color:var(--muted2); font-weight:700; }
tr:hover td{ background: rgba(255,255,255,.03); }

.input, select, input[type="text"], input[type="search"]{
  width:100%;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color:var(--white);
  outline:none;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}
.input:focus, select:focus, input:focus{
  border-color: var(--waBorder);
  box-shadow: 0 0 0 4px var(--ring);
  background: rgba(255,255,255,.06);
}

.grid{
  display:grid;
  grid-template-columns: 2fr 1fr;
  gap:12px;
}

.list{ margin-top:10px; display:flex; flex-direction:column; gap:10px; }

.itembtn{
  width:100%;
  text-align:left;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  padding:14px;
  cursor:pointer;
  transition: transform var(--ease), background var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.itembtn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 14px 26px rgba(0,0,0,.25);
}
.itembtn.active{
  transform:none;
  background: var(--waSoft2);
  border-color: var(--waBorder);
  box-shadow: 0 14px 30px rgba(37,211,102,.12);
}

.mini{ font-size:12px; color:var(--muted2); margin-top:6px; }

.badge{
  display:inline-block;
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.88);
}

.chatbox, #chatBox{
  height:520px;
  overflow-y:auto;
  padding-right:4px;
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:10px;

  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.22);
  padding:12px;
}

.bubbleRow{ display:flex; margin:10px 0; }
.bubbleRow.user{ justify-content:flex-end; }
.bubbleRow.bot{ justify-content:flex-start; }

.bubble{
  max-width:min(560px, 85%);
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  padding:12px;
  font-size:13px;
  line-height:1.35;
  white-space:pre-wrap;
  animation: popIn 220ms var(--ease);
}

@keyframes popIn{
  from{ transform: translateY(4px); opacity:0; }
  to{ transform: translateY(0); opacity:1; }
}

.bubble.user{
  background: rgba(255,255,255,.92);
  color:#071024;
  border-color: rgba(255,255,255,.25);
}
.bubble.bot{
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  border-color: rgba(255,255,255,.12);
  box-shadow: inset 3px 0 0 0 rgba(37,211,102,.22);
}

.time{ margin-top:8px; font-size:11px; opacity:.7; }

.alert{
  margin-top:10px;
  border-radius:14px;
  border:1px solid rgba(255,80,80,.35);
  background: rgba(255,80,80,.10);
  padding:10px 12px;
  font-size:13px;
  color: rgba(255,200,200,.95);
}

#chatBox::-webkit-scrollbar,
#chatList::-webkit-scrollbar,
.chatbox::-webkit-scrollbar{ width:10px; }
#chatBox::-webkit-scrollbar-thumb,
#chatList::-webkit-scrollbar-thumb,
.chatbox::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.12);
  border-radius:999px;
  border:2px solid rgba(0,0,0,.25);
}
#chatBox::-webkit-scrollbar-track,
#chatList::-webkit-scrollbar-track,
.chatbox::-webkit-scrollbar-track{
  background: rgba(255,255,255,.04);
  border-radius:999px;
}

/* ✅ MOBİL GARANTİ: grid tek kolon + search width override */
@media (max-width: 820px){
  .container{ padding:14px; }

  .topbar{ flex-wrap:wrap; align-items:flex-start; }
  #logoutBtn{ width:100%; }

  .tab{ width:100%; }

  .kpi{ min-width:0 !important; }

  .grid{ grid-template-columns:1fr !important; gap:12px !important; }

  #viewChats .topbar{ flex-wrap:wrap; }
  #viewChats .topbar > div:last-child{ width:100% !important; }
  #searchInput{ width:100% !important; }

  #chatBox, .chatbox{ height:52vh !important; min-height:320px; }
  .bubble{ max-width:92% !important; }

  .btn{ width:100%; }
}


.appointment-card {
  background: linear-gradient(135deg, var(--card), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.3s ease;
}

.appointment-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  border-color: rgba(255,255,255,0.2);
}

/* =========================
   CX POLISH PATCH (append)
   ========================= */

/* 1) Daha iyi okunabilirlik + tutarlı ölçü sistemi */
:root{
  --radius:18px;
  --radiusSm:14px;

  --space-1:8px;
  --space-2:12px;
  --space-3:16px;
  --space-4:24px;

  /* metin kontrastını iyileştir */
  --muted: rgba(255,255,255,.72);
  --muted2: rgba(255,255,255,.52);

  /* daha “premium” border */
  --border: rgba(255,255,255,.12);

  /* focus ring (klavye) */
  --focus: rgba(103,61,230,.22); /* hafif mor, WA ile çakışmadan */
  --focus2: rgba(37,211,102,.22);
}

body{
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 2) Container: içerik genişliği + başlık alanı “nefes” */
.container{ padding: 26px; }
@media (max-width: 820px){ .container{ padding: 14px; } }

/* 3) Card: daha temiz katman + hover abartısını azalt (daha az motion fatigue) */
.card{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  box-shadow: 0 10px 28px rgba(0,0,0,.26);
}
.card:hover{
  box-shadow: 0 14px 36px rgba(0,0,0,.34);
}

/* 4) A11y: focus-visible her yerde tutarlı */
:where(button, a, input, select, textarea):focus{ outline: none; }
:where(button, a, input, select, textarea):focus-visible{
  box-shadow: 0 0 0 4px var(--focus2);
  border-color: var(--waBorder);
}

/* 5) Tabs: aktif tab daha net + hover’da zıplama daha az */
.tab{
  border-radius: 999px; /* “pill” daha net */
  padding: 10px 14px;
  transform: none;
}
.tab:hover{
  transform: none;
  background: rgba(255,255,255,.075);
}
.tab.active{
  background: linear-gradient(180deg, rgba(37,211,102,.18), rgba(37,211,102,.10));
  border-color: rgba(37,211,102,.46);
}

/* 6) Butonlar: daha net hiyerarşi (primary/secondary hissi) */
.btn{
  border-radius: 999px;
  padding: 10px 14px;
}
.btn.whatsapp{
  color: #03110a;
  letter-spacing: .2px;
  box-shadow: 0 14px 34px rgba(37,211,102,.20);
}
.btn.whatsapp:hover{
  box-shadow: 0 18px 44px rgba(37,211,102,.26);
}

/* 7) Inputs: placeholder kontrast + “search” alanı daha premium */
.input::placeholder,
input[type="search"]::placeholder{
  color: rgba(255,255,255,.42);
}
.input{
  border-radius: 999px;
  background: rgba(255,255,255,.045);
}
.input:focus{
  background: rgba(255,255,255,.06);
}

/* 8) Liste item: daha net bilgi hiyerarşisi + aktif seçimin farkı */
.itembtn{
  border-radius: var(--radiusSm);
  padding: 14px 14px;
  transform: none;
}
.itembtn:hover{
  transform: none; /* sürekli zıplama yerine “soft glow” */
  background: rgba(255,255,255,.07);
  box-shadow: 0 10px 20px rgba(0,0,0,.22);
}
.itembtn.active{
  background: linear-gradient(180deg, rgba(37,211,102,.18), rgba(255,255,255,.05));
  border-color: rgba(37,211,102,.50);
}

/* 9) Tablo: satır okunabilirliği + mobil scroll ipucu */
.tablewrap{
  position: relative;
  border-radius: 14px;
}
.tablewrap::after{
  content:"";
  pointer-events:none;
  position:absolute;
  top:0; right:0;
  width: 28px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,.28));
  opacity:.0;
  transition: opacity var(--ease);
}
@media (max-width: 820px){
  .tablewrap::after{ opacity: .9; }
}
th, td{ padding: 12px 10px; }
tr:hover td{ background: rgba(255,255,255,.035); }

/* 10) Chatbox: sticky “meta” hissi + daha iyi scroll davranışı */
.chatbox, #chatBox{
  background: rgba(0,0,0,.24);
  border-radius: var(--radius);
  scroll-behavior: smooth;
}

/* Mesaj balonları: daha rahat okuma */
.bubble{
  border-radius: 18px;
  line-height: 1.45;
  font-size: 13.5px;
}
.bubble.user{
  background: rgba(255,255,255,.94);
}
.bubble.bot{
  background: rgba(255,255,255,.07);
  box-shadow: inset 4px 0 0 0 rgba(37,211,102,.22);
}

/* 11) Durum feedback: "loading skeleton" sınıfı (JS ekleyebilirsin) */
.skeleton{
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
}
.skeleton::before{
  content:"";
  position:absolute;
  inset:0;
  transform: translateX(-60%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.10), transparent);
  animation: shimmer 1.1s linear infinite;
}
@keyframes shimmer{
  to{ transform: translateX(60%); }
}

/* 12) Alert: daha okunur + ikon alanı (istersen HTML’ye küçük ikon eklenir) */
.alert{
  border-radius: var(--radiusSm);
  background: rgba(255,80,80,.12);
  border-color: rgba(255,80,80,.40);
  color: rgba(255,220,220,.96);
}

/* 13) Randevu kartları: status için class destekle (JS’e dokunmadan da olur) */
.appointment-card{
  border-radius: var(--radiusSm);
  box-shadow: 0 10px 22px rgba(0,0,0,.24);
}
.appointment-card:hover{
  transform: none; /* mobilde + yaşlı kullanıcıda motion fatigue azalt */
  box-shadow: 0 14px 30px rgba(0,0,0,.32);
}

/* 14) Reduced motion: animasyonları kırp */
@media (prefers-reduced-motion: reduce){
  *{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .bubble{ animation: none !important; }
}

/* 15) Mobil: "CTA" butonlar üst üste + daha rahat dokunma alanı */
@media (max-width: 820px){
  .tabs{ gap: 10px; }
  .tab{ padding: 12px 14px; }
  .btn{ padding: 12px 14px; }
}

/* =========================
   Appointments UX Upgrade
   ========================= */

#appointmentsList{
  padding: 14px !important;
  gap: 10px !important;
}

/* daha “liste” hissi, daha az boşluk */
.appointment-card{
  border-radius: 16px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 14px;
  align-items: start;

  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.035));
  border: 1px solid rgba(255,255,255,.10);
}

/* hover’ı yumuşat (zıplama yok) */
.appointment-card:hover{
  transform: none;
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 14px 32px rgba(0,0,0,.32);
}

.ap-left{
  min-width: 0;
  display: grid;
  gap: 6px;
}

.ap-title{
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.ap-name{
  font-weight: 800;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-meta{
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted2);
  font-size: 12px;
}

.ap-right{
  display: grid;
  justify-items: end;
  gap: 8px;
}

.ap-dt{
  display: flex;
  gap: 10px;
  align-items: center;
  color: rgba(255,255,255,.75);
  font-size: 12px;
  white-space: nowrap;
}

.ap-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
}

.ap-pill[data-status="bekliyor"]{
  background: rgba(255, 167, 38, .16);
  border-color: rgba(255, 167, 38, .32);
  color: rgba(255, 214, 170, .95);
}
.ap-pill[data-status="onaylandi"]{
  background: rgba(37,211,102,.14);
  border-color: rgba(37,211,102,.32);
  color: rgba(210,255,230,.95);
}
.ap-pill[data-status="iptal"]{
  background: rgba(255,80,80,.14);
  border-color: rgba(255,80,80,.32);
  color: rgba(255,220,220,.95);
}

.ap-actions{
  display:flex;
  gap:8px;
}

.ap-action{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.92);
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease);
  font-size: 12px;
  font-weight: 800;
}
.ap-action:hover{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.16);
}

.ap-action.wa{
  background: rgba(37,211,102,.14);
  border-color: rgba(37,211,102,.28);
}
.ap-action.wa:hover{
  background: rgba(37,211,102,.18);
  border-color: rgba(37,211,102,.38);
}

@media (max-width: 820px){
  .appointment-card{
    grid-template-columns: 1fr;
  }
  .ap-right{
    justify-items: start;
  }
  .ap-dt{ white-space: normal; }
}

