/* Ana sayfa, menu ve ust cubuk yeniden tasarimi (27 Kasim 2026). app.css degiskenlerini kullanir. */
/*
 * Kurallar: yalnız yeni sınıflar (home-*, cash-*, bridge-*, attn-*, expo-*, rank-*, strip-*, colchart-*, user-menu-*, nav-count);
 * app.css sınıfları değiştirilmez, yalnız menü öğelerinin dokunma yüksekliği büyütülür. Kartlarda sol renk şeridi ve renkli ikon kutusu yoktur;
 * renk yalnız durum bildirir (yeşil olumlu, kırmızı/turuncu dikkat). Dış font/CDN/JS yoktur.
 */

/* ───────── Menü: sayaç rozeti ve dokunma yüksekliği ───────── */
.nav-item, .nav-section > summary { min-height: 40px; }
.nav-count { margin-left: auto; min-width: 24px; padding: 1px 8px; border-radius: 10px; background: #ffd28a; color: #3d2600; font-size: 0.78rem; font-weight: 700; line-height: 1.5; text-align: center; font-variant-numeric: tabular-nums; flex-shrink: 0; }

/* ───────── Üst çubuk: kullanıcı menüsü (betiksiz details/summary) ───────── */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu-button { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 10px 4px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; user-select: none; }
.user-menu-button:hover, .user-menu[open] > .user-menu-button { border-color: var(--accent); }
.user-menu-button:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.user-menu-button .avatar { background: var(--blue-100); color: var(--blue-700); font-weight: 700; }
.user-menu-name { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu-caret { width: 7px; height: 7px; margin: 0 4px 3px 2px; border-right: 2px solid var(--slate-600); border-bottom: 2px solid var(--slate-600); transform: rotate(45deg); transition: transform 0.16s; }
.user-menu[open] .user-menu-caret { transform: translateY(3px) rotate(-135deg); }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(260px, calc(100vw - 32px)); padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16); }
.user-menu-panel form { margin: 0; }
.user-menu-who { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line-soft); line-height: 1.3; min-width: 0; }
.user-menu-who strong, .user-menu-who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu-who small { color: var(--ink-soft); font-size: 0.8rem; }
.user-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); font: inherit; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; }
.user-menu-item .ico { color: var(--slate-600); }
.user-menu-item:hover { background: var(--slate-100); color: var(--accent-strong); }
.user-menu-item:focus-visible { outline: 2px solid var(--blue-500); outline-offset: -2px; }

