[hidden] { display: none !important; }
:root {
  --ink: #17161a;
  --ink-2: #2a282f;
  --paper: #f6f4ef;
  --card: #ffffff;
  --line: #e6e2d9;
  --muted: #6f6a62;
  --accent: #e2552d;
  --accent-ink: #ffffff;
  --accent-soft: #fde9e2;
  --ok: #1f8a5b;
  --ok-soft: #e1f3ea;
  --warn: #b7791f;
  --warn-soft: #fbf0d9;
  --bad: #c53030;
  --bad-soft: #fde2e2;
  --ty: #f27a1a;
  --wix: #3b5bdb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(23, 22, 26, .06), 0 4px 16px rgba(23, 22, 26, .05);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Giriş ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--ink); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art .wordmark { font-weight: 800; font-size: 22px; letter-spacing: .02em; }
.login-art .wordmark span { color: var(--accent); }
.login-art h1 { font-size: 44px; line-height: 1.05; max-width: 420px; font-weight: 800; }
.login-art p { color: #b9b4ab; max-width: 380px; line-height: 1.5; }
.tees { position: absolute; right: -30px; top: 130px; opacity: .9; }
.login-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 360px; }
.login-card h2 { font-size: 26px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 28px; }
.made-by { margin-top: 40px; color: var(--muted); font-size: 12.5px; letter-spacing: .02em; text-align: center; }
.made-by strong { color: var(--ink); font-weight: 600; }
@media (max-width: 820px) { .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; } }

