.mg-scope{
    --c-bg: #F7F8F6;
    --c-surface: #FFFFFF;
    --c-surface-muted: #EEF2EF;
    --c-border: #DCE3DE;
    --c-border-strong: #B9C4BD;
    --c-text: #1C2620;
    --c-text-muted: #5C6B62;
    --c-text-faint: #8B978F;

    --c-teal-50: #E1F5EE;
    --c-teal-100: #9FE1CB;
    --c-teal-600: #0F6E56;
    --c-teal-800: #085041;
    --c-teal-900: #04342C;

    --c-coral-50: #FAECE7;
    --c-coral-100: #F5C4B3;
    --c-coral-600: #993C1D;
    --c-coral-800: #712B13;

    --c-amber-50: #FAEEDA;
    --c-amber-600: #854F0B;
    --c-amber-800: #633806;

    --c-red-50: #FCEBEB;
    --c-red-600: #A32D2D;
    --c-red-800: #791F1F;

    --mg-radius: 10px;
    --mg-radius-lg: 14px;
    --mg-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mg-font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}.mg-scope *{
    box-sizing: border-box;
}.mg-scope{
    margin: 0;
    padding: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--mg-font-sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}.mg-scope{
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 24px 80px;
}.mg-scope /* ---------- Typography ---------- */
h1, .mg-scope h2, .mg-scope h3{
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.01em;
}.mg-scope h1{ font-size: 22px; }.mg-scope h2{ font-size: 17px; }.mg-scope h3{ font-size: 14px; }.mg-scope .muted{ color: var(--c-text-muted); }.mg-scope .faint{ color: var(--c-text-faint); }.mg-scope .mono{ font-family: var(--mg-font-mono); }.mg-scope /* ---------- Header ---------- */
.topbar{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}.mg-scope .topbar-brand{
    display: flex;
    align-items: center;
    gap: 12px;
}.mg-scope .brand-logo{
    height: 38px;
    width: auto;
    object-fit: contain;
}.mg-scope .topbar-sub{
    font-size: 13px;
    color: var(--c-text-faint);
    margin-top: 4px;
}.mg-scope .env-badge{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--c-amber-800);
    background: var(--c-amber-50);
    border-radius: 999px;
    padding: 4px 10px 4px 8px;
}.mg-scope .env-dot{
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #C9821B;
    display: inline-block;
}.mg-scope /* ---------- Cards / surfaces ---------- */
.surface{
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--mg-radius-lg);
}.mg-scope .panel{
    background: var(--c-surface-muted);
    border-radius: var(--mg-radius);
    padding: 14px 16px;
}.mg-scope /* ---------- Kompakt kontrol şeridi (tarih + kur tek satır) ---------- */
.control-strip{
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin: 18px 0 10px;
    flex-wrap: wrap;
}.mg-scope .cs-block label{
    display: block;
    font-size: 11px;
    color: var(--c-text-faint);
    margin-bottom: 5px;
}.mg-scope .cs-date{ width: 148px; }.mg-scope .cs-date input{ height: 34px; font-size: 13px; }.mg-scope .cs-fetch{ height: 34px; flex-shrink: 0; }.mg-scope .cs-divider{
    width: 1px;
    align-self: stretch;
    background: var(--c-border);
    margin: 0 2px;
}.mg-scope .cs-rate{ width: 118px; }.mg-scope .cs-rate input{
    height: 34px;
    background: var(--c-surface-muted);
    border: 1px solid transparent;
    font-family: var(--mg-font-mono);
    font-weight: 700;
    font-size: 14px;
}.mg-scope .cs-rate input:focus{ background: var(--c-surface); }.mg-scope .cs-chips{ display: flex; flex-direction: column; }.mg-scope .cs-chips .chip{ height: 26px; }.mg-scope .cs-detay-btn{ width: 34px; height: 34px; align-self: flex-end; flex-shrink: 0; font-size: 16px; }.mg-scope /* ---------- Chip strip (MM ek maliyet) ---------- */
.chip-strip{
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}.mg-scope .chip-strip-label{
    font-size: 12px;
    color: var(--c-text-faint);
    margin-right: 2px;
}.mg-scope .chip{
    display: inline-flex;
    align-items: center;
    background: var(--c-amber-50);
    color: var(--c-amber-800);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12.5px;
    font-weight: 700;
    font-family: var(--mg-font-mono);
}.mg-scope .chip-strip .spacer{ flex: 1; }.mg-scope /* legacy aliases (kept for safety, .mg-scope unused) */
.controls-row{ display: flex; gap: 12px; flex-wrap: wrap; }.mg-scope .control-block label{ display:block; font-size:12px; color:var(--c-text-faint); margin-bottom:6px; }.mg-scope input[type="date"], .mg-scope input[type="number"], .mg-scope input[type="text"]{
    width: 100%;
    height: 36px;
    border: 1px solid var(--c-border);
    border-radius: var(--mg-radius);
    background: var(--c-surface);
    padding: 0 10px;
    font-size: 13.5px;
    color: var(--c-text);
    font-family: var(--mg-font-sans);
}.mg-scope input[type="number"]{
    font-family: var(--mg-font-mono);
    font-weight: 600;
}.mg-scope input:focus{
    outline: none;
    border-color: var(--c-teal-600);
    box-shadow: 0 0 0 3px var(--c-teal-50);
}.mg-scope button{
    height: 36px;
    border-radius: var(--mg-radius);
    border: 1px solid var(--c-border-strong);
    background: var(--c-surface);
    color: var(--c-text);
    font-size: 13.5px;
    font-weight: 500;
    font-family: var(--mg-font-sans);
    padding: 0 16px;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, transform 0.05s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}.mg-scope button:hover{ background: var(--c-surface-muted); }.mg-scope button:active{ transform: scale(0.98); }.mg-scope button:disabled{ opacity: 0.45; cursor: not-allowed; }.mg-scope button.primary{
    background: var(--c-teal-600);
    border-color: var(--c-teal-600);
    color: #fff;
}.mg-scope button.primary:hover{ background: var(--c-teal-800); }.mg-scope button.ghost{
    border-color: transparent;
    background: transparent;
}.mg-scope button.ghost:hover{ background: var(--c-surface-muted); }.mg-scope button.small{
    height: 28px;
    padding: 0 10px;
    font-size: 12.5px;
}.mg-scope /* (eski .rate-grid / .rate-card / .cost-strip kaldırıldı, .mg-scope yerine .control-strip / .chip-strip geldi) */


