/* =================================================================
   Topics Design System - NMG Studio
   Basierend auf Energy EventBot / Quizkönig Topics Theme
   ================================================================= */

:root {
    --primary: #0AA692;
    --primary-dark: #089480;
    --primary-light: #0CC0A8;
    --primary-bg: rgba(10, 166, 146, 0.08);
    --primary-border: rgba(10, 166, 146, 0.25);

    --bg: #E9E9E9;
    --surface: #FFFFFF;
    --surface-alt: #F9F9F9;
    --surface-hover: #F3F3F3;

    --text: #333333;
    --text-secondary: #555555;
    --text-muted: #888888;
    --text-light: #AAAAAA;

    --success: #51A551;
    --success-bg: rgba(81, 165, 81, 0.1);
    --success-border: rgba(81, 165, 81, 0.3);

    --danger: #DA504F;
    --danger-bg: rgba(218, 80, 79, 0.1);
    --danger-border: rgba(218, 80, 79, 0.3);

    --warning: #E8A835;
    --warning-bg: rgba(232, 168, 53, 0.1);
    --warning-border: rgba(232, 168, 53, 0.3);

    --info: #0090D9;
    --info-bg: rgba(0, 144, 217, 0.1);
    --info-border: rgba(0, 144, 217, 0.3);

    --border: #DDDDDD;
    --border-light: #EEEEEE;

    --radius: 4px;
    --radius-lg: 8px;
    --shadow: 0 1px 1px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);

    --font: 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Menlo', 'Consolas', monospace;

    --claude-accent: #D4A574;
}

/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 18px;
    line-height: 1.5;
}

/* ===== TOP HEADER ===== */
.top-header {
    background: var(--primary);
    color: #fff;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1em;
    letter-spacing: 0.3px;
}

.top-header-brand .nmg-logo {
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
}

.top-header-nav {
    display: flex;
    gap: 6px;
    align-items: center;
}

.top-header-nav a,
.top-header-nav button {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 5px 12px;
    border-radius: var(--radius);
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.15s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
}

