/* Clean, High-Visibility Outdoor Light Design System */
:root {
    --bg-dark: #f8fafc;
    --card-bg: #ffffff;
    --sidebar-bg: #ffffff;
    --border-color: #cbd5e1;
    --border-hover: #94a3b8;
    
    --primary: #0284c7;
    --primary-glow: rgba(2, 132, 199, 0.25);
    --primary-dark: #0369a1;
    
    --success: #059669;
    --success-glow: rgba(5, 150, 105, 0.2);
    --danger: #e11d48;
    --danger-glow: rgba(225, 29, 72, 0.2);
    --warning: #d97706;
    --warning-glow: rgba(217, 119, 6, 0.2);
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background glows */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.4;
}

.bg-glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    top: -10%;
    left: -10%;
}

.bg-glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
    bottom: -10%;
    right: -5%;
}

.bg-glow-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
    top: 40%;
    left: 45%;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* General Layout helpers */
.hidden {
    display: none !important;
}

.card-glass {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-glass:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.12);
}

/* Button UI */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn:disabled, .btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #0b1329;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #be123c 100%);
    color: white;
    box-shadow: 0 4px 15px var(--danger-glow);
}
.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--danger-glow);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-glow-on {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-glow-on:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-glow-off {
    background: linear-gradient(135deg, #64748b 0%, #334155 100%);
    color: white;
}
.btn-glow-off:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #94a3b8 0%, #475569 100%);
}

/* Form Fields */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.input-group label {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

select option {
    background-color: #ffffff;
    color: var(--text-primary);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* LOGIN SCREEN STYLING */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

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

.logo-icon-wrapper {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(56, 189, 248, 0.02) 100%);
    border: 1px solid rgba(56, 189, 248, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.1);
}

.logo-icon-glow {
    font-size: 32px;
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary-glow);
}

.login-logo-container h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 26px;
    letter-spacing: 2px;
    color: var(--text-primary);
}

.login-logo-container p {
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.btn-login {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
}

.error-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-radius: 8px;
    color: #fda4af;
    font-size: 13px;
    margin-bottom: 16px;
}

/* APP LAYOUT STYLING */
/* APP LAYOUT STYLING */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Navigation Bar */
.top-nav-bar {
    width: 100%;
    height: 75px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b1329;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(56, 189, 248, 0.3);
}

.brand-text h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.brand-text span {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Nav Dropdown Selector Container */
.nav-dropdown-container {
    position: relative;
    user-select: none;
}

.btn-dropdown {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 24px;
    border-radius: 12px;
    min-width: 240px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-dropdown:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

.btn-dropdown #dropdown-active-icon {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
    font-size: 16px;
}

.btn-dropdown .chevron-icon {
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.25s ease;
}

.btn-dropdown.open .chevron-icon {
    transform: rotate(180deg);
}

/* Solid Dropdown Menu Options list */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    max-height: 350px;
    overflow-y: auto;
    z-index: 120;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transform-origin: top center;
    animation: dropdownFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.dropdown-menu-right {
    left: auto !important;
    right: 0 !important;
    transform: none !important;
    transform-origin: top right !important;
    animation: dropdownRightFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

@keyframes dropdownRightFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dropdown-item {
    width: 100%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.dropdown-item i {
    font-size: 15px;
    color: var(--text-muted);
}

.dropdown-item:hover {
    color: var(--text-primary);
    background: #f1f5f9;
}

.dropdown-item.active {
    background: #e0f2fe;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

.dropdown-item.active i {
    color: #0284c7;
    text-shadow: none;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 6px 0;
    list-style: none;
}

/* Station selector dropdown field and options */
#plant-selector,
select.plant-select,
.nav-plant-container select {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 700 !important;
}

#plant-selector option,
select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
    font-weight: 600;
}

/* User Section on the Right side */
.nav-user-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 6px 16px 6px 12px;
    border-radius: 30px;
}

.info-avatar {
    font-size: 20px;
    color: var(--text-secondary);
}

.info-text {
    display: flex;
    flex-direction: column;
}

.info-text .user-name {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.info-text .badges {
    display: flex;
    gap: 4px;
    margin-top: 2px;
}

.btn-logout-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    padding: 0;
    background: rgba(244, 63, 94, 0.05);
    border: 1px solid rgba(244, 63, 94, 0.1);
    color: #fda4af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout-icon:hover {
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.3);
    transform: scale(1.05);
}

/* Responsive adjustments for Top Nav Bar and Mobile Devices */
@media (max-width: 768px), (max-height: 500px) and (max-width: 1024px) {
    .top-nav-bar {
        padding: 8px 12px;
        height: auto;
        min-height: 65px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .brand-text {
        display: none !important;
    }

    .nav-center-actions {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        flex: 1 1 auto;
        order: 2;
        width: 100%;
        margin-top: 4px;
    }

    .nav-plant-container,
    .nav-dropdown-container {
        flex: 1 1 50%;
        min-width: 0;
    }

    #plant-selector,
    .btn-dropdown {
        width: 100% !important;
        min-width: 0 !important;
        font-size: 13px !important;
        padding: 6px 10px !important;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
    }
    
    .nav-user-section {
        gap: 8px;
        order: 1;
    }
    
    .user-info-pill .info-text {
        display: flex !important;
    }
    
    /* Hide specific device table columns on mobile (portrait & landscape) */
    #devices-vl-panel .col-sel,
    #devices-vl-panel .col-eui,
    #devices-vl-panel .col-seen,
    #devices-vl-panel .col-actions,
    #devices-sl-panel .col-sel,
    #devices-sl-panel .col-eui,
    #devices-sl-panel .col-seen,
    #devices-sl-panel .col-actions {
        display: none !important;
    }
    
    #devices-vl-panel .col-telemetry,
    #devices-sl-panel .col-status,
    #devices-sl-panel .col-telemetry {
        display: table-cell !important;
    }
    
    .rename-device-btn, .delete-device-btn {
        display: none !important;
    }
    
    /* Make device table rows clickable on mobile */
    #device-table-body tr {
        cursor: pointer;
        transition: background-color 0.2s ease;
    }
    
    #device-table-body tr:hover {
        background: rgba(255, 255, 255, 0.03);
    }
    
    #device-table-body tr:active {
        background: rgba(255, 255, 255, 0.06);
    }

    .workspace-header {
        display: none !important;
    }

    .workspace-content {
        padding: 16px !important;
    }
}

