/* NETROOM2 — Control Deck Theme */
:root {
    --bg-base: #0A0A0F;
    --bg-surface: #12121A;
    --bg-surface-hover: #1A1A26;
    --bg-surface-active: #1E1E2E;
    --bg-overlay: rgba(10,10,15,0.8);

    --accent-primary: #4A9EFF;
    --accent-success: #34D399;
    --accent-warning: #FBBF24;
    --accent-danger: #EF4444;
    --accent-muted: #6B7280;

    --text-primary: #E5E7EB;
    --text-secondary: #9CA3AF;
    --text-muted: #4B5563;

    --border-subtle: #1E1E2E;
    --radius: 8px;
    --radius-sm: 4px;
}

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

body {
    font-family: 'Segoe UI Variable', 'Segoe UI', -apple-system, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
}

.mono { font-family: 'Cascadia Mono', 'Consolas', monospace; }

/* === Login Page === */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 40px;
    width: 360px;
}

.login-box h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-box h1 span { color: var(--accent-primary); }
.login-box .subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--accent-primary);
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-primary {
    width: 100%;
    background: var(--accent-primary);
    color: #fff;
    margin-top: 8px;
}

.btn-primary:hover { filter: brightness(1.15); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline:hover {
    background: rgba(74,158,255,0.1);
}

.login-error {
    color: var(--accent-danger);
    font-size: 13px;
    margin-top: 12px;
    display: none;
}

.login-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.login-tab {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.login-tab.active {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(74,158,255,0.05);
}

/* === Dashboard Header === */
.header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: 16px;
    font-weight: 700;
}

.header-title span { color: var(--accent-primary); }

.header-stats {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 13px;
}

.header-stats .stat-label { color: var(--text-secondary); }
.header-stats .stat-value { font-weight: 600; }

.header-actions { display: flex; gap: 8px; align-items: center; }

.last-update {
    font-size: 11px;
    color: var(--text-muted);
}

/* === Motel Cards Grid === */
.dashboard {
    padding: 24px;
}

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

.motel-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 4px solid var(--accent-success);
    position: relative;
}

.motel-card:hover {
    background: var(--bg-surface-hover);
    transform: translateX(2px);
}

.motel-card.warning {
    border-left-color: var(--accent-danger);
    box-shadow: 0 0 20px rgba(239,68,68,0.1);
}

.motel-card.offline {
    border-left-color: var(--accent-muted);
    opacity: 0.6;
}

.motel-card .card-warning {
    background: rgba(239,68,68,0.15);
    color: var(--accent-danger);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    display: none;
}

.motel-card.warning .card-warning { display: block; }

.motel-card .card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.motel-card .card-code {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}

.motel-card .card-stats {
    display: flex;
    gap: 12px;
    margin: 8px 0;
    font-size: 13px;
}

.motel-card .card-stats .on { color: var(--accent-success); }
.motel-card .card-stats .off { color: var(--accent-muted); }

.motel-card .card-traffic {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 13px;
}

.motel-card .card-speed {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.motel-card .card-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

.motel-card .status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.status-dot.ok { background: var(--accent-success); }
.status-dot.warn { background: var(--accent-danger); animation: pulse 2s infinite; }
.status-dot.muted { background: var(--accent-muted); }

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

/* === Room List (accordion) === */
.room-list {
    display: none;
    margin-top: 12px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 8px;
}

.motel-card.expanded .room-list { display: block; }

.room-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(30,30,46,0.5);
}

.room-item .room-name {
    font-weight: 600;
    width: 70px;
}

.room-item .room-ip {
    color: var(--text-secondary);
    width: 120px;
}

.room-item .room-cpu { width: 55px; }
.room-item .room-dl { width: 65px; }
.room-item .room-lan { width: 50px; }

.lan-warning { color: var(--accent-danger) !important; font-weight: 700; }

/* === Owner Dashboard === */
.owner-summary {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.owner-summary h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.summary-item {
    text-align: center;
}

.summary-item .value {
    font-size: 28px;
    font-weight: 700;
}

.summary-item .label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.summary-item .value.success { color: var(--accent-success); }
.summary-item .value.muted { color: var(--accent-muted); }
.summary-item .value.warning { color: var(--accent-warning); }
.summary-item .value.danger { color: var(--accent-danger); }

.peak-section {
    background: var(--bg-base);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
}

.peak-section h3 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.peak-grid {
    display: flex;
    gap: 32px;
}

.peak-item .peak-value {
    font-size: 18px;
    font-weight: 600;
}

.peak-item .peak-label {
    font-size: 11px;
    color: var(--text-muted);
}

.owner-rooms {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.owner-room-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.15s;
    cursor: pointer;
}

.owner-room-card:hover {
    background: var(--bg-surface-hover);
    transform: translateX(2px);
}

.owner-room-card.offline { opacity: 0.5; }

.owner-room-card .room-detail {
    display: none;
    width: 100%;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-secondary);
}

.owner-room-card.expanded .room-detail { display: block; }

/* Responsive */
@media (max-width: 640px) {
    .header { flex-direction: column; gap: 8px; }
    .header-stats { flex-wrap: wrap; gap: 12px; }
    .motel-grid { grid-template-columns: 1fr; }
    .dashboard { padding: 12px; }
    .summary-grid { grid-template-columns: repeat(3, 1fr); }
    .peak-grid { flex-direction: column; gap: 12px; }
}
