/* Ekranlara özel düzen. Renk/ölçü yalnızca tokens.css değişkenleriyle. */
.mt { margin-top: var(--s-4); }
.mt-sm { margin-top: var(--s-3); }
.mt-lg { margin-top: var(--s-6); }
.hint { text-align: center; color: var(--text-3); font-size: var(--fs-sm); margin: var(--s-4) 0 0; }
.icon.muted { color: var(--text-3); }
.card.muted { color: var(--text-2); }

/* ---------- Bugün: özet ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: var(--s-3) var(--s-4); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1);
  transition: transform .1s var(--ease);
}
.stat:active { transform: scale(.98); }
.stat .n { font-size: 26px; font-weight: var(--fw-bold); line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .l { font-size: var(--fs-sm); color: var(--text-2); font-weight: var(--fw-medium); }
.stat.danger { box-shadow: inset 0 3px 0 var(--danger), var(--shadow-1); }
.stat.danger .n { color: var(--danger-text); }
.stat.accent { box-shadow: inset 0 3px 0 var(--accent), var(--shadow-1); }
.stat.accent .n { color: var(--accent-text); }
.stat[aria-disabled="true"] .n { color: var(--text-3); }

.milk-list { margin-top: var(--s-3); display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--s-2) var(--s-3); }
.milk-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.milk-item small { font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.home-card .btn-row { justify-content: flex-start; }
.home-card .btn-row .btn { flex: none; }

/* ---------- kısayollar ---------- */
.quick {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * var(--s-2)) / 4); gap: var(--s-2);
  overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--s-4)); padding: 2px var(--s-4) var(--s-1);
  scroll-snap-type: x proximity; scroll-padding-inline: var(--s-4);
}
.quick::-webkit-scrollbar { display: none; }
.quick-item {
  scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: var(--s-2);
  padding: var(--s-3) var(--s-2); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1);
  font-size: 13px; font-weight: var(--fw-semibold); text-align: center; line-height: 1.25; min-height: 100px;
  transition: transform .1s var(--ease);
}
.quick-item:active { transform: scale(.97); background: var(--surface-2); }

/* ---------- iş kartı ---------- */
.task { padding: var(--s-4); overflow: hidden; transition: opacity .18s, transform .18s var(--ease), max-height .3s var(--ease), margin .3s, padding .3s; }
.task.late { box-shadow: inset 3px 0 0 var(--danger), var(--shadow-1); }
.task.leaving { opacity: 0; transform: translateX(24px); }
.task.gone { max-height: 0 !important; padding-top: 0; padding-bottom: 0; margin-top: calc(-1 * var(--s-3)); }
.task-head { display: flex; align-items: center; gap: var(--s-3); }
.task-head .body { flex: 1; min-width: 0; }
.task-title { font-size: var(--fs-md); font-weight: var(--fw-bold); line-height: 1.25; letter-spacing: -.01em; }
.task-meta { color: var(--text-2); font-size: var(--fs-sm); margin-top: 2px; }
.task-meta .late { display: inline-flex; align-items: center; gap: 4px; color: var(--danger-text); font-weight: var(--fw-semibold); }
.task-tags { margin-top: var(--s-3); }
.task-actions { margin-top: var(--s-4); }
.task-q { font-weight: var(--fw-semibold); margin-bottom: var(--s-2); }
.task-foot { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s-1); flex-wrap: wrap; }
.task-foot .text-btn.muted:only-child { margin-left: auto; }
.sub-list { margin-top: var(--s-2); box-shadow: inset 0 0 0 1px var(--border); }
.sub-list .list-item { min-height: 56px; padding: var(--s-2) var(--s-3); }
.sub-list .list-item + .list-item::before { left: var(--s-3); }