/* ---------- Form ---------- */
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,22,26,.08); }
textarea { min-height: 70px; resize: vertical; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; cursor: pointer; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; margin: 6px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; white-space: nowrap; transition: background .12s, border-color .12s, transform .05s; }
.btn:hover { border-color: #cfc9bd; background: #fbfaf7; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: var(--ink-2); }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 9px; font-size: 12.5px; }
.btn.block { width: 100%; padding: 12px; }
.btn[disabled] { opacity: .55; cursor: default; }
.icon-btn { width: 30px; height: 30px; padding: 0; }

/* ---------- Uygulama düzeni ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #d9d5cd; padding: 22px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.side .wordmark { color: #fff; font-weight: 800; font-size: 18px; padding: 0 10px 22px; letter-spacing: .02em; }
.side .wordmark span { color: var(--accent); }
.side .wordmark small { display: block; font-weight: 500; font-size: 11.5px; color: #8e897f; letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; text-decoration: none; margin-bottom: 2px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.on { background: rgba(255,255,255,.1); color: #fff; }
.nav a .ic { width: 18px; text-align: center; opacity: .85; }
.nav a .badge { margin-left: auto; background: var(--accent); color: #fff; border-radius: 20px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
.side .foot { margin-top: auto; padding: 10px; font-size: 12px; color: #8e897f; }
.side .foot button { background: none; border: none; color: #d9d5cd; cursor: pointer; padding: 0; text-decoration: underline; }

.main { padding: 26px 32px 60px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.topbar h1 { font-size: 24px; font-weight: 800; }
.topbar .spacer { flex: 1; }
.sync-state { font-size: 12.5px; color: var(--muted); }
.sync-state .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #bbb; }
.sync-state .dot.ok { background: var(--ok); } .sync-state .dot.bad { background: var(--bad); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 18px 20px; }
.card h3 { font-size: 15px; margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
.kpi { padding: 16px 18px; }
.kpi .l { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi .v { font-size: 30px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
.kpi .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.two { grid-template-columns: 1.3fr 1fr; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } .two { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .app { grid-template-columns: 1fr; } .side { position: static; height: auto; } .main { padding: 18px; } }

.alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.alert { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; border: 1px solid; font-weight: 500; }
.alert.warn { background: var(--warn-soft); border-color: #f0dcae; color: #7a5212; }
.alert.bad { background: var(--bad-soft); border-color: #f5c2c2; color: #8f2020; }
.alert.info { background: #eef1fb; border-color: #d4dbf5; color: #2c3e8f; }
.alert a { margin-left: auto; font-weight: 700; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type=search] { max-width: 280px; }
.toolbar select { width: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: none; background: none; padding: 8px 12px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--ink); color: #fff; }

table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fbfaf7; position: sticky; top: 0; }
table.t td { padding: 10px 12px; border-bottom: 1px solid #f0ede6; vertical-align: middle; }
table.t tr:last-child td { border-bottom: none; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #fbfaf7; }
.table-wrap { overflow: auto; max-height: calc(100vh - 220px); border-radius: var(--radius); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

.pill { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 700; background: #f0ede6; color: var(--ink-2); white-space: nowrap; }
.pill.ty { background: #fff0e3; color: #b4520a; }
.pill.wix { background: #e7ecfc; color: #2b44a8; }
.pill.man { background: #efeaf8; color: #5b3d99; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------- Stok matrisi ---------- */
.group { margin-bottom: 18px; overflow: hidden; }
.group-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.group-h h3 { margin: 0; font-size: 16px; }
.group-h .tot { color: var(--muted); font-size: 12.5px; }
.matrix { width: 100%; border-collapse: collapse; }
.matrix th { font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 10px; text-align: center; background: #fbfaf7; }
.matrix th.c { text-align: left; padding-left: 18px; width: 180px; }
.matrix td { text-align: center; padding: 6px; border-top: 1px solid #f0ede6; }
.matrix td.c { text-align: left; padding-left: 18px; font-weight: 600; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); margin-right: 8px; vertical-align: -1px; }
.cell { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; padding: 7px 6px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; font-weight: 800; font-size: 16px; background: #f7f5f0; }
.cell:hover { border-color: var(--ink); }
.cell.low { background: var(--warn-soft); color: #7a5212; }
.cell.zero { background: var(--bad-soft); color: var(--bad); }
.cell small { font-size: 10px; font-weight: 600; color: var(--muted); }
.cell.none { background: none; color: #ccc; font-weight: 400; cursor: default; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 14px; align-items: start; }
.col { background: #efece5; border-radius: var(--radius); padding: 10px; min-height: 120px; }
.col-h { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 10px; font-weight: 800; }
.col-h .n { background: #fff; border-radius: 20px; padding: 1px 9px; font-size: 12px; }
.job { background: #fff; border-radius: 8px; padding: 11px 12px; margin-bottom: 8px; box-shadow: var(--shadow); border-left: 3px solid var(--line); }
.job.ty { border-left-color: var(--ty); } .job.wix { border-left-color: var(--wix); } .job.manuel { border-left-color: #7d5bbd; }
.job .tt { font-weight: 700; line-height: 1.3; }
.job .meta { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.45; }
.job .blank { margin-top: 6px; font-size: 12.5px; font-weight: 600; }
.job .blank.missing { color: var(--bad); }
.job .note { margin-top: 6px; font-size: 12px; background: #fbf6e6; padding: 5px 7px; border-radius: 6px; }
.job .acts { display: flex; gap: 6px; margin-top: 9px; }
.job .qty { float: right; background: var(--ink); color: #fff; border-radius: 6px; padding: 1px 7px; font-weight: 800; font-size: 12.5px; margin-left: 6px; }
@media (max-width: 1100px) { .kanban { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(23,22,26,.45); display: flex; align-items: flex-start; justify-content: center; padding: 70px 16px; z-index: 50; overflow: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 760px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-h h2 { font-size: 18px; }
.modal-h .x { border: none; background: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-b { padding: 20px 22px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--line); background: #fbfaf7; border-radius: 0 0 14px 14px; }
.modal-f .left { margin-right: auto; }
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 9px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 380px; font-weight: 500; animation: tin .2s ease-out; }
.toast.bad { background: var(--bad); } .toast.ok { background: var(--ok); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.big-qty { font-size: 40px; font-weight: 800; letter-spacing: -.02em; }
.lines { margin: 0; padding: 0; list-style: none; }
.lines li { padding: 3px 0; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 26px 0 10px; }
code { background: #f0ede6; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
