/* Bozbay Muhasebe — arayüz stilleri */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #f4f4f1;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --ink: #16171b;
  --ink-2: #3b3e46;
  --muted: #6e717a;
  --line: #e4e3de;
  --line-soft: #efeee9;

  --side: #141519;
  --side-2: #202227;
  --side-ink: #a0a3ab;

  --accent: #ff5b1f;
  --accent-hover: #e94b10;
  --accent-soft: #fff0e8;

  --green: #15803d;  --green-soft: #e5f4ea;
  --red: #c42b2b;    --red-soft: #fbeaea;
  --amber: #a05a06;  --amber-soft: #fcf1dc;
  --blue: #2451c7;   --blue-soft: #e8eefc;
  --gray: #55585f;   --gray-soft: #efefec;

  --radius: 12px;
  --radius-sm: 8px;
  --ring: 0 0 0 3px rgba(255, 91, 31, .18);
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a.link { color: var(--accent-hover); font-weight: 550; }
a.link:hover, a.link-plain:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 15px; }
p { margin: 0; }
.i { flex: none; }
.money, .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.r { text-align: right; }
.t-green { color: var(--green); }
.t-red { color: var(--red); }
.t-amber { color: var(--amber); }
.inline { display: inline; margin: 0; }
.hide { display: none !important; }

/* ---------- Yerleşim ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 232px; z-index: 30;
  background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column;
  transition: transform .2s ease;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 16px; color: #fff; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent);
  display: grid; place-items: center; font-weight: 800; font-size: 17px; color: #fff;
}
.brand-text { line-height: 1.2; }
.brand-text strong { display: block; font-size: 15px; }
.brand-text small { font-size: 12px; color: var(--side-ink); }
.nav { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px;
  color: var(--side-ink); font-weight: 500; transition: background .12s, color .12s;
}
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.active { background: var(--side-2); color: #fff; }
.nav a.active .i { color: var(--accent); }
.nav-sep { height: 1px; background: #25272d; margin: 10px 4px; }
.side-foot { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid #25272d; }
.side-foot .who { flex: 1; min-width: 0; line-height: 1.25; font-size: 12px; }
.side-foot .who strong { display: block; color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot a { color: var(--side-ink); padding: 6px; border-radius: 6px; display: inline-flex; }
.side-foot a:hover { color: #fff; background: var(--side-2); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: #2b2d34; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; background: var(--gray-soft); color: var(--ink-2); }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; background: var(--accent-soft); color: var(--accent-hover); }
.person { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }

.main { margin-left: 232px; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 62px;
  display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: rgba(244, 244, 241, .9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { flex: 1; min-width: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; }
.top-actions .btn:first-child .i { color: var(--green); }
.top-actions .btn:last-child .i { color: var(--red); }
.burger { display: none; }
.content { padding: 24px 28px 64px; max-width: 1360px; }
.scrim { display: none; }

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  body.side-open .sidebar { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .35); }
  .main { margin-left: 0; }
  .burger { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .content { padding: 18px 14px 56px; }
}
@media (max-width: 600px) {
  .top-actions .btn span { display: none; }
  .top-actions .btn { width: 32px; padding: 0; }
}

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 550; line-height: 1; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); border-color: #d2d0c9; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #2c2e35; border-color: #2c2e35; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: #efc8c8; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--gray-soft); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; gap: 6px; }
.btn-icon { width: 30px; padding: 0; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Kart ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid, .stats + .grid, .stats + .card, .toolbar + .card { margin-top: 18px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft); min-height: 54px;
}
.card-head .sub { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.card-body { padding: 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line-soft); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1fr) 340px; }
.grid-side-l { grid-template-columns: 340px minmax(0, 1fr); }
@media (max-width: 1100px) { .grid-side, .grid-side-l, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 800px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- İstatistik ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stats.s3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1180px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .stats, .stats.s3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stats + .stats { margin-top: 10px; }
  .stat { padding: 12px 14px; }
  .stat-label { font-size: 12px; gap: 6px; }
  .stat-value { font-size: 17px; }
  .stat-meta { font-size: 11.5px; }
}
.stats + .stats { margin-top: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: block; }
a.stat:hover { border-color: #d2d0c9; }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-value { margin-top: 6px; font-size: 24px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-meta { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.stat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray); }
.stat-dot.green { background: var(--green); }
.stat-dot.red { background: var(--red); }
.stat-dot.amber { background: #e59a1e; }
.stat-dot.blue { background: var(--blue); }
.stat-dot.accent { background: var(--accent); }
.stat.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.stat.dark .stat-label, .stat.dark .stat-meta { color: #a3a6ae; }

/* ---------- Tablo ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line-soft); white-space: nowrap;
}
.table th.r { text-align: right; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fcfcfa; }
.table tfoot td { padding: 11px 14px; border-top: 1px solid var(--line); font-weight: 650; background: var(--surface-2); }
.card > .table-wrap:first-child .table th:first-child { border-top-left-radius: var(--radius); }
.card > .table-wrap:first-child .table th:last-child { border-top-right-radius: var(--radius); }
.cell-title { font-weight: 550; }
.table td.desc { min-width: 170px; }
.cell-meta { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.actions { text-align: right; white-space: nowrap; width: 1%; }
.actions > * + * { margin-left: 4px; }

/* ---------- Rozet ---------- */
.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--gray-soft); color: var(--gray);
}
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }

