/* ═══════════════════════════ modBUS nexR CORPORATE DESIGN SYSTEM ═══════════════════════════ */
:root {
    --brand:          #FF6A1A;
    --brand-600:      #E85A10;
    --brand-700:      #FF9A60;
    --brand-50:       rgba(255,106,26,.11);
    --brand-100:      rgba(255,106,26,.20);

    --page:           #08090B;
    --surface:        #111317;
    --surface-2:      #15181C;
    --surface-3:      #1B1F24;

    --border:         rgba(255,255,255,.08);
    --border-strong:  rgba(255,255,255,.15);

    --text:           #F4F5F7;
    --text-2:         #B2B8C1;
    --text-3:         #747C87;

    --success:        #15905A;
    --success-bg:     rgba(21,144,90,.14);
    --danger:         #FF6B6B;
    --danger-bg:      rgba(198,40,40,.15);
    --warn:           #F4A340;
    --warn-bg:        rgba(178,106,0,.16);
    --info-bg:        rgba(255,106,26,.10);

    --sh-1: 0 1px 2px rgba(0,0,0,.20);
    --sh-2: 0 1px 3px rgba(0,0,0,.22), 0 12px 30px -10px rgba(0,0,0,.55);
    --sh-3: 0 2px 8px rgba(0,0,0,.30), 0 24px 60px -14px rgba(0,0,0,.70);
    --sh-focus: 0 0 0 3px rgba(255,106,26,.18);

    --r-sm: 8px;
    --r:    12px;
    --r-lg: 16px;

    --sidebar-w: 244px;
    --ease: cubic-bezier(.4,0,.2,1);
}

* { margin:0; padding:0; box-sizing:border-box; }
html, body { height:100%; }
body {
    font-family:'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:var(--page);
    color:var(--text);
    font-size:14px;
    line-height:1.5;
    -webkit-font-smoothing:antialiased;
}
#landing-root { min-height:100vh; background:#030405; }
#landing-root.hidden { min-height:0; }
button, input, select, textarea { font-family:inherit; font-size:inherit; color:inherit; }
.hidden { display:none !important; }
::selection { background:var(--brand-100); }

/* ═══════════════════════════ FORM ATOMS ═══════════════════════════ */
.field { display:flex; flex-direction:column; gap:6px; margin-bottom:16px; }
.field:last-child { margin-bottom:0; }
.field > label {
    font-size:12.5px; font-weight:600; color:var(--text-2);
    letter-spacing:.01em;
}
.field .hint { font-size:12px; color:var(--text-3); }