/* ---------- Stage chain ---------- */
.stage-row{
    display: flex;
    gap: 14px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}.mg-scope .stage-card{
    flex: 1;
    min-width: 220px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--mg-radius-lg);
    padding: 18px;
    position: relative;
    transition: border-color 0.15s ease;
}.mg-scope .stage-card.is-ready{ border-color: var(--c-teal-100); }.mg-scope .stage-num{
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 12px;
}.mg-scope .stage-num.done{ background: var(--c-teal-50); color: var(--c-teal-800); }.mg-scope .stage-num.pending{ background: var(--c-amber-50); color: var(--c-amber-800); }.mg-scope .stage-num.locked{ background: var(--c-surface-muted); color: var(--c-text-faint); }.mg-scope .stage-eyebrow{
    font-size: 11.5px;
    color: var(--c-text-faint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}.mg-scope .stage-title{
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 2px;
}.mg-scope .stage-count{
    font-size: 12.5px;
    color: var(--c-text-muted);
    margin-bottom: 14px;
}.mg-scope .stage-status{
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    margin-bottom: 14px;
}.mg-scope .stage-status.ok{ color: var(--c-teal-600); }.mg-scope .stage-status.warn{ color: var(--c-amber-600); }.mg-scope .stage-status.muted{ color: var(--c-text-faint); }.mg-scope .stage-card button{ width: 100%; justify-content: center; }.mg-scope .chain-arrow{
    display: flex;
    align-items: center;
    color: var(--c-border-strong);
    font-size: 18px;
}.mg-scope /* ---------- Preview screen ---------- */
.preview-header{
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}.mg-scope .preview-sub{
    font-size: 13px;
    color: var(--c-text-faint);
    margin: 4px 0 0 40px;
}.mg-scope .summary-grid{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 18px 0;
}.mg-scope .summary-card{
    border-radius: var(--mg-radius);
    padding: 12px 14px;
}.mg-scope .summary-card .num{ font-size: 20px; font-weight: 700; font-family: var(--mg-font-mono); }.mg-scope .summary-card .lbl{ font-size: 12px; margin-bottom: 4px; display: block; }.mg-scope .summary-card.neutral{ background: var(--c-surface-muted); }.mg-scope .summary-card.ok{ background: var(--c-teal-50); color: var(--c-teal-800); }.mg-scope .summary-card.ok .num{ color: var(--c-teal-800); }.mg-scope .summary-card.bad{ background: var(--c-red-50); color: var(--c-red-800); }.mg-scope .summary-card.bad .num{ color: var(--c-red-800); }.mg-scope .list-toolbar{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 10px;
    flex-wrap: wrap;
}.mg-scope .select-all-label{
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--c-text-muted);
    white-space: nowrap;
}.mg-scope .toolbar-actions{ display: flex; gap: 8px; }.mg-scope .search-wrap{
    position: relative;
    flex: 1;
    min-width: 180px;
    max-width: 320px;
}.mg-scope .search-icon{
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-text-faint);
    font-size: 15px;
    pointer-events: none;
}.mg-scope .search-wrap input{
    padding-left: 30px;
    height: 34px;
}.mg-scope .product-table{
    border: 1px solid var(--c-border);
    border-radius: var(--mg-radius-lg);
    overflow: hidden;
}.mg-scope .product-row{
    display: grid;
    grid-template-columns: 24px 1fr 100px 100px 76px 34px;
    gap: 8px;
    align-items: center;
    padding: 9px 12px;
    border-top: 1px solid var(--c-border);
    font-size: 13px;
}.mg-scope .product-row:first-child{ border-top: none; }.mg-scope .product-row.head{
    background: var(--c-surface-muted);
    font-size: 11.5px;
    color: var(--c-text-faint);
    padding: 7px 12px;
}.mg-scope .product-row.is-error{ background: var(--c-red-50); }.mg-scope .product-name{ font-weight: 600; }.mg-scope .product-sub{ font-size: 12px; color: var(--c-text-faint); }.mg-scope .num-cell{ text-align: right; font-family: var(--mg-font-mono); }.mg-scope .num-cell.up{ color: var(--c-coral-600); }.mg-scope .num-cell.down{ color: var(--c-teal-600); }.mg-scope .error-pill{
    font-size: 11.5px;
    color: var(--c-red-800);
}.mg-scope .scroll-note{
    text-align: center;
    font-size: 12px;
    color: var(--c-text-faint);
    margin-top: 10px;
}.mg-scope /* ---------- Modal (recipe detail) ---------- */
.modal-backdrop{
    position: fixed;
    inset: 0;
    background: rgba(20, 28, 23, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 24px;
}.mg-scope .modal-box{
    background: var(--c-surface);
    border-radius: var(--mg-radius-lg);
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 22px 24px;
}.mg-scope .modal-box.draggable-modal{
    padding-top: 14px;
}.mg-scope .modal-draghandle{
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    height: 18px;
    margin-bottom: 10px;
    cursor: grab;
    color: var(--c-text-faint);
    user-select: none;
}.mg-scope .modal-draghandle:active{ cursor: grabbing; }.mg-scope .drag-dots{ font-size: 13px; letter-spacing: 1px; }.mg-scope .drag-hint{ font-size: 10.5px; }.mg-scope .modal-box.dragging{
    transition: none;
    box-shadow: 0 18px 40px rgba(20, 28, 23, 0.22);
}.mg-scope .modal-box h2{
    padding-right: 110px;
}.mg-scope .modal-close{
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 5;
}.mg-scope .draggable-modal .modal-close{
    top: 30px;
}.mg-scope .modal-actions-top{
    position: absolute;
    top: 14px;
    right: 50px;
    z-index: 5;
}.mg-scope .draggable-modal .modal-actions-top{
    top: 28px;
}.mg-scope .recipe-line{
    display: grid;
    grid-template-columns: 1fr 70px 90px 90px;
    gap: 8px;
    padding: 8px 0;
    border-top: 1px solid var(--c-border);
    font-size: 12.5px;
    align-items: center;
}.mg-scope .recipe-line.head{
    color: var(--c-text-faint);
    font-size: 11px;
    border-top: none;
}.mg-scope .recipe-total-row{
    display: grid;
    grid-template-columns: 1fr 70px 90px 90px;
    gap: 8px;
    padding: 10px 0 0;
    margin-top: 6px;
    border-top: 2px solid var(--c-border-strong);
    font-weight: 700;
    font-size: 13px;
}.mg-scope /* ---------- Toast / banner ---------- */
.banner{
    border-radius: var(--mg-radius);
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 14px;
}.mg-scope .banner.error{ background: var(--c-red-50); color: var(--c-red-800); }.mg-scope .banner.success{ background: var(--c-teal-50); color: var(--c-teal-800); }.mg-scope .banner.info{ background: var(--c-surface-muted); color: var(--c-text-muted); }.mg-scope /* ---------- Loading ---------- */
.spinner{
    width: 16px; height: 16px;
    border: 2px solid var(--c-border);
    border-top-color: var(--c-teal-600);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }.mg-scope .loading-row{
    display: flex; align-items: center; gap: 8px;
    color: var(--c-text-faint); font-size: 13px;
    padding: 24px 0; justify-content: center;
}.mg-scope /* ---------- Checkbox ---------- */
input[type="checkbox"]{
    width: 16px;
    height: 16px;
    accent-color: var(--c-teal-600);
    cursor: pointer;
}.mg-scope /* ---------- Utility ---------- */
.hidden{ display: none !important; }.mg-scope .flex-row{ display: flex; align-items: center; gap: 8px; }.mg-scope .icon-btn{
    width: 30px; height: 30px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

/* ---------- Ortam rozeti (canlı/test) ---------- */
.mg-scope .env-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 8px 14px;
    border-radius: var(--mg-radius);
    margin-bottom: 14px;
    width: fit-content;
}
.mg-scope .env-badge .env-dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block;
}
.mg-scope .env-badge.canli {
    background: var(--c-red-50);
    color: var(--c-red-800);
    border: 1px solid var(--c-red-600);
}
.mg-scope .env-badge.canli .env-dot { background: var(--c-red-600); }
.mg-scope .env-badge.test {
    background: var(--c-amber-50);
    color: var(--c-amber-800);
    border: 1px solid var(--c-amber-600);
}
.mg-scope .env-badge.test .env-dot { background: var(--c-amber-600); }

