/* Ortak stiller. Sayfa düzenleri için Tailwind yardımcı sınıfları da kullanılabilir. */
/* IBM Plex, repodan (assets/fonts, OFL). Dosyaya çift tıklayınca da yüklenir. */
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/IBMPlexSans-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/IBMPlexSans-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/IBMPlexSans-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/IBMPlexMono-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/IBMPlexMono-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/IBMPlexMono-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
:root {
  --bg: #f5f4f1;
  --panel: #ffffff;
  --panel-2: #fafaf9;
  --border: #e7e5e4;
  --border-2: #d6d3d1;
  --text: #1c1917;
  --text-2: #44403c;
  --muted: #78716c;
  --accent: #c2410c;
  --accent-2: #9a3412;
  --accent-soft: #fff1e6;
  --side: #1c1917;
  --side-2: #292524;
  --side-text: #d6d3d1;
  --blue: #2563eb; --blue-soft: #eff6ff;
  --green: #15803d; --green-soft: #ecfdf3;
  --red: #dc2626; --red-soft: #fef2f2;
  --orange: #ea580c; --orange-soft: #fff7ed;
  --yellow: #a16207; --yellow-soft: #fefce8;
  --purple: #7c3aed; --purple-soft: #f5f3ff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(28, 25, 23, .05), 0 1px 3px rgba(28, 25, 23, .06);
  --shadow-lg: 0 10px 30px rgba(28, 25, 23, .14);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 .5rem; }
code { font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; background: var(--panel-2); padding: 1px 4px; border-radius: 4px; }
.muted { color: var(--muted); }
.neg { color: var(--red); }
.pos { color: var(--green); }
.c { text-align: center; }
.r { text-align: right; }
.nw { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.ico { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; }
.ico-xs { width: 13px; height: 13px; }
.ico-lg { width: 22px; height: 22px; }

/* Kurgusal veri bandı (index.html). Ekranın üstüne yapışır; yüksekliğini layout.js --banner-h olarak yazar,
   yapışkan üst bar, menü ve sayfa içi yapışkan alanlar bu kadar aşağıdan başlar. */
.proto-banner { position: sticky; top: 0; z-index: 35; font-size: 13px; padding: 6px 16px; line-height: 1.4; text-align: center; background: var(--accent-soft); color: var(--accent-2); border-bottom: 1px solid var(--border); }
.proto-banner a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; margin-left: 4px; }

/* Prototip şeridi */
.ribbon { position: fixed; top: 14px; right: -34px; z-index: 60; transform: rotate(45deg); background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .12em; padding: 3px 40px; box-shadow: var(--shadow); pointer-events: none; }

