/* =============================================================================
   MAIN CSS - Optimized and organized styles for Nutify
   ============================================================================= */

/* Theme Variables */

/* Light Theme */
:root {
    /* Define global CSS variables */
    --content-padding: 1.5rem;
    /* Base padding for content */
    --content-max-width: 1200px;
    /* Maximum width for main content */
    --grid-gap: 1rem;
    /* Default gap between grid items */
    --spacing-sm: 0.5rem;
    /* Small spacing value */
    --spacing-md: 1rem;
    /* Medium spacing value */
    --spacing-lg: 1.5rem;
    /* Large spacing value */
    --spacing-xl: 2rem;
    /* Extra large spacing value */
    --primary-color: #2563eb;
    /* Primary color for highlights */
    --text-primary: #1f2937;
    /* Primary text color */
    --text-secondary: #6b7280;
    /* Secondary text color */
    --bg-primary: #f8f9fa;
    /* Main background color */
    --bg-secondary: #f1f3f5;
    /* Secondary background color */
    --border-color: #e9ecef;
    /* Border color */
    --card-bg: #fff;
    /* Card background color */
    --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    /* Colori di base */
    --bg-main: #f4f6f8;
    /* Sfondo principale più soft */
    --bg-sidebar: #fff;
    /* Sidebar bianca */
    --bg-card: #fff;
    /* Card bianche */
    /* Colori del testo */
    --text-primary: #2c3e50;
    /* Testo principale */
    --text-secondary: #64748b;
    /* Testo secondario */
    /* Bordi e ombre */
    --border-color: #e2e8f0;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    /* Accenti e stati */
    --accent-color: #3b82f6;
    /* Colore principale per elementi attivi */
    --hover-bg: #f8fafc;
    /* Background hover */
    }
:root[data-theme="light"] {
    --bg-primary: #f4f6f8;
    /* Nuovo colore di sfondo principale */
    --bg-secondary: #fff;
    /* Sidebar e header */
    --card-bg: #fff;
    /* Card background */
    /* Testo */
    --text-primary: #2c3e50;
    --text-secondary: #64748b;
    /* Bordi e ombre */
    --border-color: #e2e8f0;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    /* Accenti */
    --accent-color: #3b82f6;
    --hover-bg: #f8fafc
    }
:root[data-theme="light"] {
    /* Colori di base */
    --bg-primary: #f4f6f8;
    /* Nuovo colore di sfondo principale */
    --bg-secondary: #fff;
    /* Sidebar e header */
    --card-bg: #fff;
    /* Card background */
    /* Testo */
    --text-primary: #2c3e50;
    --text-secondary: #64748b;
    /* Bordi e ombre */
    --border-color: #e2e8f0;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    /* Accenti */
    --accent-color: #3b82f6;
    --hover-bg: #f8fafc
    }
:root[data-theme="light"] .page {
    background-color: var(--bg-primary)
    }
:root[data-theme="light"] .sidebar {
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color)
    }
:root[data-theme="light"] .stat_card, :root[data-theme="light"] .chart_card, :root[data-theme="light"] .combined_card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow)
    }
:root[data-theme="light"] .header_top {
    background-color: var(--bg-primary);  /* Cambiato da var(--bg-secondary) a var(--bg-primary) */
    border-bottom: none;
    }

/* Dark Theme */
:root[data-theme="dark"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #fff;
    --text-secondary: #8b949e;
    --border-color: #30363d;
    --primary-color: #2563eb;
    --card-bg: var(--bg-secondary);
    /* Card background color per tema scuro */
    }
:root[data-theme="dark"] .stat_card {
    background: var(--bg-secondary)
    }
:root[data-theme="dark"] .stat_card .stat-icon {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .command-log-container {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .header_top {
    background: var(--bg-primary);
    border-color: transparent;
    /* Cambiato da var(--border-color) a transparent */
    border-bottom: none;
    /* Assicuriamoci che non ci sia bordo */
    box-shadow: var(--shadow-sm)
    }
:root[data-theme="dark"] .header_top-status_bar {
    background: var(--bg-tertiary);
    border-color: var(--border-color)
    }
:root[data-theme="dark"] .header_top-time_range {
    background: var(--bg-tertiary);
    border-color: var(--border-color)
    }
:root[data-theme="dark"] .theme-toggle:hover {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .chart_card {
    background: var(--bg-secondary);
    border-color: var(--border-color)
    }
:root[data-theme="dark"] .options_mail_form_group input {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary)
    }
:root[data-theme="dark"] .options_mail_config_status, :root[data-theme="dark"] .options_mail_test_info {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .options_log_preview {
    background: var(--bg-tertiary);
    border-color: var(--border-color)
    }
:root[data-theme="dark"] .options_about_section {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .options_about_links a {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .options_about_project {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .options_log_filters {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .options_log_filter_group select {
    background: var(--bg-tertiary);
    border-color: var(--border-color)
    }
:root[data-theme="dark"] .slider {
    background-color: var(--bg-tertiary)
    }
:root[data-theme="dark"] .options_notification_card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.2s ease-in-out;
}

:root[data-theme="dark"] .options_notification_card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

:root[data-theme="dark"] .options_input {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary)
    }
:root[data-theme="dark"] .schedule-item {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .day-btn {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .options_btn_secondary {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .tables_grid {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .table_info_card {
    background: var(--bg-secondary)
    }
:root[data-theme="dark"] .options_database_stat_item {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .database_action_btn {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .events_table th {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .events_table tr:hover {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .events_filters {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .events_filter_group select, :root[data-theme="dark"] .events_filter_group input {
    background: var(--bg-tertiary);
    border-color: var(--border-color)
    }
:root[data-theme="dark"] .alert-item {
    background-color: var(--bg-tertiary)
    }
:root[data-theme="dark"] .alert-title {
    color: var(--text-primary)
    }
:root[data-theme="dark"] {
    /* When the body has the 'dark' class, override CSS variables */
    --bg-primary: #0d1117;
    /* Sfondo principale più scuro e professionale */
    --bg-secondary: #161b22;
    /* Sfondo secondario leggermente più chiaro */
    --bg-tertiary: #21262d;
    /* Terzo livello per elementi in risalto */
    /* Testo e bordi */
    --text-primary: #c9d1d9;
    /* Testo principale più leggibile */
    --text-secondary: #8b949e;
    /* Testo secondario con contrasto ottimale */
    --border-color: #30363d;
    /* Bordi più visibili ma non invasivi */
    /* Colori di accent */
    --primary-color: #58a6ff;
    /* Blu più vivido per elementi principali */
    --success-color: #238636;
    /* Verde per stati positivi */
    --warning-color: #9e6a03;
    /* Giallo per avvisi */
    --danger-color: #da3633;
    /* Rosso per errori */
    /* Ombre e overlay */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
    --overlay-color: rgba(0, 0, 0, 0.6);
    color-scheme: dark;
    background: var(--bg-primary);
    border: none
    }
:root[data-theme="dark"] .page {
    background: var(--bg-primary) !important;
    /* Stesso background del body */
    color: var(--text-primary) !important;
    border: none
    }
:root[data-theme="dark"] .header_top {
    background: var(--bg-primary);
    border-color: transparent;
    /* Cambiato da var(--border-color) a transparent */
    border-bottom: none;
    /* Assicuriamoci che non ci sia bordo */
    box-shadow: var(--shadow-sm)
    }
:root[data-theme="dark"] .sidebar {
    background: var(--bg-primary);
    border: none;
    box-shadow: none
    }
:root[data-theme="dark"] .stat_card, :root[data-theme="dark"] .combined_card, :root[data-theme="dark"] .chart_card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary) !important
    }
:root[data-theme="dark"] .btn-primary {
    background-color: var(--primary-color) !important;
    color: var(--bg-primary) !important
    }
:root[data-theme="dark"] .date-range-btn {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important
    }
:root[data-theme="dark"] .date-range-dropdown {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: var(--shadow-md)
    }
:root[data-theme="dark"] .modal_bar-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md)
    }
:root[data-theme="dark"] .page_title h1, :root[data-theme="dark"] .page_subtitle, :root[data-theme="dark"] .stat-label, :root[data-theme="dark"] .stat-value, :root[data-theme="dark"] .selected-period, :root[data-theme="dark"] .header_top-status_bar h3, :root[data-theme="dark"] .header_top-clock, :root[data-theme="dark"] .nav-item {
    color: var(--text-primary) !important
    }
:root[data-theme="dark"] .chart {
    filter: brightness(0.8) contrast(1.2)
    }
:root[data-theme="dark"] .apexcharts-text, :root[data-theme="dark"] .apexcharts-yaxis-label, :root[data-theme="dark"] .apexcharts-xaxis-label {
    fill: var(--text-secondary) !important
    }
:root[data-theme="dark"] .apexcharts-gridline, :root[data-theme="dark"] .apexcharts-xaxis-line, :root[data-theme="dark"] .apexcharts-yaxis-line {
    stroke: var(--border-color) !important;
    opacity: 0.2
    }
:root[data-theme="dark"] .apexcharts-tooltip {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-md) !important;
    color: var(--text-primary) !important
    }
:root[data-theme="dark"] .apexcharts-tooltip-title {
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-color) !important
    }
:root[data-theme="dark"] .apexcharts-legend-text {
    color: var(--text-secondary) !important
    }
:root[data-theme="dark"] .nav-item.active {
    color: var(--primary-color);
    /* Già impostato sul blu */
    background-color: var(--bg-tertiary);
    /* Sfondo più scuro */
    border-left: 2px solid var(--primary-color);
    /* Bordo blu a sinistra */
    }
:root[data-theme="dark"] .nav-item:hover {
    color: var(--primary-color);
    background-color: var(--bg-tertiary)
    }
:root[data-theme="dark"] .nav-item:not(.active):hover {
    transform: scale(1.1);
    background-color: var(--bg-tertiary)
    }
:root[data-theme="dark"] .date-range-dropdown {
    background: var(--bg-secondary);
    border-color: var(--border-color)
    }
:root[data-theme="dark"] .range-options {
    border-color: var(--border-color)
    }
:root[data-theme="dark"] .range-options a:hover, :root[data-theme="dark"] .range-options a.active {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .time-input-group input, :root[data-theme="dark"] .range-input-group input {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary)
    }
:root[data-theme="dark"] .time-range-selector, :root[data-theme="dark"] .day-selector, :root[data-theme="dark"] .range-selector, :root[data-theme="dark"] .realtime-selector {
    background: var(--bg-secondary);
    border-color: var(--border-color)
    }
:root[data-theme="dark"] .events, :root[data-theme="dark"] .health {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md)
    }
:root[data-theme="dark"] .card-header h3 {
    color: var(--text-primary)
    }
:root[data-theme="dark"] .events-stats {
    background: var(--bg-tertiary);
    border-color: var(--border-color)
    }
:root[data-theme="dark"] .event-stat {
    border-color: var(--border-color)
    }
:root[data-theme="dark"] .event-label {
    color: var(--text-secondary)
    }
:root[data-theme="dark"] .event-value {
    color: var(--text-primary)
    }
:root[data-theme="dark"] .health-tip {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-color: var(--border-color)
    }
:root[data-theme="dark"] .health-chart-container {
    background: var(--bg-tertiary);
    border-color: var(--border-color)
    }
:root[data-theme="dark"] .mini-info-row {
    border-color: var(--border-color)
    }
:root[data-theme="dark"] .info-label {
    color: var(--text-secondary)
    }
:root[data-theme="dark"] .info-value {
    color: var(--text-primary)
    }
:root[data-theme="dark"] .modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color)
    }
:root[data-theme="dark"] .command-confirmation {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .command-warning {
    background: rgba(255, 152, 0, 0.1)
    }
:root[data-theme="dark"] .live-log {
    background: var(--bg-primary);
    color: var(--text-primary)
    }
:root[data-theme="dark"] .command-execution-status {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .api_command-item {
    background: var(--bg-secondary)
    }
:root[data-theme="dark"] .api_command-item:hover {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .api_log-details {
    background: var(--bg-tertiary);
    border-color: var(--border-color)
    }
:root[data-theme="dark"] .api_log-details pre {
    color: var(--text-primary)
    }
:root[data-theme="dark"] .schedule-item {
    background-color: var(--bg-tertiary)
    }
:root[data-theme="dark"] .tooltip {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color)
    }
:root[data-theme="dark"] .tooltip::before {
    background-color: var(--bg-tertiary);
    border-left: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color)
    }
:root[data-theme="dark"] .feature-item, :root[data-theme="dark"] .tech-item, :root[data-theme="dark"] .license-content, :root[data-theme="dark"] .combined_content, :root[data-theme="dark"] .contact-link {
    background: var(--bg-tertiary)
    }
:root[data-theme="dark"] .tech-item:hover {
    background: var(--primary-color)
    }

    :root[data-theme="light"] .options_log_card {
        background-color: var(--card-bg);
        border: 1px solid var(--border-color);
        box-shadow: var(--card-shadow);
    }
    
    :root[data-theme="light"] #logPreview {
        background-color: var(--bg-secondary) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }
    
    :root[data-theme="light"] .log-line {
        background-color: transparent !important;
        color: var(--text-primary) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    
    :root[data-theme="light"] .log-file {
        color: #555 !important;
    }
    
    :root[data-theme="light"] .log-number {
        color: #777 !important;
    }
    
    :root[data-theme="light"] .log-timestamp {
        color: #666 !important;
    }
    
    :root[data-theme="light"] .log-content {
        color: var(--text-primary) !important;
    }
    
    :root[data-theme="light"] .log-info {
        color: #2563eb !important;
    }
    
    :root[data-theme="light"] .log-debug {
        color: #555 !important;
    }
    
    :root[data-theme="light"] .log-warning {
        color: #d97706 !important;
    }
    
    :root[data-theme="light"] .log-error {
        color: #dc2626 !important;
    }
    
    :root[data-theme="light"] .web-log {
        background-color: transparent !important;
    }
    
    :root[data-theme="light"] .web-log .log-level {
        font-weight: bold;
    }
    
    :root[data-theme="light"] .web-log[data-level="info"] .log-level {
        color: #2563eb !important;
    }
    
    :root[data-theme="light"] .web-log[data-level="debug"] .log-level {
        color: #555 !important;
    }
    
    :root[data-theme="light"] .web-log[data-level="warning"] .log-level {
        color: #d97706 !important;
    }
    
    :root[data-theme="light"] .web-log[data-level="error"] .log-level {
        color: #dc2626 !important;
    }
    

/* Base Styles */
body {
    /* Style for the body element */
    font-family: "Inter", sans-serif;
    /* Use the "Inter" font */
    background-color: var(--bg-main);
    color: var(--text-primary);
    margin: 0;
    /* Reset default margin */
    min-height: 100vh;
    /* Ensure full viewport height */
    display: flex;
    /* Enable flex layout */
    padding: 0;
    overflow-x: hidden;
    transition: background-color 0s ease-in-out
    }
.page {
    width: 100%;
    min-height: calc(100vh - 60px);
    /* Adjust padding-top to bring content closer to status bar */
    padding: calc(var(--content-padding) * 0.5) var(--content-padding) var(--content-padding);
    box-sizing: border-box;
    border: none;
    background: #eef0f2;
    /* Stesso colore del body per consistenza */
    box-shadow: none;
    margin: 0;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease
    }
.combined_subtitle {
    /* Header subtitle styling */
    color: var(--text-secondary);
    font-size: 0.875rem
    }
.page_title h1 {
    /* Style for main title */
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm)
    }
.page_subtitle {
    /* Style for subtitle text */
    color: var(--text-secondary);
    font-size: 0.875rem
    }
.page_actions {
    /* Container for actions in header */
    display: flex;
    gap: var(--spacing-md);
    align-items: center
    }
.log-entry {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem
    }
.log-entry:last-child {
    border-bottom: none
    }
.log-time {
    font-size: 0.75rem;
    color: var(--text-secondary)
    }
.log-command {
    display: flex;
    justify-content: space-between;
    align-items: center
    }
.log-status {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem
    }
.log-details {
    font-family: monospace;
    font-size: 0.875rem;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 0.25rem;
    white-space: pre-wrap
    }
body.dark .log-entry {
    border-color: var(--border-color)
    }
body.dark .log-details {
    background: var(--bg-secondary)
    }
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: var(--spacing-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px
    }
.theme-toggle:hover {
    background: var(--bg-secondary);
    color: var(--primary-color)
    }
.theme-toggle i {
    font-size: 1.25rem
    }
.nav-item {
    /* Single navigation item */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    color: var(--text-secondary);
    transition: all 0.2s;
    position: relative
    }
.nav-item:hover, .nav-item.active {
    /* Hover and active states */
    color: var(--accent-color);
    background-color: var(--hover-bg)
    }
.nav-item:not(.active):hover {
    /* Additional hover effect for inactive items */
    transform: scale(1.1)
    }
.nav-item .nav-label {
    /* Tooltip for nav items */
    opacity: 0;
    transform: translatex(10px) translatey(-50%);
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-size: 0.75rem;
    color: var(--text-secondary);
    position: absolute;
    left: calc(100% + 0.5rem);
    top: 50%;
    white-space: nowrap;
    pointer-events: none
    }
.nav-item:not(.active):hover .nav-label {
    /* Show tooltip on hover */
    opacity: 1;
    transform: translatex(0) translatey(-50%)
    }
.main-content {
    margin-left: 64px;
    padding: 80px 1.5rem 1.5rem;
    width: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1;
    min-width: 0;
    background: var(--bg-primary);
    /* Assicuriamoci che il background sia uniforme */
    border: none
    }
.date-picker {
    /* Style for date picker inputs */
    padding: 0.375rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    width: 100%
    }
.date_range {
    /* Container for date range menu */
    position: relative
    }
.date-range-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: auto;
    min-width: 200px;
    max-width: 300px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    margin-top: 0.5rem;
    z-index: 50;
    padding: 0.5rem
}

.time-inputs,
.range-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem
}

.time-input-group,
.range-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem
}

.time-input-group input,
.range-input-group input {
    width: 100%;
    padding: 0.375rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    background: var(--bg-primary)
}
.date-range-dropdown.show {
    display: block
    }
.range-options {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color)
    }
.range-options a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.25rem;
    transition: all 0.2s ease
    }
