/* ==========================================================================
   FABA STONE ERP — arayüz tasarım sistemi
   Renkler firma logosundan türetildi: mermer siyahı + altın.
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }

:root {
  --ink:      #0C1420;
  --navy:     #101B2B;
  --navy-2:   #18273C;
  --navy-3:   #22344E;

  --accent:   #A9752B;   /* butonlar, vurgu — beyaz yazı okunur */
  --accent-d: #8A5D1E;
  --accent-l: #C4A265;   /* logo altını, dekoratif */
  --accent-s: #FBF2E3;

  --stone:    #F5F3F0;
  --card:     #FFFFFF;
  --line:     #E3DFD9;
  --line-2:   #EFECE7;

  --muted:    #6B7580;
  --muted-2:  #98A1AB;

  --green:    #2E7D5B;  --green-s: #E6F2EC;
  --red:      #C0453B;  --red-s:   #FBEAE8;
  --blue:     #2E6FA8;  --blue-s:  #E9F1F8;
  --amber:    #B7791F;  --amber-s: #FBF0DC;

  --r-sm: 7px; --r: 10px; --r-lg: 14px;
  --sh:    0 1px 2px rgba(12,20,32,.06), 0 1px 3px rgba(12,20,32,.05);
  --sh-lg: 0 12px 32px rgba(12,20,32,.16);
  --side-w: 232px;

  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Consolas', 'SF Mono', 'Roboto Mono', monospace;
}

html { -webkit-text-size-adjust: 100% }
body {
  font-family: var(--font);
  background: var(--stone);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
.hidden { display: none !important }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit }
a { color: var(--accent); text-decoration: none }
code { font-family: var(--mono); font-size: .92em }

