/* Dosya: cost/assets/css/app.css  ·  Tüm sayfaların ortak stilleri (satış sistemiyle aynı tasarım, turuncu tema) */

/* =========================================================
   Renkler ve ölçüler
   ========================================================= */
:root {
  --bg: #F4F6FA;          /* sayfa zemini */
  --surface: #FFFFFF;     /* kartlar, sidebar */
  --line: #ECEFF4;        /* ince çizgiler */
  --line-strong: #E1E6EE; /* kontrol kenarlıkları */
  --ink: #1A2233;         /* ana metin */
  --ink-2: #5A6478;       /* ikincil metin */
  --ink-3: #9AA3B2;       /* soluk metin */

  --acc: #F5892B;         /* ana vurgu (aktif menü, butonlar) */
  --acc-strong: #E06F12;
  --acc-soft: #FFF1E4;
  --acc2: #FFC46B;        /* gradyan bitişi (amber) */
  --acc2-strong: #F2A62E;
  --ok: #2CB67D;          /* durum noktası: senkron başarılı */

  --up: #15935A;   --up-bg: #E7F7EF;
  --down: #D93D42; --down-bg: #FDEDEE;
  --warn: #B7791F; --warn-bg: #FEF6E7;

  --r-card: 14px;
  --r-control: 10px;
  --sidebar-w: 256px;
  --sidebar-w-collapsed: 84px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 6px; }
.ic { width: 18px; height: 18px; flex-shrink: 0; }

/* =========================================================
   İskelet: sidebar + içerik
   ========================================================= */
.shell { display: grid; grid-template-columns: auto 1fr; min-height: 100vh; }

/* Daraltma animasyonu: genişlik, iç boşluklar ve yazıların saydamlığı birlikte geçiş yapar */
.sidebar {
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur: .28s;
  position: sticky; top: 0; height: 100vh; width: var(--sidebar-w); display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px 16px;
  overflow-x: hidden; overflow-y: auto; transition: width var(--dur) var(--ease);
}
.sb-head { display: flex; align-items: center; gap: 8px; padding: 0 6px 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.logo { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-decoration: none; display: flex; flex-direction: column;
  transition: flex-grow var(--dur) var(--ease), opacity .18s var(--ease); }
.logo-name { font-size: 20px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.logo-sub { font-size: 12px; color: var(--ink-3); }
.sb-collapse { flex-shrink: 0; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink-3); transition: color .15s, background .15s; }
.sb-collapse:hover { color: var(--ink); background: var(--bg); }
.sb-collapse svg { transition: transform var(--dur) var(--ease); }

.sb-label { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 0 10px; margin: 6px 0 8px; white-space: nowrap; transition: opacity .18s var(--ease); }
.sb-nav ul { list-style: none; display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.sb-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-control); text-decoration: none; color: var(--ink-2); font-weight: 500; white-space: nowrap;
  transition: background .15s, color .15s, padding var(--dur) var(--ease); }