.range-options a:hover {
    background: var(--bg-secondary);
    color: var(--primary-color)
    }
.range-options a.active {
    background: var(--bg-secondary);
    color: var(--primary-color)
    }
.time-actions, .range-actions, .day-actions {
    /* Aggiunto day-actions */
    display: flex;
    justify-content: center;
    margin-top: 1rem
    }
.time-actions, .range-actions {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    /* Aumentato lo spazio sopra il pulsante */
    }

.options_tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto
    }
.options_tab_content {
    display: none;
    animation: fadeIn 0.3s ease
    }
.options_tab_content.active {
    display: block
    }
.options_mail_subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem
    }
.options_mail_config_status {
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center
    }
.options_mail_config_status p {
    color: var(--text-primary);
    font-weight: 500;
    margin: 0
    }
.options_mail_test_info {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.375rem;
    color: var(--text-primary)
    }
.options_nutify_item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.375rem;
    gap: 1rem
    }
.options_nutify_content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1
    }
.options_nutify_checkbox {
    width: 1.25rem;
    height: 1.25rem
    }
.options_nutify_title {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem
    }
.options_nutify_description {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary)
    }
.options_nutify_test {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s
    }
.options_nutify_test:hover {
    background: var(--primary-dark)
    }
.log-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem
    }
.log-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem
    }
.options_log_filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem
    }
.options_log_filter_group {
    flex: 1;
    min-width: 200px
    }
.options_log_filter_group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem
    }
.options_log_preview {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    max-height: 500px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.875rem;
    line-height: 1.5
    }
.options_log_preview pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word
    }
.options_log_actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem
    }
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px
    }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-secondary);
    transition: 0.4s;
    border: 1px solid var(--border-color)
    }
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s
    }
.slider.round {
    border-radius: 24px
    }
.slider.round:before {
    border-radius: 50%
    }
.options_about_avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary-color)
    }
.options_about_title {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.5rem
    }
.options_about_section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem
    }
.options_about_section h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1rem
    }
.options_about_links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem
    }
.options_about_links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease
    }
.options_about_links a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color)
    }
.options_about_project {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem
    }
.options_about_project p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary)
    }
.options_about_project strong {
    color: var(--text-primary)
    }
.options_notification_subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem
    }
.options_checkbox_group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem
    }
.options_checkbox_item {
    display: flex;
    align-items: center;
    gap: 0.5rem
    }
.scheduler-list {
    margin: 1.5rem 0
    }
.schedule-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem
    }
.schedule-info {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem
    }
.schedule-time, .schedule-days, .schedule-period, .schedule-reports, .schedule-email {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-primary)
    }
.schedule-actions {
    display: flex;
    gap: 0.5rem
    }
.schedule-days {
    margin-bottom: 1.5rem
    }
.schedule-time {
    margin-bottom: 1.5rem
    }
.schedule-reports {
    margin-bottom: 1.5rem
    }
.report-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem
    }
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    margin: 1rem 0
    }
.options_database_stat_item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem
    }
.options_database_stat_item .stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary)
    }
.options_database_stat_item .stat-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary)
    }
.database_actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem
    }
.database_status {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem
    }
.database_status.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2)
    }
.database_status.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2)
    }
.database_status i {
    font-size: 1.25rem
    }
.events_title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary)
    }
.events_actions {
    display: flex;
    gap: 1rem
    }
.events_filters {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap
    }
.events_filter_group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
    flex: 1
    }
.events_filter_group label {
    font-size: 0.875rem;
    color: var(--text-secondary)
    }
.event_badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500
    }
.event_badge.online {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981
    }
.event_badge.onbatt {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b
    }
.event_badge.lowbatt {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444
    }
.event_badge.commok {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6
    }
.event_badge.commbad {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444
    }
.event_actions {
    display: flex;
    gap: 0.5rem
    }
.events-list {
    max-height: 300px;
    overflow-y: auto
    }
.event-item {
    display: flex;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
    transition: background-color 0.2s ease
    }
.event-item:hover {
    background-color: var(--bg-secondary)
    }
