:root{
  --bg:#0b1020;
  --panel:#111833;
  --card:#0f1730;
  --text:#e8ecff;
  --muted:#a9b1d6;
  --line:rgba(255,255,255,.08);
  --accent:#7aa2f7;
  --accent2:#2ac3de;
  --danger:#ff5c7a;
  --ok:#9ece6a;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius:14px;
  --radius2:10px;
  --pad:16px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  background: radial-gradient(1200px 600px at 15% 0%, #16224a 0%, var(--bg) 55%);
  color:var(--text);
}

a{color:var(--accent); text-decoration:none}
a:hover{text-decoration:underline}

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

.sidebar{
  width:260px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border-right:1px solid var(--line);
  padding:18px;
  position:sticky;
  top:0;
  height:100vh;
}

.brand{
  padding:14px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:rgba(255,255,255,.03);
  box-shadow: var(--shadow);
}
.brand-title{font-weight:800; letter-spacing:.2px; font-size:18px}
.brand-sub{color:var(--muted); margin-top:4px; font-size:13px}

.nav{margin-top:16px; display:flex; flex-direction:column; gap:8px}
.nav-item{
  display:block;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid transparent;
  background:rgba(255,255,255,.02);
}
.nav-item:hover{
  border-color:var(--line);
  background:rgba(255,255,255,.04);
  text-decoration:none;
}

.sidebar-footer{margin-top:auto; padding:12px; color:var(--muted); font-size:12px}

.main{flex:1; padding:18px}
.topbar{
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:14px 16px;
  background:rgba(255,255,255,.03);
  box-shadow: var(--shadow);
}
.topbar-title{font-size:16px; font-weight:700}

.content{margin-top:16px; display:flex; flex-direction:column; gap:14px}

.card{
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:rgba(255,255,255,.03);
  box-shadow: var(--shadow);
  padding:16px;
}

.grid{display:grid; gap:14px}
.grid-2{grid-template-columns: repeat(2, minmax(0,1fr))}
@media (max-width: 980px){
  .sidebar{display:none}
  .grid-2{grid-template-columns:1fr}
}

.h-row{display:flex; align-items:center; justify-content:space-between; gap:12px}
.muted{color:var(--muted)}
.badge{
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(255,255,255,.03);
  color:var(--muted);
  font-size:12px;
}

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
  font-weight:600;
}
.btn:hover{background:rgba(255,255,255,.06)}
.btn-primary{border-color: rgba(122,162,247,.45); background: rgba(122,162,247,.15)}
.btn-danger{border-color: rgba(255,92,122,.45); background: rgba(255,92,122,.12)}

.input, select, textarea{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.25);
  color:var(--text);
  outline:none;
}
textarea{min-height:90px; resize:vertical}
label{font-size:13px; color:var(--muted); display:block; margin:10px 0 6px}

.table{
  width:100%;
  border-collapse:collapse;
  overflow:hidden;
  border-radius:14px;
  border:1px solid var(--line);
}
.table th, .table td{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  text-align:left;
  font-size:14px;
}
.table th{color:var(--muted); font-weight:700; background:rgba(255,255,255,.03)}
.table tr:hover td{background:rgba(255,255,255,.02)}
.table td small{color:var(--muted)}

hr{border:none; border-top:1px solid var(--line); margin:16px 0}

/* --- Sidebar icons (simple, asset-free) --- */
.nav-item { display:flex; align-items:center; gap:10px; }
.nav-ico { width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; border-radius:8px; opacity:.95; }
.nav-ico::before { font-size:16px; line-height:1; }

/* icon mappings */
.ico-patients::before { content:"👤"; }
.ico-transfer::before { content:"🔁"; }
.ico-overdue::before { content:"⏰"; }
.ico-users::before { content:"👥"; }
.ico-audit::before { content:"🧾"; }
.ico-login::before { content:"🔐"; }
.ico-money::before { content:"💰"; }