/* İskelet */
.app { display: flex; min-height: calc(100vh - var(--banner-h, 0px)); }
.side { width: 248px; flex-shrink: 0; background: var(--side); color: var(--side-text); position: sticky; top: var(--banner-h, 0px); height: calc(100vh - var(--banner-h, 0px)); overflow-y: auto; display: flex; flex-direction: column; transition: width .15s; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main { padding: 18px 28px 48px; max-width: 1480px; width: 100%; }
.brand { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 12px 16px; border-bottom: 1px solid var(--side-2); }
.brand-a { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.brand-name { font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .icon-btn { color: var(--side-text); }
.side .icon-btn:hover { background: var(--side-2); }
.nav { padding: 8px 8px 16px; flex: 1; }
.nav-group { margin-top: 10px; }
.nav-title { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: #a8a29e; padding: 6px 10px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--side-text); font-size: 13.5px; }
.nav-item:hover { background: var(--side-2); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge { background: #44403c; color: #fff; font-size: 11px; font-weight: 600; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.nav-badge.crit { background: var(--red); }
.nav-item.active .nav-badge { background: rgba(255, 255, 255, .25); }
.side-foot { padding: 10px 16px; font-size: 12px; color: #a8a29e; border-top: 1px solid var(--side-2); }
.app.collapsed .side { width: 62px; }
.app.collapsed .brand-name, .app.collapsed .nav-label, .app.collapsed .nav-title, .app.collapsed .side-foot, .app.collapsed .nav-badge { display: none; }
.app.collapsed .brand { flex-direction: column; gap: 8px; padding: 12px 8px; }
.app.collapsed .nav-item { justify-content: center; }

.top { position: sticky; top: var(--banner-h, 0px); z-index: 30; display: flex; align-items: center; gap: 16px; padding: 10px 70px 10px 28px; background: rgba(245, 244, 241, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); }
.search { position: relative; flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; color: var(--muted); }
.search input { border: 0; outline: 0; background: transparent; height: 36px; flex: 1; font: inherit; color: var(--text); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-res { position: absolute; top: 42px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 420px; overflow-y: auto; padding: 6px; z-index: 40; }
.search-res a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--text); }
.search-res a:hover { background: var(--accent-soft); }
.search-res small { color: var(--muted); }
.sr-g { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px 4px; }
.sr-empty { padding: 14px; color: var(--muted); text-align: center; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.role { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; color: var(--muted); }
.role select { border: 0; background: transparent; font: inherit; height: 34px; color: var(--text); outline: 0; cursor: pointer; }
.icon-btn { border: 0; background: transparent; width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; cursor: pointer; color: var(--text-2); position: relative; }
.icon-btn:hover { background: var(--border); }
.bell-wrap, .menu-wrap { position: relative; }
.bell-n { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--orange); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.bell-n.crit { background: var(--red); }
.bell-panel { position: absolute; right: 0; top: 42px; width: 420px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 40; overflow: hidden; }
.bell-h { display: flex; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.bell-all { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 10px; font-weight: 600; color: var(--accent); border-top: 1px solid var(--border); }
.menu-pop { position: absolute; right: 0; top: 42px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; min-width: 260px; }
.menu-pop button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; padding: 8px 10px; border-radius: 6px; font: inherit; cursor: pointer; text-align: left; color: var(--text); }
.menu-pop button:hover { background: var(--panel-2); }
.menu-pop button.danger { color: var(--red); }

/* Sayfa başlığı */
.crumbs { display: flex; align-items: center; gap: 2px; font-size: 12.5px; color: var(--muted); margin: 4px 0 10px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { margin: 0 4px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.ph-l { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.ph-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.ph-sub { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.infobox { display: flex; gap: 12px; align-items: flex-start; background: var(--blue-soft); border: 1px solid #bfdbfe; color: #1e3a8a; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; }
.infobox-ico { color: var(--blue); width: 20px; height: 20px; margin-top: 2px; }
.infobox-b { flex: 1; }
.infobox ul { margin: 4px 0 0; padding-left: 18px; }
.infobox li { margin: 2px 0; }
.infobox .icon-btn { color: #1e3a8a; width: 28px; height: 28px; }
.infobox .icon-btn:hover { background: #dbeafe; }
.page { display: flex; flex-direction: column; gap: 16px; }

/* Kart */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.card-h h3 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-b { padding: 14px 16px; }
.card-flush { padding: 0; }
.count-pill { background: var(--orange-soft); color: var(--orange); font-size: 11.5px; border-radius: 10px; padding: 0 7px; font-weight: 600; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kpi { display: block; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); transition: border-color .12s, transform .12s; }
a.kpi:hover { border-color: var(--accent); transform: translateY(-1px); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12.5px; }
.kpi-ico { color: var(--accent); }
.kpi-value { font-size: 22px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.tone-red { border-color: #fecaca; background: var(--red-soft); }
.kpi.tone-red .kpi-value { color: var(--red); }
.kpi.tone-orange { border-color: #fed7aa; background: var(--orange-soft); }
.kpi.tone-green .kpi-value { color: var(--green); }

/* Rozet */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; line-height: 1.5; }
.badge-gray { background: #f1f0ee; color: #57534e; }
.badge-blue { background: var(--blue-soft); color: #1d4ed8; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-dark { background: #292524; color: #fafaf9; }
.badge-red { background: var(--red-soft); color: #b91c1c; }
.badge-orange { background: var(--orange-soft); color: #c2410c; }
.badge-yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge-purple { background: var(--purple-soft); color: #6d28d9; }

.ref { color: var(--accent-2); font-weight: 500; border-bottom: 1px dotted rgba(154, 52, 18, .35); }
.ref:hover { color: var(--accent); border-bottom-style: solid; }

/* Tanım listesi */
.dl { display: grid; gap: 12px 24px; margin: 0; }
.dl.cols-1 { grid-template-columns: 1fr; }
.dl.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dl.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dl.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dl dt { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* İlerleme */
.prog { position: relative; height: 8px; background: #eeedeb; border-radius: 6px; overflow: hidden; min-width: 80px; }
.prog-sm { height: 6px; }
.prog-bar { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.prog-accent { background: var(--accent); }
.prog-green { background: var(--green); }
.prog-red { background: var(--red); }
.prog-blue { background: var(--blue); }
.prog-band { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, rgba(37, 99, 235, .18), rgba(37, 99, 235, .18) 3px, transparent 3px, transparent 6px); }

.empty { text-align: center; color: var(--muted); padding: 22px 12px; }
.empty-ico { width: 28px; height: 28px; color: var(--border-2); display: block; margin: 0 auto 6px; }
.empty p { margin: 0; }

/* Düğmeler */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--panel); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .1s, border-color .1s; }
.btn:hover { background: var(--panel-2); border-color: #a8a29e; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: #eceae7; border-color: transparent; }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 15px; }

/* Sekmeler */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 9px 13px; color: var(--muted); font-weight: 550; white-space: nowrap; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.tab-count { background: #eeedeb; color: var(--text-2); font-size: 11px; border-radius: 10px; padding: 0 6px; }
.tab-count.warn { background: var(--orange-soft); color: var(--orange); }

/* Uyarılar */
.alert-list { display: flex; flex-direction: column; }
.alert-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.alert-item:last-child { border-bottom: 0; }
.alert-item:hover { background: var(--panel-2); }
.alert-item.read .alert-msg { color: var(--muted); }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; align-self: flex-start; margin-top: 7px; }
.lv-kritik .alert-dot { background: var(--red); }
.lv-uyari .alert-dot { background: var(--orange); }
.lv-bilgi .alert-dot { background: var(--blue); }
.alert-body { flex: 1; min-width: 0; }
.alert-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.alert-msg { margin-top: 2px; }
span.row-warn { display: inline-flex; vertical-align: middle; margin-left: 4px; cursor: help; }
span.row-warn.lv-kritik { color: var(--red); }
span.row-warn.lv-uyari { color: var(--orange); }
span.row-warn.lv-bilgi { color: var(--blue); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 82px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.timeline li:last-child { border-bottom: 0; }
.tl-date { color: var(--muted); font-variant-numeric: tabular-nums; }

.note { display: flex; gap: 10px; align-items: flex-start; border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.note .ico { margin-top: 2px; }
.note-info { background: var(--blue-soft); color: #1e3a8a; }
.note-warn { background: var(--orange-soft); color: #9a3412; }
.note-danger { background: var(--red-soft); color: #991b1b; }
.note-ok { background: var(--green-soft); color: #166534; }

/* Tablo */
.tbl-wrap { min-width: 0; }
.tbl-scroll { overflow-x: auto; overflow-y: hidden; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--panel-2); padding: 9px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--text); }
.tbl th.sorted { color: var(--accent); }
/* Hücreler kırılmaz; satır yükseklikleri eşit kalır. Uzun metin üç noktayla kesilir, tamamı fareyle üzerine gelince görünür. */
.tbl td { padding: 9px 8px; border-bottom: 1px solid #f0efed; vertical-align: middle; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.tbl td.wrap { white-space: normal; }
.tbl.dense td { padding: 6px 10px; }
.tbl.dense th { padding: 7px 10px; }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td.c, .tbl th.c { text-align: center; }
.tbl tr.clickable { cursor: pointer; }
.tbl tbody tr:hover td { background: #fbf7f3; }
.tbl tr.grp td { background: #f6f3ef; font-weight: 650; color: var(--text-2); padding: 8px 12px; }
.tbl tr.grp-foot td { background: #fbfaf8; font-weight: 600; border-bottom: 2px solid var(--border); }
.tbl tfoot td { background: var(--panel-2); font-weight: 650; border-top: 2px solid var(--border); border-bottom: 0; }
.tbl tr.row-muted td { color: var(--muted); }
.tbl tr.row-danger td { background: #fff7f7; }
.tbl tr.row-warn td { background: #fffaf3; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 12.5px; }
.pager-btns { display: flex; align-items: center; gap: 6px; }
.pager-num { min-width: 60px; text-align: center; }
.card .tbl-wrap .tbl th:first-child, .card .tbl-wrap .tbl td:first-child { padding-left: 16px; }

/* Liste başlığı ve filtreler */
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.list-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.flt { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; height: 34px; color: var(--muted); font-size: 12.5px; }
.flt select, .flt input { border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); height: 32px; font-size: 13.5px; }
.flt-search { min-width: 240px; }
.flt-search input { flex: 1; }
.flt-chk { cursor: pointer; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--border); font-weight: 550; font-size: 13px; color: var(--text-2); }
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-n { opacity: .7; font-weight: 500; }

/* Grafik */
.chart-wrap { position: relative; width: 100%; }

/* Formlar */
.form-grid { display: grid; gap: 14px 16px; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: 1 / -1; }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.req { color: var(--red); }
.inp { width: 100%; height: 36px; border: 1px solid var(--border-2); border-radius: 8px; padding: 0 10px; font: inherit; background: var(--panel); color: var(--text); outline: 0; }
textarea.inp { height: auto; padding: 8px 10px; resize: vertical; }
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inp[readonly] { background: var(--panel-2); color: var(--text-2); }
.inp-group { display: flex; }
.inp-group .inp { border-radius: 0; }
.inp-group .inp:first-child { border-radius: 8px 0 0 8px; }
.inp-group .inp:last-child { border-radius: 0 8px 8px 0; }
.inp-add { white-space: nowrap; display: grid; place-items: center; padding: 0 10px; background: var(--panel-2); border: 1px solid var(--border-2); color: var(--muted); font-size: 13px; }
.inp-group .inp-add:first-child { border-radius: 8px 0 0 8px; border-right: 0; }
.inp-group .inp-add:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.fld.invalid .inp { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.err { color: var(--red); font-size: 12px; }
.help { color: var(--muted); font-size: 12px; }
.chk { display: flex; align-items: center; gap: 8px; cursor: pointer; flex-wrap: wrap; }
.chk input { width: 16px; height: 16px; accent-color: var(--accent); }
.chk .help { flex-basis: 100%; padding-left: 24px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; }
.combo { position: relative; }
.combo-text { padding-right: 30px; }
.combo-ico { position: absolute; right: 9px; top: 10px; color: var(--muted); pointer-events: none; }
.combo-list { position: absolute; left: 0; right: 0; top: 40px; z-index: 70; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; padding: 4px; }
.combo-opt { display: flex; justify-content: space-between; gap: 10px; padding: 7px 9px; border-radius: 6px; cursor: pointer; }
.combo-opt small { color: var(--muted); white-space: nowrap; }
.combo-opt:hover, .combo-opt.hi { background: var(--accent-soft); }
.combo-opt.disabled { opacity: .45; cursor: not-allowed; }
.combo-empty { padding: 10px; color: var(--muted); text-align: center; }

/* Modal ve bildirim */
.modal-bg { position: fixed; inset: 0; background: rgba(28, 25, 23, .45); z-index: 80; display: grid; place-items: center; padding: 20px; animation: fade .12s; }
.modal { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal-sm { width: min(420px, 100%); }
.modal-lg { width: min(760px, 100%); }
.modal-xl { width: min(1040px, 100%); }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-h h3 { font-size: 16px; }
.modal-b { padding: 16px 18px; overflow-y: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 8px; background: #1c1917; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); animation: slide .18s; max-width: 380px; }
.toast-success .ico { color: #4ade80; }
.toast-error .ico { color: #f87171; }
.toast-info .ico { color: #93c5fd; }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .3s; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { opacity: 0; transform: translateY(8px); } }

/* Detay sayfası düzeni */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.detail-main, .detail-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.stat-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.stat-row:last-child { border-bottom: 0; }
.stat-row.total { font-weight: 700; border-top: 2px solid var(--border); border-bottom: 0; margin-top: 4px; padding-top: 9px; }
.big-num { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.err-stack { white-space: pre-wrap; font-size: 11px; color: var(--muted); background: var(--panel); padding: 10px; border-radius: 8px; overflow: auto; }

/* Şoför (mobil) görünümü */
body.mobile-mode { background: #e7e5e4; }
body.mobile-mode .side, body.mobile-mode .top, body.mobile-mode .ribbon { display: none; }
body.mobile-mode .main { max-width: 440px; margin: 0 auto; padding: 0 0 30px; min-height: calc(100vh - var(--banner-h, 0px)); background: var(--bg); box-shadow: var(--shadow-lg); }
body.mobile-mode .infobox { margin: 12px 12px 0; }

@media (max-width: 1180px) {
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .side { position: fixed; top: var(--banner-h, 0px); z-index: 50; transform: translateX(-100%); }
  .app:not(.collapsed) .side { transform: none; width: 248px; }
  .app.collapsed .side { transform: translateX(-100%); }
  .main { padding: 14px 16px 40px; }
  .top { padding: 8px 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .dl.cols-3, .dl.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .form-grid.cols-2, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .bell-panel { width: calc(100vw - 32px); right: -60px; }
  .search { max-width: none; }
  .role span, .role .ico { display: none; }
}

/* Yazdırma (teklif sayfası vb.) */
@media print {
  .side, .top, .ribbon, .crumbs, .page-head, .infobox, .no-print, #toasts { display: none !important; }
  body, .main { background: #fff; padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
}
body:has(.modal-bg) #toasts { bottom: 84px; }