/* Workspace main content */
.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 75px);
}

.workspace-header {
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.header-title h1 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
}

.header-title p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.header-stats {
    display: none !important;
}

.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 13px;
}

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

.online-dot {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success-glow);
}

.workspace-content {
    padding: 20px 40px 40px;
    flex: 1;
    overflow-y: auto;
}

/* Panel Switch States */
.panel {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* DEVICES GRID & CARDS */
.devices-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

.search-bar {
    position: relative;
    max-width: 350px;
    width: 100%;
}

.search-bar i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-bar input {
    padding-left: 40px;
}

.bulk-actions {
    display: none !important;
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.device-card {
    padding: 24px;
    position: relative;
    overflow: hidden;
}

/* Card Glow Indicators based on State */
.device-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--text-muted);
}

.device-card.state-active-open::before,
.device-card.state-active-on::before {
    background: var(--success);
    box-shadow: 0 1px 10px var(--success);
}

.device-card.state-active-closing::before,
.device-card.state-active-opening::before {
    background: var(--warning);
    box-shadow: 0 1px 10px var(--warning);
}

.device-card.state-danger-overcurrent::before {
    background: var(--danger);
    box-shadow: 0 1px 10px var(--danger);
}

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

.device-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.device-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.device-title h4 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
}

.device-title span {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.device-status-badge {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
}

.device-status-badge.status-open,
.device-status-badge.status-on {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.2);
}

.device-status-badge.status-closing,
.device-status-badge.status-opening {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.2);
}

.device-status-badge.status-trip {
    background: rgba(244, 63, 94, 0.2);
    color: #f43f5e;
    border-color: rgba(244, 63, 94, 0.5);
    font-weight: 700;
}

.device-status-badge.status-overcurrent {
    background: rgba(244, 63, 94, 0.1);
    color: #fb7185;
    border-color: rgba(244, 63, 94, 0.2);
}

.device-status-badge.status-latched {
    background: rgba(139, 92, 246, 0.1);
    color: #c084fc;
    border-color: rgba(139, 92, 246, 0.2);
}

.device-eui {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: monospace;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.device-stats-panel {
    background: rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.02);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 20px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-val {
    font-weight: 600;
}

/* Meter/Progress bar for current readings */
.current-meter-container {
    margin-top: 4px;
}

.meter-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.meter-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.meter-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.meter-fill.warn {
    background: var(--warning);
}

.meter-fill.danger {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(244, 63, 94, 0.5);
}

.device-meta-seen {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.device-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.device-actions button {
    flex: 1;
}

/* CARDS GRID layout for MULTICAST PANEL */
.panel-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    align-items: flex-start;
}

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

.card-header-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.card-header h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
}