/* inline partial payment form */
.pay-inline { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.input-sm { padding:8px 10px; min-width:120px; }
.btn-sm { padding:8px 10px; }

/* Cari üst özet 4'lü satır */
.summary-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.summary-card{
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  border-radius: 16px;
  padding: 12px 14px;
}
.summary-value{
  font-size: 20px;
  font-weight: 800;
  margin-top: 4px;
}

/* Responsive: tablet ve altı otomatik kır */
@media (max-width: 1100px){
  .summary-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px){
  .summary-grid{ grid-template-columns: 1fr; }
}

/* ===== Select (Dropdown) Dark Theme Fix ===== */
select.input {
  background-color: #0f172a;        /* koyu arka plan */
  color: #e5e7eb;                   /* açık yazı */
  border: 1px solid rgba(255,255,255,.15);
}

/* Açılan seçenekler */
select.input option {
  background-color: #0f172a;
  color: #e5e7eb;
}

/* Hover edilen seçenek */
select.input option:hover,
select.input option:focus {
  background-color: #1e293b;
  color: #ffffff;
}

/* Seçili option (özellikle Windows Chrome) */
select.input option:checked {
  background-color: #2563eb;        /* mavi */
  color: #ffffff;
}

/* Disabled / pasif görünümler */
select.input option:disabled {
  color: #94a3b8;
}

/* iOS / Safari için ekstra */
select.input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(37,99,235,.4);
}


/* ===== Sidebar footer ===== */
.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  font-size: 12px;
  opacity: .85;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-footer .version {
  font-size: 11px;
  opacity: .6;
}

/* ===== Global footer ===== */
.app-footer {
  text-align: center;
  font-size: 12px;
  opacity: .6;
  padding: 24px 0 10px;
}

.app-footer a {
  color: inherit;
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

/* ===== Select / dropdown okunurluk ===== */
select,
select option {
  background-color: #0f172a;
  color: #e5e7eb;
}

select option:checked {
  background-color: #2563eb;
  color: #ffffff;
}

/* ================================
   SIDEBAR MENU FIX
   ================================ */
.sidebar,
.sidebar .menu,
.sidebar nav {
  display: flex;
  flex-direction: column;
}

.sidebar a {
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  margin: 4px 0;
  box-sizing: border-box;
  white-space: nowrap;
}

.sidebar a span {
  display: inline-block;
}

.sidebar a i,
.sidebar a svg {
  flex-shrink: 0;
}

/* Hover/active düzgün görünsün */
.sidebar a:hover {
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
}

/* ================================
   SELECT (DROPDOWN) OKUNABİLİRLİK
   ================================ */
select,
option {
  background: #0f172a !important;
  color: #e5e7eb !important;
}

/* ================================
   FOOTER SABİTLEME
   ================================ */
.app-footer {
  margin-top: auto;
  padding: 12px;
  font-size: 12px;
  opacity: .75;
}


/* === layout hotfix (menu overlap + main pushed down) === */
html, body { height: 100%; }
body { margin: 0; }

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

.sidebar{
  flex:0 0 320px; /* sidebar genişliği */
  display:flex;
  flex-direction:column;
  gap:14px;
}

.menu{
  display:flex;
  flex-direction:column;
}

.menu-item{
  display:flex;
  align-items:center;
  gap:10px;
}

.main{
  flex:1;
  display:block;          /* flex-center varsa iptal */
  align-self:flex-start;  /* aşağı kaymayı engeller */
  padding:24px;
  min-width:0;
}
/* === end hotfix === */


/* links */
.link{color:inherit;text-decoration:underline;text-underline-offset:3px}
.link:hover{opacity:.85}
/* ==============================
   Ödeme Planı – Durum Badge
   ============================== */
.badge-status{
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:600;
  letter-spacing:.2px;
}
.mini-chart{
  display:flex;
  align-items:flex-end;
  gap:12px;
  height:160px;
  padding:12px 6px;
}

.bar-wrap{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
}

.bar{
  width:100%;
  max-width:22px;
  background:linear-gradient(180deg,#3fb950,#2ea043);
  border-radius:6px 6px 0 0;
  box-shadow:0 0 14px rgba(63,185,80,.45);
  transition:.25s;
}

.bar:hover{
  opacity:.85;
}

.bar-label{
  font-size:11px;
  opacity:.7;
  margin-top:6px;
}
/* ==============================
   DASHBOARD SUMMARY HOVER
   ============================== */

.summary-card{
  position:relative;
  transition: 
    transform .25s ease,
    box-shadow .25s ease,
    background .25s ease;
}

.summary-card:hover{
  transform: translateY(-6px);
  background: rgba(255,255,255,.07);
  box-shadow:
    0 0 0 1px rgba(122,162,247,.35),
    0 20px 45px rgba(0,0,0,.55),
    0 0 40px rgba(122,162,247,.35);
}

.summary-card:hover .summary-value{
  text-shadow: 0 0 22px currentColor;
}
/* ==============================
   DASHBOARD – PREMIUM HOVER
   ============================== */

.summary-card{
  position:relative;
  overflow:hidden;
  transition:
    transform .25s ease,
    box-shadow .25s ease,
    background .25s ease;
}

.summary-card:hover{
  transform: translateY(-6px);
  background: rgba(255,255,255,.06);
  box-shadow:
    0 0 0 1px rgba(122,162,247,.35),
    0 20px 45px rgba(0,0,0,.55),
    0 0 40px rgba(122,162,247,.35);
}
.summary-value{
  transition: text-shadow .25s ease, transform .25s ease;
}

.summary-card:hover .summary-value{
  text-shadow: 0 0 22px currentColor;
  transform: scale(1.03);
}
.summary-card::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255,255,255,.08),
    transparent 70%
  );
  opacity:0;
  transition: opacity .3s ease;
  pointer-events:none;
}