.sb-link span { transition: opacity .18s var(--ease); }
.sb-link:hover { background: var(--bg); color: var(--ink); }
.sb-link.active { background: var(--acc); color: #fff; box-shadow: 0 6px 14px -8px rgba(224, 111, 18, .75); }
.sb-link.active .ic { color: #fff; }

.sb-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.branch-status { display: flex; align-items: flex-start; gap: 10px; padding: 6px 10px; transition: padding var(--dur) var(--ease); }
.bs-text { display: flex; flex-direction: column; min-width: 0; white-space: nowrap; transition: opacity .18s var(--ease); }
.bs-text b { font-weight: 500; font-size: 13px; color: var(--ink); }
.bs-text small { font-size: 12px; color: var(--ink-3); }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--ink-3); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(44, 182, 125, .15); }
.dot.acc { background: var(--acc); box-shadow: 0 0 0 3px rgba(245, 137, 43, .15); }
.dot.bad { background: var(--down); box-shadow: 0 0 0 3px rgba(217, 61, 66, .12); }
.dot.off { background: #CDD3DD; }

/* Daraltılmış hali (masaüstü): yazılar solar, ikonlar ortalanır */
.sb-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.sb-collapsed .logo { flex-grow: 0; flex-basis: 0; opacity: 0; pointer-events: none; }
.sb-collapsed .sb-collapse svg { transform: rotate(180deg); }
.sb-collapsed .sb-label,
.sb-collapsed .sb-link span,
.sb-collapsed .bs-text { opacity: 0; pointer-events: none; }
.sb-collapsed .sb-link { padding-left: 19px; padding-right: 19px; }   /* 56px alanda 18px ikon ortada */
.sb-collapsed .branch-status { padding-left: 24px; }                   /* 8px nokta ortada */
/* Genişlerken yazılar, sidebar açıldıktan sonra belirsin */
.sidebar .logo, .sidebar .sb-label, .sidebar .sb-link span, .sidebar .bs-text { transition-delay: .08s; }
.sb-collapsed .sidebar .logo, .sb-collapsed .sidebar .sb-label, .sb-collapsed .sidebar .sb-link span, .sb-collapsed .sidebar .bs-text { transition-delay: 0s; }

.content { min-width: 0; display: flex; flex-direction: column; }
.sb-overlay { display: none; }

/* =========================================================
   Üst bar
   ========================================================= */
.topbar { display: flex; align-items: center; gap: 16px; padding: 18px 28px; border-bottom: 1px solid var(--line); }
.tb-title { min-width: 0; margin-right: auto; }
.tb-title h1 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.tb-title p { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.tb-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn.menu-btn { display: none; }

.page { padding: 20px 28px 40px; display: flex; flex-direction: column; gap: 16px; }

/* =========================================================
   Kontroller
   ========================================================= */
.control {
  height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-control);
  background: var(--surface); font-size: 14px; color: var(--ink); min-width: 0;
}
.control:hover { border-color: #CDD4DF; }
.select {
  padding-right: 34px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%235A6478' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.control-sm { height: 32px; font-size: 13px; padding: 0 10px; border-radius: 8px; }
.select.control-sm { padding-right: 30px; background-position: right 10px center; }
.search.control-sm { padding-left: 32px; background-position: 10px center; }
.search { padding-left: 34px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239AA3B2' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M14 14l-3.2-3.2'/%3E%3C/svg%3E") no-repeat 11px center; }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); text-decoration: none;
}
.icon-btn:hover { color: var(--ink); border-color: #CDD4DF; }
.icon-btn:disabled .ic { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn {
  height: 40px; padding: 0 16px; border-radius: var(--r-control); font-weight: 500; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); text-decoration: none;
}
.btn:hover { border-color: #CDD4DF; }
.btn-primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn-primary:hover { background: var(--acc-strong); border-color: var(--acc-strong); }

/* =========================================================
   Kartlar
   ========================================================= */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); min-height: 58px; }
.card-head h2 { font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 8px; margin-right: auto; }
.card-head h2 .ic { color: var(--ink-3); }
.card-head .muted { font-size: 13px; color: var(--ink-3); }
.card-body { padding: 16px 18px; container-type: inline-size; }

.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }

/* Özet kartı */
.stat .card-head { min-height: 50px; padding: 12px 18px; }
.stat .card-head h2 { font-size: 14px; }
.stat-value { font-size: 24px; font-weight: 500; letter-spacing: -.02em; padding: 16px 18px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 18px 16px; font-size: 12px; color: var(--ink-3); }
.delta { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.delta.up { background: var(--up-bg); color: var(--up); }
.delta.down { background: var(--down-bg); color: var(--down); }
.delta.flat { background: var(--bg); color: var(--ink-3); }

/* Sıralı çubuklar (en çok satanlar, kanallar, şubeler) */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 18px minmax(80px, 34%) 1fr; align-items: center; gap: 10px; }
.bar-rank { color: var(--ink-3); font-size: 13px; }
.bar-name { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { position: relative; height: 30px; border-radius: 8px; background: var(--bg); overflow: hidden; }
.bar-fill {
  position: absolute; inset: 0 auto 0 0; border-radius: 8px; min-width: 8px;
  background:
    repeating-linear-gradient(-45deg, rgba(255,255,255,.35) 0 6px, transparent 6px 14px),
    linear-gradient(90deg, #FFE3C8 0%, #FFD3A8 55%, #FFE7B8 100%);
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}
.bar-label { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 500; color: #A24E0A; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.bar-label::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--acc-strong); }
.bar-label em { font-style: normal; color: var(--ink-3); font-weight: 400; }
/* Dar kartlarda ikincil bilgi (adisyon/adet) gizlenir */
@container (max-width: 380px) { .bar-label em { display: none; } }

/* Tablo */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 18px; }
th { font-size: 12px; font-weight: 500; color: var(--ink-3); background: #FAFBFD; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; white-space: nowrap; }
th:hover { color: var(--ink-2); }
th .arrow { color: var(--acc-strong); margin-left: 2px; }
td { border-bottom: 1px solid var(--line); font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FFFBF7; }
th.num, td.num { text-align: right; }
td .name { font-weight: 500; }
td .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.mini-bar { height: 4px; background: var(--bg); border-radius: 2px; margin-top: 8px; max-width: 200px; overflow: hidden; }
.mini-bar i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--acc), var(--acc2)); }

/* Sekme şeklinde filtreler */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; color: var(--ink-2); background: var(--surface); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip span { color: var(--ink-3); font-size: 12px; }
.chip:hover { border-color: #CDD4DF; color: var(--ink); }
.chip.active { background: var(--acc); border-color: var(--acc); color: #fff; }
.chip.active span { color: rgba(255,255,255,.8); }

/* Bildirim satırı */
.notice { padding: 11px 14px; border-radius: var(--r-control); font-size: 13px; line-height: 1.5; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); display: none; }
.notice.show { display: block; }
.notice.ok { background: var(--up-bg); border-color: transparent; color: var(--up); }
.notice.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.notice.err { background: var(--down-bg); border-color: transparent; color: var(--down); }

.empty { padding: 36px 18px; color: var(--ink-3); text-align: center; }
.foot-note { font-size: 12px; color: var(--ink-3); text-align: right; }

details.debug { font-size: 12px; color: var(--ink-3); }
details.debug summary { cursor: pointer; padding: 4px 0; }
details.debug pre { background: var(--surface); border: 1px solid var(--line); padding: 14px; border-radius: var(--r-control); overflow: auto; max-height: 320px; margin-top: 8px; white-space: pre-wrap; word-break: break-word; }

.m-only { display: none; }

/* =========================================================
   Tablet ve telefon
   ========================================================= */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  /* Sidebar soldan açılan çekmece olur */
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(26, 34, 51, .18); padding-top: max(20px, env(safe-area-inset-top)); }
  .sb-open .sidebar { transform: none; }
  .sb-overlay { display: block; position: fixed; inset: 0; background: rgba(26, 34, 51, .35); z-index: 30; opacity: 0; pointer-events: none; transition: opacity .25s; }
  .sb-open .sb-overlay { opacity: 1; pointer-events: auto; }
  .sb-collapse { display: none; }
  /* Daraltma durumu mobilde geçerli değil */
  .sb-collapsed .sidebar { width: 280px; }
  .sb-collapsed .logo { flex-grow: 1; flex-basis: auto; opacity: 1; pointer-events: auto; }
  .sb-collapsed .sb-label, .sb-collapsed .sb-link span, .sb-collapsed .bs-text { opacity: 1; pointer-events: auto; }
  .sb-collapsed .sb-link { padding: 10px 12px; }
  .sb-collapsed .branch-status { padding-left: 10px; }

  .icon-btn.menu-btn { display: grid; }
  .topbar { position: sticky; top: 0; z-index: 20; background: rgba(244, 246, 250, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    flex-wrap: wrap; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); gap: 10px 12px; }
  .tb-title h1 { font-size: 17px; }
  .tb-actions { width: 100%; justify-content: stretch; }
  .tb-actions > .control { flex: 1 1 0; }
  .control { height: 42px; font-size: 16px; } /* 16px: iPhone'da odaklanınca sayfa yakınlaşmasın */
  .control-sm { height: 36px; }
  .page { padding: 14px 16px 32px; gap: 12px; }
  .grid-4, .grid-auto { gap: 12px; }
  .grid-auto { grid-template-columns: 1fr; }
  .stat-value { font-size: 20px; padding: 12px 14px 2px; }
  .stat .card-head { padding: 10px 14px; min-height: 44px; }
  .stat-foot { padding: 0 14px 12px; flex-wrap: wrap; }
  .card-head { padding: 12px 14px; min-height: 52px; flex-wrap: wrap; }
  .card-body { padding: 14px; }
  th, td { padding: 12px 14px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
}

@media (max-width: 560px) {
  .col-hide-sm { display: none; }
  .m-only { display: block; }
  td { font-size: 13px; }
  .bar-row { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Ürünler sayfası: kategori kartları arası boşluk */
.product-groups { display: flex; flex-direction: column; gap: 16px; }
.product-groups th, .product-groups td { cursor: default; }
@media (max-width: 900px) { .product-groups { gap: 12px; } }

/* Kart başlığındaki arama kutusu */
.card-head .search { width: 240px; }
@media (max-width: 900px) { .card-head .search { width: 100%; order: 3; } }

/* =========================================================
   Maliyet sistemi: ek bileşenler
   ========================================================= */
a.link, .link { color: var(--acc-strong); text-decoration: none; }
a.link:hover { text-decoration: underline; }
td a.name.link { color: var(--ink); }
td a.name.link:hover { color: var(--acc-strong); text-decoration: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--ink-3); }
.grow { flex: 1 1 auto; }
form.inline { display: inline; }
.pos { color: var(--up); }
.neg, td.neg { color: var(--down); }
.stat-value small { font-size: 13px; color: var(--ink-3); font-weight: 400; }

/* Sidebar alt bilgi */
.sb-user { padding: 10px 10px 0; }
.sb-user small { font-size: 12px; color: var(--ink-3); }

/* Butonlar */
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-sm .ic { width: 16px; height: 16px; }
.btn-block { width: 100%; justify-content: center; }
.btn-ghost-danger { color: var(--down); border-color: transparent; background: transparent; }
.btn-ghost-danger:hover { background: var(--down-bg); border-color: transparent; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
td .icon-btn.sm { display: inline-grid; vertical-align: middle; }
td.actions { white-space: nowrap; }

/* Ay seçici */
.seg { display: inline-flex; align-items: center; gap: 6px; }
.seg .control { width: 160px; }

/* Formlar */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.field.row { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; }
.field.row > span { font-weight: 400; color: var(--ink-3); }
.field.end { justify-content: flex-end; }
.field[hidden] { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.one { grid-template-columns: 1fr; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; border-bottom: 1px solid var(--line); }
.form-inline .field.grow { flex: 1 1 160px; }
.form-inline .field:not(.grow) .control { width: 150px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--acc); }
.hint { font-size: 12px; color: var(--ink-3); line-height: 1.55; }
.hint.pad { padding: 12px 18px 16px; }
.hint b { color: var(--ink-2); font-weight: 500; }
textarea.control { height: auto; padding: 10px 12px; }
input.control.num { text-align: right; }
.w-xs { width: 64px; } .w-sm { width: 90px; } .w-md { width: 130px; }
.control:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px rgba(245, 137, 43, .15); }

.card-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--line); }
.card-foot .grow { order: 4; }
.card-foot .btn-ghost-danger { order: 5; }
.card-foot .btn-primary { order: 6; }
.card-foot .totals { order: 4; flex: 1 1 auto; text-align: right; font-size: 13px; color: var(--ink-2); }
.card-foot .totals b { color: var(--ink); font-weight: 600; }
form.card-body + .table-wrap { border-top: 0; }

/* Yan yana: form + liste */
.grid-side { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); gap: 16px; align-items: start; }

