/* Aktürk Makina Sipariş Programı — siyah + altın kompakt tema (masaüstü sürüm paleti) */
:root {
  --bg: #0a0a0c;
  --card: #141417;
  --card-border: #26262c;
  --header: #1b1b20;
  --field: #1c1c21;
  --field-border: #303037;
  --field-focus: #e7b94e;
  --gold: #e7b94e;
  --gold-soft: #25211a;
  --gold-line: #78602c;
  --gold-ink: #1a1a10;
  --ink: #f2f2f4;
  --muted: #bcbcc8;
  --faint: #7a7a85;
  --pending: #232329;
  --danger: #e06767;
  --danger-bg: #4a2020;
  --ok: #5fc48d;
  --radius: 13px;
  --radius-sm: 9px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }
[hidden] { display: none !important; }

.boot { display: grid; place-items: center; height: 100vh; }
.boot-logo, .logo-a {
  width: 34px; height: 34px; border-radius: 9px; background: var(--gold); color: var(--gold-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 16px; flex: none; user-select: none;
}
.boot-logo { width: 64px; height: 64px; font-size: 30px; border-radius: 16px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--header);
  display: flex; align-items: center; gap: 12px; padding: 10px 18px; min-height: 60px;
  border-bottom: 1px solid var(--card-border);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.brand-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-title.big { font-size: 19px; letter-spacing: .3px; }
.brand button.logo-a { border: 0; cursor: pointer; }
.top-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.btn {
  border: 1px solid #3a3a42; background: #26262c; color: var(--ink); border-radius: var(--radius-sm);
  padding: 7px 13px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; line-height: 1.3;
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
}
.btn:hover { border-color: #55555f; background: #2e2e35; }
.btn:focus-visible, .chip:focus-visible, .shaft-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.btn.gold:hover { background: #f0c662; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); font-weight: 500; }
.btn.ghost:hover { color: var(--ink); background: #232329; }
.btn.outline-gold { background: #221e14; color: var(--gold); border-color: var(--gold-line); }
.btn.danger { color: #ffb4b4; border-color: #5c2c2c; background: #2a1717; }
.btn.lg { padding: 11px 22px; font-size: 14px; }
.btn.block { width: 100%; }

/* ---------- layout ---------- */
.shell { max-width: 760px; margin: 0 auto; padding: 0 16px 24px; }
.shell.wide { max-width: 1240px; }

.rail { display: flex; align-items: flex-start; justify-content: center; gap: 0; padding: 18px 4px 14px; }
.rail-step { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 84px; flex: none; }
.rail-dot {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  background: var(--pending); color: var(--faint); font-size: 14px;
}
.rail-step.active .rail-dot, .rail-step.done .rail-dot { background: var(--gold); color: var(--gold-ink); }
.rail-text { font-size: 12px; color: var(--faint); font-weight: 600; }
.rail-step.active .rail-text, .rail-step.done .rail-text { color: var(--ink); }
.rail-bar { height: 3px; flex: 1; max-width: 110px; background: var(--pending); margin-top: 16px; border-radius: 2px; }
.rail-bar.done { background: var(--gold); }

.card {
  background: var(--card); border: 1.5px solid var(--card-border); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 12px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title { font-size: 16px; font-weight: 700; margin: 0; }
.card-title.gold { color: var(--gold); font-size: 14px; }
.badge {
  background: var(--gold-soft); color: var(--gold); font-weight: 700; font-size: 12px; padding: 5px 10px;
  border-radius: 8px; white-space: nowrap;
}
.badge.muted { background: #232329; color: var(--muted); }
.badge.ok { background: #16301f; color: var(--ok); }
.badge.warn { background: #3a1d1d; color: #ff9d9d; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.span2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; background: var(--field); border: 1.5px solid var(--field-border); border-radius: var(--radius-sm);
  padding: 8px 11px; min-height: 38px; outline: none; color: var(--ink);
}
textarea.input { resize: vertical; min-height: 80px; line-height: 1.4; }
.input:focus { border-color: var(--field-focus); }
.input[readonly] { color: var(--muted); background: #18181c; }
.input.error { border-color: var(--danger); background: var(--danger-bg); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
select.input option { background: #1c1c21; color: var(--ink); }
input[type="date"].input { color-scheme: dark; }
/* Yazılabilir açılır kutu (masaüstü ComboBox): tıklanınca her zaman tüm liste görünür. */
.combo { position: relative; }
.combo > .input { padding-right: 36px; }
.combo-btn {
  position: absolute; top: 2px; right: 2px; bottom: 2px; width: 32px; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 13px; border-radius: var(--radius-sm);
}
.combo-btn:hover { color: var(--gold); }
.combo-list {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow-y: auto;
  background: var(--field); border: 1.5px solid var(--gold-line); border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .55); padding: 4px;
}
.combo-opt { padding: 8px 10px; border-radius: 7px; cursor: pointer; overflow-wrap: anywhere; }
.combo-opt.sel { color: var(--gold); font-weight: 700; }
.combo-opt.active, .combo-opt:hover { background: var(--gold-soft); }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.hint.small { font-size: 12px; color: var(--faint); }

.toggle {
  border: 1.5px solid var(--field-border); background: var(--field); color: var(--ink); border-radius: var(--radius-sm);
  min-height: 38px; font-weight: 700; cursor: pointer; padding: 7px 12px;
}
.toggle.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }

.navbar {
  position: sticky; bottom: 0; z-index: 10; background: linear-gradient(180deg, rgba(10,10,12,0) 0, var(--bg) 26%);
  padding: 18px 0 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.navinfo { color: var(--faint); font-size: 12px; text-align: center; flex: 1; }

/* ---------- ürün kartları ---------- */
.product { border: 1.5px solid var(--card-border); border-radius: var(--radius); background: #17171b; padding: 14px; margin-bottom: 12px; }
.product.blank { border-style: dashed; }
.product-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.product-title { font-weight: 700; color: var(--gold); font-size: 14px; }
.harvester-line {
  display: flex; align-items: center; gap: 8px; justify-content: space-between; background: var(--field);
  border-radius: var(--radius-sm); padding: 6px 6px 6px 11px; margin-bottom: 10px;
}
.harvester-line span { font-weight: 700; font-size: 12.5px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-image { background: #101013; border-radius: var(--radius-sm); display: grid; place-items: center; height: 150px; overflow: hidden; }
.product-image img { max-width: 100%; max-height: 146px; object-fit: contain; }
.qty { display: flex; align-items: stretch; }
.qty button { width: 38px; border: 1.5px solid var(--field-border); background: #232329; cursor: pointer; font-weight: 800; font-size: 16px; }
.qty button:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.qty button:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.qty input { border-radius: 0; text-align: center; font-weight: 700; border-left: 0; border-right: 0; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.shafts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.shaft-card {
  background: #1d1d22; border: 1.5px solid var(--field-border); border-radius: var(--radius-sm); padding: 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0;
}
.shaft-card img { width: 100%; height: 64px; object-fit: contain; background: #18181c; border-radius: 6px; }
.shaft-card .noimg { width: 100%; height: 64px; display: grid; place-items: center; color: var(--faint); font-size: 11px; background: #18181c; border-radius: 6px; }
.shaft-card b { font-size: 12px; text-align: center; }
.shaft-card.selected { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.shaft-card.selected img, .shaft-card.selected .noimg { background: #f6dc9a; }
.shafts.error .shaft-card { border-color: var(--danger); }
.shaft-mixed { font-size: 12px; color: var(--gold); margin-top: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1.5px solid var(--field-border); background: var(--field); border-radius: 999px; padding: 6px 12px;
  cursor: pointer; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.chip.on::before { content: "✓"; font-weight: 900; }

.attach-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.attach-list li { display: flex; align-items: center; gap: 8px; background: var(--field); border-radius: var(--radius-sm); padding: 6px 6px 6px 11px; }
.attach-list li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; }
.attach-list li a:hover { color: var(--gold); }
.filetype { font-size: 11px; font-weight: 800; color: var(--gold); background: var(--gold-soft); padding: 2px 6px; border-radius: 5px; }

/* ---------- özet ---------- */
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.kv { min-width: 0; }
.kv .k { font-size: 11px; color: var(--muted); }
.kv .v { font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }

/* ---------- tablolar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.toolbar .field { flex: 1 1 140px; }
.table-wrap { overflow: auto; border: 1.5px solid var(--card-border); border-radius: var(--radius); max-height: 60vh; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { position: sticky; top: 0; background: var(--header); color: var(--gold); text-align: left; padding: 9px 10px; font-size: 12px; white-space: nowrap; z-index: 1; }
table.data td { padding: 8px 10px; border-top: 1px solid #222228; vertical-align: top; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td, table.data tr.sel td { background: #1f1d17; }
table.data td.num { text-align: center; }
table.data td.pre { white-space: pre-wrap; max-width: 520px; }
td .mono { font-family: Consolas, monospace; font-size: 11px; color: var(--faint); }
.count-line { color: var(--muted); font-size: 12.5px; margin: 8px 2px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- yönetici ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 16px 0 12px; border-bottom: 1px solid var(--card-border); }
.tab { background: none; border: 0; border-bottom: 2.5px solid transparent; padding: 9px 13px; color: var(--muted); font-weight: 700; cursor: pointer; }
.tab.active { color: var(--gold); border-color: var(--gold); }
/* Portal ana sayfası: kullanıcıya tanımlı programlar */
.home-hello { font-size: 20px; font-weight: 700; margin: 22px 0 14px; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.app-card {
  position: relative; text-align: left; background: var(--card); border: 1.5px solid var(--card-border); border-radius: var(--radius);
  padding: 18px 18px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; min-height: 132px;
  transition: border-color .15s, transform .15s;
}
.app-card:hover, .app-card:focus-visible { border-color: var(--gold); transform: translateY(-1px); outline: none; }
.app-dot { width: 34px; height: 6px; border-radius: 3px; display: block; }
.app-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.app-icon svg { width: 26px; height: 26px; }
.login .brand .app-icon { width: 52px; height: 52px; }
.company-logo { height: 34px; width: auto; max-width: 160px; object-fit: contain; background: #fff; border-radius: 7px; padding: 3px 6px; }
.section-title { font-size: 16px; margin: 22px 0 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1.5px solid var(--card-border); border-radius: var(--radius); padding: 14px 16px; }
.stat.warn { border-color: var(--danger); }
.stat-value { font-size: 22px; font-weight: 800; }
.stat.warn .stat-value { color: #ff9d9d; }
.stat-label { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.app-title { font-size: 17px; font-weight: 700; }
.app-desc { color: var(--muted); font-size: 13px; line-height: 1.45; }
.module-picks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.module-pick { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.module-pick i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.info-card { background: var(--card); border: 1.5px solid var(--card-border); border-radius: var(--radius); padding: 16px; }
.info-card h3 { margin: 0 0 8px; font-size: 15px; color: var(--gold); }
.info-card p { margin: 3px 0; color: var(--muted); line-height: 1.5; }
.info-card p b { color: var(--ink); }
.split { display: grid; grid-template-columns: 340px 1fr; gap: 14px; align-items: start; }
.list-editor { display: flex; flex-direction: column; gap: 6px; }
.list-row { display: grid; gap: 6px; align-items: center; background: #17171b; border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 8px; }
.list-row.prod { grid-template-columns: 1fr auto auto auto; }
.list-row.shaft { grid-template-columns: 1fr 1fr; }
.list-row.opt { grid-template-columns: 1fr auto; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid #3a3a42; background: #232329; cursor: pointer; font-weight: 800; }
.icon-btn:hover { border-color: var(--gold-line); color: var(--gold); }

/* ---------- modallar ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.66); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal {
  background: var(--card); border: 1.5px solid var(--card-border); border-radius: 16px; width: 100%; max-width: 520px;
  max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.modal.wide { max-width: 1100px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--card-border); gap: 10px; }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-body p { line-height: 1.5; margin: 0 0 10px; white-space: pre-line; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--card-border); flex-wrap: wrap; }
.missing-list { margin: 6px 0 0; padding-left: 18px; color: #ffc2c2; line-height: 1.6; }
.pdf-links { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.pdf-group { background: #17171b; border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 10px 12px; }
.pdf-group b { color: var(--gold); display: block; margin-bottom: 8px; }
.pdf-group .row { display: flex; gap: 6px; flex-wrap: wrap; }

.menu { position: absolute; top: 54px; left: 14px; background: var(--header); border: 1px solid #33333b; border-radius: 12px; padding: 6px; z-index: 50; min-width: 230px; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.menu button:hover { background: #2a2a31; color: var(--gold); }
.menu hr { border: 0; border-top: 1px solid #33333b; margin: 4px 0; }
.menu .kbd { float: right; color: var(--faint); font-size: 11px; margin-left: 12px; }

#toast-root { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #24242a; border: 1px solid #3a3a42; padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: 0 8px 30px rgba(0,0,0,.5); max-width: 90vw; }
.toast.ok { border-color: #2c6a45; color: #b4f2cd; }
.toast.err { border-color: #7a3030; color: #ffc2c2; }

/* ---------- giriş ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 380px; }
.login .brand { margin-bottom: 18px; justify-content: center; }
.login .logo-a { width: 46px; height: 46px; font-size: 22px; border-radius: 12px; }
.login h1 { font-size: 18px; margin: 0; }
.login .sub { color: var(--muted); font-size: 12.5px; }
.form-stack { display: flex; flex-direction: column; gap: 12px; }
.error-box { background: var(--danger-bg); color: #ffd0d0; border-radius: var(--radius-sm); padding: 8px 11px; font-size: 13px; }
.foot-note { color: var(--faint); font-size: 11.5px; text-align: center; margin-top: 14px; }

.spinner { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.busy { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 18px 4px; color: var(--muted); }

/* ---------- dar ekran ---------- */
@media (max-width: 720px) {
  .topbar { padding: 8px 12px; flex-wrap: wrap; }
  .brand-title { font-size: 13px; }
  .hide-sm { display: none !important; }
  .grid2, .summary-grid, .info-grid, .split { grid-template-columns: 1fr; }
  .shafts { grid-template-columns: repeat(2, 1fr); }
  .rail-step { width: 62px; }
  .rail-text { font-size: 11px; }
  .card { padding: 14px; }
  .list-row.prod, .list-row.shaft { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .brand { flex: 0 0 auto; }
  .brand-title:not(.big) { display: none; }
  .brand-title.big { font-size: 15px; }
  .top-actions .btn { padding: 7px 10px; }
}
