/* ==========================================================================
   Panel gorunumu.

   WEGS web uygulamasinin gorsel diline yakin: Montserrat, mor ana renk,
   golgeli kartlar, ikonlu dikey menu, acik ve koyu tema. Ana renkler
   brand.config.json'dan gelir (--primary, --success...); notr renkler
   (zemin, yuzey, metin, cizgi) temaya aittir ve markadan EZILMEZ.

   Tum dosyalar yereldir (vendor/): kurulum internete erisemese de calisir.
   ========================================================================== */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/vendor/fonts/montserrat-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/vendor/fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

:root {
  /* marka (brand.config.json ile degisir) */
  --primary: #7367f0;
  --primary-dark: #5e50ee;
  --accent: #28c76f;
  --danger: #ea5455;
  --warn: #ff9f43;
  --info: #00cfe8;

  /* acik tema */
  --bg: #f8f8f8;
  --surface: #ffffff;
  --surface-2: #f3f2f7;
  --text: #6e6b7b;
  --heading: #5e5873;
  --text-muted: #b9b9c3;
  --border: #ebe9f1;
  --input-border: #d8d6de;
  --shadow: 0 4px 24px 0 rgba(34, 41, 47, 0.1);
  --shadow-sm: 0 2px 8px 0 rgba(34, 41, 47, 0.08);
  --scrim: rgba(34, 41, 47, 0.5);

  --radius: 0.5rem;
  --radius-sm: 0.357rem;
  --sidebar-w: 260px;

  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #161d31;
  --surface: #283046;
  --surface-2: #343d55;
  --text: #b4b7bd;
  --heading: #d0d2d6;
  --text-muted: #676d7d;
  --border: #3b4253;
  --input-border: #404656;
  --shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.24);
  --shadow-sm: 0 2px 8px 0 rgba(0, 0, 0, 0.2);
  --scrim: rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, strong { color: var(--heading); }

.ico {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  vertical-align: middle;
}
.ico.sm { width: 15px; height: 15px; }
.ico.lg { width: 22px; height: 22px; }

/* ------------------------------------------------------------------ iskelet */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* Izgara ogeleri varsayilan olarak icerikten kucuk olamaz (min-width:auto);
   bu kural olmadan genis bir tablo tum sayfayi yana kaydirir. */
.app > * { min-width: 0; }

.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: 0 0 15px 0 rgba(34, 41, 47, 0.05);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px 14px;
  min-height: 66px;
}

.brand img {
  max-height: 44px;
  max-width: 150px;
  border-radius: 4px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  background: linear-gradient(118deg, var(--primary), color-mix(in srgb, var(--primary) 70%, transparent));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  font-size: 19px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.01rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 14px 14px;
}

.nav-group {
  padding: 18px 12px 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.nav-group:first-child { padding-top: 4px; }

.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  margin-bottom: 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  cursor: pointer;
  transition: padding 0.15s ease, background 0.15s ease;
}

.nav button:hover:not(.active) {
  background: var(--surface-2);
  padding-left: 18px;
}

.nav button.active {
  background: linear-gradient(118deg, var(--primary), color-mix(in srgb, var(--primary) 70%, transparent));
  color: #fff;
  box-shadow: 0 0 10px 1px color-mix(in srgb, var(--primary) 70%, transparent);
}

.sidebar-foot {
  padding: 12px 22px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.conn { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }

.dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--text-muted);
}
.dot.ok { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent); }

.content { min-width: 0; padding: 18px 28px 44px; }

/* Ust cubuk — WEGS'teki gibi icerigin ustunde yuzen kart. */
.navbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 12px;
  z-index: 15;
}

.navbar-title {
  display: none;
  font-weight: 600;
  color: var(--heading);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--heading);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }

.hamburger { display: none; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}
.user-chip .who { text-align: right; line-height: 1.2; }
.user-chip .who strong { display: block; font-size: 13.5px; font-weight: 600; }
.user-chip .who span { font-size: 11.5px; color: var(--text-muted); }

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
}
.avatar.ok { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.avatar.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.avatar.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.avatar.info { color: var(--info); background: color-mix(in srgb, var(--info) 14%, transparent); }

.scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--scrim);
  z-index: 40;
}