.status-select {
  appearance: none; -webkit-appearance: none; border: 0; cursor: pointer;
  height: 24px; padding: 0 22px 0 10px; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 600;
  background: var(--gray-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='3'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
  color: var(--gray);
}
.status-select.s-green { background-color: var(--green-soft); color: var(--green); }
.status-select.s-red { background-color: var(--red-soft); color: var(--red); }
.status-select.s-amber { background-color: var(--amber-soft); color: var(--amber); }
.status-select.s-blue { background-color: var(--blue-soft); color: var(--blue); }
.status-select:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- Form ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); } }
.field label, .label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.req { color: var(--accent); }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=date],
.field input[type=tel], .field input[type=number], .field select, .field textarea, .filters input, .filters select {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; transition: border-color .12s, box-shadow .12s;
}
.field textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.field select, .filters select { padding-right: 30px; appearance: none; -webkit-appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent) !important; box-shadow: var(--ring); }
.input-money { text-align: right; font-variant-numeric: tabular-nums; }
.input-big { height: 48px !important; font-size: 20px !important; font-weight: 650; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.form-actions .spacer { flex: 1; }
.errors { background: var(--red-soft); color: var(--red); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; }
.errors ul { margin: 0; padding-left: 18px; }

.seg { display: inline-flex; background: var(--gray-soft); border-radius: 10px; padding: 3px; gap: 2px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  margin: 0; padding: 7px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 7px; transition: background .12s, color .12s;
}
.seg input:checked + label { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg input:focus-visible + label { box-shadow: var(--ring); }
.seg.type input[value=gelir]:checked + label { color: var(--green); }
.seg.type input[value=gider]:checked + label { color: var(--red); }

/* ---------- Filtre çubuğu ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters input, .filters select { height: 34px; width: auto; min-width: 140px; font-size: 13.5px; }
.filters input[type=date] { min-width: 0; }
.filters .search { position: relative; }
.filters .search .i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.filters .search input { padding-left: 32px; min-width: 200px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 550; color: var(--ink-2);
}
.chip:hover { border-color: #d2d0c9; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 16px; }
.filter-panel .filters + .chips { margin-top: 10px; }

/* ---------- Mesajlar ---------- */
.flash {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm);
  margin-bottom: 16px; font-weight: 550; background: var(--green-soft); color: var(--green);
}
.flash-error { background: var(--red-soft); color: var(--red); }
.flash-info { background: var(--blue-soft); color: var(--blue); }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }
.empty p { margin-bottom: 12px; }
.empty p:last-child { margin-bottom: 0; }

/* ---------- Liste ögeleri ---------- */
.dl { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 9px 14px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.profile { display: flex; align-items: center; gap: 14px; }
.profile h2 { font-size: 18px; }
.list-rows { list-style: none; margin: 0; padding: 0; }
.list-rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line-soft); }
.list-rows li:last-child { border-bottom: 0; }
.list-rows .total { font-weight: 650; background: var(--surface-2); }
.note-box { white-space: pre-line; color: var(--ink-2); }

