:root {
    --bg-dark: #050505;
    --bg-deep: #030305;   /* Fond profond identique à la page de connexion (superadmin) */
    --bg-card: rgba(30, 30, 35, 0.4);
    --accent: #dc2626;
    --accent-hover: #991b1b;
    --accent-glow: rgba(239, 68, 68, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --border: rgba(255, 255, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-strong: rgba(255, 255, 255, 0.05);
    --glass-blur: blur(16px);
}


/* PREMIUM CUSTOM TIME PICKER RESTORED */
.time-picker-container {
    position: relative;
    display: inline-block;
}

.time-picker-header {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    padding: 6px 12px !important;
    color: white !important;
    cursor: pointer !important;
    min-width: 55px !important;
    text-align: center !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    user-select: none !important;
}

.time-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: #121212 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    width: 80px !important;
    max-height: 250px !important;
    overflow-y: auto !important;
    z-index: 100000 !important;
    display: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6) !important;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

.time-picker-dropdown.show {
    display: block !important;
    animation: fadeInDown 0.2s ease-out !important;
}

.time-picker-option {
    padding: 10px 8px !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.1s !important;
    font-size: 1rem !important;
    color: rgba(255,255,255,0.7) !important;
}

.time-picker-option:hover {
    background: rgba(220, 38, 38, 0.2) !important;
    color: white !important;
}

.time-picker-option.selected {
    background: var(--accent) !important;
    color: white !important;
    font-weight: bold !important;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateX(-50%) translateY(0); }
    to { opacity: 1; transform: translateX(-50%) translateY(8px); }
}

.modal-content.delete-confirm .modal-header {
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
}

.danger-icon {
    width: 60px !important;
    height: 60px !important;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    padding: 1rem;
    border-radius: 50%;
    margin: 0 auto;
}

.modal-body p {
    margin-bottom: 0.5rem;
}

.warning-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Custom Confirm Modal Styling */
.modal-content.delete-confirm {
    max-width: 380px !important;
    text-align: center !important;
    padding: 2.5rem !important;
    border: 1px solid rgba(220, 38, 38, 0.3) !important;
    background: rgba(10, 10, 12, 0.98) !important;
    -webkit-backdrop-filter: blur(40px) !important;
    backdrop-filter: blur(40px) !important;
    border-radius: 32px !important;
}

.icon-circle-danger {
    width: 64px;
    height: 64px;
    background: rgba(220, 38, 38, 0.1);
    border: 2px solid rgba(220, 38, 38, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: #ef4444;
}

.icon-circle-danger i {
    width: 30px;
    height: 30px;
}


.btn-primary.danger:hover {
    background: #b91c1c;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html {
    /* Fond dégradé rouge/noir identique à la page de connexion (login.html) */
    background:
        radial-gradient(circle at 15% 15%, rgba(239, 68, 68, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(239, 68, 68, 0.08) 0%, transparent 40%),
        var(--bg-deep);
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
}

body {
    color: var(--text-primary);
    min-height: 100vh;
    background: transparent;
}

.hidden {
    display: none !important;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.header-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

#settings-btn {
    padding: 0.6rem;
    border-radius: 10px;
    margin-bottom: 2px;
}

#settings-btn i {
    width: 20px;
    height: 20px;
}

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

.logo-container {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#app-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(220, 38, 38, 0.4));
    z-index: 2;
    border-radius: 8px; /* Arrondi sur l'image elle-même */
    background: white; /* Fond blanc interne */
}

.logo-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--accent);
    filter: blur(15px);
    opacity: 0.2;
    border-radius: 50%;
    z-index: 1;
    animation: pulseLogo 4s infinite ease-in-out;
}

@keyframes pulseLogo {
    0%, 100% { transform: scale(1); opacity: 0.15; }
    50% { transform: scale(1.3); opacity: 0.3; }
}

.logo-container.has-scheduled-macros .logo-glow {
    background: var(--accent) !important;
    animation: pulseSubtleRed 4s infinite ease-in-out !important;
    opacity: 0.2;
}

@keyframes pulseSubtleRed {
    0%, 100% { transform: scale(1); opacity: 0.15; filter: blur(12px); }
    50% { transform: scale(1.15); opacity: 0.3; filter: blur(18px); }
}