/* --------------------------------------------------------------- sayfa basi */

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.page-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  color: var(--heading);
}

.page-head .sub {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-muted);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.crumb button {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--primary);
  cursor: pointer;
}
.crumb button:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ denetim */

input, select, textarea {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-width: 0;
  max-width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

input[type="search"] { min-width: 230px; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--primary); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 3px 10px 0 rgba(34, 41, 47, 0.1);
}

input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  opacity: 0.85;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: box-shadow 0.2s ease, background 0.15s ease;
}

.btn:hover:not(:disabled) { box-shadow: 0 8px 25px -8px var(--primary); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn.ghost {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn.ghost:hover:not(:disabled) {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  box-shadow: none;
}

.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover:not(:disabled) { box-shadow: 0 8px 25px -8px var(--danger); }
.btn.ghost.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.ghost.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 8%, transparent); box-shadow: none; }
.btn.success { background: var(--accent); border-color: var(--accent); }
.btn.success:hover:not(:disabled) { box-shadow: 0 8px 25px -8px var(--accent); }

.seg {
  display: inline-flex;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.seg button {
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
  color: var(--primary);
  border-right: 1px solid var(--primary);
}
.seg button:last-child { border-right: 0; }
.seg button.active { background: var(--primary); color: #fff; }

/* Sekmeler (para birimi vb.) */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.tabs button:hover { color: var(--primary); }
.tabs button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 18px -4px color-mix(in srgb, var(--primary) 65%, transparent);
}

/* -------------------------------------------------------------------- kart */

.card {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 22px 12px;
  font-weight: 500;
  font-size: 16px;
  color: var(--heading);
}
.card-head .card-sub {
  display: block;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}
.card-head .muted { font-weight: 400; color: var(--text-muted); font-size: 12.5px; }

.card-body { padding: 14px 22px 22px; }

.card-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ------------------------------------------------------------- ozet kartlar */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.stat {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.stat > .stat-main { min-width: 0; flex: 1; }

.stat .label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.stat .value {
  margin-top: 4px;
  font-size: clamp(17px, 1.45vw, 22px);
  white-space: nowrap;
  font-weight: 600;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.stat .value.neg { color: var(--danger); }
.stat .value.pos { color: var(--accent); }

.stat .foot { margin-top: 4px; font-size: 12px; color: var(--text-muted); }

.stat .lines { margin-top: 8px; }
.stat .lines div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  padding: 2px 0;
  font-variant-numeric: tabular-nums;
}
.stat .lines span:first-child { color: var(--text-muted); }

/* Iki kolonlu dashboard yerlesimi */
.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}
.cols > * { min-width: 0; }
.cols > .card { margin-bottom: 0; }
.cols.wide-left { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* Dashboard: varlik karti icindeki kutucuklar */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 16px;
}
.tile {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  min-width: 0;
}
.tile .t-label { font-size: 12.5px; color: var(--text); font-weight: 500; }
.tile .t-sub { font-size: 11.5px; color: var(--text-muted); }
.tile .t-value {
  font-size: 17px;
  font-weight: 600;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tile .t-value.neg { color: var(--danger); }

.big-total { margin: 4px 0 18px; }
.big-total .k { font-size: 12px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-muted); }
.big-total .v { font-size: 30px; font-weight: 600; color: var(--heading); font-variant-numeric: tabular-nums; }

/* Yaslandirma cubugu */
.aging { display: flex; flex-direction: column; gap: 10px; }
.aging .row { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; font-size: 13px; }
.aging .bar { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.aging .bar > i { display: block; height: 100%; border-radius: 8px; background: var(--primary); }
.aging .amt { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--heading); white-space: nowrap; }

.chart { min-height: 280px; }
.chart-note { font-size: 12px; color: var(--text-muted); padding: 0 22px 16px; }

/* ------------------------------------------------------------------- tablo */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--heading);
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }

tbody tr.clickable { cursor: pointer; }

th.num, td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

td.mono { font-family: var(--mono); font-size: 12.5px; }
td.strong { font-weight: 600; color: var(--heading); }
td.wrap { min-width: 180px; }

.link {
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
}
.link:hover { text-decoration: underline; }

/* ------------------------------------------------------------------- rozet */

.badge {
  display: inline-block;
  padding: 3px 9px;
  margin-right: 4px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  color: var(--text);
}

.badge.ok { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.badge.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.badge.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.badge.api { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.badge.info { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }

/* ------------------------------------------------------------------- durum */

.state {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 38px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
}

.state.error {
  color: var(--text);
  background: color-mix(in srgb, var(--danger) 6%, transparent);
}
.state.error strong { color: var(--danger); }
.state .hint { font-size: 12.5px; color: var(--text-muted); }

.notice {
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  box-shadow: 0 6px 15px -7px color-mix(in srgb, var(--warn) 40%, transparent);
}

.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.pager span { margin-right: auto; }

.toast {
  position: fixed;
  right: 22px;
  top: 22px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--heading);
  border-left: 4px solid var(--primary);
  font-size: 13.5px;
  box-shadow: var(--shadow);
  z-index: 130;
  animation: toast-in 0.2s ease-out;
}
.toast.ok { border-left-color: var(--accent); }
.toast.err { border-left-color: var(--danger); }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } }

/* Tarih araligi sucgeci */
.daterange {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 0 10px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
}
.daterange input { border: 0; padding: 7px 4px; background: transparent; box-shadow: none; }
.daterange input:focus { box-shadow: none; }
.daterange select { border: 0; padding: 7px 4px; background: transparent; }

/* -------------------------------------------------------------------- form */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 14px 16px;
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field > span {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--heading);
}
.field > span.req::after { content: " *"; color: var(--danger); }
.field.full { grid-column: 1 / -1; }
.field .hint { font-size: 12px; color: var(--text-muted); }
.field.check { flex-direction: row; align-items: center; gap: 8px; padding-top: 22px; }
.field.check > span { font-size: 13.5px; color: var(--text); font-weight: 500; }
textarea { resize: vertical; }

