/* =====================================================================
   MDD Ritim Panel · glassmorphism tema
   Tanıtım sitesiyle aynı aile: şarap/bordo, pudra, krem, sıcak gri.
   Başlıklar ve büyük rakamlar: Fraunces (ince serif) · metin: Inter Tight
   ===================================================================== */
:root {
  --wine-900: #3e1018;
  --wine-800: #5e1a24;
  --wine-700: #7a2232;
  --wine-500: #9b4556;
  --powder: #e8c9c6;
  --powder-soft: #f4e4e1;
  --cream: #f3ece4;
  --cream-2: #ebe2d7;
  --warm-gray: #d8d1cb;
  --warm-gray-2: #b9b0a9;
  --teal: #4e7377;
  --teal-soft: #d7e5e4;

  --ink: #2a1a1e;
  --ink-2: #4a3a3e;
  --muted: #76686b;

  --ok: #2f7a55;      --ok-bg: rgba(47, 122, 85, .12);
  --warn: #a8661a;    --warn-bg: rgba(168, 102, 26, .13);
  --danger: #a3323a;  --danger-bg: rgba(163, 50, 58, .11);

  /* Grafik serileri (dataviz doğrulayıcısından geçti, yüzey #F7F2EC) */
  --series-income: #a3364d;
  --series-expense: #2a7dad;

  --glass: rgba(255, 252, 249, .58);
  --glass-strong: rgba(255, 252, 249, .78);
  --glass-border: rgba(255, 255, 255, .75);
  --glass-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 18px 40px -22px rgba(94, 26, 36, .35);
  --blur: 18px;
  --line: rgba(42, 26, 30, .1);
  --line-2: rgba(42, 26, 30, .18);

  --r-lg: 24px;
  --r: 18px;
  --r-sm: 12px;
  --r-pill: 999px;

  --serif: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);

  --sidebar-w: 248px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(900px 600px at 0% 0%, rgba(232, 201, 198, .75), transparent 60%),
    radial-gradient(700px 500px at 100% 10%, rgba(215, 229, 228, .7), transparent 60%),
    radial-gradient(800px 600px at 70% 100%, rgba(122, 34, 50, .14), transparent 60%),
    linear-gradient(160deg, #f6f0e9, var(--cream-2));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--wine-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; letter-spacing: -.01em; }
h1, h2, .serif { font-family: var(--serif); font-optical-sizing: auto; }
h1 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 300; line-height: 1.1; }
h2 { font-size: 22px; font-weight: 400; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--wine-700); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Cam yüzeyler ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  backdrop-filter: blur(var(--blur)) saturate(140%);
}
.card { padding: 22px; }
.card + .card { margin-top: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card__head h2 { font-size: 20px; }

/* ---------- Uygulama iskeleti ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  padding: calc(20px + var(--safe-top)) 14px 18px;
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  border-left: 0;
  overflow-y: auto;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; letter-spacing: -.01em; font-size: 17px; color: var(--wine-800); }
.brand__mark { position: relative; width: 22px; height: 22px; flex-shrink: 0; }
.brand__mark::before { content: ""; position: absolute; left: 0; top: 0; width: 10px; height: 10px; border-radius: 3.5px; background: currentColor;
  box-shadow: 12px 0 0 var(--teal), 0 12px 0 #d4877c, 12px 12px 0 currentColor; }
.bell { position: relative; }
.bell__n { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }
.searchbar { display: flex; align-items: center; gap: 8px; margin: 0 4px 12px; padding: 9px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: rgba(255, 255, 255, .55); color: var(--muted); font-size: 13.5px; cursor: pointer; text-align: left; }
.searchbar:hover { background: rgba(255, 255, 255, .8); }
.searchbar svg { width: 16px; height: 16px; }
.searchbar span { flex: 1; }
.searchbar kbd, kbd { font: 600 11px var(--sans); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: #fff; color: var(--muted); }
.search-group { margin: 12px 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.list__item.is-sel { background: rgba(122, 34, 50, .08); }
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 12px 6px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; border-radius: var(--r-sm); }
.notif:hover { background: rgba(255, 255, 255, .6); text-decoration: none; }
.notif:last-child { border-bottom: 0; }
.notif__dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--teal); }
.notif__dot.is-danger { background: var(--danger); } .notif__dot.is-warn { background: var(--warn); } .notif__dot.is-ok { background: var(--ok); }
.heat { display: grid; gap: 2px; align-items: center; font-size: 11.5px; }
.heat__h { text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.heat__d { color: var(--ink-2); font-weight: 500; }
.heat__c { height: 26px; border-radius: 4px; background: rgba(42, 26, 30, .04); outline-offset: 1px; }
.heat__c.is-empty { background: repeating-linear-gradient(135deg, rgba(42, 26, 30, .03) 0 4px, rgba(42, 26, 30, .07) 4px 6px); }
.heat__c:not(.is-empty):hover, .heat__c:focus { outline: 2px solid var(--ink); }
.heat__key { width: 18px; height: 12px; border-radius: 3px; display: inline-block; }
.heat__key.is-empty { background: repeating-linear-gradient(135deg, rgba(42, 26, 30, .03) 0 4px, rgba(42, 26, 30, .1) 4px 6px); }
.studio-chip { margin: 0 4px 14px; padding: 10px 12px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .5); border: 1px solid var(--line); font-size: 13px; }
.studio-chip b { display: block; font-weight: 600; font-size: 14px; }
.studio-chip--logo { display: flex; align-items: center; gap: 10px; }
.studio-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex-shrink: 0; }
.auth__logo { display: block; max-width: 160px; max-height: 88px; margin: 0 auto 16px; object-fit: contain; border-radius: 14px; }
.auth__studio { text-align: center; font-size: 13px; color: var(--muted); margin: -12px 0 18px; }
.logo-preview { width: 96px; height: 96px; border-radius: 18px; object-fit: contain; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.url-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .6); border: 1px solid var(--line); font-size: 13.5px; overflow-wrap: anywhere; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__label { margin: 14px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; font-size: 14px;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nav a:hover { background: rgba(255, 255, 255, .55); text-decoration: none; }
.nav a.is-active { background: var(--wine-800); color: #fff; box-shadow: 0 10px 22px -12px rgba(94, 26, 36, .7); }
.nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar__foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--powder); color: var(--wine-800); font-weight: 600; font-size: 13px; flex-shrink: 0; }
.user-chip b { display: block; font-size: 13px; font-weight: 600; line-height: 1.2; }
.user-chip small { color: var(--muted); font-size: 12px; }

.main { min-width: 0; padding: calc(28px + var(--safe-top)) clamp(16px, 3vw, 40px) 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin-top: 6px; color: var(--muted); }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.topbar { display: none; }
.bottom-nav { display: none; }
.scrim { display: none; }
.app > .sidebar { grid-column: 1; grid-row: 1; }
.app > .content { grid-column: 2; grid-row: 1; min-width: 0; }
.acting-bar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 16px; background: var(--wine-800); color: #fff; font-size: 13px; }
.acting-bar svg { width: 16px; height: 16px; flex-shrink: 0; }
.acting-bar button { padding: 4px 12px; border-radius: var(--r-pill); border: 1px solid rgba(255, 255, 255, .5); background: none; color: #fff; cursor: pointer; }

/* ---------- Izgara ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.spacer { flex: 1; }

/* ---------- Stat kutuları ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; min-height: 118px; }
.stat__label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat__value { font-family: var(--serif); font-weight: 300; font-size: 36px; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat__value small { font-family: var(--sans); font-size: 15px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.stat__note { margin-top: auto; font-size: 12.5px; color: var(--muted); }
.stat--accent { background: linear-gradient(150deg, rgba(122, 34, 50, .92), rgba(94, 26, 36, .96)); color: #fff; border-color: rgba(255, 255, 255, .25); }
.stat--accent .stat__label, .stat--accent .stat__note, .stat--accent .stat__value small { color: rgba(255, 255, 255, .75); }

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer;
  background: rgba(255, 255, 255, .7); color: var(--ink); border-color: var(--line-2);
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .1s;
}
.btn:hover { background: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--wine-800); border-color: var(--wine-800); color: #fff; }
.btn--primary:hover { background: var(--wine-700); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: rgba(255, 255, 255, .6); }
.btn--danger { color: var(--danger); border-color: rgba(163, 50, 58, .35); }
.btn--danger:hover { background: var(--danger-bg); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn--icon { width: 40px; padding: 0; }
.btn--sm.btn--icon { width: 32px; }
.btn--block { width: 100%; }
.btn.is-loading { pointer-events: none; opacity: .7; }

/* ---------- Form ---------- */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 13px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .78);
  transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--wine-700); box-shadow: 0 0 0 3px rgba(122, 34, 50, .14); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }
.field__error { font-size: 12.5px; color: var(--danger); }
.field__hint { font-size: 12.5px; color: var(--muted); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--wine-800); flex-shrink: 0; }
.input-color { width: 56px; height: 42px; padding: 4px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: #fff; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search svg { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 38px; border-radius: var(--r-pill); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.alert { padding: 12px 14px; border-radius: var(--r-sm); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert--error { background: var(--danger-bg); color: var(--danger); }
.alert--warn { background: var(--warn-bg); color: var(--warn); }
.alert--ok { background: var(--ok-bg); color: var(--ok); }
.alert--info { background: rgba(78, 115, 119, .12); color: var(--teal); }

/* ---------- Sekmeler / segment ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .5); border: 1px solid var(--line); flex-wrap: wrap; }
.tabs button, .tabs a { padding: 7px 14px; border: 0; border-radius: var(--r-pill); background: none; font-size: 13.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.tabs .is-active { background: var(--wine-800); color: #fff; }
.tabs svg { width: 14px; height: 14px; vertical-align: -2px; }
.tabs a:hover { text-decoration: none; }

/* ---------- Tablo / liste ---------- */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 10px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-link { cursor: pointer; }
.table tr.is-link:hover td { background: rgba(255, 255, 255, .5); }
.table .right, .right { text-align: right; }
.list { display: flex; flex-direction: column; }
.list__item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.list__item:last-child { border-bottom: 0; }
.list__item.is-link { cursor: pointer; border-radius: var(--r-sm); padding-left: 8px; padding-right: 8px; }
.list__item.is-link:hover { background: rgba(255, 255, 255, .55); }
.list__item > svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); }
.list__main { flex: 1; min-width: 0; }
.list__main b { display: block; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__main small { display: block; color: var(--muted); font-size: 13px; }
.time-pill { min-width: 58px; padding: 6px 8px; text-align: center; border-radius: 10px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); font-weight: 600; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.empty svg { display: block; width: 28px; height: 28px; margin: 0 auto 8px; opacity: .55; }

/* ---------- Rozetler ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; white-space: nowrap; background: rgba(42, 26, 30, .07); color: var(--ink-2); }
.badge svg { width: 12px; height: 12px; }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--wine { background: rgba(122, 34, 50, .12); color: var(--wine-700); }
.badge--teal { background: rgba(78, 115, 119, .14); color: var(--teal); }

/* Doluluk çubuğu (meter) */
.meter { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.meter__track { flex: 1; height: 8px; border-radius: 99px; background: var(--powder-soft); overflow: hidden; }
.meter__fill { height: 100%; border-radius: 99px; background: var(--wine-700); }
.meter__fill.is-warn { background: var(--warn); }
.meter__fill.is-full { background: var(--wine-900); }
.meter__text { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }

/* ---------- Haftalık takvim ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-toolbar h2 { font-size: 20px; min-width: 210px; }
.cal { --hour: 56px; display: grid; grid-template-columns: 54px repeat(7, minmax(0, 1fr)); overflow: hidden; padding: 0; }
.cal__corner, .cal__dayhead { padding: 12px 8px; border-bottom: 1px solid var(--line-2); text-align: center; font-size: 13px; position: sticky; top: 0; }
.cal__dayhead b { display: block; font-family: var(--serif); font-size: 22px; font-weight: 300; line-height: 1.1; }
.cal__dayhead.is-today b { color: #fff; background: var(--wine-800); border-radius: 50%; width: 36px; height: 36px; display: grid; place-items: center; margin: 2px auto 0; font-size: 18px; }
.cal__times { position: relative; border-right: 1px solid var(--line); }
.cal__time { height: var(--hour); font-size: 11.5px; color: var(--muted); text-align: right; padding: 0 8px 0 0; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.cal__col { position: relative; border-right: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--line) calc(var(--hour) - 1px), var(--line) var(--hour)); }
.cal__col:last-child { border-right: 0; }
.cal__col.is-today { background-color: rgba(232, 201, 198, .22); }
.cal__now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 3; }
.cal__now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.ev {
  position: absolute; left: 3px; right: 3px; z-index: 2;
  padding: 5px 7px; border-radius: 10px; overflow: hidden;
  background: rgba(255, 255, 255, .86); border: 1px solid var(--line);
  border-left: 4px solid var(--c, var(--wine-700));
  font-size: 12px; line-height: 1.25; cursor: pointer; text-align: left;
  box-shadow: 0 6px 16px -10px rgba(42, 26, 30, .4);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.ev:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -10px rgba(42, 26, 30, .5); z-index: 4; }
.ev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev span { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.is-full { background: rgba(94, 26, 36, .92); color: #fff; border-color: rgba(94, 26, 36, .9); }
.ev.is-full span { color: rgba(255, 255, 255, .78); }
.ev.is-cancelled { opacity: .55; text-decoration: line-through; }
.ev[draggable="true"] { cursor: grab; }
.ev.is-dragging { opacity: .35; }
.cal__ghost { position: absolute; left: 3px; right: 3px; z-index: 5; border: 2px dashed var(--wine-700); border-radius: 10px; background: rgba(122, 34, 50, .08); color: var(--wine-800); font-size: 12px; font-weight: 600; padding: 4px 7px; pointer-events: none; }
.cal-days { display: none; }
.day-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.day-tabs button { flex: 1; min-width: 46px; padding: 8px 4px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(255, 255, 255, .55); font-size: 12px; cursor: pointer; }
.day-tabs button b { display: block; font-family: var(--serif); font-size: 18px; font-weight: 400; }
.day-tabs button.is-active { background: var(--wine-800); color: #fff; border-color: var(--wine-800); }

/* ---------- Katılımcı satırı ---------- */
.att { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.att:last-child { border-bottom: 0; }
.att__actions { display: flex; gap: 6px; }
.att-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: rgba(255, 255, 255, .7); font-size: 13px; font-weight: 500; cursor: pointer; }
.att-btn svg { width: 15px; height: 15px; }
.att-btn.is-on.att-btn--yes { background: var(--ok); border-color: var(--ok); color: #fff; }
.att-btn.is-on.att-btn--no { background: var(--danger); border-color: var(--danger); color: #fff; }
.att-btn.is-on.att-btn--exc { background: var(--warn); border-color: var(--warn); color: #fff; }
.day-chip { position: relative; cursor: pointer; }
.day-chip input { position: absolute; opacity: 0; pointer-events: none; }
.day-chip span { display: inline-block; min-width: 46px; padding: 7px 10px; text-align: center; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: rgba(255, 255, 255, .7); font-size: 13px; font-weight: 500; }
.day-chip input:checked + span { background: var(--wine-800); border-color: var(--wine-800); color: #fff; }
.day-chip input:focus-visible + span { outline: 2px solid var(--wine-700); outline-offset: 2px; }
.chip-x { margin-left: 4px; border: 0; background: none; color: inherit; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; }
details > summary { list-style: revert; }
a.alert { display: flex; }

/* ---------- Modal ---------- */
dialog.modal {
  width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  padding: 0; border: 1px solid var(--glass-border); border-radius: var(--r-lg);
  background: var(--glass-strong); color: var(--ink);
  -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 30px 80px -30px rgba(42, 26, 30, .55);
}
dialog.modal--wide { width: min(860px, calc(100vw - 24px)); }
dialog.modal--sm { width: min(440px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(42, 26, 30, .32); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: pop .22s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal__head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 12px; border-bottom: 1px solid var(--line); }
.modal__head h2 { flex: 1; font-size: 22px; }
.modal__body { padding: 18px 22px 22px; overflow-y: auto; max-height: calc(100vh - 140px); }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 18px; bottom: calc(18px + var(--safe-bottom)); z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r); background: rgba(42, 26, 30, .92); color: #fff; font-size: 14px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .5); animation: pop .25s var(--ease); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast--error { background: rgba(140, 34, 42, .95); }
.toast--warn { background: rgba(130, 78, 18, .95); }

/* ---------- Grafik ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover, .chart .hit.is-hover { fill: rgba(42, 26, 30, .05); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.tooltip { position: absolute; pointer-events: none; z-index: 5; min-width: 160px; padding: 10px 12px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .96); border: 1px solid var(--line-2); box-shadow: 0 14px 30px -16px rgba(42, 26, 30, .5); font-size: 13px; }
.tooltip b { display: block; margin-bottom: 4px; }
.tooltip .t-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .t-row i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 6px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 90px; align-items: center; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.bar-row__track { height: 10px; border-radius: 4px; background: rgba(42, 26, 30, .06); overflow: hidden; }
.bar-row__fill { height: 100%; border-radius: 4px; }

/* ---------- Giriş ekranı ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: calc(24px + var(--safe-top)) 16px calc(24px + var(--safe-bottom)); }
.auth__card { width: min(420px, 100%); padding: 34px 30px 30px; }
.auth__card .brand { justify-content: center; padding-bottom: 22px; }
.auth__card h1 { text-align: center; font-size: 32px; }
.auth__card > p { text-align: center; color: var(--muted); margin: 8px 0 22px; }
.auth__card form { display: flex; flex-direction: column; gap: 14px; }
.auth__links { display: flex; justify-content: space-between; font-size: 13.5px; margin-top: 4px; }
.auth__foot { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--muted); }

/* ---------- Yükleniyor ---------- */
.loading { display: grid; place-items: center; min-height: 200px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(122, 34, 50, .18); border-top-color: var(--wine-700); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot { min-height: 100vh; display: grid; place-items: center; }

/* Üye kartı başlığı */
.profile { display: flex; align-items: center; gap: 16px; }
.profile .avatar { width: 58px; height: 58px; font-size: 20px; font-family: var(--serif); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.pkg { padding: 14px 16px; border-radius: var(--r); background: rgba(255, 255, 255, .55); border: 1px solid var(--line); }
.pkg + .pkg { margin-top: 10px; }
.pkg__big { font-family: var(--serif); font-size: 30px; font-weight: 300; line-height: 1; }
.money-pos { color: var(--danger); }
.money-neg { color: var(--ok); }

/* =====================================================================
   Mobil / tablet (Capacitor'a hazır)
   ===================================================================== */
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .app > .content { grid-column: 1; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw);
    transform: translateX(-105%); transition: transform .28s var(--ease);
    background: var(--glass-strong);
  }
  .app.nav-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(42, 26, 30, .3); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .app.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .topbar {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 20;
    padding: calc(10px + var(--safe-top)) 14px 10px;
    border-radius: 0 0 var(--r) var(--r); border-top: 0;
  }
  .topbar .brand { padding: 0; flex: 1; }
  .main { padding: 18px 14px calc(96px + var(--safe-bottom)); }
  .bottom-nav {
    display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(10px + var(--safe-bottom)); z-index: 20;
    padding: 6px; border-radius: 22px; justify-content: space-around;
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; border-radius: 16px; font-size: 11px; font-weight: 500; color: var(--ink-2); }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav a.is-active { background: var(--wine-800); color: #fff; }
  .bottom-nav svg { width: 20px; height: 20px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .cal { display: none; }
  .cal-days { display: block; }
  .toasts { bottom: calc(92px + var(--safe-bottom)); }
}

@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .form { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; min-height: 104px; }
  .stat__value { font-size: 28px; }
  .card { padding: 16px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; }
  .table--stack thead { display: none; }
  .table--stack tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .table--stack td { display: flex; justify-content: space-between; gap: 10px; padding: 3px 4px; border: 0; }
  .table--stack td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; }
  .table--stack td.right { text-align: right; }
  .bar-row { grid-template-columns: 90px 1fr 76px; }
  .page-head h1 { font-size: 28px; }
  .modal__body { padding: 16px; }
  .att { flex-wrap: wrap; }
  .att__actions { width: 100%; }
  .att-btn { flex: 1; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .sidebar, .topbar, .bottom-nav, .page-head__actions, .toasts { display: none !important; }
  .app { display: block; }
  .glass { background: #fff; box-shadow: none; backdrop-filter: none; }
}
