* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --secondary-color: #94a3b8;
    --success-color: #22c55e;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --navbar-bg-start: #1e293b;
    --navbar-bg-end: #0f172a;
    --navbar-text: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    --navbar-text: #ffffff;
}

/* Navigation */
.navbar {
    background: var(--navbar-bg-start);
    color: var(--navbar-text);
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
    transition: background 0.3s ease;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
}

.navbar-logo {
    height: 60px;
    width: auto;
    margin-right: 0.5rem;
}

.nav-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--navbar-text);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
}

.nav-links {
    display: flex;
    gap: 0.35rem;
}

.nav-link {
    color: var(--navbar-text);
    background-color: transparent;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.85rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--navbar-text);
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* DateTime Header */
.datetime-header {
    background-color: var(--bg-color);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-left #systemLogo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.header-left h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
}

.datetime-header .header-right span {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.025em;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Header Section */
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header-section h2 {
    font-size: 1.875rem;
    color: var(--text-primary);
}

.controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-large {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    margin-top: 1rem;
}

#refreshIcon {
    display: inline-block;
    transition: transform 0.3s;
}

#refreshBtn:active #refreshIcon {
    transform: rotate(180deg);
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--card-bg);
    border-radius: 0.375rem;
    box-shadow: var(--shadow);
}

.status-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background-color: var(--secondary-color);
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background-color: var(--success-color);
}

.status-dot.error {
    background-color: var(--danger-color);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Device List */
.device-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ===== Device Table ===== */
.device-table-wrapper {
    overflow-x: auto;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
}

.device-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 800px;
}

.device-table thead {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.device-table thead th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    border-bottom: 2px solid #3b82f6;
    white-space: nowrap;
}

.device-table thead th.col-no { width: 50px; text-align: center; }
.device-table thead th.col-tag { min-width: 140px; }
.device-table thead th.col-status { width: 120px; text-align: center; }
.device-table thead th.col-datetime { width: 170px; text-align: center; }
.device-table thead th.col-di { min-width: 150px; width: 150px; }
.device-table thead th.col-ai { min-width: 290px; }

.device-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.device-table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.08);
}

.device-table tbody tr.row-connected {
    border-left: 3px solid var(--success-color);
}

.device-table tbody tr.row-disconnected {
    border-left: 3px solid var(--danger-color);
    opacity: 0.7;
}

.device-table tbody tr.row-inactive {
    border-left: 3px solid #475569;
    opacity: 0.4;
}

.cell-status .status-dot.inactive {
    background-color: #475569;
    box-shadow: none;
    animation: none;
}

.device-table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    color: var(--text-primary);
}

.device-table tbody td.cell-no {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
}

.device-table tbody td.cell-tag .tag-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.device-tag-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.device-tag-info {
    font-size: 0.75rem;
    color: var(--warning-color);
    font-style: italic;
}

.device-table tbody td.cell-status {
    text-align: center;
}

.cell-status .status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    background-color: var(--secondary-color);
}

.cell-status .status-dot.connected {
    background-color: var(--success-color);
    box-shadow: 0 0 6px var(--success-color);
}

.cell-status .status-dot.error {
    background-color: var(--danger-color);
    box-shadow: 0 0 6px var(--danger-color);
}

.cell-status .status-label {
    font-size: 0.8rem;
    vertical-align: middle;
}

.device-table tbody td.cell-datetime {
    text-align: center;
    font-size: 0.8rem;
    font-family: 'Consolas', 'Courier New', monospace;
    color: var(--text-secondary);
    white-space: nowrap;
}

.loading-cell, .empty-cell {
    text-align: center;
    padding: 2rem !important;
}

.no-data {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* DI Badges */
.di-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.di-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    background-color: rgba(15, 23, 42, 0.6);
}

.di-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.di-dot.di-on {
    background-color: var(--success-color);
    box-shadow: 0 0 6px var(--success-color);
}

.di-dot.di-off {
    background-color: var(--secondary-color);
}

.di-dot.di-error {
    background-color: var(--danger-color);
}

.di-badge.di-on {
    border-color: rgba(34, 197, 94, 0.3);
}

.di-badge.di-off {
    border-color: var(--border-color);
}

.di-badge.di-error {
    border-color: rgba(248, 113, 113, 0.4);
    background-color: rgba(248, 113, 113, 0.08);
}

.di-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.di-value {
    font-weight: 600;
    color: var(--text-primary);
}

.di-badge.di-on .di-value { color: var(--success-color); }
.di-badge.di-off .di-value { color: var(--secondary-color); }
.di-badge.di-error .di-value { color: var(--danger-color); }
.di-badge.di-disconnected { border-color: rgba(148, 163, 184, 0.2); opacity: 0.6; }
.di-badge.di-disconnected .di-value { color: var(--secondary-color); }

