/* BEED CRM – arayüz stilleri (derleme adımı yok) */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-ext-wght-normal.341687eeeb6a.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: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-wght-normal.7660bd9909fb.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 {
  --brand: #075955;
  --brand-700: #054541;
  --brand-600: #06504c;
  --brand-100: #d7ecea;
  --brand-50: #eef7f6;
  --accent: #f5ba14;
  --accent-50: #fff7df;
  --ink: #0f2d2a;
  --ink-2: #33504c;
  --muted: #647a77;
  --line: #e2e9e8;
  --line-2: #eef2f1;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --green: #11805a;
  --green-50: #e7f6ef;
  --amber: #a86a00;
  --amber-50: #fff4d9;
  --red: #c2352b;
  --red-50: #fdecea;
  --gray-50: #f1f4f3;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 45, 42, .05), 0 1px 3px rgba(15, 45, 42, .06);
  --shadow-lg: 0 12px 32px rgba(15, 45, 42, .16);
  --sidebar-w: 256px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 64px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; font-weight: 750; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
.icon { flex: none; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--ink); padding: 8px 14px; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------------- Kenar menüsü */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar-w);
  background: var(--ink);
  color: #cfe0dd;
  display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain;
  transition: width .18s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  height: var(--topbar-h); padding: 0 18px; flex: none;
  color: #fff; font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.sidebar-brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: var(--ink); font-weight: 800; font-size: 1rem;
}
.brand-text small { display: block; font-size: .7rem; font-weight: 600; color: #8fb0ab; letter-spacing: .02em; }
.nav { padding: 10px 10px 24px; }
.nav-group { margin-top: 14px; }
.nav-title {
  padding: 0 12px 6px; font-size: .68rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: #7d9a96; white-space: nowrap;
}
.nav a {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin: 1px 0; border-radius: 10px;
  color: #cfe0dd; font-weight: 550; font-size: .92rem; white-space: nowrap;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.active { background: var(--brand); color: #fff; }
.nav a.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--accent);
}
.nav a .icon { opacity: .9; }

html.sb-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
html.sb-collapsed .sidebar .brand-text,
html.sb-collapsed .sidebar .nav-label,
html.sb-collapsed .sidebar .nav-title { display: none; }
html.sb-collapsed .sidebar .nav-group { margin-top: 6px; border-top: 1px solid rgba(255,255,255,.06); padding-top: 6px; }
html.sb-collapsed .sidebar .nav a { justify-content: center; padding: 10px; }
html.sb-collapsed .shell { margin-left: var(--sidebar-w-collapsed); }

.backdrop {
  position: fixed; inset: 0; z-index: 35; background: rgba(15, 45, 42, .45);
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}

