/* =====================================================================
   MAY Tohum · Makine İzleme — tasarım sistemi

   Tek bir jeton (token) katmanı: renk, boşluk, yarıçap, gölge ve tipografi
   burada tanımlanır; bileşenler yalnızca bu değişkenleri kullanır.
   Böylece tema değiştirmek tek dosyada birkaç satır demektir.

   Açık ve koyu tema, işletim sisteminin tercihine göre kendiliğinden seçilir.
   ===================================================================== */

:root {
    color-scheme: light dark;

    /* --- Nötr iskelet: saf gri değil, maviye kaymış grafit --- */
    --bg:            #F3F5F9;
    --surface:       #FFFFFF;
    --surface-1:     #FFFFFF;
    --surface-2:     #F7F9FC;
    --surface-3:     #EDF1F7;
    --border-hair:   #EAEEF4;
    --border:        #DCE2EB;
    --border-strong: #C3CBD8;

    /* --- Metin: üç kademe --- */
    --text:          #0E1420;
    --text-1:        #0E1420;
    --text-2:        #4E5A6C;
    --text-3:        #657085;

    /* --- Kimlik: Sinyal (dokunulabilir) + İris (canlı veri) --- */
    --accent:        #1F63D6;
    --accent-text:   #1F63D6;
    --accent-hover:  #1A55BA;
    --accent-press:  #16489C;
    --accent-soft:   rgba(31, 99, 214, .10);
    --accent-quiet:  rgba(31, 99, 214, .10);
    --accent-ink:    #FFFFFF;
    --iris:          #7A44C9;
    --iris-quiet:    rgba(122, 68, 201, .10);

    /* --- Durum: yalnızca eşik/durum bildirir, seri rengi olmaz --- */
    --good:      #0E7A52;  --good-quiet:     rgba(14, 122, 82, .10);
    --warn:      #8A5A0B;  --warn-quiet:     rgba(138, 90, 11, .10);
    --critical:  #C1362A;  --critical-quiet: rgba(193, 54, 42, .10);
    --idle:      #657085;  --idle-quiet:     rgba(101, 112, 133, .12);

    /* Eski adlar Kadran jetonlarına bağlandı - mevcut bileşenler bozulmasın.
       var() geç çözülür, bu yüzden koyu temada kendiliğinden koyu değeri alır. */
    --green:  var(--good);     --green-soft:  var(--good-quiet);
    --yellow: var(--warn);     --yellow-soft: var(--warn-quiet);
    --red:    var(--critical); --red-soft:    var(--critical-quiet);
    --gray:   var(--idle);     --gray-soft:   var(--idle-quiet);

    /* --- Veri serisi: sabit sıra, asla döngüsel değil --- */
    --series-1: #245FD4;
    --series-2: #C62C58;
    --series-3: #00919D;
    --series-4: #873FBB;
    --grid:     rgba(14, 20, 32, .08);

    /* --- 3D görüntü alanı: sahne de aynı jetonlardan beslenir --- */
    --viewport-bg:     #EDF1F7;
    --viewport-grid:   #C3CBD8;
    --viewport-grid-2: #DCE2EB;

    /* --- Aralık: 4px tabanı --- */
    --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 20px;
    --s-6: 24px; --s-7: 32px; --s-8: 40px; --s-9: 56px; --s-10: 72px;

    /* --- Yarıçap: dışarıdan içeriye küçülür --- */
    --r-xs:   5px;
    --r-sm:   8px;
    --r-md:   12px;
    --r:      16px;
    --r-lg:   22px;
    --r-pill: 980px;
    --r-full: 980px;

    /* --- Yükseklik: koyuda gölge değil yüzey açıklığı; gölge kopan katmanlara --- */
    --shadow-1: 0 1px 2px rgba(16, 24, 40, .06), 0 0 0 1px rgba(16, 24, 40, .03);
    --shadow-2: 0 12px 32px -8px rgba(16, 24, 40, .18), 0 0 0 1px rgba(16, 24, 40, .04);
    --e-1: var(--shadow-1);
    --e-2: var(--shadow-2);

    /* --- Hareket: hızlı çıkar, yavaş oturur --- */
    --dur-1: 120ms;
    --dur-2: 180ms;
    --dur-3: 280ms;
    --ease:       cubic-bezier(.32, .72, 0, 1);
    --ease-inout: cubic-bezier(.4, 0, .2, 1);

    --font:     "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
                Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-num: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono",
                "Segoe UI Mono", Menlo, Consolas, monospace;
}