/* Device Macro Indicator - The Zenith of Subtle Pulse */
.macro-status-indicator.active-scheduled {
    animation: pulseVioletIndicator 3.5s infinite ease-in-out !important;
    background: rgba(168, 85, 247, 0.06) !important;
    border-color: rgba(168, 85, 247, 0.3) !important;
}

.macro-status-indicator.active-scheduled i,
.macro-status-indicator.active-scheduled .count-badge {
    color: #a855f7 !important;
}

@keyframes pulseVioletIndicator {
    0%, 100% { background: rgba(168, 85, 247, 0.05); transform: scale(1); box-shadow: 0 0 5px rgba(168, 85, 247, 0.02); }
    50% { background: rgba(168, 85, 247, 0.18); transform: scale(1.03); box-shadow: 0 0 12px rgba(168, 85, 247, 0.15); }
}

.brand-text h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1;
}

.brand-text span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    margin-top: 4px;
    font-weight: 600;
}


.btn-primary {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
}

/* Stats Section */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-card);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-card .label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.value.danger,
.label.danger {
    color: var(--danger);
    font-weight: 700;
}

/* Device Grid */
.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
    gap: 2rem;
    padding-bottom: 10rem;
    align-items: start; /* Allows cards to have different heights */
}

.device-card {
    background: var(--bg-card);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 520px; /* Assure une hauteur uniforme */
}

.device-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 12px 30px rgba(220, 38, 38, 0.15);
}

/* Device Disabled Style */
.device-card.disabled-style {
    opacity: 0.8;
    filter: grayscale(0.4);
}

.device-card.disabled-style .device-controls,
.device-card.disabled-style .advanced-section .adv-actions,
.device-card.disabled-style .device-header,
.device-card.disabled-style .device-details {
    pointer-events: none;
    opacity: 0.4;
}

/* Keep ONLY essential fix/delete actions bright and interactive */
.device-card.disabled-style .card-actions .delete-btn,
.device-card.disabled-style .card-actions .icon-btn, 
.device-card.disabled-style .error-indicator,
.device-card.disabled-style .inline-edit-panel {
    pointer-events: auto !important;
    filter: none !important;
    opacity: 1 !important;
}

.device-card.disabled-style .error-indicator {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
    color: var(--danger);
}

.device-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.1), transparent 70%);
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.device-info h3 {
    font-size: 1.25rem;
}

.hostname-in-title {
    font-size: 0.75em;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 6px;
    opacity: 0.8;
}

.name-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0.6;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
    opacity: 1;
}

.icon-btn-large {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    cursor: pointer;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.icon-btn-large:hover {
    background: rgba(220, 38, 38, 0.1);
    border-color: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 38, 38, 0.2);
}

.icon-btn-large i {
    width: 20px;
    height: 20px;
}

.icon-btn i {
    width: 14px;
    height: 14px;
}

.edit-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--accent);
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    outline: none;
    width: 100%;
    max-width: 200px;
}

.edit-ip-input, .edit-mac-input {
    font-size: 0.85rem;
    font-weight: 400;
    padding: 1px 4px;
    max-width: 150px;
    font-family: 'Monaco', 'Consolas', monospace;
}

.edit-inline-btn {
    opacity: 0.4;
    padding: 2px;
}

.edit-inline-btn i {
    width: 12px;
    height: 12px;
}

.animate-in {
    animation: slideFadeIn 0.3s ease-out;
}