/* ------------------------------------------------------------ pencere (modal) */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px 16px;
  overflow-y: auto;
  z-index: 90;
}
.modal {
  width: min(680px, 100%);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
  animation: modal-in 0.18s ease-out;
}
@keyframes modal-in { from { transform: translateY(-14px); opacity: 0; } }
.modal.narrow { width: min(460px, 100%); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 22px;
  background: var(--surface-2);
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal-head strong { font-weight: 600; font-size: 16px; }
.modal-head .btn.ghost { border: 0; color: var(--heading); }
.modal-body { padding: 20px 22px; }
.modal-text { font-size: 14px; line-height: 1.55; }
.modal-text p { margin: 0 0 8px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 20px;
}
.form-error {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  font-size: 13.5px;
}
.form-error:empty { display: none; }

/* Ozellik/deger listesi — detay ekranlari icin */
.props {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 16px 24px;
}
.props > div { min-width: 0; }
.props dt {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.props dd {
  margin: 3px 0 0;
  font-size: 14px;
  color: var(--heading);
  overflow-wrap: anywhere;
}
.props dd.num { font-variant-numeric: tabular-nums; }

.items-table input { width: 100%; }
.items-table .col-qty { width: 100px; }
.items-table .col-price, .items-table .col-tax, .items-table .col-disc { width: 110px; }
.items-table .col-del { width: 44px; }

.totals {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.totals .row {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  min-width: 280px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.totals .row.grand {
  font-weight: 600;
  font-size: 16px;
  color: var(--heading);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ------------------------------------------------- aranabilir secim (combo) */

.combo { position: relative; display: flex; min-width: 0; }
.combo-input { width: 100%; padding-right: 30px; text-overflow: ellipsis; cursor: pointer; }
.combo.open .combo-input { cursor: text; border-color: var(--primary); }
.combo-caret {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.combo.disabled .combo-caret { opacity: 0.4; cursor: not-allowed; }
.combo-list {
  position: fixed;
  z-index: 120;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: 0 5px 25px rgba(34, 41, 47, 0.2);
  padding: 6px;
}
.combo-opt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
}
.combo-opt small { font-size: 11.5px; color: var(--text-muted); }
.combo-opt.active { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.combo-opt.selected { font-weight: 600; }
.combo-opt.empty { color: var(--text-muted); font-style: italic; }
.combo-note { padding: 8px 10px; font-size: 13px; color: var(--text-muted); }
.items-table .combo { min-width: 220px; }

/* ApexCharts — temaya uyum */
.apexcharts-tooltip { box-shadow: var(--shadow) !important; }
.apexcharts-text, .apexcharts-legend-text { font-family: var(--font) !important; }

/* -------------------------------------------------------------------- mobil */

@media (max-width: 1100px) {
  .cols.wide-left { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }

  .hamburger { display: inline-flex; }
  .navbar-title { display: block; }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100%;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease-out;
  }

  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; }

  .content { padding: 12px 14px 40px; }
  .navbar { top: 8px; margin-bottom: 18px; }
  .user-chip .who, .conn span:last-child { display: none; }
  .page-head h1 { font-size: 19px; }
  input[type="search"] { min-width: 0; width: 100%; }
  .toolbar { width: 100%; }
  .toolbar > * { flex: 1 1 140px; }
  .stats, .cols { gap: 16px; }
}

/* Ust cubuk genel arama */
.global-search { flex: 1; max-width: 460px; align-items: center; }
.global-search > .ico { position: absolute; left: 4px; color: var(--text-muted); pointer-events: none; }
.global-search .combo-input {
  border: 0;
  background: transparent;
  padding-left: 30px;
  box-shadow: none;
}
.global-search .combo-caret { display: none; }
@media (max-width: 960px) {
  .global-search { max-width: none; }
  .global-search .combo-input::placeholder { color: transparent; }
}

/* ---------------------------------------------------------- cari karti */

.profile {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 22px;
}
.profile-main { display: flex; gap: 18px; align-items: flex-start; min-width: 0; flex: 1; }
.avatar.xl { width: 64px; height: 64px; flex: 0 0 64px; font-size: 22px; border-radius: 10px; }
.profile-id { min-width: 0; }
.profile-id h2 { margin: 0 0 8px; font-size: 20px; font-weight: 600; }
.profile-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.profile-contacts { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; }
.contact { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; }
a.contact:hover { color: var(--primary); }
.contact .ico { color: var(--text-muted); }
.tabs button.dim:not(.active) { opacity: 0.55; }

/* Kart icindeki sekme cubugu */
.tabbar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
}
.tabbar button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  padding: 16px 12px 14px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.tabbar button:hover { color: var(--primary); }
.tabbar button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.filterbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 22px 14px;
}
.muted { color: var(--text-muted); font-size: 13px; }
tr.muted-row td { color: var(--text-muted); background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
td.neg { color: var(--danger); }

/* Acilir islem menusu */
.menu { position: relative; display: inline-flex; }
.menu-list {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 240px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: 0 5px 25px rgba(34, 41, 47, 0.2);
  padding: 6px;
  z-index: 60;
}
.menu.open .menu-list { display: block; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  text-align: left;
  padding: 9px 12px;
  border-radius: 5px;
  cursor: pointer;
}
.menu-item:hover:not(:disabled) { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }
.menu-item:disabled { opacity: 0.5; cursor: not-allowed; }
.menu-item.danger { color: var(--danger); }
.aging.names .row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; cursor: pointer; }
.aging.names .row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Hareket fisi */
.receipt-amount { display: flex; align-items: center; gap: 14px; padding: 4px 0 18px; margin-bottom: 16px; border-bottom: 1px dashed var(--border); }
.receipt-amount .v { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.receipt-amount .v.pos { color: var(--accent); }
.receipt-amount .v.neg { color: var(--danger); }

/* ------------------------------------------------- belge (fatura) gorunumu */

.doc-layout { align-items: start; }
.doc { padding: 0; }
.doc-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap;
  padding: 26px 28px 20px; border-bottom: 1px solid var(--border);
}
.doc-brand img { max-height: 46px; display: block; margin-bottom: 6px; }
.doc-no { text-align: right; }
.doc-kind { font-size: 12px; font-weight: 600; letter-spacing: 0.8px; color: var(--primary); }
.doc-num { font-size: 22px; font-weight: 600; color: var(--heading); margin: 2px 0 4px; }
.doc-parties {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 20px;
  padding: 20px 28px; border-bottom: 1px solid var(--border); font-size: 13.5px; line-height: 1.65;
}
.doc-label { font-size: 11px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.doc-party { display: block; font-size: 15px; font-weight: 600; color: var(--heading); margin-bottom: 2px; }
a.doc-party { color: var(--primary); }
table.kv { width: auto; font-size: 13px; }
table.kv td { padding: 2px 16px 2px 0; border: 0; }
table.kv td:first-child { color: var(--text-muted); white-space: nowrap; }
table.kv tr:hover td { background: none; }
.doc-items tbody td { vertical-align: top; }
.doc-items .muted.mono { font-family: var(--mono); font-size: 11.5px; }
.doc-foot {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 20px 28px 26px; border-top: 1px solid var(--border);
}
.doc-words { max-width: 380px; font-size: 13px; }
.doc-note { margin-top: 14px; }
.doc-totals { min-width: 300px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.doc-totals .row { display: flex; justify-content: space-between; gap: 20px; }
.doc-totals .row.grand { font-size: 18px; font-weight: 600; color: var(--heading); border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }

.pay-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.progress { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; margin-bottom: 14px; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 8px; }
.pay-rows { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.pay-rows > div { display: flex; justify-content: space-between; gap: 10px; }
.pay-rows strong { font-variant-numeric: tabular-nums; }
strong.pos { color: var(--accent); }
strong.neg { color: var(--danger); }
.side-actions { display: flex; flex-direction: column; gap: 10px; }
.side-actions .btn { width: 100%; }
.doc-layout .cols, .doc-layout > div > .card { margin-bottom: 24px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 16px 12px; font-size: 13px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -26px; top: 3px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}
.timeline li.ok::before { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.timeline li.info::before { background: var(--info); box-shadow: 0 0 0 4px color-mix(in srgb, var(--info) 18%, transparent); }
.tl-head { display: flex; justify-content: space-between; gap: 10px; }

/* Toplu aktarim */
.import-log { max-height: 320px; overflow-y: auto; margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.import-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto 110px; gap: 10px; align-items: center; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.import-row > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-row .badge { justify-self: end; }
.import-err { grid-column: 1 / -1; color: var(--danger); font-size: 12px; }
.import-done { padding: 10px 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-size: 13.5px; }
.modal-body .progress { margin-top: 16px; }

/* ------------------------------------------------------------- raporlar */

.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 24px; }
.report-tile { display: flex; align-items: center; gap: 16px; padding: 22px; margin: 0; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.report-tile:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(34, 41, 47, 0.16); }
.report-tile h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.report-tile p { margin: 0; }
.report-tile > div { flex: 1; min-width: 0; }
.report-tile > .ico { color: var(--text-muted); }
.report-period { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -6px 0 18px; font-size: 13px; color: var(--heading); }
.bar.thin { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: 5px 0 2px; max-width: 320px; }
.bar.thin > i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
tr.total-row td { font-weight: 600; color: var(--heading); background: var(--surface-2); }
td.warn-text { color: var(--warn); }

@media print {
  .sidebar, .navbar, #page-actions, .scrim, .toast, .crumb { display: none !important; }
  .app { display: block; }
  .content { padding: 0; }
  body, :root { background: #fff !important; }
  .card, .stat { box-shadow: none !important; border: 1px solid #ddd; break-inside: avoid; }
  .cols, .cols.wide-left { grid-template-columns: 1fr 1fr; }
}
.col-check { width: 36px; }

/* ------------------------------------------------- muhasebe (onizleme) */

.preview-note {
  display: flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 9px 14px;
  border-radius: var(--radius-sm); font-size: 12.5px; color: var(--primary);
  background: color-mix(in srgb, var(--primary) 9%, transparent);
}
.notice.info-note { color: var(--info); background: color-mix(in srgb, var(--info) 10%, transparent); box-shadow: none; }
.code-input { width: 140px; font-family: var(--mono); font-size: 13px; padding: 6px 9px; }
.code-input.dirty { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }

.acc-tree { padding: 4px 14px 18px; }
.acc-row {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto 160px; gap: 12px; align-items: center;
  padding: 8px 10px; border-radius: 6px; font-size: 13.5px;
}
.acc-row.has-kids { cursor: pointer; }
.acc-row:hover { background: var(--surface-2); }
.acc-row.d0 { font-weight: 700; color: var(--heading); background: color-mix(in srgb, var(--primary) 6%, transparent); margin-top: 8px; }
.acc-row.d1 { padding-left: 28px; font-weight: 600; color: var(--heading); }
.acc-row.d2 { padding-left: 48px; font-weight: 500; }
.acc-row.d3 { padding-left: 68px; font-size: 13px; }
.acc-row.sub { color: var(--text); }
.acc-row.more { display: block; color: var(--text-muted); font-style: italic; font-size: 12.5px; }
.acc-node.closed > .acc-children { display: none; }
.acc-code { font-family: var(--mono); font-size: 12.5px; color: var(--primary); }
.acc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-bal { text-align: right; font-variant-numeric: tabular-nums; }
.acc-mini { display: flex; flex-direction: column; gap: 10px; }
.acc-mini-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13.5px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.acc-mini-row strong { font-variant-numeric: tabular-nums; }
.deadline-bar { height: 5px; width: 120px; border-radius: 5px; background: var(--surface-2); overflow: hidden; margin: 4px 0 2px; }
.deadline-bar > i { display: block; height: 100%; border-radius: 5px; }
table.mizan td, table.mizan th { padding: 9px 16px; }
table.mizan tr.mz-main td { background: color-mix(in srgb, var(--primary) 6%, transparent); font-weight: 600; color: var(--heading); }
table.mizan tr.mz-sub td:first-child { padding-left: 34px; }

/* Gelir tablosu */
table.income td { padding: 9px 16px; }
table.income .is-letter { width: 34px; font-weight: 700; color: var(--primary); }
table.income tr.is-h td { font-weight: 600; color: var(--heading); background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
table.income tr.is-item td:nth-child(2) { padding-left: 34px; }
table.income tr.is-t td { font-weight: 700; color: var(--heading); border-top: 2px solid var(--border); }
table.income tr.is-grand td { background: color-mix(in srgb, var(--primary) 8%, transparent); font-size: 15px; }

/* Beyanname taslagi */
.decl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 18px; padding: 4px 22px 22px; }
.decl-sec { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.decl-title { padding: 10px 14px; font-size: 12px; font-weight: 700; letter-spacing: 0.4px; color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, transparent); }
.decl-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; font-size: 13.5px; border-top: 1px dashed var(--border); font-variant-numeric: tabular-nums; }
.decl-row.strong { font-weight: 600; color: var(--heading); }

/* Logo aktarimi */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 34px 20px; margin-bottom: 24px; border: 2px dashed color-mix(in srgb, var(--primary) 45%, var(--border));
  border-radius: var(--radius); background: var(--surface); color: var(--primary); cursor: pointer; transition: background 0.15s ease;
}
.dropzone.over, .dropzone:hover { background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.dropzone strong { color: var(--heading); }
table.kdv391 td, table.kdv391 th { padding: 8px 12px; font-size: 12.5px; white-space: nowrap; }
table.kdv391 td.wrap { white-space: normal; min-width: 200px; }
table.kdv391 tr.ik-row td { background: color-mix(in srgb, var(--info) 6%, transparent); }