/* ---------- kayıt sihirbazı ---------- */
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.type-item {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: var(--s-4);
  min-height: 104px; padding: var(--s-4); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1);
  font-size: var(--fs-md); font-weight: var(--fw-semibold); line-height: 1.25; text-align: left;
  transition: transform .1s var(--ease);
}
.type-item:active { transform: scale(.98); background: var(--surface-2); }

.for-animal { display: flex; align-items: center; gap: var(--s-2); color: var(--text-2); font-size: var(--fs-sm); font-weight: var(--fw-semibold); margin-bottom: var(--s-3); }
.all-row { margin-bottom: var(--s-3); }
.search-row { display: flex; gap: var(--s-2); align-items: stretch; }
.search-row .search { flex: 1; min-width: 0; }
.filter-btn { position: relative; flex: none; width: 52px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--border); display: grid; place-items: center; color: var(--text-2); }
.filter-btn .count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--r-full); background: var(--accent); color: #fff; font-size: 11px; display: grid; place-items: center; }
.chips.preset-row { margin-top: var(--s-2); }
.chip { white-space: nowrap; }
.chip.sm .icon { margin-left: 2px; }
.filter-panel { display: flex; flex-direction: column; gap: var(--s-4); }
.filter-group { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.filter-label { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.filter-group .chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; gap: var(--s-2); }
.filter-group .chip { height: 40px; }

/* alttan açılan pencere */
body.sheet-open { overflow: hidden; }
.sheet-wrap { position: fixed; inset: 0; z-index: 40; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .4); animation: fade-in .2s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-xl, 16px) var(--r-xl, 16px) 0 0; box-shadow: var(--shadow-2); animation: sheet-in .25s var(--ease); }
.sheet-head { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-4) var(--s-3) var(--s-2) var(--s-5); }
.sheet-head b { flex: 1; font-size: var(--fs-lg); }
.sheet-body { overflow-y: auto; padding: var(--s-2) var(--s-5) var(--s-4); }
.sheet-foot { padding: var(--s-3) var(--s-4) calc(var(--s-3) + var(--safe-b)); border-top: 1px solid var(--border); }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
.bulk-bar { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4); margin-bottom: var(--s-3); border-radius: var(--r-lg); background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-sm); }
.bulk-bar .body { flex: 1; min-width: 0; }
.bulk-bar .btn { flex: none; }
.sticky-search { position: sticky; top: 0; z-index: 5; padding: var(--s-2) 0; margin: 0 0 var(--s-2); background: var(--bg); }
.picked { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--text-2); font-size: var(--fs-sm); margin: 0 var(--s-1) var(--s-3); }

.done-hero { text-align: center; padding: var(--s-6) 0 var(--s-2); }
.success-mark {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto var(--s-4);
  display: grid; place-items: center; background: var(--accent); color: var(--on-accent);
  animation: pop .4s cubic-bezier(.2, 1.4, .5, 1);
}
.success-mark .icon { width: 36px; height: 36px; stroke-width: 2.5; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }

