:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --nav: #0b1220;
  --nav-soft: #172033;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --critical: #dc2626;
  --warning: #ea580c;
  --healthy: #16a34a;
  --shadow: 0 14px 40px rgba(15, 23, 42, .08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.login-screen { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 18px; background: radial-gradient(circle at 20% 10%, #1e3a8a, #0b1220 55%); }
.login-screen[hidden] { display: none; }
.session-restoring .login-screen { display: none; }
.login-logo { display: block; width: min(300px, 100%); height: auto; margin: 0 auto 4px; }
.login-card { width: min(420px, 100%); padding: 28px; border-radius: 20px; background: white; box-shadow: 0 30px 90px rgba(0,0,0,.35); display: grid; gap: 16px; }
.login-card h1 { margin-top: 7px; }.login-card p { margin-top: 6px; color: var(--muted); font-size: 12px; }
.login-card label span { display: block; margin-bottom: 6px; color: #475569; font-size: 12px; font-weight: 750; }
.login-card input { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 10px; }
.login-card small { color: var(--muted); text-align: center; }
.login-error { padding: 9px; border-radius: 9px; background: #fff1f2; color: #be123c; font-size: 12px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--nav); color: #e5edf9; padding: 22px 16px; display: flex; flex-direction: column; z-index: 40; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #2f6ff0, #1f4cc3); color: white; font-weight: 800; font-size: 20px; }
.brand-logo-icon { object-fit: cover; background: white; padding: 2px; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 18px; }
.brand span { color: #8fa1bd; font-size: 12px; margin-top: 2px; }
.nav-list { display: grid; gap: 6px; }
.nav-item { border: 0; background: transparent; color: #9dafc8; padding: 12px 13px; border-radius: 11px; text-align: left; display: flex; gap: 11px; align-items: center; font-weight: 650; }
.nav-item:hover, .nav-item.active { background: var(--nav-soft); color: white; }
.nav-item span { width: 20px; text-align: center; font-size: 18px; }
.nav-item .nav-count { width: auto; min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: #dc2626; color: white; font-size: 12px; }
.nav-group { display: grid; gap: 3px; }
.nav-parent { width: 100%; }
.nav-svg { width: 20px; height: 20px; display: grid; place-items: center; }
.nav-svg svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-chevron { width: 18px; height: 18px; display: grid; place-items: center; margin-left: auto; transition: transform .18s ease; }
.nav-chevron svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-group.open .nav-chevron { transform: rotate(180deg); }
.nav-submenu { display: none; gap: 3px; padding-left: 14px; }
.nav-group.open .nav-submenu { display: grid; }
.nav-subitem { width: 100%; padding: 9px 12px; font-size: 12px; }
.nav-subitem span { font-size: 12px; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 12px; }
.sync-card { border: 1px solid #253047; border-radius: 14px; padding: 13px; background: rgba(255,255,255,.035); }
.sync-card span, .sync-card strong { display: block; }
.sync-label { font-size: 12px; color: #8fa1bd; text-transform: uppercase; letter-spacing: .08em; }
.sync-card strong { margin: 5px 0 12px; font-size: 13px; }
.user-card { border-top: 1px solid #253047; padding: 14px 5px 0; display: flex; gap: 10px; align-items: center; }
.logout-button { margin-left: auto; width: 30px; height: 30px; border: 1px solid #34405a; border-radius: 8px; background: transparent; color: #dce7f8; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #243047; font-size: 12px; font-weight: 800; }
.user-card strong, .user-card span { display: block; font-size: 12px; }
.user-card span { color: #8fa1bd; margin-top: 2px; }
.main-content { padding: 22px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }
.topbar > div:first-of-type { min-width: 230px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; letter-spacing: -.025em; white-space: nowrap; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
.topbar p, .section-heading p, .dealer-panel-header p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.search-box { width: min(300px, 30vw); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; display: flex; align-items: center; gap: 8px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; padding: 10px 0; }
.notification-menu-wrap { position: relative; }
.notification-button { position: relative; width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: white; color: #334155; }
.notification-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-button > span { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border: 2px solid var(--bg); border-radius: 999px; background: #dc2626; color: white; font-size: 12px; font-weight: 850; }
.notification-dropdown { position: absolute; top: calc(100% + 8px); right: 0; z-index: 125; width: min(380px, calc(100vw - 24px)); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 20px 55px rgba(15,23,42,.2); }
.notification-dropdown-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.notification-dropdown-head strong, .notification-dropdown-head span { display: block; }
.notification-dropdown-head strong { font-size: 12px; }.notification-dropdown-head span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.notification-dropdown-head button { border: 0; background: transparent; color: #2563eb; font-size: 12px; font-weight: 800; }
.notification-list { max-height: 350px; overflow: auto; }
.notification-item { width: 100%; display: grid; grid-template-columns: 9px 1fr; gap: 10px; padding: 12px 13px; border: 0; border-bottom: 1px solid #eef2f7; background: white; color: var(--text); text-align: left; }
.notification-item:hover { background: #f8fafc; }
.notification-item.read { opacity: .62; }
.notification-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #f59e0b; }
.notification-item.critical .notification-dot { background: #dc2626; }
.notification-item strong, .notification-item span, .notification-item small { display: block; }
.notification-item strong { font-size: 12px; }.notification-item span { margin-top: 3px; color: #475569; font-size: 12px; line-height: 1.45; }.notification-item small { margin-top: 4px; color: #94a3b8; font-size: 12px; }
.notification-open-today { width: 100%; padding: 11px; border: 0; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 800; }
.profile-menu-wrap { position: relative; }
.profile-button { min-width: 190px; height: 46px; display: grid; grid-template-columns: 34px 1fr 18px; align-items: center; gap: 9px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--text); text-align: left; }
.profile-button .avatar { width: 34px; height: 34px; background: #dbeafe; color: #1d4ed8; }
.profile-button-text strong, .profile-button-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-button-text strong { font-size: 12px; }.profile-button-text small { margin-top: 2px; color: #64748b; font-size: 12px; }
.profile-button > svg { width: 16px; height: 16px; fill: none; stroke: #64748b; stroke-width: 2; transition: transform .18s ease; }
.profile-button[aria-expanded="true"] > svg { transform: rotate(180deg); }
.profile-dropdown { position: absolute; top: calc(100% + 8px); right: 0; z-index: 120; width: 270px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 20px 55px rgba(15,23,42,.18); }
.profile-dropdown-head { padding: 13px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.profile-dropdown-head strong, .profile-dropdown-head span { display: block; }
.profile-dropdown-head strong { font-size: 12px; }.profile-dropdown-head span { margin-top: 3px; color: #64748b; font-size: 12px; }
.profile-dropdown button { width: 100%; display: block; padding: 11px 13px; border: 0; border-bottom: 1px solid #eef2f7; background: white; color: #0f172a; text-align: left; }
.profile-dropdown button:hover { background: #f8fafc; }
.profile-dropdown button span, .profile-dropdown button small { display: block; }
.profile-dropdown button span { font-size: 12px; font-weight: 800; }.profile-dropdown button small { margin-top: 2px; color: #64748b; font-size: 12px; }
.profile-dropdown .profile-logout { color: #b91c1c; border-bottom: 0; }
.button { min-height: 39px; border-radius: 10px; border: 1px solid transparent; padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 750; font-size: 13px; }
.button.primary { background: var(--primary); color: white; }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { background: var(--panel); border-color: var(--line); color: var(--text); }
.button.location-needed { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.button.danger { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.button.danger:hover { background: #ffe4e6; }
.button.full { width: 100%; background: transparent; color: #dce7f8; border-color: #34405a; }
.icon-button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 19px; display: grid; place-items: center; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; box-shadow: 0 4px 20px rgba(15,23,42,.035); }
.metric-card span, .metric-card small, .metric-card strong { display: block; }
.metric-card span { color: var(--muted); font-size: 12px; }
.metric-card strong { font-size: 23px; margin: 7px 0 4px; letter-spacing: -.035em; }
.metric-card small { color: var(--muted); font-size: 12px; }
.metric-card.critical strong { color: var(--critical); }
.metric-card.warning strong { color: var(--warning); }
.region-section { margin-bottom: 14px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.section-heading.compact { align-items: center; }
.status-legend { display: flex; gap: 12px; color: var(--muted); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.dot.critical { background: var(--critical); }.dot.warning { background: var(--warning); }.dot.healthy { background: var(--healthy); }
.dot.blacklisted { background: #111827; }
.region-tabs { display: flex; flex-wrap: wrap; gap: 7px; }
.region-tab, .segment { border: 1px solid var(--line); background: var(--panel); color: #475569; border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 700; }
.region-tab.active, .segment.active { background: #e8f0ff; color: #1d4ed8; border-color: #b8cdf8; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(310px, .65fr); gap: 14px; height: calc(100vh - 325px); min-height: 470px; }
.map-panel, .dealer-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.map-panel { position: relative; min-width: 0; }
.panel-toolbar { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 4; display: flex; justify-content: space-between; gap: 10px; pointer-events: none; }
.segmented, .panel-toolbar .icon-button { pointer-events: auto; }
.segmented { background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 999px; padding: 4px; display: flex; gap: 3px; box-shadow: 0 8px 20px rgba(15,23,42,.08); }
.segment { border: 0; background: transparent; padding: 7px 10px; }
#map { width: 100%; height: 100%; min-height: 470px; background: #eaf0f5; }
.region-map-badge { position: absolute; left: 12px; bottom: 30px; z-index: 4; padding: 7px 10px; border: 1px solid rgba(255,255,255,.8); border-radius: 9px; background: rgba(255,255,255,.88); color: #334155; box-shadow: 0 5px 16px rgba(15,23,42,.12); backdrop-filter: blur(6px); font-size: 12px; font-weight: 800; }
.map-credit { position: absolute; bottom: 8px; left: 8px; background: rgba(255,255,255,.88); padding: 3px 7px; border-radius: 7px; font-size: 12px; color: var(--muted); z-index: 3; }
.dealer-panel { display: flex; flex-direction: column; min-height: 0; }
.dealer-panel-header { padding: 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dealer-panel-header select { max-width: 145px; border: 1px solid var(--line); border-radius: 9px; padding: 8px; background: white; font-size: 12px; }
.dealer-panel-search { position: relative; display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.dealer-panel-search span { position: absolute; left: 23px; top: 50%; transform: translateY(-50%); color: #64748b; font-size: 14px; pointer-events: none; }
.dealer-panel-search input { width: 100%; padding: 10px 11px 10px 34px; border: 1px solid #cbd5e1; border-radius: 10px; background: white; color: #0f172a; font-size: 12px; outline: none; }
.dealer-panel-search input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.dealer-list { overflow: auto; padding: 8px; display: grid; gap: 7px; }
.dealer-item { border: 1px solid var(--line); border-left: 4px solid var(--line); background: white; border-radius: 11px; padding: 11px; text-align: left; }
.dealer-item:hover { background: var(--panel-soft); border-color: #cbd5e1; }
.dealer-item.critical { border-left-color: var(--critical); }.dealer-item.warning { border-left-color: var(--warning); }.dealer-item.healthy { border-left-color: var(--healthy); }
.dealer-item.blacklisted { border: 2px solid #111827; border-left-width: 6px; background: #f8fafc; box-shadow: inset 0 0 0 1px #cbd5e1; }
.blacklist-chip { display: inline-flex; margin: 5px 0 0 7px; padding: 3px 6px; border-radius: 5px; background: #111827; color: white; font-size: 12px; font-weight: 900; letter-spacing: .05em; vertical-align: middle; }
.dealer-top, .dealer-bottom { display: flex; justify-content: space-between; gap: 8px; }
.dealer-item strong { font-size: 13px; }
.dealer-item .city { color: var(--muted); font-size: 12px; margin-top: 3px; }
.dealer-item .days { font-size: 12px; font-weight: 800; white-space: nowrap; }
.dealer-item.critical .days { color: var(--critical); }.dealer-item.warning .days { color: var(--warning); }.dealer-item.healthy .days { color: var(--healthy); }
.dealer-bottom { margin-top: 9px; align-items: end; }
.dealer-bottom span { display: block; color: var(--muted); font-size: 12px; }
.dealer-bottom b { display: block; font-size: 12px; margin-top: 2px; }
.health-score { --score: 0; --score-color: #3b82f6; width: 50px; height: 50px; flex: 0 0 50px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--score-color) calc(var(--score) * 1%), #e8edf4 0); box-shadow: 0 3px 10px rgba(15,23,42,.08); }
.health-score::before { content: ""; grid-area: 1 / 1; width: 35px; height: 35px; border-radius: 50%; background: white; box-shadow: inset 0 0 0 1px rgba(148,163,184,.18); }
.health-score span { position: relative; grid-area: 1 / 1; margin: 0 !important; color: #172033 !important; font-size: 13px !important; font-weight: 900; line-height: 1; }
.health-score.score-strong { --score-color: #16a34a; }
.health-score.score-controlled { --score-color: #2563eb; }
.health-score.score-risky { --score-color: #f59e0b; }
.health-score.score-critical { --score-color: #ef476f; }
.health-score-list { width: 43px; height: 43px; flex-basis: 43px; }
.health-score-list::before { width: 30px; height: 30px; }
.health-score-list span { font-size: 12px !important; }
.empty-view { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; min-height: 300px; }
.today-view { min-height: 360px; margin-bottom: 16px; }
.today-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; }
.today-column { border: 1px solid var(--line); border-radius: 13px; padding: 13px; background: var(--panel-soft); }
.today-column h3 { margin-bottom: 10px; }
.today-item { padding: 10px; border-radius: 10px; background: white; border: 1px solid var(--line); margin-top: 7px; }
.today-item strong, .today-item span { display: block; }
.today-item strong { font-size: 12px; }.today-item span { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.today-dealer-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.today-dealer-item > div:first-child { min-width: 0; }
.health-score-today { width: 54px; height: 54px; flex-basis: 54px; }
.health-score-today::before { width: 38px; height: 38px; }
.health-score-today span { font-size: 14px !important; }
.record-list { display: grid; gap: 9px; }
.record-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; }
.record-card strong, .record-card span { display: block; }
.record-card strong { font-size: 12px; }.record-card span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.record-status { padding: 6px 8px; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 800; }
.record-status.suresi_gecti, .record-status.gecikti { background: #fff1f2; color: #be123c; }
.record-status.onaylandi, .record-status.payment { background: #dcfce7; color: #166534; }
.record-status.onaylanmadi { background: #fff1f2; color: #be123c; }
.record-status.responded { background: #eff6ff; color: #1d4ed8; }
.record-status.yaklasiyor { background: #fff7ed; color: #c2410c; }
.record-status.odendi { background: #dcfce7; color: #166534; }
.record-status.odenemedi { background: #fee2e2; color: #b91c1c; }
.promise-decision-area { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.promise-card { align-items: stretch; }
.promise-card-copy { min-width: 280px; flex: 1; }
.promise-dealer-debt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: -4px; padding: 8px 10px; border: 1px solid #bfdbfe; border-radius: 9px; background: #eff6ff; color: #475569; font-size: 12px; }
.promise-dealer-debt[hidden] { display: none; }
.promise-dealer-debt span { display: inline-flex; align-items: center; gap: 4px; }
.promise-dealer-debt strong { color: #1e3a8a; font-size: 12px; }
.promise-dealer-debt .debt-current { color: #15803d; font-weight: 750; }
.collection-dealer-debt { margin-top: -8px; border-color: #e2e8f0; background: #f8fafc; }
.collection-dealer-debt .overdue-amount,
.collection-dealer-debt .overdue-amount strong { color: #be123c; }
.collection-priority-view { min-height: calc(100vh - 110px); }
.collection-priority-filters { display: grid; grid-template-columns: minmax(240px,1.4fr) minmax(180px,.8fr) minmax(220px,1fr) auto; gap: 9px; align-items: end; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-soft); }
.collection-priority-filters label > span { display: block; margin-bottom: 5px; color: #475569; font-size: 12px; font-weight: 750; }
.collection-priority-filters input, .collection-priority-filters select { width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.collection-priority-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; margin: 12px 0; }
.collection-priority-summary article { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.collection-priority-summary span, .collection-priority-summary strong { display: block; }
.collection-priority-summary span { color: var(--muted); font-size: 12px; }
.collection-priority-summary strong { margin-top: 5px; font-size: 18px; }
.collection-priority-summary .priority-overdue-summary { border-color: #fecaca; background: #fff7f7; }
.collection-priority-summary .priority-overdue-summary strong { color: #be123c; }
.collection-priority-summary .priority-current-summary { border-color: #bbf7d0; background: #f0fdf4; }
.collection-priority-summary .priority-current-summary strong { color: #15803d; }
.collection-priority-table { min-width: 1120px; table-layout: fixed; }
.collection-priority-table th:nth-child(1) { width: 20%; }
.collection-priority-table th:nth-child(2) { width: 10%; }
.collection-priority-table th:nth-child(3),
.collection-priority-table th:nth-child(4),
.collection-priority-table th:nth-child(5) { width: 8%; }
.collection-priority-table th:nth-child(6) { width: 7%; }
.collection-priority-table th:nth-child(7) { width: 7%; }
.collection-priority-table th:nth-child(8) { width: 32%; }
.collection-priority-table td { height: 62px; }
.collection-priority-table td:first-child strong { line-height: 1.35; }
.collection-priority-table tr.priority-overdue-row td { background: #fffafa; }
.collection-priority-table tr.priority-current-row td { background: #fbfffc; }
.collection-priority-table tr.priority-bad-debt-row td { background: #fff1f2; border-top-color: #fda4af; }
.collection-priority-table tr.priority-recent-action-row td { background: #f7fbff; }
.collection-priority-table tr.priority-recent-action-row td:first-child { box-shadow: inset 3px 0 #3b82f6; }
.collection-priority-table tr.priority-has-promise-row td { background: #f7fff9; }
.collection-priority-table tr.priority-has-promise-row td:first-child { box-shadow: inset 3px 0 #10b981; }
.collection-priority-table tr.priority-followup-critical-row td,
.collection-priority-table tr.priority-broken-promise-row td { background: #fff7f7; }
.collection-priority-table tr.priority-followup-critical-row td:first-child,
.collection-priority-table tr.priority-broken-promise-row td:first-child { box-shadow: inset 3px 0 #ef4444; }
.amount-current { color: #15803d; font-weight: 800; }
.collection-start-button { min-width: 118px; }
.collection-priority-action-state,
.priority-promise-state {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
}
.priority-promise-state { border-color: #86efac; background: #f0fdf4; }
.priority-promise-state.priority-promise-broken {
  border-color: #fca5a5;
  background: #fff1f2;
}
.priority-promise-state.priority-promise-broken .priority-state-copy strong { color: #be123c; }
.collection-priority-action-state.priority-followup-waiting,
.collection-priority-action-state.priority-followup-contact {
  border-color: #fdba74;
  background: #fff7ed;
}
.collection-priority-action-state.priority-followup-waiting .priority-state-copy strong,
.collection-priority-action-state.priority-followup-contact .priority-state-copy strong { color: #c2410c; }
.collection-priority-action-state.priority-followup-visit {
  border-color: #fca5a5;
  background: #fff1f2;
}
.collection-priority-action-state.priority-followup-visit .priority-state-copy strong { color: #be123c; }
.collection-priority-action-state.priority-followup-payment {
  border-color: #86efac;
  background: #f0fdf4;
}
.collection-priority-action-state.priority-followup-payment .priority-state-copy strong { color: #047857; }
.priority-state-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: white;
  font-size: 18px;
  box-shadow: 0 1px 3px rgba(15,23,42,.08);
}
.priority-state-copy { min-width: 0; }
.priority-state-copy strong,
.priority-state-copy small { display: block; overflow-wrap: anywhere; }
.priority-state-copy strong { color: #1e3a8a; font-size: 13px; line-height: 1.4; }
.priority-promise-state .priority-state-copy strong { color: #047857; }
.priority-state-copy small { margin-top: 3px; color: #64748b; font-size: 12px; line-height: 1.4; }
.priority-state-copy .priority-note {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #475569;
}
.priority-state-button { min-width: 64px; min-height: 40px; padding: 8px 11px; font-size: 12px; white-space: nowrap; }
.collection-rule-banner { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.collection-rule-banner article { padding: 12px 14px; border: 1px solid #bfdbfe; border-radius: 12px; background: #eff6ff; }
.collection-rule-banner strong, .collection-rule-banner span { display: block; }
.collection-rule-banner strong { color: #1e40af; font-size: 12px; }
.collection-rule-banner span { margin-top: 4px; color: #475569; font-size: 12px; }
.collection-action-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.collection-action-summary article { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.collection-action-summary span, .collection-action-summary strong { display: block; }
.collection-action-summary span { color: var(--muted); font-size: 12px; }
.collection-action-summary strong { margin-top: 5px; font-size: 19px; }
.collection-action-summary small { display: block; margin-top: 4px; color: #64748b; font-size: 11px; }
.collection-action-summary .collection-completed-summary { border-color: #a7f3d0; background: #f0fdf4; }
.collection-action-summary .collection-completed-summary strong { color: #047857; }
.collection-action-summary .bad-debt-summary { border-color: #fecaca; background: #fff7f7; }
.collection-action-summary .bad-debt-summary strong { color: #b91c1c; }
.collection-action-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.collection-list-filter { display: inline-flex; gap: 4px; margin: 0; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.collection-list-filter button { padding: 7px 11px; border: 0; border-radius: 7px; background: transparent; color: #64748b; font-size: 12px; font-weight: 800; cursor: pointer; }
.collection-list-filter button.active { background: #1d4ed8; color: white; }
.collection-card-search { min-width: 260px; flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: white; color: #64748b; }
.collection-card-search:focus-within { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.collection-card-search input { width: 100%; min-height: 38px; border: 0; outline: 0; background: transparent; color: #0f172a; font-size: 13px; }
.collection-search-count { min-width: 65px; color: #64748b; font-size: 12px; font-weight: 750; text-align: right; }
.collection-action-list { display: grid; gap: 10px; }
.collection-action-card { border: 1px solid var(--line); border-radius: 13px; padding: 14px; background: white; transition: border-color .18s ease, background .18s ease; }
.collection-action-card.awaiting-response { border-color: #fed7aa; background: #fffaf3; }
.collection-action-card.responded { border-color: #bfdbfe; background: #f5f9ff; }
.collection-action-card.promise { border-color: #c4b5fd; background: #faf8ff; }
.collection-action-card.paid { border-color: #86efac; background: #f3fcf6; }
.collection-action-card.bad-debt { border: 2px solid #ef4444; background: #fff5f5; }
.collection-action-card.attention { border-color: #fecaca; background: #fff7f7; }
.collection-action-card.urgent { border-color: #fecaca; background: #fffafa; }
.collection-action-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.collection-action-card-head strong, .collection-action-card-head span { display: block; }
.collection-action-card-head strong { font-size: 12px; }
.collection-action-card-head span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.collection-next-action { min-width: 190px; display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 9px 11px; border-radius: 10px; background: #eff6ff; text-align: right; }
.collection-next-action.acil, .collection-next-action.gecikti { background: #fff1f2; color: #be123c; }
.collection-next-action.batak { background: #7f1d1d; color: white; }
.collection-next-action.batak .next-action-copy,
.collection-next-action.batak strong,
.collection-next-action.batak small { color: #fff; }
.collection-next-action .next-action-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; background: rgba(255,255,255,.72); font-size: 17px; }
.collection-next-action .next-action-copy { display: block; }
.collection-next-action strong { font-size: 12px; }.collection-next-action small { display: block; margin-top: 3px; color: inherit; font-size: 12px; }
.collection-history { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.collection-history-item { min-width: 290px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 11px; border: 1px solid #dbe4f0; border-radius: 11px; background: var(--panel-soft); color: #475569; }
.collection-history-item.no-response { border-color: #fed7aa; background: #fff7ed; }
.collection-history-item.responded, .collection-history-item.promise, .collection-history-item.paid { border-color: #bbf7d0; background: #f0fdf4; }
.collection-action-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; background: white; box-shadow: 0 1px 3px rgba(15,23,42,.08); font-size: 18px; }
.collection-action-copy { min-width: 0; display: grid; gap: 3px; }
.collection-action-copy strong { color: #1e293b; font-size: 12px; line-height: 1.25; }
.collection-action-copy small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.collection-result-badge { margin-left: auto; padding: 6px 8px; border-radius: 999px; white-space: nowrap; background: #e2e8f0; color: #475569; font-size: 12px; font-weight: 800; }
.collection-result-badge.no-response { background: #ffedd5; color: #c2410c; }
.collection-result-badge.responded { background: #dcfce7; color: #15803d; }
.collection-result-badge.promise { background: #dbeafe; color: #1d4ed8; }
.collection-result-badge.paid { background: #ccfbf1; color: #0f766e; }
.collection-payment-financials { flex: 1 0 100%; display: grid; grid-template-columns: repeat(2, minmax(135px, 1fr)); gap: 7px; }
.collection-payment-financials > span { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid #a7f3d0; border-radius: 9px; background: rgba(255,255,255,.76); }
.collection-payment-financials small { color: #64748b; font-size: 11px; font-weight: 700; }
.collection-payment-financials strong { color: #047857; font-size: 14px; }
.collection-kursoft-confirmation { flex: 1 0 calc(100% - 44px); margin-left: 44px; padding: 7px 9px; border: 1px solid #93c5fd; border-radius: 8px; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 800; }
.collection-action-note { flex: 1 0 calc(100% - 44px); margin-left: 44px; border-top: 1px solid rgba(148,163,184,.35); padding-top: 8px; }
.collection-action-note summary { width: max-content; cursor: pointer; color: #1d4ed8; font-size: 12px; font-weight: 850; }
.collection-action-note summary:hover { text-decoration: underline; }
.collection-action-note p { max-width: 520px; margin: 8px 0 0; padding: 9px 10px; border-radius: 9px; background: rgba(255,255,255,.82); color: #334155; font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.conditional-form-fields { display: grid; gap: 11px; padding: 12px; border: 1px solid #bfdbfe; border-radius: 11px; background: #eff6ff; }
.conditional-form-fields[hidden] { display: none; }
.amount-transfer-field { min-width: 0; }
.amount-transfer-field > label span {
  display: block;
  margin-bottom: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
}
.amount-transfer-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
}
.amount-transfer-control input { min-width: 0; }
.amount-transfer-button { min-height: 43px; padding-inline: 12px; white-space: nowrap; }
.collection-payment-fields { border-color: #a7f3d0; background: #f0fdf4; }
.collection-payment-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.collection-payment-preview > span { display: grid; gap: 3px; padding: 9px 10px; border: 1px solid #d1fae5; border-radius: 9px; background: white; }
.collection-payment-preview small, .form-helper { color: #64748b; font-size: 11px; }
.collection-payment-preview strong { color: #065f46; font-size: 14px; }
.priority-payment-summary { display: block; margin-top: 5px; padding: 5px 7px; border-radius: 7px; background: #ecfdf5; color: #047857; font-size: 11px; font-weight: 800; }
.collection-total-collected { border-color: #86efac !important; background: #f0fdf4 !important; }
.collection-total-collected strong { color: #047857; }
.collection-report-payment { display: grid; gap: 3px; min-width: 145px; padding: 7px 8px; border: 1px solid #a7f3d0; border-radius: 9px; background: #f0fdf4; }
.collection-report-payment strong { color: #047857; font-size: 13px; }
.collection-report-payment small { color: #475569; font-size: 11px; }
.collection-report-payment span { width: max-content; padding: 3px 5px; border-radius: 999px; background: #dbeafe; color: #1d4ed8; font-size: 10px; font-weight: 800; }
.collection-report-payment span.manual { background: #e2e8f0; color: #475569; }
.collection-table-action { display: inline-flex; align-items: center; gap: 6px; font-weight: 750; }
.collection-report-table { min-width: 1220px; }
.collection-report-table th,
.collection-report-table td { font-size: 13px; line-height: 1.4; }
.collection-report-table th:nth-child(1),
.collection-report-table td:nth-child(1) { width: 112px; min-width: 112px; white-space: nowrap; }
.collection-report-table th:nth-child(2),
.collection-report-table td:nth-child(2) { width: 270px; min-width: 270px; }
.collection-report-table th:nth-child(3),
.collection-report-table td:nth-child(3) { width: 155px; min-width: 155px; }
.collection-report-table th:nth-child(4),
.collection-report-table td:nth-child(4) { width: 155px; min-width: 155px; }
.collection-report-table th:nth-child(5),
.collection-report-table td:nth-child(5) { width: 180px; min-width: 180px; }
.collection-report-table th:nth-child(6),
.collection-report-table td:nth-child(6) { width: 145px; min-width: 145px; }
.collection-report-table th:nth-child(7),
.collection-report-table td:nth-child(7) { min-width: 235px; }
.collection-report-table .record-status,
.collection-report-table .collection-table-action { white-space: nowrap; }
.collection-report-table td:nth-child(7) { overflow-wrap: anywhere; }
.collection-report-table td > strong { font-size: 13px; }
.collection-report-table td > small { font-size: 12px; line-height: 1.4; }
.collection-report-dealer strong,
.collection-report-dealer small { display: block; }
.collection-report-dealer small { margin-top: 4px; color: var(--muted); }
.collection-card-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.collection-complete-label { margin-left: auto; padding: 7px 10px; border-radius: 9px; background: #dcfce7; color: #15803d; font-size: 12px; font-weight: 850; }
.bad-debt-chip { display: inline-flex !important; margin-left: 8px; padding: 4px 7px; border-radius: 999px; background: #b91c1c; color: white; font-size: 12px; font-weight: 900; vertical-align: middle; }
.bad-debt-complete-label { margin-right: auto; padding: 7px 10px; border-radius: 9px; background: #fee2e2; color: #b91c1c; font-size: 12px; font-weight: 850; }
.delete-card-button { margin-left: 4px; }
.delete-warning { padding: 13px; border: 1px solid #fecaca; border-radius: 11px; background: #fff1f2; color: #9f1239; font-size: 12px; font-weight: 750; line-height: 1.5; }
.accounting-view { min-height: calc(100vh - 110px); }
.accounting-filters { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-soft); }
.accounting-filters label span, .location-editor-form label > span { display: block; margin-bottom: 5px; color: #475569; font-size: 12px; font-weight: 750; }
.accounting-filters input, .accounting-filters select, .location-editor-form input, .location-editor-form select, .location-editor-form textarea { width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.accounting-filter-actions { display: flex; align-items: end; gap: 7px; }
.accounting-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px,1fr)); gap: 9px; margin: 12px 0; }
.accounting-summary article { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.accounting-summary span, .accounting-summary strong { display: block; }
.accounting-summary span { color: var(--muted); font-size: 12px; }.accounting-summary strong { margin-top: 5px; font-size: 16px; }
.accounting-summary .score-summary { border-color: #bfdbfe; background: #eff6ff; }
.accounting-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.accounting-table { width: 100%; border-collapse: collapse; min-width: 1050px; background: white; }
.accounting-table th { position: sticky; top: 0; z-index: 1; padding: 10px; background: #f8fafc; color: #475569; text-align: left; font-size: 12px; }
.accounting-table td { padding: 10px; border-top: 1px solid var(--line); font-size: 12px; vertical-align: middle; }
.accounting-table td strong, .accounting-table td small { display: block; }.accounting-table td small { color: var(--muted); margin-top: 3px; }
.accounting-table tr.blacklisted-row td { background: #fff7ed; border-top-color: #fdba74; }
.dealer-score-cell { display: flex; align-items: center; gap: 8px; min-width: 108px; }
.dealer-score-cell > span { color: #475569; font-size: 12px; font-weight: 750; }
.sales-view { min-height: calc(100vh - 110px); }
.sales-period-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.sales-period-tabs button { border: 0; border-radius: 8px; padding: 8px 14px; background: transparent; color: #64748b; font-size: 12px; font-weight: 800; }
.sales-period-tabs button.active { background: #1d4ed8; color: white; box-shadow: 0 4px 12px rgba(29,78,216,.22); }
.sales-filters { display: grid; grid-template-columns: repeat(5, minmax(145px,1fr)); gap: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-soft); }
.sales-filters label span { display: block; margin-bottom: 5px; color: #475569; font-size: 12px; font-weight: 750; }
.sales-filters input, .sales-filters select { width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.sales-filters input:disabled { background: #eef2f7; color: #94a3b8; }
.sales-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; margin: 12px 0; }
.sales-summary article { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.sales-summary span, .sales-summary strong, .sales-summary small { display: block; }
.sales-summary span, .sales-summary small { color: var(--muted); font-size: 12px; }
.sales-summary strong { margin: 5px 0 3px; font-size: 16px; }
.sales-summary .china-summary { border-color: #fbbf24; background: #fffbeb; }
.sales-summary .profit-summary { border-color: #86efac; background: #f0fdf4; }
.profit-positive { color: #15803d !important; }
.profit-negative { color: #dc2626 !important; }
.cost-missing { color: #94a3b8; font-size: 12px; font-weight: 750; }
.sales-sync-note { text-align: right; }
.sales-sync-note span, .sales-sync-note strong { display: block; }
.sales-sync-note span { color: var(--muted); font-size: 12px; }
.sales-sync-note strong { margin-top: 3px; font-size: 12px; }
.sales-chart-card { overflow: hidden; margin-bottom: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(180deg,#fff,#fbfdff); }
.sales-chart-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sales-chart-heading strong, .sales-chart-heading span { display: block; }
.sales-chart-heading span { color: var(--muted); font-size: 12px; }
.sales-chart-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-bottom: 12px; }
.sales-chart-summary > div { padding: 9px 11px; border: 1px solid #dbe5f1; border-radius: 10px; background: rgba(248,250,252,.88); }
.sales-chart-summary span, .sales-chart-summary strong { display: block; }
.sales-chart-summary span { color: #64748b; font-size: 11px; font-weight: 750; }
.sales-chart-summary strong { overflow: hidden; margin-top: 3px; color: #1e293b; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sales-bars {
  --sales-bar-count: 12;
  min-height: 215px;
  display: grid;
  grid-template-columns: repeat(var(--sales-bar-count), minmax(0,1fr));
  align-items: stretch;
  gap: clamp(3px,.55vw,9px);
  overflow: visible;
  padding: 8px 3px 0;
}
.sales-bar-item { min-width: 0; display: grid; grid-template-rows: 24px 150px 28px; text-align: center; }
.sales-bar-value { overflow: visible; color: #475569; font-size: 10px; font-weight: 800; white-space: nowrap; transition: opacity .16s ease; }
.sales-bar-value.is-hidden { opacity: 0; }
.sales-bar-track {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
  height: 150px;
  border-bottom: 1px solid #cbd5e1;
  background: repeating-linear-gradient(to top, transparent 0, transparent 36px, rgba(226,232,240,.75) 37px);
}
.sales-bar {
  width: min(30px,72%);
  min-height: 0;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg,#60a5fa 0%,#2563eb 55%,#1d4ed8 100%);
  box-shadow: 0 4px 10px rgba(37,99,235,.18);
  transition: filter .16s ease, transform .16s ease;
}
.sales-bar-item:hover .sales-bar { filter: brightness(1.08); transform: scaleX(1.08); }
.sales-bar-item:hover .sales-bar-value { opacity: 1; }
.sales-bar-item.is-peak .sales-bar { background: linear-gradient(180deg,#818cf8,#4f46e5); box-shadow: 0 5px 14px rgba(79,70,229,.25); }
.sales-bar-item.is-negative .sales-bar { background: linear-gradient(180deg,#fb7185,#e11d48); box-shadow: 0 4px 10px rgba(225,29,72,.18); }
.sales-bar-item.is-zero .sales-bar-track::after { content: ""; position: absolute; bottom: -3px; width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; }
.sales-bar-item > span { overflow: visible; padding-top: 7px; color: #64748b; font-size: 10px; font-weight: 700; white-space: nowrap; }
.sales-bar-item > span.is-hidden { visibility: hidden; }
.sales-table { min-width: 1420px; }
.china-chip, .neutral-chip { display: inline-block; padding: 3px 6px; border-radius: 999px; font-size: 12px; font-weight: 900; letter-spacing: .03em; }
.china-chip { background: #fef3c7; color: #92400e; }
.neutral-chip { background: #eef2f7; color: #475569; }
.finance-overview { min-height: calc(100vh - 110px); }
.balance-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.balance-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow); }
.balance-card-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px; border-bottom: 1px solid var(--line); }
.assets-card .balance-card-title { background: linear-gradient(135deg,#ecfdf5,#f0fdf4); }
.liabilities-card .balance-card-title { background: linear-gradient(135deg,#fff7ed,#fff1f2); }
.balance-card-title span, .balance-card-title strong { display: block; }
.balance-card-title > div > span { color: #64748b; font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.balance-card-title > div > strong { margin-top: 4px; font-size: 22px; }
.balance-badge { padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.balance-badge.positive { background: #dcfce7; color: #166534; }
.balance-badge.danger { background: #fee2e2; color: #991b1b; }
.balance-lines { padding: 5px 15px 12px; }
.balance-lines > div { min-height: 46px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; border-bottom: 1px solid #eef2f7; font-size: 12px; }
.balance-lines > div:last-child { border-bottom: 0; }
.balance-lines span small { display: block; margin-top: 2px; color: #94a3b8; font-size: 12px; }
.balance-lines button { border: 0; border-radius: 7px; padding: 5px 8px; background: #dbeafe; color: #1d4ed8; font-size: 12px; font-weight: 850; }
.balance-lines .net-assets-line { margin-top: 8px; padding: 4px 8px; border: 0; border-radius: 9px; background: #f8fafc; }
.finance-operation-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(155px,1fr)); gap: 9px; margin: 12px 0; }
.finance-operation-grid article { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.finance-operation-grid span, .finance-operation-grid strong, .finance-operation-grid small { display: block; }
.finance-operation-grid span { color: #64748b; font-size: 12px; }
.finance-operation-grid strong { margin-top: 5px; font-size: 15px; }
.finance-operation-grid small { margin-top: 3px; color: #94a3b8; font-size: 11px; }
.finance-operation-grid .china-operation-card { border-color: #fbbf24; background: #fffbeb; }
.finance-operation-grid .result-card { border-color: #93c5fd; background: #eff6ff; }
.finance-operation-grid .warning-card, .stock-summary .warning-card { border-color: #fbbf24; background: #fffbeb; }
.danger-card { border-color: #fca5a5 !important; background: #fff1f2 !important; }
.negative-value { color: #dc2626 !important; }
.finance-charts-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(280px,.5fr); gap: 12px; }
.finance-chart-card, .top-sellers-card { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.chart-card-heading { display: flex; justify-content: space-between; margin-bottom: 12px; }
.chart-card-heading strong, .chart-card-heading span { display: block; }
.chart-card-heading span { margin-top: 3px; color: #64748b; font-size: 12px; }
.finance-chart-legend { display: flex; gap: 12px; margin-bottom: 8px; color: #64748b; font-size: 12px; }
.finance-chart-legend span { display: flex; align-items: center; gap: 4px; }
.finance-chart-legend i { width: 8px; height: 8px; border-radius: 2px; }
.finance-month-bars { height: 180px; display: flex; align-items: stretch; gap: 8px; overflow-x: auto; }
.finance-month-item { flex: 1 0 54px; min-width: 54px; display: grid; grid-template-rows: 158px 20px; }
.finance-month-columns { display: flex; align-items: end; justify-content: center; gap: 3px; border-bottom: 1px solid #cbd5e1; }
.finance-month-columns i { width: 10px; min-height: 3px; border-radius: 4px 4px 0 0; }
.finance-month-item > span { padding-top: 4px; color: #64748b; font-size: 12px; text-align: center; }
.sales-color { background: #2563eb; }.purchase-color { background: #f59e0b; }.expense-color { background: #ef4444; }
.finance-category-chart { display: grid; align-content: start; gap: 10px; }
.category-bar-row > div:first-child { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.category-bar-track { height: 6px; overflow: hidden; margin-top: 4px; border-radius: 999px; background: #eef2f7; }
.category-bar-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#8b5cf6,#6366f1); }
.expense-summary { grid-template-columns: repeat(4,minmax(0,1fr)); }
.expense-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(250px,.5fr); gap: 12px; }
.expense-category-chip { display: inline-block; padding: 4px 7px; border-radius: 8px; background: #f1f5f9; color: #334155; font-size: 12px; font-weight: 850; }
.stock-valuation-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
  padding: 12px 13px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #334155;
}
.stock-valuation-note-icon {
  flex: 0 0 29px;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #2563eb;
  color: white;
  font-size: 14px;
  font-weight: 900;
}
.stock-valuation-note strong, .stock-valuation-note span { display: block; }
.stock-valuation-note strong { color: #1d4ed8; font-size: 13px; }
.stock-valuation-note span { margin-top: 3px; font-size: 12px; line-height: 1.5; }
.stock-summary { grid-template-columns: repeat(4,minmax(0,1fr)); }
.stock-summary article { min-height: 116px; }
.stock-summary article > span { color: #475569; font-weight: 750; line-height: 1.35; }
.stock-summary article > small { line-height: 1.45; }
.stock-summary .stock-value-summary { border-color: #86efac; background: #f0fdf4; }
.stock-summary .stock-value-summary strong { color: #15803d; }
.stock-summary .stock-excluded-summary { border-color: #fdba74; background: #fff7ed; }
.stock-summary .stock-excluded-summary strong { color: #c2410c; }
.stock-excluded-row td { background: #fff7ed !important; color: #7c2d12; }
.valuation-excluded-badge { display: inline-block; padding: 3px 6px; border-radius: 999px; background: #ffedd5; color: #c2410c; font-size: 11px; font-weight: 900; }
.valuation-excluded-value { color: #c2410c; font-weight: 900; }
.stock-report-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(270px,.5fr); gap: 12px; }
.stock-low-row td { background: #fffbeb; }.stock-out-row td { background: #fff1f2; }
.top-sellers-list { display: grid; gap: 7px; }
.top-seller-row { display: grid; grid-template-columns: 25px 1fr auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; }
.top-seller-row > b { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 7px; background: #dbeafe; color: #1d4ed8; font-size: 12px; }
.top-seller-row strong, .top-seller-row span { display: block; }
.top-seller-row strong { font-size: 12px; }.top-seller-row span { margin-top: 2px; color: #64748b; font-size: 12px; }
.top-seller-row em { color: #0f172a; font-size: 12px; font-style: normal; font-weight: 900; }
.blacklist-summary { border-color: #fca5a5 !important; background: #fff1f2 !important; }.blacklist-summary strong { color: #b91c1c; }
.amount-overdue { color: #be123c; font-weight: 800; }
.location-missing { color: #64748b; font-weight: 750; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.location-modal { width: min(940px, 96vw); }
.location-editor-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(290px, .75fr); gap: 13px; }
#dealerLocationMap { min-height: 490px; border: 1px solid var(--line); border-radius: 12px; background: #eaf0f5; }
.dealer-location-map-wrap { position: relative; min-width: 0; }
.map-drag-hint { position: absolute; top: 12px; left: 50%; z-index: 3; transform: translateX(-50%); max-width: calc(100% - 24px); padding: 8px 12px; border: 1px solid rgba(37,99,235,.22); border-radius: 999px; background: rgba(255,255,255,.94); box-shadow: 0 5px 18px rgba(15,23,42,.12); color: #1e3a8a; font-size: 12px; font-weight: 800; text-align: center; pointer-events: none; }
.location-editor-form { display: grid; align-content: start; gap: 10px; }
.location-coordinate-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.maplibregl-marker { cursor: grab; }.maplibregl-marker:active { cursor: grabbing; }
.location-status-note { padding: 9px; border-radius: 9px; background: #eff6ff; color: #1d4ed8; font-size: 12px; }
.notice { padding: 18px; border-radius: 12px; background: #f8fafc; color: var(--muted); border: 1px dashed #cbd5e1; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(2,6,23,.38); z-index: 70; }
.detail-drawer { position: fixed; right: 0; top: 0; height: 100vh; width: min(470px, 96vw); background: white; z-index: 80; box-shadow: -20px 0 60px rgba(15,23,42,.18); transform: translateX(105%); transition: transform .22s ease; display: flex; flex-direction: column; }
.detail-drawer.open { transform: translateX(0); }
.drawer-header { padding: 20px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.drawer-header-actions { display: flex; gap: 7px; }
.drawer-header h2 { font-size: 21px; margin-top: 4px; }
.drawer-header p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.eyebrow { color: var(--primary); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 800; }
.drawer-body { padding: 18px 20px 26px; overflow: auto; }
.detail-score-row { display: flex; align-items: stretch; gap: 10px; margin-bottom: 14px; }
.large-status { flex: 1; display: flex; align-items: center; border-radius: 10px; padding: 10px 12px; font-size: 12px; font-weight: 800; }
.large-status.critical { background: #fff1f2; color: #be123c; }.large-status.warning { background: #fff7ed; color: #c2410c; }.large-status.healthy { background: #f0fdf4; color: #15803d; }
.health-score-detail { width: 58px; height: 58px; flex-basis: 58px; }
.health-score-detail::before { width: 40px; height: 40px; }
.health-score-detail span { font-size: 15px !important; }
.blacklist-banner { padding: 12px; border-radius: 10px; margin-bottom: 10px; background: #111827; color: white; font-size: 12px; font-weight: 900; line-height: 1.45; }
.financial-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.financial-grid > div { border: 1px solid var(--line); border-radius: 11px; padding: 11px; background: var(--panel-soft); }
.financial-grid span, .financial-grid strong { display: block; }
.financial-grid span { color: var(--muted); font-size: 12px; }
.financial-grid strong { margin-top: 5px; font-size: 14px; }
.info-list { margin: 16px 0; border-top: 1px solid var(--line); }
.info-list > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.info-list span { color: var(--muted); }
.info-list a { color: var(--primary); font-weight: 750; text-decoration: none; }
.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 22px; }
.visit-entry { padding: 11px 0; border-bottom: 1px solid var(--line); }
.visit-entry strong, .visit-entry span { display: block; }
.visit-entry strong { font-size: 12px; }.visit-entry span { color: var(--muted); font-size: 12px; margin-top: 3px; }
.modal { width: min(780px, 94vw); max-height: 90vh; border: 0; border-radius: 18px; padding: 0; box-shadow: 0 30px 80px rgba(2,6,23,.25); }
.modal.small { width: min(540px, 94vw); }
.dealer-settings-modal { width: min(760px, 94vw); }
.modal::backdrop { background: rgba(2,6,23,.55); }
.modal form { padding: 20px; max-height: 90vh; overflow: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.modal-header h2 { font-size: 21px; margin-top: 4px; }.modal-header p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid.one-column { grid-template-columns: 1fr; }.form-grid .full { grid-column: 1 / -1; }
.form-grid label span { display: block; color: #475569; font-size: 12px; font-weight: 750; margin-bottom: 6px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: white; outline: none; font-size: 14px; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: #8bb0ff; box-shadow: 0 0 0 3px #e5eeff; }
.selection-box { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin: 16px 0 8px; padding: 11px; border-radius: 11px; background: var(--panel-soft); border: 1px solid var(--line); }
.selection-box strong, .selection-box span { display: block; }.selection-box strong { font-size: 12px; }.selection-box span { color: var(--muted); font-size: 12px; margin-top: 3px; }
.location-picker { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px; border: 1px solid #bfdbfe; border-radius: 11px; background: #eff6ff; }
.location-picker strong, .location-picker span { display: block; }
.location-picker strong { font-size: 12px; color: #1e3a8a; }
.location-picker span { margin-top: 3px; color: #3b82f6; font-size: 12px; }
.trip-dealer-selection { max-height: 245px; overflow: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.trip-checkbox { border: 1px solid var(--line); border-radius: 10px; padding: 9px; display: flex; gap: 8px; align-items: flex-start; font-size: 12px; }
.trip-checkbox span { display: block; }.trip-checkbox small { display: block; color: var(--muted); margin-top: 2px; }
.trip-result { margin-top: 14px; border: 1px solid #b8cdf8; background: #f3f7ff; border-radius: 12px; padding: 12px; }
.trip-result ol { padding-left: 22px; margin: 8px 0 0; }.trip-result li { margin: 5px 0; font-size: 12px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); padding-top: 15px; margin-top: 18px; }
.trip-list { display: grid; gap: 10px; }
.trip-card { border: 1px solid var(--line); border-radius: 13px; padding: 14px; }
.trip-card-header { display: flex; justify-content: space-between; gap: 10px; }.trip-card p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.trip-stops { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }.trip-stops span { background: var(--panel-soft); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 12px; }
.trip-routes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.google-route { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 14px; }
.settings-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--panel-soft); }
.toggle-row { display: flex; align-items: center; gap: 9px; padding: 10px 0; font-size: 13px; }
.toggle-row input { width: auto; }
.toggle-row span { margin: 0 !important; }
.security-note { margin-top: 14px; padding: 11px; border-radius: 10px; background: #eff6ff; color: #1e40af; font-size: 12px; line-height: 1.5; }
.cash-conversion-card {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 11px;
  background: #eff6ff;
}
.cash-conversion-card > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cash-conversion-card span, .cash-conversion-card strong, .cash-conversion-card small { display: block; }
.cash-conversion-card span { color: #475569; font-size: 12px; font-weight: 750; }
.cash-conversion-card strong { margin-top: 8px; color: #1d4ed8; font-size: 20px; }
.cash-conversion-card small { margin-top: 4px; color: #64748b; font-size: 12px; line-height: 1.4; }
.cash-conversion-card button {
  border: 0;
  padding: 3px 0;
  background: transparent;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.cash-conversion-card.is-error { border-color: #fecaca; background: #fff1f2; }
.cash-conversion-card.is-error strong, .cash-conversion-card.is-error span { color: #b91c1c; }
.settings-actions { margin-top: 14px; }
.dealer-settings-stack { display: grid; gap: 10px; }
.settings-block { display: grid; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); }
.settings-block p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.settings-block label > span { display: block; margin-bottom: 6px; color: #475569; font-size: 12px; font-weight: 750; }
.settings-block select, .settings-block textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px; background: white; }
.blacklist-settings { border-color: #fecaca; background: #fff7f7; }
.compact-button { min-height: 33px; padding: 6px 10px; white-space: nowrap; }
.role-guide { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 9px; margin-bottom: 14px; }
.role-guide article { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); }
.role-guide strong, .role-guide span { display: block; }.role-guide strong { font-size: 12px; }.role-guide span { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.management-user-list { display: grid; gap: 8px; }
.management-user-card { display: grid; grid-template-columns: minmax(240px,1.5fr) minmax(150px,.7fr) minmax(150px,.7fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.management-user-card.inactive { opacity: .58; background: #f8fafc; }
.management-user-main { display: flex; align-items: center; gap: 10px; }
.management-user-main strong, .management-user-main span, .management-scope strong, .management-scope span { display: block; }
.management-user-main strong, .management-scope strong { font-size: 12px; }
.management-user-main span, .management-scope span { color: var(--muted); font-size: 12px; margin-top: 3px; }
.role-badge { display: inline-flex; padding: 6px 8px; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 800; }
.connection-badge { border-radius: 999px; padding: 7px 10px; background: #f1f5f9; color: #475569; font-size: 12px; font-weight: 800; }
.connection-badge.active { background: #dcfce7; color: #166534; }
.sync-history { display: grid; gap: 8px; }
.sync-entry { padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: white; }
.sync-entry strong, .sync-entry span { display: block; }
.sync-entry strong { font-size: 12px; }.sync-entry span { color: var(--muted); font-size: 12px; margin-top: 4px; }
.places-view { min-height: calc(100vh - 110px); }
.place-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.places-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr); gap: 14px; height: calc(100vh - 230px); min-height: 520px; }
.places-map-wrap { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
#placesMap { width: 100%; height: 100%; min-height: 520px; background: #eaf0f5; }
.map-hint { position: absolute; left: 12px; bottom: 12px; z-index: 4; padding: 7px 10px; border-radius: 9px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); color: var(--muted); font-size: 12px; }
.place-list { overflow: auto; display: grid; align-content: start; gap: 9px; }
.place-card { border: 1px solid var(--line); border-radius: 13px; padding: 13px; background: white; }
.place-card-header { display: flex; justify-content: space-between; gap: 10px; }
.place-card-header strong { display: block; font-size: 13px; }
.place-card-header small { display: block; color: var(--muted); margin-top: 3px; }
.place-category { display: inline-flex; border-radius: 999px; padding: 5px 8px; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 800; white-space: nowrap; }
.place-rating { margin: 9px 0; color: #d97706; font-size: 12px; font-weight: 800; }
.place-review { padding: 8px 0; border-top: 1px solid var(--line); }
.place-review strong, .place-review span { display: block; }
.place-review strong { font-size: 12px; }.place-review span { color: #475569; font-size: 12px; margin-top: 3px; line-height: 1.45; }
.place-actions { display: flex; gap: 7px; margin-top: 10px; }
.place-actions .button { min-height: 34px; padding: 7px 10px; flex: 1; }
.place-marker { width: 32px; height: 32px; display: grid; place-items: center; border: 3px solid white; border-radius: 50% 50% 50% 5px; transform: rotate(-45deg); box-shadow: 0 5px 14px rgba(15,23,42,.3); font-size: 15px; }
.place-marker span { transform: rotate(45deg); }
.place-marker.hotel { background: #2563eb; }.place-marker.restaurant { background: #ea580c; }.place-marker.attraction { background: #7c3aed; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 120; background: #0f172a; color: white; border-radius: 11px; padding: 11px 14px; font-size: 12px; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.marker { width: 26px; height: 26px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); border: 3px solid white; box-shadow: 0 4px 10px rgba(15,23,42,.3); cursor: pointer; }
.marker span { display: block; width: 8px; height: 8px; background: white; border-radius: 50%; margin: 6px; }
.marker.critical { background: var(--critical); }.marker.warning { background: var(--warning); }.marker.healthy { background: var(--healthy); }
.mobile-only { display: none; }
.mobile-nav-backdrop { display: none; }
@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .workspace { grid-template-columns: 1fr 350px; height: 620px; }
  .accounting-filters { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .accounting-summary { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .collection-priority-filters { grid-template-columns: repeat(2,minmax(180px,1fr)); }
  .collection-priority-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sales-filters { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .sales-summary, .stock-summary { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .finance-operation-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .finance-charts-grid, .expense-layout, .stock-report-layout { grid-template-columns: 1fr; }
  .role-guide { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); transition: transform .2s ease; width: 248px; }
  .sidebar.open { transform: translateX(0); }
  .mobile-only { display: grid; }
  .main-content { padding: 14px; }
  .topbar { align-items: flex-start; }
  .topbar > div:first-of-type { min-width: 0; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .search-box { width: min(300px, 60vw); }
  .workspace { grid-template-columns: 1fr; height: auto; }
  .settings-layout { grid-template-columns: 1fr; }
  .places-layout { grid-template-columns: 1fr; height: auto; }
  .places-map-wrap, #placesMap { height: 480px; min-height: 480px; }
  .place-list { max-height: 600px; }
  .today-grid { grid-template-columns: 1fr; }
  .location-editor-grid { grid-template-columns: 1fr; }
  .management-user-card { grid-template-columns: 1fr 1fr; }
  .balance-layout { grid-template-columns: 1fr; }
  .sales-summary, .stock-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  #dealerLocationMap { min-height: 380px; }
  .map-panel { height: 520px; }.dealer-panel { max-height: 520px; }
}
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; }.topbar > div:nth-child(2) { flex: 1; }
  .topbar-actions { width: 100%; }.search-box { width: 100%; }.topbar-actions .button { width: 100%; }
  .profile-menu-wrap { margin-left: auto; }
  .profile-button { min-width: 46px; width: 46px; grid-template-columns: 34px; padding: 5px; }
  .profile-button-text, .profile-button > svg { display: none; }
  .profile-dropdown { position: fixed; top: 72px; right: 12px; width: min(280px, calc(100vw - 24px)); }
  .notification-dropdown { position: fixed; top: 72px; right: 12px; }
  .metrics { grid-template-columns: 1fr 1fr; }.metric-card { padding: 12px; }.metric-card strong { font-size: 18px; }
  .status-legend { display: none; }.region-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .region-tab { white-space: nowrap; }
  .workspace { display: block; }.map-panel { height: 460px; margin-bottom: 12px; }.dealer-panel { max-height: 500px; }
  .segmented { max-width: calc(100vw - 95px); overflow-x: auto; }.segment { white-space: nowrap; }
  .form-grid, .trip-dealer-selection { grid-template-columns: 1fr; }.financial-grid { grid-template-columns: 1fr 1fr; }
  .accounting-filters, .accounting-summary, .sales-filters, .sales-summary,
  .collection-priority-filters, .collection-priority-summary { grid-template-columns: 1fr; }
  .finance-operation-grid { grid-template-columns: 1fr 1fr; }
  .collection-rule-banner, .collection-action-summary { grid-template-columns: 1fr; }
  .collection-action-toolbar { align-items: stretch; flex-wrap: wrap; }
  .collection-list-filter { width: 100%; overflow-x: auto; }
  .collection-card-search { min-width: 0; width: 100%; }
  .collection-search-count { width: 100%; text-align: left; }
  .collection-action-card-head { display: grid; }
  .collection-next-action { min-width: 0; justify-content: flex-start; text-align: left; }
  .collection-history-item { width: 100%; min-width: 0; }
  .collection-card-actions { justify-content: flex-start; }
  .role-guide, .management-user-card, .location-coordinate-actions { grid-template-columns: 1fr; }
}

/* Telefon ve tabletlerde dokunmatik odaklı uygulama kabuğu */
@media (max-width: 820px) {
  html { -webkit-text-size-adjust: 100%; }
  body.mobile-nav-open { overflow: hidden; }
  button, .button, input, select, textarea { touch-action: manipulation; }

  .sidebar {
    top: 0;
    bottom: 0;
    width: min(86vw, 320px);
    height: 100dvh;
    padding: max(18px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 18px 0 55px rgba(2, 6, 23, .35);
    z-index: 150;
  }
  .brand { position: sticky; top: -18px; z-index: 2; margin: -2px -2px 10px; padding: 10px 8px 18px; background: var(--nav); }
  .sidebar-close {
    width: 42px;
    height: 42px;
    margin-left: auto;
    border: 1px solid #34405a;
    border-radius: 11px;
    background: #172033;
    color: white;
    font-size: 24px;
    place-items: center;
  }
  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 145;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(2, 6, 23, .54);
    backdrop-filter: blur(2px);
  }
  .mobile-nav-backdrop[hidden] { display: none; }
  .nav-list { gap: 5px; }
  .nav-item { min-height: 46px; padding: 12px 13px; font-size: 14px; }
  .nav-subitem { min-height: 43px; padding-left: 15px; font-size: 13px; }
  .nav-subitem span { font-size: 14px; }
  .sidebar-bottom { padding-top: 18px; }

  .main-content { width: 100%; padding: 12px; overflow: hidden; }
  .topbar {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 14px;
  }
  .topbar > .icon-button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .topbar > div:first-of-type { min-width: 0; }
  .topbar h1 {
    overflow: hidden;
    font-size: 19px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar p { margin-top: 3px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-actions {
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px 46px;
    gap: 8px;
  }
  .search-box { width: 100%; min-height: 46px; border-radius: 12px; }
  .search-box input { min-width: 0; font-size: 16px; }
  .topbar-actions > #openTripPlanner {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-height: 44px;
  }
  .notification-button, .profile-button { width: 46px; height: 46px; min-width: 46px; }
  .notification-dropdown, .profile-dropdown {
    position: fixed;
    top: max(70px, calc(env(safe-area-inset-top) + 58px));
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100dvh - 92px);
    overflow: auto;
  }
  .notification-list { max-height: min(55dvh, 430px); }

  .empty-view {
    min-height: 0;
    padding: 14px;
    border-radius: 14px;
  }
  .section-heading { align-items: flex-start; flex-wrap: wrap; }
  .section-heading > .button, .section-heading > button { min-height: 42px; }
  .metrics { gap: 8px; margin-bottom: 12px; }
  .metric-card { min-width: 0; padding: 12px; }
  .metric-card strong { overflow-wrap: anywhere; }
  .today-column { padding: 10px; }
  .today-item, .record-card { padding: 11px; }
  .record-card { align-items: flex-start; flex-direction: column; }
  .record-status { align-self: flex-start; }

  .accounting-table-wrap {
    position: relative;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    box-shadow: inset -10px 0 16px -16px rgba(15,23,42,.45);
  }
  .accounting-table th, .accounting-table td { padding: 11px 10px; font-size: 12px; }
  .accounting-table th:first-child,
  .accounting-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 175px;
    background: inherit;
    box-shadow: 8px 0 14px -14px rgba(15,23,42,.7);
  }
  .accounting-table thead th:first-child { z-index: 3; background: #f8fafc; }
  .accounting-table tr { scroll-snap-align: start; }
  .pagination { flex-wrap: wrap; }
  .pagination .button { min-height: 42px; }

  .accounting-filters, .sales-filters, .collection-priority-filters { gap: 10px; padding: 11px; }
  .accounting-filters input, .accounting-filters select,
  .sales-filters input, .sales-filters select,
  .collection-priority-filters input, .collection-priority-filters select {
    min-height: 46px;
    padding: 11px;
    font-size: 16px;
  }
  .accounting-filter-actions { align-items: stretch; }
  .accounting-filter-actions .button { flex: 1; min-height: 44px; }

  .workspace { gap: 10px; }
  .map-panel { height: min(56dvh, 520px); min-height: 390px; }
  #map { min-height: 390px; }
  .dealer-panel { max-height: min(68dvh, 620px); }
  .dealer-panel-header { align-items: flex-start; flex-wrap: wrap; padding: 12px; }
  .dealer-panel-header select { min-height: 42px; max-width: none; }
  .dealer-panel-search input { min-height: 44px; font-size: 16px; }
  .dealer-item { padding: 12px; }
  .panel-toolbar { top: 9px; left: 9px; right: 9px; }
  .segmented { max-width: calc(100% - 48px); overflow-x: auto; scrollbar-width: none; }
  .segmented::-webkit-scrollbar, .region-tabs::-webkit-scrollbar, .collection-list-filter::-webkit-scrollbar { display: none; }
  .segment { min-height: 38px; padding: 8px 11px; }
  .region-tabs, .place-filters {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 2px 0 6px;
    scrollbar-width: none;
  }
  .region-tab, .place-filters .button { min-height: 40px; flex: 0 0 auto; white-space: nowrap; }

  .places-map-wrap, #placesMap { height: min(52dvh, 480px); min-height: 360px; }
  .place-list { max-height: none; }
  .place-actions { flex-wrap: wrap; }
  .place-actions .button { min-width: 130px; min-height: 42px; }

  .detail-drawer {
    top: 0;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    box-shadow: none;
  }
  .drawer-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: max(14px, env(safe-area-inset-top)) 14px 13px;
    background: white;
  }
  .drawer-header h2 { font-size: 19px; line-height: 1.25; overflow-wrap: anywhere; }
  .drawer-header-actions .icon-button { width: 42px; height: 42px; }
  .drawer-body { padding: 14px 14px max(22px, env(safe-area-inset-bottom)); }
  .drawer-actions .button { min-height: 46px; }
  .info-list > div { grid-template-columns: 92px minmax(0, 1fr); }
  .info-list strong, .info-list a { overflow-wrap: anywhere; }

  .modal, .modal.small, .dealer-settings-modal, .location-modal {
    width: 100vw;
    max-width: none;
    max-height: 96dvh;
    margin: auto 0 0;
    border-radius: 20px 20px 0 0;
  }
  .modal form {
    max-height: 96dvh;
    padding: 16px 14px max(14px, env(safe-area-inset-bottom));
    overscroll-behavior: contain;
  }
  .modal-header {
    position: sticky;
    top: -16px;
    z-index: 5;
    margin: -2px -2px 16px;
    padding: 4px 2px 12px;
    border-bottom: 1px solid var(--line);
    background: white;
  }
  .modal-header h2 { font-size: 20px; line-height: 1.25; }
  .modal-header .icon-button { flex: 0 0 42px; width: 42px; height: 42px; }
  .form-grid input, .form-grid select, .form-grid textarea,
  .settings-block select, .settings-block textarea,
  .location-editor-form input, .location-editor-form select, .location-editor-form textarea {
    min-height: 46px;
    padding: 11px 12px;
    font-size: 16px;
  }
  .form-grid textarea, .settings-block textarea, .location-editor-form textarea { min-height: 104px; }
  .amount-transfer-control { grid-template-columns: 1fr; }
  .amount-transfer-button { width: 100%; min-height: 44px; }
  .modal-footer {
    position: sticky;
    bottom: -14px;
    z-index: 5;
    margin: 18px -14px -14px;
    padding: 12px 14px max(12px, env(safe-area-inset-bottom));
    background: white;
    box-shadow: 0 -10px 22px rgba(15,23,42,.06);
  }
  .modal-footer .button { flex: 1; min-height: 46px; }
  .selection-box, .location-picker { align-items: stretch; flex-direction: column; }
  .selection-box .button, .location-picker .button { width: 100%; min-height: 44px; }
  #dealerLocationMap { min-height: min(48dvh, 420px); }
  .map-drag-hint { top: 8px; width: calc(100% - 16px); border-radius: 10px; }

  .collection-card-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .collection-card-actions .button { width: 100%; min-height: 42px; padding: 8px; white-space: normal; }
  .collection-complete-label, .bad-debt-complete-label { grid-column: 1 / -1; margin: 0; text-align: center; }
  .collection-history-item { align-items: flex-start; }
  .collection-result-badge { margin-left: 44px; }
  .collection-action-note, .collection-kursoft-confirmation { flex-basis: 100%; margin-left: 0; }
  .collection-action-note summary { width: auto; min-height: 38px; display: flex; align-items: center; }
  #collectionPrioritiesView .accounting-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  #collectionPrioritiesView .collection-priority-table {
    display: block;
    min-width: 0;
    table-layout: auto;
    background: transparent;
  }
  #collectionPrioritiesView .collection-priority-table thead { display: none; }
  #collectionPrioritiesView .collection-priority-table tbody { display: grid; gap: 11px; }
  #collectionPrioritiesView .collection-priority-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--line);
    border-left: 4px solid #94a3b8;
    border-radius: 13px;
    background: white;
    box-shadow: 0 4px 14px rgba(15,23,42,.045);
  }
  #collectionPrioritiesView .collection-priority-table tr.priority-overdue-row { border-left-color: #ef4444; }
  #collectionPrioritiesView .collection-priority-table tr.priority-recent-action-row { border-left-color: #3b82f6; }
  #collectionPrioritiesView .collection-priority-table tr.priority-has-promise-row { border-left-color: #10b981; }
  #collectionPrioritiesView .collection-priority-table tr.priority-followup-critical-row,
  #collectionPrioritiesView .collection-priority-table tr.priority-broken-promise-row { border-left-color: #ef4444; }
  #collectionPrioritiesView .collection-priority-table tr.priority-bad-debt-row { border-left-color: #991b1b; }
  #collectionPrioritiesView .collection-priority-table td,
  #collectionPrioritiesView .collection-priority-table td:first-child {
    position: static;
    z-index: auto;
    width: auto;
    min-width: 0;
    height: auto;
    padding: 10px 11px;
    border: 0;
    border-top: 1px solid #eef2f7;
    background: transparent;
    box-shadow: none;
  }
  #collectionPrioritiesView .collection-priority-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
  }
  #collectionPrioritiesView .collection-priority-table td:first-child {
    grid-column: 1 / -1;
    padding-top: 13px;
    border-top: 0;
  }
  #collectionPrioritiesView .collection-priority-table td:first-child::before { display: none; }
  #collectionPrioritiesView .collection-priority-table td:first-child strong {
    font-size: 14px;
    line-height: 1.4;
  }
  #collectionPrioritiesView .collection-priority-table td:last-child {
    grid-column: 1 / -1;
    padding: 11px;
    background: rgba(248,250,252,.72);
  }
  #collectionPrioritiesView .collection-priority-table td:last-child::before { margin-bottom: 7px; }
  #collectionPrioritiesView .priority-promise-state,
  #collectionPrioritiesView .collection-priority-action-state {
    min-width: 0;
    grid-template-columns: 38px minmax(0,1fr) auto;
    padding: 11px;
  }
  #collectionPrioritiesView .priority-state-icon { width: 38px; height: 38px; }
  #collectionPrioritiesView .priority-state-copy strong { font-size: 13px; }
  #collectionPrioritiesView .priority-state-copy small { font-size: 12px; white-space: normal; }
  #collectionPrioritiesView .priority-state-button { min-height: 40px; }
  #collectionPrioritiesView .collection-start-button { width: 100%; min-height: 44px; }
  .collection-rule-banner { grid-template-columns: 1fr; }

  .balance-card-title { padding: 13px; }
  .balance-lines { padding: 0 13px 13px; }
  .balance-lines > div { grid-template-columns: minmax(0,1fr) auto; }
  .balance-lines > div .button { grid-column: 1 / -1; justify-self: stretch; }
  .finance-month-bars, .sales-chart-scroll { -webkit-overflow-scrolling: touch; }
  .sales-chart-summary { grid-template-columns: 1fr; }
  .sales-chart-heading { align-items: flex-start; flex-direction: column; }
  .stock-summary article { min-height: 0; }

  .settings-card { padding: 13px; }
  .settings-actions { flex-direction: column-reverse; }
  .settings-actions .button { width: 100%; }
  .management-user-card { grid-template-columns: 1fr; }
  .management-user-card > .button { width: 100%; }
  .role-guide { grid-template-columns: 1fr 1fr; }
  .trip-card-header { align-items: flex-start; flex-direction: column; }
  .trip-routes .button { flex: 1 1 150px; min-height: 42px; }

  .toast {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .topbar-actions { grid-template-columns: minmax(0, 1fr) 46px 46px; }
  .profile-menu-wrap { margin-left: 0; }
  .profile-button { grid-template-columns: 34px; padding: 5px; }
  .topbar-actions .button { width: auto; }
  .topbar-actions > #openTripPlanner { width: 100%; }
  .metrics, .accounting-summary, .sales-summary, .collection-priority-summary,
  .finance-operation-grid, .expense-summary, .stock-summary {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
  .collection-action-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .collection-action-summary article:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .financial-grid, .collection-payment-preview, .collection-payment-financials { grid-template-columns: 1fr 1fr; }
  .promise-card-copy { min-width: 0; }
  .promise-card { flex-direction: column; }
  .promise-decision-area { justify-content: stretch; }
  .promise-decision-area .button { flex: 1 1 130px; }
  .location-coordinate-actions { grid-template-columns: 1fr; }
  .location-coordinate-actions .button { width: 100%; }
  .role-guide { grid-template-columns: 1fr; }
}

@media (max-width: 370px) {
  .main-content { padding: 9px; }
  .topbar h1 { font-size: 17px; }
  .metrics, .accounting-summary, .sales-summary, .collection-priority-summary,
  .finance-operation-grid, .expense-summary, .stock-summary,
  .collection-action-summary, .financial-grid,
  .collection-payment-preview, .collection-payment-financials {
    grid-template-columns: 1fr;
  }
  .collection-card-actions { grid-template-columns: 1fr; }
  .drawer-actions { grid-template-columns: 1fr; }
}

/* Tahsilat raporu: dar masaüstünde sıkışan tablo yerine okunaklı kayıt kartları */
@media (max-width: 1400px) {
  .collection-report-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .collection-report-table {
    display: block;
    min-width: 0;
    background: transparent;
  }
  .collection-report-table thead { display: none; }
  .collection-report-table tbody {
    display: grid;
    gap: 12px;
  }
  .collection-report-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 22px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .04);
  }
  .collection-report-table tbody td,
  .collection-report-table tbody td:first-child {
    position: static;
    left: auto;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    width: auto;
    min-width: 0;
    padding: 10px 0;
    border-top: 1px solid #eef2f7;
    background: transparent;
    box-shadow: none;
    color: #172033;
    font-size: 14px;
    line-height: 1.45;
    white-space: normal;
  }
  .collection-report-table tbody td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .01em;
  }
  .collection-report-table tbody td:nth-child(1),
  .collection-report-table tbody td:nth-child(2) { border-top: 0; }
  .collection-report-table tbody td:nth-child(7) { grid-column: 1 / -1; }
  .collection-report-table tbody td:nth-child(2) { grid-template-columns: 112px minmax(0, 1fr); }
  .collection-report-table tbody td > strong { font-size: 14px; line-height: 1.4; }
  .collection-report-table tbody td > small { font-size: 12px; line-height: 1.5; }
  .collection-report-table .record-status,
  .collection-report-table .collection-table-action {
    width: max-content;
    max-width: 100%;
    white-space: normal;
  }
  .collection-report-table .record-status { font-size: 13px; line-height: 1.25; }
  .collection-report-table .collection-report-payment {
    min-width: 0;
    max-width: 260px;
    padding: 10px 12px;
  }
  .collection-report-table .collection-report-payment strong { font-size: 15px; }
  .collection-report-table .collection-report-payment small { font-size: 12px; }
  .collection-report-table .collection-report-payment span { font-size: 11px; }
  .collection-report-table .collection-report-empty {
    display: block;
    padding: 0;
    border: 0;
    box-shadow: none;
  }
  .collection-report-table .collection-report-empty td {
    display: block;
    padding: 0;
    border: 0;
  }
  .collection-report-table .collection-report-empty td::before { content: none; }
}

@media (max-width: 700px) {
  .collection-report-table tbody tr {
    grid-template-columns: 1fr;
    padding: 13px;
  }
  .collection-report-table tbody td,
  .collection-report-table tbody td:nth-child(2),
  .collection-report-table tbody td:nth-child(7) {
    grid-column: 1;
    grid-template-columns: 96px minmax(0, 1fr);
  }
  .collection-report-table tbody td:nth-child(2) { border-top: 1px solid #eef2f7; }
}