.event-icon {
    font-size: 1.25rem;
    color: var(--primary-color)
    }
.event-content {
    flex: 1
    }
.event-type {
    font-weight: 500;
    color: var(--text-primary)
    }
.event-time {
    color: var(--text-secondary);
    font-size: 0.875rem
    }
.health-metrics {
    display: grid;
    gap: 1rem;
    padding: 1rem
    }
.health-metric {
    display: flex;
    align-items: center;
    gap: 1rem
    }
.health-gauge {
    height: 4px;
    background-color: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem
    }
.gauge-fill {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease
    }
.command-confirmation {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.375rem;
    margin-bottom: 1rem
    }
.command-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #fff3e6;
    border-left: 4px solid #ff9800;
    margin: 1rem 0
    }
.command-warning i {
    color: #ff9800
    }
.command-execute-confirm {
    font-weight: 500;
    margin-top: 1rem;
    color: var(--text-primary)
    }
.command-execution-status {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.375rem
    }
.live-log {
    font-family: monospace;
    white-space: pre-wrap;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 0.25rem;
    margin-top: 0.5rem;
    max-height: 200px;
    overflow-y: auto
    }
.api_command-wrapper {
    margin-bottom: 1rem;
    position: relative
    }
.api_command-item {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
    cursor: pointer
    }
.api_command-item:hover {
    background: var(--bg-secondary)
    }
.api_command-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    margin-left: 1rem
    }
.api_command-name i {
    color: var(--primary-color);
    font-size: 1.2rem
    }
.api_command-name span {
    font-weight: 600;
    color: var(--text-primary)
    }
.api_command-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-left: 1rem
    }
.api_log-details {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1)
    }
.api_log-details pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-primary)
    }
.api_command-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
    margin-left: 1rem
    }
.api_log-details {
    transition: all 0.3s ease
    }
.upscmd_stats-body {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    padding: 1rem
    }
.upscmd_commands-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem
    }
.stat-label.small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
    }
.stat-value {
    font-size: 1.15rem; /* Slightly smaller font size */
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    word-break: break-word; /* More robust word breaking */
    white-space: normal; /* Allow wrapping */
    line-height: 1.3; /* Adjust line height for wrapped text */
    display: block; /* Ensure it behaves as a block element */
}
.schedules-section {
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem
    }
.schedule-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background-color: var(--bg-secondary);
    border-radius: 0.375rem;
    gap: 0.5rem
    }
.schedule-icon {
    color: var(--primary-color);
    font-size: 0.875rem
    }
.schedule-content {
    flex: 1;
    overflow: hidden
    }
.schedule-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary)
    }
.schedule-days {
    font-size: 0.675rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
    }
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center
    }
.animated-bell {
    color: var(--primary-color)
    }
.animated-schedule {
    color: var(--primary-color)
    }
.fa-shake {
    animation: custom-shake 0.5s ease-in-out
    }
.fa-bounce {
    animation: custom-bounce 0.5s ease-in-out
    }
.notification-badge {
    animation: pulse 2s infinite
    }
.active-schedule {
    color: var(--primary-color) !important
    }
.options_nutify_test {
    min-width: 80px;
    justify-content: center
    }
.options_nutify_test.loading {
    pointer-events: none;
    opacity: 0.8
    }
.options_mail_checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    /* Spinge la checkbox a destra */
    }
.options_nutify_actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.options_email_select {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.875rem;
    min-width: 180px;
    max-width: 250px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.options_email_select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
}

:root[data-theme="dark"] .options_email_select {
    background-color: var(--dark-bg-secondary);
    border: 1px solid var(--dark-border-color);
    color: var(--dark-text-primary);
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

:root[data-theme="dark"] .options_email_select:focus {
    border-color: var(--dark-primary-color);
    outline: none;
}

@media (max-width: 768px) {
    .options_nutify_actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .options_email_select {
        width: 100%;
        max-width: 100%;
    }
}

.report-type-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer
    }
#Log_tab .stat-description {
    margin-top: 8px;
    font-size: 0.85rem
    }
#logPreview {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #30363d;
    border-radius: 4px;
    background-color: #0d1117;
    padding: 8px;
    font-size: 0.85rem;
    line-height: 1.1;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    color: #e6e6e6
    }
.log-line {
    padding: 1px 4px;
    border-bottom: 1px solid #1e2329;
    white-space: pre;
    word-break: break-all;
    line-height: 1.1;
    margin: 0;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap
    }
.log-line:hover {
    background-color: #161b22
    }
.log-file {
    color: #7d8590;
    margin-right: 6px;
    font-weight: bold;
    font-size: 0.75em;
    min-width: 80px;
    display: inline-block
    }
.log-number {
    color: #7d8590;
    margin-right: 6px;
    font-size: 0.7em;
    min-width: 40px;
    display: inline-block;
    text-align: right
    }
.log-timestamp {
    color: #7d8590;
    margin-right: 6px;
    font-size: 0.75em;
    min-width: 120px;
    display: inline-block
    }
.log-content {
    white-space: pre;
    display: inline;
    flex: 1
    }
.log-debug {
    color: #939aa3
    }
.log-info {
    color: #58a6ff
    }
.log-warning {
    color: #e3b341
    }
.log-error {
    color: #f85149;
    font-weight: bold
    }
.load-more-logs {
    text-align: center;
    padding: 6px;
    margin: 6px 0
    }
.contact-links {
    margin-top: 2rem
    }
.contact-links h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary)
    }
.contact-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease
    }
.contact-link i {
    font-size: 1.2rem;
    color: var(--primary-color)
    }
.contact-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translatey(-3px)
    }
.contact-link:hover i {
    color: white
    }
.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    transition: transform 0.2s ease
    }
.feature-item:hover {
    transform: translatey(-5px)
    }
.feature-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    min-width: 2rem;
    text-align: center
    }
.feature-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary)
    }
.feature-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5
    }
.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    min-width: 100px;
    transition: all 0.2s ease
    }
.tech-item i {
    font-size: 2rem;
    color: var(--primary-color)
    }
.tech-item span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary)
    }
.tech-item:hover {
    transform: translatey(-5px);
    background: var(--primary-color)
    }
.tech-item:hover i, .tech-item:hover span {
    color: white
    }
.license-content {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    color: var(--text-primary)
    }
.license-content p {
    margin-bottom: 1rem;
    line-height: 1.6
    }
.license-terms {
    padding-left: 1.5rem;
    margin: 1rem 0
    }
.license-terms li {
    margin-bottom: 0.75rem;
    line-height: 1.5
    }
.combined_content {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    color: var(--text-primary);
    line-height: 1.6
    }
.combined_content p {
    margin-bottom: 1rem
    }

/* Layout */

    /* Grid */
    .grid {
    /* Grid container */
    display: grid;
    /* Enable CSS grid */
    }
    .grid-cols-2 {
    /* Two-column grid */
    grid-template-columns: repeat(2, 1fr);
    /* Two equal columns */
    }
    .stats_grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--grid-gap);
    margin-bottom: var(--spacing-lg);
    width: 100%
    }
    .bottom_grid {
    /* Container for bottom grid layout */
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem
    }
    .charts_grid {
    display: grid;
    gap: var(--spacing-lg);
    width: 100%;
    box-sizing: border-box
    }
    .options_nutify_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

    .options_nutify_item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        background: var(--bg-secondary);
        border-radius: 0.375rem;
        gap: 1rem;
    }

    .options_nutify_content {
        display: flex;
        align-items: center;
        gap: 1rem;
        flex: 1;
    }

    .options_nutify_title {
        display: block;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 0.25rem;
    }

    .options_nutify_description {
        display: block;
        font-size: 0.875rem;
        color: var(--text-secondary);
    }

    .options_nutify_actions {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-left: auto;
    }
    .stats_grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem
    }
    .grid_container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem
    }
    .schedules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem
    }
    .report-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem
    }
    .contact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem
    }
    .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem
    }
    .tech-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem
    }

    /* Containers */
    .status_container {
    /* Container for status information */
    display: flex;
    /* Use flex layout */
    justify-content: space-between;
    /* Space items evenly */
    align-items: center;
    /* Vertical centering */
    gap: 1rem;
    /* Gap between items */
    padding: 1rem;
    /* Internal padding */
    margin-bottom: 1.5rem;
    /* Margin below container */
    }
    .combined_container {
    /* Container for charts within combined cards */
    width: 100%;
    height: 450px
    }
    .command-log-container {
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto
    }
    .chart_container {
    width: 100%;
    height: 450px;
    position: relative;
    box-sizing: border-box
    }
    .events_container {
    display: grid;
    gap: 1.5rem;
    padding: 1.5rem
    }
    .upscmd_container {
    padding: 1.5rem
    }
    .control-container {
    height: 38px;
    display: flex;
    align-items: center;
    margin: 8px 0
    }
    .switch-container {
    display: flex;
    align-items: center
    }

