:root {
  --bg: #f4f4f3;
  --surface: #ffffff;
  --surface-2: #f8f8f7;
  --ink: #191b1f;
  --ink-2: #4c525c;
  --ink-3: #6d737d;
  --line: #e4e4e2;
  --line-strong: #cfcfcc;
  --brand: #2f353c;
  --brand-hover: #1c2025;
  --brand-soft: #ecedee;
  --on-brand: #ffffff;
  --side: #17181c;
  --side-2: #24262b;
  --side-ink: #c9cbd0;
  --side-ink-2: #8d9099;
  --good: #16784a;
  --good-soft: #e7f4ed;
  --warn: #9a5b00;
  --warn-soft: #fbf1df;
  --bad: #b3261e;
  --bad-soft: #fbeae8;
  --chart: #2f6fb0;
  --grid: #ececea;
  --shadow: 0 1px 2px rgb(20 20 20 / 5%), 0 1px 1px rgb(20 20 20 / 3%);
  --shadow-lg: 0 12px 40px rgb(20 20 20 / 18%);
  --radius: 10px;
  --radius-sm: 7px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #111215;
  --surface: #1a1c20;
  --surface-2: #212328;
  --ink: #ecedef;
  --ink-2: #b4b8bf;
  --ink-3: #8f949c;
  --line: #2c2f35;
  --line-strong: #3d4047;
  --brand: #e3e5e8;
  --brand-hover: #ffffff;
  --brand-soft: #2a2d32;
  --on-brand: #15171a;
  --side: #0c0d0f;
  --side-2: #1c1e22;
  --good: #52c08b;
  --good-soft: #15291f;
  --warn: #e0a84e;
  --warn-soft: #2e2413;
  --bad: #f07a70;
  --bad-soft: #331a18;
  --chart: #4f97e0;
  --grid: #2a2d32;
  --shadow: none;
  --shadow-lg: 0 12px 40px rgb(0 0 0 / 55%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.icon { flex: none; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.link { color: var(--brand); font-weight: 550; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.link:hover { text-decoration-color: currentColor; }
.strong { font-weight: 600; }
.inline-form { display: inline-flex; margin: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Yerleşim */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; padding: 14px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.brand-logo { width: 42px; height: 42px; border-radius: 50%; flex: none; display: block; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: #3a4047; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; flex: none; }
.brand-name { font-weight: 650; color: #fff; font-size: 14.5px; line-height: 1.2; }
.brand-sub { font-size: 11.5px; color: var(--side-ink-2); }
.nav-group { margin-top: 14px; }
.nav-label { padding: 0 10px 5px; font-size: 11px; font-weight: 600; color: var(--side-ink-2); }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--side-ink); font-size: 13.5px; font-weight: 500; margin-bottom: 1px;
}
.nav-link:hover { background: var(--side-2); color: #fff; }
.nav-link.is-active { background: #e8e9eb; color: #17181c; }
.nav-count { margin-left: auto; font-size: 11.5px; background: rgb(255 255 255 / 12%); padding: 0 7px; border-radius: 99px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.icon-btn.menu-btn { display: none; }
.search-trigger {
  flex: 1; max-width: 430px; display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 11px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink-3); cursor: pointer; text-align: left;
}
.search-trigger:hover { border-color: var(--line-strong); }
kbd { margin-left: auto; font: 11px/1 inherit; padding: 3px 6px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--ink-3); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none;
  display: inline-grid; place-items: center; background: var(--side); color: #fff; font-size: 12px; font-weight: 600;
}
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 2px 4px; border-radius: var(--radius-sm); }
.user-menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 30;
}
.menu-panel a, .menu-panel button {
  display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 6px; background: none; border: 0; cursor: pointer; text-align: left;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); }
.menu-head { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.content { padding: 22px 24px 40px; max-width: 1400px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head .sub { color: var(--ink-3); margin-top: 2px; }
.crumb { font-size: 12.5px; color: var(--ink-3); margin-bottom: 3px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumb a:hover { color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Düğmeler */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 13px;
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius-sm); cursor: pointer; font-weight: 550; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-sm { height: 30px; padding: 0 9px; font-size: 13px; }
.btn-block { width: 100%; }

/* Kart */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 48px; }
.card-body { padding: 16px; }
.grid { display: grid; gap: 14px; }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.grid-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stack { display: grid; gap: 14px; }
.mt { margin-top: 14px; }

.kpi { display: block; padding: 14px 16px; }
a.kpi:hover { border-color: var(--line-strong); }
.kpi-label { color: var(--ink-2); font-size: 13px; display: flex; align-items: center; gap: 7px; }
.kpi-value { font-size: 26px; font-weight: 650; letter-spacing: -.015em; margin-top: 3px; line-height: 1.2; }
.kpi-value.money { font-size: 21px; }
.kpi-note { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.kpi.is-alert .kpi-value { color: var(--bad); }
.tone-good { color: var(--good); }
.tone-bad { color: var(--bad); }

/* Tablo */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 9px 9px;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2);
}
.table td { padding: 10px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table th.right, .table td.right { text-align: right; }
.table tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 0; }
.row-title { font-weight: 600; display: block; }
.row-title:hover { color: var(--brand); }
.row-sub { display: block; color: var(--ink-3); font-size: 12.5px; }
.clip { display: block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; align-items: center; }
.table td:first-child, .table th:first-child { padding-left: 14px; }
.table td:last-child, .table th:last-child { padding-right: 14px; }
.row-actions .btn-ghost { padding: 0 6px; }
tr.priority-3 > td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tr.priority-2 > td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.sort-hint { display: flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 12.5px; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.table .drag-cell { width: 36px; padding: 0 0 0 8px; }
.drag-handle { display: grid; place-items: center; width: 30px; height: 36px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--ink-3); cursor: grab; touch-action: none; }
.drag-handle:hover { background: var(--surface-2); color: var(--ink); }
tr.is-dragging { background: var(--surface-2); outline: 2px solid var(--brand); outline-offset: -2px; }
body.is-sorting, body.is-sorting * { cursor: grabbing !important; user-select: none; }
tr[data-href] { cursor: pointer; }
.queue-input { width: 62px !important; height: 32px !important; padding: 0 6px !important; text-align: center; font-weight: 600; }
.transfer-form { flex-wrap: nowrap; }
.transfer-form input { width: 120px !important; height: 30px !important; }
.plain-fieldset { border: 0; margin: 0; padding: 0; }
.debt-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.debt-item:last-child { border-bottom: 0; }
.debt-item:hover { background: var(--surface-2); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .01em; }
.table .pick-cell { width: 38px; }
.pick-cell input { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }
.sort-hint .btn { margin-left: auto; }
.empty { padding: 44px 18px; text-align: center; color: var(--ink-3); }
.empty strong { display: block; color: var(--ink); margin-bottom: 3px; font-size: 15px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 550; white-space: nowrap; }
.pill i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tag { display: inline-flex; padding: 1px 8px; font-size: 12px; font-weight: 600; border-radius: 5px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-bad { background: var(--bad-soft); color: var(--bad); }
.tag-good { background: var(--good-soft); color: var(--good); }
.status-select {
  appearance: none; max-width: 170px; height: 30px; padding: 0 24px 0 24px; border: 1px solid var(--line); border-radius: 99px; background-color: var(--surface-2); font-size: 12.5px; font-weight: 550; cursor: pointer;
  background-image: radial-gradient(circle at center, var(--dot, #999) 4px, transparent 4.5px), linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-size: 24px 28px, 5px 5px, 5px 5px; background-position: 0 center, right 13px center, right 8px center; background-repeat: no-repeat;
  text-overflow: ellipsis;
}
.table .status-select { min-width: 104px; max-width: 136px; }

/* Sekme ve filtre */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 0 8px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 11px 11px 10px; font-weight: 550; color: var(--ink-3); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--brand); }
.tab .count { font-size: 12px; font-weight: 500; margin-left: 4px; color: var(--ink-3); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; align-items: flex-end; border-bottom: 1px solid var(--line); }
.filters .grow { flex: 1 1 220px; }
.filters .fld { display: grid; gap: 3px; font-size: 12px; color: var(--ink-3); }
.filters .fld input, .filters .fld select { width: auto; min-width: 128px; }
.search-input { position: relative; }
.search-input .icon { position: absolute; left: 10px; top: 9px; color: var(--ink-3); pointer-events: none; }
.search-input input { padding-left: 33px !important; }

/* Form */
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; height: 36px; padding: 0 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); outline: none;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--brand) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
input[type=file] { width: 100%; font-size: 13px; }
input[type=color] { width: 56px; height: 36px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.field { display: grid; gap: 4px; min-width: 0; align-content: start; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--ink-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.span-all { grid-column: 1 / -1; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.segmented label { padding: 7px 13px; cursor: pointer; font-weight: 550; font-size: 13px; }
.segmented label + label { border-left: 1px solid var(--line-strong); }
.segmented input { position: absolute; opacity: 0; width: 0; height: 0; }
.segmented label:has(input:checked) { background: var(--side); color: #fff; }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: -2px; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-footer {
  position: sticky; bottom: 0; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 10px 16px;
  background: var(--surface); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); z-index: 5;
}
.notice { padding: 9px 12px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.total-box { display: grid; gap: 3px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.total-box div { display: flex; justify-content: space-between; }
.total-box .grand { font-weight: 650; font-size: 15px; }

/* Müşteri seçici */
.combo { position: relative; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 25; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-height: 300px; overflow-y: auto; padding: 4px;
}
.combo-item { display: block; width: 100%; text-align: left; padding: 8px 10px; background: none; border: 0; border-radius: 5px; cursor: pointer; }
.combo-item:hover, .combo-item.is-active { background: var(--surface-2); }
.picked { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); }

/* Detay */
.dl { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 7px 12px; margin: 0; }
.dl dt { color: var(--ink-3); font-size: 13px; }
.dl dd { margin: 0; overflow-wrap: anywhere; font-weight: 500; }
.note-block { white-space: pre-wrap; overflow-wrap: anywhere; }
.measure-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.measure { padding: 9px 11px; background: var(--surface-2); border-radius: var(--radius-sm); }
.measure span { display: block; font-size: 12px; color: var(--ink-3); }
.measure strong { font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.timeline li { display: grid; grid-template-columns: 10px 1fr; gap: 9px; font-size: 13px; }
.timeline li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); margin-top: 6px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo form { position: absolute; top: 4px; right: 4px; }
.photo button { width: 26px; height: 26px; display: grid; place-items: center; background: rgb(0 0 0 / 60%); color: #fff; border: 0; border-radius: 6px; cursor: pointer; }
.contact-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Bildirim, diyalog */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 60; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 9px; align-items: flex-start; background: var(--side); color: #fff; padding: 11px 13px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-weight: 500; }
.toast.success .icon { color: #6ee7a8; }
.toast.error .icon { color: #ff9b92; }
.toast.warning .icon { color: #f6c667; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); max-width: calc(100vw - 24px); }
dialog::backdrop { background: rgb(10 10 12 / 55%); }
.confirm-box { width: 400px; max-width: 100%; padding: 18px; }
.confirm-box .actions { justify-content: flex-end; margin-top: 16px; }
.search-dialog { width: 620px; margin-top: 10vh; }
.search-dialog input { height: 48px !important; border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; box-shadow: none !important; padding: 0 16px !important; font-size: 15px; }
.search-results { max-height: 58vh; overflow-y: auto; padding: 6px; min-height: 60px; }
.search-group { padding: 8px 10px 3px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.search-result { display: block; padding: 8px 10px; border-radius: 6px; }
.search-result:hover, .search-result.is-active { background: var(--surface-2); }
.lightbox { background: transparent; border: 0; box-shadow: none; max-width: 94vw; max-height: 94vh; }
.lightbox img { max-width: 94vw; max-height: 92vh; display: block; border-radius: 8px; }

/* Grafik */
.chart { display: grid; grid-template-columns: 40px 1fr; height: 196px; }
.chart-y { position: relative; font-size: 11.5px; color: var(--ink-3); }
.chart-y span { position: absolute; right: 8px; transform: translateY(50%); }
.chart-plot { position: relative; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--line-strong); background-image: linear-gradient(var(--grid) 1px, transparent 1px); background-size: 100% 50%; }
.chart-col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; }
.chart-bar { width: min(62%, 30px); background: var(--chart); border-radius: 4px 4px 0 0; min-height: 2px; transition: opacity .12s; }
.chart-plot:hover .chart-bar { opacity: .55; }
.chart-col:hover .chart-bar, .chart-col:focus .chart-bar { opacity: 1; }
.chart-tip {
  position: absolute; bottom: calc(100% - 22px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--side); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 5px; opacity: 0; pointer-events: none; z-index: 4;
}
.chart-col:hover .chart-tip, .chart-col:focus .chart-tip { opacity: 1; }
.chart-col:first-child .chart-tip { left: 0; transform: none; }
.chart-col:last-child .chart-tip { left: auto; right: 0; transform: none; }
.chart-x { display: flex; gap: 2px; margin-left: 40px; padding-top: 5px; font-size: 11.5px; color: var(--ink-3); }
.chart-x span { flex: 1; text-align: center; min-width: 0; overflow: hidden; }
details.data-table summary { cursor: pointer; font-size: 12.5px; color: var(--ink-3); margin-top: 10px; }

.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; font-size: 13px; }
.bar-track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; background: var(--chart); }
.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }

/* Ajanda */
.agenda-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.agenda-item:last-child { border-bottom: 0; }
.agenda-item:hover { background: var(--surface-2); }
.agenda-time { font-weight: 600; color: var(--ink-2); font-size: 13px; }

/* Takvim */
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-title { font-weight: 650; font-size: 15px; min-width: 128px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--ink-3); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-day { min-height: 112px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.is-out { background: var(--surface-2); }
.cal-num { font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 50%; }
.cal-day.is-today .cal-num { background: var(--brand); color: var(--on-brand); }
.cal-chip { display: flex; gap: 5px; align-items: center; font-size: 12px; padding: 2px 4px; border-radius: 4px; overflow: hidden; white-space: nowrap; }
.cal-chip:hover { background: var(--surface-2); }
.cal-chip i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.cal-chip span { overflow: hidden; text-overflow: ellipsis; }
.cal-chip.is-urgent { color: var(--bad); font-weight: 600; }
.cal-more { font-size: 12px; color: var(--ink-3); padding: 1px 4px; display: block; }
.cal-more:hover { color: var(--ink); }

/* Sayfalama */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; }
.pager-links { display: flex; gap: 4px; }
.pager-links a, .pager-links span { min-width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0 8px; border-radius: 6px; color: var(--ink-2); }
.pager-links a:hover { background: var(--surface-2); }
.pager-links .is-current { background: var(--side); color: #fff; }

/* Giriş */
.login-page { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.login-side { background: var(--side); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.login-side h1 { font-size: 34px; line-height: 1.15; max-width: 440px; letter-spacing: -.02em; }
.login-side ul { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 9px; color: var(--side-ink); }
.login-side li { display: flex; gap: 9px; align-items: center; }
.login-side li .icon { color: #b4bac1; }
.login-form-wrap { display: grid; place-items: center; padding: 32px 20px; }
.login-form { width: 100%; max-width: 360px; display: grid; gap: 14px; }
.credit { font-size: 12px; color: var(--ink-3); text-align: center; padding-top: 12px; border-top: 1px solid var(--line); }
.side-credit { margin: auto 0 0; padding: 16px 10px 2px; font-size: 11.5px; line-height: 1.4; color: var(--side-ink-2); }
.login-logo { width: 132px; height: 132px; justify-self: center; display: block; }

/* Mobil alt menü */
.bottom-nav { display: none; }
.only-mobile { display: none !important; }
.scrim { display: none; }

@media (max-width: 1100px) {
  .grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 50; width: 268px; left: 0; top: 0; transform: translateX(-100%); transition: transform .18s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgb(0 0 0 / 50%); z-index: 45; }
  .icon-btn.menu-btn { display: inline-grid; }
  .topbar { padding: 8px 12px; }
  .search-trigger { min-width: 0; }
  .search-trigger kbd, .user-name, .hide-mobile { display: none; }
  .only-mobile { display: inline-flex !important; }
  .content { padding: 16px 16px 90px; }
  .grid-2, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .login-page { grid-template-columns: minmax(0, 1fr); }
  .login-side { display: none; }
  .toasts { bottom: 76px; }
  .form-footer { bottom: 60px; }

  /* Tablolar telefonda kart olur */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tfoot { display: block; }
  .table-cards tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table-cards tbody tr:last-child { border-bottom: 0; }
  .table-cards td { display: block; padding: 0; border: 0; text-align: left !important; min-width: 0; }
  .table-cards td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--ink-3); }
  .table-cards td.card-title { grid-column: 1 / -1; }
  .table-cards td.card-full { grid-column: 1 / -1; }
  .table-cards .row-actions { justify-content: flex-start; flex-wrap: wrap; }
  .table-cards .clip { max-width: 100%; white-space: normal; }
  .table-cards tfoot tr { background: var(--surface-2); }
  .table-cards tr[data-id] { position: relative; }
  .table-cards tr[data-id] td.card-title { padding-right: 40px; }
  .table-cards td.drag-cell { position: absolute; top: 8px; right: 8px; width: auto; }
  .drag-handle { width: 40px; height: 40px; background: var(--surface-2); }
  .table-cards tr.priority-3 > td:first-child, .table-cards tr.priority-2 > td:first-child { box-shadow: none; }
  .table-cards tr.priority-3 { box-shadow: inset 3px 0 0 var(--bad); }
  .table-cards tr.priority-2 { box-shadow: inset 3px 0 0 var(--warn); }
  .status-select, .table .status-select { max-width: 100%; min-width: 0; width: 100%; }

  .cal { display: block; }
  .cal-head, .cal-day.is-out, .cal-day.is-empty { display: none; }
  .cal-day { min-height: 0; border-right: 0; padding: 10px 14px; }
  .cal-chip { font-size: 13px; padding: 4px 2px; }

  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a, .bottom-nav button { display: grid; justify-items: center; gap: 1px; padding: 8px 2px 7px; font-size: 11px; color: var(--ink-3); background: none; border: 0; cursor: pointer; }
  .bottom-nav .is-active { color: var(--brand); font-weight: 600; }
}

@media print {
  .sidebar, .topbar, .bottom-nav, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  body { background: #fff; color: #000; }
  .content { padding: 0; max-width: none; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  .table th { background: #f2f2f2; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Teklif formu */
.quote-lines { table-layout: fixed; }
.quote-lines input { width: 100%; min-width: 0; }
.quote-lines td { vertical-align: middle; padding-top: 6px; padding-bottom: 6px; }
.quote-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.quote-sum { min-width: 260px; display: grid; gap: 6px; }
.quote-sum > div { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.quote-grand { border-top: 1px solid var(--border); padding-top: 6px; font-size: 16px; }
@media (max-width: 720px) {
  .quote-lines thead { display: none; }
  .quote-lines tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .quote-lines td { border: 0; padding: 0 4px; }
  .quote-lines td:nth-child(1) { display: none; }
  .quote-lines td:nth-child(2) { grid-column: 1 / -1; }
  .quote-lines td.q-total { align-self: center; }
  .quote-sum { min-width: 0; width: 100%; }
}

.logo-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.logo-slot { display: grid; gap: 8px; align-content: start; }
.logo-preview { width: 100%; height: 84px; border: 1px dashed var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #fff; overflow: hidden; }
.logo-preview img { max-width: 90%; max-height: 90%; object-fit: contain; }
