/* ============================================
   24&go Control Service – Design System
   Premium Dark Mode UI
   ============================================ */

:root {
    /* Colors */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2236;
    --bg-card-hover: #1f2a42;
    --bg-input: #0f1520;
    --bg-glass: rgba(26, 34, 54, 0.7);

    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.25);
    --accent-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border: rgba(148, 163, 184, 0.1);
    --border-hover: rgba(148, 163, 184, 0.2);

    /* Spacing */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);

    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ============================================
   App Shell
   ============================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition-slow);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.sidebar-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 16px 12px 6px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 450;
    text-decoration: none;
    user-select: none;
}

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

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent);
    font-weight: 500;
}

.nav-item .material-icons-round {
    font-size: 20px;
    opacity: 0.8;
}

.nav-item.active .material-icons-round {
    opacity: 1;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.user-info:hover { background: var(--bg-card); }

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 500; }
.user-role { font-size: 11px; color: var(--text-muted); }

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn .material-icons-round { font-size: 18px; }

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 30px var(--accent-glow); }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ============================================
   Cards
   ============================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}

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

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

.card-title {
    font-size: 16px;
    font-weight: 600;
}

/* ============================================
   Forms
   ============================================ */

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

.form-input:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder { color: var(--text-muted); }

/* ============================================
   Status Badges
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-online { background: var(--success-bg); color: var(--success); }
.badge-offline { background: var(--danger-bg); color: var(--danger); }
.badge-paired { background: var(--warning-bg); color: var(--warning); }
.badge-unpaired { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

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

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

/* ============================================
   Location Cards Grid
   ============================================ */

.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.location-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.location-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: var(--transition);
}

.location-card:hover::before { opacity: 1; }

.location-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.location-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.location-icon .material-icons-round { font-size: 22px; }

.location-name {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
}

.location-address {
    font-size: 13px;
    color: var(--text-muted);
}

.location-stats {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.location-stat {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.location-stat .material-icons-round { font-size: 16px; }

/* ============================================
   Location Detail Page
   ============================================ */

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-grid .card.full-width {
    grid-column: 1 / -1;
}

/* DMX Sliders */
.dmx-channel {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.dmx-channel:last-child { border-bottom: none; }

.dmx-label {
    width: 50px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.dmx-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-input);
    outline: none;
}

.dmx-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
    transition: var(--transition);
}

.dmx-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 14px var(--accent-glow);
}

.dmx-value {
    width: 44px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
}

/* Motion Events */
.motion-list {
    max-height: 320px;
    overflow-y: auto;
}

.motion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.motion-item:last-child { border-bottom: none; }

.motion-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--warning-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--warning);
    flex-shrink: 0;
}

.motion-icon .material-icons-round { font-size: 16px; }
.motion-time { color: var(--text-muted); font-size: 12px; margin-left: auto; white-space: nowrap; }

/* ============================================
   Login Page
   ============================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
    bottom: -200px;
    left: -100px;
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-icon {
    width: 64px;
    height: 64px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
    box-shadow: var(--shadow-glow);
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.login-error {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
    align-items: center;
    gap: 8px;
}

.login-error.visible { display: flex; }
.login-error .material-icons-round { font-size: 18px; }

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    margin-top: 8px;
}

/* ============================================
   Tables
   ============================================ */

.table-wrapper { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px 14px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.data-table tr:hover td { background: var(--bg-card-hover); }

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.visible { opacity: 1; visibility: visible; }

.modal {
    width: 100%;
    max-width: 500px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.95);
    transition: var(--transition-slow);
}

.modal-overlay.visible .modal { transform: translateY(0) scale(1); }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-title { font-size: 18px; font-weight: 600; }

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover { background: var(--bg-input); color: var(--text-primary); }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

/* ============================================
   Utility
   ============================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .material-icons-round { font-size: 56px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 15px; margin-bottom: 16px; }

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

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

.pairing-id-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 4px;
    padding: 20px;
    background: var(--bg-input);
    border-radius: var(--radius);
    border: 2px dashed var(--accent);
    color: var(--accent);
    margin: 16px 0;
    cursor: pointer;
    transition: var(--transition);
}

.pairing-id-display:hover { background: var(--accent-glow); }

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition-slow);
}

.toast.visible { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }

/* ============================================
   Responsive
   ============================================ */

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); z-index: 300; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 20px; padding-top: 64px; }
    .mobile-menu-btn { display: flex; }
    .detail-grid { grid-template-columns: 1fr; }
    .locations-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 22px; }
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease-out forwards; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up { animation: slideUp 0.4s ease-out forwards; }

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }

/* ============================================
   DMX Device Management
   ============================================ */

/* Device List */
.dmx-devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.dmx-device-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.dmx-device-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0.6;
}