/* Components */

    /* Header */
    .stat_card .stat-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: auto;
    /* Spinge il contenuto verso l'alto */
    }
    .combined_header {
    /* Header container for combined cards */
    margin-bottom: 1rem
    }
    .combined_header h2 {
    /* Header title styling */
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem
    }
    .page_header {
    /* Container for header section on pages */
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl)
    }
    .header_top {
    position: fixed;
    top: 0;
    left: 64px;
    right: 0;
    height: 60px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    z-index: 90;
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-md)
    }
    .header_top-status_container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
    height: 100%;
    padding: var(--spacing-sm);
    /* Aggiungiamo margine superiore per staccare la status bar dal top */
    margin-top: 10px;
    /* Puoi regolare questo valore in base alle tue preferenze */
    }
    .header_top-status_bar {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    align-items: center;
    flex-grow: 1;
    min-width: 0
    }
    .header_top-status_bar h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500
    }
    .header_top-time_range {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0
    }
    .header_top-serial {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
    }
    .header_top-status_info {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    /* Assicura che occupi tutta la larghezza */
    justify-content: space-between;
    /* Questo spinge gli elementi ai lati opposti */
    }
    .header_top-right_elements {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    /* Spinge il gruppo verso destra */
    }
    .header_top-battery {
    display: flex;
    align-items: center;
    gap: 0.5rem
    }
    .header_top-status_info h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem
    }
    .header_top-status_info i {
    font-size: 1.1em
    }
    .chart_header {
    margin-bottom: var(--spacing-md)
    }
    .chart_header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary)
    }
    .modal_bar-header {
    /* Modal header container */
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
    padding-right: 2rem;
    /* Space for close button */
    }
    .header_top-clock {
    /* Clock container in header */
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    font-family: monospace;
    font-size: 1.1rem;
    color: #4B5563;
    margin-left: auto
    }
    .header_top-clock i {
    /* Clock icon style */
    color: #3B82F6
    }
    .options_log_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem
    }
    .options_about_header {
    text-align: center;
    margin-bottom: 2rem
    }
    .table_info_header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem
    }
    .table_info_header i {
    color: var(--primary-color);
    font-size: 1.25rem
    }
    .table_info_header h4 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0
    }
    .events_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem
    }
    .event-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem
    }
    .modal-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color)
    }
    .modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem
    }
    .upscmd_card-header {
    background: var(--bg-secondary);
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center
    }
    .upscmd_card-header h2 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-primary)
    }
    .section-header {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem
    }
    .header_top-icons {
    display: flex;
    align-items: center;
    gap: 1rem
    }
    .header_top-notify, .header_top-schedule {
    position: relative;
    cursor: pointer
    }
    .header_top-status_info {
    display: flex;
    align-items: center;
    gap: 1.5rem
    }
    .header_top-battery, .header_top-load, .header_top-power {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap
    }
    .header_top-notify a, .header_top-schedule a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 24px;
    height: 24px
    }
    .header_top-notify:hover a, .header_top-schedule:hover a {
    transform: scale(1.1);
    transition: transform 0.2s ease
    }
    .header_top-notify a:hover .tooltip, .header_top-schedule a:hover .tooltip {
    visibility: visible;
    opacity: 1
    }
    .header_top-ups_info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-right: 1rem;
    border-right: 1px solid var(--border-color);
    margin-right: 1rem
    }
    .header_top-model {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem
    }
    .header_top-serial {
    font-size: 0.75rem;
    color: var(--text-secondary)
    }
    .header_top-settings {
    position: relative;
    cursor: pointer
    }
    .header_top-settings a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 24px;
    height: 24px
    }
    .header_top-settings a.active i {
    color: var(--primary-color)
    }
    .header_top-settings:hover a {
    transform: scale(1.1);
    transition: transform 0.2s ease
    }
    .header_top-settings:hover i {
    transform: rotate(45deg);
    transition: transform 0.3s ease
    }
    .header_top-logout {
    position: relative;
    cursor: pointer
    }
    .header_top-logout a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 24px;
    height: 24px
    }
    .header_top-logout:hover a {
    transform: scale(1.1);
    transition: transform 0.2s ease
    }
    .header_top-logout:hover i {
    color: var(--danger-color);
    transition: color 0.3s ease
    }
    .header_top-ups_info, .header_top-status_info h3, .header_top-battery, .header_top-load, .header_top-power {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-right: 0.75rem;
    border-right: 1px solid var(--border-color);
    margin-right: 0.75rem;
    flex: 1;
    min-width: 100px
    }
    .header_top-status_info {
    gap: 0.75rem
    }
    .header_top-ups_info {
    flex: 1.5;
    min-width: 150px
    }
    .header_top-status_info h3, .header_top-battery, .header_top-load, .header_top-power {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
    }
    .header_top-power {
    border-right: none;
    padding-right: 0;
    margin-right: 0
    }
    .card_header {
    margin-bottom: 20px
    }
    .card_header h2 {
    color: var(--text-primary);
    margin-bottom: 8px
    }
    .notification_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    width: 100%
    }

    /* Sidebar */
    .sidebar {
    /* Sidebar container */
    width: 64px;
    background-color: var(--bg-sidebar);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    border-right: 1px solid var(--border-color);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 1rem
    }
    .sidebar-logo {
    /* Sidebar logo style */
    width: 32px;
    height: 32px;
    margin-bottom: 2rem;
    color: var(--primary-color)
    }
    .sidebar-nav {
    /* Container for sidebar navigation */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%
    }

    /* Cards */
    .stat_card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: var(--spacing-lg);
    box-shadow: var(--card-shadow);
    display: flex;
    gap: var(--spacing-md);
    min-height: 140px;
    /* Aumentato leggermente per dare più spazio */
    position: relative;
    /* Per il posizionamento assoluto dei dettagli */
    min-width: 0;
    /* Importante per far funzionare text-overflow */
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease
    }
    .stat_card .stat-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    color: var(--primary-color);
    margin-top: 4px;
    /* Allinea con il titolo */
    }
    .stat_card .stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem
    }
    .stat_card .stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.25
    }
    .stat_card .selected-period {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1
    }
    .stat_card .stat-value {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    word-wrap: break-word;
    white-space: normal;
}
    .stat_card:hover {
    transform: translatey(-2px);
    box-shadow: var(--shadow-md)
    }
    .stat_card.mini {
    /* Variant for small widget cards */
    background: white;
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: flex-start;
    gap: 0.375rem
    }
    .stat_card.mini .stat-icon {
    /* Icon container in mini cards */
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 0.375rem;
    color: var(--primary-color);
    font-size: 0.75rem;
    flex-shrink: 0
}
    .stat_card.mini .stat-content {
    /* Content area in mini cards */
    flex: 1;
    min-width: 0
    }
    .stat_card.mini .stat-label {
    /* Label in mini cards */
    font-size: 0.75rem;
    color: #6B7280;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
    }
    .stat_card.mini .stat-value {
    /* Value in mini cards */
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin: 0.2rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    word-wrap: break-word;
    white-space: normal;
}
    .stat_card.mini .stat-description {
    /* Optional description in mini cards */
    font-size: 0.65rem;
    color: #6B7280;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.1
    }
    .stat_card.mini.updated {
    /* Animation for updated mini card */
    animation: highlight 1s ease-out
    }
    .combined_card, .events, .health, .frequency, .quality {
    /* Shared styles for multiple combined cards */
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease
    }
    .chart_card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: var(--spacing-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    /* Questo impedisce al contenuto di uscire dalla card */
    width: 100%;
    margin-bottom: var(--spacing-lg);
    box-sizing: border-box;
    /* Importante per includere padding nel calcolo della larghezza */
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease
    }
    .options_mail_card {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm)
    }
    .options_mail_card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary)
    }
    .options_nutify_card {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-top: 1.5rem
    }
    .options_database_card {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-top: 1.5rem
    }
    .stat_card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05)
    }
    .options_log_card {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm)
    }
    .options_about_card {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: var(--shadow-sm)
    }
    .options_notification_card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.2s ease-in-out;
}

:root[data-theme="dark"] .options_notification_card {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

:root[data-theme="dark"] .options_notification_card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

:root[data-theme="light"] .options_notification_card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

.options_notification_card .options_nutify_item {
    border-radius: 0;
    margin: 0;
}
    .table_info_card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem
    }
    .upscmd_card {
    background: var(--bg-primary);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px
    }
    .upscmd_card-body {
    padding: 20px
    }
    .options_card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1)
    }
    .card_subtitle {
    color: var(--text-secondary);
    font-size: 0.9em
    }
    #Log_tab .stat_card .stat-content {
    display: flex;
    flex-direction: column
    }
    #Log_tab .stat_card .stat-label {
    margin-bottom: 4px
    }
    .performance-chart-card {
    height: 570px !important;
    padding-bottom: 30px !important
    }

    /* Forms */
    .time-range-selector, .day-selector, .range-selector, .realtime-selector {
    padding: 0.75rem;
    border-top: 1px solid var(--border-color)
    }
    .time-input-group, .range-input-group, .day-input-group {
    /* Aggiunto day-input-group */
    display: flex;
    flex-direction: column;
    gap: 0.25rem
    }
    .time-input-group label, .range-input-group label {
    font-size: 0.7rem;
    /* Ridotto da 0.75rem */
    color: var(--text-secondary)
    }
    .time-input-group input, .range-input-group input {
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.8rem;
    /* Ridotto da 0.875rem */
    }
    .options_mail_form_grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.options_mail_form_group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.options_mail_form_group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.options_mail_form_group input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.options_mail_form_group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Checkbox container style */
.checkbox-container {
    display: flex;
    align-items: center;
    height: 100%;
    padding-top: 28px;
}