/* AI Badges */
.ai-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    background-color: rgba(15, 23, 42, 0.6);
    position: relative;
}

.ai-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.ai-value {
    font-weight: 600;
    color: var(--text-primary);
}

.ai-badge.ai-error {
    border-color: rgba(248, 113, 113, 0.4);
    background-color: rgba(248, 113, 113, 0.08);
}

.ai-badge.ai-error .ai-value {
    color: var(--danger-color);
}

.ai-badge.ai-disconnected { border-color: rgba(148, 163, 184, 0.2); opacity: 0.6; }
.ai-badge.ai-disconnected .ai-value { color: var(--secondary-color); }

/* HL alarm (High Limit) — red */
.ai-badge.ai-alarm-hl {
    border-color: #ef4444;
    background-color: rgba(239, 68, 68, 0.15);
    animation: alarm-pulse-hl 1.5s ease-in-out infinite;
}

.ai-badge.ai-alarm-hl .ai-value {
    color: #fca5a5;
    font-weight: 700;
}

.alarm-tag.hl {
    background-color: #ef4444;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1;
    letter-spacing: 0.04em;
}

/* LL alarm (Low Limit) — amber / orange */
.ai-badge.ai-alarm-ll {
    border-color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.15);
    animation: alarm-pulse-ll 1.5s ease-in-out infinite;
}

.ai-badge.ai-alarm-ll .ai-value {
    color: #fcd34d;
    font-weight: 700;
}

.alarm-tag.ll {
    background-color: #f59e0b;
    color: #000;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1;
    letter-spacing: 0.04em;
}

@keyframes alarm-pulse-hl {
    0%, 100% { box-shadow: 0 0 4px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 12px rgba(239, 68, 68, 0.7); }
}

@keyframes alarm-pulse-ll {
    0%, 100% { box-shadow: 0 0 4px rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 12px rgba(245, 158, 11, 0.7); }
}

/* Responsive: stack table on small screens */
@media (max-width: 768px) {
    .device-table { min-width: 600px; }
    .device-table thead th,
    .device-table tbody td { padding: 0.5rem 0.6rem; font-size: 0.78rem; }
}

.device-card {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.device-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateX(2px);
}

.device-card.connected {
    border-left-color: var(--success-color);
}

.device-card.disconnected {
    border-left-color: var(--danger-color);
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.device-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.device-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.device-additional-info {
    font-size: 0.813rem;
    color: var(--warning-color);
    font-style: italic;
    margin-top: 0.25rem;
    line-height: 1.4;
}

.device-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.device-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background-color: var(--bg-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.device-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.value-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.values-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.value-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background-color: var(--bg-color);
    border-radius: 0.25rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
}

.value-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.value-data {
    color: var(--text-primary);
    font-weight: 600;
}

.digital-indicator {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--secondary-color);
}

.digital-indicator.on {
    background-color: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
}

.digital-indicator.off {
    background-color: var(--secondary-color);
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Device Config List */
.device-config-list {
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.device-config-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.device-config-table thead tr {
    background-color: #1a2744;
}

.device-config-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary-color);
    border-bottom: 1px solid var(--border-color);
}