/* ---------- Sabit (sticky) arama + sütun başlığı ---------- */
/* Adil'in isteği (17.07.2026): sayfa aşağı kaydırılınca arama kutusu ve
   ürün listesi sütun başlıkları sabit kalsın, sadece ürün satırları kaysın
   — aksi halde her aramada sayfanın başına dönmek gerekiyordu.
   top: 60px -> ana uygulamanın kendi topbar'ının (position:sticky, bkz.
   style.css .topbar) yaklaşık yüksekliği; ikisi üst üste binmesin, hemen
   altına yapışsın diye. Sende birkaç piksel boşluk/üst üste binme
   görürsen, sadece bu top değerini birkaç px oynatman yeterli. */
.mg-scope .mg-sticky-head{
    position: sticky;
    top: 60px;
    z-index: 15;
    background: var(--c-bg);
    padding-top: 8px;
    margin-top: -8px;
    box-shadow: 0 6px 10px -6px rgba(20, 28, 23, 0.12);
}
.mg-scope .product-table-head-only{
    border-radius: var(--mg-radius-lg) var(--mg-radius-lg) 0 0;
    border-bottom: none;
    margin-bottom: 0;
}
/* Sabit başlığın hemen altındaki gerçek liste, üstte köşe yuvarlaması
   yapmasın (başlıkla tek parça gibi görünsün) ve çift kenarlık binmesin. */