/* Tablolar */
table.plain th { cursor: default; }
table.plain th:hover { color: var(--ink-3); }
table.compact th, table.compact td { padding: 9px 0; }
table.compact th:first-child, table.compact td:first-child { padding-left: 0; }
table.compact td + td, table.compact th + th { padding-left: 12px; }
.sub.inl { display: inline; margin: 0; }
td .unit { font-size: 12px; font-weight: 500; color: var(--acc-strong); background: var(--acc-soft); padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
td.sub-cell { color: var(--ink-2); font-size: 13px; }
tr.inactive td { opacity: .55; }
tr.group-row td { background: #FAFBFD; font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); padding-top: 9px; padding-bottom: 9px; }
tbody tr.group-row:hover td { background: #FAFBFD; }
tr.total-row td { font-weight: 600; background: #FAFBFD; border-top: 1px solid var(--line-strong); }
tr.total-row.soft td { font-weight: 500; color: var(--ink-2); border-top: 0; }
tr.editing td { background: var(--acc-soft) !important; }
tr.warn-row td { background: var(--warn-bg); }
tr.new-row td { background: #FFFDFB; }
table.matrix td, table.matrix th { white-space: nowrap; }
table.matrix td:first-child { position: sticky; left: 0; background: var(--surface); }

/* Reçete satırları */
table.lines td { padding-top: 8px; padding-bottom: 8px; vertical-align: middle; }
table.lines select.ing { width: 100%; min-width: 180px; }
table.lines .qty-wrap { display: inline-flex; align-items: center; gap: 6px; }
table.lines input.qty { width: 90px; text-align: right; }
table.lines .unit-lbl { font-size: 12px; color: var(--ink-3); min-width: 28px; text-align: left; }
table.lines td.uc { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
table.lines td.lc { font-weight: 500; white-space: nowrap; }

/* Kâr-zarar */
table.pnl td { white-space: nowrap; }
table.pnl td .sub { margin-top: 1px; }
tr.pnl-sub td { background: #FAFBFD; font-weight: 500; }
tr.pnl-strong td { font-weight: 600; font-size: 15px; }
tr.pnl-strong:last-child td { background: var(--acc-soft); }
.sign { display: inline-block; width: 16px; color: var(--ink-3); }

/* Rozetler */
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 500; white-space: nowrap; background: var(--bg); color: var(--ink-2); vertical-align: middle; }
.badge.acc, .badge.paket { background: var(--acc-soft); color: var(--acc-strong); }
.badge.ok { background: var(--up-bg); color: var(--up); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--down-bg); color: var(--down); }
.badge.muted { background: var(--bg); color: var(--ink-3); }
.badge.hammadde { background: #F1F3F7; color: var(--ink-2); }
.badge.ambalaj { background: #FFF6E0; color: #9A6A00; }
.badge.yari_mamul, .badge.self { background: #EEF1FB; color: #4B5B9E; }

/* Negatif çubuk */
.bar-fill.neg { background: repeating-linear-gradient(-45deg, rgba(255,255,255,.35) 0 6px, transparent 6px 14px), linear-gradient(90deg, #FAD4D6, #FDE7E8); }

/* Sekmeler */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tabs a.chip { text-decoration: none; }
.chips.wrap { flex-wrap: wrap; }
a.chip { text-decoration: none; }

/* Açılır kart */
details.collapsible > summary { list-style: none; cursor: pointer; border-bottom: 0; }
details.collapsible > summary::-webkit-details-marker { display: none; }
details.collapsible > summary::after { content: "+"; font-size: 18px; color: var(--ink-3); margin-left: 6px; }
details.collapsible[open] > summary { border-bottom: 1px solid var(--line); }
details.collapsible[open] > summary::after { content: "–"; }

/* Giriş sayfası */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 500px at 50% -10%, var(--acc-soft), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 380px; padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 50px -30px rgba(224, 111, 18, .45); }
.auth-logo { display: flex; flex-direction: column; margin-bottom: 4px; }
.auth-logo .logo-name { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.auth-logo .logo-name::after { content: ""; display: block; width: 28px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--acc), var(--acc2)); margin-top: 6px; }
.auth-logo .logo-sub { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.auth .muted { font-size: 13px; }

@media (max-width: 1100px) {
  .grid-side { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .seg { width: 100%; }
  .seg .control { flex: 1 1 0; width: auto; }
  .tb-actions > .seg { flex: 1 1 100%; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .card-foot { padding: 12px 14px; }
  .hint.pad { padding: 10px 14px 14px; }
  .form-inline .field:not(.grow) { flex: 1 1 40%; }
  .form-inline .field:not(.grow) .control { width: 100%; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  table.lines select.ing { min-width: 150px; }
  table.lines input.qty { width: 72px; }
  .btn-sm[data-csv] span { display: none; }
  .btn-sm[data-csv] { padding: 0 9px; }
}