.card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.alarm-row-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 6px;
}

.alarm-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.15);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.alarm-row input[type="number"] {
    width: 65px;
    text-align: center;
    padding: 6px;
}

.alarm-row select {
    padding: 6px;
}

.light-control-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.light-control-actions button {
    padding: 16px;
    font-size: 15px;
}

/* double column layout for User Admin */
.panel-double-column {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
    align-items: flex-start;
}

@media (max-width: 1024px) {
    .panel-double-column {
        grid-template-columns: 1fr;
    }
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.form-grid .full-width {
    grid-column: span 2;
}

.table-card {
    padding: 24px;
}

.table-scroll-container {
    overflow-x: auto;
    margin-top: 16px;
}

.sleek-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.sleek-table th {
    padding: 14px 16px;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sleek-table td {
    padding: 14px 16px;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

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

.sleek-table tr.disabled-row {
    opacity: 0.45;
}

.sleek-table tr.disabled-row td {
    text-decoration: line-through;
}

/* FUOTA PANELS */
.fuota-card {
    padding: 30px;
}

.fuota-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .fuota-grid {
        grid-template-columns: 1fr;
    }
}

.file-dropzone {
    border: 2px dashed rgba(255,255,255,0.08);
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.file-dropzone:hover {
    border-color: var(--primary);
    background: rgba(56, 189, 248, 0.02);
}

.file-dropzone i {
    font-size: 32px;
    color: var(--text-secondary);
}

.file-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.slider-container input[type="range"] {
    flex: 1;
    cursor: pointer;
}

.slider-val {
    font-family: monospace;
    font-weight: 700;
    font-size: 14px;
}

.fuota-selection-column h4 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.column-help {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.target-device-checklist {
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    max-height: 250px;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.checklist-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.checklist-item input {
    width: 16px;
    height: 16px;
}

.target-status-row {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* SYSTEM AUDIT LOGS */
.logs-container {
    max-height: 600px;
}

.logs-container td {
    font-size: 13px;
}

.log-time {
    color: var(--text-muted);
    font-family: monospace;
}

.log-user {
    font-weight: 600;
}

.log-action {
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: var(--primary);
}

/* MODAL WINDOWS */
body.modal-open {
    overflow: hidden !important;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal {
    width: 100%;
    max-width: 480px;
    padding: 30px;
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.medium-modal {
    max-width: 550px;
}

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

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

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
}

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

.modal-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.modal-body {
    margin-bottom: 24px;
}

.input-checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.input-checkbox-group input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.input-checkbox-group label {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Toast System */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 200;
}

.toast {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 500;
    transform: translateX(100px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(10px);
    max-width: 360px;
}
.toast span {
    color: #ffffff !important;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    font-size: 16px;
}

.toast-success {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.15);
}
.toast-success .toast-icon {
    color: var(--success);
}

.toast-error {
    border-color: rgba(244, 63, 94, 0.4);
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.15);
}
.toast-error .toast-icon {
    color: var(--danger);
}

.pulse-alert {
    animation: pulse-red 2s infinite;
}
@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(244, 63, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(244, 63, 94, 0);
    }
}

@media (min-width: 768px) {
    .modal-layout-grid {
        grid-template-columns: 1.1fr 1.3fr !important;
    }
    #gps-location-modal .modal {
        max-width: 800px !important;
        width: 85% !important;
    }
}

/* Fullscreen Map Toggle styles */
.map-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
}
.leaflet-control-fullscreen-btn {
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f8fafc !important;
    border-radius: 8px !important;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.2s;
}
.leaflet-control-fullscreen-btn:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
}

/* Mobile modal actions stacking with generous spacing to avoid accidental clicks */
@media (max-width: 768px), (max-height: 500px) and (max-width: 1024px) {
    #mobile-vl-actions,
    #mobile-sl-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }
    #mobile-vl-actions .btn,
    #mobile-vl-actions a.btn,
    #mobile-sl-actions .btn,
    #mobile-sl-actions a.btn {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        justify-content: center !important;
        padding: 12px 16px !important;
        font-size: 14px !important;
    }
}

/* Scroll alignment for long modals on mobile and short viewports */
@media (max-width: 768px), (max-height: 600px) {
    .modal-backdrop {
        align-items: flex-start !important;
        padding: 20px 10px !important;
    }
    .modal {
        margin-top: 10px !important;
        margin-bottom: 20px !important;
        max-height: none !important;
    }
}