.input, select.input {
    width:100%; height:40px; padding:0 12px;
    background:var(--surface); color:var(--text);
    border:1px solid var(--border-strong); border-radius:var(--r-sm);
    transition:border-color .15s var(--ease), box-shadow .15s var(--ease);
    outline:none;
}
select.input {
    appearance:none; padding-right:34px; cursor:pointer;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235A6076' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat:no-repeat; background-position:right 12px center;
}
.input::placeholder { color:var(--text-3); }
.input:hover:not(:disabled) { border-color:#BFC5D8; }
.input:focus { border-color:var(--brand); box-shadow:var(--sh-focus); }
.input:disabled { background:var(--surface-3); color:var(--text-3); cursor:not-allowed; }

/* ═══════════════════════════ BUTTONS ═══════════════════════════ */
.btn {
    display:inline-flex; align-items:center; justify-content:center; gap:8px;
    height:40px; padding:0 16px; border:1px solid transparent;
    border-radius:var(--r-sm); font-weight:600; font-size:13.5px;
    cursor:pointer; white-space:nowrap; user-select:none;
    transition:background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .08s var(--ease);
}
.btn:active:not(:disabled) { transform:translateY(1px); }
.btn:focus-visible { outline:none; box-shadow:var(--sh-focus); }
.btn svg { width:16px; height:16px; flex-shrink:0; }

.btn-primary { background:var(--brand); color:#fff; box-shadow:var(--sh-1); }
.btn-primary:hover:not(:disabled) { background:var(--brand-600); }
.btn-ghost { background:var(--surface); color:var(--text-2); border-color:var(--border-strong); }
.btn-ghost:hover:not(:disabled) { background:var(--surface-3); color:var(--text); }
.btn-soft { background:var(--brand-50); color:var(--brand); }
.btn-soft:hover:not(:disabled) { background:var(--brand-100); }
.btn-danger-ghost { background:var(--surface); color:var(--danger); border-color:#F0D5D5; }
.btn-danger-ghost:hover:not(:disabled) { background:var(--danger-bg); }

.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn-lg { height:46px; padding:0 22px; font-size:14.5px; }
.btn-sm { height:32px; padding:0 12px; font-size:12.5px; border-radius:7px; }
.btn-block { width:100%; }
.btn-icon { width:34px; height:34px; padding:0; }
.btn-icon svg { width:15px; height:15px; }

/* ═══════════════════════════ CARD ═══════════════════════════ */
.card {
    background:var(--surface); border:1px solid var(--border);
    border-radius:var(--r-lg); box-shadow:var(--sh-2);
}
.card-head {
    padding:20px 24px; border-bottom:1px solid var(--border);
    display:flex; align-items:flex-start; justify-content:space-between; gap:16px;
}
.card-head h2 { font-size:15.5px; font-weight:650; letter-spacing:-.01em; }
.card-head .desc { font-size:12.5px; color:var(--text-3); margin-top:3px; }
.card-body { padding:24px; }

/* ═══════════════════════════ ALERTS ═══════════════════════════ */
.alert {
    display:flex; gap:10px; align-items:flex-start;
    padding:11px 14px; border-radius:var(--r-sm); font-size:13px;
    border:1px solid transparent; margin-bottom:16px;
}
.alert svg { width:16px; height:16px; margin-top:1px; flex-shrink:0; }
.alert-error   { background:var(--danger-bg);  color:#FFB4B4; border-color:rgba(255,107,107,.28); }
.alert-warn    { background:var(--warn-bg);    color:#FFD39A; border-color:rgba(244,163,64,.25); }
.alert-success { background:var(--success-bg); color:#82D9B1; border-color:rgba(21,144,90,.28); }
.alert-info    { background:var(--info-bg);    color:var(--brand-700); border-color:var(--brand-100); }

/* ═══════════════════════════ LOGIN ═══════════════════════════ */
.login-screen {
    position:fixed; inset:0; z-index:100;
    display:flex; align-items:center; justify-content:center; padding:24px;
    background:
        radial-gradient(900px 600px at 100% 100%, rgba(156,64,11,.55) 0%, transparent 68%),
        radial-gradient(700px 420px at 10% -10%, rgba(255,106,26,.13) 0%, transparent 65%),
        var(--page);
}
.login-card { width:100%; max-width:408px; padding:38px 36px; box-shadow:var(--sh-3); backdrop-filter:blur(18px); }
.login-brand { text-align:center; margin-bottom:24px; display:flex; flex-direction:column; align-items:center; width:100%; overflow:hidden; }
.portal-brand { display:inline-flex; align-items:baseline; gap:9px; margin-bottom:14px; font-size:23px; letter-spacing:-.035em; }
.portal-brand span { color:var(--text-3); font-weight:300; }
.portal-brand span b { color:var(--text); font-weight:800; }
.portal-brand span:last-child b { color:var(--brand); }
.portal-brand i { width:1px; height:17px; background:var(--border-strong); transform:translateY(2px); }
.portal-brand--small { margin:0; font-size:17px; white-space:nowrap; }
.portal-brand--small i { height:13px; }
.login-brand p {
    font-size:11.5px; font-weight:600; letter-spacing:.14em;
    color:var(--text-3); text-transform:uppercase;
}
.login-foot { margin-top:20px; text-align:center; font-size:11.5px; color:var(--text-3); }

/* ═══════════════════════════ SHELL ═══════════════════════════ */
.shell { display:flex; min-height:100vh; }

.sidebar {
    width:var(--sidebar-w); flex-shrink:0;
    background:var(--surface); border-right:1px solid var(--border);
    display:flex; flex-direction:column;
    position:sticky; top:0; height:100vh; z-index:30;
    transition:transform .2s var(--ease), width .2s var(--ease);
}
.sb-brand {
    height:64px; display:flex; align-items:center; justify-content:flex-start; gap:10px;
    padding:0 20px; border-bottom:1px solid var(--border); overflow:hidden; width:100%;
}

.sb-nav { padding:16px 12px; display:flex; flex-direction:column; gap:2px; flex:1; }
.sb-label {
    font-size:10.5px; font-weight:700; letter-spacing:.11em; text-transform:uppercase;
    color:var(--text-3); padding:8px 12px 6px;
}
.nav-item {
    display:flex; align-items:center; gap:11px;
    padding:9px 12px; border:none; background:none; border-radius:var(--r-sm);
    font-size:13.5px; font-weight:550; color:var(--text-2);
    cursor:pointer; text-align:left; width:100%;
    transition:background .15s var(--ease), color .15s var(--ease);
}
.nav-item svg { width:17px; height:17px; stroke-width:1.9; flex-shrink:0; opacity:.8; }
.nav-item:hover { background:var(--surface-3); color:var(--text); }
.nav-item.active { background:var(--brand-50); color:var(--brand); font-weight:650; }
.nav-item.active svg { opacity:1; }

.sb-foot { padding:14px 20px; border-top:1px solid var(--border); }
.sb-foot .ver { font-size:11.5px; color:var(--text-3); }
.sb-foot .ver strong { color:var(--text-2); font-weight:600; }

.main { flex:1; min-width:0; display:flex; flex-direction:column; }

.topbar {
    height:64px; flex-shrink:0;
    display:flex; align-items:center; justify-content:space-between; gap:16px;
    padding:0 28px; background:rgba(17,19,23,.86);
    backdrop-filter:blur(8px); border-bottom:1px solid var(--border);
    position:sticky; top:0; z-index:20;
}
.topbar h1 { font-size:16.5px; font-weight:650; letter-spacing:-.015em; }
.topbar .crumb { font-size:12px; color:var(--text-3); margin-top:1px; }
.topbar-right { display:flex; align-items:center; gap:12px; }
.user-chip {
    display:flex; align-items:center; gap:9px;
    padding:5px 12px 5px 5px; background:var(--surface-3);
    border-radius:100px; font-size:13px; font-weight:600; color:var(--text-2);
}
.avatar {
    width:26px; height:26px; border-radius:50%;
    background:var(--brand); color:#fff;
    display:grid; place-items:center; font-size:11.5px; font-weight:700;
}

.page { padding:26px 28px 44px; flex:1; }
.page-max { max-width:1520px; margin:0 auto; }

/* ═══════════════════════════ SECTION HEAD ═══════════════════════════ */
.sec-head {
    display:flex; align-items:flex-end; justify-content:space-between;
    gap:16px; margin-bottom:18px; flex-wrap:wrap;
}
.sec-head h2 { font-size:18px; font-weight:650; letter-spacing:-.02em; }
.sec-head p { font-size:13px; color:var(--text-3); margin-top:3px; }

/* ═══════════════════════════ FLASHER GRID ═══════════════════════════ */
.flash-grid {
    display:grid; grid-template-columns:minmax(0,1.55fr) minmax(360px,1fr);
    gap:20px; align-items:start;
}

/* ── Stepper ── */
.steps { padding:8px 24px 24px; }
.step { display:grid; grid-template-columns:34px 1fr; gap:16px; }
.step-rail { display:flex; flex-direction:column; align-items:center; }
.step-dot {
    width:30px; height:30px; border-radius:50%; margin-top:17px;
    display:grid; place-items:center;
    font-size:12.5px; font-weight:700;
    background:var(--surface-3); color:var(--text-3);
    border:1px solid var(--border-strong);
    transition:all .2s var(--ease);
}
.step-dot svg { width:15px; height:15px; }
.step-line { flex:1; width:2px; background:var(--border); margin:8px 0 0; border-radius:2px; }
.step:last-child .step-line { display:none; }

.step-main { padding:17px 0 22px; min-width:0; }
.step:last-child .step-main { padding-bottom:4px; }
.step-title { font-size:14.5px; font-weight:650; color:var(--text-3); transition:color .2s var(--ease); }
.step-sub { font-size:12.5px; color:var(--text-3); margin-top:2px; }
.step-body { margin-top:16px; }

/* durum: aktif */
.step.is-active .step-dot { background:var(--brand); color:#fff; border-color:var(--brand); box-shadow:0 0 0 4px var(--brand-50); }
.step.is-active .step-title { color:var(--text); }
/* durum: tamamlandı */
.step.is-done .step-dot { background:var(--success); color:#fff; border-color:var(--success); }
.step.is-done .step-line { background:var(--success); opacity:.35; }
.step.is-done .step-title { color:var(--text); }
/* durum: kilitli */
.step.is-locked .step-body { opacity:.45; pointer-events:none; filter:grayscale(.35); }

.step-flag {
    display:inline-flex; align-items:center; gap:5px;
    margin-left:8px; padding:2px 8px; border-radius:100px;
    font-size:11px; font-weight:650; letter-spacing:.02em;
    background:var(--surface-3); color:var(--text-3); vertical-align:middle;
}
.step.is-done .step-flag { background:var(--success-bg); color:var(--success); }
.step.is-active .step-flag { background:var(--brand-50); color:var(--brand); }

/* ── Bağlantı satırı ── */
.conn-row {
    display:flex; align-items:center; justify-content:space-between; gap:14px;
    padding:12px 14px; background:var(--surface-2);
    border:1px solid var(--border); border-radius:var(--r); flex-wrap:wrap;
}
.status {
    display:inline-flex; align-items:center; gap:8px;
    font-size:13px; font-weight:600; color:var(--text-2);
}
.dot { width:8px; height:8px; border-radius:50%; background:var(--text-3); flex-shrink:0; }
.status.is-on  .dot { background:var(--success); box-shadow:0 0 0 3px rgba(21,144,90,.16); }
.status.is-on  { color:var(--success); }
.status.is-err .dot { background:var(--danger); box-shadow:0 0 0 3px rgba(198,40,40,.14); }
.status.is-err { color:var(--danger); }
.status.is-busy .dot { background:var(--brand); animation:pulse 1.1s var(--ease) infinite; }
@keyframes pulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.35; transform:scale(.8); } }

.chip-meta {
    display:flex; flex-wrap:wrap; gap:8px; margin-top:12px;
}
.meta-pill {
    display:inline-flex; align-items:center; gap:6px;
    padding:5px 11px; border-radius:100px;
    background:var(--surface-3); border:1px solid var(--border);
    font-size:12px; color:var(--text-2);
}
.meta-pill b { color:var(--text); font-weight:650; }

/* ── Segmented control ── */
.segmented {
    display:inline-grid; grid-auto-flow:column; gap:3px;
    padding:3px; background:var(--surface-3);
    border:1px solid var(--border); border-radius:10px;
}
.seg-btn {
    display:flex; align-items:center; gap:7px;
    padding:8px 15px; border:none; background:none; border-radius:7px;
    font-size:13px; font-weight:600; color:var(--text-2); cursor:pointer;
    transition:background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.seg-btn svg { width:15px; height:15px; }
.seg-btn:hover { color:var(--text); }
.seg-btn.active { background:var(--surface); color:var(--brand); box-shadow:var(--sh-1); }

.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }

/* ── Özet çubuğu ── */
.summary {
    display:flex; flex-wrap:wrap; gap:0; margin-top:18px;
    background:var(--surface-2); border:1px solid var(--border);
    border-radius:var(--r); overflow:hidden;
}
.sum-item { flex:1; min-width:150px; padding:11px 14px; border-right:1px solid var(--border); }
.sum-item:last-child { border-right:none; }
.sum-item .k {
    font-size:10.5px; font-weight:700; letter-spacing:.09em;
    text-transform:uppercase; color:var(--text-3);
}
.sum-item .v {
    font-size:13px; font-weight:600; color:var(--text); margin-top:3px;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.sum-item .v.empty { color:var(--text-3); font-weight:500; }

/* ── Flash aksiyonu ── */
.flash-action { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.block-reason {
    display:flex; align-items:center; gap:7px;
    font-size:12.5px; color:var(--warn);
}
.block-reason svg { width:14px; height:14px; flex-shrink:0; }

/* ── Progress ── */
.progress { margin-top:20px; }
.prog-head {
    display:flex; align-items:baseline; justify-content:space-between; gap:12px;
    margin-bottom:9px;
}
.prog-head .lbl { font-size:13px; font-weight:600; color:var(--text); }
.prog-head .pct { font-size:13px; font-weight:700; color:var(--brand); font-variant-numeric:tabular-nums; }
.prog-track { height:6px; background:var(--surface-3); border-radius:100px; overflow:hidden; }
.prog-fill {
    height:100%; width:0%; border-radius:100px;
    background:linear-gradient(90deg, var(--brand) 0%, #4A4EB8 100%);
    transition:width .25s var(--ease);
}
.prog-foot {
    display:flex; justify-content:space-between; gap:12px; margin-top:8px;
    font-size:11.5px; color:var(--text-3); font-variant-numeric:tabular-nums;
}

/* ── Sonuç paneli ── */
.result {
    margin-top:22px; border:1px solid #CDE9DA; border-radius:var(--r-lg);
    background:linear-gradient(180deg,#F4FBF7 0%, var(--surface) 55%);
    overflow:hidden;
}
.result-head {
    display:flex; align-items:center; gap:12px;
    padding:18px 22px; border-bottom:1px solid #DFF0E7;
}
.result-icon {
    width:38px; height:38px; border-radius:50%; flex-shrink:0;
    background:var(--success); color:#fff; display:grid; place-items:center;
}
.result-icon svg { width:20px; height:20px; }
.result-head h3 { font-size:15px; font-weight:650; }
.result-head p { font-size:12.5px; color:var(--text-2); margin-top:2px; }

.result-body { display:grid; grid-template-columns:1fr auto; gap:26px; padding:22px; }
.cred-list { display:flex; flex-direction:column; gap:10px; min-width:0; }
.cred {
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    padding:10px 12px; background:var(--surface);
    border:1px solid var(--border); border-radius:var(--r-sm);
}
.cred .k { font-size:11px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:var(--text-3); }
.cred .v {
    font-family:'JetBrains Mono', ui-monospace, monospace;
    font-size:13.5px; font-weight:500; color:var(--text); margin-top:3px;
    overflow:hidden; text-overflow:ellipsis;
}
.qr-box { text-align:center; }
.qr-frame {
    padding:12px; background:#fff; border:1px solid var(--border);
    border-radius:var(--r); box-shadow:var(--sh-1); line-height:0;
}
.qr-box .cap { font-size:11.5px; color:var(--text-3); margin-top:9px; }
.result-foot {
    display:flex; gap:10px; padding:0 22px 22px; flex-wrap:wrap;
}

/* ═══════════════════════════ KONSOL ═══════════════════════════ */
.console-card {
    position:sticky; top:84px; display:flex; flex-direction:column;
    max-height:calc(100vh - 108px); background:#0F1420; border-color:#1E2638;
    color:#E2E8F0; box-shadow:0 8px 30px rgba(0,0,0,0.12);
}
.console-head {
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    padding:14px 18px; border-bottom:1px solid #1E2638; flex-shrink:0;
    background:#161D2F; border-radius:var(--r-lg) var(--r-lg) 0 0;
}
.console-head h2 { font-size:14px; font-weight:650; color:#F8FAFC; }
.console-head .desc { font-size:11.5px; color:#94A3B8; margin-top:2px; }
.console-tools { display:flex; gap:6px; }
.console-tools .btn-ghost {
    background:rgba(255,255,255,0.06); color:#CBD5E1; border-color:rgba(255,255,255,0.12);
}
.console-tools .btn-ghost:hover {
    background:rgba(255,255,255,0.14); color:#FFF;
}

.console-body {
    flex:1; overflow-y:auto; padding:12px 6px 14px;
    background:#0D111A;
    border-radius:0 0 var(--r-lg) var(--r-lg);
    font-family:'JetBrains Mono', ui-monospace, monospace;
    font-size:12px; line-height:1.65; min-height:340px;
}
.console-body::-webkit-scrollbar { width:7px; }
.console-body::-webkit-scrollbar-thumb { background:#253047; border-radius:100px; }
.console-body::-webkit-scrollbar-thumb:hover { background:#3B4C70; }

.log { display:grid; grid-template-columns:62px 16px 1fr; gap:8px; padding:3px 12px; border-radius:4px; }
.log:hover { background:rgba(255,255,255,0.04); }
.log .t { color:#64748B; font-size:11px; font-weight:500; }
.log .m { word-break:break-word; color:#CBD5E1; }
.log .s { font-weight:700; text-align:center; }
.log.info    .s { color:#64748B; }
.log.ok      .s, .log.ok .m    { color:#10B981; }
.log.err     .s, .log.err .m   { color:#EF4444; }
.log.warn    .s, .log.warn .m  { color:#F59E0B; }
.log.step    .m { color:#38BDF8; font-weight:600; }
.log.step    .s { color:#38BDF8; }

.console-empty {
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:12px; height:320px; color:#64748B;
    font-family:'Inter', sans-serif; font-size:13px; text-align:center; padding:0 30px;
}
.console-empty svg { width:34px; height:34px; opacity:.4; color:#38BDF8; }

/* ═══════════════════════════ TABLO ═══════════════════════════ */
.table-wrap { overflow-x:auto; border-radius:0 0 var(--r-lg) var(--r-lg); }
table.data { width:100%; border-collapse:collapse; }
table.data th {
    text-align:left; padding:11px 20px; background:var(--surface-2);
    font-size:11px; font-weight:700; letter-spacing:.07em; text-transform:uppercase;
    color:var(--text-3); border-bottom:1px solid var(--border); white-space:nowrap;
}
table.data td {
    padding:14px 20px; border-bottom:1px solid var(--border);
    font-size:13.5px; color:var(--text-2); vertical-align:middle;
}
table.data tbody tr:last-child td { border-bottom:none; }
table.data tbody tr { transition:background .12s var(--ease); }
table.data tbody tr:hover { background:var(--surface-2); }
table.data td.mono { font-family:'JetBrains Mono', monospace; font-size:12.5px; color:var(--text); }
table.data td.strong { font-weight:650; color:var(--text); }
.row-actions { display:flex; gap:6px; justify-content:flex-end; }

.tag {
    display:inline-flex; align-items:center; padding:3px 9px; border-radius:100px;
    font-size:11.5px; font-weight:600;
    background:var(--brand-50); color:var(--brand);
}
.tag.muted { background:var(--surface-3); color:var(--text-3); }
.tag.online { background:#DCFCE7; color:#15803D; }
.tag.error { background:#FEE2E2; color:#B91C1C; }
.online-empty { text-align:center; color:var(--text-3); padding:24px !important; }
.online-values-card { margin-top:18px; }
.live-indicator { display:flex; align-items:center; gap:7px; color:#15803D; font-size:12px; font-weight:600; }
.live-indicator span { width:8px; height:8px; border-radius:50%; background:#22C55E; box-shadow:0 0 0 4px #DCFCE7; }
.online-values-card table.data th:last-child { text-align:right; }
.inline-write { display:flex; gap:6px; justify-content:flex-end; min-width:155px; }
.inline-write .input { width:90px; padding:7px 8px; }

/* Model view, grouped per slave to match the panel served by the card itself. */
.online-model { padding:18px; display:flex; flex-direction:column; gap:18px; }
.online-slave-group { border:1px solid var(--border); border-radius:var(--r); background:var(--surface-2); }
.online-slave-head {
    display:flex; align-items:center; gap:10px;
    padding:12px 14px; border-bottom:1px solid var(--border);
}
.online-slave-tag { font-size:14px; font-weight:650; }
.online-slave-tag .mono { color:var(--text-3); font-weight:500; }
.online-slave-line { flex:1; }
.online-value-grid {
    display:grid; gap:12px; padding:14px;
    grid-template-columns:repeat(auto-fill, minmax(250px, 1fr));
}
.online-value-tile {
    display:flex; flex-direction:column; gap:8px;
    padding:12px; border:1px solid var(--border);
    border-radius:var(--r); background:var(--surface);
}
/* A value the card could not read keeps its place but stops looking live. */
.online-value-tile.is-stale { opacity:.72; }
.ovt-head { display:flex; align-items:flex-start; justify-content:space-between; gap:6px; }
.ovt-name { font-size:13px; font-weight:650; overflow-wrap:anywhere; }
.ovt-actions { display:flex; gap:2px; flex-shrink:0; }
.ovt-value { font:600 22px 'JetBrains Mono', monospace; }
.ovt-meta { display:flex; justify-content:space-between; gap:8px; color:var(--text-3); font-size:11px; }
.online-value-tile .inline-write { justify-content:flex-start; min-width:0; }
.online-value-tile .inline-write .input { width:100%; }

/* .btn-ghost and .input share a surface background and the same border, so a
   ghost button next to a text box reads as a second text box. Inside the model
   view the actions get a filled, tinted look instead. */
.online-slave-head .btn, .online-value-tile .btn {
    height:30px; padding:0 11px; font-size:12.5px; font-weight:650;
    background:var(--surface-3); color:var(--text-2);
    border-color:transparent; border-radius:8px;
}
.online-slave-head .btn:hover:not(:disabled),
.online-value-tile .btn:hover:not(:disabled) { background:#242A31; color:var(--text); }
/* Writing to the bus is the one action that changes the plant, so it carries
   the brand colour and the others stay quiet. */
.online-value-tile .inline-write .btn {
    background:var(--brand-50); color:var(--brand);
    border-color:rgba(255,106,26,.35);
}
.online-value-tile .inline-write .btn:hover:not(:disabled) { background:var(--brand-100); }
.online-slave-head .btn-danger-ghost, .online-value-tile .btn-danger-ghost {
    background:var(--danger-bg); color:var(--danger); border-color:transparent;
}
.online-slave-head .btn-danger-ghost:hover:not(:disabled),
.online-value-tile .btn-danger-ghost:hover:not(:disabled) { background:rgba(198,40,40,.28); }
.online-tile-add {
    align-items:center; justify-content:center; gap:4px; cursor:pointer;
    border-style:dashed; color:var(--text-3); background:transparent; min-height:120px;
}
.online-tile-add:hover { color:var(--text-1); border-color:var(--text-3); }
.ovt-plus { font-size:22px; line-height:1; }
.online-add-slave { align-self:flex-start; border-style:dashed; }

@media (max-width:640px) {
    .online-value-grid { grid-template-columns:1fr; }
}
.online-tools { display:grid; grid-template-columns:1fr 1fr; gap:16px; padding:18px; border-top:1px solid var(--border); }
.online-tool { padding:16px; border:1px solid var(--border); border-radius:var(--r); background:var(--surface-2); }
.online-tool h3 { font-size:14px; margin-bottom:5px; }
.online-tool p { color:var(--text-3); font-size:12px; margin-bottom:12px; }
.command-row { display:flex; gap:8px; }
.command-row .input { min-width:0; flex:1; }
.command-result { min-height:20px; margin-top:10px; font:12px 'JetBrains Mono', monospace; overflow-wrap:anywhere; }
.command-result.ok { color:#15803D; }
.command-result.error { color:#B91C1C; }
.history-chart { min-height:160px; margin-top:12px; }
.history-chart svg { width:100%; min-width:0; }
.history-chart line { stroke:var(--border-strong); }
.history-chart polyline { fill:none; stroke:var(--brand); stroke-width:3; stroke-linejoin:round; }
.history-chart text { fill:var(--text-3); font-size:11px; }
.history-events { max-height:180px; overflow:auto; margin-top:10px; }
.history-events > div { display:grid; grid-template-columns:1.4fr 1fr .5fr; gap:8px; padding:7px 0; border-bottom:1px solid var(--border); font-size:11px; }
@media (max-width: 820px) {
    .online-tools { grid-template-columns:1fr; padding:12px; }
    .command-row { flex-direction:column; }
    .inline-write { min-width:135px; }
}

/* ═══════════════════════════ PROFİL KARTLARI ═══════════════════════════ */
.profile-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(310px,1fr)); gap:16px; }
.profile-card { padding:20px; transition:box-shadow .18s var(--ease), border-color .18s var(--ease); }
.profile-card:hover { box-shadow:var(--sh-3); border-color:var(--border-strong); }
.pc-top { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.pc-top h3 { font-size:14.5px; font-weight:650; }
.pc-top .sub { font-size:12.5px; color:var(--text-3); margin-top:2px; }
.pc-specs { display:flex; flex-wrap:wrap; gap:7px; margin:16px 0; }
.pc-foot {
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    padding-top:14px; border-top:1px solid var(--border);
    font-size:12px; color:var(--text-3);
}

/* ═══════════════════════════ REPEATER (slave / register satırları) ═══════════════════════════ */
.repeater { border:1px solid var(--border); border-radius:var(--r); overflow:hidden; background:var(--surface-2); }
.rep-head {
    display:grid; gap:8px; padding:9px 12px;
    background:var(--surface-3); border-bottom:1px solid var(--border);
}
.rep-head span {
    font-size:10.5px; font-weight:700; letter-spacing:.07em;
    text-transform:uppercase; color:var(--text-3);
}
.rep-rows { padding:10px 12px; display:flex; flex-direction:column; gap:8px; }
.rep-row { display:grid; gap:8px; align-items:center; }
.rep-row .input { height:36px; font-size:13px; }
.rep-empty {
    padding:18px 12px; text-align:center; font-size:12.5px; color:var(--text-3);
}
.rep-foot {
    padding:0 12px 12px; display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.rep-count { font-size:12px; color:var(--text-3); font-variant-numeric:tabular-nums; }

/* satır kolon şablonları */
.rep-slaves .rep-head, .rep-slaves .rep-row { grid-template-columns:1fr 104px 34px; }
.rep-values .rep-head, .rep-values .rep-row { grid-template-columns:110px 1fr 96px 78px 34px; }

.rep-del {
    width:34px; height:36px; padding:0; border-radius:7px;
    border:1px solid #F0D5D5; background:var(--surface); color:var(--danger);
    cursor:pointer; display:grid; place-items:center;
    transition:background .15s var(--ease);
}
.rep-del:hover { background:var(--danger-bg); }
.rep-del svg { width:14px; height:14px; }

/* ═══════════════════════════ MODAL ═══════════════════════════ */
.modal-back {
    position:fixed; inset:0; z-index:200; display:none;
    align-items:center; justify-content:center; padding:24px;
    background:rgba(22,24,34,.42); backdrop-filter:blur(3px);
}
.modal-back.open { display:flex; }
.modal { width:100%; max-width:460px; box-shadow:var(--sh-3); max-height:88vh; display:flex; flex-direction:column; }
.modal-wide { max-width:760px; }
.modal-head {
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    padding:18px 22px; border-bottom:1px solid var(--border); flex-shrink:0;
}
.modal-head h3 { font-size:15.5px; font-weight:650; }
.modal-body { padding:22px; overflow-y:auto; }
.modal-foot {
    display:flex; gap:10px; justify-content:flex-end;
    padding:16px 22px; border-top:1px solid var(--border); background:var(--surface-2);
    border-radius:0 0 var(--r-lg) var(--r-lg); flex-shrink:0;
}
.x-btn {
    width:30px; height:30px; border:none; background:none; border-radius:7px;
    color:var(--text-3); font-size:20px; line-height:1; cursor:pointer;
}
.x-btn:hover { background:var(--surface-3); color:var(--text); }

/* ═══════════════════════════ TOAST ═══════════════════════════ */
.toast-zone {
    position:fixed; right:22px; bottom:22px; z-index:300;
    display:flex; flex-direction:column; gap:10px; pointer-events:none;
}
.toast {
    display:flex; align-items:center; gap:10px;
    padding:12px 16px; background:var(--surface);
    border:1px solid var(--border); border-left:3px solid var(--success);
    border-radius:var(--r-sm); box-shadow:var(--sh-3);
    font-size:13px; font-weight:550; min-width:220px;
    animation:toastIn .22s var(--ease);
}
.toast.err { border-left-color:var(--danger); }
@keyframes toastIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

/* ═══════════════════════════ RESPONSIVE ═══════════════════════════ */
@media (max-width:1180px) {
    .flash-grid { grid-template-columns:1fr; }
    .console-card { position:static; max-height:none; }
}
@media (max-width:960px) {
    :root { --sidebar-w:64px; }
    .sb-brand { justify-content:center; padding:0; }
    .sb-brand img, .sb-brand .fallback, .sb-brand .portal-brand { display:none; }
    .sb-brand::after {
        content:'nR'; width:32px; height:32px; border-radius:8px;
        background:var(--brand); color:#fff; display:grid; place-items:center;
        font-weight:800; font-size:13px;
    }
    .sb-label, .nav-item span, .sb-foot { display:none; }
    .nav-item { justify-content:center; padding:11px 0; }
    .page, .topbar { padding-left:18px; padding-right:18px; }
    .result-body { grid-template-columns:1fr; }
    .qr-box { justify-self:center; }
}
@media (max-width:640px) {
    .grid-2 { grid-template-columns:1fr; }
    .topbar h1 { font-size:15px; }
    .user-chip span { display:none; }
    .rep-values .rep-head, .rep-values .rep-row { grid-template-columns:85px 1fr 70px 65px 34px; }
}
@media print { .sidebar, .topbar, .console-card { display:none; } }