.date-block {
  flex: none; width: 52px; padding: 6px 0; border-radius: var(--r-sm); text-align: center; line-height: 1.1;
  background: var(--accent-soft); color: var(--accent-text);
}
.date-block b { display: block; font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.date-block span { font-size: 12px; font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- sürü ---------- */
.next-line { display: flex; align-items: center; gap: 5px; }
.list-item .badges { margin-top: 6px; }

/* ---------- hayvan kartı ---------- */
.hero { text-align: center; padding: var(--s-6) var(--s-4) var(--s-5); }
.hero-kupe { color: var(--text-2); font-size: var(--fs-sm); letter-spacing: .06em; margin-top: var(--s-3); font-variant-numeric: tabular-nums; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: var(--s-5); border-top: 1px solid var(--border); padding-top: var(--s-4); }
.fact { display: flex; flex-direction: column; gap: 2px; }
.fact + .fact { border-left: 1px solid var(--border); }
.fact .l { font-size: var(--fs-xs); color: var(--text-3); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: .05em; }
.fact .v { font-weight: var(--fw-semibold); }
.badges.center { justify-content: center; margin-top: var(--s-4); }
.trail.late { color: var(--danger-text); font-weight: var(--fw-semibold); }

/* ---------- hayvan ekle ---------- */
.seg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.option.center { justify-content: center; text-align: center; min-height: 56px; padding: var(--s-2); }
.check-row { display: flex; align-items: center; gap: var(--s-3); min-height: var(--tap); margin-top: var(--s-2); font-weight: var(--fw-medium); color: var(--text-2); }


/* ---------- hayvan kartı: fotoğraf ve isim ---------- */
.hero.has-photo { padding-top: var(--s-4); }
.hero-photo { display: block; width: 100%; margin-bottom: var(--s-4); border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); }
.hero-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hero-id { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); }
.hero-name { font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -.02em; line-height: 1.15; overflow-wrap: anywhere; }
.hero-actions { display: flex; gap: var(--s-2); justify-content: center; margin-top: var(--s-4); flex-wrap: wrap; }
.hero-actions .btn { flex: none; }
.hero-note { color: var(--text-2); font-size: var(--fs-sm); margin: var(--s-3) 0 0; }
.center-btn { display: flex; margin: var(--s-3) auto 0; }
.link { color: var(--accent-text); font-weight: var(--fw-semibold); text-decoration: underline; text-underline-offset: 3px; }
.photo-viewer { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .92); display: grid; place-items: center; padding: var(--s-4); }
.photo-viewer img { max-width: 100%; max-height: 100%; border-radius: var(--r-sm); }

/* ---------- formlar ---------- */
.form-note { display: flex; align-items: center; gap: var(--s-2); color: var(--text-2); font-size: var(--fs-sm); margin: 0 var(--s-1) var(--s-4); }
.field-hint { color: var(--text-3); font-size: var(--fs-xs); margin: 6px var(--s-1) 0; }
.seg-grid.two { grid-template-columns: 1fr 1fr; }
.seg-grid.four { grid-template-columns: repeat(4, 1fr); }
.option.center .icon { margin-right: -4px; }
.photo-pick img { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--r-md); margin-bottom: var(--s-3); }
.photo-pick .btn-row { justify-content: flex-start; }
.photo-pick .btn-row .btn { flex: none; }
.calf-card .calf-head { font-weight: var(--fw-bold); font-size: var(--fs-md); margin-bottom: var(--s-3); }
.label.mt { margin-top: var(--s-4); }
.input-unit { position: relative; flex: 1; }
.input-unit .input { padding-right: 64px; font-variant-numeric: tabular-nums; }
.input-unit span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-weight: var(--fw-semibold); pointer-events: none; }
.inline-form { display: flex; gap: var(--s-2); align-items: stretch; }
.inline-form .btn { flex: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; padding: 0; }