.checkbox-container input[type="checkbox"] {
    margin-right: 10px;
}

    .options_mail_form_group:nth-child(1) {
    order: 1
    }
    .options_mail_form_group:nth-child(2) {
    order: 2
    }
    .options_mail_form_group:nth-child(3) {
    order: 3
    }
    .options_mail_form_group:nth-child(4) {
    order: 4
    }
    .options_mail_form_group:nth-child(5) {
    order: 5
    }
    .options_mail_form_group:nth-child(6) {
    order: 6
    }
    .options_mail_form_group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem
    }
    .options_mail_form_group input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem
    }
    .options_mail_form_group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1)
    }
    .options_log_filter_group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem
    }
    .switch input {
    opacity: 0;
    width: 0;
    height: 0
    }
    input:checked + .slider {
    background-color: var(--primary-color)
    }
    input:checked + .slider:before {
    transform: translatex(26px)
    }
    .options_form_group {
    margin-bottom: 1.5rem
    }
    .options_form_label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary)
    }
    .options_date_inputs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem
    }
    .options_input_group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem
    }
    .options_input {
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: var(--bg-primary);
    color: var(--text-primary)
    }
    .day-btn.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color)
    }
    .email-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem
    }
    .events_filter_group select, .events_filter_group input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--bg-primary);
    color: var(--text-primary)
    }
    .api_command-actions select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem
    }
    .schedule-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1.5rem 0
    }
    .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem
    }
    .form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary)
    }
    .days-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap
    }
    .day-btn.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color)
    }
    .schedule-input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--bg-primary);
    color: var(--text-primary)
    }

    /* Buttons */
    .btn-primary {
    /* Primary button style */
    background-color: #6366f1;
    color: white;
    padding: 0.375rem 1rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    min-width: 100px;
    text-align: center
    }
    .btn-primary:hover {
    /* Button hover state */
    background-color: #4f46e5
    }
    .button-group {
    display: flex;
    align-items: center;
    gap: 0.5rem
    }
    .btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    min-width: auto
    }
    .date-range-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease
    }
    .date-range-btn:hover {
    background: var(--bg-secondary);
    color: var(--primary-color)
    }
    .btn-primary {
    padding: 0.375rem 1.5rem;
    font-size: 0.8rem;
    /* Ridotto da 0.875rem */
    }
    .options_tab_button {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 0.375rem;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap
    }
    .options_tab_button i {
    font-size: 1rem
    }
    .options_tab_button:hover {
    background: var(--primary-color);
    color: white
    }
    .options_tab_button.active {
    background: var(--primary-color);
    color: white
    }
    #reconfigureBtn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease
    }
    #reconfigureBtn:hover {
    background: var(--primary-color-dark)
    }
    .options_log_actions button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease
    }
    .options_log_actions button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color)
    }
    .day-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap
    }
    .day-btn {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease
    }
    .options_btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem
    }
    .options_btn_primary {
    background: var(--primary-color);
    color: white;
    border: none
    }
    .options_btn_secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color)
    }
    .options_btn:hover {
    transform: translatey(-1px)
    }
    .database_action_btn {
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color)
    }
    .database_action_btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color)
    }
    .database_action_btn i {
    font-size: 1rem
    }
    .button-loader {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem
    }
    .button-loader i {
    animation: spin 1s linear infinite
    }
    .event_action_btn {
    padding: 0.25rem;
    border-radius: 0.375rem;
    color: var(--text-secondary);
    transition: all 0.2s ease
    }
    .event_action_btn:hover {
    background: var(--bg-secondary);
    color: var(--primary-color)
    }
    .upscmd_btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease
    }
    .upscmd_btn-primary {
    background: var(--primary-color);
    color: white;
    border: none
    }
    .upscmd_btn-primary:hover {
    opacity: 0.9
    }
    .options_btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease
    }
    .options_btn:hover {
    background: var(--primary-color-dark)
    }
    .options_btn .btn-loader {
    display: none
    }
    .options_btn.loading .btn-text {
    display: none
    }
    .options_btn.loading .btn-loader {
    display: inline-block
    }
    .day-btn {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease
    }
    .load-more-logs button {
    background-color: #21262d;
    border: 1px solid #30363d;
    border-radius: 4px;
    padding: 4px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #c9d1d9;
    font-size: 0.8rem
    }
    .load-more-logs button:hover {
    background-color: #2ea043;
    color: white;
    border-color: #2ea043
    }

    /* Modals */
    .modal_bar {
    /* Modal container for detailed energy information */
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000
    }
    .modal_bar-content {
    /* Content area within the modal */
    position: relative;
    background-color: #fff;
    margin: 15% auto;
    /* <-- Cambiamo da 5% a 15% per abbassarlo */
    width: 80%;
    max-width: 1200px;
    height: 80vh;
    max-height: 450px;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1)
    }
    .modal_bar-title-group {
    /* Container for modal title and date */
    display: flex;
    flex-direction: column;
    gap: 0.5rem
    }
    .modal_bar-title {
    /* Modal title style */
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin: 0
    }
    .modal_bar-date {
    /* Modal date style */
    color: #6B7280;
    font-size: 1rem
    }
    .modal_bar-close {
    /* Modal close button */
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s
    }
    .modal_bar-close:hover {
    /* Hover state for close button */
    color: #4b5563
    }
    .modal_bar-chart {
    /* Container for the detailed chart in the modal */
    height: calc(100% - 60px)
    }
    .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000
    }
    .modal-content {
    position: relative;
    background: var(--bg-primary);
    margin: 10% auto;
    padding: 1.5rem;
    width: 90%;
    max-width: 600px;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md)
    }
    .modal-body {
    margin-bottom: 1.5rem
    }
    .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color)
    }
    .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color)
    }

    /* Tables */
    .tables_grid {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem
    }
    .tables_grid h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary)
    }
    .table_info_stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem
    }
    .table_info_stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem
    }
    .table_info_stat_label {
    font-size: 0.75rem;
    color: var(--text-secondary)
    }
    .table_info_stat_value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary)
    }
    .events_table_container {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    overflow: hidden
    }
    .events_table {
    width: 100%;
    border-collapse: collapse
    }
    .events_table th {
    background: var(--bg-secondary);
    padding: 1rem;
    text-align: left;
    font-weight: 500;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color)
    }
    .events_table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary)
    }
    .events_table tr:hover {
    background: var(--bg-secondary)
    }
    .api_log-details table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem
    }

    /* Alerts */
    .alert-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0.375rem;
    background-color: var(--bg-secondary);
    transition: all 0.2s ease
    }
    
    :root[data-theme="light"] .alert-item {
    border: 1px solid var(--border-color);
    }
    
    .alert-item:hover {
    transform: translatex(4px)
    }
    .alert-icon {
    width: 2rem;
    text-align: center;
    font-size: 1rem
    }
    .alert-item.critical .alert-icon {
    color: #EF4444
    }
    .alert-item.warning .alert-icon {
    color: #F59E0B
    }
    .alert-item.info .alert-icon {
    color: #3B82F6
    }
    .alert-content {
    flex: 1;
    margin: 0 0.75rem
    }
    .alert-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary)
    }
    .alert-status {
    font-size: 0.5rem
    }
    .alert-item.critical .alert-status {
    color: #EF4444
    }
    .alert-item.warning .alert-status {
    color: #F59E0B
    }
    .alert-item.info .alert-status {
    color: #3B82F6
    }
    .alert-more {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 0.5rem
    }
    .alerts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-height: 300px;
    /* Altezza massima per evitare che occupi troppo spazio */
    overflow-y: auto;
    /* Scroll verticale se necessario */
    padding-right: 0.5rem;
    /* Spazio per la scrollbar */
    }
    .alerts-grid::-webkit-scrollbar {
    width: 4px
    }
    .alerts-grid::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 2px
    }
    .alerts-grid::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px
    }

    /* Tooltips */
    .tooltip {
    visibility: hidden;
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translatex(-50%);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease
    }
    .tooltip::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translatex(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background-color: var(--bg-secondary)
    }

/* Utilities */
.gap-6 {
    /* Utility class for gap spacing */
    gap: 1.5rem;
    /* Set gap to 1.5rem */
    }
.mt-6 {
    /* Utility class for top margin */
    margin-top: 1.5rem;
    /* Top margin 1.5rem */
    }
.hidden {
    /* Utility to hide elements */
    display: none !important;
    /* Force hidden display */
    }
.text-success {
    color: #10b981
    }
.text-danger {
    color: #ef4444
    }
.date-range-dropdown.hidden {
    display: none
    }
.text-success {
    color: #10b981
    }
.text-danger {
    color: #ef4444
    }
.api_log-details:not(.hidden) {
    animation: slideDown 0.3s ease
    }
.text-center {
    text-align: center
    }

/* Media Queries */

    /* Desktop Styles */
    @media (min-width: 1200px) {
    .upscmd_commands-list {
        grid-template-columns: repeat(3, 1fr)
        }
    }
    @media (max-width: 1200px) {
    .header_top-ups_info, .header_top-status_info h3, .header_top-battery, .header_top-load, .header_top-power {
        min-width: 100px;
        padding-right: 0.5rem;
        margin-right: 0.5rem;
        font-size: 0.9rem
        }
    }

    /* Tablet Styles */
    @media (max-width: 768px) {
    /* On mobile, adjust container height */
    .combined_container {
        height: 300px
        }
    }
    @media (max-width: 768px) {
    /* On smaller screens, use a single-column layout */
    .bottom_grid {
        grid-template-columns: 1fr
        }
    }
    @media (max-width: 768px) {
    /* Responsive adjustment for title */
    .page_title h1 {
        font-size: 1.25rem
        }
    }
    @media (max-width: 768px) {
    .header_top-status_bar h3 {
        font-size: 0.875rem
        }
    .header_top-serial {
        font-size: 0.7rem
        }
    }
    @media (min-width: 768px) and (max-width: 1024px) {
    /* iPad Portrait settings */
    .stats_grid {
        grid-template-columns: repeat(2, 1fr)
        }
    .sidebar {
        width: 56px
        }
    .page {
        margin-left: 56px;
        padding: 60px 0.5rem 0.5rem
        }
    }
    @media (min-width: 1024px) and (max-height: 768px) {
    /* iPad Landscape settings */
    .combined_container {
        height: 350px !important
        }
    .stat_card .stat-value {
        font-size: 1.75rem
        }
    }
    @media (max-width: 768px) {
    /* Mobile Landscape settings */
    .widgets_container .stat_card.mini {
        flex: 1 1 calc(50% - 1rem);
        max-width: calc(50% - 1rem)
        }
    }
    @media screen and (min-width: 768px) and (max-width: 1024px) {
    /* iPad and tablet */
    .stat_card .stat-value {
        font-size: 2.5rem;
        /* Slightly smaller on tablet */
        }
    .stat_card {
        min-height: 140px;
        /* Increase height for larger text */
        }
    }
    @media (max-width: 768px) {
    .header_top-status_info {
        gap: 0.5rem
        }
    .header_top-ups_info, .header_top-status_info h3, .header_top-battery, .header_top-load, .header_top-power {
        min-width: 80px;
        padding-right: 0.25rem;
        margin-right: 0.25rem;
        font-size: 0.8rem
        }
    }

    /* Mobile Styles */
    @media (max-width: 1024px) {
    /* Responsive adjustments for smaller screens */
    .page {
        margin: 0;
        /* Keep the proportion even on mobile */
        padding: calc(60px + var(--content-padding) * 0.5) var(--content-padding) var(--content-padding);
        border: none
        }
    }
    @media (max-width: 1024px) {
    .header_top {
        left: 0
        }
    .header_top-status_container {
        padding: var(--spacing-sm)
        }
    .header_top-status_bar {
        padding: var(--spacing-sm)
        }
    .header_top-time_range {
        display: none;
        /* Hide on small screens if necessary */
        }
    }
    @media (max-width: 576px) {
    /* Mobile Portrait settings */
    .widgets_container .stat_card.mini {
        flex: 1 1 100%;
        max-width: 100%
        }
    }
    @media (max-width: 767px) {
    /* Additional mobile adjustments */
    .header_top {
        left: 0
        }
    .page {
        padding-top: 60px
        }
    }
    @media screen and (max-width: 767px) {
    /* Mobile phones */
    .stat_card .stat-value {
        font-size: 2rem;
        /* Even smaller on mobile */
        }
    .stat_card {
        min-height: 120px
        }
    }
    @media screen and (min-width: 1025px) {
    .stat_card .stat-value {
        font-size: 3rem;
        /* Keep the text large on desktop */
        }
    }


        /* Mail Configuration */
    .provider-info {
        margin: 10px 0;
        padding: 10px;
        background-color: var(--bg-secondary);
        border-radius: 4px;
    }
        
    .provider-info p {
        margin: 0;
        color: var(--text-primary);
    }
        
    .provider-info strong {
        color: var(--primary-color);
    }
        
    .provider-select {
        margin-bottom: 20px;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 20px;
    }

/* Email Configuration Summary Card Styles */
.email_config_summary {
    padding: 1rem;
}