/* ---------- Grafik ---------- */
.chart { display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); gap: 10px; height: 210px; }
.chart-col { display: flex; flex-direction: column; min-width: 0; }
.chart-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 5px; border-bottom: 1px solid var(--line); }
.bar { width: min(22px, 38%); min-height: 2px; border-radius: 5px 5px 0 0; }
.bar-in { background: var(--green); }
.bar-out { background: #e8836e; }
.chart-label { text-align: center; font-size: 12px; color: var(--muted); padding-top: 7px; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 9px 18px; }
.hbar + .hbar { border-top: 1px solid var(--line-soft); }
.hbar-track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--gray-soft); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 3px; }

.acc-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.acc-row:last-child { border-bottom: 0; }
.acc-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--gray-soft); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.acc-row .name { flex: 1; min-width: 0; font-weight: 550; }

/* ---------- Sekmeler ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- Teklif kalemleri ---------- */
.items-table { width: 100%; border-collapse: collapse; }
.items-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 6px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.items-table th:first-child, .items-table td:first-child { padding-left: 18px; }
.items-table th:last-child, .items-table td:last-child { padding-right: 18px; }
.items-table td { padding: 6px; vertical-align: top; }
.items-table input, .items-table select { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; font: inherit; background: var(--surface); }
.items-table select { padding-right: 6px; }
.items-table .c-qty { width: 90px; }
.items-table .c-unit { width: 100px; }
.items-table .c-price { width: 140px; }
.items-table .c-vat { width: 86px; }
.items-table .c-total { width: 130px; text-align: right; }
.items-table .c-del { width: 76px; white-space: nowrap; text-align: right; }
.items-table tr.row-flash td { animation: rowflash 1.2s ease; }
@keyframes rowflash { from { background: var(--accent-soft); } to { background: transparent; } }