/* ---------------- AÇILIŞ ---------------- */
.boot {
  position: fixed; inset: 0; background: linear-gradient(155deg, #0A1119, #16263B 60%, #25405F);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; z-index: 999;
}
.boot img { width: 130px; opacity: .95 }
.boot p { color: #8FA3BC; font-size: 13px; letter-spacing: 1px }
.boot-bar { width: 180px; height: 3px; background: rgba(255,255,255,.14); border-radius: 99px; overflow: hidden }
.boot-bar i { display: block; height: 100%; width: 40%; background: var(--accent-l); border-radius: 99px; animation: slide 1.1s ease-in-out infinite }
@keyframes slide { 0% { margin-left: -40% } 100% { margin-left: 100% } }

/* ---------------- GİRİŞ ---------------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr }
.login-art {
  background: linear-gradient(155deg, #0A1119 0%, #16263B 55%, #25405F 100%);
  color: #fff; padding: 56px 52px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
}
.login-art::after {
  content: ''; position: absolute; right: -140px; top: -120px; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(196,162,101,.28), transparent 68%);
}
.login-art > * { position: relative; z-index: 2 }
.login-logo { width: 156px; margin-bottom: 34px }
.login-art h1 { font-size: 32px; line-height: 1.15; letter-spacing: -.8px; font-weight: 800 }
.login-art p { color: #B7C4D4; margin-top: 14px; font-size: 15px; line-height: 1.65; max-width: 420px }
.login-art ul { list-style: none; margin-top: 28px; display: grid; gap: 10px }
.login-art li { color: #CBD6E3; font-size: 13.5px; padding-left: 26px; position: relative }
.login-art li::before {
  content: '✓'; position: absolute; left: 0; top: -1px; color: var(--accent-l); font-weight: 700;
}
.login-box { display: flex; align-items: center; justify-content: center; padding: 40px 32px; background: var(--card) }
.login-box form { width: 100%; max-width: 340px }
.login-box h2 { font-size: 24px; letter-spacing: -.5px }
.login-box .sub { color: var(--muted); font-size: 13.5px; margin: 6px 0 26px }
.login-hint {
  margin-top: 24px; padding: 13px 15px; background: var(--stone); border: 1px solid var(--line);
  border-radius: var(--r); display: grid; gap: 3px;
}
.login-hint b { font-size: 11.5px; letter-spacing: .6px; color: var(--muted); text-transform: uppercase }
.login-hint span { font-size: 12.5px; color: #46505B }
.login-hint code { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px }

/* ---------------- UYGULAMA KABUĞU ---------------- */
.app { display: flex; min-height: 100vh }
.overlay {
  position: fixed; inset: 0; background: rgba(12,20,32,.5); z-index: 58; opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.overlay.on { opacity: 1; pointer-events: auto }

.sidebar {
  width: var(--side-w); flex: none; background: var(--navy); color: #9FB0C4;
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 60;
}
.side-logo {
  display: flex; align-items: center; gap: 11px; padding: 16px 18px 15px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.side-logo img { width: 32px; height: auto; opacity: .95 }
.side-logo b { display: block; color: #fff; font-size: 12.5px; letter-spacing: 1.8px }
.side-logo span { display: block; font-size: 9.5px; letter-spacing: 2.4px; color: #61748C; margin-top: 1px }

.nav { flex: 1; overflow-y: auto; padding: 10px 0 16px }
.nav-title {
  font-size: 9.5px; letter-spacing: 1.6px; color: #55677E; padding: 14px 18px 6px; text-transform: uppercase; font-weight: 600;
}
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 18px; font-size: 13.5px; color: #A6B6C9;
  border-left: 3px solid transparent; cursor: pointer; user-select: none;
}
.nav a i { font-style: normal; width: 18px; text-align: center; font-size: 14px; opacity: .85; flex: none }
.nav a:hover { background: rgba(255,255,255,.05); color: #DCE5EF }
.nav a.on { background: rgba(196,162,101,.15); color: #fff; border-left-color: var(--accent-l); font-weight: 600 }
.nav a .badge { margin-left: auto }

.side-user {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.09); background: rgba(0,0,0,.16);
}
.side-user-info { min-width: 0; flex: 1 }
.side-user b { display: block; color: #DDE5EE; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.side-user span { font-size: 10.5px; color: #67788E }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--navy-3); color: #fff;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: none;
}

.main { flex: 1; min-width: 0; margin-left: var(--side-w); display: flex; flex-direction: column }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--line); padding: 11px 22px;
  display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 40;
}
.crumb { font-size: 10.5px; color: var(--muted-2); letter-spacing: .5px; text-transform: uppercase; display: block }
.topbar h1 {
  font-size: 17px; letter-spacing: -.3px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-title { min-width: 0; flex: 1; overflow: hidden }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none }
.page-actions { display: flex; gap: 8px; align-items: center }

.view { padding: 20px 22px 40px; flex: 1 }
.tabbar { display: none }

/* ---------------- BİLEŞENLER ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh);
}
.card-pad { padding: 16px 18px }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--line-2);
}
.card-head h3 { font-size: 14px; letter-spacing: -.2px }
.card-head .sub { font-size: 11.5px; color: var(--muted-2); font-weight: 400 }
.card-body { padding: 16px 18px }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); background: #FAF9F7; border-radius: 0 0 var(--r) var(--r) }

.grid { display: grid; gap: 14px }
.grid > * { min-width: 0 }   /* içerik ızgara sütununu genişletip taşma yapmasın */
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)) }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)) }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)) }
.g-23 { grid-template-columns: minmax(0,1.7fr) minmax(0,1fr) }
.g-32 { grid-template-columns: minmax(0,1fr) minmax(0,1.6fr) }
.mt { margin-top: 14px } .mt-lg { margin-top: 22px } .mb { margin-bottom: 14px }