.email_config_row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.email_config_info {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.email_provider_info, .email_address_info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.email_provider_info i, .email_address_info i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.email_config_actions {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .email_config_row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .email_config_info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .email_config_actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Provider notes container */
.provider-notes-container {
    background-color: #f8f9fa;
    border-left: 4px solid #17a2b8;
    padding: 12px 15px;
    margin: 10px 0 20px 0;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #495057;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    clear: both;
    display: none;
}

.provider-notes-container:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.provider-notes-container i {
    color: #17a2b8;
    margin-right: 8px;
    font-size: 1rem;
}
    
.options_nutify_header {
    display: flex;
    align-items: center;
    padding: 1rem;
}

.options_nutify_icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    margin-right: 1rem;
}

.options_nutify_icon i {
    font-size: 1.25rem;
}

.options_nutify_title_container {
    flex: 1;
}

.options_nutify_toggle {
    margin-left: 1rem;
}

.options_nutify_body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.options_nutify_body .options_email_select {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.options_nutify_body .options_nutify_test {
    align-self: flex-end;
}

:root[data-theme="dark"] .options_nutify_header {
    border-color: var(--dark-border-color);
}

:root[data-theme="dark"] .options_nutify_icon {
    background: var(--dark-primary-color);
}

@media (max-width: 768px) {
    .options_nutify_header {
        flex-wrap: wrap;
    }
    
    .options_nutify_title_container {
        width: 100%;
        margin: 0.5rem 0;
    }
    
    .options_nutify_toggle {
        margin-left: auto;
    }
}


        /* Mail Configuration */
    .provider-info {
        margin: 10px 0;
        padding: 10px;
        background-color: var(--bg-secondary);
        border-radius: 4px;
    }
        
    .provider-info p {
        margin: 0;
        color: var(--text-primary);
    }
        
    .provider-info strong {
        color: var(--primary-color);
    }
        
    .provider-select {
        margin-bottom: 20px;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 20px;
    }

/* Email Configuration Summary Card Styles */
.email_config_summary {
    padding: 1rem;
}

.email_config_row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.email_config_info {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.email_provider_info, .email_address_info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.email_provider_info i, .email_address_info i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.email_config_actions {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .email_config_row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .email_config_info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .email_config_actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Provider notes container */
.provider-notes-container {
    background-color: #f8f9fa;
    border-left: 4px solid #17a2b8;
    padding: 12px 15px;
    margin: 10px 0 20px 0;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #495057;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    clear: both;
    display: none;
}

.provider-notes-container:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.provider-notes-container i {
    color: #17a2b8;
    margin-right: 8px;
    font-size: 1rem;
}
    

/* Ntfy Configuration Styles */
.ntfy-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ntfy-form-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 500;
}

.ntfy-form-header select {
    border-radius: 4px;
    padding: 8px 12px;
    min-width: 180px;
    border: 1px solid var(--border-color);
    appearance: menulist;
}

.ntfy-form-description {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.ntfy-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.ntfy-form-field {
    flex: 1;
    min-width: 250px;
}

.ntfy-form-field.auth-field {
    min-width: 200px;
}

.ntfy-form-field.checkbox-field {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.ntfy-form-field-inner {
    display: flex;
    align-items: center;
}

.ntfy-form-field-inner i {
    color: var(--text-secondary);
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.ntfy-form-field-inner label {
    min-width: 80px;
}

.ntfy-form-field-inner input[type="text"],
.ntfy-form-field-inner input[type="password"],
.ntfy-form-field-inner select {
    flex-grow: 1;
    border-radius: 4px;
    padding: 8px;
    border: 1px solid var(--border-color);
}

.ntfy-form-field-inner.checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-right: 15px;
}

.ntfy-form-field-inner.checkbox input[type="checkbox"] {
    margin-right: 8px;
}

.ntfy-form-divider {
    margin: 15px 0;
    border: 0;
    border-top: 1px solid var(--border-color);
}

.ntfy-info-container {
    background-color: var(--bg-light);
    border-radius: 8px;
    padding: 16px;
    margin: 25px 0;
    display: flex;
    align-items: center;
}

.ntfy-info-container i {
    color: #17a2b8;
    margin-right: 12px;
    font-size: 1.1rem;
}

.ntfy-info-container span {
    color: var(--text-dark);
    font-size: 0.95rem;
}

.ntfy-info-container a {
    color: var(--primary-color);
    text-decoration: none;
}

.ntfy-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.ntfy-actions button i {
    margin-right: 8px;
}

/* UPS Status animations in header */
/* Make the status pulse red when on battery and discharging */
.ups-status-critical {
    color: #ef4444 !important;
    animation: status-pulse 1.5s ease-in-out infinite;
}

/* Battery charging animation - green pulsing effect */
.battery-charging {
    color: #10b981 !important;
    animation: charging-pulse 1.5s ease-in-out infinite;
}

/* Keyframes for the battery charging animation - green pulse */
@keyframes charging-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Keyframes for the status pulse animation */
@keyframes status-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); opacity: 0.9; }
}

/* Advanced NUT Configuration Editor Styles */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    border-radius: 0.25rem;
    overflow: hidden;
}

.doc-table th, .doc-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.doc-table th {
    background-color: var(--bg-secondary);
    font-weight: 600;
}

.doc-table tr:hover {
    background-color: var(--bg-secondary);
}

.file-description {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.file-description h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.file-desc {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.file-path, .file-modified {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.param-values, .param-example, .param-format {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: var(--bg-secondary);
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.param-value {
    background-color: var(--bg-tertiary);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: monospace;
}

.doc-tips {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
}

.doc-tips h4 {
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.doc-tips ul {
    padding-left: 1.5rem;
    margin-bottom: 0;
}

.doc-tips li {
    margin-bottom: 0.5rem;
}

.doc-tips code {
    background-color: var(--bg-tertiary);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: monospace;
}

.params-header {
    margin: 1.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.no-docs-message {
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
}

.alert {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    animation: fade-in 0.3s ease-in-out;
}

.alert-success {
    background-color: rgba(46, 160, 67, 0.1);
    border: 1px solid rgba(46, 160, 67, 0.2);
    color: #2ea043;
}

.alert-error {
    background-color: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.2);
    color: #f85149;
}

.alert-info {
    background-color: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.2);
    color: #58a6ff;
}

.alert-warning {
    background-color: rgba(227, 179, 65, 0.1);
    border: 1px solid rgba(227, 179, 65, 0.2);
    color: #e3b341;
}

.alert-icon {
    margin-right: 0.75rem;
}

.alert-message {
    flex: 1;
}

.close-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
}

.close-btn:hover {
    opacity: 1;
}

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


/* ADVANCED CONFIGURATION EDITOR */
/* CodeMirror Custom Theme Overrides */
.CodeMirror {
    font-family: "Monaco", "Consolas", "Courier New", monospace;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

:root[data-theme="dark"] .CodeMirror {
    border-color: var(--border-color);
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

:root[data-theme="dark"] .CodeMirror-gutters {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

:root[data-theme="dark"] .CodeMirror-linenumber {
    color: var(--text-secondary) !important;
}

:root[data-theme="dark"] .CodeMirror-cursor {
    border-left-color: var(--text-primary) !important;
}

:root[data-theme="dark"] .CodeMirror-selected {
    background-color: rgba(88, 166, 255, 0.2) !important;
}

:root[data-theme="dark"] .CodeMirror-line::selection,
:root[data-theme="dark"] .CodeMirror-line > span::selection,
:root[data-theme="dark"] .CodeMirror-line > span > span::selection {
    background-color: rgba(88, 166, 255, 0.2) !important;
}

:root[data-theme="dark"] .CodeMirror-line::-moz-selection,
:root[data-theme="dark"] .CodeMirror-line > span::-moz-selection,
:root[data-theme="dark"] .CodeMirror-line > span > span::-moz-selection {
    background-color: rgba(88, 166, 255, 0.2) !important;
}

:root[data-theme="dark"] .CodeMirror-activeline-background {
    background-color: var(--bg-primary) !important;
}

:root[data-theme="dark"] .CodeMirror-matchingbracket {
    color: #2ea043 !important;
    background-color: rgba(46, 160, 67, 0.2) !important;
}

:root[data-theme="dark"] .CodeMirror-foldmarker {
    color: var(--primary-color) !important;
    text-shadow: none !important;
}

/* Light mode overrides */
:root[data-theme="light"] .CodeMirror {
    border-color: var(--border-color);
    background-color: white !important;
    color: #333 !important;
}

:root[data-theme="light"] .CodeMirror-gutters {
    background-color: #f5f5f5 !important;
    border-color: #ddd !important;
}

:root[data-theme="light"] .CodeMirror-linenumber {
    color: #999 !important;
}

:root[data-theme="light"] .CodeMirror-cursor {
    border-left-color: #333 !important;
}

:root[data-theme="light"] .CodeMirror-selected {
    background-color: rgba(77, 151, 255, 0.1) !important;
}

:root[data-theme="light"] .CodeMirror-line::selection,
:root[data-theme="light"] .CodeMirror-line > span::selection,
:root[data-theme="light"] .CodeMirror-line > span > span::selection {
    background-color: rgba(77, 151, 255, 0.1) !important;
}

:root[data-theme="light"] .CodeMirror-line::-moz-selection,
:root[data-theme="light"] .CodeMirror-line > span::-moz-selection,
:root[data-theme="light"] .CodeMirror-line > span > span::-moz-selection {
    background-color: rgba(77, 151, 255, 0.1) !important;
}

:root[data-theme="light"] .CodeMirror-activeline-background {
    background-color: #f8f9fa !important;
}

:root[data-theme="light"] .CodeMirror-matchingbracket {
    color: #107c10 !important;
    background-color: rgba(16, 124, 16, 0.1) !important;
}

/* Configuration Editor Card specific styling */
#Configuration_Editor {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 0.5rem;
    overflow: hidden;
    padding: 1rem;
}

:root[data-theme="dark"] #Configuration_Editor {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

:root[data-theme="light"] #Configuration_Editor {
    background-color: white;
    color: #333;
}

:root[data-theme="dark"] #Configuration_Editor .CodeMirror {
    background-color: var(--bg-tertiary) !important;
}

/* Make sure editor fills the container */
#advanced_editor_container .CodeMirror {
    height: 400px;
    width: 100%;
}

/* Prevent any default themes from overriding our styles */
#advanced_editor_container .cm-s-default,
#advanced_editor_container .cm-s-monokai,
#advanced_editor_container .cm-s-solarized,
#advanced_editor_container .cm-s-material,
#advanced_editor_container .cm-s-nord {
    background-color: inherit !important;
    color: inherit !important;
}

:root[data-theme="dark"] #advanced_editor_container .cm-s-default,
:root[data-theme="dark"] #advanced_editor_container .cm-s-monokai,
:root[data-theme="dark"] #advanced_editor_container .cm-s-solarized,
:root[data-theme="dark"] #advanced_editor_container .cm-s-material,
:root[data-theme="dark"] #advanced_editor_container .cm-s-nord {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

:root[data-theme="light"] #advanced_editor_container .cm-s-default,
:root[data-theme="light"] #advanced_editor_container .cm-s-monokai,
:root[data-theme="light"] #advanced_editor_container .cm-s-solarized,
:root[data-theme="light"] #advanced_editor_container .cm-s-material,
:root[data-theme="light"] #advanced_editor_container .cm-s-nord {
    background-color: white !important;
    color: #333 !important;
}

/* Editor header styling */
.configuration-editor-header {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Syntax highlighting for dark mode */
:root[data-theme="dark"] .cm-s-default .cm-comment,
:root[data-theme="dark"] .cm-s-monokai .cm-comment,
:root[data-theme="dark"] .cm-s-solarized .cm-comment,
:root[data-theme="dark"] .cm-s-material .cm-comment,
:root[data-theme="dark"] .cm-s-nord .cm-comment {
    color: #8b949e !important;
}

:root[data-theme="dark"] .cm-s-default .cm-string,
:root[data-theme="dark"] .cm-s-monokai .cm-string,
:root[data-theme="dark"] .cm-s-solarized .cm-string,
:root[data-theme="dark"] .cm-s-material .cm-string,
:root[data-theme="dark"] .cm-s-nord .cm-string {
    color: #a5d6ff !important;
}

:root[data-theme="dark"] .cm-s-default .cm-keyword,
:root[data-theme="dark"] .cm-s-monokai .cm-keyword,
:root[data-theme="dark"] .cm-s-solarized .cm-keyword,
:root[data-theme="dark"] .cm-s-material .cm-keyword,
:root[data-theme="dark"] .cm-s-nord .cm-keyword {
    color: #ff7b72 !important;
}

:root[data-theme="dark"] .cm-s-default .cm-number,
:root[data-theme="dark"] .cm-s-monokai .cm-number,
:root[data-theme="dark"] .cm-s-solarized .cm-number,
:root[data-theme="dark"] .cm-s-material .cm-number,
:root[data-theme="dark"] .cm-s-nord .cm-number {
    color: #79c0ff !important;
}

:root[data-theme="dark"] .cm-s-default .cm-def,
:root[data-theme="dark"] .cm-s-monokai .cm-def,
:root[data-theme="dark"] .cm-s-solarized .cm-def,
:root[data-theme="dark"] .cm-s-material .cm-def,
:root[data-theme="dark"] .cm-s-nord .cm-def {
    color: #d2a8ff !important;
}

:root[data-theme="dark"] .cm-s-default .cm-variable,
:root[data-theme="dark"] .cm-s-monokai .cm-variable,
:root[data-theme="dark"] .cm-s-solarized .cm-variable,
:root[data-theme="dark"] .cm-s-material .cm-variable,
:root[data-theme="dark"] .cm-s-nord .cm-variable {
    color: #c9d1d9 !important;
}

:root[data-theme="dark"] .cm-s-default .cm-variable-2,
:root[data-theme="dark"] .cm-s-monokai .cm-variable-2,
:root[data-theme="dark"] .cm-s-solarized .cm-variable-2,
:root[data-theme="dark"] .cm-s-material .cm-variable-2,
:root[data-theme="dark"] .cm-s-nord .cm-variable-2 {
    color: #79c0ff !important;
}

:root[data-theme="dark"] .cm-s-default .cm-property,
:root[data-theme="dark"] .cm-s-monokai .cm-property,
:root[data-theme="dark"] .cm-s-solarized .cm-property,
:root[data-theme="dark"] .cm-s-material .cm-property,
:root[data-theme="dark"] .cm-s-nord .cm-property {
    color: #79c0ff !important;
}

:root[data-theme="dark"] .cm-s-default .cm-operator,
:root[data-theme="dark"] .cm-s-monokai .cm-operator,
:root[data-theme="dark"] .cm-s-solarized .cm-operator,
:root[data-theme="dark"] .cm-s-material .cm-operator,
:root[data-theme="dark"] .cm-s-nord .cm-operator {
    color: #ff7b72 !important;
}

/* Syntax highlighting for light mode */
:root[data-theme="light"] .cm-s-default .cm-comment,
:root[data-theme="light"] .cm-s-monokai .cm-comment,
:root[data-theme="light"] .cm-s-solarized .cm-comment,
:root[data-theme="light"] .cm-s-material .cm-comment,
:root[data-theme="light"] .cm-s-nord .cm-comment {
    color: #6a737d !important;
}

:root[data-theme="light"] .cm-s-default .cm-string,
:root[data-theme="light"] .cm-s-monokai .cm-string,
:root[data-theme="light"] .cm-s-solarized .cm-string,
:root[data-theme="light"] .cm-s-material .cm-string,
:root[data-theme="light"] .cm-s-nord .cm-string {
    color: #032f62 !important;
}

:root[data-theme="light"] .cm-s-default .cm-keyword,
:root[data-theme="light"] .cm-s-monokai .cm-keyword,
:root[data-theme="light"] .cm-s-solarized .cm-keyword,
:root[data-theme="light"] .cm-s-material .cm-keyword,
:root[data-theme="light"] .cm-s-nord .cm-keyword {
    color: #d73a49 !important;
}

:root[data-theme="light"] .cm-s-default .cm-number,
:root[data-theme="light"] .cm-s-monokai .cm-number,
:root[data-theme="light"] .cm-s-solarized .cm-number,
:root[data-theme="light"] .cm-s-material .cm-number,
:root[data-theme="light"] .cm-s-nord .cm-number {
    color: #005cc5 !important;
}

:root[data-theme="light"] .cm-s-default .cm-def,
:root[data-theme="light"] .cm-s-monokai .cm-def,
:root[data-theme="light"] .cm-s-solarized .cm-def,
:root[data-theme="light"] .cm-s-material .cm-def,
:root[data-theme="light"] .cm-s-nord .cm-def {
    color: #6f42c1 !important;
}

:root[data-theme="light"] .cm-s-default .cm-variable,
:root[data-theme="light"] .cm-s-monokai .cm-variable,
:root[data-theme="light"] .cm-s-solarized .cm-variable,
:root[data-theme="light"] .cm-s-material .cm-variable,
:root[data-theme="light"] .cm-s-nord .cm-variable {
    color: #24292e !important;
}

:root[data-theme="light"] .cm-s-default .cm-variable-2,
:root[data-theme="light"] .cm-s-monokai .cm-variable-2,
:root[data-theme="light"] .cm-s-solarized .cm-variable-2,
:root[data-theme="light"] .cm-s-material .cm-variable-2,
:root[data-theme="light"] .cm-s-nord .cm-variable-2 {
    color: #005cc5 !important;
}

:root[data-theme="light"] .cm-s-default .cm-property,
:root[data-theme="light"] .cm-s-monokai .cm-property,
:root[data-theme="light"] .cm-s-solarized .cm-property,
:root[data-theme="light"] .cm-s-material .cm-property,
:root[data-theme="light"] .cm-s-nord .cm-property {
    color: #005cc5 !important;
}

:root[data-theme="light"] .cm-s-default .cm-operator,
:root[data-theme="light"] .cm-s-monokai .cm-operator,
:root[data-theme="light"] .cm-s-solarized .cm-operator,
:root[data-theme="light"] .cm-s-material .cm-operator,
:root[data-theme="light"] .cm-s-nord .cm-operator {
    color: #d73a49 !important;
}

/* Advanced NUT Configuration Tab Layout */
.advanced_nut_config {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 0;
}

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

.advanced_selection label {
    min-width: 180px;
    font-weight: 500;
}

.advanced_selection select {
    flex-grow: 1;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.advanced_editor_layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    margin-top: 10px;
}

.advanced_editor_section, .advanced_docs_section {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-primary);
}

.advanced_editor_section {
    min-height: 400px;
}

.advanced_docs_section {
    max-height: 450px;
    overflow-y: auto;
}

.advanced_buttons {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 10px;
}

/* Documentation styling */
.file-description {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.file-description h3 {
    margin-top: 0;
    color: var(--text-primary);
    font-size: 18px;
}

.file-desc {
    margin: 10px 0;
    line-height: 1.4;
    color: var(--text-primary);
}

.file-path, .file-modified {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin: 5px 0;
}

.params-header {
    margin-top: 15px;
    padding-top: 5px;
    color: var(--text-primary);
    font-size: 16px;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.9em;
}

.doc-table th, .doc-table td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: left;
}

.doc-table th {
    background-color: var(--bg-secondary);
    font-weight: bold;
    color: var(--text-primary);
}

.doc-table tr:nth-child(even) {
    background-color: var(--bg-tertiary);
}

.doc-table tr:hover {
    background-color: var(--bg-secondary);
}

code {
    padding: 2px 4px;
    background-color: var(--bg-tertiary);
    border-radius: 3px;
    font-family: monospace;
    color: var(--primary-color);
}

.param-values, .param-example, .param-format {
    margin-top: 5px;
    font-size: 0.95em;
}

.param-value {
    padding: 1px 5px;
    background-color: var(--bg-tertiary);
    border-radius: 3px;
    color: var(--primary-color);
    font-family: monospace;
}

.doc-tips {
    margin-top: 20px;
    padding: 10px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    border-left: 4px solid var(--primary-color);
}

.doc-tips h4 {
    margin-top: 0;
    color: var(--text-primary);
}

.doc-tips ul {
    margin: 5px 0 0 0;
    padding-left: 20px;
}

.doc-tips li {
    margin: 5px 0;
    color: var(--text-primary);
}

.no-docs-message {
    padding: 15px;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 4px;
    text-align: center;
    font-style: italic;
}

/* Dark mode documentation overrides */
:root[data-theme="dark"] .advanced_editor_section,
:root[data-theme="dark"] .advanced_docs_section {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

:root[data-theme="dark"] .doc-table th {
    background-color: var(--bg-secondary);
}

:root[data-theme="dark"] .doc-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
}

:root[data-theme="dark"] .doc-table tr:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .param-value {
    background-color: rgba(41, 128, 185, 0.2);
    color: #58a6ff;
}

:root[data-theme="dark"] code {
    background-color: rgba(231, 76, 60, 0.1);
    color: #ff7b72;
}

:root[data-theme="dark"] .doc-tips {
    background-color: rgba(52, 152, 219, 0.1);
    border-left-color: #58a6ff;
}

:root[data-theme="dark"] .no-docs-message {
    background-color: var(--bg-secondary);
}

/* Alert styling */
.options_alert_container {
    margin-bottom: 15px;
}

.alert {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease-in-out;
}

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

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-icon {
    font-size: 1.2em;
}

.alert-message {
    flex-grow: 1;
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.close-btn:hover {
    opacity: 1;
}

/* Dark mode alert styling */
:root[data-theme="dark"] .alert-success {
    background-color: rgba(21, 87, 36, 0.2);
    color: #4cd964;
    border-color: rgba(21, 87, 36, 0.4);
}

:root[data-theme="dark"] .alert-error {
    background-color: rgba(114, 28, 36, 0.2);
    color: #ff3b30;
    border-color: rgba(114, 28, 36, 0.4);
}

:root[data-theme="dark"] .alert-info {
    background-color: rgba(12, 84, 96, 0.2);
    color: #5ac8fa;
    border-color: rgba(12, 84, 96, 0.4);
}

:root[data-theme="dark"] .alert-warning {
    background-color: rgba(133, 100, 4, 0.2);
    color: #ffcc00;
    border-color: rgba(133, 100, 4, 0.4);
}

/* Responsive layout for advanced tab */
@media (max-width: 768px) {
    .advanced_editor_layout {
        grid-template-columns: 1fr;
    }
    
    .advanced_selection {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .advanced_selection label,
    .advanced_selection select {
        width: 100%;
    }
}

/* Collapsible Card Styles */
.collapse-card {
    margin-bottom: 1rem;
}

.collapse-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapse-header-content {
    flex: 1;
}

.collapse-toggle {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.collapse-card.expanded .collapse-toggle i {
    transform: rotate(180deg);
}

.collapse-content {
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    overflow: hidden;
    max-height: 1000px;
    opacity: 1;
}

.collapse-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
}
/* Notification positioned at bottom right for important status messages */
/* Notification styling is now handled by the injected CSS in notifications.js */
/* Notification styling is now handled by the injected CSS in notifications.js */

/* Add animation for editable fields */
@keyframes highlight-editable {
    0% { background-color: transparent; }
    50% { background-color: rgba(52, 152, 219, 0.2); }
    100% { background-color: transparent; }
}

.editable-field {
    animation: highlight-editable 2s ease;
    position: relative;
    border-radius: 4px;
    padding: 2px 4px;
}

.editable-field::after {
    content: "(click to edit)";
    font-size: 0.8em;
    color: #3498db;
    margin-left: 4px;
    opacity: 0;
    animation: fade-in-out 2s ease;
}

@keyframes fade-in-out {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Improved provider notes styling */
.provider-note {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 5px;
    border-left: 3px solid #4e73df;
}

.provider-note i.fa-sliders-h {
    color: #3498db;
}

.provider-note i.fa-info-circle {
    color: #4e73df;
}

/* Restart Countdown Timer Styles */
.countdown-container {
    text-align: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 280px;
    max-width: 90vw;
    border: 1px solid var(--border-color);
}

.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999;
    backdrop-filter: blur(3px);
}

.countdown-circle-container {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto;
}

.countdown-circle {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    width: 100%;
    height: 100%;
}

.countdown-circle-bg {
    fill: none;
    stroke: #eee;
    stroke-width: 3;
}

.countdown-circle-progress {
    fill: none;
    stroke: #4CAF50;
    stroke-width: 3;
    transition: stroke-dashoffset 1s linear;
}

.countdown-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    font-weight: bold;
    color: var(--text-primary);
}

.countdown-text {
    margin-top: 20px;
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Light theme adjustments for countdown timer */
:root[data-theme="light"] .countdown-container {
    background-color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

:root[data-theme="light"] .countdown-circle-bg {
    stroke: #e0e0e0;
}

:root[data-theme="light"] .countdown-number {
    color: #2c3e50;
}

:root[data-theme="light"] .countdown-text {
    color: #2c3e50;
}

/* Dark theme adjustments for countdown timer */
:root[data-theme="dark"] .countdown-circle-bg {
    stroke: #333;
}

:root[data-theme="dark"] .countdown-container {
    background-color: var(--bg-secondary);
}

:root[data-theme="dark"] .countdown-number {
    color: var(--text-primary);
}

:root[data-theme="dark"] .countdown-text {
    color: var(--text-primary);
}

/* User Permissions Modal Styles */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.permission-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.permission-item:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
}

.permission-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin: 0;
}

.permission-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.permission-label i {
    color: var(--primary-color);
    font-size: 1.25rem;
    width: 20px;
    text-align: center;
}

.permission-label span {
    font-weight: 500;
    flex: 1;
}

.clickable-username {
    cursor: pointer;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

.clickable-username:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.non-clickable-username {
    color: var(--text-secondary);
    font-weight: bold;
    opacity: 0.7;
    cursor: default;
}

/* Dark theme adjustments for permission modal */
:root[data-theme="dark"] .permission-item {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

:root[data-theme="dark"] .permission-item:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

:root[data-theme="dark"] .permission-label {
    color: var(--text-primary);
}

:root[data-theme="dark"] .permission-label i {
    color: var(--primary-color);
}

:root[data-theme="dark"] .clickable-username {
    color: var(--primary-color);
}

:root[data-theme="dark"] .clickable-username:hover {
    color: #79c0ff;
}

:root[data-theme="dark"] .non-clickable-username {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Light theme adjustments for permission modal */
:root[data-theme="light"] .permission-item {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

:root[data-theme="light"] .permission-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

:root[data-theme="light"] .permission-label {
    color: var(--text-primary);
}

:root[data-theme="light"] .permission-label i {
    color: var(--primary-color);
}

:root[data-theme="light"] .clickable-username {
    color: var(--primary-color);
}

:root[data-theme="light"] .clickable-username:hover {
    color: #1d4ed8;
}

:root[data-theme="light"] .non-clickable-username {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Configure Settings Button */
.configure-settings-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    margin-left: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.configure-settings-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.configure-settings-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Options Tabs Grid */
.options-tabs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.options-tab-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.options-tab-item:hover {
    background: var(--hover-bg);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.options-tab-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 500;
}

.options-tab-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.options-tab-label i {
    font-size: 1.2em;
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.options-tab-label span {
    flex: 1;
    font-size: 0.95em;
}

/* Dark theme for options tabs */
:root[data-theme="dark"] .options-tab-item {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

:root[data-theme="dark"] .options-tab-item:hover {
    background: var(--bg-tertiary);
}

:root[data-theme="dark"] .options-tab-label {
    color: var(--text-primary);
}

:root[data-theme="dark"] .options-tab-label i {
    color: var(--primary-color);
}

/* Permission item with settings button */
.permission-item:has(.configure-settings-btn) {
    position: relative;
}

.permission-item .permission-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.permission-item .permission-label > span {
    flex: 1;
}

/* Disabled state for settings permission */
.permission-checkbox:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.permission-checkbox:disabled + i,
.permission-checkbox:disabled ~ span {
    opacity: 0.5;
}

/* Role Badge Styles */
.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.administrator-role {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.user-role {
    background-color: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

/* Dark theme role badges */
:root[data-theme="dark"] .administrator-role {
    background-color: rgba(248, 81, 73, 0.2);
    color: #ff6b6b;
    border-color: rgba(248, 81, 73, 0.3);
}

:root[data-theme="dark"] .user-role {
    background-color: rgba(139, 148, 158, 0.2);
    color: #8b949e;
    border-color: rgba(139, 148, 158, 0.3);
}

/* Users table styles */
.users-table-wrapper {
    overflow-x: auto;
}

.users-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.users-table-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.users-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    overflow: hidden;
}

.users-table th,
.users-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.users-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.users-table td {
    color: var(--text-primary);
    font-size: 0.875rem;
}

.users-table tr:hover {
    background: var(--bg-tertiary);
}

.users-table .actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.options_btn_small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.options_btn_danger {
    background-color: #dc2626;
    color: white;
    border: none;
}

.options_btn_danger:hover {
    background-color: #b91c1c;
}

/* Modal form styles */
.modal-form-group {
    margin-bottom: 1rem;
}

.modal-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-form-group input,
.modal-form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.modal-form-group input:focus,
.modal-form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Connection Alarm Modal */
.connection-alarm-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.connection-alarm-modal {
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 6px 10px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 500px;
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.connection-alarm-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.connection-alarm-header i {
    font-size: 1.5rem;
}

.connection-alarm-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
}

.connection-alarm-body {
    padding: 1.5rem;
}

.connection-alarm-status {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.connection-alarm-status i {
    font-size: 1.25rem;
    color: #ef4444;
    margin-top: 0.25rem;
}

.connection-alarm-message {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.connection-alarm-recovery {
    background-color: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.connection-alarm-spinner {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.connection-alarm-recovery-text {
    font-weight: 500;
    color: var(--text-primary);
}

.connection-alarm-attempt {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.connection-alarm-tips {
    background-color: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 0.375rem;
}

.connection-alarm-tips h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.connection-alarm-tips ul {
    margin: 0;
    padding-left: 1.5rem;
}

.connection-alarm-tips li {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.connection-alarm-tips li:last-child {
    margin-bottom: 0;
}

#connection-alarm-close {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
}

#connection-alarm-close:hover {
    background-color: #1d4ed8;
}

/* Dark theme adjustments */
:root[data-theme="dark"] .connection-alarm-modal {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35), 0 6px 10px rgba(0, 0, 0, 0.25);
}

:root[data-theme="dark"] .connection-alarm-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

:root[data-theme="dark"] .connection-alarm-recovery,
:root[data-theme="dark"] .connection-alarm-tips {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

/* Animation for spinner */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* System stats in header */
.header_top-system_stats {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-left: 10px;
    font-size: 0.75rem;
    line-height: 1.2;
}

.header_top-cpu, .header_top-ram {
    display: inline-flex;
    align-items: center;
    margin-right: 15px;
    white-space: nowrap;
}

.header_top-cpu i, .header_top-ram i {
    margin-right: 4px;
    font-size: 0.75rem;
}

/* Make dropdown open downward instead of upward */
.dropdown-below {
    position: relative !important;
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 28px;
}

.toggle-switch .toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: .4s;
    border-radius: 34px;
    overflow: hidden;
}

.toggle-switch .toggle-label .toggle-inner {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 3px;
    background-color: var(--primary-color);
    opacity: 0.3;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch .toggle-switch-text-on,
.toggle-switch .toggle-switch-text-off {
    position: absolute;
    font-size: 10px;
    font-weight: bold;
    top: 6px;
    transition: .4s;
}

.toggle-switch .toggle-switch-text-on {
    right: 8px;
    color: transparent;
}

.toggle-switch .toggle-switch-text-off {
    left: 8px;
    color: var(--text-primary);
}

.toggle-switch .toggle-input:checked + .toggle-label {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.toggle-switch .toggle-input:checked + .toggle-label .toggle-inner {
    transform: translateX(30px);
    opacity: 1;
    background-color: white;
}

.toggle-switch .toggle-input:checked + .toggle-label .toggle-switch-text-on {
    color: white;
}

.toggle-switch .toggle-input:checked + .toggle-label .toggle-switch-text-off {
    color: transparent;
}

/* Dark theme toggle switch */
:root[data-theme="dark"] .toggle-switch .toggle-label {
    background-color: #333;
    border-color: #444;
}

:root[data-theme="dark"] .toggle-switch .toggle-label .toggle-inner {
    background-color: #666;
}

:root[data-theme="dark"] .toggle-switch .toggle-input:checked + .toggle-label {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

:root[data-theme="dark"] .toggle-switch .toggle-input:checked + .toggle-label .toggle-inner {
    background-color: white;
}
                
:root[data-theme="light"] .btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none
}

:root[data-theme="light"] .options_btn {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem
}

:root[data-theme="light"] .options_btn_secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color)
}

:root[data-theme="light"] .date-range-btn {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color)
}

:root[data-theme="light"] .database_action_btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color)
}

:root[data-theme="light"] .options_btn:hover {
    opacity: 0.9;
    transform: translateY(-1px)
}

:root[data-theme="light"] .btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px)
}

:root[data-theme="light"] .database_action_btn:hover {
    background-color: var(--border-color);
    color: var(--text-primary)
}

/* Radio Group for Configuration Method */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.radio-option input[type="radio"] {
    margin: 0;
}

.radio-option label {
    font-weight: normal;
    margin: 0;
}

/* Scan Results */
.scan-results {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 10px;
    margin-bottom: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.scan-results-title {
    background-color: #f5f5f5;
    padding: 8px 12px;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
}

.scan-device {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.scan-device:last-child {
    border-bottom: none;
}

.scan-device:hover {
    background-color: #f9f9f9;
}

.scan-device.selected {
    background-color: #e8f4fc;
    border-left: 3px solid #007bff;
}

.scan-device-name {
    font-weight: bold;
    margin-bottom: 3px;
}

.scan-device-details {
    font-size: 0.9em;
    color: #666;
}

.scan-loading {
    padding: 15px;
    text-align: center;
    color: #666;
}

.no-devices-found {
    padding: 15px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.role-permissions-overview {
    max-height: 600px;
    overflow-y: auto;
}

.role-section {
    margin-bottom: 2rem;
}

.role-section:last-child {
    margin-bottom: 0;
}

.role-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.role-title i {
    font-size: 1.2rem;
}

.permissions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.permission-overview-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.permission-overview-item.allowed {
    border-color: var(--success-color);
    background: rgba(34, 197, 94, 0.1);
}

.permission-overview-item.denied {
    border-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

.permission-overview-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.permission-overview-item.allowed .permission-overview-icon {
    color: var(--success-color);
}

.permission-overview-item.denied .permission-overview-icon {
    color: var(--danger-color);
}

.permission-overview-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.permission-overview-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.permission-overview-content span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

:root[data-theme="dark"] .permission-overview-item {
    background: var(--bg-tertiary);
}

:root[data-theme="dark"] .permission-overview-item.allowed {
    background: rgba(34, 197, 94, 0.15);
}

:root[data-theme="dark"] .permission-overview-item.denied {
    background: rgba(239, 68, 68, 0.15);
}