/* Teklif: ürün arama */
.product-bar { flex-wrap: wrap; }
.product-bar h2 { margin-right: auto; }
.ps-field { position: relative; }
.ps-field .i { position: absolute; left: 10px; top: 11px; color: var(--muted); pointer-events: none; }
.items-table .ps-field input { padding-left: 30px; }
.ps-list { position: absolute; z-index: 60; max-height: 360px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(16, 17, 20, .16); padding: 5px; }
.ps-head { padding: 6px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.ps-foot { padding: 6px 10px 2px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line-soft); margin-top: 4px; }
.ps-item { padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.ps-item.on, .ps-item:hover { background: var(--accent-soft); }
.ps-name { font-weight: 600; }
.ps-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.ps-meta strong { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.ps-new { color: var(--accent-hover); font-weight: 600; border-top: 1px solid var(--line-soft); margin-top: 4px; border-radius: 0 0 7px 7px; }
.ps-empty { padding: 10px; color: var(--muted); font-size: 13px; }

/* Pencere (dialog) */
dialog.modal { border: 0; padding: 0; border-radius: 14px; width: min(640px, calc(100% - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 24px 64px rgba(0, 0, 0, .25); color: var(--ink); }
dialog.modal::backdrop { background: rgba(20, 21, 25, .45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { display: flex; align-items: center; gap: 8px; }
.modal-body { padding: 18px; }
.modal-body .errors { margin: 0; }
.modal-foot { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line-soft); background: var(--surface-2); border-radius: 0 0 14px 14px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; font-weight: 550; box-shadow: 0 10px 30px rgba(0,0,0,.2); transition: opacity .4s, transform .4s; }
.toast.out { opacity: 0; transform: translate(-50%, 10px); }
.items-table .line-total { display: block; line-height: 36px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.totals-box { margin-left: auto; width: min(100%, 360px); }
.totals-box .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; }
.totals-box .row input { width: 140px; height: 34px; text-align: right; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; font: inherit; }
.totals-box .grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-size: 17px; font-weight: 700; }
@media (max-width: 800px) {
  .items-table thead { display: none; }
  .items-table tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
  .items-table td { padding: 0 !important; width: auto !important; }
  .items-table td.c-desc { grid-column: 1 / -1; }
  .items-table td.c-total { grid-column: 1 / 3; }
}

/* ---------- Teklif belgesi ---------- */
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 48px 52px; max-width: 900px; margin: 0 auto; color: #1a1b1f; }
.doc-head { display: flex; justify-content: space-between; gap: 30px; padding-bottom: 26px; border-bottom: 2px solid #1a1b1f; }
.doc-brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.doc-brand .brand-mark { width: 38px; height: 38px; font-size: 20px; border-radius: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc-sub { margin-top: 10px; font-size: 12.5px; color: #555; line-height: 1.6; }
.doc-title { text-align: right; }
.doc-label { font-size: 28px; font-weight: 800; letter-spacing: .08em; color: var(--accent); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc-meta { margin-top: 8px; margin-left: auto; border-collapse: collapse; font-size: 13px; }
.doc-meta td { padding: 2px 0 2px 16px; }
.doc-meta td:first-child { color: #666; }
.doc-meta td:last-child { font-weight: 600; text-align: right; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding: 24px 0; }
.doc-cap { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #888; margin-bottom: 6px; }
.doc-parties .who { font-size: 16px; font-weight: 700; }
.doc-parties .info { font-size: 13px; color: #444; line-height: 1.6; margin-top: 4px; }
.doc-subject { font-size: 15px; font-weight: 600; }
.doc-items { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.doc-items th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #666; padding: 10px 8px; border-bottom: 1px solid #ccc; background: #f6f6f4; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc-items td { padding: 11px 8px; border-bottom: 1px solid #eee; vertical-align: top; }
.doc-items .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc-items .n { width: 30px; color: #888; }
.doc-bottom { display: grid; grid-template-columns: 1fr 320px; gap: 30px; margin-top: 22px; }
.doc-totals .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.doc-totals .grand { border-top: 2px solid #1a1b1f; margin-top: 6px; padding-top: 10px; font-size: 18px; font-weight: 800; }
.doc-notes { font-size: 12.5px; color: #444; line-height: 1.65; white-space: pre-line; }
.doc-bank { margin-top: 16px; font-size: 12.5px; line-height: 1.6; }
.doc-foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 50px; padding-top: 18px; border-top: 1px solid #ddd; font-size: 12px; color: #777; }
.doc-sign { text-align: center; min-width: 200px; }
.doc-sign .line { border-top: 1px solid #aaa; margin-top: 50px; padding-top: 6px; }
@media (max-width: 760px) {
  .doc { padding: 24px 18px; }
  .doc-head, .doc-foot { flex-direction: column; align-items: flex-start; }
  .doc-title { text-align: left; }
  .doc-meta { margin-left: 0; }
  .doc-meta td { padding: 2px 16px 2px 0; }
  .doc-parties, .doc-bottom { grid-template-columns: 1fr; }
}

/* ---------- Küçük yardımcılar ---------- */
.check { display: flex !important; align-items: center; gap: 9px; font-weight: 550 !important; cursor: pointer; margin: 0 !important; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.cost-total { height: 38px; display: flex; align-items: center; font-size: 20px; font-weight: 700; }
.allocate-box { background: var(--green-soft); border-radius: var(--radius-sm); padding: 12px 14px; }
.month-nav { gap: 6px; }
.month-title { font-size: 16px; min-width: 130px; text-align: center; }
.row-done td { background: #fbfdfb; }
.clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; max-width: 380px; }
.progress { height: 8px; border-radius: 4px; background: var(--gray-soft); overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: var(--green); border-radius: 4px; }
.progress-row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.list-head { padding: 10px 18px 6px; font-size: 12px; font-weight: 600; color: var(--muted); border-top: 1px solid var(--line-soft); }

/* Biçimli açıklama (ürün kapsamı) */
.rt { font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.rt > span { display: block; }
.rt-h { display: block; margin-top: 8px; color: var(--ink); }
.rt-h:first-child { margin-top: 0; }
.rt-li { padding-left: 14px; position: relative; }
.rt-li::before { content: "•"; position: absolute; left: 2px; color: var(--muted); }
.rt-gap { height: 6px; }
.prod-details summary { cursor: pointer; list-style: none; display: inline-block; margin-top: 2px; }
.prod-details summary::-webkit-details-marker { display: none; }
.prod-details summary:hover { color: var(--accent-hover); }
.prod-details[open] summary { margin-bottom: 8px; }
.prod-details .rt { max-width: 640px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; max-height: 320px; overflow: auto; }
.item-details { margin-top: 5px; }
.item-details summary { cursor: pointer; font-size: 12.5px; color: var(--muted); list-style: none; }
.item-details summary::-webkit-details-marker { display: none; }
.item-details summary:hover { color: var(--accent-hover); }
.items-table .item-details textarea { width: 100%; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font: inherit; font-size: 13px; resize: vertical; min-height: 90px; }
.doc-item-title { font-weight: 600; }
.doc-item-details { margin-top: 4px; }
.doc-item-details .rt { font-size: 11.5px; color: #555; line-height: 1.5; }
.doc-item-details .rt-h { margin-top: 5px; color: #333; }

/* İş notları akışı */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 18px; border-left: 2px solid var(--line); margin-left: 5px; }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted); }
.timeline li.tl-status::before { border-color: var(--accent); background: var(--accent); }
.tl-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.tl-head .muted { font-size: 12px; }
.tl-body { margin-top: 3px; white-space: normal; color: var(--ink-2); overflow-wrap: anywhere; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumbs a { display: block; width: 92px; height: 92px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--gray-soft); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.note-form { display: grid; gap: 10px; }
.note-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; resize: vertical; min-height: 84px; }
.file-pick { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); cursor: pointer; color: var(--muted); font-weight: 550; position: relative; }
.file-pick:hover { border-color: var(--accent); color: var(--accent-hover); }
.file-pick.has-files { border-style: solid; border-color: var(--green); color: var(--green); background: var(--green-soft); }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Personel panosu ---------- */
body.staff { background: var(--bg); }
.staff-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px; height: 60px; background: var(--side); }
.staff-top .brand { padding: 0; }
.staff-nav { display: flex; gap: 4px; }
.staff-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 8px; color: var(--side-ink); font-weight: 550; }
.staff-nav a:hover, .staff-nav a.on { background: var(--side-2); color: #fff; }
.staff-nav a.on .i { color: var(--accent); }
.staff-main { max-width: 1240px; margin: 0 auto; padding: 22px 20px 60px; }
.staff-hello { margin-bottom: 18px; }
.staff-hello h1 { font-size: 22px; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.board-col { background: #ebebe7; border-radius: var(--radius); padding: 12px; min-height: 120px; }
.board-col h2 { font-size: 13.5px; padding: 2px 4px 10px; display: flex; gap: 6px; }
.board-col.col-tamamlandi { background: #e8efe9; }
.board-empty { padding: 18px 8px; text-align: center; color: var(--muted); font-size: 13px; }
.job-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.job-card:last-child { margin-bottom: 0; }
.job-card-link { display: block; padding: 12px 14px; }
.job-card-link:hover { background: var(--surface-2); }
.job-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.job-card-desc { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.job-card-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.job-card-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.job-card-actions { display: flex; gap: 6px; justify-content: flex-end; padding: 8px 10px; border-top: 1px solid var(--line-soft); background: var(--surface-2); }
.col-tamamlandi .job-card { opacity: .85; }
@media (max-width: 900px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .staff-nav a span { display: none; }
  .staff-main { padding: 16px 12px 50px; }
}

/* ---------- Giriş / kurulum ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--side); }
.auth-card { width: min(100%, 400px); background: var(--surface); border-radius: 16px; padding: 32px; }
.auth-card .brand { padding: 0 0 22px; color: var(--ink); }
.auth-card .brand-text small { color: var(--muted); }
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-card .lead { color: var(--muted); margin-bottom: 22px; }
.auth-card .field + .field { margin-top: 14px; }
.auth-foot { margin-top: 18px; color: #6f727b; font-size: 12.5px; text-align: center; }
.auth-foot a { color: #b9bcc4; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line-soft); font-size: 13px; }

/* ---------- Yazdırma ---------- */
@page { size: A4; margin: 12mm; }
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .no-print, .flash, .scrim { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  .doc { border: 0; border-radius: 0; padding: 0; max-width: none; }
  .doc-items tr { page-break-inside: avoid; }
}