/* ---------- hesap ---------- */
.month-switch { display: flex; align-items: center; justify-content: space-between; margin: 0 0 var(--s-3); font-weight: var(--fw-bold); font-size: var(--fs-lg); }
.month-switch [aria-disabled="true"] { opacity: .3; }
.net-card { text-align: center; padding: var(--s-5) var(--s-4) var(--s-4); }
.net-card > .l { color: var(--text-2); font-weight: var(--fw-semibold); }
.net-card > .n { font-size: 40px; font-weight: var(--fw-bold); letter-spacing: -.02em; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.net-card.profit > .n, .net-card.profit > .l { color: var(--accent-text); }
.net-card.loss > .n, .net-card.loss > .l { color: var(--danger-text); }
.net-card .split { display: grid; grid-template-columns: 1fr 1fr; margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--border); }
.net-card .split > div { display: flex; flex-direction: column; gap: 2px; }
.net-card .split > div + div { border-left: 1px solid var(--border); }
.net-card .split .l { font-size: var(--fs-xs); color: var(--text-3); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: .05em; }
.net-card .split b { font-variant-numeric: tabular-nums; }
.hesap-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.amount { font-weight: var(--fw-bold); white-space: nowrap; font-variant-numeric: tabular-nums; }
.amount.plus { color: var(--accent-text); }
.amount.minus { color: var(--text); }
.date-block.neutral { background: var(--surface-2); color: var(--text-2); }
.ratio { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-4); color: var(--text-2); font-size: var(--fs-sm); }
.ratio b { color: var(--text); }
.total-line { display: flex; justify-content: space-between; align-items: baseline; padding: var(--s-4); border-radius: var(--r-lg); background: var(--accent-soft); color: var(--accent-text); font-weight: var(--fw-semibold); }
.total-line b { font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.total-line b.muted { color: var(--text-3); }
.list-item.hist.selected { background: var(--surface-2); }
.feed-editor { margin-bottom: var(--s-3); }
.sugg { margin-top: var(--s-3); padding: var(--s-3); border-radius: var(--r-md); background: var(--surface-2); }
.sugg-label { display: block; font-size: var(--fs-xs); color: var(--text-3); font-weight: var(--fw-semibold); margin-bottom: var(--s-2); }
.sugg-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip.sm { height: 32px; padding: 0 var(--s-3); font-size: var(--fs-xs); }

/* ---------- ayarlar ---------- */
.head-actions { display: flex; gap: var(--s-2); }
.page-head.compact { margin: 0 0 var(--s-2); }
.page-head.compact .page-title { font-size: var(--fs-xl); }
.note { color: var(--text-3); font-size: var(--fs-xs); line-height: 1.45; margin: var(--s-2) var(--s-1) 0; }
.note.top { margin: 0 var(--s-1) var(--s-3); }
.group-label { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-3); text-transform: uppercase;
  letter-spacing: .05em; margin: var(--s-4) var(--s-1) var(--s-2); }
.group-label:first-of-type { margin-top: 0; }
.list-item.compact { min-height: 56px; }
.list-item.notif { flex-wrap: wrap; row-gap: var(--s-2); }
.list-item.notif.off .title { color: var(--text-2); }
.notif-time { flex-basis: 100%; display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--s-2); border-top: 1px dashed var(--border); color: var(--text-2); font-size: var(--fs-sm); }
.notif-time.off { color: var(--text-3); }
.input.time { width: 104px; height: 44px; padding: 0 var(--s-2); font-size: var(--fs-md); text-align: center; flex: none; }
.row-card { display: flex; align-items: center; gap: var(--s-3); }
.row-card .body { flex: 1; min-width: 0; }
.row-card .title { font-weight: var(--fw-semibold); }
.row-card .sub { color: var(--text-2); font-size: var(--fs-sm); margin-top: 2px; }
.stepper { display: flex; align-items: center; gap: var(--s-1); flex: none; }
.stepper .step { width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 22px;
  font-weight: var(--fw-medium); display: grid; place-items: center; color: var(--text); }
.stepper .step:disabled { opacity: .35; }
.stepper .step:active:not(:disabled) { background: var(--surface-pressed); }
.stepper .num { min-width: 64px; text-align: center; color: var(--text-2); font-size: var(--fs-sm); }
.stepper .num b { color: var(--text); font-size: var(--fs-lg); }
.list-item.duration { align-items: flex-start; }
.duration .days { position: relative; flex: none; width: 96px; }
.duration .days .input { height: 44px; padding: 0 40px 0 var(--s-3); font-size: var(--fs-md); text-align: right;
  font-variant-numeric: tabular-nums; }
.duration .days span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3);
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); pointer-events: none; }
.duration .days.changed .input { border-color: var(--accent); background: var(--accent-soft); }
.text-btn.small { min-height: 32px; font-size: var(--fs-xs); padding: 0; margin-top: 2px; }
.card.invite .title { font-weight: var(--fw-semibold); }
.card.invite .sub { color: var(--text-2); font-size: var(--fs-sm); margin: 2px 0 var(--s-3); }
.input.mono { font-size: var(--fs-sm); font-weight: var(--fw-medium); height: 44px; color: var(--text-2); }

