/* ==========================================================================
   Çınarağacı — tasarım sistemi
   Sıcak krem zemin + koyu çınar yeşili cam panel + bakır vurgu
   ========================================================================== */

:root {
  --ink: #14231e;
  --ink-soft: #34473f;
  --muted: #72857c;
  --muted-2: #93a49c;
  --line: rgba(18, 48, 40, 0.09);
  --line-strong: rgba(18, 48, 40, 0.16);

  --green-900: #0b3b33;
  --green-800: #0f4a40;
  --green-700: #12594c;
  --green-600: #1a7261;
  --green-500: #2b8d78;
  --mint: #dff0e8;
  --mint-2: #eef7f2;

  --copper: #b97a44;
  --copper-dark: #9c6335;
  --copper-soft: #f3e5d6;
  --sand: #e8dcc8;

  --cream: #f5f1e9;
  --cream-2: #efe9de;
  --white: #ffffff;

  --card: rgba(255, 255, 255, 0.62);
  --card-strong: rgba(255, 255, 255, 0.86);
  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-dark: rgba(255, 255, 255, 0.09);
  --glass-dark-border: rgba(255, 255, 255, 0.14);

  --shadow-xs: 0 1px 2px rgba(14, 55, 46, 0.06);
  --shadow-sm: 0 4px 14px -6px rgba(14, 55, 46, 0.18);
  --shadow: 0 22px 48px -28px rgba(11, 59, 51, 0.45);
  --shadow-lg: 0 34px 80px -40px rgba(11, 59, 51, 0.55);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --font-ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  --ease: cubic-bezier(0.22, 0.68, 0.3, 1);
  --sidebar-w: 262px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--cream);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: -20% -10%;
  z-index: -2;
  background:
    radial-gradient(38% 42% at 12% 8%, rgba(43, 141, 120, 0.20), transparent 70%),
    radial-gradient(34% 40% at 88% 2%, rgba(185, 122, 68, 0.18), transparent 72%),
    radial-gradient(46% 46% at 62% 95%, rgba(43, 141, 120, 0.13), transparent 76%),
    linear-gradient(180deg, #f7f3ec 0%, #f3eee5 55%, #efe9df 100%);
  animation: drift 26s ease-in-out infinite alternate;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-1.5%, 1.2%, 0) scale(1.04); }
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: rgba(43, 141, 120, 0.22); }

.hidden { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ico--fill { fill: currentColor; stroke: none; }

/* ---------------------------------------------------------------- boot */
.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--cream);
  z-index: 90;
  transition: opacity 0.4s var(--ease);
}
.boot p { color: var(--muted); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.boot__mark { display: flex; gap: 8px; }
.boot__mark span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green-700);
  animation: pulse 1.1s ease-in-out infinite;
}
.boot__mark span:nth-child(2) { animation-delay: 0.15s; background: var(--copper); }
.boot__mark span:nth-child(3) { animation-delay: 0.3s; background: var(--green-500); }
@keyframes pulse { 0%, 100% { transform: scale(0.7); opacity: 0.4; } 50% { transform: scale(1.15); opacity: 1; } }

/* --------------------------------------------------------------- login */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  padding: 22px;
  gap: 22px;
}
.login__art {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 46px 48px;
  color: #f2f7f4;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(63, 140, 118, 0.55), transparent 60%),
    radial-gradient(90% 80% at 90% 100%, rgba(185, 122, 68, 0.35), transparent 65%),
    linear-gradient(155deg, #0d4239 0%, #0a352d 60%, #072a24 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  isolation: isolate;
}
.login__art > div:first-child { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; }
.login__art::before {
  content: "";
  position: absolute;
  inset: -30%;
  background-image:
    repeating-radial-gradient(circle at 78% 18%, rgba(216, 180, 138, 0.16) 0 1px, transparent 1px 34px);
  opacity: 0.7;
  z-index: -1;
  animation: rings 40s linear infinite;
}
@keyframes rings { to { transform: rotate(12deg) scale(1.08); } }
.login__brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 22px; max-width: 420px; }
.login__brand img { width: 96px; height: 96px; display: block; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.35)); }
.login__brand strong { font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 30px); font-weight: 600; line-height: 1.3; letter-spacing: 0.01em; color: #fff; display: block; }
.login__brand span { font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(242, 247, 244, 0.6); }
.login__foot { display: flex; justify-content: center; align-items: center; font-size: 12px; color: rgba(238, 246, 242, 0.45); gap: 16px; }
.login__foot span { display: inline-flex; align-items: center; gap: 7px; }

