* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.5;
}

.header {
    background: #1a1a2e;
    color: #fff;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header h1 { font-size: 20px; font-weight: 600; }
.header .subtitle { font-size: 13px; color: #8888aa; }

.container { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* Stats bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-card .value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
}

.stat-card .label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Panels */
.panel {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.panel h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Add station form */
.add-form {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.add-form input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.add-form input:focus { border-color: #4a6cf7; }

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary { background: #4a6cf7; color: #fff; }
.btn-primary:hover { background: #3a5ce5; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid #eee;
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.5px;
}

tbody td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

tbody tr:hover { background: #f8f9ff; }

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-online { background: #d4edda; color: #155724; }
.badge-offline { background: #f8d7da; color: #721c24; }

/* Credentials modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
}

.modal h3 { margin-bottom: 16px; font-size: 18px; }

.credential-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.credential-row .label { color: #888; }
.credential-row .value { font-weight: 600; font-family: monospace; font-size: 15px; }

.modal .note {
    margin-top: 16px;
    padding: 12px;
    background: #fff3cd;
    border-radius: 6px;
    font-size: 13px;
    color: #856404;
}

.modal .actions { margin-top: 20px; text-align: right; }

/* Detail panel */
.detail-panel { display: none; }
.detail-panel.active { display: block; }

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 2px solid #eee;
}

.tab {
    padding: 8px 16px;
    background: none;
    border: none;
    font-size: 13px;
    cursor: pointer;
    color: #888;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab.active { color: #4a6cf7; border-bottom-color: #4a6cf7; font-weight: 600; }

.tab-content { display: none; }
.tab-content.active { display: block; }

pre.json-view {
    background: #1a1a2e;
    color: #a8e6cf;
    padding: 16px;
    border-radius: 8px;
    font-size: 13px;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.back-btn {
    background: none;
    border: none;
    color: #4a6cf7;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 12px;
}