.dmx-device-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow);
}

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

.dmx-device-name {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dmx-device-name .material-icons-round {
    font-size: 20px;
    color: var(--accent);
}

.dmx-device-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.dmx-device-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    background: var(--bg-input);
    color: var(--text-muted);
    font-weight: 500;
}

/* RGBW Sliders */
.rgbw-slider-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rgbw-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rgbw-slider-label {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.15);
}

.rgbw-slider-label.red { background: #ef4444; border-color: rgba(239,68,68,0.4); }
.rgbw-slider-label.green { background: #22c55e; border-color: rgba(34,197,94,0.4); }
.rgbw-slider-label.blue { background: #3b82f6; border-color: rgba(59,130,246,0.4); }
.rgbw-slider-label.white { background: #e2e8f0; border-color: rgba(226,232,240,0.4); }
.rgbw-slider-label.dimmer { background: #94a3b8; border-color: rgba(148,163,184,0.4); }
.rgbw-slider-label.strobe { background: #fde047; border-color: rgba(253,224,71,0.4); }

.rgbw-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-input);
    outline: none;
}

.rgbw-slider.red::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px; border-radius: 50%;
    background: #ef4444; cursor: pointer;
    box-shadow: 0 0 8px rgba(239,68,68,0.4);
}

.rgbw-slider.green::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px; border-radius: 50%;
    background: #22c55e; cursor: pointer;
    box-shadow: 0 0 8px rgba(34,197,94,0.4);
}

.rgbw-slider.blue::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px; border-radius: 50%;
    background: #3b82f6; cursor: pointer;
    box-shadow: 0 0 8px rgba(59,130,246,0.4);
}

.rgbw-slider.white::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px; border-radius: 50%;
    background: #e2e8f0; cursor: pointer;
    box-shadow: 0 0 8px rgba(226,232,240,0.4);
}

.rgbw-slider.dimmer::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px; border-radius: 50%;
    background: #94a3b8; cursor: pointer;
    box-shadow: 0 0 8px rgba(148,163,184,0.4);
}

.rgbw-slider.strobe::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fde047; cursor: pointer;
    box-shadow: 0 0 8px rgba(253,224,71,0.4);
}

.rgbw-slider-value {
    width: 36px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

/* Color preview */
.dmx-color-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    transition: var(--transition);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
}

.dmx-device-controls {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.dmx-device-controls .rgbw-slider-group {
    flex: 1;
}

/* Device Actions */
.dmx-device-actions {
    display: flex;
    gap: 6px;
}

/* Add Device Button */
.add-device-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 16px;
}

.add-device-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

.add-device-btn .material-icons-round {
    font-size: 20px;
}

/* Large Modal Variant */
.modal.modal-lg {
    max-width: 600px;
}

.modal-body-scroll {
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 4px;
}

/* Channel Mapping */
.channel-mapping-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.channel-mapping-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.channel-mapping-item .rgbw-slider-label {
    width: 12px;
    height: 12px;
}

.channel-mapping-item label {
    font-size: 13px;
    color: var(--text-secondary);
    width: 40px;
}

.channel-mapping-item .form-input {
    width: 60px;
    padding: 6px 8px;
    font-size: 13px;
    text-align: center;
}

/* Test section in modal */
.test-section {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
}

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

.test-section-title {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.test-section-title .material-icons-round {
    font-size: 18px;
    color: var(--warning);
}

/* Form row helpers */
.form-row {
    display: flex;
    gap: 14px;
}

.form-row .form-group {
    flex: 1;
}

/* Separator */
.form-separator {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

/* ============================================
   Agent Logs
   ============================================ */

.agent-log-list {
    max-height: 400px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    margin-top: 4px;
}

.log-entry {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s ease;
}

.log-entry:hover {
    background: rgba(255, 255, 255, 0.03);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-icon {
    font-size: 15px !important;
    flex-shrink: 0;
    margin-top: 1px;
}

.log-message {
    flex: 1;
    color: var(--text-secondary);
    word-break: break-word;
    line-height: 1.5;
}

.log-time {
    color: var(--text-muted);
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

.log-warn .log-message { color: var(--warning); }
.log-error .log-message { color: var(--danger); }

.log-source {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 5px;
    border-radius: 3px;
    flex-shrink: 0;
    font-family: inherit;
    text-transform: uppercase;
}

.log-source-server {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.log-source-agent {
    background: rgba(20, 184, 166, 0.15);
    color: #2dd4bf;
}

/* Device status indicators */
.device-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.device-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.device-dot-unknown { background: var(--text-muted); opacity: 0.4; }
.device-dot-online { background: var(--success); box-shadow: 0 0 6px var(--success); animation: pulse-dot 2s infinite; }
.device-dot-offline { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