/* Koyu tema iki yoldan gelir:
   1) Sistem tercihi koyuysa VE kullanici elle 'acik' secmediyse
   2) Kullanici dugmeyle 'koyu' sectiyse (data-theme="dark")
   Kadran koyu oncelikli tasarlandi - asil kurgu burasi. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg:            #0A0D13;
        --surface:       #10141C;
        --surface-1:     #10141C;
        --surface-2:     #161B25;
        --surface-3:     #1D2430;
        --border-hair:   #1F2635;
        --border:        #2A3342;
        --border-strong: #3A4557;

        --text:          #E6EAF2;
        --text-1:        #E6EAF2;
        --text-2:        #98A3B5;
        --text-3:        #8792A6;

        --accent:        #5B93F5;
        --accent-text:   #5B93F5;
        --accent-hover:  #7BA9F8;
        --accent-press:  #4680E4;
        --accent-soft:   rgba(91, 147, 245, .14);
        --accent-quiet:  rgba(91, 147, 245, .14);
        --accent-ink:    #0A0D13;
        --iris:          #A77DEA;
        --iris-quiet:    rgba(167, 125, 234, .14);

        --good:     #3FC98D;  --good-quiet:     rgba(63, 201, 141, .14);
        --warn:     #E8A33D;  --warn-quiet:     rgba(232, 163, 61, .14);
        --critical: #F2705F;  --critical-quiet: rgba(242, 112, 95, .14);
        --idle:     #8792A6;  --idle-quiet:     rgba(135, 146, 166, .16);

        --series-1: #3F75DD;
        --series-2: #E25A77;
        --series-3: #009A97;
        --series-4: #9C5ECD;
        --grid:     rgba(230, 234, 242, .07);

        --viewport-bg:     #0D111A;
        --viewport-grid:   #2A3342;
        --viewport-grid-2: #1B2230;

        --shadow-1: inset 0 1px 0 rgba(255,255,255,.03), 0 1px 2px rgba(0,0,0,.40);
        --shadow-2: 0 10px 30px -8px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.04);
    }
}

:root[data-theme="dark"] {
        --bg:            #0A0D13;
        --surface:       #10141C;
        --surface-1:     #10141C;
        --surface-2:     #161B25;
        --surface-3:     #1D2430;
        --border-hair:   #1F2635;
        --border:        #2A3342;
        --border-strong: #3A4557;

        --text:          #E6EAF2;
        --text-1:        #E6EAF2;
        --text-2:        #98A3B5;
        --text-3:        #8792A6;

        --accent:        #5B93F5;
        --accent-text:   #5B93F5;
        --accent-hover:  #7BA9F8;
        --accent-press:  #4680E4;
        --accent-soft:   rgba(91, 147, 245, .14);
        --accent-quiet:  rgba(91, 147, 245, .14);
        --accent-ink:    #0A0D13;
        --iris:          #A77DEA;
        --iris-quiet:    rgba(167, 125, 234, .14);

        --good:     #3FC98D;  --good-quiet:     rgba(63, 201, 141, .14);
        --warn:     #E8A33D;  --warn-quiet:     rgba(232, 163, 61, .14);
        --critical: #F2705F;  --critical-quiet: rgba(242, 112, 95, .14);
        --idle:     #8792A6;  --idle-quiet:     rgba(135, 146, 166, .16);

        --series-1: #3F75DD;
        --series-2: #E25A77;
        --series-3: #009A97;
        --series-4: #9C5ECD;
        --grid:     rgba(230, 234, 242, .07);

        --viewport-bg:     #0D111A;
        --viewport-grid:   #2A3342;
        --viewport-grid-2: #1B2230;

        --shadow-1: inset 0 1px 0 rgba(255,255,255,.03), 0 1px 2px rgba(0,0,0,.40);
        --shadow-2: 0 10px 30px -8px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.04);
}

/* =====================================================================
   Temel
   ===================================================================== */

html { -webkit-text-size-adjust: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: -0.004em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.022em;
    font-weight: 600;
    color: var(--text);
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: none; }

::selection { background: var(--accent-soft); }

/* Bootstrap'in metin yardımcılarını kendi skalamıza bağla */
.text-muted, .text-body-secondary { color: var(--text-2) !important; }
.text-body-tertiary { color: var(--text-3) !important; }

/* =====================================================================
   Üst çubuk
   ===================================================================== */

.app-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
}

.app-bar__inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.app-bar__brand {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
    letter-spacing: -0.02em;
    white-space: nowrap;
}
.app-bar__brand span { color: var(--text-3); font-weight: 400; }

.app-nav { display: flex; gap: 4px; margin-left: auto; }

.app-nav a {
    font-size: 13px;
    color: var(--text-2);
    padding: 5px 12px;
    border-radius: var(--r-pill);
    transition: background .15s ease, color .15s ease;
}
.app-nav a:hover { color: var(--text); background: var(--surface-3); }
.app-nav a.is-active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-1); }

.app-main {
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px 24px 64px;
}

.app-foot {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px 32px;
    color: var(--text-3);
    font-size: 12px;
}

/* =====================================================================
   Sayfa başlığı
   ===================================================================== */

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.page-head h1 {
    font-size: 26px;
    margin: 0;
    line-height: 1.2;
}

.page-head .page-sub {
    color: var(--text-2);
    font-size: 13px;
    margin-top: 3px;
}

/* =====================================================================
   Kart
   ===================================================================== */

.card {
    background: var(--surface);
    border: none;
    border-radius: var(--r);
    box-shadow: var(--shadow-1);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 13px 18px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-3);
    border-radius: var(--r) var(--r) 0 0 !important;
}

.card-body { padding: 18px; }

.list-group-item {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
    padding: 11px 18px;
    font-size: 14px;
}

/* =====================================================================
   Sayı kartı (KPI)
   ===================================================================== */

.stat {
    background: var(--surface);
    border-radius: var(--r);
    box-shadow: var(--shadow-1);
    padding: 18px 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat__label {
    font-size: 12px;
    color: var(--text-2);
    letter-spacing: -0.005em;
}

.stat__value {
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.stat__unit {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-3);
    margin-left: 3px;
    letter-spacing: -0.01em;
}

.stat__note {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

/* Sayılar değişince kısa bir vurgu — göz nereye bakacağını bilsin */
.flash { animation: flash .5s ease-out; }
@keyframes flash {
    from { background: var(--accent-soft); }
    to   { background: transparent; }
}

/* =====================================================================
   Durum rozeti
   ===================================================================== */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 500;
    padding: 3px 10px 3px 8px;
    border-radius: var(--r-pill);
    letter-spacing: -0.005em;
    white-space: nowrap;
}
.pill::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}