.summary-card:hover::after{
  opacity:1;
}
.summary-card:active{
  transform: translateY(-2px) scale(.98);
}
/* ==============================
   GECİKEN KART – YAVAŞ PULSE
   ============================== */

@keyframes overduePulse {
  0% {
    box-shadow:
      0 0 0 rgba(255,92,122,.35),
      0 0 0 rgba(255,92,122,.15);
  }
  50% {
    box-shadow:
      0 0 25px rgba(255,92,122,.55),
      0 0 60px rgba(255,92,122,.25);
  }
  100% {
    box-shadow:
      0 0 0 rgba(255,92,122,.35),
      0 0 0 rgba(255,92,122,.15);
  }
}

/* Geciken kart */
.summary-card .summary-value[style*="danger"]{
  animation: overduePulse 3.5s ease-in-out infinite;
}
/* ==============================
   BUGÜN BEKLENEN – MAVİ SHIMMER
   ============================== */

.today-card{
  position: relative;
  overflow: hidden;
}

/* ışık şeridi */
.today-card::before{
  content:"";
  position:absolute;
  top:0;
  left:-60%;
  width:50%;
  height:100%;
  background:linear-gradient(
    120deg,
    transparent,
    rgba(122,162,247,.18),
    transparent
  );
  animation: todayShimmer 6s ease-in-out infinite;
}

@keyframes todayShimmer{
  0%   { left:-60%; }
  40%  { left:120%; }
  100% { left:120%; }
}
/* ==============================
   GECİKEN ALACAK – YAVAŞ PULSE
   ============================== */

.overdue-card{
  position: relative;
  box-shadow: 0 0 0 rgba(255,92,122,0);
  animation: overduePulse 3.8s ease-in-out infinite;
}

@keyframes overduePulse{
  0%{
    box-shadow: 0 0 0 rgba(255,92,122,0);
  }
  50%{
    box-shadow: 0 0 28px rgba(255,92,122,.45);
  }
  100%{
    box-shadow: 0 0 0 rgba(255,92,122,0);
  }
}