/* ───────── Ana sayfa: başlık ve denetimler ───────── */
.home-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.home-head h1 { margin: 0; }
.home-sub { margin-top: 2px; color: var(--ink-soft); }
.home-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0; }
.home-head-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.home-head-actions:empty { display: none; }
.home-new-service { min-height: 44px; padding: 0 16px; border-radius: var(--radius); display: inline-flex; align-items: center; }
.home-field { display: flex; flex-direction: column; gap: 3px; font-size: 0.82rem; font-weight: 600; color: var(--slate-700); }
.home-field input, .home-field select { height: 44px; min-width: 130px; padding: 0 10px; border: 1px solid var(--slate-300); border-radius: var(--radius); background: #fff; color: var(--ink); font: inherit; font-weight: 400; }
.home-field select { cursor: pointer; }
.home-field input:hover, .home-field select:hover { border-color: #9db0c3; }
.home-controls .btn { min-height: 44px; padding: 0 18px; border-radius: var(--radius); }

/* ───────── Ana sayfa: paneller ───────── */
.home-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: stretch; margin-bottom: 16px; }
.home-top > .home-panel { margin-bottom: 0; }
.home-panel { display: flex; flex-direction: column; gap: 16px; min-width: 0; margin-bottom: 16px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.home-panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.home-panel-head h2 { font-size: 1.07rem; }
.home-panel .alert { margin: 0; }
.home-subtitle { margin: 0 0 6px; font-size: 0.86rem; font-weight: 600; color: var(--slate-700); }
.home-subtitle .muted { font-weight: 400; }
.home-note { font-size: 0.86rem; color: var(--ink-soft); }
.home-loading { color: var(--ink-soft); }
.home-cols { display: flex; flex-wrap: wrap; gap: 20px 28px; }
.home-col { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; }
.home-col.wide { flex: 3 1 460px; gap: 16px; }
.home-cols.even > * { flex: 1 1 300px; min-width: 0; }
.home-more { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; align-self: flex-start; }
.home-panel .link:focus-visible, .home-panel a:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; border-radius: 2px; }

/* Başlık rakamları */
.home-stats { display: flex; flex-wrap: wrap; gap: 16px 32px; }
.home-stat { display: flex; flex-direction: column; min-width: 0; }
.home-stat-label { font-size: 0.93rem; font-weight: 600; color: var(--slate-700); }
.home-stat-value { font-size: 1.86rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.home-stat-hint { font-size: 0.86rem; color: var(--ink-soft); }
.home-stat-hint .up, .cash-delta.up, .bridge-value.up { color: var(--ok); }
.home-stat-hint .down, .cash-delta.down { color: var(--bad); }
.home-stat-hint .up, .home-stat-hint .down { font-weight: 700; }

/* ───────── Nakit paneli ───────── */
.cash-headline-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.cash-total { font-size: 2.6rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cash-total.neg, .bridge-value.neg { color: var(--bad); }
.cash-delta { font-weight: 650; font-variant-numeric: tabular-nums; }
.cash-bridge { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.bridge-cell { flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); color: var(--ink); text-decoration: none; }
a.bridge-cell { border: 1px solid transparent; }
a.bridge-cell:hover { border-color: var(--slate-300); background: var(--slate-100); }
a.bridge-cell:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.bridge-cell.total { background: var(--accent-soft); }
.bridge-label { font-size: 0.86rem; font-weight: 600; color: var(--slate-700); }
.bridge-value { font-size: 1.24rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bridge-value.out { color: var(--warn); }
.bridge-cell.total .bridge-value:not(.neg) { color: var(--accent-strong); }
.bridge-hint { font-size: 0.86rem; color: var(--slate-600); }

/* ───────── Dikkat isteyenler ───────── */
.home-attention { gap: 0; }
.home-attention .home-panel-head { margin-bottom: 12px; }
.attn-list { list-style: none; margin: 0; padding: 0; }
.attn-row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 0; border-top: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; }
.attn-row:hover .attn-title { color: var(--accent-strong); text-decoration: underline; }
.attn-row:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; border-radius: var(--radius-sm); }
.attn-badge { min-width: 44px; padding: 4px 6px; border-radius: var(--radius-sm); background: var(--muted-bg); color: var(--slate-700); font-size: 1.07rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.attn-badge.wait { background: var(--wait-bg); color: #7a4500; }
.attn-badge.warn { background: var(--warn-bg); color: #8a3f00; }
.attn-badge.bad { background: var(--bad-bg); color: #a3222c; }
.attn-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.attn-title { font-weight: 600; }
.attn-hint { font-size: 0.86rem; color: var(--slate-600); }
.attn-go { width: 7px; height: 7px; margin-right: 4px; border-right: 2px solid var(--slate-600); border-top: 2px solid var(--slate-600); transform: rotate(45deg); flex-shrink: 0; }
.attn-ok { display: flex; align-items: flex-start; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--ok); font-weight: 600; line-height: 1.9; }
.attn-ok a { color: inherit; text-decoration: underline; text-underline-offset: 2px; padding: 6px 0; }
.attn-ok a:hover { color: var(--accent-strong); }
.attn-ok-mark { width: 9px; height: 15px; margin: 4px 4px 0 3px; border-right: 2.4px solid currentColor; border-bottom: 2.4px solid currentColor; transform: rotate(40deg); flex-shrink: 0; }
.attn-error { padding: 10px 0; border-top: 1px solid var(--line-soft); color: var(--wait); font-weight: 600; }
.attn-empty { padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--ink-soft); }

/* ───────── Satış: sütun grafiği ve müşteri listesi ───────── */
.colchart { margin: 0; min-width: 0; }
.colchart figcaption { margin-bottom: 8px; font-size: 0.86rem; font-weight: 600; color: var(--slate-700); }
.colchart-scroll { overflow-x: auto; }
.colchart-plot { display: flex; align-items: flex-end; min-width: calc(var(--cols, 12) * 38px); }
.colchart-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: stretch; }
.colchart-stack { height: 164px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding: 0 3px; border-bottom: 1px solid var(--slate-300); }
.colchart-val { font-size: 0.79rem; color: var(--slate-700); font-variant-numeric: tabular-nums; white-space: nowrap; }
.colchart-val.neg { color: var(--bad); }
.colchart-bar { display: block; width: 100%; max-width: 44px; background: #8fb5e3; border-radius: 3px 3px 0 0; }
.colchart-col.now .colchart-bar { background: var(--blue-700); }
.colchart-col.now .colchart-val, .colchart-col.now .colchart-lab { color: var(--ink); font-weight: 700; }
.colchart-lab { padding-top: 4px; font-size: 0.79rem; color: var(--slate-600); text-align: center; white-space: nowrap; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; flex-direction: column; gap: 5px; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.rank-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.rank-row .link { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-figures { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rank-share { display: inline-block; min-width: 3.2em; text-align: right; font-size: 0.86rem; color: var(--slate-600); }
.rank-track { height: 4px; background: var(--slate-100); border-radius: 2px; }
.rank-track span { display: block; height: 100%; min-width: 2px; background: var(--blue-500); border-radius: 2px; }

/* ───────── Alacak ve borç ───────── */
.expo { display: flex; flex-direction: column; gap: 8px; }
.expo-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.expo-head strong { font-size: 1.43rem; font-variant-numeric: tabular-nums; }
.expo-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #cfe0f5; }
.expo-bar span { display: block; background: var(--bad); }
.expo-bar.payable { background: var(--slate-200); }
.expo-bar.payable span { background: var(--warn); }
.expo-foot { font-size: 0.93rem; font-variant-numeric: tabular-nums; }
.home-table-box { overflow-x: auto; }
.home-table-box:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.home-table { width: 100%; min-width: 440px; border-collapse: collapse; font-size: 0.93rem; }
.home-table th { padding: 8px 0 8px 12px; border-bottom: 1px solid var(--line); color: var(--slate-700); font-size: 0.86rem; font-weight: 600; text-align: left; white-space: nowrap; }
.home-table td { padding: 9px 0 9px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.home-table th:first-child, .home-table td:first-child { padding-left: 0; white-space: normal; }
.home-table tbody tr:last-child td { border-bottom: 0; }
.home-table th.num, .home-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.home-table td.overdue { color: var(--bad); font-weight: 650; }
.home-aging .barlist { margin: 0; }
.home-aging .barlist figcaption { margin-bottom: 8px; font-size: 0.86rem; font-weight: 600; color: var(--slate-700); }
.home-aging .bar-track { height: 12px; border-radius: 2px; background: var(--slate-100); }
.home-aging .bar-fill { background: var(--bad); border-radius: 2px; }

/* ───────── Stok ve alışlar şeridi ───────── */
.home-strip { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 40px; padding: 16px 22px; }
.home-strip h2 { flex: 0 0 auto; font-size: 1.07rem; }
.strip-item { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; }
.strip-item strong { font-size: 1.24rem; font-variant-numeric: tabular-nums; }
.strip-hint { font-size: 0.86rem; color: var(--slate-600); }
.home-strip > .link { display: inline-flex; align-items: center; min-height: 44px; }

/* ───────── Kısayollar (finans izni olmayan kullanıcı) ───────── */
.home-shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 28px; }
.home-shortcut { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; border-top: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; }
.home-shortcut .ico { color: var(--slate-600); }
.home-shortcut-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.home-shortcut-title { font-weight: 650; }
.home-shortcut-hint { font-size: 0.86rem; color: var(--slate-600); }
.home-shortcut:hover .home-shortcut-title { color: var(--accent-strong); text-decoration: underline; }
.home-shortcut:hover .ico { color: var(--accent-strong); }

/* ───────── Duyarlı yerleşim ───────── */
@media (max-width: 1180px) {
    .home-top { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    /* Dar kenar menüde (yalnız ikon) sayaç ikonun köşesine oturur. */
    .nav-item, .nav-section > summary { min-height: 44px; }
    .nav-count { position: absolute; top: 3px; right: 6px; min-width: 18px; padding: 0 5px; font-size: 0.68rem; line-height: 18px; }
    .user-menu-name { display: none; }
}

@media (max-width: 760px) {
    /* Telefonda menü tam genişlikte açılır; sayaç yeniden satır sonuna geçer. */
    .nav-count { position: static; min-width: 24px; padding: 1px 8px; font-size: 0.78rem; line-height: 1.5; }
    .home-panel { padding: 16px; }
    .home-strip { padding: 14px 16px; }
    .home-controls { width: 100%; }
    .home-field { flex: 1 1 140px; }
    .home-field input, .home-field select { width: 100%; min-width: 0; font-size: 16px; }
    .cash-total { font-size: 2rem; }
    .home-stat-value { font-size: 1.6rem; }
}

@media print {
    .user-menu, .home-controls { display: none; }
}

/* ───────── Bölüm durumları: tazelik notu, geciken okuma, cari bakiye listeleri (28 Kasım 2026) ───────── */
.home-fresh { margin-top: 2px; font-size: 0.86rem; color: var(--ink-soft); }
.home-wait { padding: 10px 12px; border-radius: var(--radius); background: var(--wait-bg); color: #7a4500; font-weight: 600; }
.home-wait .link, .attn-error .link, .home-panel .alert .link { margin-left: 6px; }
.expo.party .home-table { min-width: 0; }
.expo.party .home-table td:first-child { white-space: normal; overflow-wrap: anywhere; }