.device-config-table td {
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.device-config-table td strong {
    color: var(--text-primary);
}

.device-config-table tbody tr:last-child td {
    border-bottom: none;
}

.device-config-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

/* Keep card styles for potential reuse */
.device-config-card {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}   

/* Device status badge (Active / Inactive) on settings cards */
.device-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.70rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.device-status-badge.active {
    background-color: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.device-status-badge.inactive {
    background-color: rgba(100, 116, 139, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.35);
}

/* Toggle switch in device modal */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    width: 48px;
    height: 26px;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background-color: #334155;
    border-radius: 26px;
    transition: background-color 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--success-color);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

.toggle-label-text {
    font-weight: 600;
    font-size: 0.9rem;
}

.device-config-info h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.device-config-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.device-additional-info-settings {
    font-size: 0.875rem;
    color: var(--warning-color);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.device-config-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    white-space: nowrap;
}

.btn-small {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.5rem;
}

.close {
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Forms */
form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    font-family: inherit;
}

.form-group textarea {
    resize: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.config-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 0.375rem;
}

.config-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .header-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .device-values {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .device-config-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Inputs Configuration Page Styles */
.subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.device-selector-section {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.device-selector {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    margin-top: 0.5rem;
    transition: all 0.2s;
}

.device-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.inputs-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.config-panel {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #ffffff;
}

.panel-description {
    padding: 1rem 1.5rem;
    margin: 0;
    color: var(--secondary-color);
    font-size: 0.9rem;
    background-color: rgba(148, 163, 184, 0.05);
    border-bottom: 1px solid var(--border-color);
}

.inputs-list {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.2s;
}

.input-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.input-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.input-number {
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
    background-color: rgba(37, 99, 235, 0.1);
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
}

.input-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.btn-icon:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.btn-icon.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.empty-list {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ===== Config Input Tables (DI / AI) ===== */
.config-table-wrapper {
    overflow-x: auto;
}

.config-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 500px;
}

.config-table thead tr {
    background: linear-gradient(135deg, rgba(37,99,235,0.25) 0%, rgba(30,41,59,0.8) 100%);
}

.config-table thead th {
    padding: 0.6rem 0.6rem;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--secondary-color);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.config-table thead th.col-idx     { width: 52px;  text-align: center; }
.config-table thead th.col-alarm   { width: 110px; text-align: center; }
.config-table thead th.col-action  { width: 44px; }
.config-table thead th.col-num     { width: 90px; }
.config-table thead th.col-addr    { width: 90px; }
.config-table thead th.col-regtype { min-width: 120px; }
.config-table thead th.col-dtype   { min-width: 90px; }
.config-table thead th.col-active  { min-width: 110px; }
.config-table thead th.col-label   { min-width: 150px; }
.config-table thead th.col-unit    { width: 70px; }

.config-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.config-table tbody tr:nth-child(even) {
    background-color: rgba(255,255,255,0.02);
}

.config-table tbody tr:hover {
    background-color: rgba(37,99,235,0.08);
}

.config-table tbody td {
    padding: 0.4rem 0.5rem;
    vertical-align: middle;
}

.config-table tbody td.col-idx {
    text-align: center;
}

.config-table tbody td.col-alarm {
    text-align: center;
}

.input-badge {
    display: inline-block;
    font-weight: 700;
    font-size: 0.75rem;
    color: #93c5fd;
    background-color: rgba(37,99,235,0.15);
    border: 1px solid rgba(37,99,235,0.3);
    padding: 0.2rem 0.45rem;
    border-radius: 0.25rem;
    letter-spacing: 0.03em;
}

.tbl-input {
    width: 100%;
    background-color: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    padding: 0.28rem 0.45rem;
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.tbl-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}

.tbl-input-num {
    width: 80px;
    text-align: right;
}

.tbl-input-unit {
    width: 62px;
}

.tbl-select {
    width: 100%;
    background-color: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    padding: 0.28rem 0.35rem;
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
}

.tbl-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}

.config-table tbody td input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.save-section {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

/* Reports Page Styles */
.report-config-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.report-section {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    padding: 2rem;
}

.report-section h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.report-select,
.report-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.report-select:focus,
.report-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.report-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s;
}

.report-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.quick-range-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.form-help {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

.logo-preview {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-preview img {
    max-width: auto;
    max-height: 70px;
    object-fit: contain;
}

.report-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.preview-section {
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-top: 2rem;
}

.preview-section h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.preview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.25rem;
    border-radius: 0.5rem;
    text-align: center;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
}

.preview-table-container {
    overflow-x: auto;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.preview-table th,
.preview-table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.preview-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.preview-table tbody tr:nth-child(even) {
    background-color: var(--bg-color);
}

.preview-table tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

.preview-note {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 1rem;
}

/* Alarm report specific styles */
.alarm-high {
    color: #f87171;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.alarm-low {
    color: #fbbf24;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.status-active {
    color: #f87171;
    font-weight: 600;
}

.status-cleared {
    color: #22c55e;
    font-weight: 600;
}

.status-repeated {
    color: #94a3b8;
    font-weight: 500;
    font-style: italic;
}

.alarm-row-repeated td {
    opacity: 0.55;
    font-style: italic;
    font-size: 0.8rem;
    background-color: rgba(148, 163, 184, 0.04);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.chart-options {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

.chart-parameters-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.chart-param-checkbox {
    padding: 0.5rem;
    background-color: var(--card-bg);
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.chart-param-checkbox:hover {
    background-color: var(--bg-color);
    border-color: var(--primary-color);
}

.charts-preview {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: var(--bg-color);
    border-radius: 0.5rem;
    border: 2px solid var(--primary-color);
}

.charts-preview h4 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 2rem;
}

.chart-wrapper {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.chart-wrapper canvas {
    max-height: 400px;
}

/* Responsive adjustments for inputs config */
@media (max-width: 768px) {
    .panel-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .panel-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    .report-config-container {
        grid-template-columns: 1fr;
    }
    
    .report-actions {
        flex-direction: column;
    }
    
    .quick-range-buttons {
        flex-direction: column;
    }
    
    .preview-stats {
        grid-template-columns: 1fr;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
}

/* Authentication Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.login-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo img {
    max-width: 200px;
    height: auto;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.login-header p {
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.alert {
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #fee2e2;
    color: var(--danger-color);
    border: 1px solid #fecaca;
}

.alert-info {
    background-color: #dbeafe;
    color: var(--primary-color);
    border: 1px solid #bfdbfe;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.login-btn {
    background-color: #6b7280;
    color: white;
    width: 100%;
    display: block;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.login-btn:hover {
    background-color: #4b5563;
    box-shadow: var(--shadow);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--navbar-text);
}

#userDisplay {
    font-size: 0.9rem;
    color: var(--navbar-text);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Users Management */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* ===== Users Table ===== */
.users-table-wrapper {
    overflow-x: auto;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 700px;
}

.users-table thead {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.users-table thead th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    border-bottom: 2px solid #3b82f6;
    white-space: nowrap;
}

.users-table thead th.col-no { width: 50px; text-align: center; }
.users-table thead th.col-user { min-width: 160px; }
.users-table thead th.col-username { min-width: 120px; }
.users-table thead th.col-role { width: 140px; text-align: center; }
.users-table thead th.col-status-user { width: 130px; text-align: center; }
.users-table thead th.col-actions { width: 160px; text-align: center; }

.users-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.users-table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.08);
}

.users-table tbody tr.inactive {
    opacity: 0.55;
}

.users-table tbody tr.inactive:hover {
    opacity: 0.75;
}

.users-table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    color: var(--text-primary);
}

.users-table tbody td.cell-no {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
}

.users-table tbody td.cell-user-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.user-icon-inline {
    font-size: 1.1rem;
    margin-right: 0.4rem;
}

.users-table tbody td.cell-username {
    font-family: 'Consolas', 'Courier New', monospace;
}

.username-tag {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.users-table tbody td.cell-role { text-align: center; }
.users-table tbody td.cell-user-status { text-align: center; }
.users-table tbody td.cell-actions { text-align: center; }

.user-role-badge-table {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.user-status-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.user-status-badge.active {
    background-color: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.user-status-badge.inactive-badge {
    background-color: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Toggle Switch */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
    background-color: #475569;
    border-radius: 10px;
    transition: background-color 0.3s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #22c55e;
}

.toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(18px);
}

.toggle-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.toggle-switch input:checked ~ .toggle-label {
    color: #22c55e;
}

@media (max-width: 768px) {
    .users-table { min-width: 550px; }
    .users-table thead th,
    .users-table tbody td { padding: 0.5rem 0.6rem; font-size: 0.78rem; }
}

.user-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.user-info-section h3 {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
}

.user-username {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.admin {
    background-color: #fee2e2;
    color: #dc2626;
}

.role-badge.supervisor {
    background-color: #dbeafe;
    color: #2563eb;
}

.role-badge.operator {
    background-color: #dcfce7;
    color: #16a34a;
}

.user-permissions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.user-permissions h4 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.permission-list {
    list-style: none;
    padding: 0;
}

.permission-list li {
    padding: 0.25rem 0;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.permission-list li::before {
    content: '✓ ';
    color: var(--success-color);
    font-weight: bold;
    margin-right: 0.5rem;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    color: var(--text-primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Analog Chart Container Styles */
.analog-chart-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-header h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    margin: 0;
}

.chart-wrapper {
    background-color: var(--bg-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.device-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.device-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Footer */
.footer {
    background-color: var(--card-bg);
    color: var(--text-secondary);
    text-align: center;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
}

.footer p {
    margin: 0;
}

body:not(.login-body) {
    padding-bottom: 6rem;
}
/* View Tabs */
.view-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.1);
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* View Container */
.view-container {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view-container.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Device Map Styles */
.device-map-container {
    width: 100%;
}

.map-canvas {
    background-color: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    position: relative;
    min-height: 600px;
}

/* Map tiles — standard light mode */
.map-tiles {
    filter: none;
}

/* Leaflet popup styles */
.map-popup {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border-radius: 4px;
}

.map-popup strong {
    color: #3b82f6;
    display: block;
    margin-bottom: 4px;
}

.map-popup small {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
}

/* Map error message */
.map-error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(54, 65, 86, 0.4), rgba(30, 41, 59, 0.6));
}

.map-error-message p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #f87171;
}

.map-error-message small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.map-info-panel {
    background: linear-gradient(135deg, var(--card-bg), rgba(30, 41, 59, 0.7));
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.map-info-panel h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.device-map-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.map-list-item {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid #3b82f6;
}

.map-list-item:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateX(4px);
}

.map-list-item-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.map-list-item-content strong {
    color: #3b82f6;
    font-size: 0.95rem;
}

.map-list-item-content small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.text-muted {
    color: var(--text-secondary);
    opacity: 0.7;
}