/* Pixelon Design System, dark product UI. Layout: fixed sidebar + content column of panels. Contrast checked: all text >= 5.4:1. */
:root {
  --bg: #0a0a0a;          /* px-black, page */
  --s1: #131414;          /* px-ink-900, panels */
  --s2: #1c1e1d;          /* px-ink-800, inputs, hover */
  --line: #2b2e2c;        /* px-ink-700, structural hairlines */
  --line-strong: #6b6f6c; /* px-ink-500, control borders (3:1 on s2) */
  --text: #f4f5f2;
  --text-2: #b9bdb8;
  --text-3: #8f948f;
  --lime: #c5f400; --lime-hover: #d6fa3d;
  --danger: #ff8589; --danger-bg: rgba(229, 72, 77, .16);
  --st-new-fg: #c5f400; --st-new-bg: rgba(197, 244, 0, .12);
  --st-contact-fg: #8fb8ff; --st-contact-bg: rgba(59, 130, 246, .18);
  --st-meet-fg: #b9a8ff; --st-meet-bg: rgba(124, 92, 252, .20);
  --st-offer-fg: #f9c46e; --st-offer-bg: rgba(244, 166, 41, .16);
  --st-won-fg: #6ee7a8; --st-won-bg: rgba(24, 182, 106, .18);
  --st-lost-fg: #b9bdb8; --st-lost-bg: #2b2e2c;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 4px; --r-md: 6px; --r-lg: 10px; --r-pill: 999px;
  --tracking: .12em;
  --ease: cubic-bezier(.2, .8, .25, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

.wordmark { font: 700 21px/1 var(--font-display); letter-spacing: -0.035em; color: var(--text); }
.wordmark b { color: var(--lime); }
.brand { display: flex; align-items: center; gap: 10px; }
.chip-lime { background: var(--lime); color: #0a0a0a; font: 700 10px/1 var(--font-body); letter-spacing: var(--tracking); padding: 5px 6px; }
.eyebrow { margin: 0 0 6px; font: 600 11px/1.2 var(--font-body); letter-spacing: var(--tracking); text-transform: uppercase; color: var(--text-3); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--r-sm); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s var(--ease), border-color .15s var(--ease); }
.btn-lime { background: var(--lime); color: #0a0a0a; }
.btn-lime:hover { background: var(--lime-hover); }
.btn-line { background: var(--s2); border-color: var(--line-strong); color: var(--text); }
.btn-line:hover { border-color: var(--text-3); }
.btn-quiet { background: transparent; border-color: var(--line); color: var(--text-2); min-height: 36px; }
.btn-quiet:hover { border-color: var(--line-strong); color: var(--text); }
.btn[disabled] { opacity: 1; background: var(--s2); color: var(--text-3); cursor: not-allowed; }
.icon-btn { width: 40px; height: 40px; flex: none; border: 1px solid var(--line); background: var(--s2); color: var(--text); border-radius: var(--r-sm); font-size: 22px; line-height: 1; cursor: pointer; }
.icon-btn:hover { border-color: var(--line-strong); }

.field { display: grid; gap: 6px; min-width: 0; }
label { font-size: 12px; font-weight: 600; color: var(--text-2); }
input, select, textarea { width: 100%; min-height: 40px; padding: 9px 12px; background: var(--s2); border: 1px solid var(--line-strong); border-radius: var(--r-sm); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:hover, select:hover, textarea:hover { border-color: var(--text-3); }
input:focus, select:focus, textarea:focus { border-color: var(--lime); outline: none; box-shadow: 0 0 0 1px var(--lime); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .8; cursor: pointer; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.form-error { min-height: 1.2em; margin: 0; color: var(--danger); font-size: 13px; }

/* Login */
.login { min-height: 100%; display: grid; place-items: center; padding-block: 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.login-card { width: 100%; max-width: 380px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px 28px; display: grid; gap: 14px; }
.login-card h1 { margin: 8px 0 4px; font: 700 30px/1 var(--font-display); letter-spacing: -0.035em; }

/* Shell */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100%; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 28px; padding: 22px 16px; border-right: 1px solid var(--line); background: var(--bg); }
.sidebar .brand { padding: 0 8px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 0 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--text-2); font-weight: 500; position: relative; }
.nav a:hover { background: var(--s1); color: var(--text); }
.nav a[aria-current="page"] { background: var(--s2); color: var(--text); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; background: var(--lime); }
.nav-n { font-size: 12px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; padding: 0 8px; }
.me { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; }
.avatar { width: 28px; height: 28px; border-radius: var(--r-pill); background: var(--s2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 600; font-size: 12px; color: var(--text); }

.main { min-width: 0; padding-block: 28px 64px; padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }
.view { max-width: 1240px; display: grid; gap: 20px; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.view-title { margin: 0; font: 700 34px/0.94 var(--font-display); letter-spacing: -0.035em; text-wrap: balance; }

/* Panels */
.panel { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font: 600 15px/1.2 var(--font-body); }
.panel-sub { font-size: 12px; color: var(--text-3); }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; display: grid; gap: 6px; text-align: left; cursor: pointer; transition: border-color .15s var(--ease); }
.kpi:hover { border-color: var(--line-strong); }
.kpi .k { font: 600 11px/1.2 var(--font-body); letter-spacing: var(--tracking); text-transform: uppercase; color: var(--text-3); }
.kpi .v { font: 800 36px/1 var(--font-body); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi .h { font-size: 12px; color: var(--text-2); }
.kpi.alert .v { color: var(--danger); }
.kpi.accent .v { color: var(--lime); }

.stages { display: grid; gap: 12px; }
.stagebar { display: flex; height: 10px; border-radius: var(--r-pill); overflow: hidden; background: var(--s2); gap: 2px; }
.stagebar span { display: block; min-width: 0; }
.stage-legend { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.stage-item { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: transparent; text-align: left; cursor: pointer; color: var(--text); }
.stage-item:hover { border-color: var(--line-strong); }
.stage-item .lbl { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.stage-item .lbl i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.stage-item .n { font: 700 22px/1.1 var(--font-body); font-variant-numeric: tabular-nums; }

.todo, .feed { list-style: none; margin: 0; padding: 0; }
.todo li { border-top: 1px solid var(--line); }
.todo li:first-child, .feed li:first-child { border-top: 0; }
.todo button { width: 100%; display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; padding: 12px 4px; background: none; border: 0; text-align: left; cursor: pointer; color: var(--text); border-radius: var(--r-sm); }
.todo button:hover { background: var(--s2); }
.todo .date { font-size: 12px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; padding-top: 1px; }
.todo .date.late { color: var(--danger); }
.todo .t { font-weight: 600; display: block; }
.todo .s { font-size: 13px; color: var(--text-2); display: block; overflow-wrap: anywhere; }
.feed li { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.feed .meta { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.feed .meta b { color: var(--text-2); font-weight: 600; }
.feed .body { overflow-wrap: anywhere; white-space: pre-wrap; }
.feed a { color: var(--text); text-decoration: none; font-weight: 600; }
.feed a:hover { color: var(--lime); }
.empty { color: var(--text-3); padding: 16px 0; font-size: 13px; }

/* Leads table */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.filters input { max-width: 340px; }
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg button { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); background: transparent; border-radius: var(--r-pill); font-size: 13px; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { border-color: var(--line-strong); color: var(--text); }
.seg button[aria-selected="true"] { background: var(--text); border-color: var(--text); color: #0a0a0a; }
.seg .n { font-variant-numeric: tabular-nums; font-weight: 600; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--s1); }
.table { width: 100%; border-collapse: collapse; min-width: 900px; }
.table th { text-align: left; font: 600 11px/1.2 var(--font-body); letter-spacing: var(--tracking); text-transform: uppercase; color: var(--text-3); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover td { background: var(--s2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .p-title { font-weight: 600; display: block; }
.table .p-sub, .table .c-sub { font-size: 12px; color: var(--text-3); display: block; }
.table .step { color: var(--text-2); max-width: 260px; }
.table .late { color: var(--danger); font-weight: 600; }
.table .muted { color: var(--text-3); }

.pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-0 { color: var(--st-new-fg); background: var(--st-new-bg); }
.st-1 { color: var(--st-contact-fg); background: var(--st-contact-bg); }
.st-2 { color: var(--st-meet-fg); background: var(--st-meet-bg); }
.st-3 { color: var(--st-offer-fg); background: var(--st-offer-bg); }
.st-4 { color: var(--st-won-fg); background: var(--st-won-bg); }
.st-5 { color: var(--st-lost-fg); background: var(--st-lost-bg); }
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.prio i { width: 8px; height: 8px; border-radius: 2px; background: var(--line-strong); }
.prio.p-Yüksek { color: var(--text); font-weight: 600; }
.prio.p-Yüksek i { background: var(--lime); }
.prio.p-Orta i { background: var(--text-2); }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 20; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(780px, 100%); background: var(--s1); border-left: 1px solid var(--line); display: flex; flex-direction: column; animation: slide .22s var(--ease); }
@keyframes slide { from { transform: translateX(16px); opacity: .7; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: calc(20px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 18px 24px; border-bottom: 1px solid var(--line); }
.drawer-titles { min-width: 0; }
.drawer-head h2 { margin: 0; font: 700 26px/1.05 var(--font-display); letter-spacing: -0.03em; }
.drawer-sub { margin: 6px 0 0; color: var(--text-2); font-size: 13px; }
.drawer-body { overflow-y: auto; padding: 20px max(20px, env(safe-area-inset-right, 0px)) calc(32px + env(safe-area-inset-bottom, 0px)) 24px; display: grid; gap: 24px; }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.summary div { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; min-width: 0; }
.summary dt { font-size: 11px; letter-spacing: var(--tracking); text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.summary dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.contact-row { display: flex; flex-wrap: wrap; gap: 8px; }
.section h3 { margin: 0 0 12px; font: 600 11px/1.2 var(--font-body); letter-spacing: var(--tracking); text-transform: uppercase; color: var(--text-3); padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grid2 .full { grid-column: 1 / -1; }
.note-form { display: grid; gap: 8px; margin-bottom: 6px; }
.note-form .btn { justify-self: start; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.timeline .meta { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.timeline .meta b { color: var(--text-2); font-weight: 600; }
.timeline .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline li.status .body { color: var(--text-2); font-weight: 600; }
.save-bar { position: sticky; bottom: calc(-32px - env(safe-area-inset-bottom, 0px)); background: var(--s1); border-top: 1px solid var(--line); padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); margin-top: 8px; display: flex; gap: 12px; align-items: center; }
.save-state { font-size: 13px; color: var(--danger); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--text); color: #0a0a0a; font-weight: 600; padding: 11px 16px; border-radius: var(--r-sm); z-index: 40; max-width: calc(100% - 32px); }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; height: auto; flex-direction: row; align-items: center; gap: 12px; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { padding: 0; }
  .sidebar .chip-lime { display: none; }
  .nav { display: flex; gap: 4px; }
  .nav a { min-height: 36px; padding: 0 10px; gap: 6px; }
  .nav a[aria-current="page"]::before { display: none; }
  .sidebar-foot { margin-left: auto; padding: 0; }
  .me { display: none; }
  .main { padding-block: 20px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .view-title { font-size: 28px; }
  .stage-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: 1fr; }
  .filters input { max-width: none; }
  .drawer-head, .drawer-body { padding-left: max(16px, env(safe-area-inset-left, 0px)); }
}
@media (max-width: 420px) { .kpi .v { font-size: 30px; } .wordmark { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; } }