@keyframes slideFadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.device-type {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
    color: var(--text-secondary);
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background: rgba(0, 0, 0, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-Online .status-dot {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.status-Offline .status-dot {
    background: var(--text-secondary);
}

.status-Error .status-dot {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
}

.device-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.detail-item .val {
    font-size: 0.9rem;
    font-family: 'Monaco', 'Consolas', monospace;
}

.device-controls {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.control-btn {
    flex: 1;
    padding: 0.6rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.control-btn.on:hover {
    color: var(--success);
    border-color: var(--success);
}

.control-btn.off:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* Bouton Redémarrer sorti des Actions Avancées (PC / Projecteur) */
.control-btn.restart.full-width {
    width: 100%;
    margin-top: 0.75rem;
}

.control-btn.restart:hover {
    color: var(--warning);
    border-color: var(--warning);
}

.advanced-section {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delete-btn {
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.delete-btn:hover {
    color: var(--danger);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #151518;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    width: 95%;
    max-width: 450px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: white;
    outline: none;
}

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

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .value {
        font-size: 1.5rem;
    }

    .device-grid {
        gap: 1rem;
        padding-bottom: 5rem;
    }

    .device-card {
        padding: 1.25rem;
    }

    .device-details {
        grid-template-columns: 1fr;
    }

    .system-status-bar, .discovery-bar, .macro-bar {
        margin: 1rem !important;
        padding: 1rem !important;
    }

    .discovery-content {
        gap: 1rem !important;
    }
}

@media (max-width: 480px) {
    .stats-overview {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .notification-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .notification {
        width: 100%;
        min-width: 0;
    }
}

/* Password Edit Panel */
.inline-edit-panel {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    animation: slideFadeIn 0.3s ease-out;
}

.inline-edit-panel label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.inline-edit-panel .input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.inline-edit-panel input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: white;
    outline: none;
    font-size: 0.875rem;
}

.inline-edit-panel input:focus {
    border-color: var(--accent);
}

.inline-edit-panel .save-btn {
    background: var(--accent);
    color: white;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.inline-edit-panel .save-btn i {
    width: 14px;
    height: 14px;
}

.inline-edit-panel .save-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.inline-edit-panel .cancel-btn {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.inline-edit-panel .cancel-btn i {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

.inline-edit-panel .cancel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.card-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Error Indicators */
.error-indicator {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    color: #fca5a5;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-indicator i {
    width: 14px;
    height: 14px;
    color: var(--danger);
}

.error-indicator.clickable-error {
    cursor: pointer;
    transition: all 0.2s;
}

.error-indicator.clickable-error:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

.fix-hint {
    margin-left: auto;
    font-size: 0.7rem;
    opacity: 0.8;
    font-style: italic;
    color: var(--accent);
}

.hw-name-banner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid var(--accent);
    padding: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 24px 24px 0 0;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.notification {
    pointer-events: auto;
    background: rgba(15, 15, 20, 0.85);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: calc(100vw - 4rem);
    min-width: 280px;
    max-width: 450px;
    animation: toastIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: all 0.3s ease;
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.error {
    border-left: 4px solid var(--danger);
}

.notification i {
    width: 20px;
    height: 20px;
}

.notification.success i { color: var(--success); }
.notification.error i { color: var(--danger); }

.notification.fade-out {
    opacity: 0;
    transform: translateX(50px) scale(0.9);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Onboarding & Settings Enhancements */

.icon-btn-large {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn-large:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
    border-color: var(--accent);
}

/* Settings Modal Specifics */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.mini-downloads {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.btn-mini {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: white;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-mini:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.btn-mini i {
    width: 14px;
    height: 14px;
}

.btn-mini-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid var(--accent);
    color: white;
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.btn-mini-inline:hover {
    background: var(--accent);
    transform: translateY(-1px);
}

.btn-mini-inline i {
    width: 12px;
    height: 12px;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

/* Mode Selection Styles */
.mode-selection {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.mode-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--accent);
}

.mode-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mode-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.mode-text small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.mode-option:has(input:checked) {
    background: rgba(220, 38, 38, 0.05);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.1);
}

.port-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.input-subgroup {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.input-subgroup label {
    font-size: 0.7rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.border-top { border-top: 1px solid var(--border); }
.pt-1 { padding-top: 1rem; }

/* Switch Component */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-top: 0.5rem;
}

.scan-info-banner { background: rgba(0, 0, 0, 0.2); border-radius: 8px; padding: 0.75rem; margin-top: 0.75rem; border: 1px dashed var(--border); display: flex; flex-direction: column; gap: 0.4rem; }
.scan-detail { display: flex; justify-content: space-between; font-size: 0.8rem; }
.scan-detail .label { color: var(--text-secondary); }
.scan-detail .val { font-weight: 600; color: var(--accent); }

.discovery-bar { 
    background: rgba(255, 255, 255, 0.02); 
    border-top: 1px solid rgba(255, 255, 255, 0.05); 
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); 
    padding: 12px 0; 
    margin-bottom: 2.5rem; 
    position: relative; 
    overflow: hidden; 
    width: 100%; 
}

.scan-progress-container { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 2px; 
    background: rgba(255, 255, 255, 0.03); 
}

.scan-progress-line { 
    height: 100%; 
    width: 0%; 
    background: linear-gradient(90deg, var(--accent), #ff4d4d, var(--accent)); 
    background-size: 200% 100%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.4);
}

.scan-progress-line.active {
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.6);
    animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.spin { animation: spin 1s linear infinite; }
#scan-icon-wrapper.spinning svg { animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Action Bar & Expandable Panel */
.expand-toggle-container {
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
}

.card-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.main-actions {
    display: flex;
    gap: 0.5rem;
}

.expand-toggle-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.expand-toggle-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--accent);
}

.device-card.expanded .expand-toggle-btn {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.expand-toggle-btn i {
    width: 14px;
    height: 14px;
    transition: transform 0.3s;
}

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

/* Expandable Panel Animation */
.expandable-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
    opacity: 0;
}

.device-card.expanded .expandable-panel {
    max-height: 600px;
    opacity: 1;
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px dashed var(--border);
    border-bottom: 1px dashed var(--border);
}

/* Advanced Grid */
.advanced-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

.adv-action-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
}

.adv-action-card.full-width {
    grid-column: span 2;
    flex-direction: row;
    gap: 0.8rem;
    padding: 0.8rem;
}

.adv-action-card i {
    width: 20px;
    height: 20px;
}

.adv-action-card span {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-align: center;
}

.adv-action-card:hover:not(:disabled) {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.adv-action-card:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Specific Action Colors (Customized) */
.adv-action-card.restart:hover {
    border-color: #ff4757; /* Brighter Coral Red */
    color: #ff4757;
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.15);
    background: rgba(255, 71, 87, 0.05);
}

.adv-action-card.hdmi:hover {
    border-color: #a29bfe; /* Indigo / Lavender */
    color: #a29bfe;
    box-shadow: 0 5px 15px rgba(162, 155, 254, 0.15);
    background: rgba(162, 155, 254, 0.05);
}

.adv-action-card.warning:hover {
    border-color: #ffa502; /* Bright Orange */
    color: #ffa502;
    box-shadow: 0 5px 15px rgba(255, 165, 2, 0.15);
    background: rgba(255, 165, 2, 0.05);
}

.adv-action-card.success:hover {
    border-color: #2ed573; /* Emerald Green (Different from ON) */
    color: #2ed573;
    box-shadow: 0 5px 15px rgba(46, 213, 115, 0.15);
    background: rgba(46, 213, 115, 0.05);
}

/* Footer & Mute Indicators V2 */
.footer-mute-indicators {
    display: flex;
    gap: 0.4rem;
}

.mute-indicator-v2 {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.mute-indicator-v2 i {
    width: 16px;
    height: 16px;
}

.mute-indicator-v2.success {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.mute-indicator-v2.danger {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
}


/* Active Status & Source Indicators */
.adv-action-card.active-source {
    border-color: #a29bfe;
    background: rgba(162, 155, 254, 0.1);
    position: relative;
}

.adv-action-card.active-status {
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.05);
}

.active-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    background: #a29bfe;
    border-radius: 50%;
    box-shadow: 0 0 8px #a29bfe;
}


/* Macro Bar Styles */
.macro-bar {
    margin: 1rem 2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem;
}

.macro-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.macro-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--accent);
}

.btn-create-macro {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.btn-create-macro:hover {
    background: var(--accent);
    color: white;
}

.macros-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.macro-item-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: white;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.macro-item-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.macro-item-btn.executing {
    animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* Macro Builder */
.macro-actions-builder {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.macro-actions-list {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.macro-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
}

.macro-action-add-row {
    display: flex;
    gap: 0.5rem;
}

.macro-action-add-row select {
    flex: 1;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    color: white;
    padding: 8px;
    border-radius: 8px;
}

.btn-add-action {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    cursor: pointer;
}


.btn-mini-danger {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.2);
    color: #ff4757;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.delete-mini-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.macro-item-container:hover .delete-mini-btn {
    opacity: 1;
}

.delete-mini-btn i {
    width: 10px;
    height: 10px;
}


/* Card Macros Section */
.card-macros-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card-macros-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.card-macros-section .section-header i {
    width: 12px;
    height: 12px;
    color: var(--accent);
}

.card-macros-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.macro-pill {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.1);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.macro-pill:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-1px);
}

.btn-mini-add {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
}

.btn-mini-add:hover {
    color: var(--accent);
}


/* System Status Bar */
.system-status-bar {
    margin: 1rem 2rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.status-group {
    display: flex;
    gap: 1.5rem;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.status-pill .label {
    color: var(--text-secondary);
    font-weight: 400;
}

.status-pill .val {
    font-weight: 700;
}

.status-pill i {
    width: 14px;
    height: 14px;
}

/* Status Variations */
.status-pill.private {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--accent);
}

.status-pill.public {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: #8b5cf6; /* Violet */
}

.status-pill.manual {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.status-pill.auto {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
}


/* Macro Scheduler Styles */
.days-selector {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.day-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.day-opt input {
    margin: 0;
}

.day-opt span {
    font-weight: 600;
}

.time-selector input[type="time"] {
 width: 100%;
 background: rgba(0, 0, 0, 0.2);
 border: 1px solid var(--border);
 color: white;
 padding: 8px;
 border-radius: 8px;
 margin-top: 0.5rem;
}

.mt-2 { margin-top: 1rem; }
.pt-1 { padding-top: 0.5rem; }

/* Separation for ON/OFF */
.device-controls {
 border-top: 1px solid rgba(255, 255, 255, 0.03);
 padding-top: 1.5rem;
 margin-top: 2rem;
}


/* Blinking Scan Text */
.blinking-text {
    color: var(--success);
    font-weight: bold;
    animation: blinkGreen 1.5s infinite;
    font-size: 0.9rem;
    margin-left: 10px;
}

@keyframes blinkGreen {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Ripple Radar Effect */
.active-scan-info {
    display: flex;
    align-items: center;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 4px 15px;
    border-radius: 50px;
    margin-right: 1.5rem;
}

.ripple-container {
    position: relative;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ripple {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: rippleEffect 2s infinite ease-out;
}

.ripple:nth-child(2) { animation-delay: 0.6s; }
.ripple:nth-child(3) { animation-delay: 1.2s; }

@keyframes rippleEffect {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(4); opacity: 0; }
}

/* Separation of card sections */
.card-section {
    padding: 1.25rem;
    margin-bottom: 0.5rem;
}

.macros-section {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.controls-section {
    background: rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.device-controls {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}


/* Macro Status Indicator */
/* Removed duplicate indicator style */

/* --- MACRO INDICATORS & CARD FOOTER (RESTORED & CLEANED) --- */
.macro-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    font-size: 0.75rem;
    font-weight: 600;
}

.macro-indicator i {
    width: 14px;
    height: 14px;
    color: inherit;
    transition: transform 0.3s ease, color 0.3s ease;
}

.macro-indicator:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.3);
    color: #a855f7 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15);
}

.macro-indicator:hover i {
    transform: rotate(-15deg) scale(1.1);
}

.macro-indicator.active {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.4);
    color: #a855f7 !important;
}

.macro-indicator.active i {
    filter: drop-shadow(0 0 5px rgba(168, 85, 247, 0.6));
}

.macro-indicator span {
    margin-left: 4px;
}

/* Clean Footer Bar */
.card-action-bar {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.3) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.main-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.delete-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #f87171;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.btn-permanent-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

/* Premium Table styling for Task Manager */
.premium-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(15, 23, 42, 0.4);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.premium-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease;
}

.premium-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.premium-table td {
    padding: 10px 16px;
    color: var(--text-primary);
    vertical-align: middle;
}

/* Liste des processus : barre de défilement visible, discrète sur fond sombre */
.task-list-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.task-list-scroll::-webkit-scrollbar {
    width: 8px;
}
.task-list-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.task-list-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.task-list-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.btn-task-kill {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #f87171;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.btn-task-kill:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
}

/* Spinner rotation animation for Refresh Button */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

.macros-section {
    display: none;
}

/* Macro Management in Modal */
.macro-pill-manage {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
    color: #a78bfa;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.macro-pill-manage button {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: 4px;
    transition: background 0.2s;
}

.macro-pill-manage button:hover {
    background: rgba(239, 68, 68, 0.1);
}

.macro-pill-manage i {
    width: 14px;
    height: 14px;
}



/* Integrated Macro Clock Indicator (FINAL FIXED ANIMATION) */
/* Consolidated Indicator Style */
.macro-status-indicator {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
}

.macro-status-indicator:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.4);
    color: #a855f7 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(168, 85, 247, 0.3);
}

.macro-status-indicator.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(1);
}

/* Only rotate if NOT scheduled (idle state) */
.macro-status-indicator:not(.active-scheduled):hover i,
.macro-status-indicator:not(.active-scheduled):hover svg {
    transform: rotate(360deg);
    color: #a855f7 !important;
}

.macro-status-indicator i,
.macro-status-indicator svg {
    width: 15px;
    height: 15px;
    filter: drop-shadow(0 0 2px rgba(168, 85, 247, 0.3));
    transition: transform 0.6s ease-in-out, color 0.3s ease;
}

.card-footer-user {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.macro-indicator-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #a855f7;
}

.macro-indicator-user.active-scheduled i {
    animation: pulseVioletIndicator 3.5s infinite ease-in-out;
}

/* Macro Management List Styling */
.macro-manage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.macro-manage-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.macro-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-weight: 600;
}

.macro-info i {
    width: 16px;
    height: 16px;
    color: #a855f7;
}

.btn-delete-macro {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete-macro:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.btn-delete-macro i {
    width: 14px;
    height: 14px;
}
/* Macro Indicators Group & Scheduled Times */
.macro-indicators-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scheduled-times-list {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    max-width: 120px;
}

.time-badge {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #a78bfa;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.time-badge:hover {
    background: #a855f7;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.macro-manage-item .macro-info small {
    display: flex;
    align-items: center;
    opacity: 0.8;
}

.macro-manage-item .macro-info small i {
    margin-right: 4px;
}

/* --- PREMIUM UI POLISH --- */

/* History Modal Redesign */
.history-modal-content {
    max-width: 950px !important;
    max-height: 85vh !important;
    border-radius: 40px !important;
    background: rgba(10, 10, 12, 0.98) !important;
    -webkit-backdrop-filter: blur(40px) saturate(180%) !important;
    backdrop-filter: blur(40px) saturate(180%) !important;
    border: 1px solid rgba(220, 38, 38, 0.2) !important;
    box-shadow: 0 50px 100px rgba(0,0,0,0.8) !important;
}

.history-list {
    padding: 20px 30px !important;
}

.history-item {
    display: grid;
    grid-template-columns: 100px 160px 1fr 180px;
    gap: 20px;
    padding: 18px 20px;
    margin-bottom: 8px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(220, 38, 38, 0.3);
    transform: translateX(5px);
}

.history-user {
    font-weight: 800;
    color: #a855f7;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.history-action {
    font-weight: 700;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    text-transform: uppercase;
}

/* Action-specific colors */
.history-item[data-type*="Ajout"] .history-action,
.history-item[data-type*="Création"] .history-action { color: #10b981; background: rgba(16, 185, 129, 0.1); }

.history-item[data-type*="Suppression"] .history-action { color: #ef4444; background: rgba(239, 68, 68, 0.1); }

.history-item[data-type*="Commande ON"] .history-action { color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }

.history-item[data-type*="Commande OFF"] .history-action { color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

.history-details {
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
}

.history-time {
    color: #64748b;
    font-size: 0.75rem;
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
}

.history-item.header {
    background: none !important;
    border: none !important;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 0;
    color: var(--accent);
    font-weight: 800;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Settings Modal Polish */
.modal-content {
    border-radius: 40px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 3rem !important;
}

.form-group {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 1.5rem !important;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 1rem;
}

.input-field input {
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    height: 45px !important;
    padding: 0 15px !important;
    color: white !important;
    width: 100%;
}

.input-field small {
    display: block;
    color: #64748b;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    font-weight: 700;
}

.scan-status-pill {
    background: rgba(220, 38, 38, 0.05) !important;
    border-radius: 16px !important;
    padding: 15px 20px !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scan-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: #94a3b8;
}

.scan-info-row i {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.scan-info-row strong {
    color: white;
}


.discovery-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    align-items: center;

}

.discovery-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
}

.discovery-pill i {
    width: 14px;
    height: 14px;
    color: var(--accent);
}

.discovery-pill strong {
    color: white;
    font-weight: 700;
}

.discovery-pill.status i.spinning {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

/* User Management UI */
.user-add-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.small-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px 10px;
    color: white;
    font-size: 0.85rem;
    flex: 1;
}

.btn-primary-mini {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.users-list-minimal {
    max-height: 150px;
    overflow-y: auto;
    margin-top: 10px;
}

.user-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 4px;
}

.user-item-row .username {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-item-row .role-badge {
    font-size: 0.7rem;
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

/* Widened Modals */
.modal-content.settings-wide {
    max-width: 850px;
    /* En-tête (avec la croix) toujours visible : seul le corps défile. */
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.settings-wide .modal-header {
    flex-shrink: 0;
    margin: 0;
    padding: 1.5rem 2.5rem;
    background: #151518;
    border-bottom: 1px solid var(--border);
}
.settings-wide .modal-header h2 { margin-bottom: 0; }
.settings-wide .modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1.75rem 2.5rem 2.5rem;
}

/* Rappel visuel quand on clique dehors avec des changements non enregistrés */
@keyframes settingsShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-7px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(3px); }
}
.modal-content.settings-wide.shake { animation: settingsShake 0.35s ease; }

/* Role Badges */
.role-badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}
.role-badge.role-superuser {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.4);
}
.role-badge.role-admin {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
}
.role-badge.role-user {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.4);
}
.btn-clear-history {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-clear-history:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.btn-clear-history i {
    width: 14px;
    height: 14px;
}

/* Mini Delete Log Button */
.btn-mini-delete-log {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    opacity: 0.6;
    transition: opacity 0.3s;
    vertical-align: middle;
    display: inline-flex;
}

.btn-mini-delete-log:hover {
    opacity: 1;
}

.btn-mini-delete-log i {
    width: 14px;
    height: 14px;
}

.logout-btn:hover {
    color: #ef4444 !important;
}

.company-logo-wrapper {
    height: 32px;
    width: auto; /* Largeur dynamique */
    min-width: 32px;
    padding: 2px 6px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-logo-wrapper img {
    height: 24px; /* Hauteur fixe pour alignement */
    width: auto;
    object-fit: contain;
}

#company-name-display {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.9;
    white-space: nowrap;
    text-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

#company-identity-block {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}


/* Settings Layout */
.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px 20px;
}

.settings-group {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 18px;
    transition: all 0.3s ease;
}

.settings-group:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.settings-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-group-header i {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.settings-group-header span {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.9);
}

.danger-zone {
    background: rgba(239, 68, 68, 0.03) !important;
    border-color: rgba(239, 68, 68, 0.1) !important;
}

.danger-zone:hover {
    background: rgba(239, 68, 68, 0.05) !important;
    border-color: rgba(239, 68, 68, 0.15) !important;
}

.small-hint {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
}

.btn-danger-minimal {
    width: 100%;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-danger-minimal:hover {
    background: #ef4444;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
}

@media (max-width: 900px) {
    .settings-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }
}

/* --- CORBEILLE / BLACKLIST PREMIUM UI --- */
.corbeille-modal-content {
    max-width: 750px !important;
    max-height: 85vh !important;
    border-radius: 40px !important;
    background: rgba(10, 10, 12, 0.98) !important;
    -webkit-backdrop-filter: blur(40px) saturate(180%) !important;
    backdrop-filter: blur(40px) saturate(180%) !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
    box-shadow: 0 50px 100px rgba(0,0,0,0.8) !important;
}

.corbeille-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 20px;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.corbeille-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.corbeille-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.corbeille-name {
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.corbeille-meta {
    font-size: 0.85rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.btn-restore {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #4ade80;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-restore:hover {
    background: rgba(74, 222, 128, 0.2);
    transform: translateY(-1px);
}

.btn-permanent-delete {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-permanent-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

/* Zoom Control styling */
.zoom-control {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 2px 6px;
    font-size: 0.75rem;
    height: 26px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.zoom-control:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.zoom-control select {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    padding: 0;
    margin-right: 2px;
}

.zoom-control select option {
    background: #09090b;
    color: white;
    font-size: 0.85rem;
    padding: 8px;
}

.zoom-control input[type="number"] {
    width: 32px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: white;
    font-size: 0.7rem;
    text-align: center;
    outline: none;
    padding: 1px 2px;
    height: 18px;
    box-sizing: border-box;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* ─── Device Filter Bar ─────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.filter-search-wrapper .filter-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted, #8892a4);
    pointer-events: none;
}

.filter-search-wrapper input {
    width: 100%;
    padding: 10px 12px 10px 46px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
}

.filter-search-wrapper input::placeholder {
    color: var(--text-muted, #8892a4);
}

.filter-search-wrapper input:focus {
    border-color: var(--accent, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.filter-type-select {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    min-width: 160px;
}

.filter-type-select option {
    background: #1a1f2e;
    color: #e2e8f0;
}

.filter-type-select:focus {
    border-color: var(--accent, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.filter-clear-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-muted, #8892a4);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-clear-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.filter-clear-btn i {
    width: 14px;
    height: 14px;
}

.filter-results-count {
    font-size: 0.78rem;
    color: var(--text-muted, #8892a4);
    white-space: nowrap;
    align-self: center;
}

.filter-results-count span {
    font-weight: 600;
    color: var(--accent, #6366f1);
}



/* ── Groupe d'applications ────────────────────────────────────────────────
   Une carte de type « Application » ne montre ni temperature ni adresse MAC :
   ce qu'on veut y lire, c'est quelles applications du script tournent. */
.app-liste {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 16px 2px;
}
.app-ligne {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 0;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.app-ligne:last-child { border-bottom: none; }
.app-pastille { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: #64748b; }
.app-pastille.ok { background: #4ade80; box-shadow: 0 0 5px rgba(74, 222, 128, 0.5); }
.app-pastille.hs { background: #f87171; }
.app-titre { color: #e2e8f0; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-etat { color: #94a3b8; font-size: 0.76rem; font-family: 'JetBrains Mono', monospace; white-space: nowrap; }


/* ── Marqueur « Automation », à côté du logo ──────────────────────────────
   Il reprend la teinte violette de la pulsation du logo : les deux signalent
   la même chose, ils doivent se lire comme un seul signal. */


/* La mention qui nomme l'indicateur d'automations d'une carte. Le pictogramme
   seul ne disait pas de quoi il s'agissait ; le mot lève le doute sans ouvrir
   le gestionnaire pour le découvrir. */
.macro-indicator-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.macro-status-indicator.active-scheduled .macro-indicator-label { color: #a855f7; }


/* ── Centre de notification ───────────────────────────────────────────────
   La cloche reste en bas a droite, quelle que soit la rubrique. Elle remplace
   les bandeaux surgissants : l'information est disponible en permanence au
   lieu d'arriver par vagues. */
#cloche-notification {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 900;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #1c1c22;
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: #cbd5e1;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
#cloche-notification:hover { transform: translateY(-2px); color: #fff; }
#cloche-notification i { width: 21px; height: 21px; }
#cloche-notification.en-alerte { border-color: rgba(248, 113, 113, 0.45); color: #f87171; }

.cloche-pastille {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #ef4444;
    color: #fff;
    font-size: 0.70rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #141418;
}

#centre-notification {
    position: fixed;
    right: 24px;
    bottom: 88px;
    z-index: 900;
    width: min(340px, calc(100vw - 48px));
    /* Un parc nombreux ne doit pas pousser le panneau hors de l'ecran. */
    max-height: min(420px, calc(100vh - 140px));
    flex-direction: column;
    background: #16161b;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}
.centre-entete {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 14px 16px 10px;
    font-size: 0.80rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #e2e8f0;
}
.centre-entete i { width: 15px; height: 15px; }
.centre-fermer {
    margin-left: auto;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    display: flex;
    padding: 2px;
}
.centre-fermer:hover { color: #fff; }
.centre-fermer i { width: 15px; height: 15px; }
.centre-soustitre {
    padding: 0 16px 10px;
    font-size: 0.76rem;
    color: #64748b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.centre-liste { overflow-y: auto; padding: 6px; }
.centre-vide { display: block; padding: 18px 10px; color: #64748b; font-size: 0.84rem; font-style: italic; text-align: center; }

.centre-ligne {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.86rem;
    transition: background 0.15s ease;
}
.centre-ligne:hover { background: rgba(255, 255, 255, 0.05); }
.centre-nom { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.centre-detail { color: #64748b; font-size: 0.76rem; font-family: 'JetBrains Mono', monospace; }
.centre-pourcent { font-weight: 800; font-size: 0.86rem; min-width: 44px; text-align: right; }
.centre-ligne.ok .centre-nom, .centre-ligne.ok .centre-pourcent { color: #4ade80; }
.centre-ligne.alerte .centre-nom, .centre-ligne.alerte .centre-pourcent { color: #f87171; }

/* Les memes couleurs dans l'encadre ESPACES de la vue generale. */
.espace-ok { color: #4ade80; font-weight: 600; }
.espace-alerte { color: #f87171; font-weight: 600; }
.espace-detail { color: #64748b; font-size: 0.74rem; font-weight: 500; margin-left: 6px; font-family: 'JetBrains Mono', monospace; }