/* ---------------------------------------------------------------- Kabuk + üst çubuk */
.shell { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .18s ease; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--gray-50); }
.menu-btn { display: none; }
.search {
  flex: 1; max-width: 520px; position: relative;
}
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 12px 0 40px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  font: inherit; color: var(--ink);
}
.search input:focus { background: #fff; border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-100); }
.topbar-spacer { flex: 1; }
.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font: inherit; color: var(--ink);
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem;
}
.user-name { font-weight: 600; font-size: .9rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; z-index: 50;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
}
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px;
  color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; text-align: left;
}
.dropdown a:hover, .dropdown button:hover { background: var(--gray-50); text-decoration: none; }
.dropdown .dd-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.dropdown form { margin: 0; }
.dropdown .dd-label { padding: 8px 10px 4px; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dropdown .dd-sep { height: 1px; background: var(--line-2); margin: 6px 0; }
.dropdown button.current { color: var(--brand); font-weight: 700; }
.org-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 260px; height: 36px; padding: 0 12px;
  border-radius: 999px; background: var(--brand-50); color: var(--brand-700); font-weight: 650; font-size: .85rem;
}
.org-chip:hover { background: var(--brand-100); text-decoration: none; }
.org-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-switch { position: relative; margin-left: auto; }
.org-btn {
  display: inline-flex; align-items: center; gap: 8px; max-width: 280px; height: 42px; padding: 0 10px 0 5px;
  border: 1px solid var(--brand-100); border-radius: 12px; background: var(--brand-50); color: var(--brand-700);
  font: inherit; cursor: pointer; text-align: left;
}
.org-btn:hover, .org-btn[aria-expanded="true"] { border-color: var(--brand); background: #fff; }
.org-btn-name { display: flex; flex-direction: column; min-width: 0; font-weight: 700; font-size: .86rem; line-height: 1.15; }
.org-btn-name small { font-size: .66rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.org-btn-name, .org-opt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-initial { width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; }
.org-logo { width: 32px; height: 32px; flex: none; border-radius: 8px; object-fit: contain; background: #fff; }
.org-initial.sm, .org-logo.sm { width: 26px; height: 26px; font-size: .8rem; border-radius: 7px; }
.org-dd { width: 300px; max-width: calc(100vw - 24px); }
.org-dd .org-filter { margin: 4px 0 6px; min-height: 36px; }
.org-options { list-style: none; margin: 0; padding: 0; max-height: min(360px, 60vh); overflow-y: auto; }
.org-options button { display: flex; align-items: center; gap: 10px; }
.org-options .org-opt-name { flex: 1; min-width: 0; }
.org-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.org-card { width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; padding: 18px; display: flex; gap: 14px; align-items: center; }
.org-card:hover { border-color: var(--brand); }
.org-card.current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.setup-link { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.setup-link input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inline-form .input { min-height: 34px; padding: 4px 30px 4px 10px; width: auto; }

.main { padding: 24px; flex: 1; width: 100%; max-width: 1480px; }

/* ---------------------------------------------------------------- Sayfa başlığı */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { margin-top: 4px; color: var(--muted); font-size: .9rem; }
.breadcrumb { display: flex; gap: 6px; align-items: center; font-size: .82rem; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Düğmeler */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-weight: 650; font-size: .9rem; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--gray-50); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-700); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn-accent:hover { background: #e6ad0d; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #a82c23; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .85rem; }

/* ---------------------------------------------------------------- Kartlar */
.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: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.card-body { padding: 18px; }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-dash { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.kpis { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.kpi { padding: 18px; position: relative; overflow: hidden; }
.kpi-label { color: var(--muted); font-size: .82rem; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.kpi-label .dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.kpi-value { font-size: 1.5rem; font-weight: 800; margin-top: 10px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-foot { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.kpi.accent .dot { background: var(--accent-50); color: var(--amber); }
.kpi.red .dot { background: var(--red-50); color: var(--red); }

/* ---------------------------------------------------------------- Tablolar */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table th {
  background: #f8faf9; color: var(--muted); font-weight: 700; font-size: .75rem; letter-spacing: .04em;
  text-transform: uppercase; white-space: nowrap; position: sticky; top: 0;
}
.table th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.table th a:hover { color: var(--ink); text-decoration: none; }
.table th.sorted { color: var(--brand); }
.table th .arrow { font-size: .7rem; }
.table th.num, .table td.num { text-align: right; }
.table th.num a { flex-direction: row-reverse; }
.table tbody tr:hover { background: #f8fbfa; }
.table td a.row-link { font-weight: 650; }
.table tfoot td { font-weight: 800; background: #f8faf9; border-top: 2px solid var(--line); border-bottom: 0; }
.table .clip { display: inline-block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.table .empty { text-align: center; color: var(--muted); padding: 36px 14px; }
.table.compact th, .table.compact td { padding: 8px 12px; }
.table tr.inactive td { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(100,122,119,.4); }

.bal { font-weight: 700; }
.bal-pos { color: var(--red); }
.bal-neg { color: var(--green); }
.bal-zero { color: var(--muted); font-weight: 500; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-green { background: var(--green-50); color: var(--green); }
.badge-amber { background: var(--amber-50); color: var(--amber); }
.badge-red { background: var(--red-50); color: var(--red); }
.badge-gray { background: var(--gray-50); color: var(--muted); }

/* ---------------------------------------------------------------- Filtre çubuğu */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.toolbar .field { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.toolbar .field.grow { flex: 1; min-width: 220px; }
.toolbar label { font-size: .75rem; font-weight: 700; color: var(--muted); }
.toolbar .daterange { display: flex; gap: 6px; }
.toolbar .daterange .input { width: 150px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 16px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); font-size: .82rem; font-weight: 650; }
.chip a { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: inherit; }
.chip a:hover { background: var(--brand-100); }
.list-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }

/* ---------------------------------------------------------------- Sayfalama */
.pagination { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: .85rem;
}
.pagination a:hover { background: var(--gray-50); text-decoration: none; }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .disabled { color: #b5c3c1; }

/* ---------------------------------------------------------------- Formlar */
.input {
  width: 100%; min-height: 40px; padding: 8px 12px;
  border: 1px solid #d3dcdb; border-radius: var(--radius-sm); background: #fff;
  font: inherit; color: var(--ink);
}
.input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-100); }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23647a77' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.textarea { min-height: 88px; resize: vertical; }
.checkbox { width: 18px; height: 18px; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field > label { font-size: .85rem; font-weight: 650; color: var(--ink-2); }
.form-field.check { flex-direction: row; align-items: center; gap: 10px; }
.form-field .help { font-size: .78rem; color: var(--muted); }
.form-field .errors, .errorlist { color: var(--red); font-size: .82rem; margin: 0; padding: 0; list-style: none; }
.form-field.has-error .input { border-color: var(--red); }
.req { color: var(--red); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 18px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }

/* Dosya / logo yükleme */
.upload { display: flex; gap: 14px; align-items: center; padding: 10px; border: 1px dashed #c9d4d2; border-radius: 12px; background: #fbfcfc; }
.upload-thumb { width: 72px; height: 72px; flex: none; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; overflow: hidden; }
.upload-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.upload-thumb.empty { color: var(--muted); font-size: 1.6rem; background: var(--gray-50); }
.upload-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.upload-btn { position: relative; overflow: hidden; }
.upload-btn:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.upload-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.upload-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-clear { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--ink-2); cursor: pointer; }
.upload.is-cleared .upload-thumb img { opacity: .3; }
.ms-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 3px 0; }
.ms-row + .ms-row { border-top: 1px dashed var(--line-2); }
.ms-org { font-weight: 650; min-width: 140px; }

/* Arama kutusu (autocomplete) */
.ac { position: relative; }
.ac-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; max-height: 300px; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
}
.ac-list li { padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.ac-list li small { display: block; color: var(--muted); font-size: .76rem; }
.ac-list li[aria-selected="true"], .ac-list li:hover { background: var(--brand-50); }

/* Belge kalemleri */
.lines { padding: 0 18px 18px; }
.line-head, .line-row {
  display: grid; gap: 8px; align-items: center;
  grid-template-columns: minmax(200px, 3fr) 90px 120px 90px 80px 120px 44px;
}
.lines.with-mf .line-head, .lines.with-mf .line-row { grid-template-columns: minmax(200px, 3fr) 80px 80px 115px 85px 75px 115px 44px; }
.line-head { padding: 10px 0 6px; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line-2); }
.line-row { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.line-row .cell-label { display: none; }
.line-row .line-total { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.line-row.deleted { opacity: .4; }
.line-row.deleted .line-total { text-decoration: line-through; }
.line-row .errors { grid-column: 1 / -1; }
.input.num { text-align: right; }
.lines-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.sum-box { min-width: 280px; margin-left: auto; }
.sum-box div { display: flex; justify-content: space-between; gap: 24px; padding: 5px 0; font-variant-numeric: tabular-nums; }
.sum-box .grand { border-top: 2px solid var(--line); margin-top: 6px; padding-top: 10px; font-size: 1.1rem; font-weight: 800; }

/* ---------------------------------------------------------------- Detay */
.dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 0; }
.dl > div { padding: 10px 0; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; }
.dl > div.full { grid-column: 1 / -1; }
.dl dt { color: var(--muted); font-size: .85rem; font-weight: 600; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.hero { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 20px; }
.hero-title { display: flex; gap: 14px; align-items: center; min-width: 0; }
.hero-icon { width: 48px; height: 48px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.hero h1 { overflow-wrap: anywhere; }
.hero-meta { display: flex; gap: 8px 16px; flex-wrap: wrap; margin-top: 6px; color: var(--muted); font-size: .88rem; align-items: center; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); border-top: 1px solid var(--line-2); }
.stat { padding: 14px 20px; border-right: 1px solid var(--line-2); }
.stat:last-child { border-right: 0; }
.stat .label { font-size: .76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 1.15rem; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 18px 0 16px; scrollbar-width: thin; }
.tabs a {
  padding: 10px 14px; color: var(--muted); font-weight: 650; font-size: .9rem; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .count { background: var(--gray-50); color: var(--muted); border-radius: 999px; padding: 0 7px; font-size: .72rem; }
.tabs a.active .count { background: var(--brand-50); color: var(--brand); }

/* ---------------------------------------------------------------- Mesajlar */
.messages { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.messages li { padding: 12px 16px; border-radius: 10px; font-weight: 600; font-size: .9rem; border: 1px solid; }
.messages .success { background: var(--green-50); color: var(--green); border-color: #bfe6d3; }
.messages .error { background: var(--red-50); color: var(--red); border-color: #f5c6c2; }
.messages .info, .messages .warning { background: var(--accent-50); color: var(--amber); border-color: #f5e0a6; }
.note { padding: 10px 14px; border-radius: 10px; background: var(--brand-50); color: var(--brand-700); font-size: .85rem; margin-bottom: 14px; }

/* ---------------------------------------------------------------- Genel bakış */
.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar-sales { fill: var(--brand); }
.chart .bar-coll { fill: var(--accent); }
.chart g.month:hover rect { opacity: .85; }
.legend { display: flex; gap: 16px; font-size: .82rem; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 18px; border-bottom: 1px solid var(--line-2); }
.rank li:last-child { border-bottom: 0; }
.rank .pos { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--gray-50); color: var(--muted); font-size: .75rem; font-weight: 800; }
.rank li:nth-child(-n+3) .pos { background: var(--accent-50); color: var(--amber); }
.rank .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .bar { height: 4px; border-radius: 4px; background: var(--brand-100); margin-top: 4px; overflow: hidden; }
.rank .bar span { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: flex; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.agenda li:last-child { border-bottom: 0; }
.agenda .when { flex: none; width: 54px; text-align: center; background: var(--brand-50); color: var(--brand); border-radius: 10px; padding: 4px 0; font-weight: 800; line-height: 1.1; }
.agenda .when small { display: block; font-size: .66rem; font-weight: 700; text-transform: uppercase; }
.agenda .when.late { background: var(--red-50); color: var(--red); }
.agenda .what { min-width: 0; flex: 1; }
.agenda .what a { font-weight: 650; }
.empty-state { padding: 28px 18px; text-align: center; color: var(--muted); font-size: .9rem; }

/* ---------------------------------------------------------------- Takvim */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head { padding: 10px; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; text-align: center; border-bottom: 1px solid var(--line); }
.cal-day { min-height: 118px; padding: 6px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.out { background: #fafcfb; }
.cal-day.out .d { color: #b5c3c1; }
.cal-day .d { font-size: .8rem; font-weight: 700; color: var(--ink-2); display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; }
.cal-day.today .d { background: var(--brand); color: #fff; }
.cal-item { display: block; font-size: .76rem; padding: 3px 6px; border-radius: 6px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--brand-50); color: var(--brand-700); }
.cal-item.task { background: var(--accent-50); color: var(--amber); }
.cal-item.call { background: #eef0fb; color: #3b4aa8; }
.cal-item.receipt { background: var(--red-50); color: var(--red); }

.cal-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.cal-legend .cal-item { display: inline-block; font-size: .76rem; height: auto; padding: 3px 8px; margin: 0; }

/* ---------------------------------------------------------------- Giriş */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.auth-side {
  background: radial-gradient(circle at 20% 20%, rgba(245, 186, 20, .18), transparent 40%), linear-gradient(160deg, var(--brand) 0%, var(--ink) 100%);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side h2 { font-size: 2rem; font-weight: 800; line-height: 1.15; max-width: 420px; letter-spacing: -.02em; }
.auth-side p { color: #cfe0dd; max-width: 420px; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h1 { margin-bottom: 6px; }
.auth-box form { display: grid; gap: 16px; margin-top: 24px; }
.auth-box .btn { width: 100%; min-height: 46px; }

/* ---------------------------------------------------------------- Arama sonuçları */
.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line-2); align-items: center; }
.result-list li:last-child { border-bottom: 0; }

/* ---------------------------------------------------------------- Duyarlı */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-dash { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; width: min(86vw, 300px); box-shadow: var(--shadow-lg); visibility: hidden; }
  html.sb-collapsed .sidebar { width: min(86vw, 300px); }
  html.sb-collapsed .sidebar .brand-text, html.sb-collapsed .sidebar .nav-label, html.sb-collapsed .sidebar .nav-title { display: revert; }
  html.sb-collapsed .sidebar .nav a { justify-content: flex-start; padding: 9px 12px; }
  body.nav-open .sidebar { transform: none; visibility: visible; }
  body.nav-open .backdrop { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .shell, html.sb-collapsed .shell { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .collapse-btn { display: none; }
  .topbar { padding: 0 12px; gap: 8px; }
  .user-name { display: none; }
  .org-chip { max-width: 44vw; padding: 0 10px; }
  .search { min-width: 0; }
  .search input { min-width: 0; }
  .topbar-spacer { display: none; }
  .user-btn { padding: 3px; }
  .user-btn > .icon { display: none; }
  .main { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .dl { grid-template-columns: minmax(0, 1fr); }
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 760px) {
  .table-wrap > .table { min-width: 640px; }
  .line-head { display: none; }
  .line-row, .lines.with-mf .line-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px;
    padding: 12px; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px;
  }
  .line-row .cell-product { grid-column: 1 / -1; }
  .line-row .cell-label { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
  .line-row .cell-total { grid-column: 1 / 2; align-self: end; }
  .line-row .line-total { text-align: left; font-size: 1rem; }
  .line-row .cell-del { justify-self: end; align-self: end; }
  .cal-day { min-height: 70px; padding: 3px; }
  .cal-item { font-size: 0; padding: 0; height: 6px; margin-top: 2px; }
  .dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .sum-box { min-width: 0; width: 100%; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpi-value { font-size: 1.3rem; }
  .toolbar .field, .toolbar .field.grow { min-width: 0; flex: 1 1 100%; }
  .toolbar .daterange .input { width: auto; flex: 1; min-width: 0; }
  .page-head { align-items: stretch; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  h1 { font-size: 1.25rem; }
  .search input { font-size: 16px; }
  .org-btn { padding: 0 6px 0 4px; gap: 4px; }
  .org-btn-name { display: none; }
  .org-dd { position: fixed; top: calc(var(--topbar-h) - 4px); right: 12px; left: 12px; width: auto; max-width: none; }
  .input { font-size: 16px; }
}

/* ---------------------------------------------------------------- Yazdırma */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 11.5pt; }
  .sidebar, .topbar, .backdrop, .no-print, .actions, .tabs, .toolbar, .pagination, .form-actions, .messages { display: none !important; }
  .shell { margin: 0 !important; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  .table th { background: #f1f1f1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; }
}
