/* Atölye defteri: solda sabit menü, sağda iş listesi. Sakin çelik griler, tek vurgu "işaretleme mavisi";
   kırmızı/sarı/yeşil sadece durum bildirmek için. */
:root {
  --bg: #eef1f3;
  --surface: #ffffff;
  --surface-2: #f6f8f9;
  --ink: #18222c;
  --muted: #5a6773;
  --line: #d6dde2;
  --accent: #2456a6;
  --accent-ink: #ffffff;
  --accent-soft: #e3ecf8;
  --ok: #2c7a4b;
  --ok-soft: #e2f2e8;
  --warn: #9a5b00;
  --warn-soft: #fbefd9;
  --bad: #b8332a;
  --bad-soft: #fbe4e1;
  --shadow: 0 1px 2px rgba(20, 35, 50, .06), 0 4px 16px rgba(20, 35, 50, .06);
  --f-display: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161b; --surface: #182028; --surface-2: #1d262f; --ink: #e5eaee; --muted: #94a2ae; --line: #2b3640;
    --accent: #6ea1e6; --accent-ink: #0d1620; --accent-soft: #1d2e45;
    --ok: #62c08a; --ok-soft: #173326; --warn: #e3a645; --warn-soft: #3a2c12; --bad: #f07567; --bad-soft: #3d1c19;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11161b; --surface: #182028; --surface-2: #1d262f; --ink: #e5eaee; --muted: #94a2ae; --line: #2b3640;
  --accent: #6ea1e6; --accent-ink: #0d1620; --accent-soft: #1d2e45;
  --ok: #62c08a; --ok-soft: #173326; --warn: #e3a645; --warn-soft: #3a2c12; --bad: #f07567; --bad-soft: #3d1c19;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--f-body); }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; margin: 0; text-wrap: balance; letter-spacing: .01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
a { color: var(--accent); }
.mono { font-family: var(--f-mono); font-size: .88em; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.small { font-size: .85rem; }

/* Kabuk */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100%; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { font-family: var(--f-display); font-weight: 700; font-size: 1.35rem; letter-spacing: .06em; padding: 0 10px 14px; }
.brand small { display: block; font-family: var(--f-body); font-weight: 500; font-size: .72rem; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface-2); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav .count { background: var(--bad); color: #fff; border-radius: 10px; font-size: .72rem; padding: 0 7px; font-weight: 600; }
.side .me { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 10px 0; font-size: .88rem; display: grid; gap: 6px; }
.main { padding: 22px 28px 60px; min-width: 0; display: grid; gap: 18px; align-content: start; }
.pagehead { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.demo-band { background: var(--warn-soft); color: var(--warn); padding: 8px 14px; border-radius: 8px; font-size: .88rem; display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; align-items: center; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 16px; }
  .brand { padding: 0 8px 0 0; font-size: 1.1rem; }
  .brand small { display: none; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav a { padding: 6px 8px; font-size: .9rem; gap: 6px; }
  .side .me { margin: 0; border: 0; padding: 0; width: 100%; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
  .main { padding: 16px 16px 60px; }
}

/* Bileşenler */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; min-width: 0; }
.panel > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.panel > header > :first-child { min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
@media (max-width: 420px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat b { display: block; font-family: var(--f-display); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.btn { font: 600 .9rem var(--f-body); border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 7px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 3px 8px; font-size: .8rem; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.info { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 600; font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
tr.sub td { background: var(--surface-2); font-weight: 600; }

.bar { height: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; min-width: 70px; }
.bar i { display: block; height: 100%; background: var(--accent); }

.alerts { display: grid; gap: 8px; }
.alert { border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 8px; padding: 9px 12px; display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; background: var(--surface); }
.alert.bad { border-left-color: var(--bad); }
.alert.warn { border-left-color: var(--warn); }
.alert.info { border-left-color: var(--accent); }
.alert > div { min-width: 0; flex: 1 1 220px; }
.empty { color: var(--muted); font-size: .9rem; padding: 6px 0; }

.ack { background: var(--warn-soft); border: 1px solid var(--warn); border-radius: 10px; padding: 14px 16px; display: grid; gap: 10px; }
.ack h2 { color: var(--warn); }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 18px; }
.kv div span { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.addr { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; max-width: 100%; }
select.stage { padding: 3px 6px; font-size: .85rem; }

.timeline { display: grid; gap: 6px; }
.timeline .ev { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; font-size: .88rem; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.timeline .ev.imp { color: var(--ink); font-weight: 500; }
@media (max-width: 520px) { .timeline .ev { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* Üretim panosu */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font: 600 .85rem var(--f-body); border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.pill b { color: var(--muted); margin-left: 4px; }
.pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill.on b { color: #fff; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { min-width: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 8px; align-content: start; }
.col h3 { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.col h3 a { color: inherit; text-decoration: none; }
.col h3 a:hover { text-decoration: underline; }
.colbody { display: grid; gap: 8px; max-height: 68vh; overflow-y: auto; padding-right: 2px; }
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 10px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: grid; gap: 6px; font-size: .86rem; min-width: 0; overflow-wrap: anywhere; }
.cardhead { display: flex; justify-content: space-between; gap: 6px; align-items: start; }
.card summary { cursor: pointer; color: var(--muted); }
.pline { border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 6px; display: grid; gap: 4px; }

/* Aşama + tik */
.stagebox { display: grid; gap: 2px; min-width: 0; }
.stagerow { display: flex; gap: 6px; align-items: center; }
.stagerow select { flex: 1; min-width: 0; }
.tick { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border: 2px solid var(--line); border-radius: 6px; cursor: pointer; background: var(--surface); }
.tick input { appearance: none; -webkit-appearance: none; margin: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; background: transparent; }
.tick.on { background: var(--ok); border-color: var(--ok); }
.tick.on::after { content: '✓'; color: #fff; font-weight: 800; position: absolute; pointer-events: none; }
.tick { position: relative; }
.who { font-size: .76rem; color: var(--muted); }
.who .done { color: var(--ok); font-weight: 600; }

/* Kalem detayı */
.nowrap { white-space: nowrap; }
tr.lrow .caret { color: var(--muted); display: inline-block; width: 1em; }
tr.lrow.open td { background: var(--accent-soft); border-bottom-color: transparent; }
tr.linedetail > td { background: var(--accent-soft); padding: 4px 10px 14px; }
.ldetail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; }
.ldetail > div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.ldetail p { margin: 0; }
@media (max-width: 760px) { .ldetail { grid-template-columns: minmax(0, 1fr); } }
.checklist { display: grid; gap: 2px; }
.chk { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
.chk:hover { background: var(--surface-2); }
.chk input { width: 18px; height: 18px; margin: 0; accent-color: var(--ok); cursor: pointer; }
.chk.on .nm { font-weight: 600; }
.chk .by { font-size: .78rem; color: var(--ok); white-space: nowrap; }
.chk.cur { background: var(--ok-soft); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.thumbs a { display: block; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbph { display: grid; place-items: center; height: 100%; font-size: .75rem; padding: 6px; text-align: center; overflow-wrap: anywhere; }

/* Kalem yüzdesi */
.pct { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.pct .bar { flex: 1; min-width: 70px; height: 8px; }
.pct b { font-size: .82rem; min-width: 3.2em; text-align: right; }

/* Kaydedilmemiş kutucuklar */
.donetag { color: var(--ok); font-weight: 700; font-size: .78rem; white-space: nowrap; }
.chk.pend { outline: 1px dashed var(--warn); }
.pendtag { color: var(--warn); font-weight: 600; }
.sevkdate { display: flex; gap: 8px; align-items: center; justify-content: flex-end; font-size: .82rem; color: var(--muted); padding: 2px 8px 6px; }
.savebar { position: sticky; bottom: 8px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); border-radius: 8px; padding: 8px 10px; font-weight: 600; margin-top: 8px; }

/* Siparişler: firma başlıkları */
tr.grp td { background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 1.05rem; cursor: pointer; border-top: 2px solid var(--accent); padding: 10px 8px; box-shadow: inset 4px 0 0 var(--accent); }
tr.grp:hover td { background: var(--accent); color: var(--accent-ink); }
tr.grp:hover .caret { color: var(--accent-ink); }
tr.grp .caret { display: inline-block; width: 1em; color: var(--accent); }
tr.grp .chip { font-weight: 600; margin-left: 4px; }

/* Dosya bölümleri */
.filesecs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); gap: 14px; }
.filesec { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.filesec .upload { margin-bottom: 0; grid-template-columns: minmax(0, 1fr); }
.filesec .row { flex-wrap: wrap; }
.filesec .row select { flex: 1 1 130px; min-width: 0; width: 100%; }
.filelist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.filelist li { display: flex; justify-content: space-between; gap: 8px; align-items: start; border-top: 1px solid var(--line); padding-top: 6px; overflow-wrap: anywhere; }
.warnpanel { border-color: var(--warn); }

/* Form penceresi */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 18, 26, .45); display: grid; place-items: start center; padding: 40px 16px; overflow-y: auto; z-index: 10; }
.modal { background: var(--surface); border-radius: 12px; width: min(640px, 100%); padding: 18px; display: grid; gap: 14px; box-shadow: var(--shadow); }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form label { display: grid; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.form label.wide { grid-column: 1 / -1; }
.form label.check { display: flex; gap: 8px; align-items: center; color: var(--ink); }
.form .hint { font-weight: 400; font-size: .78rem; }
@media (max-width: 520px) { .form { grid-template-columns: minmax(0, 1fr); } }
.err { color: var(--bad); font-weight: 600; }
.toast { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: 8px; z-index: 20; font-weight: 600; }

/* Giriş */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login form { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; width: min(380px, 100%); display: grid; gap: 12px; }
.login .brand { padding: 0; font-size: 1.8rem; }
.login label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.demo-users { display: grid; gap: 4px; font-size: .85rem; }
.demo-users button { text-align: left; white-space: normal; }
.login form > * { min-width: 0; }

/* Notlar ve dosyalar */
.pre { white-space: pre-wrap; }
.composer { display: grid; gap: 8px; margin-bottom: 12px; }
.composer textarea { width: 100%; resize: vertical; }
.upload { display: grid; gap: 8px; margin-bottom: 12px; }
.drop { display: grid; gap: 2px; justify-items: center; text-align: center; padding: 18px 12px; border: 2px dashed var(--line); border-radius: 10px; cursor: pointer; color: var(--ink); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 760px) {
  .ldetail { position: sticky; left: 0; width: calc(100vw - 72px); }
  .panel header .small.muted { display: none; }
}
@media (max-width: 760px) {
  .ldetail { position: sticky; left: 0; width: calc(100vw - 72px); }
  .panel header .small.muted { display: none; }
}

.usage { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; padding: 12px 14px 14px; }
.ucard { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.ucard > span { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ucard > b { font-family: var(--f-display); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.ucard.wide { grid-column: 1 / -1; }
.ucard .bar.hot i { background: var(--bad, #c0392b); }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 110px; align-items: end; }
.days > div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 2px; font-size: .75rem; }
.days i { display: block; width: 70%; min-height: 2px; background: var(--accent, #2c6e9b); border-radius: 4px 4px 0 0; }
.days b { font-variant-numeric: tabular-nums; }
.days small { color: var(--muted); }

.chk.fasonrow { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 10px; }
.chk.fasonrow.on .nm { color: var(--warn); font-weight: 700; }
.chip.fasonchip { background: var(--warn-soft); color: var(--warn); }
.linenote { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.linenote textarea { width: 100%; min-height: 90px; resize: vertical; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink, inherit); }

.forecast .fcmonth { border-top: 1px solid var(--line); }
.forecast .fchead { all: unset; box-sizing: border-box; width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; }
.forecast .fchead:hover { background: var(--accent-soft); }
.forecast .fchead b { color: var(--accent); }
.forecast .fcmonth.late .fchead b { color: var(--bad); }
.forecast .fchead .caret { width: 1em; color: var(--muted); }
.forecast .fcmonth .tablewrap { padding: 0 14px 12px; }
.forecast td .pct { min-width: 120px; }
