:root {
  color-scheme: light;
  --ink: #17211c;
  --muted: #66756e;
  --paper: #eef2ef;
  --card: #ffffff;
  --line: #e3eae6;
  --sidebar: #12211e;
  --sidebar-text: #d5e4de;
  --sidebar-dim: #8aa399;
  --accent: #1b7f6e;
  --accent-dark: #146256;
  --danger-bg: #fdeceb;
  --danger: #8d342f;
  --ok-bg: #e7f6ee;
  --ok: #1d6b42;
  --shadow: 0 10px 30px rgba(18, 33, 30, 0.06);
  font-family: "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
}

a { color: inherit; }

h1, h2, h3 {
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

h1 { font-size: 1.85rem; }
h2 { font-size: 1.05rem; }

p { line-height: 1.5; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font-size: 0.95rem;
}

.brand-light { color: white; }
.brand-light .brand-mark { background: rgba(255, 255, 255, 0.14); }

.auth {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 100vh;
}

.auth-intro {
  padding: 10vh 8vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(900px 420px at 10% 0%, rgba(27, 127, 110, 0.45), transparent 60%),
    var(--sidebar);
  color: #e7f3ef;
}

.auth-intro h1 {
  max-width: 11ch;
  margin-top: 2rem;
  font-size: 3.4rem;
  line-height: 1.05;
  color: white;
}

.auth-intro p:last-child {
  max-width: 36ch;
  color: var(--sidebar-text);
}

.auth-card {
  margin: auto;
  width: min(440px, calc(100% - 3rem));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 1.8rem 1.7rem 1.6rem;
}

.auth-card h2 { font-size: 1.45rem; margin-bottom: 0.2rem; }

label {
  display: block;
  margin: 0.95rem 0 0.35rem;
  color: #3e5149;
  font-size: 0.86rem;
  font-weight: 600;
}

input, textarea, select {
  width: 100%;
  border: 1px solid #d5dfda;
  background: #fbfcfb;
  color: var(--ink);
  border-radius: 12px;
  padding: 0.78rem 0.85rem;
  font: inherit;
}

textarea { resize: vertical; }

select {
  appearance: none;
  padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, #66756e 50%), linear-gradient(135deg, #66756e 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 2px), calc(100% - 10px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(27, 127, 110, 0.28);
  outline-offset: 2px;
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font: inherit;
  font-weight: 650;
  padding: 0.72rem 1rem;
  cursor: pointer;
}

form > button { margin-top: 1.1rem; }
button:hover, .button:hover { background: var(--accent-dark); }

.button.secondary, button.secondary, .ghost {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

.ghost { margin: 0; padding: 0.45rem 0.75rem; font-weight: 600; }
.ghost:hover { background: #f3f6f4; }

.hint, .muted { color: var(--muted); font-size: 0.92rem; }
.hint { margin: 0.35rem 0 0; }
.leash { margin: 0 0 1rem; }

.alert, .notice {
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  margin: 0.6rem 0 0.2rem;
}

.alert { background: var(--danger-bg); color: var(--danger); }
.notice { background: var(--ok-bg); color: var(--ok); }

.shell { display: grid; grid-template-columns: 268px 1fr; min-height: 100vh; }

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.15rem 0.9rem 1rem;
  background: var(--sidebar);
  color: var(--sidebar-text);
}

.side .brand { color: white; padding: 0.2rem 0.45rem 0.8rem; }

.side-label {
  margin: 0.4rem 0.7rem 0.35rem;
  color: var(--sidebar-dim);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  gap: 0.2rem;
  align-content: start;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 42px;
  padding: 0.45rem 0.7rem;
  border-radius: 12px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 600;
}

.nav-item svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.nav-item.current {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

a.nav-item:hover { background: rgba(255, 255, 255, 0.06); }

.nav-item.waiting { color: var(--sidebar-dim); }
.nav-item em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #c9ddd6;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
}

.side-foot {
  margin-top: auto;
  padding: 0.85rem 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: white;
  font-weight: 650;
}

.workspace { min-width: 0; }

.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0.85rem 1.4rem;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
  backdrop-filter: blur(10px);
}

.who { display: flex; gap: 0.7rem; align-items: center; }
.who-name { font-weight: 650; }

.avatar {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e5f3ef;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 750;
  flex: none;
}

.page {
  width: min(1280px, calc(100% - 2.4rem));
  margin: 0 auto;
  padding: 1.4rem 0 3rem;
}

.page-head, .split, .grid-2, .facts {
  display: grid;
  gap: 1rem;
}

.page-head {
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-bottom: 1rem;
}

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.filters input { width: min(280px, 100%); background: white; }
.filters select { width: auto; min-width: 10rem; background: white; }
.filters button { margin-top: 0; }

.eyebrow { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.85rem; }
.eyebrow a { color: var(--accent-dark); font-weight: 700; text-decoration: none; }

.badge {
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  background: #e7f3ef;
  color: var(--accent-dark);
}
.badge.banka, .badge.alis, .badge.tedarikci { background: #eef1f8; color: #31456e; }
.badge.taslak, .badge.hizmet { background: #f6efe4; color: #6a4b28; }
.badge.iptal, .badge.pasif { background: #f3f1ee; color: #6d655c; }
.badge.odendi, .badge.kabul { background: #e7f3ef; color: var(--accent-dark); }
.badge.odenecek, .badge.acik { background: #eef1f8; color: #31456e; }
.badge.geciken, .badge.red { background: #fbeceb; color: #9a3b32; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.8rem; }
.tab {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
}
.tab.current { background: var(--accent-dark); border-color: var(--accent-dark); color: white; }
.ledger tfoot td { font-weight: 750; background: #f7faf8; border-top: 1px solid var(--line); border-bottom: 0; }
.ledger tfoot .num { text-align: right; }
.ledger small { font-weight: 400; }
.document { margin-bottom: 1rem; }
.doc-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 0.8rem; }
.doc-head h2 { margin: 0; }
.doc-meta { display: grid; gap: 0.25rem; margin: 0; }
.doc-meta div { display: flex; gap: 0.6rem; justify-content: space-between; }
.doc-meta dt { color: var(--muted); font-size: 0.82rem; }
.doc-meta dd { margin: 0; font-weight: 700; }
.doc-to { padding: 0.8rem 0; }
.doc-to p { margin: 0.15rem 0; }
.badge-pair { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.report-grid { display: grid; gap: 1rem; }
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.8rem; margin-bottom: 1rem; }
.report-card { display: block; text-decoration: none; color: inherit; }
.report-card small { color: var(--muted); }
.report-card strong { display: block; margin-top: 0.3rem; }
.check { display: flex; align-items: center; gap: 0.5rem; margin: 0.7rem 0; }
.check input { width: auto; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; margin-bottom: 1rem; }
.stat {
  display: grid;
  gap: 0.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.stat span { color: var(--muted); font-size: 0.82rem; }
.stat strong { font-size: 1.2rem; letter-spacing: -0.02em; }
.actions form, .moves form { display: flex; }
.actions button, .moves button { margin-top: 0; }
.leash a, .hint a { color: var(--accent-dark); font-weight: 700; }

.actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 0 0 1rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.stack { display: grid; gap: 1rem; }
.composer { max-width: 760px; }
.popup { display: none; position: fixed; inset: 0; z-index: 30; }
.popup:target, .popup.show { display: block; }
.popup-backdrop { position: absolute; inset: 0; background: rgba(18, 33, 30, 0.48); }
.popup-card {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 2rem));
  max-height: calc(100vh - 2.4rem);
  margin: 1.2rem auto;
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(18, 33, 30, 0.28);
}
.popup-card .panel { border: 0; box-shadow: none; margin: 0; }
.popup-card h2 { padding-right: 4.2rem; }
.popup-dismiss {
  position: absolute;
  top: 0.95rem;
  right: 1rem;
  z-index: 2;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}
.command { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.command .actions, .command .stock-figure { margin: 0; }
.sheet {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: auto;
}
.ledger { width: 100%; border-collapse: collapse; min-width: 640px; }
.ledger th, .ledger td { text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ledger th { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; background: #f7faf8; }
.ledger tr:last-child td { border-bottom: 0; }
.ledger tbody tr:hover td { background: #f4faf8; }
.ledger a { color: var(--ink); font-weight: 650; text-decoration: none; }
.ledger a:hover { color: var(--accent-dark); }
.ledger .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.ledger .down { color: #9a3b32; }
.board-kpis, .board-metrics, .board-columns { display: grid; gap: 0.8rem; margin-bottom: 0.8rem; }
.board-kpis, .board-columns { grid-template-columns: 1fr 1fr; }
.board-metrics { grid-template-columns: repeat(3, 1fr); }
.kpi {
  display: grid;
  gap: 0.35rem;
  min-height: 132px;
  align-content: end;
  padding: 1.15rem 1.25rem;
  border-radius: 18px;
  color: white;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.kpi span { opacity: 0.88; font-size: 0.92rem; }
.kpi strong { font-size: 1.85rem; letter-spacing: -0.04em; }
.kpi.tahsil { background: linear-gradient(145deg, #1b7f6e, #0e4f45); }
.kpi.satis { background: linear-gradient(145deg, #2d6cdf, #1b3f86); }
.metric {
  display: grid;
  gap: 0.3rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.metric span { color: var(--muted); font-size: 0.82rem; }
.metric strong { font-size: 1.15rem; letter-spacing: -0.03em; }
.feed { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.55rem; }
.feed li { display: flex; justify-content: space-between; gap: 0.8rem; align-items: baseline; padding-bottom: 0.55rem; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; padding-bottom: 0; }
.feed a { font-weight: 650; text-decoration: none; }
.feed time, .feed span { color: var(--muted); font-size: 0.86rem; }
.feed strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.stock-figure { margin: 0.1rem 0 0.8rem; font-size: 1.7rem; font-weight: 750; letter-spacing: -0.03em; }
.moves { width: 100%; border-collapse: collapse; margin-top: 0.3rem; }
.moves th, .moves td { text-align: left; padding: 0.5rem 0.15rem; border-bottom: 1px solid var(--line); }
.moves th { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.03em; text-transform: uppercase; }
.moves .num { text-align: right; font-variant-numeric: tabular-nums; }
.moves .down { color: #9a3b32; }

.name-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.7rem;
  align-items: start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.name-item form { display: flex; gap: 0.45rem; align-items: center; }
.name-item input { background: white; }
.name-item button { margin-top: 0; }
.name-meta { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.82rem; }

.search { display: flex; gap: 0.5rem; align-items: center; }
.search input { width: 230px; background: white; }
.search button { margin-top: 0; }

.split { grid-template-columns: 1.35fr 0.85fr; align-items: start; }
.grid-2 { grid-template-columns: 1fr 1fr; }

.firm-list { display: grid; gap: 0.7rem; }

.firm-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.9rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.firm-row:hover { border-color: #b7d4cb; }
.firm-copy { display: grid; }
.firm-copy small { color: var(--muted); }
.firm-go {
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.9rem;
}

.panel, .empty, .facts {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.panel .panel {
  border: 0;
  padding: 0.2rem 0 0;
  box-shadow: none;
  background: transparent;
}

.facts {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 0.8rem;
}

.facts div { margin: 0; }
.facts dt { color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.facts dd { margin: 0.2rem 0 0; font-size: 1.02rem; }
.facts .wide { grid-column: 1 / -1; }
.pre { white-space: pre-line; }

.members { list-style: none; padding: 0; margin: 0 0 0.6rem; }
.members li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.narrow {
  max-width: 36rem;
  margin: 12vh auto;
  padding: 0 1.2rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media print {
  .side, .topbar, .no-print, .notice, .alert, .popup { display: none !important; }
  .shell { display: block; }
  .page { width: 100%; padding: 0; }
  .panel { box-shadow: none; border: 0; }
  body { background: white; }
}

@media (max-width: 900px) {
  .auth, .split, .page-head, .shell, .facts, .grid-2, .stat-grid, .board-kpis, .board-metrics, .board-columns, .command { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .auth-intro { padding: 2.2rem 1.3rem 1.4rem; }
  .auth-intro h1 { font-size: 2.4rem; margin-top: 1.2rem; }
  .auth-card { margin: 1rem auto 1.5rem; }
  .side { position: static; height: auto; }
  .side-nav { display: flex; gap: 0.35rem; overflow-x: auto; padding-bottom: 0.3rem; }
  .nav-item { flex: 0 0 auto; }
  .side-foot { display: none; }
  .search, .search input { width: 100%; }
}
