/* MAKINEX ONE - panel tasarim sistemi */

:root {
  /* MAKINEX ONE kurumsal Light Mode */
  --navy-950: #08132a;
  --navy-900: #0b1a36;
  --navy-800: #122445;
  --navy-700: #1b3157;
  --navy-500: #3b5482;
  /* koyu zeminli (giris oncesi) alanlar */
  --hero-text: #c9d3ee;
  --hero-muted: #98a5c8;
  /* koyu kenar cubugu (calisma alani acik kalir): yalnizca .sidebar icinde kullanilan, kapsamli belirteçler */
  --sb-bg: linear-gradient(180deg, #0b1226 0%, #0e1530 100%);
  --sb-border: rgba(148, 163, 255, .16);
  --sb-fg: #e2e8f0;
  --sb-muted: #a5b4cc;
  --sb-label: #8f9dc0;
  --sb-hover-bg: rgba(129, 140, 248, .14);
  --sb-active-bg: linear-gradient(90deg, rgba(99, 102, 241, .32), rgba(139, 92, 246, .16));
  --sb-accent: linear-gradient(180deg, #6d8bff, #a78bfa);
  --sb-ring: #a5b4ff;

  /* marka: mavi-mor (turkuaz yok) */
  --brand-50: #eef2ff;
  --brand-100: #e0e7ff;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #3730a3;
  --violet-600: #7c3aed;
  --brand-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --brand-grad-hover: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
  --ring: rgba(79, 70, 229, .28);

  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --border: #e3e8f2;
  --border-strong: #c5cee0;
  --text: #0b1a36;
  --text-2: #26365a;
  --muted: #54627f;

  --ok: #15803d;      --ok-bg: #e8f7ee;
  --warn: #b45309;    --warn-bg: #fef4e2;
  --bad: #b91c1c;     --bad-bg: #fdecec;
  --info: #1d4ed8;    --info-bg: #e8effe;
  --neutral: #475569; --neutral-bg: #eef2f6;
  --mock: #6d28d9;    --mock-bg: #f1ebfe;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(11, 26, 54, .06);
  --shadow: 0 1px 3px rgba(11, 26, 54, .08), 0 4px 16px rgba(11, 26, 54, .06);
  --shadow-lg: 0 20px 50px rgba(11, 26, 54, .22);
  --sidebar-w: 252px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--text); }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.login-hero :focus-visible, .auth-page .login-hero a:focus-visible { outline-color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ yerlesim */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; background: var(--bg); }
.sidebar {
  background: var(--sb-bg); border-right: 1px solid var(--sb-border); color-scheme: dark;
  color: var(--sb-fg); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 18px; color: inherit; text-decoration: none; }
/* Logo plakasi: orijinal logo DEGISTIRILMEDEN, kendi zemin rengiyle (#010C21) sunulur */
.logo-plate { display: block; background: #010C21; border-radius: 12px; overflow: hidden; line-height: 0; }
.logo-plate img { display: block; width: 100%; height: auto; }
.sidebar .brand { padding: 16px 12px 6px; }
.sidebar .brand .logo-plate { width: 172px; border-radius: 10px; }
.login-hero .brand .logo-plate { width: 200px; }
.auth-mobile-brand { display: none; }

.nav { padding: 8px 12px 16px; flex: 1; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--sb-label); padding: 16px 10px 6px; font-weight: 650; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px;
  color: var(--sb-fg); font-weight: 550; text-decoration: none; position: relative;
  transition: background .12s, color .12s;
}
.nav a svg { flex: none; color: var(--sb-muted); }
.nav a:hover { background: var(--sb-hover-bg); color: #fff; }
.nav a:hover svg { color: #c7d2fe; }
.nav a.active { background: var(--sb-active-bg); color: #fff; font-weight: 650; box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .22); }
.nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--sb-accent);
}
.nav a.active svg { color: #c7d2fe; }
.sidebar :focus-visible { outline-color: var(--sb-ring); }
.sidebar ::selection { background: rgba(129, 140, 248, .4); }
.nav .count {
  margin-left: auto; background: var(--brand-grad); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 0 7px; line-height: 18px; min-width: 20px; text-align: center;
}
.sidebar-foot { padding: 14px 20px 18px; border-top: 1px solid var(--sb-border); font-size: 12px; color: var(--sb-muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 28px; position: sticky; top: 0; z-index: 20;
}
.topbar .crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; min-width: 0; }
.topbar .crumbs a { color: var(--muted); }
.topbar .crumbs strong { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.user-chip:hover { border-color: var(--border-strong); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--navy-800); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none;
}
.user-chip .who { text-align: left; line-height: 1.15; padding-right: 6px; }
.user-chip .who b { display: block; font-size: 13px; font-weight: 600; }
.user-chip .who small { color: var(--muted); font-size: 11.5px; }
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); min-width: 220px; padding: 6px; z-index: 40;
}
.dropdown-menu .meta { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; font-size: 12.5px; color: var(--muted); }
.dropdown-menu button, .dropdown-menu a {
  display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: none;
  font: inherit; color: var(--text); border-radius: 6px; cursor: pointer; text-align: left; text-decoration: none;
}
.dropdown-menu button:hover, .dropdown-menu a:hover { background: var(--surface-2); }

.content { padding: 26px 28px 48px; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 240px; }
.page-head .titles p { color: var(--muted); margin-top: 4px; }
.page-head .title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.quote-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.quote-side > * { min-width: 0; }
.grid-main-wide { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt { margin-top: 14px; }

/* ------------------------------------------------------------ kartlar */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2 { flex: 1; }
.card-head .sub { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.card-body { padding: 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card.flush .card-body { padding: 0; }

.kpis { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
@media (min-width: 1680px) { .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
a.kpi:hover { border-color: var(--brand-500); box-shadow: var(--shadow); text-decoration: none; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi .label .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.kpi .hint { font-size: 12.5px; color: var(--muted); }
.kpi.alert .label .ic { background: var(--bad-bg); color: var(--bad); }
.kpi.alert .value { color: var(--bad); }
.kpi.attention .label .ic { background: var(--warn-bg); color: var(--warn); }

/* is akisi hatti */
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; }
.pipe-step { position: relative; padding: 16px 14px; text-decoration: none; color: inherit; border-right: 1px solid var(--border); }
.pipe-step:last-child { border-right: 0; }
.pipe-step:hover { background: var(--surface-2); text-decoration: none; }
.pipe-step .n { font-size: 22px; font-weight: 700; }
.pipe-step .t { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.pipe-step .bar { height: 4px; border-radius: 4px; background: var(--brand-100); margin-top: 10px; overflow: hidden; }
.pipe-step .bar i { display: block; height: 100%; background: var(--brand-500); }

.stepper { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 14px 18px; }
.step { display: flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--muted); font-size: 12.5px; font-weight: 500; text-decoration: none; }
a.step:hover { text-decoration: none; color: var(--text); }
.step .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-strong); background: var(--surface); font-size: 11px; font-weight: 700; flex: none; }
.step.done { color: var(--text-2); }
.step.done .dot { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.step.current { color: var(--text); font-weight: 650; }
.step.current .dot { border-color: var(--brand-500); color: var(--brand-700); box-shadow: 0 0 0 4px var(--brand-50); }
.step.blocked .dot { border-color: var(--bad); color: var(--bad); }
.step.skip { opacity: .5; }
.step-line { flex: 1; min-width: 24px; height: 2px; background: var(--border); margin: 0 10px; }
.step-line.done { background: var(--brand-500); }

/* ------------------------------------------------------------ butonlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--brand-50); border-color: var(--brand-500); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand-grad); border-color: var(--brand-600); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, .35); }
.btn.primary:hover:not(:disabled) { background: var(--brand-grad-hover); border-color: var(--brand-700); }
.btn.navy { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.btn.navy:hover:not(:disabled) { background: var(--navy-700); }
.btn.danger { color: var(--bad); border-color: #f1c4c4; }
.btn.danger:hover:not(:disabled) { background: var(--bad-bg); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--brand-50); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--brand-500) transparent var(--brand-500) transparent; animation: spin .7s linear infinite;
}
.btn.primary.busy::after { border-color: #fff transparent #fff transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ rozetler */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap;
  background: var(--neutral-bg); color: var(--neutral);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.brand { background: var(--brand-50); color: var(--brand-700); }
.badge.mock { background: var(--mock-bg); color: var(--mock); letter-spacing: .02em; }
.badge.live { background: var(--ok-bg); color: var(--ok); }
.badge.pulse::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .2; } }

.notice { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid; font-size: 13.5px; align-items: flex-start; }
.notice svg { flex: none; margin-top: 1px; }
.notice b { font-weight: 650; }
.notice.mock { background: var(--mock-bg); border-color: #ddd0fb; color: #4c1d95; }
.notice.warn { background: var(--warn-bg); border-color: #f7dcae; color: #78350f; }
.notice.bad { background: var(--bad-bg); border-color: #f5c2c2; color: #7f1d1d; }
.notice.info { background: var(--info-bg); border-color: #c9d8fb; color: #1e3a8a; }
.notice.ok { background: var(--ok-bg); border-color: #bfe6cd; color: #14532d; }

/* ------------------------------------------------------------ tablolar */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th .sort { opacity: .5; margin-left: 4px; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--brand-50); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td .primary-text { font-weight: 600; color: var(--text); }
.table td .secondary-text { color: var(--muted); font-size: 12.5px; }
.table tr.warn-row td { background: #fffaf0; }
.table tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
.table.compact td, .table.compact th { padding: 8px 12px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 34px; }
.segmented { display: inline-flex; background: var(--neutral-bg); border-radius: 8px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button {
  border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 550; color: var(--muted);
  padding: 5px 11px; border-radius: 6px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented button[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.segmented button[aria-disabled="true"]:hover { color: var(--muted); }
.segmented .n { font-size: 11px; background: var(--border); border-radius: 999px; padding: 0 6px; color: var(--text-2); }
.load-more { display: flex; justify-content: center; padding: 12px; border-top: 1px solid var(--border); }

/* ------------------------------------------------------------ formlar */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 13px; font-weight: 550; color: var(--text-2); }
.field .req { color: var(--bad); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--bad); font-weight: 500; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 0 11px; height: 36px; width: 100%; transition: border-color .12s, box-shadow .12s;
}
textarea { padding: 9px 11px; height: auto; min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--ring); }
input:disabled, select:disabled, textarea:disabled, input[readonly] { background: var(--surface-2); color: var(--muted); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--brand-600); padding: 0; }
input[type="file"] { padding: 6px; height: auto; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; border: 0; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: var(--shadow-sm); }
.switch input:checked { background: var(--brand-600); }
.switch input:checked::after { left: 18px; }
.switch input:disabled { opacity: .5; cursor: not-allowed; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; flex-wrap: wrap; }
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center;
  background: var(--surface-2); color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand-500); background: var(--brand-50); }
.dropzone b { color: var(--text); }

/* urun arama combobox'i (teklif kalem editoru) */
.combobox { position: relative; }
.combobox input { width: 100%; }
.cb-list {
  position: fixed; z-index: 1000; margin: 0; padding: 4px; list-style: none; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-lg);
}
.cb-list[hidden] { display: none; }
.cb-opt { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.cb-opt[aria-selected="true"] { background: var(--brand-50); outline: 2px solid var(--brand-500); outline-offset: -2px; }
.cb-primary { font-weight: 600; overflow-wrap: anywhere; }
.cb-secondary { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; }
.cb-badge { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--warn-bg); color: #78350f; border: 1px solid #f7dcae; align-self: start; white-space: nowrap; }
.cb-more { grid-template-columns: 1fr; text-align: center; color: var(--brand-600, var(--brand-500)); font-weight: 600; }
.cb-status { padding: 10px; color: var(--muted); font-size: 13px; }
.cb-status.bad { color: var(--bad); }
.items-editor .cur-warn { margin-top: 4px; max-width: 26ch; white-space: normal; }

/* teklif kalem editoru */
.items-editor td { padding: 6px 8px; }
.items-editor input, .items-editor select { height: 32px; padding: 0 8px; font-size: 13px; }
.items-editor .col-part { width: 150px; }
/* para/miktar sutunlari icerige gore buyur (ch birimi); sabit px genislik buyuk tutari kesiyordu */
.items-editor .col-qty { width: 96px; min-width: 14ch; }
.items-editor .col-unit { width: 80px; }
.items-editor .col-price { width: 1%; min-width: 24ch; }
.items-editor .col-total { width: 1%; min-width: 20ch; white-space: nowrap; font-variant-numeric: tabular-nums; }
.items-editor .col-desc { min-width: 18ch; }   /* aciklama, para sutunlari genisleyince ezilmesin */
@media print {
  .col-cat, .col-cost, .col-margin { display: none !important; }      /* alis maliyeti ve marj kagida cikmaz */
  .table-wrap { overflow: visible; }
  /* kagitta kaydirma yok: yazi ve bosluklar kucultulur, tutarlar yine tam yazilir */
  .items-editor { font-size: 11px; }
  .items-editor td, .items-editor th { padding: 4px; }
  .items-editor input, .items-editor select { font-size: 11px; padding: 0 3px; }
  .items-editor .col-part { width: 80px; }
  .items-editor .col-qty { width: 60px; min-width: 0; }
  .items-editor .col-unit { width: 50px; }
  .items-editor .col-price { min-width: 21ch; }
  .items-editor .col-total { min-width: 18ch; }
  .items-editor .col-desc { min-width: 10ch; }
  .table td, .table th { padding: 4px 6px; font-size: 11px; }   /* salt okunur kalem tablosu da kagida sigar */
  .items-editor input[type=number]::-webkit-inner-spin-button { display: none; }
}
.items-editor .col-del { width: 40px; }
/* katalog referansi (salt okunur), alis maliyeti ve marj (yalnizca yetkili); kagida YAZDIRILMAZ */
.table .col-cat, .items-editor .col-cat { min-width: 13ch; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .col-cost, .table .col-margin { white-space: nowrap; min-width: 9ch; font-variant-numeric: tabular-nums; }
.price-src { margin-top: 2px; min-height: 1em; }
.items-editor tr.missing input.price { border-color: var(--warn); background: #fffaf0; }
.totals { display: flex; justify-content: flex-end; gap: 28px; padding: 14px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.totals .t { text-align: right; }
.totals .t small { display: block; color: var(--muted); font-size: 12px; }
.totals .t b { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------------------------------------ bilgi listeleri */
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.kv.tight { grid-template-columns: 120px minmax(0, 1fr); gap: 8px 12px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 0 0 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .tdot { width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--brand-100); background: var(--brand-500); flex: none; margin-top: 2px; }
.timeline .tbody { min-width: 0; }
.timeline .tbody b { font-weight: 600; }
.timeline .tbody small { display: block; color: var(--muted); font-size: 12px; }

.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.activity li:last-child { border-bottom: 0; }
.activity .aic { width: 30px; height: 30px; border-radius: 8px; background: var(--neutral-bg); color: var(--neutral); display: grid; place-items: center; flex: none; }
.activity .aic.ok { background: var(--ok-bg); color: var(--ok); }
.activity .aic.bad { background: var(--bad-bg); color: var(--bad); }
.activity .aic.brand { background: var(--brand-50); color: var(--brand-700); }
.activity .aic.mock { background: var(--mock-bg); color: var(--mock); }
.activity .txt { flex: 1; min-width: 0; }
.activity .txt small { display: block; color: var(--muted); font-size: 12px; }

.meter { height: 6px; border-radius: 6px; background: var(--neutral-bg); overflow: hidden; width: 100%; }
.meter i { display: block; height: 100%; background: var(--brand-500); }
.meter.warn i { background: #f59e0b; }
.meter.bad i { background: var(--bad); }

.progress-track { display: flex; gap: 6px; }
.progress-track .seg { flex: 1; }
.progress-track .seg .b { height: 6px; border-radius: 6px; background: var(--border); }
.progress-track .seg.done .b { background: var(--brand-500); }
.progress-track .seg.current .b { background: linear-gradient(90deg, var(--brand-500), var(--brand-100)); }
.progress-track .seg small { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.progress-track .seg.done small, .progress-track .seg.current small { color: var(--text-2); font-weight: 550; }
.progress-track.cancelled .seg .b { background: var(--bad-bg); }

pre.raw { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin: 0; max-height: 360px; overflow: auto; }
.secret { font-family: var(--mono); font-size: 12.5px; background: var(--brand-50); color: var(--text); border: 1px solid var(--brand-100); padding: 12px; border-radius: 8px; word-break: break-all; }

/* ------------------------------------------------------------ durumlar */
.empty { text-align: center; padding: 44px 24px; color: var(--muted); }
.empty .eic { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.error-state { text-align: center; padding: 40px 24px; }
.error-state .eic { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 12px; display: grid; place-items: center; background: var(--bad-bg); color: var(--bad); }
.error-state p { color: var(--muted); margin: 6px 0 14px; }
.skeleton { background: linear-gradient(90deg, #edf1f6 25%, #f6f8fb 37%, #edf1f6 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sk-line { height: 12px; margin: 10px 0; }
.sk-block { height: 96px; }
.page-loading { display: grid; gap: 18px; }

/* ------------------------------------------------------------ modal / toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(11, 26, 54, .45); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .12s ease; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: rise .16s ease; }
.modal.lg { max-width: 960px; height: calc(100vh - 40px); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { flex: 1; }
.modal-body { padding: 20px; overflow: auto; flex: 1; }
.modal-body.flush { padding: 0; display: flex; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 12px 12px; flex-wrap: wrap; }
.pdf-frame { width: 100%; flex: 1; border: 0; min-height: 420px; background: #525659; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); color: var(--text); padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); border-left: 4px solid var(--ok); box-shadow: var(--shadow); animation: rise .16s ease; font-size: 13.5px; }
.toast svg { flex: none; margin-top: 1px; color: var(--ok); }
.toast.bad { background: var(--bad-bg); border-color: #f5c2c2; border-left-color: var(--bad); color: #7f1d1d; }
.toast.bad svg { color: var(--bad); }

/* ------------------------------------------------------------ giris */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero {
  background: radial-gradient(circle at 20% 10%, rgba(124, 92, 246, .28), transparent 45%), linear-gradient(160deg, var(--navy-900), var(--navy-950));
  color: var(--hero-text); padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-hero h2 { color: #fff; font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; max-width: 460px; }
.login-hero p { margin-top: 14px; max-width: 440px; color: var(--hero-text); }
.login-flow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.login-flow span { border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; color: #e2e8f0; }
.login-flow span.arrow { border: 0; padding: 4px 0; color: #b7c0ff; }
.login-form-wrap { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { margin-bottom: 6px; }
.login-card form { display: flex; flex-direction: column; gap: 16px; margin-top: 26px; }

/* ------------------------------------------------------------ duyarli */
@media (max-width: 1180px) {
  .grid-main, .grid-main-wide { grid-template-columns: minmax(0, 1fr); }
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipe-step:nth-child(3) { border-right: 0; }
  .pipe-step:nth-child(-n+3) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; background: var(--bg); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 14px; }
  .kpi .value { font-size: 22px; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(8, 19, 42, .45); z-index: 25; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 40px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .user-chip .who { display: none; }
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .auth-mobile-brand { display: block; width: 150px; margin: 0 0 22px; padding: 0; }
  .auth-page .login-form-wrap { place-items: start center; padding: 28px 20px 32px; }
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipe-step { border-right: 0; border-bottom: 1px solid var(--border); }
  .page-head .actions { width: 100%; }
  .topbar .ai-mode { display: none; }
}
@media print {
  .sidebar, .topbar, .page-head .actions { display: none !important; }
  .shell { display: block; }
}

/* ------------------------------------------------------------ kimlik ekranlari (koyu lacivert / mavi-mor) */
.auth-page .login-hero { background: radial-gradient(circle at 80% 0%, rgba(139, 92, 246, .30), transparent 50%), radial-gradient(circle at 10% 20%, rgba(79, 107, 255, .26), transparent 50%), #060b1a; }
.auth-page .btn.primary { background: linear-gradient(135deg, #4f6bff, #8b5cf6); border-color: transparent; color: #fff; }
.auth-page .btn.primary:hover { filter: brightness(1.08); }
.auth-page a { color: #5b5bd6; }
.auth-page .btn { text-decoration: none; }
.auth-page .btn.primary, .auth-page .btn.primary:hover { color: #fff; }
.auth-points { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; color: #cbd3ee; }
.auth-points li { display: flex; gap: 10px; align-items: center; }
.auth-points svg { color: #8b9bff; }
.login-card.wide { max-width: 460px; }
.auth-alt { margin-top: 18px; text-align: center; font-size: 13.5px; color: var(--muted); }
.login-form-wrap { overflow-y: auto; }

/* ------------------------------------------------------------ kurulum */
.progress { height: 8px; border-radius: 999px; background: var(--neutral-bg); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4f6bff, #8b5cf6); }
.onb-steps { display: grid; gap: 12px; }
.onb-step { display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: center; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.onb-step.current { border-color: #7c8cff; box-shadow: 0 0 0 3px rgba(124, 140, 255, .15); }
.onb-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--info-bg); color: var(--info); }
.onb-step.done .onb-ico { background: var(--ok-bg); color: var(--ok); }
.onb-text p { margin-top: 2px; }
hr.sep { border: 0; border-top: 1px solid var(--border); width: 100%; margin: 4px 0; }
@media (max-width: 640px) { .onb-step { grid-template-columns: 44px 1fr; } .onb-step .btn { grid-column: 1 / -1; } }

.qr { width: 200px; max-width: 100%; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.qr svg { width: 100%; height: auto; display: block; }
.recovery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.recovery li { padding: 8px 10px; border: 1px dashed var(--border-strong); border-radius: 8px; text-align: center; }
.recovery code, .auth-page code, #mfa-secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; word-break: break-all; }

/* ------------------------------------------------------------ erisilebilirlik */
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 300; background: var(--brand-700); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none; transition: top .12s; }
.skip-link:focus { top: 12px; outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
/* boş durum metinleri: taşmasız (flush) kartların içinde de iç boşluk */
.card.flush .card-body.muted { padding: 18px; }

.ai-blockers { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
pre.raw.ai-consent-text { max-height: 220px; font-family: var(--font); font-size: 13px; line-height: 1.55; }

/* ------------------------------------------------------------ ice aktarma: sutun eslestirme */
.map-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.map-card h3 { margin: 0; font-size: 15px; }
.map-grid { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 12px 16px; align-items: start; }
.map-grid .map-label { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 550; font-size: 13px; padding-top: 8px; }
.map-grid select { width: 100%; min-width: 0; }
.map-grid select[aria-invalid="true"] { border-color: var(--bad); }
.map-grid .hint { font-size: 12px; color: var(--muted); display: block; margin-top: 4px; overflow-wrap: anywhere; }
.map-actions { display: flex; gap: 10px; flex-wrap: wrap; }
#import-summary[data-stale="true"], #import-summary[data-policy-stale="true"] { opacity: .5; }
@media (max-width: 640px) {
  .map-grid { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .map-grid .map-label { padding-top: 10px; }
  .map-actions .btn { flex: 1 1 100%; justify-content: center; }
}
.warn-text { color: var(--warn); font-weight: 550; }

/* fiyatlandirma asistani */
.chip { border: 1px solid var(--border-strong); background: var(--surface-2); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; color: var(--text); }
.chip:hover { background: var(--brand-50); border-color: var(--brand-500); }
#pricing-assistant textarea { width: 100%; }