.top-header-nav a:hover,
.top-header-nav button:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.top-header-nav a.active,
.top-header-nav button.active {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.top-header-meta {
    font-size: 0.8em;
    opacity: 0.8;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px;
}

.container-narrow {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 24px;
}

/* ===== CARDS ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.card h2,
.card-title {
    color: var(--text-secondary);
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* ===== NAV TABS ===== */
.nav-tabs {
    display: flex;
    gap: 0;
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    padding: 0 20px;
    overflow-x: auto;
    flex-wrap: nowrap;
    box-shadow: var(--shadow);
}

.nav-tab {
    padding: 10px 18px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.nav-tab:hover {
    color: var(--text);
}

.nav-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.nav-tab .tab-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

/* Main Navigation (3 Sektionen) */
.main-nav {
    display: flex;
    gap: 0;
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    padding: 0 20px;
    box-shadow: var(--shadow);
}

.main-nav-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.9em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.main-nav-btn:hover {
    color: var(--text);
    background: var(--primary-bg);
}

.main-nav-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.main-nav-btn .nav-icon {
    margin-right: 6px;
}

/* Tab Content */
.tab-content { display: none; max-width: 1400px; margin: 0 auto; }
.tab-content.active { display: block; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    border-radius: 20px;
    font-family: var(--font);
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.15s;
    background: none;
    line-height: 1.4;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary-border);
    background: transparent;
}
.btn-outline-primary:hover { background: var(--primary-bg); }

.btn-success {
    color: var(--success);
    border-color: var(--success-border);
    background: var(--success-bg);
}
.btn-success:hover { background: rgba(81, 165, 81, 0.2); }

.btn-danger {
    color: var(--danger);
    border-color: var(--danger-border);
    background: var(--danger-bg);
}
.btn-danger:hover { background: rgba(218, 80, 79, 0.2); }

.btn-warning {
    color: var(--warning);
    border-color: var(--warning-border);
    background: var(--warning-bg);
}
.btn-warning:hover { background: rgba(232, 168, 53, 0.2); }

.btn-muted {
    color: var(--text-muted);
    border-color: var(--border);
    background: transparent;
}
.btn-muted:hover { background: var(--surface-hover); }

.btn-sm {
    font-size: 0.78em;
    padding: 4px 12px;
}

.btn.loading { pointer-events: none; opacity: 0.5; }
.btn.loading::after {
    content: '';
    display: inline-block;
    width: 10px; height: 10px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-standalone {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.badge-project {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid var(--info-border);
}

.badge-planner {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

/* ===== STATUS DOTS ===== */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.green { background: var(--success); }
.status-dot.yellow { background: var(--warning); }
.status-dot.red { background: var(--danger); }
.status-dot.grey { background: var(--text-light); }
.status-dot.teal { background: var(--primary); }

.status-dot.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.82em;
    font-weight: 500;
}

.status-badge.running { background: var(--success-bg); color: var(--success); }
.status-badge.stopped { background: var(--surface-hover); color: var(--text-light); }
.status-badge.attached { background: var(--warning-bg); color: var(--warning); }

/* ===== TABLES ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.table th {
    text-align: left;
    padding: 8px 12px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
}

.table tr:last-child td { border-bottom: none; }

.table tr:nth-child(even) td {
    background: var(--surface-alt);
}

.table tr:hover td {
    background: var(--surface-hover);
}

/* ===== PROGRESS BARS ===== */
.progress-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-fill.green { background: var(--success); }
.progress-fill.yellow { background: var(--warning); }
.progress-fill.red { background: var(--danger); }
.progress-fill.teal { background: var(--primary); }

/* ===== HEALTH BAR (Status Page) ===== */
.health-bar {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.health-item {
    flex: 1;
    min-width: 140px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow);
}

.health-label {
    color: var(--text-muted);
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.health-value {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--text);
}

.health-bar-track {
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.health-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}

.health-bar-fill.green { background: var(--success); }
.health-bar-fill.yellow { background: var(--warning); }
.health-bar-fill.red { background: var(--danger); }

/* ===== INSTANCE GRID ===== */
.inst-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.inst-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    transition: all 0.15s;
    box-shadow: var(--shadow);
    cursor: pointer;
}

.inst-card:hover {
    border-color: var(--primary-border);
    box-shadow: var(--shadow-md);
}

.inst-card.running { border-left: 3px solid var(--warning); }
.inst-card.attached { border-left: 3px solid var(--success); }
.inst-card.stopped { border-left: 3px solid var(--text-light); }

.inst-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.inst-card-name {
    font-weight: 700;
    font-size: 1em;
    color: var(--text);
}

.inst-card-alias {
    color: var(--text-muted);
    font-size: 0.85em;
}

.inst-card-desc {
    color: var(--text-muted);
    font-size: 0.85em;
    margin-bottom: 8px;
}

.inst-card-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
}

.inst-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

/* Flash Animation */
.inst-card.flash-success { animation: flashSuccess 1s ease; }
.inst-card.flash-error { animation: flashError 1s ease; }
@keyframes flashSuccess { 0%,100% { border-color: var(--border); } 50% { border-color: var(--success); } }
@keyframes flashError { 0%,100% { border-color: var(--border); } 50% { border-color: var(--danger); } }

/* ===== SECTION TITLE ===== */
.section-title {
    color: var(--text-secondary);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

/* ===== RESOURCE BARS ===== */
.resource-bar {
    display: grid;
    grid-template-columns: 50px 1fr 120px;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.resource-label {
    font-size: 0.8em;
    color: var(--text-muted);
    font-weight: 600;
}

.resource-value {
    font-size: 0.8em;
    color: var(--text);
    text-align: right;
}

/* ===== TERMINAL PREVIEW ===== */
.terminal-preview {
    background: #1e1e1e;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #2d2d2d;
    border-bottom: 1px solid #444;
}

.terminal-header span {
    color: #999;
    font-size: 0.8em;
}

.terminal-content {
    padding: 12px;
    font-size: 0.8em;
    line-height: 1.5;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: #d4d4d4;
    font-family: var(--font-mono);
}

.terminal-content.loading {
    color: #666;
    text-align: center;
    padding: 40px;
}

/* ===== OVERLAYS & DIALOGS ===== */
.overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.overlay.active { display: flex; }

.overlay-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.overlay-box h3 { color: var(--text); margin-bottom: 8px; font-size: 1.1em; }
.overlay-box .desc { color: var(--text-secondary); font-size: 0.85em; margin-bottom: 20px; }
.overlay-box .session-target { color: var(--primary); font-weight: 700; font-size: 1.2em; margin-bottom: 16px; }

.overlay-buttons { display: flex; gap: 12px; justify-content: center; }

.overlay-btn {
    padding: 8px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.15s;
    font-family: var(--font);
    background: none;
}

.overlay-btn.cancel { border-color: var(--border); background: var(--surface-alt); color: var(--text-muted); }
.overlay-btn.cancel:hover { background: var(--surface-hover); color: var(--text); }
.overlay-btn.confirm-danger { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger); }
.overlay-btn.confirm-danger:hover { background: rgba(218, 80, 79, 0.2); }
.overlay-btn.confirm-ok { border-color: var(--success-border); background: var(--success-bg); color: var(--success); }
.overlay-btn.confirm-ok:hover { background: rgba(81, 165, 81, 0.2); }

.overlay-countdown {
    color: var(--warning);
    font-size: 1.1em;
    font-weight: 600;
    margin-top: 16px;
    padding: 8px 16px;
    background: var(--warning-bg);
    border-radius: 6px;
    display: inline-block;
}

/* Dialog Overlay */
.dialog-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.dialog-overlay.active { display: flex; }

.dialog-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.dialog-box h3 { color: var(--text); margin-bottom: 16px; font-size: 1.1em; }
.dialog-field { margin-bottom: 14px; }
.dialog-field label { display: block; color: var(--text-secondary); font-size: 0.85em; margin-bottom: 4px; }

.dialog-field input[type="text"] {
    width: 100%;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 8px 10px;
}

.dialog-field input[type="text"]:focus { border-color: var(--primary); outline: none; }

.dialog-section-title {
    color: var(--text-secondary);
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 16px 0 8px 0;
}

.dialog-checkbox {
    display: flex;
    align-items: center;
    padding: 5px 0;
    font-size: 0.9em;
    cursor: pointer;
    color: var(--text);
}

.dialog-checkbox input { margin-right: 10px; accent-color: var(--primary); }

.dialog-inst-row { display: flex; align-items: center; gap: 8px; }

.dialog-inst-alias {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 0.85em;
    padding: 2px 6px;
    width: 80px;
}

.dialog-inst-alias:focus { border-color: var(--primary); outline: none; }

.dialog-buttons { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

.dialog-btn {
    padding: 8px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.15s;
    font-family: var(--font);
    background: none;
}

.dialog-btn.cancel { border-color: var(--border); background: var(--surface-alt); color: var(--text-muted); }
.dialog-btn.cancel:hover { background: var(--surface-hover); color: var(--text); }
.dialog-btn.create { border-color: var(--primary); background: var(--primary-bg); color: var(--primary); }
.dialog-btn.create:hover { background: rgba(10, 166, 146, 0.2); }

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--success);
    color: var(--success);
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-size: 0.85em;
    z-index: 300;
    opacity: 0;
    transition: opacity 0.3s;
    max-width: 500px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.toast.show { opacity: 1; }
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.warn { border-color: var(--warning); color: var(--warning); }

/* ===== FORMS ===== */
.remote-checkbox {
    display: flex;
    align-items: center;
    padding: 6px 0;
    font-size: 0.9em;
    cursor: pointer;
}

.remote-checkbox input { margin-right: 10px; accent-color: var(--primary); }

.remote-alias-input {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 0.85em;
    padding: 2px 6px;
    width: 80px;
    margin-left: 6px;
}

.remote-alias-input:focus { border-color: var(--primary); outline: none; }

.remote-options {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.remote-options h3 {
    color: var(--text-secondary);
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

/* Script Boxes */
.remote-script-box {
    display: none;
    margin-top: 16px;
    background: #1e1e1e;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.remote-script-box.visible { display: block; }

.remote-script-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #2d2d2d;
    border-bottom: 1px solid #444;
}

.remote-script-header span { color: #999; font-size: 0.8em; }

.remote-script-actions { display: flex; gap: 8px; }

.remote-script-actions button {
    padding: 4px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text);
    cursor: pointer;
    font-size: 0.82em;
    transition: all 0.15s;
    font-family: var(--font);
}

.remote-script-actions button:hover { background: var(--surface-hover); }

.remote-script-content {
    padding: 12px;
    font-size: 0.8em;
    line-height: 1.4;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre;
    color: #d4d4d4;
    font-family: var(--font-mono);
}

.remote-curl-box {
    margin-top: 16px;
    background: var(--surface);
    border: 1px solid var(--primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.remote-curl-header {
    padding: 6px 12px;
    background: var(--primary-bg);
    border-bottom: 1px solid var(--primary-border);
    color: var(--primary);
    font-size: 0.82em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.remote-curl-content {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    gap: 12px;
}

.remote-curl-content code {
    flex: 1;
    color: var(--primary);
    font-size: 0.85em;
    word-break: break-all;
    user-select: all;
}

/* ===== USER MANAGEMENT ===== */
.user-card {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 10px;
}

.user-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.user-name { font-weight: 700; font-size: 1.05em; color: var(--text); }

.user-badge {
    font-size: 0.78em;
    padding: 3px 10px;
    border-radius: 12px;
}

.user-badge.active {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.user-badge.disabled {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.user-hostname { color: var(--text-muted); font-size: 0.85em; }
.user-instances { color: var(--text-muted); font-size: 0.85em; }

.user-instances code {
    background: var(--info-bg);
    color: var(--info);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    margin-left: 2px;
}

.user-key { color: var(--text-light); font-size: 0.8em; font-family: var(--font-mono); }
.user-created { color: var(--text-light); font-size: 0.8em; }

.user-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.user-actions button {
    padding: 5px 14px;
    border-radius: 6px;
    border: 1px solid;
    cursor: pointer;
    font-size: 0.82em;
    transition: all 0.15s;
    background: none;
    font-family: var(--font);
}

.user-mgmt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

/* ===== VPN TAB ===== */
.vpn-table { width: 100%; border-collapse: collapse; font-size: 0.85em; }
.vpn-table th { text-align: left; padding: 8px 12px; color: var(--text-secondary); border-bottom: 2px solid var(--border); font-weight: 600; }
.vpn-table td { padding: 8px 12px; border-bottom: 1px solid var(--border-light); }
.vpn-table tr:last-child td { border-bottom: none; }

.vpn-action-drop {
    color: var(--danger);
    font-weight: 700;
    font-size: 0.8em;
    background: var(--danger-bg);
    padding: 2px 8px;
    border-radius: 4px;
}

.vpn-action-accept {
    color: var(--success);
    font-weight: 700;
    font-size: 0.8em;
    background: var(--success-bg);
    padding: 2px 8px;
    border-radius: 4px;
}

.vpn-inst-badge {
    display: inline-block;
    background: var(--surface-alt);
    color: var(--info);
    font-size: 0.8em;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 1px 2px;
    border: 1px solid var(--border-light);
}

.vpn-groups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

.vpn-group-card {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
}

.vpn-group-name { color: var(--primary); font-weight: 600; margin-bottom: 4px; }
.vpn-group-type { color: var(--text-muted); font-size: 0.8em; margin-bottom: 8px; }
.vpn-group-members { display: flex; flex-wrap: wrap; gap: 4px; }

.vpn-ip {
    display: inline-block;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.8em;
    padding: 2px 6px;
    border-radius: 3px;
}

.vpn-wan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }

.vpn-wan-item {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
}

.vpn-wan-label { color: var(--text-muted); font-size: 0.82em; text-transform: uppercase; margin-bottom: 4px; }
.vpn-wan-value { color: var(--text); font-family: var(--font-mono); font-size: 0.9em; }

/* ===== HARDWARE CARDS (Netzwerk Tab) ===== */
.hw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }

.hw-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    transition: border-color 0.15s;
    box-shadow: var(--shadow);
}

.hw-card:hover { border-color: var(--primary-border); }
.hw-card-name { font-weight: 700; color: var(--text); margin-bottom: 4px; }
.hw-card-model { color: var(--text-muted); font-size: 0.85em; margin-bottom: 6px; }
.hw-card-detail { font-size: 0.8em; color: var(--text-light); line-height: 1.6; }
.hw-card-detail span { display: inline-block; margin-right: 12px; }
.hw-card-price { color: var(--warning); font-weight: 600; font-size: 0.85em; margin-top: 6px; }

.hw-category-title {
    color: var(--primary);
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 20px 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.hw-category-title:first-child { margin-top: 0; }

.hw-category-badge {
    display: inline-block;
    font-size: 0.78em;
    padding: 2px 10px;
    border-radius: 8px;
    margin-left: 8px;
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 500;
}

/* ===== NETWORK STATS ===== */
.nw-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.nw-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow);
}

/* ===== PROCESS TABLE ===== */
.proc-row {
    display: grid;
    grid-template-columns: 60px 70px 70px 1fr;
    padding: 4px 0;
    font-size: 0.85em;
    border-bottom: 1px solid var(--border-light);
}

.proc-row:last-child { border-bottom: none; }
.proc-row.head { color: var(--text-muted); font-weight: 600; }
.proc-cpu { color: var(--warning); text-align: right; padding-right: 12px; }
.proc-mem { color: var(--info); text-align: right; padding-right: 12px; }
.proc-pid { color: var(--text-light); }

/* ===== CLAUDE TAB ===== */
.claude-summary {
    font-size: 0.85em;
    color: var(--text-muted);
    padding: 10px 0;
}

.claude-summary .highlight { color: var(--claude-accent); font-weight: 600; }

.claude-logo {
    width: 18px; height: 18px;
    background: var(--claude-accent);
    border-radius: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; color: #fff; font-weight: bold;
    margin-right: 6px;
    vertical-align: middle;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}

.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--text-muted); }
.stat-value { color: var(--text); font-weight: 500; }
.stat-value.highlight { color: var(--primary); }

.stat-big {
    text-align: center;
    padding: 12px 0;
}

.stat-big .number {
    font-size: 2em;
    font-weight: 700;
    color: var(--claude-accent);
    line-height: 1;
}

.stat-big .label {
    color: var(--text-muted);
    font-size: 0.82em;
    margin-top: 4px;
}

.stat-trio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.chart-container {
    position: relative;
    height: 120px;
    margin-top: 12px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 100px;
    padding: 0 2px;
}

.chart-bar {
    flex: 1;
    min-width: 0;
    border-radius: 2px 2px 0 0;
    background: rgba(212, 165, 116, 0.4);
    position: relative;
    cursor: default;
    transition: background 0.2s;
}

.chart-bar:hover { background: var(--claude-accent); }

.chart-bar .tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 8px;
    font-size: 0.78em;
    white-space: nowrap;
    z-index: 10;
    color: var(--text);
    box-shadow: var(--shadow-md);
}

.chart-bar:hover .tooltip { display: block; }

.chart-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75em;
    color: var(--text-light);
    margin-top: 4px;
}

.hour-chart {
    display: flex;
    align-items: flex-end;
    gap: 1px;
    height: 40px;
}

.hour-bar {
    flex: 1;
    border-radius: 1px 1px 0 0;
    background: rgba(0, 144, 217, 0.3);
}

.model-row {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85em;
}

.model-row:last-child { border-bottom: none; }
.model-name { color: var(--text); font-weight: 500; }
.model-tokens { color: var(--text-muted); text-align: right; }

/* ===== INSTANCE DETAIL ===== */
.instance-detail { max-width: 900px; }

.instance-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.instance-detail-header h2 {
    font-size: 1.3em;
    color: var(--text);
    font-weight: 700;
    margin-bottom: 0;
    text-transform: none;
    letter-spacing: 0;
}

.instance-detail-type { margin-bottom: 8px; }

.instance-detail-path {
    font-size: 0.9em;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-family: var(--font-mono);
}

.instance-detail-status {
    font-size: 0.95em;
    color: var(--text);
    margin-bottom: 10px;
    font-weight: 500;
}

.instance-detail-flags {
    font-size: 0.85em;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-bottom: 12px;
    background: var(--surface-alt);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.instance-detail-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

/* ===== LOGIN SECTION ===== */
.login-section {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.btn-login {
    display: inline-block;
    padding: 10px 28px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font);
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-login:hover { background: var(--primary-dark); }

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    color: var(--text-light);
    font-size: 0.82em;
    margin-top: 16px;
}

.refresh-info {
    text-align: center;
    color: var(--text-light);
    font-size: 0.82em;
    margin-top: 16px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .top-header {
        flex-direction: column;
        gap: 8px;
        padding: 8px 16px;
    }
    .top-header-nav { flex-wrap: wrap; justify-content: center; }
    .container { padding: 12px 16px; }
    .health-bar { gap: 8px; }
    .health-item { min-width: 100px; padding: 10px 12px; }
    .health-value { font-size: 1.1em; }
    .inst-grid { grid-template-columns: 1fr; }
    .main-nav { overflow-x: auto; padding: 0 12px; }
    .nav-tabs { padding: 0 12px; }
}

@media print {
    .top-header, .no-print { display: none !important; }
    body { background: white; }
}