/* KPI */
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; position: relative; overflow: hidden; box-shadow: var(--sh) }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent) }
.kpi.blue::before { background: var(--blue) } .kpi.green::before { background: var(--green) }
.kpi.red::before { background: var(--red) } .kpi.gray::before { background: var(--muted-2) }
.kpi label { font-size: 10px; letter-spacing: .9px; color: var(--muted-2); text-transform: uppercase; font-weight: 600; display: block }
.kpi > b { display: block; font-size: 25px; font-weight: 700; letter-spacing: -1px; margin-top: 5px; line-height: 1.15 }
.kpi > b small { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0 }
.kpi .note b { font-weight: 700 }
.kpi .note { font-size: 11px; color: var(--muted); margin-top: 3px; display: block }
.kpi .note.up { color: var(--green) } .kpi .note.down { color: var(--red) }

/* Tablo */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch }
table { width: 100%; border-collapse: collapse; font-size: 13px }
th {
  text-align: left; font-size: 10px; letter-spacing: .9px; text-transform: uppercase; color: var(--muted-2);
  padding: 9px 12px; font-weight: 700; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FBFAF8;
}
td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); color: #333C46; vertical-align: middle }
tbody tr:last-child td { border-bottom: none }
tbody tr.clickable { cursor: pointer }
tbody tr.clickable:hover { background: #FAF8F5 }
td b, th.num, td.num { font-weight: 600 }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: -.2px }
.nowrap { white-space: nowrap }
.empty { padding: 44px 20px; text-align: center; color: var(--muted) }
.empty .big { font-size: 34px; display: block; margin-bottom: 10px; opacity: .35 }
.empty p { font-size: 13.5px }

/* Rozet */
.badge { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; white-space: nowrap }
.badge.green { background: var(--green-s); color: var(--green) }
.badge.red { background: var(--red-s); color: var(--red) }
.badge.blue { background: var(--blue-s); color: var(--blue) }
.badge.amber { background: var(--amber-s); color: var(--amber) }
.badge.gray { background: #EEF0F2; color: #63707E }
.badge.solid { background: var(--accent); color: #fff }

/* Buton */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--accent); color: #fff; border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 9px 15px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, opacity .15s; text-decoration: none;
}
.btn:hover { background: var(--accent-d) }
.btn:active { transform: translateY(1px) }
.btn:disabled { opacity: .5; cursor: not-allowed }
.btn-dark { background: var(--ink) } .btn-dark:hover { background: #1B2838 }
.btn-danger { background: var(--red) } .btn-danger:hover { background: #A5372E }
.btn-success { background: var(--green) } .btn-success:hover { background: #25664B }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line) }
.btn-outline:hover { background: var(--stone) }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line) }
.btn-ghost:hover { background: var(--stone) }
.btn-sm { padding: 6px 11px; font-size: 12px }
.btn-lg { padding: 13px 20px; font-size: 14.5px }
.btn-block { width: 100%; }
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r-sm); background: transparent; border: 1px solid transparent;
  display: grid; place-items: center; cursor: pointer; font-size: 15px; color: inherit; flex: none;
}
.icon-btn:hover { background: rgba(255,255,255,.09) }
.topbar .icon-btn:hover, .view .icon-btn:hover { background: var(--stone); border-color: var(--line) }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap }

/* Form */
label.field, .field { display: block; margin-bottom: 14px }
.field > span, label.field > span { display: block; font-size: 11.5px; font-weight: 600; color: #46505B; margin-bottom: 5px; letter-spacing: .2px }
.field .hint { font-size: 11px; color: var(--muted); margin-top: 4px; display: block; font-weight: 400 }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local],
input[type=search], input[type=tel], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(169,117,43,.13) }
input:disabled, select:disabled { background: var(--stone); color: var(--muted) }
textarea { min-height: 76px; resize: vertical }
select { appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7580' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 11px; padding-right: 32px }
.login-box label { display: block; margin-bottom: 15px; font-size: 12.5px; font-weight: 600; color: #46505B }
.login-box label input { margin-top: 6px }
.form-grid { display: grid; gap: 0 14px; grid-template-columns: repeat(2, minmax(0,1fr)) }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0,1fr)) }
.form-grid .span2 { grid-column: span 2 }
/* Seçim kutusunun yanındaki hızlı ekleme düğmesi */
.with-add { display: flex; gap: 8px; align-items: stretch }
.with-add select, .with-add input { flex: 1; min-width: 0 }
.with-add .add-btn { flex: none; padding: 0 15px; font-size: 19px; line-height: 1; font-weight: 400 }
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; margin-bottom: 14px }
.check input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer }

/* Uyarı kutusu */
.alert { padding: 11px 14px; border-radius: var(--r-sm); font-size: 13px; line-height: 1.55; margin-bottom: 14px; border: 1px solid }
.alert-error { background: var(--red-s); border-color: #EFCFCB; color: #8E2F27 }
.alert-ok { background: var(--green-s); border-color: #CBE3D8; color: #1F5A41 }
.alert-info { background: var(--blue-s); border-color: #CFE0EE; color: #23557F }
.alert-warn { background: var(--amber-s); border-color: #EEDCB6; color: #8A5A12 }
.alert b { display: block; margin-bottom: 2px }

/* İlerleme */
.bar { height: 6px; border-radius: 99px; background: #E7E3DD; overflow: hidden }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .3s }
.bar.green i { background: var(--green) } .bar.red i { background: var(--red) } .bar.blue i { background: var(--blue) }
.bar-label { font-size: 11px; color: var(--muted); margin-top: 4px; display: block }

/* Grafik */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 6px }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; min-width: 0 }
.chart .col i { width: 100%; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #D2A868, var(--accent)); display: block; min-height: 2px; position: relative }
.chart .col i.g { background: linear-gradient(180deg, #7FBFA1, var(--green)) }
.chart .col i.r { background: linear-gradient(180deg, #DE9089, var(--red)) }
.chart .col span { font-size: 10px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100% }
.chart .col em { font-size: 10.5px; font-style: normal; font-weight: 700; color: #46505B }

/* Depo haritası */
.rack { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 5px }
.cell {
  aspect-ratio: 1; border-radius: 5px; background: #E9E5DF; display: grid; place-items: center;
  font-size: 9.5px; font-weight: 700; color: #929BA5; cursor: pointer; border: 1.5px solid transparent; user-select: none;
}
.cell:hover { border-color: var(--ink) }
.cell.full { background: var(--accent); color: #fff }
.cell.part { background: #E2C08C; color: #6E4A12 }
.cell.res  { background: var(--blue); color: #fff }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: #4B555F; margin-top: 12px }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px }

/* Hammadde akış şeridi */
.akis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px }
.akis-adim {
  border: 1px solid var(--line); border-radius: var(--r); padding: 12px 12px 13px; background: #fff;
  transition: border-color .15s, transform .15s; min-width: 0;
}
.akis-adim:hover { border-color: var(--accent); transform: translateY(-2px) }
.akis-ust { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 7px }
.akis-simge { font-size: 19px; line-height: 1 }
.akis-ad { display: block; font-size: 11.8px; line-height: 1.3; min-height: 30px }
.akis-ton { font-size: 20px; font-weight: 700; letter-spacing: -.7px; margin-top: 5px }
.akis-ton small { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0 }
.akis-bar { height: 4px; border-radius: 99px; background: #EDEAE5; overflow: hidden; margin: 7px 0 6px }
.akis-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px }
.akis-aciklama { font-size: 10.5px; color: var(--muted-2); line-height: 1.4 }

/* Fotoğraf şeridi (en fazla 5) */
.foto-serit { display: flex; gap: 10px; flex-wrap: wrap }
.foto-kutu { position: relative; width: 118px; height: 118px; border-radius: var(--r-sm);
  overflow: hidden; border: 1px solid var(--line); background: #F2EFEA }
.foto-kutu img { width: 100%; height: 100%; object-fit: cover; display: block }
.foto-sil {
  position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(11,17,25,.7); color: #fff; font-size: 13px; border: 0; line-height: 1;
  display: grid; place-items: center; cursor: pointer;
}
.foto-sil:hover { background: var(--red) }

/* Uygulama indirme kartı (giriş ekranı) */
.apk-indir {
  display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 13px 15px;
  border: 1px solid var(--line); border-radius: var(--r); background: #FAF8F5;
  text-decoration: none; color: var(--ink); transition: border-color .15s, background .15s;
}
.apk-indir:hover { border-color: var(--accent); background: #F5F0E8 }
.apk-indir .apk-ik { font-size: 22px; line-height: 1 }
.apk-indir .apk-yazi { flex: 1; min-width: 0 }
.apk-indir .apk-yazi b { display: block; font-size: 13.5px }
.apk-indir .apk-yazi small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px }
.apk-indir .apk-ok { font-size: 18px; color: var(--accent); font-weight: 700 }

/* Görünüm değiştirme bağlantıları (telefon ↔ bilgisayar) */
.login-gorunum { margin-top: 16px; text-align: center; font-size: 13px; color: var(--muted) }
.login-gorunum a { color: var(--accent); font-weight: 600 }
.side-gorunum {
  display: block; margin: 0 12px 12px; padding: 11px 12px; border-radius: var(--r-sm);
  background: rgba(255,255,255,.07); color: #D8CFC2; font-size: 12.5px; font-weight: 600;
  text-align: center; text-decoration: none;
}
.side-gorunum:hover { background: rgba(255,255,255,.13); color: #fff }

/* Göz içeriği penceresinde palet seçim satırı */
.secim-satir {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-bottom: 1px solid var(--line-2); cursor: pointer;
}
.secim-satir:last-child { border-bottom: none }
.secim-satir:hover { background: #FAF8F5 }
.secim-satir input { width: 17px; height: 17px; flex: none; accent-color: var(--accent) }
.secim-satir b { display: block; font-size: 13.5px }
.secim-satir small { display: block; font-size: 11.8px; color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.secim-satir input:disabled { opacity: .35 }
.secim-satir:has(input:disabled) { opacity: .5; cursor: not-allowed }

/* Parti dağılım yığını */
.parti { padding: 13px 0; border-bottom: 1px solid var(--line-2); cursor: pointer }
.parti:last-child { border-bottom: none }
.parti:hover { background: #FAF8F5 }
.parti-ust { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 9px }
.parti-alt { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px }
.yigin { display: flex; height: 9px; border-radius: 99px; overflow: hidden; background: #EDEAE5 }
.yigin i { display: block; height: 100% }
.yigin-etiket { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 7px; font-size: 11px; color: #4B555F }
.yigin-etiket i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px }

/* "Şu an nerede" kartı */
.nerede {
  border-radius: var(--r); padding: 16px 18px; display: flex; align-items: center; gap: 15px;
  border: 1px solid; margin-bottom: 14px;
}
.nerede .sim { font-size: 32px; line-height: 1; flex: none }
.nerede b { display: block; font-size: 16px; letter-spacing: -.2px }
.nerede .det { font-size: 13.5px; margin-top: 3px; font-weight: 600 }
.nerede .alt { font-size: 12px; opacity: .85; margin-top: 2px }
.nerede.green { background: var(--green-s); border-color: #CBE3D8; color: #1F5A41 }
.nerede.blue { background: var(--blue-s); border-color: #CFE0EE; color: #23557F }
.nerede.amber { background: var(--amber-s); border-color: #EEDCB6; color: #8A5A12 }
.nerede.gray { background: #F1F2F4; border-color: #E1E4E8; color: #4B555F }
.nerede.red { background: var(--red-s); border-color: #EFCFCB; color: #8E2F27 }

/* İzlenebilirlik zinciri */
.chain { position: relative; padding-left: 26px }
.chain::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 10px; width: 2px; background: var(--line) }
.chain-item { position: relative; padding-bottom: 16px }
.chain-item::before {
  content: ''; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent);
}
.chain-item:last-child { padding-bottom: 0 }
.chain-step { font-size: 10.5px; letter-spacing: .7px; text-transform: uppercase; color: var(--accent-d); font-weight: 700 }
.chain-title { font-size: 13.5px; font-weight: 600; margin-top: 2px }
.chain-detail { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.5 }
.chain-at { font-size: 11px; color: var(--muted-2); margin-top: 2px; font-family: var(--mono) }

/* Tanım listesi */
.dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: 13px; align-items: baseline }
.dl dt { color: var(--muted); white-space: nowrap }
.dl dd { font-weight: 600; text-align: right }

/* Filtre çubuğu */
.filters {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px;
}
.filters .field { margin: 0; min-width: 140px; flex: 1 }
.filters .field.grow { flex: 2.2 }
.filters .btn { margin-bottom: 0 }
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px }
.chip {
  padding: 6px 13px; border-radius: 99px; border: 1px solid var(--line); background: #fff;
  font-size: 12.5px; cursor: pointer; font-weight: 600; color: #4B555F;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff }

/* Modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(12,20,32,.55); z-index: 80; display: flex;
  align-items: center; justify-content: center; padding: 20px; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-lg); width: 100%; max-width: 560px;
  max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .16s ease-out;
}
.modal.wide { max-width: 860px }
.modal.narrow { max-width: 400px }
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0 } }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 12px }
.modal-head h3 { font-size: 16px; flex: 1; letter-spacing: -.2px }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1 }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 9px; justify-content: flex-end; background: #FAF9F7; border-radius: 0 0 var(--r-lg) var(--r-lg) }

/* Bildirim */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 9px; max-width: min(400px, calc(100vw - 32px)) }
.toast {
  background: var(--ink); color: #fff; padding: 12px 15px; border-radius: var(--r); box-shadow: var(--sh-lg);
  font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; animation: pop .18s ease-out; line-height: 1.5;
}
.toast.ok { background: var(--green) } .toast.err { background: var(--red) } .toast.warn { background: var(--amber) }
.toast b { display: block }
.toast .x { margin-left: auto; cursor: pointer; opacity: .7; font-size: 16px; line-height: 1 }

/* QR tarayıcı */
.scanner { background: #000; border-radius: var(--r); overflow: hidden; position: relative; aspect-ratio: 4/3 }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block }
.scanner-frame {
  position: absolute; inset: 12%; border: 3px solid rgba(255,255,255,.85); border-radius: 12px;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); transition: border-color .15s, box-shadow .15s;
}
.scanner-frame.vurdu { border-color: #34D07F; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35), 0 0 26px 4px rgba(52,208,127,.75) }
.scanner-hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: #fff; font-size: 12.5px; text-shadow: 0 1px 3px #000 }
.scan-tools { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap }
.scan-tools .btn.on { background: var(--accent); color: #fff; border-color: var(--accent) }
.scan-motor { margin-left: auto; font-size: 10.5px; color: var(--muted-2); letter-spacing: .4px }
.scan-manual { display: flex; gap: 8px; margin-top: 12px; width: 100% }
/* min-width:0 olmadan input kendi doğal genişliğini dayatır ve dar ekranda taşma yapar */
.scan-manual input { flex: 1; min-width: 0; font-family: var(--mono); text-transform: uppercase }
.scan-manual .btn { flex: none }

/* Fotoğraf */
.photo-box {
  border: 2px dashed var(--line); border-radius: var(--r); padding: 20px; text-align: center; cursor: pointer;
  background: var(--stone); color: var(--muted); font-size: 13px;
}
.photo-box:hover { border-color: var(--accent); color: var(--accent-d) }
.photo-box .big { font-size: 28px; display: block; margin-bottom: 6px }
.photo-prev { position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line) }
.photo-prev img { width: 100%; display: block; max-height: 260px; object-fit: cover }
.photo-prev .rm {
  position: absolute; top: 8px; right: 8px; background: rgba(12,20,32,.8); color: #fff; border: 0;
  border-radius: 6px; padding: 6px 11px; font-size: 12px; cursor: pointer;
}

/* Yükleniyor */
.loading { padding: 50px; text-align: center; color: var(--muted); font-size: 13.5px }
.spinner {
  width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg) } }
.skeleton { background: linear-gradient(90deg, #ECE9E4 25%, #F6F4F1 50%, #ECE9E4 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; height: 14px }
@keyframes sk { to { background-position: -200% 0 } }

/* Yazdırma */
@media print {
  .sidebar, .topbar, .tabbar, .toasts, .page-actions, .filters, .btn { display: none !important }
  .main { margin-left: 0 } .view { padding: 0 }
  .card { box-shadow: none; border-color: #ccc }
}

/* ==================== DUYARLI TASARIM ==================== */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0,1fr)) }
  .g-23, .g-32 { grid-template-columns: 1fr }
  .akis { grid-template-columns: repeat(4, minmax(0,1fr)) }
}
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr }
  .login-art { display: none }
  .login-box { min-height: 100vh }
  .g3 { grid-template-columns: repeat(2, minmax(0,1fr)) }
  .form-grid, .form-grid.g3 { grid-template-columns: 1fr }
  .form-grid .span2 { grid-column: auto }
  .rack { grid-template-columns: repeat(6, minmax(0,1fr)) }
}
@media (max-width: 720px) {
  body { font-size: 14.5px }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease-out; box-shadow: var(--sh-lg) }
  .sidebar.open { transform: none }
  .main { margin-left: 0 }
  /* Dar ekranda başlık ile düğmeler yan yana sığmıyor: düğmeler alt satıra iner */
  .topbar { padding: 9px 14px; flex-wrap: wrap; row-gap: 8px }
  .topbar h1 { font-size: 16px }
  .topbar-actions { flex-basis: 100%; justify-content: flex-start; overflow-x: auto; scrollbar-width: none }
  .topbar-actions::-webkit-scrollbar { display: none }
  .page-actions { flex: 1; justify-content: flex-start }
  .view { padding: 14px 14px 92px }
  .g2, .g3, .g4 { grid-template-columns: 1fr }
  .akis { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px }
  .akis-ad { min-height: 0 }
  .parti-ust { flex-direction: column; gap: 4px }
  .parti-ust > div:last-child { text-align: left !important }
  .kpi > b { font-size: 23px }
  .card-head, .card-body, .card-pad { padding-left: 14px; padding-right: 14px }
  th, td { padding: 9px 10px }
  .hide-sm { display: none }
  .filters { padding: 11px 12px }
  .filters .field { min-width: 100%; flex: none }
  .modal-back { padding: 0; align-items: flex-end }
  .modal { max-width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92vh }
  .modal.wide, .modal.narrow { max-width: 100% }
  .toasts { left: 12px; right: 12px; bottom: 78px; max-width: none }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fff;
    border-top: 1px solid var(--line); padding: 6px 2px calc(6px + env(safe-area-inset-bottom)); z-index: 50;
  }
  .tabbar a {
    flex: 1; text-align: center; font-size: 10px; color: var(--muted-2); padding: 4px 2px; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0;
  }
  .tabbar a i { font-style: normal; font-size: 18px; opacity: .55 }
  .tabbar a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100% }
  .tabbar a.on { color: var(--accent-d); font-weight: 700 }
  .tabbar a.on i { opacity: 1 }
  .only-mobile { display: flex }
}
@media (min-width: 721px) { .only-mobile { display: none !important } }
