/* ── Variables ───────────────────────────────────────────────────────────── */
:root {
    --bg-base:    #f0f4f8;
    --bg-surface: #ffffff;
    --bg-card:    #ffffff;
    --bg-card2:   #f8fafc;
    --bg-input:   #ffffff;
    --border:     #e2e8f0;
    --border2:    #cbd5e1;

    --accent:     #3b82f6;
    --accent-dim: #2563eb;
    --purple:     #8b5cf6;
    --green:      #10b981;
    --red:        #ef4444;
    --orange:     #f59e0b;
    --yellow:     #fbbf24;

    --text:       #1e293b;
    --text-muted: #94a3b8;
    --text-dim:   #64748b;

    --sidebar-w:  260px;
    --topbar-h:   60px;
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md:  0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
}

/* ── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-base);
    color: var(--text);
    min-height: 100vh;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.page { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 8px rgba(0,0,0,0.06);
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

main {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
}

.top-row {
    height: var(--topbar-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 1.5rem;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-row a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}
.top-row a:hover { color: var(--accent); }

article.content { min-width: 0; padding: 1.5rem 2rem 2rem; flex: 1; }

/* ── Sidebar Brand ───────────────────────────────────────────────────────── */
.sidebar-brand {
    padding: 1.25rem 1.25rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.brand-icon {
    width: 36px; height: 36px;
    background: var(--violet);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: #fff; flex-shrink: 0;
}

.brand-name {
    font-weight: 700; font-size: 0.95rem;
    color: var(--text); line-height: 1.2;
}

.brand-sub {
    font-size: 0.7rem; color: var(--text-muted); line-height: 1.2;
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.nav-section { padding: 0 0.75rem; margin-bottom: 0.25rem; }

.nav-label {
    font-size: 0.65rem; font-weight: 600; letter-spacing: 0.08em;
    color: var(--text-muted); text-transform: uppercase;
    padding: 0.75rem 0.5rem 0.35rem;
}

.nav-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 0.75rem; border-radius: 8px;
    color: var(--text-dim); text-decoration: none;
    font-size: 0.88rem; font-weight: 500;
    transition: all 0.15s ease; margin-bottom: 2px; position: relative;
}
.nav-link:hover { background: rgba(59,130,246,0.07); color: var(--text); }
.nav-link.active {
    background: rgba(59,130,246,0.10); color: var(--accent);
}
.nav-link.active::before {
    content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
    width: 3px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-link i { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer {
    margin-top: auto; padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.72rem; color: var(--text-muted);
}

/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header {
    display: flex; align-items: center; gap: 1rem;
    margin-bottom: 1.5rem; padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.page-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--text); margin: 0; }
.page-icon {
    width: 42px; height: 42px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.card-header {
    padding: 0.875rem 1.25rem;
    background: var(--bg-card2);
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem; font-weight: 600; color: var(--text-dim);
    display: flex; align-items: center; gap: 0.5rem;
}
.card-header i { color: var(--accent); }
.card-body { padding: 1.25rem; }

/* ── Stat Cards ──────────────────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 1.25rem;
    position: relative; overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    box-shadow: var(--shadow-card);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); cursor: pointer; }
.stat-card::after {
    content: ''; position: absolute; top: 0; right: 0;
    width: 80px; height: 80px; border-radius: 50%;
    opacity: 0.08; transform: translate(20px, -20px);
}
.stat-card.s-accent::after { background: var(--accent); }
.stat-card.s-green::after  { background: var(--green); }
.stat-card.s-red::after    { background: var(--red); }
.stat-card.s-orange::after { background: var(--orange); }
.stat-card.s-violet::after { background: var(--violet); }

.stat-icon {
    width: 40px; height: 40px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; margin-bottom: 0.75rem;
}
.stat-card.s-accent .stat-icon { background: rgba(59,130,246,0.12);  color: var(--accent); }
.stat-card.s-green .stat-icon  { background: rgba(16,185,129,0.12);  color: var(--green); }
.stat-card.s-red .stat-icon    { background: rgba(239,68,68,0.12);   color: var(--red); }
.stat-card.s-orange .stat-icon { background: rgba(245,158,11,0.12);  color: var(--orange); }
.stat-card.s-violet .stat-icon { background: rgba(116,71,255,0.12); color: var(--violet); }

.stat-value {
    font-size: 1.75rem; font-weight: 700; color: var(--text);
    line-height: 1; margin-bottom: 0.25rem;
}
.stat-label { font-size: 0.8rem; color: var(--text-muted); }

/* ── Form Controls ───────────────────────────────────────────────────────── */
.form-label {
    font-size: 0.8rem; font-weight: 600; color: var(--text-dim);
    margin-bottom: 0.35rem; display: block;
}
.form-control, .form-select {
    background: var(--bg-input); border: 1px solid var(--border2);
    border-radius: 8px; color: var(--text);
    padding: 0.5rem 0.875rem; font-size: 0.875rem;
    width: 100%; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
    background: var(--bg-input); color: var(--text);
}
.form-control::placeholder { color: var(--text-muted); }
.form-select option { background: var(--bg-card); color: var(--text); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1.125rem; border-radius: 8px;
    font-size: 0.875rem; font-weight: 600;
    border: none; cursor: pointer; transition: all 0.15s ease;
    text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary  { background: var(--accent);  color: #fff; }
.btn-primary:hover:not(:disabled)  { background: var(--accent-dim); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59,130,246,0.35); }

.btn-success  { background: var(--green);   color: #fff; }
.btn-success:hover:not(:disabled)  { background: #059669; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16,185,129,0.35); }

.btn-danger   { background: var(--red);     color: #fff; }
.btn-danger:hover:not(:disabled)   { background: #dc2626; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(239,68,68,0.35); }

.btn-warning  { background: var(--orange);  color: #fff; }
.btn-warning:hover:not(:disabled)  { background: #d97706; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,158,11,0.35); }

.btn-secondary { background: #ffffff; color: var(--text-dim); border: 1px solid var(--border2); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-card2); color: var(--text); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

.btn-outline-accent { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-outline-accent:hover:not(:disabled) { background: rgba(59,130,246,0.08); }

.btn-outline-danger { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn-outline-danger:hover:not(:disabled) { background: rgba(239,68,68,0.08); }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.25rem 0.625rem; border-radius: 20px;
    font-size: 0.72rem; font-weight: 600;
}
.badge-cyan    { background: rgba(59,130,246,0.12);   color: var(--accent); }
.badge-green   { background: rgba(16,185,129,0.12);   color: var(--green); }
.badge-red     { background: rgba(239,68,68,0.12);    color: var(--red); }
.badge-orange  { background: rgba(245,158,11,0.12);   color: var(--orange); }
.badge-purple  { background: rgba(139,92,246,0.12);   color: var(--purple); }
.badge-grey    { background: rgba(100,116,139,0.12);  color: var(--text-dim); }
/* StatusClass aliases */
.badge-danger  { background: var(--red);  color: #fff; }
.badge-success { background: rgba(16,185,129,0.12);   color: var(--green); }
.badge-warning { background: rgba(245,158,11,0.12);   color: var(--orange); }

/* ── Terminal ────────────────────────────────────────────────────────────── */
.terminal-bar {
    background: #1e2430; border-radius: 12px 12px 0 0;
    padding: 0.6rem 1rem; display: flex; align-items: center; gap: 0.5rem;
    border: 1px solid #2d3748; border-bottom: 1px solid #1a202c;
}
.terminal-dot { width: 12px; height: 12px; border-radius: 50%; }
.terminal-dot.rd { background: #ff5f57; }
.terminal-dot.yl { background: #ffbd2e; }
.terminal-dot.gn { background: #28c940; }
.terminal-title { font-size: 0.75rem; color: #718096; margin-left: 0.5rem; }

.terminal-output {
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', 'Courier New', monospace;
    font-size: 0.82rem; line-height: 1.65;
    padding: 1rem 1.25rem;
    min-height: 180px; max-height: max-content; overflow-y: auto;
    background: #0f1117; color: #d4d4d4;
    white-space: pre-wrap; word-break: break-all;
    border: 1px solid #2d3748; border-top: none;
    border-radius: 0 0 12px 12px;
}
.t-line { min-height: 1.2em; }

/* Terminal color classes */
.t-white   { color: #e2e8f0; }
.t-grey    { color: #64748b; }
.t-cyan    { color: #22d3ee; }
.t-skyblue { color: #38bdf8; }
.t-lime    { color: #a3e635; }
.t-green   { color: #4ade80; }
.t-red     { color: #f87171; }
.t-yellow  { color: #fde047; }
.t-orange  { color: #fb923c; }
.t-purple  { color: #c084fc; }
.t-blue    { color: #60a5fa; }
.t-bold    { font-weight: 700; }

/* ── Data Table ──────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table thead th {
    background: var(--bg-card2); color: var(--text-dim);
    font-weight: 600; font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 0.05em;
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
    text-align: left; white-space: nowrap;
}
.data-table tbody tr {
    border-bottom: 1px solid var(--border); transition: background 0.15s;
}
.data-table tbody tr:hover { background: rgba(59,130,246,0.04); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody td { padding: 0.75rem 1rem; color: var(--text); vertical-align: middle; }

/* ── Network Map ─────────────────────────────────────────────────────────── */
.node-chip {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 0.875rem; border-radius: 8px;
    font-size: 0.82rem; font-weight: 600; border: 1px solid; margin: 3px;
}
.node-chip.cisco  { background: rgba(59,130,246,0.08);  border-color: rgba(59,130,246,0.25);  color: #2563eb; }
.node-chip.allied { background: rgba(139,92,246,0.08);  border-color: rgba(139,92,246,0.25);  color: #7c3aed; }
.node-chip .nd { width: 8px; height: 8px; border-radius: 50%; }
.node-chip.cisco  .nd { background: #3b82f6; }
.node-chip.allied .nd { background: #8b5cf6; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
    padding: 0.875rem 1rem; border-radius: 8px; font-size: 0.875rem;
    display: flex; align-items: flex-start; gap: 0.5rem;
}
.alert-danger  { background: rgba(239,68,68,0.08);   border: 1px solid rgba(239,68,68,0.25);  color: #dc2626; }
.alert-success { background: rgba(16,185,129,0.08);  border: 1px solid rgba(16,185,129,0.25); color: #059669; }
.alert-info    { background: rgba(59,130,246,0.08);  border: 1px solid rgba(59,130,246,0.25); color: var(--accent); }
.alert-warning { background: rgba(245,158,11,0.08);  border: 1px solid rgba(245,158,11,0.25); color: #d97706; }

/* ── Auth Loading ─────────────────────────────────────────────────────────── */
.auth-loading {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: var(--bg-base);
}

/* ── Login ────────────────────────────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh; display: flex;
    align-items: center; justify-content: center;
    background: var(--bg-base); padding: 1rem;
}

.login-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 16px; padding: 2.5rem;
    width: 100%; max-width: 420px;
    box-shadow: var(--shadow-md);
}

.login-header { text-align: center; margin-bottom: 2rem; }

.login-header .brand-icon {
    width: 56px; height: 56px;
    background: var(--violet);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #fff;
    margin: 0 auto 1rem;
}

.login-header h1 {
    font-size: 1.5rem; font-weight: 700;
    color: var(--text); margin: 0 0 0.25rem;
}

.login-header p { font-size: 0.875rem; color: var(--text-muted); margin: 0; }

/* ── Reconnect Modal ─────────────────────────────────────────────────────── */
#reconnect-modal { display: none; position: fixed; inset: 0; z-index: 1000; overflow: hidden; }
#reconnect-modal.show { display: flex; }

/* ── Error UI ────────────────────────────────────────────────────────────── */
#blazor-error-ui {
    background: rgba(239,68,68,0.9); bottom: 0; left: 0; display: none;
    padding: 0.6rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
    color: white; font-size: 0.875rem;
}
#blazor-error-ui .dismiss { cursor: pointer; font-size: 1.2rem; float: right; }
#blazor-error-ui a { color: white; font-weight: 600; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spinner-border {
    display: inline-block; width: 1rem; height: 1rem;
    border: 2px solid currentColor; border-right-color: transparent;
    border-radius: 50%; animation: spin 0.75s linear infinite;
}
.spinner-border-sm { width: 0.875rem; height: 0.875rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }    .mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; } .mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }    .mb-4 { margin-bottom: 1.5rem; }
.me-1 { margin-right: 0.25rem; } .me-2 { margin-right: 0.5rem; }
.ms-2 { margin-left: 0.5rem; }   .ms-auto { margin-left: auto; }
.d-flex { display: flex; } .align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; } .w-100 { width: 100%; }
.text-muted { color: var(--text-muted); } .text-accent { color: var(--accent); }
.fw-bold { font-weight: 700; } .small { font-size: 0.82rem; }
.gap-2 { gap: 0.5rem; } .gap-3 { gap: 1rem; }
.overflow-auto { overflow: auto; }

.row { display: flex; flex-wrap: wrap; margin: -0.5rem; }
.row > * { padding: 0.5rem; }
.col { flex: 1; min-width: 0; }
.col-auto { flex: 0 0 auto; }
.col-md-3  { flex: 0 0 25%;      max-width: 25%; }
.col-md-4  { flex: 0 0 33.333%;  max-width: 33.333%; }
.col-md-5  { flex: 0 0 41.667%;  max-width: 41.667%; }
.col-md-6  { flex: 0 0 50%;      max-width: 50%; }
.col-md-8  { flex: 0 0 66.667%;  max-width: 66.667%; }
.col-md-12 { flex: 0 0 100%;     max-width: 100%; }
.g-3 { gap: 1rem; }

/* ── Mobile Sidebar Toggle ───────────────────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    cursor: pointer;
}
.hamburger-btn {
    display: inline-flex;
    align-items: center;
    background: none; border: none;
    padding: 0.35rem 0.5rem; cursor: pointer;
    color: var(--text-dim); font-size: 1.4rem;
    border-radius: 8px; line-height: 1;
    transition: background 0.15s, color 0.15s;
    margin-right: auto;
}
.hamburger-btn:hover { background: rgba(59,130,246,0.08); color: var(--accent); }

.sidebar-close-btn {
    display: none;
    background: none; border: none;
    margin-left: auto; padding: 0.3rem;
    color: var(--text-muted); font-size: 1rem;
    cursor: pointer; border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.sidebar-close-btn:hover { background: rgba(239,68,68,0.08); color: var(--red); }

@media (min-width: 769px) {
    .sidebar-collapsed .sidebar { transform: translateX(-100%); }
    .sidebar-collapsed main { margin-left: 0; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.18);
    }
    .sidebar-open .sidebar-overlay { display: block; }
    .sidebar-close-btn { display: inline-flex; align-items: center; }
    .top-row { justify-content: flex-start; }
    main { margin-left: 0; }
    article.content { padding: 1rem; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-8 { flex: 0 0 100%; max-width: 100%; }
}

/* ── Input Group ─────────────────────────────────────────────────────────── */
.input-group { display: flex; position: relative; }
.input-group .form-control { border-radius: 8px 0 0 8px; }
.input-group-text {
    background: var(--bg-card2); border: 1px solid var(--border2);
    border-left: none; border-radius: 0 8px 8px 0;
    padding: 0 0.75rem; color: var(--text-dim); cursor: pointer;
}

/* ── Kinetic Colorful Neo-Utility remake ───────────────────────────────── */
:root {
    --ink: #16132A;
    --paper: #FFFDF8;
    --surface: #FFFFFF;
    --violet: #7447FF;
    --cyan: #16BFD0;
    --lime: #B9E93D;
    --pink: #FF5CA8;
    --danger: #D92D5E;

    --bg-base: var(--paper);
    --bg-surface: var(--surface);
    --bg-card: var(--surface);
    --bg-card2: #F7F1FF;
    --bg-input: var(--paper);
    --border: var(--ink);
    --border2: var(--ink);
    --accent: var(--violet);
    --accent-dim: #5D34E7;
    --purple: var(--violet);
    --green: #487A12;
    --red: var(--danger);
    --orange: #FF5A1F;
    --yellow: #8A6A00;
    --text: var(--ink);
    --text-muted: #686176;
    --text-dim: #423C55;
    --sidebar-w: 272px;
    --topbar-h: 64px;
    --radius-card: 16px;
    --radius-control: 12px;
    --radius-pill: 999px;
    --shadow-hard: 6px 6px 0 var(--ink);
    --shadow-hard-sm: 4px 4px 0 var(--ink);
    --shadow-sm: none;
    --shadow-md: var(--shadow-hard);
    --shadow-card: var(--shadow-hard);
}

html { background: var(--paper); }

html,
body {
    font-family: 'Noto Sans Thai', 'Inter', system-ui, sans-serif;
    background: var(--paper);
    color: var(--ink);
    font-size: 16px;
    overflow-x: hidden;
}

a { color: var(--violet); }

button,
input,
select,
textarea { font: inherit; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--orange) !important;
    outline-offset: 3px !important;
}

.sidebar {
    border-right: 2px solid var(--ink);
    box-shadow: none;
    background: var(--surface);
    scrollbar-color: var(--violet) var(--paper);
    scrollbar-width: thin;
}

main { background: transparent; }

.top-row {
    min-height: var(--topbar-h);
    height: auto;
    border-bottom: 2px solid var(--ink);
    box-shadow: none;
    background: rgba(255, 253, 248, 0.97);
    padding: 8px 24px;
}

article.content {
    width: min(100%, 1244px);
    margin: 0 auto;
    padding: 32px 32px 48px;
}

.sidebar-brand {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 80px;
    margin: 0 0 8px;
    padding: 16px;
    border-bottom: 2px solid var(--ink);
    background: var(--violet);
    color: white;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border: 2px solid var(--ink);
    border-radius: var(--radius-control);
    background: var(--lime);
    color: var(--ink);
    box-shadow: var(--shadow-hard-sm);
}

.brand-name { color: white; font-size: 1.05rem; font-weight: 800; }
.brand-sub { color: white; opacity: 0.88; font-weight: 600; }

.nav-section { padding: 0 12px; margin-bottom: 8px; }
.nav-label {
    color: var(--ink);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    padding: 12px 8px 6px;
}

.nav-link {
    min-height: 46px;
    margin-bottom: 5px;
    padding: 10px 12px;
    border: 2px solid transparent;
    border-radius: var(--radius-control);
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 700;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.nav-link:hover {
    border-color: var(--ink);
    background: var(--paper);
    color: var(--ink);
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--ink);
}

.nav-link.active {
    border-color: var(--ink);
    background: var(--cyan);
    color: var(--ink);
    box-shadow: 3px 3px 0 var(--ink);
}

.nav-link.active::before { display: none; }
.nav-link .text-muted { color: var(--ink) !important; opacity: 0.7; font-family: 'IBM Plex Mono', monospace; }

.sidebar-footer {
    border-top: 2px solid var(--ink);
    background: var(--paper);
    color: var(--ink);
    font-family: 'IBM Plex Mono', monospace;
}

.sidebar-version { margin-top: 3px; }

.user-chip,
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 6px 12px;
    border: 2px solid var(--ink);
    border-radius: var(--radius-pill);
    background: var(--cyan);
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.user-chip { min-width: 0; max-width: min(320px, 48vw); }
.user-chip i { flex: 0 0 auto; }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; border: 2px solid var(--ink); border-radius: 50%; background: var(--lime); }
.status-neutral { background: var(--paper); }
.status-neutral .status-dot { background: var(--orange); }
.status-ready { background: var(--lime); }
.status-violet { min-height: 28px; padding: 4px 8px; background: var(--violet); color: white; font-size: 0.68rem; }

.hamburger-btn,
.sidebar-close-btn {
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--ink);
    border-radius: var(--radius-control);
    background: var(--lime);
    color: var(--ink);
    box-shadow: var(--shadow-hard-sm);
}

.hamburger-btn:hover,
.sidebar-close-btn:hover { background: var(--cyan); color: var(--ink); }

.page-header {
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    padding: 0;
    border: 0;
}

.page-header h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.page-header p,
.page-heading-copy > p {
    margin: 6px 0 0;
    color: var(--text-dim);
    font-size: 1rem;
    font-weight: 600;
}

.page-icon,
.section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border: 2px solid var(--ink);
    border-radius: var(--radius-control);
    background: var(--cyan) !important;
    color: var(--ink) !important;
    box-shadow: var(--shadow-hard-sm);
    font-size: 1.25rem;
}

.tone-cyan { background: var(--cyan) !important; }
.tone-violet { background: var(--violet) !important; color: white !important; }
.tone-pink { background: var(--pink) !important; }
.tone-lime { background: var(--lime) !important; }
.tone-orange { background: var(--orange) !important; color: white !important; }
.page-heading-copy { min-width: 0; }
.page-header-status { margin-left: auto; }

.card,
.shadow-sm {
    border: 2px solid var(--ink) !important;
    border-radius: var(--radius-card) !important;
    background: var(--surface);
    box-shadow: var(--shadow-hard) !important;
}

.card { overflow: hidden; }

.card-header,
.card-footer {
    min-height: 52px;
    padding: 12px 18px;
    border-color: var(--ink) !important;
    background: var(--paper) !important;
    color: var(--ink);
    font-weight: 800;
}

.card-header i { color: var(--ink); }
.card-body { padding: 20px; }

.card-header-feature {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header-feature h2 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.card-header-feature p { margin: 2px 0 0; color: var(--text-dim); font-size: 0.82rem; font-weight: 600; }
.card-header-feature .status-pill,
.card-header-feature .selected-action-chip { margin-left: auto; }
.section-icon { width: 40px; height: 40px; box-shadow: none; }

.stat-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 20px; margin-bottom: 28px; }
.stat-card {
    min-height: 180px;
    padding: 24px;
    border: 2px solid var(--ink);
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-hard);
    transition: transform 140ms ease, box-shadow 140ms ease;
    color: var(--ink);
    text-decoration: none;
}
.stat-card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); color: var(--ink); }
.stat-card::after { width: 88px; height: 88px; opacity: 1; border: 2px solid var(--ink); }
.stat-card.s-accent::after { background: var(--cyan); }
.stat-card.s-green::after { background: var(--lime); }
.stat-card.s-red::after { background: var(--pink); }
.stat-card.s-orange::after { background: var(--orange); }
.stat-card.s-violet::after { background: var(--violet); }
.stat-icon { width: 46px; height: 46px; border: 2px solid var(--ink); border-radius: var(--radius-control); }
.stat-card.s-accent .stat-icon { background: var(--cyan); color: var(--ink); }
.stat-card.s-green .stat-icon { background: var(--lime); color: var(--ink); }
.stat-card.s-red .stat-icon { background: var(--pink); color: var(--ink); }
.stat-card.s-orange .stat-icon { background: var(--orange); color: white; }
.stat-card.s-violet .stat-icon { background: var(--violet); color: white; }
.stat-value { color: var(--ink); font-family: 'Archivo Black', 'Noto Sans Thai', sans-serif; font-size: 1.55rem; }
.stat-label { color: var(--text-dim); font-size: 0.88rem; font-weight: 600; }

.form-label {
    margin-bottom: 7px;
    color: var(--ink);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.form-control,
.form-select {
    min-height: 52px;
    padding: 10px 14px;
    border: 2px solid var(--ink);
    border-radius: var(--radius-control);
    background: var(--paper);
    color: var(--ink);
    font-size: 1rem;
    font-weight: 600;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ink);
    background: var(--paper);
    color: var(--ink);
    box-shadow: none;
}

.form-control::placeholder { color: #746E80; opacity: 1; }
.technical-input,
code,
.terminal-title { font-family: 'IBM Plex Mono', monospace; }

.input-group-text {
    border: 2px solid var(--ink);
    border-right: 0;
    border-radius: var(--radius-control) 0 0 var(--radius-control);
    background: var(--cyan) !important;
    color: var(--ink);
}
.input-group .form-control { border-radius: 0 var(--radius-control) var(--radius-control) 0; }

.btn {
    min-height: 48px;
    padding: 9px 17px;
    border: 2px solid var(--ink) !important;
    border-radius: var(--radius-control);
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.15;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.btn:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: none !important; }
.btn:disabled { opacity: 0.48; }
.btn-primary { background: var(--orange) !important; color: white !important; box-shadow: var(--shadow-hard-sm); }
.btn-info { background: var(--cyan) !important; color: var(--ink) !important; box-shadow: var(--shadow-hard-sm); }
.btn-success { background: var(--lime) !important; color: var(--ink) !important; }
.btn-danger { background: var(--danger) !important; color: white !important; }
.btn-warning { background: var(--pink) !important; color: var(--ink) !important; }
.btn-secondary,
.btn-outline-accent,
.btn-outline-secondary,
.btn-outline-danger { background: var(--surface) !important; color: var(--ink) !important; }
.btn-sm { min-height: 42px; padding: 7px 12px; }

.badge {
    border: 2px solid var(--ink);
    border-radius: var(--radius-pill);
    padding: 5px 10px;
    color: var(--ink) !important;
    font-weight: 800;
}
.badge-cyan { background: var(--cyan) !important; }
.badge-green,
.badge-success { background: var(--lime) !important; }
.badge-red,
.badge-danger { background: var(--danger) !important; color: white !important; }
.badge-orange,
.badge-warning { background: var(--orange) !important; color: white !important; }
.badge-purple { background: var(--violet) !important; color: white !important; }
.badge-grey { background: var(--paper) !important; }

.alert {
    border: 2px solid var(--ink) !important;
    border-radius: var(--radius-control);
    color: var(--ink) !important;
    font-weight: 650;
}
.alert-danger { background: #FFD9E7 !important; }
.alert-success { background: #E9F9B7 !important; }
.alert-info { background: #CFF7FA !important; }
.alert-warning { background: #FFE4D9 !important; }

.data-table,
.table { color: var(--ink); font-size: 0.9rem; }
.data-table thead th,
.table thead th,
.table-dark th {
    border-color: var(--ink) !important;
    background: var(--ink) !important;
    color: white !important;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    font-weight: 600;
}
.data-table tbody tr,
.table tbody tr { border-color: var(--ink) !important; }
.data-table tbody tr:hover,
.table-hover tbody tr:hover { background: #F1EDFF !important; }
.data-table tbody td,
.table tbody td { border-color: var(--ink) !important; color: var(--ink); }

.pagination .page-link {
    min-width: 42px;
    min-height: 42px;
    border: 2px solid var(--ink) !important;
    background: var(--surface) !important;
    color: var(--ink) !important;
    font-weight: 800;
}
.pagination .page-item.active .page-link { background: var(--violet) !important; color: white !important; }

.mobile-record-list { display: none; }

/* Stock Count dashboard */
.stock-entry { width: min(100%, 430px); margin: 2rem auto; }
.stock-entry .login-header h2 { font-size: 1.5rem; font-weight: 800; }
.stock-entry .btn { min-height: 48px; }
.stock-toolbar, .stock-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.stock-toolbar { padding: 18px 20px; border: 2px solid var(--ink); border-radius: var(--radius-card); background: var(--surface); }
.stock-toolbar strong { font-size: 1.15rem; }
.stock-toolbar-actions, .stock-tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.stock-toolbar-actions .btn, .stock-tabs .btn { min-height: 44px; }
.stock-display-options { display: flex; align-items: end; gap: 12px 20px; flex-wrap: wrap; margin-top: 18px; padding: 16px 20px; border: 2px solid var(--ink); border-radius: var(--radius-card); background: var(--surface); }
.stock-display-group { display: flex; flex-direction: column; gap: 6px; }
.stock-display-group .form-label { font-weight: 700; }
.stock-display-group .form-select { min-width: 145px; }
.stock-display-buttons { display: flex; gap: 8px; }
.stock-display-buttons .btn { min-width: 72px; min-height: 40px; }
.stock-tabs { margin: 20px 0; }
.stock-hero { padding: 24px; margin-bottom: 20px; border: 2px solid var(--ink); border-radius: var(--radius-card); background: var(--cyan); }
.stock-hero h2 { margin: 0 0 5px; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; }
.stock-hero p { margin: 0; }
.stock-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stock-metric { min-width: 0; padding: 18px; border: 2px solid var(--ink); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-hard-sm); }
.stock-metric span, .stock-metric strong { display: block; }
.stock-metric span { color: var(--text-dim); font-size: .85rem; font-weight: 700; }
.stock-metric strong { margin-top: 8px; overflow-wrap: anywhere; font-size: clamp(1.35rem, 2.5vw, 1.8rem); font-weight: 800; }
.stock-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stock-filter-row, .stock-item-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stock-filter-row .form-control { flex: 1 1 260px; }
.stock-filter-row .form-select { flex: 0 1 180px; }
.stock-item-filters .form-control, .stock-item-filters .form-select { flex: 1 1 180px; min-width: 0; }
.stock-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; }
.stock-check input { width: 18px; height: 18px; }
.stock-table { width: 100%; }
.stock-items-table { width: max-content; min-width: 100%; }
.stock-items-scroll { max-width: 100%; overflow-x: auto; }
.stock-table th, .stock-table td { white-space: nowrap; }
.stock-table th:nth-last-child(-n+4), .stock-table td:nth-last-child(-n+4) { text-align: right; }
.stock-items-table th:nth-child(n+5), .stock-items-table td:nth-child(n+5) { text-align: right; }
.stock-items-table th:nth-child(4), .stock-items-table td:nth-child(4) { text-align: left; }
.stock-negative { color: #b91c1c; }
.stock-table td.stock-negative { color: #b91c1c !important; }
.stock-total { background: var(--lime); font-weight: 800; }
.stock-rollup { background: var(--paper); font-weight: 800; }
@media (max-width: 767px) {
    .stock-toolbar-actions, .stock-toolbar-actions .btn, .stock-tabs .btn { flex: 1 1 100%; }
    .stock-display-group { flex: 1 1 100%; }
    .stock-display-buttons .btn { flex: 1; }
    .stock-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stock-filter-row .form-select { flex: 1 1 100%; }
    .stock-item-filters .form-control, .stock-item-filters .form-select { flex: 1 1 100%; }
}
.mobile-record-card { padding: 16px; border-bottom: 2px solid var(--ink); background: var(--surface); }
.mobile-record-card:last-child { border-bottom: 0; }
.mobile-record-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.mobile-record-heading .badge { margin-left: auto; }
.record-index { color: var(--text-muted); font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; font-weight: 600; }
.mobile-record-details { display: grid; gap: 10px; margin: 0; }
.mobile-record-details > div { display: grid; grid-template-columns: minmax(92px, 0.38fr) minmax(0, 1fr); gap: 10px; padding-top: 10px; border-top: 2px solid var(--ink); }
.mobile-record-details dt { color: var(--text-dim); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; }
.mobile-record-details dd { margin: 0; overflow-wrap: anywhere; font-size: 0.9rem; font-weight: 650; }

/* Switch operational workspace */
.switch-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 24px;
}
.switch-workspace-primary,
.switch-workspace-secondary { display: grid; min-width: 0; gap: 24px; }
.switch-workspace-secondary { position: static; }
.operation-card { overflow: visible; }
.connection-grid { display: grid; grid-template-columns: minmax(0, 1fr) 142px; align-items: end; gap: 14px; }
.action-groups { display: grid; gap: 24px; }
.action-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.action-group legend {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0 0 10px;
    color: var(--ink);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.action-group-dot { width: 13px; height: 13px; border: 2px solid var(--ink); border-radius: 50%; background: var(--cyan); }
.action-group-lime .action-group-dot { background: var(--lime); }
.action-group-violet .action-group-dot { background: var(--violet); }
.action-group-pink .action-group-dot { background: var(--pink); }
.action-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.action-choice {
    --choice-accent: var(--cyan);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    min-height: 82px;
    padding: 13px;
    border: 2px solid var(--ink);
    border-radius: var(--radius-control);
    background: var(--paper);
    color: var(--ink);
    text-align: left;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.action-group-lime .action-choice { --choice-accent: var(--lime); }
.action-group-violet .action-choice { --choice-accent: var(--violet); }
.action-group-pink .action-choice { --choice-accent: var(--pink); }
.action-choice:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: var(--shadow-hard-sm); }
.action-choice.is-selected { transform: translate(-2px, -2px); background: var(--ink); color: white; box-shadow: 5px 5px 0 var(--choice-accent); }
.action-choice:disabled { cursor: not-allowed; opacity: 0.55; }
.action-choice > i { flex: 0 0 auto; margin-top: 2px; font-size: 1.2rem; }
.action-choice > span { min-width: 0; }
.action-choice strong,
.action-choice small { display: block; }
.action-choice strong { font-size: 0.9rem; line-height: 1.2; }
.action-choice small { margin-top: 4px; color: var(--text-dim); font-size: 0.78rem; font-weight: 600; line-height: 1.35; }
.action-choice.is-selected small { color: var(--paper); }
.selected-action-chip { display: inline-flex; padding: 6px 10px; border: 2px solid var(--ink); border-radius: var(--radius-pill); background: var(--orange); color: white; font-size: 0.72rem; font-weight: 800; }
.parameter-empty { display: flex; align-items: center; gap: 10px; min-height: 72px; padding: 14px; border: 2px dashed var(--ink); border-radius: var(--radius-control); background: #F0FACF; font-weight: 700; }
.parameter-empty i { color: #487A12; font-size: 1.3rem; }
.operation-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.operation-execute { grid-column: 1 / -1; }
.terminal-shell { overflow: hidden; border: 2px solid var(--ink); border-radius: var(--radius-card); background: var(--ink); box-shadow: var(--shadow-hard); }
.terminal-bar {
    min-height: 62px;
    padding: 10px 14px;
    border: 0;
    border-bottom: 2px solid var(--paper);
    border-radius: 0;
    background: var(--ink);
    color: var(--paper);
    justify-content: space-between;
}
.terminal-heading { display: flex; min-width: 0; align-items: center; gap: 10px; }
.terminal-heading > i { flex: 0 0 auto; color: var(--lime); font-size: 1.2rem; }
.terminal-heading h2 { margin: 0; color: var(--paper); font-size: 0.9rem; font-weight: 800; }
.terminal-title { display: block; max-width: 220px; margin: 2px 0 0; color: var(--cyan); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.terminal-status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border: 2px solid var(--paper); border-radius: var(--radius-pill); color: var(--paper); font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; }
.terminal-status.is-running .status-dot { background: var(--orange); }
.terminal-output {
    min-height: 300px;
    max-height: 520px;
    padding: 16px;
    border: 0;
    border-radius: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.83rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
    word-break: normal;
}

/* Ping diagnostics workspace */
.ping-workspace { display: grid; min-width: 0; gap: 24px; }
.ping-target-input { min-height: 112px; resize: vertical; }
.form-help { color: var(--text-dim); font-size: 0.78rem; font-weight: 650; line-height: 1.5; }
.ping-example-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.ping-example-group legend {
    width: 100%;
    margin-bottom: 10px;
    color: var(--ink);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.ping-example-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.ping-example-button {
    display: flex;
    min-width: 0;
    min-height: 72px;
    align-items: flex-start;
    gap: 12px;
    padding: 13px;
    border: 2px solid var(--ink);
    border-radius: var(--radius-control);
    background: var(--paper);
    color: var(--ink);
    text-align: left;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.ping-example-button:hover:not(:disabled) { transform: translate(-2px, -2px); background: var(--cyan); box-shadow: var(--shadow-hard-sm); }
.ping-example-button:disabled { cursor: not-allowed; opacity: 0.55; }
.ping-example-button > i { flex: 0 0 auto; margin-top: 2px; font-size: 1.2rem; }
.ping-example-button > span { min-width: 0; }
.ping-example-button strong,
.ping-example-button code { display: block; }
.ping-example-button strong { font-size: 0.9rem; }
.ping-example-button code { margin-top: 4px; overflow-wrap: anywhere; color: var(--text-dim); font-size: 0.76rem; font-weight: 600; }
.ping-options-grid { display: grid; grid-template-columns: 170px 170px minmax(0, 1fr); align-items: end; gap: 14px; }
.ping-control-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ping-control-actions .btn { min-height: 52px; }
.ping-safety-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    border: 2px solid var(--ink);
    border-radius: var(--radius-control);
    background: #FFF1C9;
    font-size: 0.85rem;
    font-weight: 750;
    line-height: 1.5;
}
.ping-safety-note i { flex: 0 0 auto; color: #9A4B00; font-size: 1.2rem; }
.ping-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ping-summary-card {
    display: flex;
    min-width: 0;
    min-height: 132px;
    flex-direction: column;
    justify-content: center;
    padding: 18px;
    border: 2px solid var(--ink);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-hard-sm);
}
.ping-summary-card > span { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.ping-summary-card > strong { margin-top: 4px; font-family: 'Archivo Black', 'Noto Sans Thai', sans-serif; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1; overflow-wrap: anywhere; }
.ping-summary-card > small { margin-top: 6px; font-size: 0.76rem; font-weight: 800; }
.ping-summary-inverse { color: white; }
.ping-progress-track { height: 14px; border-bottom: 2px solid var(--ink); background: var(--paper); overflow: hidden; }
.ping-progress-value { height: 100%; background: var(--cyan); transition: width 180ms ease; }
.ping-results-card { overflow: hidden; }
.ping-results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 2px solid var(--ink);
    background: var(--paper);
}
.ping-result-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.ping-filter-button {
    display: inline-flex;
    min-width: 112px;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 11px;
    border: 2px solid var(--ink);
    border-radius: var(--radius-control);
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 850;
    transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease, color 140ms ease;
}
.ping-filter-button.filter-all { background: var(--surface); }
.ping-filter-button.filter-online { background: var(--lime); }
.ping-filter-button.filter-offline { background: var(--pink); }
.ping-filter-button:hover:not(.is-active) { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.ping-filter-button.is-active {
    color: white;
    background: var(--violet);
    box-shadow: 4px 4px 0 var(--ink);
    transform: translate(-2px, -2px);
}
.ping-filter-button:active { box-shadow: none; transform: translate(0, 0); }
.ping-filter-count {
    display: inline-flex;
    min-width: 24px;
    min-height: 24px;
    align-items: center;
    justify-content: center;
    padding: 1px 6px;
    border: 2px solid currentColor;
    border-radius: var(--radius-pill);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    line-height: 1;
}
.ping-filter-summary { font-family: 'IBM Plex Mono', monospace; font-size: 0.76rem; font-weight: 650; }
.ping-filter-empty {
    display: flex;
    min-height: 190px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    padding: 28px;
    text-align: center;
}
.ping-filter-empty i { color: var(--violet); font-size: 2rem; }
.ping-filter-empty strong { font-size: 1rem; }
.ping-filter-empty span { color: var(--text-muted); font-size: 0.85rem; }
.ping-results-card .desktop-data-view { overflow-x: auto; }
.ping-results-card .data-table code { color: var(--ink); font-size: 0.85rem; font-weight: 650; }
.ping-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 9px;
    border: 2px solid var(--ink);
    border-radius: var(--radius-pill);
    background: var(--paper);
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 850;
}
.ping-status-online { background: var(--lime); }
.ping-status-offline,
.ping-status-error { background: var(--pink); }
.ping-status-cancelled { background: var(--orange); color: white; }
.ping-status-pending { background: var(--paper); }
.ping-result-mobile-card h3 { margin: 3px 0 0; font-size: 0.95rem; }
.ping-result-mobile-card h3 code { color: var(--ink); }
.ping-terminal-output { min-height: 260px; }

.login-wrapper { background: var(--paper); }
.login-card { border: 2px solid var(--ink); border-radius: var(--radius-card); box-shadow: var(--shadow-hard); }
.login-header .brand-icon { border: 2px solid var(--ink); background: var(--violet); box-shadow: var(--shadow-hard-sm); }

@media (max-width: 768px) {
    .sidebar { width: min(86vw, var(--sidebar-w)); }
    .sidebar-open .sidebar { box-shadow: 6px 0 0 var(--ink); }
    .sidebar-overlay { background: rgba(22, 19, 42, 0.7); backdrop-filter: none; -webkit-backdrop-filter: none; }
    .top-row { padding: 8px 12px; gap: 8px; }
    .user-chip { max-width: calc(100vw - 164px); }
    .user-chip .status-dot { display: none; }
    .topbar-logout { min-width: 44px; padding-inline: 11px; font-size: 0; gap: 0; }
    .topbar-logout i { font-size: 1rem; }
    article.content { padding: 22px 16px 36px; }
    .page-header { align-items: flex-start; }
    .page-header-status { display: none; }
    .card { box-shadow: var(--shadow-hard-sm) !important; }
    .card-body { padding: 16px; }
    .card-header { padding: 12px 14px; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
    .stat-card { min-height: 160px; padding: 18px; box-shadow: var(--shadow-hard-sm); }
    .ping-options-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ping-control-actions { grid-column: 1 / -1; }
    .ping-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ping-results-toolbar { align-items: stretch; flex-direction: column; }
    .ping-result-filters { width: 100%; }
    .ping-filter-button { min-width: 0; }
    .terminal-output { min-height: 260px; max-height: 440px; }
    .desktop-data-view { display: none !important; }
    .mobile-record-list { display: block; }
    .card-footer { align-items: flex-start !important; flex-direction: column; gap: 12px; }
    .card-footer nav { width: 100%; overflow-x: auto; }
}

@media (max-width: 560px) {
    .page-header { gap: 12px; }
    .page-icon { width: 44px; height: 44px; }
    .page-header h1 { font-size: 1.55rem; }
    .page-header p { font-size: 0.88rem; }
    .card-header-feature { align-items: flex-start; flex-wrap: wrap; }
    .card-header-feature .status-pill,
    .card-header-feature .selected-action-chip { width: fit-content; margin-left: 52px; }
    .connection-grid,
    .action-choice-grid,
    .ping-example-grid,
    .ping-options-grid,
    .ping-control-actions,
    .operation-actions { grid-template-columns: 1fr; }
    .ping-control-actions { grid-column: auto; }
    .ping-results-toolbar { padding: 12px; }
    .ping-filter-button { gap: 4px; padding-inline: 7px; font-size: 0.76rem; }
    .ping-filter-button i { display: none; }
    .ping-filter-summary { text-align: center; }
    .operation-execute { grid-column: auto; }
    .action-choice { min-height: 76px; }
    .stat-grid { grid-template-columns: 1fr; }
    .terminal-bar { align-items: flex-start; }
    .terminal-title { max-width: 180px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