.login__panel { display: flex; align-items: center; justify-content: center; padding: 20px; }
.login__card {
  width: 100%;
  max-width: 430px;
  padding: 38px 36px 32px;
  border-radius: var(--radius-xl);
  background: var(--card);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  animation: rise 0.7s var(--ease) both;
}
.login__card .eyebrow { color: var(--copper); }
.login__card h1 { font-family: var(--font-display); font-size: 27px; font-weight: 600; margin-top: 6px; }
.login__card > p { color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-top: 18px; }
.field > label { font-size: 12px; font-weight: 600; letter-spacing: 0.03em; color: var(--ink-soft); }
.field .hint { font-size: 11.5px; color: var(--muted-2); }
.input, .select, .textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 13px;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  min-height: 42px;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: rgba(18, 89, 76, 0.55);
  box-shadow: 0 0 0 4px rgba(43, 141, 120, 0.14);
  background: #fff;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2372857c' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
.input--pw { padding-right: 44px; }
.pw-wrap { position: relative; }
.pw-wrap .pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 8px; border-radius: 8px;
}
.pw-wrap .pw-toggle:hover { background: rgba(18, 48, 40, 0.06); color: var(--ink); }

.login__quick { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.chip-doc {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  padding: 6px 12px 6px 7px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.chip-doc:hover { border-color: rgba(18, 89, 76, 0.4); background: #fff; transform: translateY(-1px); }
.chip-doc.is-active { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.chip-doc .avatar { width: 22px; height: 22px; font-size: 10px; }

.login__actions { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.login__note {
  margin-top: 20px; padding: 12px 14px; border-radius: 12px;
  background: rgba(223, 240, 232, 0.55);
  border: 1px solid rgba(18, 89, 76, 0.12);
  font-size: 12px; color: var(--green-800); line-height: 1.6;
}
.login__note b { font-weight: 700; }
.login__error {
  margin-top: 14px; padding: 10px 13px; border-radius: 10px;
  background: rgba(176, 61, 45, 0.09); border: 1px solid rgba(176, 61, 45, 0.22);
  color: #8d3126; font-size: 12.5px;
}

/* ---------------------------------------------------------------- shell */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  gap: 0;
}
.sidebar {
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  margin: 14px 0 14px 14px;
  border-radius: var(--radius-xl);
  padding: 22px 15px 16px;
  display: flex;
  flex-direction: column;
  color: #eef5f1;
  z-index: 20;
}
.glass-dark {
  background:
    radial-gradient(120% 80% at 8% 0%, rgba(58, 133, 112, 0.42), transparent 62%),
    linear-gradient(168deg, rgba(13, 66, 57, 0.94) 0%, rgba(8, 45, 39, 0.97) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 30px 60px -34px rgba(7, 38, 32, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 0; }
.brand__mark { width: 42px; height: 42px; flex: none; display: block; border-radius: 11px; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.55); }
.brand__mark svg { width: 100%; height: 100%; }
.brand__text strong {
  display: block; font-family: var(--font-display); font-size: 19.5px; font-weight: 600; color: #fff; letter-spacing: 0.01em;
}
.brand__text span { font-size: 10px; letter-spacing: 0.13em; text-transform: uppercase; color: rgba(238, 245, 241, 0.48); }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 30px; flex: 1; }
.nav__label { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(238, 245, 241, 0.32); padding: 0 12px 8px; }
.nav__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  color: rgba(238, 245, 241, 0.72);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.2s var(--ease), color 0.2s, transform 0.2s var(--ease);
}
.nav__item .ico { width: 18px; height: 18px; opacity: 0.85; }
.nav__item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; transform: translateX(2px); }
.nav__item.is-active { background: rgba(255, 255, 255, 0.13); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.nav__item.is-active::before {
  content: ""; position: absolute; left: -15px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--sand);
}
.nav__item.is-active .ico { opacity: 1; color: #e8cba6; }
.nav__count {
  margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 600;
  padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.8);
}
.sidebar__foot { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.clinic-badge {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 11px 12px; border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.clinic-badge .ico { width: 16px; height: 16px; color: #e0bd94; margin-top: 1px; }
.clinic-badge strong { display: block; font-size: 11.5px; color: rgba(255, 255, 255, 0.9); font-weight: 600; }
.clinic-badge span { font-size: 10.5px; color: rgba(255, 255, 255, 0.45); }
.sidebar__user {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.2s;
}
.sidebar__user:hover { background: rgba(255, 255, 255, 0.13); }
.sidebar__user .who { min-width: 0; flex: 1; }
.sidebar__user strong { display: block; font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user span { font-size: 10.5px; color: rgba(255, 255, 255, 0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.sidebar__user button { border: 0; background: transparent; color: rgba(255, 255, 255, 0.55); cursor: pointer; padding: 4px; border-radius: 7px; display: grid; place-items: center; }
.sidebar__user button:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }

.shell { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 24px 30px 16px;
  position: sticky; top: 0; z-index: 15;
  background: linear-gradient(180deg, rgba(246, 242, 234, 0.92) 40%, rgba(246, 242, 234, 0.55) 78%, transparent);
  backdrop-filter: blur(6px);
}
.topbar__menu { display: none; }
.eyebrow {
  font-size: 10.5px; letter-spacing: 0.17em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 3px;
}
.topbar h1 { font-family: var(--font-display); font-size: clamp(23px, 2.1vw, 30px); font-weight: 600; line-height: 1.15; }
.topbar__title { min-width: 0; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.today-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 7px 12px; border-radius: 999px;
  box-shadow: var(--shadow-xs);
}
.today-chip .ico { width: 15px; height: 15px; color: var(--green-700); }
.topbar__actions { display: flex; gap: 8px; align-items: center; }
.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 5px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-xs);
}
.user-chip .who { line-height: 1.2; }
.user-chip strong { display: block; font-size: 12.5px; font-weight: 600; }
.user-chip span { font-size: 10.5px; color: var(--muted); }

.view { padding: 4px 30px 34px; max-width: 1560px; width: 100%; outline: none; }
.appfoot {
  margin-top: auto; padding: 0 30px 20px;
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 11px; color: var(--muted-2); letter-spacing: 0.02em;
}

/* --------------------------------------------------------------- cards */
.glass {
  background: var(--card);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
}
.card { padding: 20px 22px; }
.card--tight { padding: 16px 18px; }
.card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card__head h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.card__head .sub { font-size: 12px; color: var(--muted); }
.card__head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card__title-icon {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(43, 141, 120, 0.16), rgba(43, 141, 120, 0.05));
  color: var(--green-700); border: 1px solid rgba(43, 141, 120, 0.14);
}
.card__title-icon .ico { width: 17px; height: 17px; }

.grid { display: grid; gap: 16px; }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* KPI */
.kpi { position: relative; overflow: hidden; padding: 18px 20px 20px; }
.kpi__top { display: flex; align-items: flex-start; gap: 10px; }
.kpi__icon {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(18, 89, 76, 0.08); color: var(--green-700); border: 1px solid rgba(18, 89, 76, 0.08);
}
.kpi__icon .ico { width: 18px; height: 18px; }
.kpi--copper .kpi__icon { background: rgba(185, 122, 68, 0.12); color: var(--copper-dark); border-color: rgba(185, 122, 68, 0.14); }
.kpi--blue .kpi__icon { background: rgba(63, 111, 138, 0.12); color: #35617a; border-color: rgba(63, 111, 138, 0.14); }
.kpi--plum .kpi__icon { background: rgba(108, 91, 123, 0.12); color: #5d4c6b; border-color: rgba(108, 91, 123, 0.14); }
.kpi__label { font-size: 11.5px; color: var(--muted); letter-spacing: 0.03em; font-weight: 500; }
.kpi__value { font-family: var(--font-display); font-size: clamp(24px, 2.3vw, 31px); font-weight: 600; letter-spacing: -0.02em; margin-top: 8px; line-height: 1.05; }
.kpi__value small { font-family: var(--font-ui); font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi__foot { display: flex; align-items: center; gap: 6px; margin-top: 9px; font-size: 11.5px; color: var(--muted); max-width: 84%; position: relative; z-index: 1; }
.kpi__foot .up { color: var(--green-600); font-weight: 600; }
.kpi__foot .warn { color: var(--copper-dark); font-weight: 600; }
.kpi__spark { position: absolute; right: 0; bottom: 0; width: 40%; height: 34px; opacity: 0.4; pointer-events: none; }

/* butonlar */
.btn {
  --btn-bg: rgba(255, 255, 255, 0.7);
  --btn-fg: var(--ink);
  --btn-bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 11px; border: 1px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: 13px; font-weight: 600; letter-spacing: 0.005em;
  cursor: pointer; white-space: nowrap;
  transition: transform 0.16s var(--ease), box-shadow 0.18s, background 0.18s, border-color 0.18s;
  box-shadow: var(--shadow-xs);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); background: #fff; }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid rgba(18, 89, 76, 0.45); outline-offset: 2px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn .ico { width: 16px; height: 16px; }
.btn--primary {
  --btn-bg: linear-gradient(140deg, #13604f, #0b3b33);
  --btn-fg: #fff; --btn-bd: rgba(11, 59, 51, 0.4);
  box-shadow: 0 10px 22px -12px rgba(11, 59, 51, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn--primary:hover { background: linear-gradient(140deg, #17705c, #0d4539); }
.btn--copper {
  --btn-bg: linear-gradient(140deg, #c98a52, #a9693a);
  --btn-fg: #fff; --btn-bd: rgba(156, 99, 53, 0.4);
  box-shadow: 0 10px 22px -12px rgba(156, 99, 53, 0.8);
}
.btn--ghost { --btn-bg: transparent; --btn-bd: transparent; box-shadow: none; }
.btn--ghost:hover { background: rgba(18, 48, 40, 0.06); box-shadow: none; }
.btn--danger { --btn-bg: rgba(168, 59, 45, 0.08); --btn-fg: #93372a; --btn-bd: rgba(168, 59, 45, 0.25); }
.btn--danger:hover { background: rgba(168, 59, 45, 0.14); }
.btn--sm { padding: 6px 10px; font-size: 12px; border-radius: 9px; }
.btn--block { width: 100%; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.55);
  cursor: pointer; color: var(--ink-soft); transition: all 0.18s;
}
.icon-btn:hover { background: #fff; color: var(--ink); box-shadow: var(--shadow-xs); }
.icon-btn .ico { width: 17px; height: 17px; }
.icon-btn--danger:hover { color: #93372a; background: rgba(168, 59, 45, 0.1); border-color: rgba(168, 59, 45, 0.2); }

/* seçim kutuları */
.check {
  appearance: none; width: 16px; height: 16px; border-radius: 5px;
  border: 1.5px solid rgba(18, 48, 40, 0.25); background: #fff; cursor: pointer;
  display: inline-grid; place-items: center; flex: none; transition: all 0.15s;
}
.check:checked { background: var(--green-700); border-color: var(--green-700); }
.check:checked::after { content: ""; width: 8px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translateY(-1px); }
.check:indeterminate { background: var(--green-700); border-color: var(--green-700); }
.check:indeterminate::after { content: ""; width: 7px; height: 2px; background: #fff; }

/* segmented */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px;
  background: rgba(18, 48, 40, 0.06); border: 1px solid rgba(18, 48, 40, 0.05);
}
.segmented button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all 0.18s;
}
.segmented button:hover { color: var(--ink); }
.segmented button.is-active { background: #fff; color: var(--green-800); box-shadow: var(--shadow-xs); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button {
  border: 0; background: transparent; padding: 10px 14px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--muted); position: relative; border-radius: 8px 8px 0 0;
}
.tabs button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.4); }
.tabs button.is-active { color: var(--green-800); }
.tabs button.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: var(--green-700); border-radius: 2px 2px 0 0;
}

/* -------------------------------------------------------------- tables */
.table-wrap { overflow: auto; border-radius: 14px; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data thead th {
  position: sticky; top: 0; z-index: 2;
  text-align: left; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; padding: 11px 12px;
  background: rgba(246, 242, 234, 0.95);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data tbody td { padding: 12px; border-bottom: 1px solid rgba(18, 48, 40, 0.06); vertical-align: middle; color: var(--ink-soft); }
table.data tbody tr { transition: background 0.15s; }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.55); }
table.data tbody tr.is-selected { background: rgba(43, 141, 120, 0.07); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .strong { color: var(--ink); font-weight: 600; }
table.data th.num { text-align: right; }
table.data td.tight { padding-top: 8px; padding-bottom: 8px; }
.cell-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-person .meta { min-width: 0; }
.cell-person strong { display: block; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-person span { font-size: 11.5px; color: var(--muted); }
.cell-person .strong { white-space: nowrap; font-weight: 600; color: var(--ink); }
.cell-actions { display: flex; gap: 4px; justify-content: flex-end; opacity: 0.55; transition: opacity 0.15s; }
tr:hover .cell-actions { opacity: 1; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; color: #fff;
  background: var(--green-700);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.avatar--lg { width: 46px; height: 46px; font-size: 15px; }
.avatar--sm { width: 24px; height: 24px; font-size: 9.5px; }
.avatar--soft { color: var(--green-800); background: rgba(43, 141, 120, 0.14); box-shadow: none; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.pill--done { color: #1c6b55; background: rgba(43, 141, 120, 0.11); border-color: rgba(43, 141, 120, 0.16); }
.pill--active { color: #8a5a1f; background: rgba(201, 142, 66, 0.13); border-color: rgba(201, 142, 66, 0.2); }
.pill--planned { color: #35617a; background: rgba(63, 111, 138, 0.11); border-color: rgba(63, 111, 138, 0.16); }
.pill--off { color: #7c8580; background: rgba(18, 48, 40, 0.06); border-color: rgba(18, 48, 40, 0.08); }
.pill--debt { color: #93372a; background: rgba(168, 59, 45, 0.09); border-color: rgba(168, 59, 45, 0.16); }
.pill--paid { color: #1c6b55; background: rgba(43, 141, 120, 0.09); border-color: rgba(43, 141, 120, 0.14); }
.pill--plain::before { display: none; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 6px; background: rgba(18, 48, 40, 0.06); color: var(--muted); }

.money { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; color: var(--ink); }
.money--debt { color: #a3442f; }
.money--paid { color: var(--green-600); }
.money small { font-weight: 500; color: var(--muted); font-size: 10.5px; }

.progress { height: 5px; border-radius: 999px; background: rgba(18, 48, 40, 0.08); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2b8d78, #0f4a40); transition: width 0.9s var(--ease); }
.progress--copper span { background: linear-gradient(90deg, #d09a67, #b97a44); }

.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty .ico { width: 28px; height: 28px; opacity: 0.4; margin-bottom: 10px; }
.empty strong { display: block; color: var(--ink-soft); font-size: 13.5px; margin-bottom: 3px; }
.empty p { font-size: 12.5px; }

.skeleton { position: relative; overflow: hidden; background: rgba(18, 48, 40, 0.06); border-radius: 8px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* --------------------------------------------------------------- charts */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-family: var(--font-ui); font-size: 10px; fill: var(--muted); }
.chart .bar { transition: opacity 0.18s, transform 0.18s var(--ease); transform-origin: bottom; }
.chart .bar:hover { opacity: 0.82; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.legend i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.donut-legend__item { display: grid; grid-template-columns: 8px 1fr auto; gap: 9px; align-items: center; font-size: 12px; color: var(--ink-soft); }
.donut-legend__item i { width: 8px; height: 8px; border-radius: 3px; }
.donut-legend__item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend__item b { font-variant-numeric: tabular-nums; font-size: 12px; }

/* --------------------------------------------------------------- lists */
.list { display: flex; flex-direction: column; }
.list__item { display: flex; align-items: center; gap: 11px; padding: 11px 2px; border-bottom: 1px solid rgba(18, 48, 40, 0.06); }
.list__item:last-child { border-bottom: 0; }
.list__item .meta { min-width: 0; flex: 1; }
.list__item .meta strong { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.list__item .meta span { font-size: 11.5px; color: var(--muted); }
.list__date {
  min-width: 44px; text-align: center; border-radius: 10px; padding: 5px 4px;
  background: rgba(18, 89, 76, 0.07); border: 1px solid rgba(18, 89, 76, 0.08);
}
.list__date strong { display: block; font-size: 14px; color: var(--green-800); line-height: 1.1; font-variant-numeric: tabular-nums; }
.list__date span { font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

/* ------------------------------------------------------------- toolbar */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.search { position: relative; }
.search > .ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted); z-index: 1; pointer-events: none;
}
.toolbar .search {
  position: relative; flex: 1 1 240px; min-width: 190px; max-width: 360px;
}
.toolbar .search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.toolbar .search .input { padding-left: 35px; background: rgba(255, 255, 255, 0.7); }
.toolbar .select { width: auto; min-width: 132px; }
.filter-count { font-size: 11.5px; color: var(--muted); }

/* ---------------------------------------------------------- bulk bar */
.bulkbar {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 18px);
  z-index: 40; display: flex; align-items: center; gap: 10px;
  padding: 9px 12px 9px 16px; border-radius: 15px;
  background: rgba(12, 55, 47, 0.93);
  color: #fff; border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 50px -24px rgba(7, 38, 32, 0.9);
  opacity: 0; pointer-events: none; transition: all 0.28s var(--ease);
}
.bulkbar.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.bulkbar__count { font-size: 12.5px; font-weight: 600; }
.bulkbar__count b { font-family: var(--font-display); font-size: 16px; margin-right: 4px; }
.bulkbar__divider { width: 1px; height: 22px; background: rgba(255, 255, 255, 0.18); }
.bulkbar .btn { --btn-bg: rgba(255, 255, 255, 0.12); --btn-fg: #fff; --btn-bd: rgba(255, 255, 255, 0.18); box-shadow: none; }
.bulkbar .btn:hover { background: rgba(255, 255, 255, 0.2); }
.bulkbar .btn--danger { --btn-bg: rgba(214, 96, 74, 0.22); --btn-bd: rgba(255, 160, 140, 0.3); }

/* ------------------------------------------------------------ drawer */
.drawer-backdrop, .modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(12, 38, 32, 0.34);
  backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.25s var(--ease);
}
.drawer-backdrop.is-open, .modal-backdrop.is-open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 51;
  width: min(520px, 96vw);
  display: flex; flex-direction: column;
  background: rgba(250, 247, 241, 0.96);
  backdrop-filter: blur(24px);
  border-left: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: -30px 0 70px -40px rgba(11, 59, 51, 0.6);
  transform: translateX(24px); opacity: 0;
  transition: all 0.32s var(--ease);
}
.drawer.is-open { transform: none; opacity: 1; }
.drawer__head { padding: 20px 22px 14px; display: flex; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { font-family: var(--font-display); font-size: 21px; font-weight: 600; }
.drawer__head p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.drawer__body { flex: 1; overflow: auto; padding: 18px 22px 26px; }
.drawer__foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: rgba(255, 255, 255, 0.5); }

/* -------------------------------------------------------------- modal */
.modal-backdrop { display: grid; place-items: center; padding: 20px; z-index: 60; }
.modal {
  width: min(560px, 96vw); max-height: 90vh; display: flex; flex-direction: column;
  background: rgba(250, 247, 241, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(0.985); opacity: 0;
  transition: all 0.28s var(--ease);
}
.modal.is-open { transform: none; opacity: 1; }
.modal--wide { width: min(760px, 96vw); }
.modal__head { padding: 20px 22px 6px; display: flex; gap: 12px; align-items: flex-start; }
.modal__head h2 { font-family: var(--font-display); font-size: 21px; font-weight: 600; }
.modal__head p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.modal__body { padding: 12px 22px 18px; overflow: auto; }
.modal__foot { padding: 14px 22px 18px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .span2 { grid-column: span 2; }
.form-error { color: #93372a; font-size: 12px; margin-top: 10px; }

/* -------------------------------------------------------------- toasts */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  display: flex; align-items: flex-start; gap: 9px;
  min-width: 250px; max-width: 380px; padding: 11px 14px;
  border-radius: 12px; font-size: 12.5px;
  background: rgba(252, 250, 246, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: toastIn 0.3s var(--ease) both;
}
.toast.is-out { animation: toastOut 0.25s var(--ease) both; }
.toast .ico { width: 16px; height: 16px; margin-top: 1px; }
.toast--ok .ico { color: var(--green-600); }
.toast--err .ico { color: #a3442f; }
.toast strong { display: block; font-weight: 600; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(12px); } }

/* -------------------------------------------------------------- misc */
.badge-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; font-size: 10.5px; font-weight: 700;
  background: rgba(185, 122, 68, 0.16); color: var(--copper-dark);
}
.amount-big { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.amount-big small { font-family: var(--font-ui); font-size: 13px; color: var(--muted); font-weight: 500; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.mini-stat { display: flex; flex-direction: column; gap: 2px; }
.mini-stat span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.mini-stat strong { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.note-box { padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.55); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-soft); }
.warn-box { padding: 12px 14px; border-radius: 12px; background: rgba(185, 122, 68, 0.08); border: 1px solid rgba(185, 122, 68, 0.2); font-size: 12.5px; color: #7a5227; }
.hint { font-size: 11.5px; color: var(--muted); }
.section-title { font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); font-weight: 500; }
.link { color: var(--green-700); font-weight: 600; cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.scroll-x { overflow-x: auto; }

/* animasyon iskeleti */
.stagger > * { animation: rise 0.55s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.14s; }
.stagger > *:nth-child(5) { animation-delay: 0.18s; }
.stagger > *:nth-child(6) { animation-delay: 0.22s; }
.stagger > *:nth-child(7) { animation-delay: 0.26s; }
.stagger > *:nth-child(8) { animation-delay: 0.3s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* --------------------------------------------------------- responsive */
@media (max-width: 1250px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--main { grid-template-columns: minmax(0, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .app { grid-template-columns: 78px minmax(0, 1fr); }
  .sidebar { padding: 18px 10px 14px; align-items: center; }
  .brand__text, .nav__item span, .nav__count, .clinic-badge, .sidebar__user .who, .nav__label { display: none; }
  .brand { padding: 0; }
  .nav { align-items: center; width: 100%; }
  .nav__item { justify-content: center; width: 100%; padding: 11px 0; }
  .sidebar__user { justify-content: center; padding: 8px; }
  .sidebar__user button { display: none; }
  .login { grid-template-columns: 1fr; }
  .login__art { display: none; }
}
@media (max-width: 860px) {
  .topbar { padding: 16px 18px 12px; flex-wrap: wrap; gap: 10px; }
  .topbar__menu { display: grid; }
  .topbar__right { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .today-chip { display: none; }
  .view { padding: 0 18px 28px; }
  .appfoot { padding: 0 18px 16px; }
  .grid--4, .grid--3, .grid--2 { grid-template-columns: minmax(0, 1fr); }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; margin: 0;
    width: 268px; border-radius: 0 24px 24px 0;
    transform: translateX(-104%); transition: transform 0.3s var(--ease);
    align-items: stretch;
  }
  .sidebar.is-open { transform: none; }
  .sidebar.is-open .brand__text, .sidebar.is-open .nav__item span, .sidebar.is-open .nav__count,
  .sidebar.is-open .clinic-badge, .sidebar.is-open .sidebar__user .who, .sidebar.is-open .nav__label { display: block; }
  .sidebar.is-open .nav__item { justify-content: flex-start; padding: 10px 12px; }
  .sidebar.is-open .sidebar__user { justify-content: flex-start; padding: 9px 10px; }
  .sidebar.is-open .sidebar__user button { display: grid; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }
  .kpi__spark { display: none; }
  .bulkbar { width: calc(100vw - 24px); flex-wrap: wrap; justify-content: center; }
}
@media (max-width: 520px) {
  .user-chip .who { display: none; }
  .topbar h1 { font-size: 21px; }
  .card { padding: 16px; }
  .kpi__value { font-size: 26px; }
}