.mg-scope #productListWrap .product-table{
    border-radius: 0 0 var(--mg-radius-lg) var(--mg-radius-lg);
    border-top: none;
}

/* ---------- Sayfa kaydırma çubuğu (scrollbar) ---------- */
/* Adil'in isteği (17.07.2026): scrollbar zeminle aynı renkte olduğu için
   görünmüyordu — daha kalın ve belirgin bir renk verildi. Bu kurallar
   BİLEREK .mg-scope'a bağlı değil (gerçek sayfa scrollbar'ı <html>/<body>
   üzerinde çalışıyor, .mg-scope içindeki bir kutunun kendi scrollbar'ı
   değil) — yani bu iyileştirme sadece Maliyet Güncelleme'de değil, tüm
   uygulamada geçerli olacak. Farklı bir yerde (örn. style.css) tutulması
   tercih edilirse taşınması kolay, tek blok halinde.
*/
html{
    scrollbar-width: auto;              /* Firefox */
    scrollbar-color: #8A98A0 #E4E9EE;   /* Firefox: thumb track */
}
::-webkit-scrollbar{                    /* Chrome / Edge */
    width: 14px;
    height: 14px;
}
::-webkit-scrollbar-track{
    background: #E4E9EE;
}
::-webkit-scrollbar-thumb{
    background: #8A98A0;
    border-radius: 8px;
    border: 3px solid #E4E9EE;
}
::-webkit-scrollbar-thumb:hover{
    background: #6B7A82;
}