.pill--running { color: var(--green);  background: var(--green-soft); }
.pill--warning { color: var(--yellow); background: var(--yellow-soft); }
.pill--fault   { color: var(--red);    background: var(--red-soft); }
.pill--stopped { color: var(--gray);   background: var(--gray-soft); }

/* Çalışan makinenin noktası nefes alsın */
.pill--running::before { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* =====================================================================
   Ölçü satırı (etiket solda, değer sağda)
   ===================================================================== */

.rows { display: flex; flex-direction: column; gap: 9px; }

.row-kv {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 13.5px;
}
.row-kv__k { color: var(--text-2); }
.row-kv__v {
    color: var(--text);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* =====================================================================
   Doluluk çubuğu
   ===================================================================== */

.meter {
    height: 5px;
    border-radius: var(--r-pill);
    background: var(--surface-3);
    overflow: hidden;
}
.meter__fill {
    height: 100%;
    border-radius: var(--r-pill);
    background: var(--green);
    transition: width .4s ease, background-color .4s ease;
}
.meter__fill--warn { background: var(--yellow); }
.meter__fill--crit { background: var(--red); }

/* =====================================================================
   Hat akış şeması
   ===================================================================== */

.flow {
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    padding: 4px 2px 10px;
    scrollbar-width: thin;
}

.flow__node { flex: 1 1 0; min-width: 220px; }

.flow__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    flex: none;
    color: var(--text-3);
    user-select: none;
}
.flow__arrow svg { display: block; }

.node {
    background: var(--surface);
    border-radius: var(--r);
    box-shadow: var(--shadow-1);
    padding: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform .16s ease, box-shadow .16s ease;
    position: relative;
}
a:hover > .node { transform: translateY(-2px); box-shadow: var(--shadow-2); }

.node__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.node__code { font-weight: 600; font-size: 14px; letter-spacing: -0.015em; }
.node__name { color: var(--text-2); font-size: 12.5px; margin-top: 1px; }

.node__rate {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.node__rate small { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 3px; }

/* Darboğaz: kenarlıkla değil, altına ince bir şerit ve etiketle */
.node--bottleneck { box-shadow: var(--shadow-1), inset 0 0 0 1.5px var(--yellow); }

.node__tag {
    position: absolute;
    top: -9px; left: 14px;
    background: var(--yellow);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .03em;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    text-transform: uppercase;
}
@media (prefers-color-scheme: dark) { .node__tag { color: #1c1c1e; } }

/* =====================================================================
   Not / uyarı kutusu
   ===================================================================== */

.note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--surface);
    border-radius: var(--r);
    box-shadow: var(--shadow-1);
    padding: 13px 16px;
    font-size: 13.5px;
    color: var(--text);
}
.note__k { color: var(--text-2); flex: none; font-weight: 500; }
.note--warn { background: var(--yellow-soft); box-shadow: none; }
.note--warn .note__k { color: var(--yellow); }

/* =====================================================================
   Düğme ve form
   ===================================================================== */

.btn {
    border-radius: var(--r-pill);
    font-size: 13.5px;
    font-weight: 500;
    padding: 6px 16px;
    letter-spacing: -0.01em;
    border: 1px solid transparent;
    transition: filter .15s ease, background .15s ease;
}
.btn:disabled { opacity: .4; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); border-color: var(--accent); }

.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover:not(:disabled) { filter: brightness(1.08); background: var(--green); border-color: var(--green); }

.btn-warning { background: var(--yellow); border-color: var(--yellow); color: #fff; }
.btn-warning:hover:not(:disabled) { filter: brightness(1.08); background: var(--yellow); border-color: var(--yellow); }

.btn-outline-secondary,
.btn-outline-danger {
    background: var(--surface-3);
    border-color: transparent;
    color: var(--text);
}
.btn-outline-secondary:hover:not(:disabled),
.btn-outline-danger:hover:not(:disabled) {
    background: var(--border-strong);
    border-color: transparent;
    color: var(--text);
}

.form-label { font-size: 12px; color: var(--text-2); margin-bottom: 5px; }

.form-control, .form-select {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 14px;
    padding: 7px 11px;
    font-variant-numeric: tabular-nums;
}
.form-control:focus {
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 3.5px var(--accent-soft);
    color: var(--text);
}
.form-check-input { border-color: var(--border-strong); background-color: var(--surface-2); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { box-shadow: 0 0 0 3.5px var(--accent-soft); border-color: var(--accent); }
.form-check-label { font-size: 13.5px; color: var(--text); }

/* =====================================================================
   3D görüntü alanı
   ===================================================================== */

.viewport {
    background: var(--viewport-bg);
    border-radius: var(--r);
    overflow: hidden;
    height: 540px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    font-size: 13px;
}

.viewport-hint {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 10px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.viewport-hint span { white-space: nowrap; }

@media (max-width: 991px) { .viewport { height: 380px; } }

/* Kartı saran <a> etiketi metin rengini bulaştırmasın:
   kartın içi her zaman normal metin rengini kullanır. */
.node, .stat { color: var(--text); }
a:hover .node__code { color: var(--accent-text); }

/* =====================================================================
   Zaman serisi grafikleri

   Renkler dataviz referans paletinin ilk üç kategorik yuvası; açık ve koyu
   yüzeye ayrı ayrı adımlanmış ve doğrulayıcıdan geçirilmiş hâlleri.
   ===================================================================== */

/* Seri renkleri ve izgara artik :root'ta (Kadran jeton katmani).
   .viz burada sadece grafik kapsayicisi olarak duruyor - renk tanimlamiyor,
   boylece grafikler sayfanin geri kalaniyla ayni paletten besleniyor. */
.viz { display: block; }

.chart { position: relative; padding: 4px 0 0; }

.chart__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 2px;
}
.chart__title { font-size: 13px; color: var(--text-2); }
.chart__last  {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.chart__last small { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 2px; }

.chart__svg { display: block; width: 100%; height: 132px; overflow: visible; }

.chart__grid  { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart__tick  { fill: var(--text-3); font-size: 10px; font-variant-numeric: tabular-nums; }
.chart__line  { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart__area  { stroke: none; opacity: .10; }
.chart__dot   { stroke: var(--surface); stroke-width: 2; }
.chart__cross { stroke: var(--text-3); stroke-width: 1; opacity: .55; }

/* İpucu kutusu: değer önde, etiket arkada */
.chart__tip {
    position: absolute;
    pointer-events: none;
    background: var(--surface);
    box-shadow: var(--shadow-2);
    border-radius: var(--r-sm);
    padding: 7px 10px;
    font-size: 12px;
    white-space: nowrap;
    transform: translate(-50%, -100%);
    z-index: 5;
}
.chart__tip b {
    display: block;
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.chart__tip span { color: var(--text-3); }
.chart__tip i {
    display: inline-block;
    width: 12px; height: 2px;
    border-radius: 2px;
    margin-right: 6px;
    vertical-align: middle;
}

.chart__empty { font-size: 12.5px; color: var(--text-3); padding: 24px 0; text-align: center; }

/* Tablo görünümü — grafiği okuyamayan için aynı veri, gizlenmemiş */
.viz-table summary {
    cursor: pointer;
    font-size: 12.5px;
    color: var(--text-2);
    list-style: none;
    padding: 4px 0;
}
.viz-table summary::-webkit-details-marker { display: none; }
.viz-table summary::before { content: "▸ "; color: var(--text-3); }
.viz-table[open] summary::before { content: "▾ "; }

.viz-table table { width: 100%; font-size: 12.5px; border-collapse: collapse; margin-top: 8px; }
.viz-table th, .viz-table td {
    text-align: right;
    padding: 5px 8px;
    border-bottom: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
}
.viz-table th { color: var(--text-3); font-weight: 500; }
.viz-table th:first-child, .viz-table td:first-child { text-align: left; }

/* =====================================================================
   Bölüm başlığı — sayfa içi ayraç
   ===================================================================== */

.section {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 30px 0 12px;
    flex-wrap: wrap;
}
.section h2 {
    font-size: 18px;
    margin: 0;
    letter-spacing: -0.02em;
}
.section__note { font-size: 12.5px; color: var(--text-3); }

/* =====================================================================
   Depo rafları

   Her göz bir kap gibi davranır: doluluk aşağıdan yukarı dolar.
   Renk sadece doluluk eşiğini bildirir, süs değildir.
   ===================================================================== */

.rack { display: flex; flex-direction: column; gap: 10px; }

.rack__aisle { display: flex; align-items: center; gap: 10px; }

.rack__label {
    flex: none;
    width: 74px;
    font-size: 12px;
    color: var(--text-3);
    letter-spacing: .02em;
}

.rack__slots {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    flex: 1;
}

.slot {
    position: relative;
    overflow: hidden;
    border-radius: var(--r-sm);
    background: var(--surface-3);
    height: 62px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Dolan kısım: aşağıdan yukarı */
.slot__fill {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 0;
    background: var(--accent-soft);
    border-top: 1.5px solid var(--accent);
    transition: height .5s ease, background-color .4s ease, border-color .4s ease;
}
.slot__fill--warn { background: var(--yellow-soft); border-top-color: var(--yellow); }
.slot__fill--full { background: var(--red-soft);    border-top-color: var(--red); }

.slot__code, .slot__load { position: relative; z-index: 1; }
.slot__code { font-size: 11.5px; font-weight: 600; color: var(--text-2); letter-spacing: .02em; }
.slot__load {
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.slot__load small { font-size: 11px; font-weight: 400; color: var(--text-3); margin-left: 2px; }

/* =====================================================================
   Rapor tablosu
   ===================================================================== */

.report { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.report th, .report td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.report th {
    color: var(--text-3);
    font-weight: 500;
    font-size: 11.5px;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.report th:first-child, .report td:first-child { text-align: left; }
.report tbody tr:last-child td { border-bottom: none; }
.report td:first-child { font-weight: 500; }
.report .sub { display: block; font-size: 12px; color: var(--text-3); font-weight: 400; }

.report-scroll { overflow-x: auto; }

/* Oran hücresi: sayının arkasında ince bir dolgu çubuğu */
.ratio { position: relative; display: inline-block; min-width: 52px; }
.ratio__bar {
    position: absolute;
    left: 0; right: 0; bottom: -4px;
    height: 3px;
    border-radius: 2px;
    background: var(--surface-3);
}
.ratio__bar i { display: block; height: 100%; border-radius: 2px; background: var(--accent); }

/* =====================================================================
   Giriş ekranı
   ===================================================================== */

.auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
}

.auth__card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-2);
    padding: 34px 32px 28px;
}

.auth__brand { font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: -0.01em; }
.auth__brand span { color: var(--text-3); font-weight: 400; }

.auth__title { font-size: 24px; margin: 6px 0 22px; letter-spacing: -0.025em; }

.auth__error {
    background: var(--red-soft);
    color: var(--red);
    border-radius: var(--r-sm);
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 16px;
}

.auth__hint {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-2);
    line-height: 1.7;
}
.auth__hint strong { display: block; color: var(--text); margin-bottom: 6px; font-size: 12px; }
.auth__hint code {
    background: var(--surface-3);
    padding: 1px 5px;
    border-radius: 5px;
    font-size: 12px;
    color: var(--text);
}
.auth__hint p { margin: 10px 0 0; color: var(--text-3); font-size: 12px; }

/* Üst çubuktaki kullanıcı bölümü */
.app-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 18px;
    padding-left: 18px;
    border-left: 1px solid var(--border);
}
.app-user__name { font-size: 12.5px; color: var(--text); line-height: 1.25; }
.app-user__role { font-size: 11px; color: var(--text-3); }
.app-user form { margin: 0; }
.app-user button {
    background: none;
    border: none;
    padding: 4px 8px;
    font-size: 12.5px;
    color: var(--text-2);
    border-radius: var(--r-pill);
    cursor: pointer;
}
.app-user button:hover { background: var(--surface-3); color: var(--text); }

/* =====================================================================
   Sol menü (sidebar)

   Genişlik bir CSS değişkeninde; daraltınca sadece o değişir,
   içerik alanı kendiliğinden uyar.
   ===================================================================== */

:root { --sidebar-w: 218px; }
:root[data-sidebar="collapsed"] { --sidebar-w: 64px; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 60;
    transition: width .2s ease;
    overflow: hidden;
}

.sidebar__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 12px;
    min-height: 56px;
}
.sidebar__logo { width: 30px; height: 30px; flex: none; border-radius: 8px; }
.sidebar__brand { font-weight: 600; font-size: 14px; letter-spacing: -0.02em; white-space: nowrap; }
.sidebar__brand span { display: block; font-weight: 400; font-size: 11px; color: var(--text-3); }

.sidebar__nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; flex: 1; }

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-size: 13.5px;
    white-space: nowrap;
    transition: background .14s ease, color .14s ease;
}
.sidebar__link:hover { background: var(--surface-3); color: var(--text); }
.sidebar__link.is-active { background: var(--accent-soft); color: var(--accent-text); font-weight: 500; }
.sidebar__link svg { flex: none; width: 19px; height: 19px; }

.sidebar__foot { padding: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }

.sidebar__btn {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 8px 10px;
    background: none;
    border: none;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.sidebar__btn:hover { background: var(--surface-3); color: var(--text); }
.sidebar__btn svg { flex: none; width: 18px; height: 18px; }

/* Daraltilmis halde yazilar kaybolur, simgeler kalir */
:root[data-sidebar="collapsed"] .sidebar__brand,
:root[data-sidebar="collapsed"] .sidebar__link-text,
:root[data-sidebar="collapsed"] .sidebar__btn-text,
:root[data-sidebar="collapsed"] .sidebar__user-info { display: none; }
:root[data-sidebar="collapsed"] .sidebar__link,
:root[data-sidebar="collapsed"] .sidebar__btn { justify-content: center; }

/* Kullanici blogu bir baglanti: hover ve odak gorunur, ok isareti
   tiklanabilir oldugunu soyler - renk tek basina bilgi tasimaz. */
.sidebar__user {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: var(--r-sm);
    color: inherit; text-decoration: none;
    background: var(--surface-2);
    border: 1px solid var(--border);
    transition: background var(--dur-1) var(--ease-inout),
                border-color var(--dur-1) var(--ease-inout);
}
.sidebar__user:hover { background: var(--surface-3); border-color: var(--border-strong); }
.sidebar__user:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sidebar__user.is-active { background: var(--accent-soft); }
.sidebar__user.is-active .sidebar__user-name { color: var(--accent-text); font-weight: 500; }
.sidebar__user-go {
    width: 15px; height: 15px; flex: none; margin-left: auto;
    color: var(--text-3);
    transition: transform var(--dur-1) var(--ease), color var(--dur-1) var(--ease-inout);
}
.sidebar__user:hover .sidebar__user-go { transform: translateX(2px); color: var(--text-2); }
:root[data-sidebar="collapsed"] .sidebar__user-go { display: none; }
.sidebar__user-info { line-height: 1.3; min-width: 0; }
.sidebar__user-name {
    font-size: 13px; font-weight: 500; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar__user-role { font-size: 11.5px; color: var(--text-2); }
.sidebar__avatar {
    width: 28px; height: 28px; flex: none;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-text);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600;
}

/* Icerik sola menu kadar kayar */
.app-main, .app-foot { margin-left: var(--sidebar-w); transition: margin-left .2s ease; }

@media (max-width: 860px) {
    :root { --sidebar-w: 64px; }
    .sidebar__brand, .sidebar__link-text, .sidebar__btn-text, .sidebar__user-info { display: none; }
    .sidebar__link, .sidebar__btn { justify-content: center; }
}

/* =====================================================================
   Depo raf gözü: bölmeli kare kutular

   Her göz kapasitesine göre bölmelere ayrılır; ürün arttıkça bölmeler
   sırayla dolar. Sayı okumadan "yarısı dolu" denebilsin diye.
   ===================================================================== */

.slotbox {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 8px 9px;
    cursor: pointer;
    transition: border-color .15s ease, transform .12s ease;
}
.slotbox:hover { border-color: var(--accent); transform: translateY(-1px); }
.slotbox--full { border-color: var(--red); }

.slotbox__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.slotbox__code { font-size: 11px; font-weight: 600; color: var(--text-2); letter-spacing: .02em; }
.slotbox__load { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }

.slotbox__bins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.bin {
    aspect-ratio: 1;
    border-radius: 3px;
    background: var(--surface-3);
    transition: background-color .3s ease;
}
.bin--filled  { background: var(--accent); }
.bin--partial { background: var(--accent-soft); border: 1px solid var(--accent); }
.slotbox--full .bin--filled { background: var(--red); }

.wh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }
.wh-aisle { margin-bottom: 14px; }
.wh-aisle__label { font-size: 11.5px; color: var(--text-3); letter-spacing: .04em; margin-bottom: 7px; text-transform: uppercase; }

/* Lokasyon detay kutusu */
.slot-detail {
    position: fixed;
    z-index: 100;
    width: 270px;
    background: var(--surface);
    border-radius: var(--r);
    box-shadow: var(--shadow-2);
    padding: 16px;
}
.slot-detail__code { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 10px; }
.slot-detail .rows { gap: 7px; }
.slot-detail__close {
    position: absolute; top: 10px; right: 12px;
    background: none; border: none; color: var(--text-3);
    font-size: 16px; cursor: pointer; padding: 2px 6px;
}

/* KPI serit: dashboard ust bilgileri */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.kpi {
    background: var(--surface);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-1);
    padding: 10px 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.kpi__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.kpi__body { min-width: 0; }
.kpi__label { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi__value { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi__value small { font-size: 11.5px; font-weight: 400; color: var(--text-3); }

/* =====================================================================
   Tema anahtarı — güneş/ay arasında kayan topuz
   ===================================================================== */

.theme-row { align-items: center; }

.theme-switch {
    position: relative;
    flex: none;
    width: 46px;
    height: 24px;
    border-radius: var(--r-pill);
    background: var(--surface-3);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.08);
    transition: background-color .35s ease;
}

.theme-switch svg {
    position: absolute;
    top: 50%;
    width: 13px; height: 13px;
    transform: translateY(-50%);
    transition: opacity .3s ease;
}
.theme-switch__sun  { left: 6px;  color: var(--yellow); }
.theme-switch__moon { right: 6px; color: var(--text-3); }

.theme-switch__knob {
    position: absolute;
    top: 2.5px; left: 2.5px;
    width: 19px; height: 19px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    /* Yayli kayma: dogrusal degil, hafif tasip oturur */
    transition: transform .35s cubic-bezier(.34, 1.4, .64, 1);
}

/* Koyu temada topuz saga kayar, zemin vurgu rengine doner */
[data-theme="dark"] .theme-switch { background: var(--accent); }
[data-theme="dark"] .theme-switch__knob { transform: translateX(22px); }
[data-theme="dark"] .theme-switch__sun  { opacity: .35; }
[data-theme="dark"] .theme-switch__moon { color: #fff; }

/* Sistem tercihi koyu + elle secim yoksa: ayni gorunum */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-switch { background: var(--accent); }
    :root:not([data-theme="light"]) .theme-switch__knob { transform: translateX(22px); }
    :root:not([data-theme="light"]) .theme-switch__sun  { opacity: .35; }
    :root:not([data-theme="light"]) .theme-switch__moon { color: #fff; }
}

/* =====================================================================
   Tema geçiş animasyonu

   Sürekli açık dursa her hover'ı yavaşlatırdı; JS geçiş anında
   .theme-anim sınıfını ekleyip yarım saniye sonra kaldırıyor.
   ===================================================================== */

html.theme-anim body,
html.theme-anim .card,
html.theme-anim .stat,
html.theme-anim .node,
html.theme-anim .kpi,
html.theme-anim .sidebar,
html.theme-anim .slotbox,
html.theme-anim .note,
html.theme-anim .form-control,
html.theme-anim .list-group-item {
    transition: background-color .4s ease, color .4s ease, border-color .4s ease !important;
}

/* =====================================================================
   Makine panosu (Kadran)

   Ozet seridi -> filtre -> kart izgarasi. Kartin okunma sirasi sabittir:
   kimlik, anlik debi, egilim, doluluk, kumulatif sayaclar.
   ===================================================================== */

.t-micro {
    font-size: 11px; line-height: 14px; font-weight: 600;
    letter-spacing: .07em; text-transform: uppercase; color: var(--text-3);
}
.mono { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* ---------------- Ozet seridi ---------------- */

.msum {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.4fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    margin-bottom: var(--s-4);
}
.msum__cell { background: var(--surface); padding: var(--s-4) var(--s-5); min-width: 0; }
.msum__val {
    font-size: 26px; font-weight: 600; letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums; line-height: 34px; margin-top: 5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.msum__val small { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 4px; }
.msum__val--code { font-family: var(--font-num); font-size: 21px; letter-spacing: -0.01em; }
.msum__note {
    font-size: 12px; color: var(--text-3); margin-top: 3px; line-height: 1.4;
    /* Aciklama kirpilmaz, iki satira sarar - hucre zaten esitleniyor */
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.msum__states { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }

@media (max-width: 1100px) { .msum { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px)  { .msum { grid-template-columns: minmax(0,1fr); } }

/* ---------------- Filtre satiri ---------------- */

.mfilter {
    display: flex; flex-wrap: wrap; gap: var(--s-1);
    align-items: center; margin-bottom: var(--s-4);
}
.mfilter button {
    font: inherit; font-size: 12.5px; font-weight: 500;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 12px; border-radius: var(--r-pill); cursor: pointer;
    background: transparent; color: var(--text-2);
    border: 1px solid var(--border);
    transition: background var(--dur-1) var(--ease-inout),
                color var(--dur-1) var(--ease-inout),
                border-color var(--dur-1) var(--ease-inout);
}
.mfilter button:hover { background: var(--surface-3); color: var(--text); }
.mfilter button[aria-pressed="true"] {
    background: var(--accent-soft); color: var(--accent-text); border-color: transparent;
}
.mfilter button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mfilter button b { font-weight: 500; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.mfilter__dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.mfilter__spacer { margin-left: auto; font-size: 12px; color: var(--text-3); }

/* ---------------- Kart izgarasi ---------------- */

.mgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
    gap: var(--s-4);
}

.mcard {
    display: flex; flex-direction: column; gap: var(--s-4);
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-1);
    padding: var(--s-5);
    color: var(--text);
    text-decoration: none;
    transition: border-color var(--dur-1) var(--ease-inout),
                transform var(--dur-2) var(--ease),
                box-shadow var(--dur-2) var(--ease);
}
.mcard:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.mcard:active { transform: translateY(0); }
.mcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mcard[hidden] { display: none; }

/* Darbogaz: kart bastan asaga kirmizi olmaz - solda serit + rozet */
.mcard--bottleneck { border-color: var(--critical); }
.mcard--bottleneck::before {
    content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
    border-radius: 0 var(--r-pill) var(--r-pill) 0; background: var(--critical);
}

.mcard__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-2); }
.mcard__code {
    font-family: var(--font-num); font-size: 12px; font-weight: 500;
    color: var(--text-3); letter-spacing: .02em; display: block;
}
.mcard__name {
    font-size: 15px; font-weight: 600; letter-spacing: -0.015em;
    margin-top: 2px; display: block;
}

.mcard__metric { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.mcard__value {
    font-size: 32px; font-weight: 600; letter-spacing: -0.03em; line-height: 34px;
    font-variant-numeric: tabular-nums;
}
.mcard__unit { font-size: 13px; color: var(--text-3); }
.mcard__cap  { font-size: 12px; color: var(--text-3); margin-left: auto; font-family: var(--font-num); }

/* Egilim: son yarim saatin debisi. Sayi degil sekil tasir - eksen gerekmez. */
.mcard__spark { display: block; width: 100%; height: 34px; overflow: visible; }
.mcard__spark-line { fill: none; stroke: var(--series-1); stroke-width: 1.75;
                     stroke-linecap: round; stroke-linejoin: round; }
.mcard__spark-area { fill: var(--series-1); opacity: .12; stroke: none; }
.mcard__spark-dot  { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.mcard__spark-empty { fill: var(--text-3); font-size: 11px; font-family: var(--font-num); }

.mcard__meters { display: flex; flex-direction: column; gap: var(--s-3); }
.meterline { display: flex; flex-direction: column; gap: 6px; }
.meterline__top {
    display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2);
    font-size: 12px; color: var(--text-2);
}
.meterline__top b { font-weight: 500; font-family: var(--font-num); font-variant-numeric: tabular-nums; }

.mcard__foot {
    display: flex; justify-content: space-between; gap: var(--s-2);
    padding-top: var(--s-3); border-top: 1px solid var(--border-hair);
    font-size: 12px; color: var(--text-2);
}
.mcard__foot b { font-weight: 500; font-family: var(--font-num); font-variant-numeric: tabular-nums; color: var(--text); }

.mempty {
    grid-column: 1 / -1;
    border: 1px dashed var(--border); border-radius: var(--r);
    padding: var(--s-8) var(--s-5); text-align: center; color: var(--text-2);
}
.mempty b { display: block; color: var(--text); margin-bottom: 4px; font-weight: 500; }

/* Canli baglanti gostergesi: yanip sonmez, sadece rengi ve metni degisir */
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--idle); display: inline-block; }
.live-dot--on { background: var(--good); }

/* =====================================================================
   Hesabım (Kadran)
   ===================================================================== */

.profile__id { display: flex; align-items: center; gap: var(--s-4); }
.profile__avatar {
    width: 54px; height: 54px; flex: none; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent-text);
    display: flex; align-items: center; justify-content: center;
    font-size: 21px; font-weight: 600; letter-spacing: -0.02em;
}
.profile__name {
    font-size: 19px; font-weight: 600; letter-spacing: -0.02em; line-height: 25px;
    color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile__handle { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.profile__hint { font-size: 12px; color: var(--text-3); margin: 14px 0 0; line-height: 1.55; }

/* Rol kartlari: yetkinin nerede bittigini renk degil, netlik anlatir */
.rolecard { height: 100%; }
.rolecard--mine { border-color: var(--accent); }
.rolecard__head {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--s-2); margin-bottom: var(--s-3);
}
.rolecard__list { margin: 0; padding-left: 17px; display: flex; flex-direction: column; gap: 7px; }
.rolecard__list li { font-size: 13px; color: var(--text-2); }
.rolecard__list li::marker { color: var(--text-3); }
.rolecard__list.is-off li { color: var(--text-3); text-decoration: line-through; }

/* Depo baslik satiri: ad solda, silme dugmesi sagda */
.wh-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); }
.wh-head form { margin: 0; flex: none; }

/* Yonetim alt menusu: ana baglantiya hizali, daraltilmis menude gizli */
.sidebar__sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 4px 0; }
.sidebar__sublink {
    font-size: 12.5px; color: var(--text-2); text-decoration: none;
    padding: 6px 10px 6px 42px; border-radius: var(--r-sm);
    transition: background var(--dur-1) var(--ease-inout), color var(--dur-1) var(--ease-inout);
}
.sidebar__sublink:hover { background: var(--surface-3); color: var(--text); }
.sidebar__sublink.is-active { color: var(--accent-text); font-weight: 500; background: var(--accent-soft); }
.sidebar__sublink:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:root[data-sidebar="collapsed"] .sidebar__sub { display: none; }
@media (max-width: 860px) { .sidebar__sub { display: none; } }

/* =====================================================================
   Alarm gecmisi
   ===================================================================== */

/* Suzgec satiri: kart gorunumunde, secimler yan yana.
   Bilerek bir <form> - secim adres cubuguna yaziliyor. */
.filterbar {
    display: flex; flex-wrap: wrap; align-items: flex-end;
    gap: var(--s-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-1);
    padding: var(--s-4) var(--s-5);
    margin-bottom: var(--s-4);
}
.filterbar__field { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.filterbar__field > span {
    font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-3); font-weight: 500;
}
.filterbar__field .form-select { min-width: 0; }
.filterbar__end { margin-left: auto; display: flex; gap: var(--s-2); align-items: center; }

@media (max-width: 640px) {
    .filterbar__field { flex: 1 1 100%; }
    .filterbar__end { margin-left: 0; }
}

/* Acik alarm satiri: solda ince bir seritle isaretlenir.
   Renk tek basina anlam tasimasin diye "Durum" sutunu ayrica metin yazar. */
.alarm-table tr.alarm-row--open td { background: var(--warn-quiet); }
.alarm-table tr.alarm-row--open td:first-child {
    box-shadow: inset 3px 0 0 var(--warn);
}

/* Aciklama sutunu uzun olabilir; tabloyu yatayda esnetmesin */
.alarm-msg { max-width: 42ch; white-space: normal; line-height: 1.45; }

/* Onaylayan kisi + zaman damgasi */
.ack { display: inline-block; line-height: 1.3; }
.ack .sub { color: var(--text-3); font-size: 11.5px; }

/* Sol menudeki aktif alarm sayaci */
.sidebar__badge {
    margin-left: auto;
    min-width: 20px; padding: 1px 6px;
    border-radius: var(--r-pill);
    background: var(--critical); color: #fff;
    font-family: var(--font-num); font-variant-numeric: tabular-nums;
    font-size: 11px; font-weight: 500; line-height: 1.6;
    text-align: center; flex: none;
}
.sidebar__badge[hidden] { display: none; }

/* Daraltilmis menude sayi metni sigmaz; simgenin ustune kucuk bir nokta koyariz */
:root[data-sidebar="collapsed"] .sidebar__badge {
    position: absolute; top: 5px; right: 12px;
    min-width: 8px; height: 8px; padding: 0;
    font-size: 0; line-height: 0;
}
:root[data-sidebar="collapsed"] .sidebar__link { position: relative; }

/* =====================================================================
   Bakim plani
   ===================================================================== */

/* Suresi gecen makine: alarm ekranindaki acik alarm satiriyla ayni dil */
.report tr.mnt-row--overdue td { background: var(--critical-quiet); }
.report tr.mnt-row--overdue td:first-child { box-shadow: inset 3px 0 0 var(--critical); }

/* Calisma saati hucresi: sayi ustte, ince dolgu cubugu altta */
.mnt-meter { display: inline-block; min-width: 132px; text-align: right; }
.mnt-meter .meter { margin-top: 5px; }

/* Not sutunu tabloyu yatayda esnetmesin */
.mnt-note {
    max-width: 30ch; white-space: normal; text-align: left;
    color: var(--text-2); font-size: 12.5px; line-height: 1.45;
}

.mnt-actions { text-align: left; white-space: normal; min-width: 190px; }
.mnt-actions .rowform + .rowform { margin-top: 6px; }

/* Satir ici acilir form: JavaScript yok, <details> yeterli */
.rowform > summary {
    list-style: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 500; color: var(--accent-text);
    padding: 4px 0;
}
.rowform > summary::-webkit-details-marker { display: none; }
.rowform > summary::before { content: "▸"; color: var(--text-3); font-weight: 400; }
.rowform[open] > summary::before { content: "▾"; }
.rowform > summary:hover { text-decoration: underline; }
.rowform > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }

.rowform form {
    margin: 8px 0 4px;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-hair);
    border-radius: var(--r-sm);
    display: flex; flex-direction: column; gap: 4px;
    min-width: 220px;
}
.rowform .form-label { margin: 4px 0 0; }
.rowform .btn { margin-top: 10px; align-self: flex-start; }
.rowform__hint { font-size: 11.5px; color: var(--text-3); line-height: 1.4; margin-top: 4px; }

/* Bakim rozeti: acik alarm kadar acil degil - kirmizi yerine kehribar */
.sidebar__badge--warn { background: var(--warn); }

/* Tiklanabilir KPI kutusu: gorunum aynidir, sadece imlec ve vurgu eklenir */
.kpi--link { text-decoration: none; color: inherit; }
.kpi--link:hover { border-color: var(--border-strong); background: var(--surface-2); }
.kpi--link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Enerji: bosta harcamanin yarisi gectiyse dikkat cek */
.energy-idle--high { color: var(--warn); font-weight: 500; }

/* =====================================================================
   Recete ekrani
   ===================================================================== */

/* Recete basligi: ad solda, uygula/sil sagda */
.rec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); }
.rec-head__actions { display: flex; gap: var(--s-2); flex: none; }
.rec-head__actions form { margin: 0; }

/* Yeni recete formundaki tablo: hucreler giris alani tasiyor */
.rec-form td { padding: 8px 10px; }
.rec-form .form-control { min-width: 96px; text-align: right; }
.rec-form td:last-child { text-align: center; }