@media (max-width: 360px) {
  .stat .n { font-size: 24px; }
  .type-item { min-height: 104px; }
  .seg-grid { grid-template-columns: 1fr 1fr; }
  .seg-grid.four { grid-template-columns: 1fr 1fr; }
  .net-card > .n { font-size: 34px; }
}

/* ---------- geniş ekran (bilgisayar) ---------- */
.side-brand, .side-link { display: none; }

@media (hover: hover) {
  .list-item:is(button, a):hover, .option:hover, .type-item:hover, .card.tap:hover { background: var(--surface-2); }
  .chip:hover:not(.on) { box-shadow: inset 0 0 0 1.5px var(--text-3); color: var(--text); }
  .btn:hover:not(:disabled) { filter: brightness(.96); }
  .tab:hover, .side-link:hover { color: var(--text); }
  .text-btn:hover, .link:hover { text-decoration: underline; }
}

@media (min-width: 720px) {
  :root { --page-max: 720px; }
  .type-grid { grid-template-columns: repeat(3, 1fr); }
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 520px; transform: translate(-50%, -50%); border-radius: var(--r-lg); animation: none; }
}

@media (min-width: 1024px) {
  :root { --side-w: 248px; --page-max: 860px; }
  body { padding-left: var(--side-w); }
  #app { padding: var(--s-6) var(--s-6) var(--s-8); }
  body.has-footer #app, body.no-tabbar #app { padding-bottom: 120px; }

  /* sol menü her ekranda görünür */
  .tabbar, body.no-tabbar .tabbar {
    display: flex; flex-direction: column; justify-content: flex-start; gap: 2px;
    top: 0; right: auto; width: var(--side-w); height: 100vh; padding: var(--s-4) var(--s-3);
    border-top: 0; border-right: 1px solid var(--border); background: var(--surface);
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .side-brand { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-2) var(--s-5); }
  .side-brand b { display: block; font-size: var(--fs-md); }
  .side-brand small { display: block; color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
  .side-logo { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; }
  .tab, .side-link {
    flex: none; max-width: none; height: 44px; flex-direction: row; justify-content: flex-start; gap: var(--s-3);
    padding: 0 var(--s-3); border-radius: var(--r-md); font-size: var(--fs-sm); color: var(--text-2);
  }
  .side-link { display: flex; align-items: center; margin-top: auto; font-weight: var(--fw-semibold); }
  .tab .pill { width: auto; height: auto; background: none !important; }
  .tab.on { background: var(--accent-soft); color: var(--accent-text); }
  .tab:hover:not(.on), .side-link:hover { background: var(--surface-2); }
  .tab .dot { position: static; margin-left: auto; border: 0; }

  .footer-bar, body.no-tabbar .footer-bar { left: var(--side-w); bottom: 0; padding-bottom: var(--s-4); }
  .footer-bar .inner { max-width: 480px; margin: 0 auto; }
  .toast, body.no-tabbar .toast, body.has-footer .toast { left: calc(var(--side-w) + var(--s-4)); bottom: var(--s-6); }
  body.has-footer .toast { bottom: 96px; }

  .type-grid { grid-template-columns: repeat(4, 1fr); }
  .stats { gap: var(--s-3); }
  .head-actions [data-act="openAyarlar"] { display: none; }
}
.title-sm { font-weight: var(--fw-bold); font-size: var(--fs-md); }

.file-row { cursor: pointer; }
.file-row.disabled { opacity: .6; pointer-events: none; }
.excel-result .title { font-weight: var(--fw-bold); }
.excel-result .problems { margin: var(--s-2) 0 0; padding-left: 18px; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; }
