/* ============================================
   SETTINGS & SUBMENU STYLES - Aldon Radar
   ============================================ */

/* ============================================
   SUBMENU STYLES
   ============================================ */

.nav-parent {
    position: relative;
}

.nav-parent > .nav-link {
    justify-content: space-between;
}

.nav-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.nav-parent.open > .nav-link .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    list-style: none;
    padding: 0.5rem 0 0.5rem 0;
    margin: 0;
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

.nav-subitem {
    margin: 0;
}

.nav-sublink {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
    border-left: 2px solid transparent;
}

.nav-sublink:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.03);
}

.nav-subitem.active .nav-sublink {
    color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    border-left-color: #10b981;
}

.nav-sublink i {
    font-size: 0.8rem;
    width: 16px;
    text-align: center;
}

/* Parent actif */
.nav-parent.active > .nav-link,
.nav-parent.open > .nav-link {
    color: #10b981;
}

.nav-parent.active > .nav-link i:first-child,
.nav-parent.open > .nav-link i:first-child {
    color: #10b981;
}

/* ============================================
   SETTINGS PAGE
   ============================================ */

.settings-page {
    max-width: 1400px; /* Aligné sur spotlight/plan/dashboard */
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
}

/* Header */
.settings-header {
    margin-bottom: 2rem;
}

.settings-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.settings-header h1 i {
    color: #10b981;
}

.settings-header p {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0;
}

/* ============================================
   SELECTION COUNTER - STICKY
   ============================================ */

.selection-counter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 182, 212, 0.06));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    margin-bottom: 1.5rem;

    /* Sticky behavior */
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Shadow when scrolled (subtle depth) */
.selection-counter::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8px;
    height: 8px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.15), transparent);
    pointer-events: none;
    border-radius: 0 0 12px 12px;
}

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

.counter-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.counter-text h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.counter-text p {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: #64748b;
}

.counter-text p.warning {
    color: #f59e0b;
}

.counter-text p.success {
    color: #10b981;
}

/* ============================================
   COUNTER ACTIONS - Reset All Button
   ============================================ */

.counter-actions {
    flex-shrink: 0;
}

.btn-reset-all {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset-all:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.btn-reset-all i {
    font-size: 0.75rem;
}

/* ============================================
   CATEGORIES CONTAINER
   ============================================ */

.interests-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Category Card */
.category-card {
    background: #1a2234;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s;
}

.category-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.category-card.has-selection {
    border-color: rgba(16, 185, 129, 0.3);
}

/* Category Header */
.category-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
}

.category-card-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.category-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.category-details {
    flex: 1;
    min-width: 0;
}

.category-details h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.category-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #64748b;
}

.selection-count {
    color: #10b981;
    font-weight: 600;
}

.expand-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: transform 0.3s;
}

.category-card.expanded .expand-icon {
    transform: rotate(180deg);
    color: #10b981;
}

/* Category Body */
.category-card-body {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.2);
}

/* Subcategories Grid */
.subcategories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    padding-top: 1.25rem;
}

/* Interest Chip */
.interest-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    color: #94a3b8;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.interest-chip:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #e2e8f0;
}

.interest-chip.selected {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #10b981;
}

.interest-chip.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.interest-chip .check-icon {
    font-size: 0.7rem;
}

/* Category Actions */
.category-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.cat-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.cat-action-btn.select-all {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.cat-action-btn.select-all:hover {
    background: rgba(16, 185, 129, 0.25);
}

.cat-action-btn.select-all:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cat-action-btn.clear {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.cat-action-btn.clear:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* ============================================
   SAVE SECTION (bottom sticky)
   ============================================ */

.save-section {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 0;
    background: linear-gradient(to top, #0f1419 0%, #0f1419 70%, transparent 100%);
    margin-top: 2rem;
    z-index: 15;
}

.save-section-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #1a2234;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.save-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #64748b;
    font-size: 0.9rem;
    min-width: 0;
}

.save-info i {
    color: #f59e0b;
    flex-shrink: 0;
}

.save-info.valid i {
    color: #10b981;
}

/* Save Actions Group */
.save-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Reset / Undo Button (bottom bar) */
.btn-reset-bottom {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset-bottom:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: #e2e8f0;
}

.btn-reset-bottom i {
    font-size: 0.8rem;
}

/* Save Button */
.btn-save {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #64748b;
    font-size: 1rem;
    font-weight: 600;
    cursor: not-allowed;
    transition: all 0.3s;
}

.btn-save.ready {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: transparent;
    color: white;
    cursor: pointer;
}

.btn-save.ready:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-save:disabled {
    opacity: 0.6;
}

/* Loading State */
.settings-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: #64748b;
}

.settings-loading i {
    font-size: 2rem;
    color: #10b981;
    margin-bottom: 1rem;
}

/* ============================================
   GENERAL SETTINGS
   ============================================ */

.settings-card {
    background: #1a2234;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-card h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.settings-card h2 i {
    color: #10b981;
    font-size: 1rem;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.setting-info h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #e2e8f0;
    font-weight: 500;
}

.setting-info p {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: #64748b;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #10b981;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* ============================================
   DAILY PULSE — Tranche horaire
   ============================================ */

.setting-pulse-schedule {
    padding: 0 0 0.5rem;
}

.pulse-time-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 0.75rem 0 0.25rem;
    flex-wrap: wrap;
}

.pulse-time-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
}

.pulse-time-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.pulse-time-select {
    padding: 9px 32px 9px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    min-width: 90px;
}

.pulse-time-select:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}

.pulse-time-select option {
    background: #1a2234;
    color: #e2e8f0;
    padding: 6px;
}

.pulse-time-separator {
    display: flex;
    align-items: center;
    height: 38px;
    color: #64748b;
    font-size: 12px;
}

.pulse-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
    background: #10b981;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
    height: 38px;
}

.pulse-save-btn:hover:not(:disabled) {
    opacity: 0.85;
}

.pulse-save-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pulse-time-error {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0 0;
    font-size: 0.78rem;
    color: #f87171;
}

.pulse-time-error i {
    font-size: 0.72rem;
}

.pulse-time-loading {
    padding: 16px 0;
    font-size: 0.8rem;
    color: #64748b;
}

@media (max-width: 600px) {
    .pulse-time-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .pulse-time-field {
        flex: 1;
    }
    .pulse-time-select {
        width: 100%;
    }
    .pulse-time-separator {
        display: none;
    }
    .pulse-save-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   DAILY PULSE — Résumé + Bouton Modifier
   ============================================ */

.pulse-schedule-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 10px;
    margin: 0.25rem 0 0.5rem;
}

.pulse-schedule-display {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #10b981;
    font-size: 0.9rem;
}

.pulse-schedule-display > i {
    font-size: 0.85rem;
    opacity: 0.8;
}

.pulse-schedule-times {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #e2e8f0;
    letter-spacing: 0.01em;
}

.pulse-schedule-times i {
    font-size: 0.7rem;
    color: #64748b;
    margin: 0 2px;
}

.pulse-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.pulse-edit-btn:hover {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.4);
}

.pulse-edit-btn i {
    font-size: 0.72rem;
}

/* ============================================
   DAILY PULSE — Modale pastilles
   ============================================ */

.pulse-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.pulse-modal-box {
    background: #1a2234;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 20px;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s ease;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.pulse-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.pulse-modal-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.pulse-modal-title i {
    color: #10b981;
    font-size: 0.9rem;
}

.pulse-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.pulse-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.pulse-modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.pulse-modal-section {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.pulse-modal-section-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.pulse-modal-section-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-start { background: #10b981; }
.dot-end   { background: #6366f1; }

.pulse-modal-section-val {
    margin-left: auto;
    font-size: 0.9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #e2e8f0;
    text-transform: none;
    letter-spacing: 0;
}

.pulse-slots-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.pulse-slot-pill {
    padding: 7px 4px;
    font-size: 0.75rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    line-height: 1;
}

.pulse-slot-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.15);
}

.pulse-slot-pill.active {
    background: rgba(16, 185, 129, 0.18);
    border-color: #10b981;
    color: #10b981;
    font-weight: 700;
}

.pulse-modal-error {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.625rem 1.5rem;
    font-size: 0.8rem;
    color: #f87171;
    flex-shrink: 0;
}

.pulse-modal-error i {
    font-size: 0.75rem;
}

.pulse-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.pulse-modal-cancel {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1.25rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pulse-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.pulse-modal-save {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.625rem 1.5rem;
    background: #10b981;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.pulse-modal-save:hover:not(:disabled) {
    opacity: 0.85;
}

.pulse-modal-save:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .pulse-modal-box {
        max-height: 95vh;
        border-radius: 16px;
    }
    .pulse-slots-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
    }
    .pulse-slot-pill {
        font-size: 0.72rem;
        padding: 8px 2px;
    }
    .pulse-modal-footer {
        flex-direction: column;
    }
    .pulse-modal-cancel,
    .pulse-modal-save {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   LANGUES — Card + Badges inline
   ============================================ */

.lang-current-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.82rem;
    color: #e2e8f0;
    white-space: nowrap;
    flex-shrink: 0;
}

.lang-flag-inline {
    font-size: 1rem;
    line-height: 1;
}

.lang-content-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
    max-width: 180px;
}

.lang-pill {
    font-size: 1rem;
    line-height: 1;
}

.lang-loading-inline {
    font-size: 0.8rem;
    color: #64748b;
    padding: 0.5rem 0;
}

.lang-loading-inline i {
    margin-right: 6px;
}

.lang-edit-btn {
    margin-top: 0.75rem;
    width: 100%;
    justify-content: center;
}

/* ============================================
   LANGUES — Modale
   ============================================ */

.lang-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.lang-modal-box {
    background: #1a2234;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s ease;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.lang-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.lang-modal-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.lang-modal-title i {
    color: #10b981;
    font-size: 0.9rem;
}

.lang-modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.lang-modal-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lang-modal-section-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.lang-modal-section-label i {
    font-size: 0.8rem;
}

.lang-modal-hint {
    font-size: 0.8rem;
    color: #475569;
    margin: -0.25rem 0 0;
}

/* Boutons langue interface */
.lang-interface-options {
    display: flex;
    gap: 0.625rem;
}

.lang-interface-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.lang-interface-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

.lang-interface-btn.active {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
}

.lang-flag {
    font-size: 1.25rem;
    line-height: 1;
}

.lang-coming-soon {
    font-size: 0.65rem;
    padding: 2px 6px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 20px;
    color: #f59e0b;
    white-space: nowrap;
}

/* Grille langues contenus */
.lang-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.lang-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #64748b;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.lang-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
}

.lang-toggle-btn.active {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
    color: #e2e8f0;
}

.lang-toggle-label {
    flex: 1;
    text-align: left;
}

/* Mini switch intégré */
.lang-switch {
    margin-left: auto;
    flex-shrink: 0;
}

.lang-switch-track {
    display: block;
    width: 28px;
    height: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    position: relative;
    transition: background 0.2s;
}

.lang-toggle-btn.active .lang-switch-track {
    background: #10b981;
}

.lang-switch-thumb {
    display: block;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.lang-toggle-btn.active .lang-switch-thumb {
    transform: translateX(12px);
}

.lang-modal-count {
    font-size: 0.78rem;
    color: #64748b;
    text-align: right;
}

.lang-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .lang-modal-box {
        max-height: 95vh;
        border-radius: 16px;
    }
    .lang-content-grid {
        grid-template-columns: 1fr;
    }
    .lang-interface-options {
        flex-direction: column;
    }
    .lang-modal-footer {
        flex-direction: column;
    }
    .lang-modal-footer .pulse-modal-cancel,
    .lang-modal-footer .pulse-modal-save {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   AI PULSE IA — Card + Subsections + Locked
   ============================================ */

/* Card en état verrouillé (Free users) */
.ai-pulse-card-locked {
    position: relative;
}

.ai-pulse-card-locked .setting-item,
.ai-pulse-card-locked .pulse-schedule-summary {
    opacity: 0.45;
    pointer-events: none;
}

.ai-pulse-card-locked .pulse-schedule-summary.pulse-summary-locked {
    opacity: 0.45;
}

/* Badge "Pro" dans le titre */
.ai-pulse-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.ai-pulse-lock-badge i {
    font-size: 0.65rem;
    color: #f59e0b;
}

/* Toggle grisé quand locked */
.toggle-locked {
    opacity: 0.35;
    pointer-events: none;
    cursor: not-allowed;
}

/* Subsection (Matin / Après-midi) */
.ai-pulse-subsection {
    padding: 0.25rem 0;
}

.ai-pulse-subsection-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748b;
    margin-bottom: 0.25rem;
    padding-top: 0.5rem;
}

.ai-pulse-subsection-header i {
    font-size: 0.8rem;
}

/* Séparateur entre Matin et Après-midi */
.ai-pulse-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 1rem 0;
}

/* Nudge upgrade */
.ai-pulse-upgrade-hint {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.18);
    border-radius: 10px;
    font-size: 0.82rem;
    color: #94a3b8;
    flex-wrap: wrap;
}

.ai-pulse-upgrade-hint > i {
    color: #f59e0b;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.ai-pulse-upgrade-hint strong {
    color: #e2e8f0;
}

.ai-pulse-upgrade-link {
    margin-left: auto;
    color: #10b981;
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.ai-pulse-upgrade-link:hover {
    opacity: 0.8;
}

/* Dots pour les modales Après-midi */
.dot-afternoon-start { background: #f59e0b; }
.dot-afternoon-end   { background: #8b5cf6; }

/* Pastille active — variante Après-midi (orange) */
.pulse-slot-pill.active.afternoon {
    background: rgba(245, 158, 11, 0.18);
    border-color: #f59e0b;
    color: #f59e0b;
}

/* Pulse summary locked */
.pulse-summary-locked {
    opacity: 0.45;
    pointer-events: none;
}

/* ============================================
   DANGER ZONE - SQLite Reset
   ============================================ */

.settings-card.danger-zone {
    border-color: rgba(239, 68, 68, 0.2);
}

.settings-card.danger-zone h2 {
    color: #ef4444;
}

.settings-card.danger-zone h2 i {
    color: #ef4444;
}

.setting-item-danger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 1.5rem;
}

.setting-info-danger p {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: #64748b;
}

.setting-info-danger h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #e2e8f0;
    font-weight: 500;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   MODAL - SQLITE RESET CONFIRMATION
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-box {
    background: #1a2234;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 20px;
    padding: 2rem;
    max-width: 480px;
    width: 100%;
    animation: slideUp 0.25s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

.modal-icon {
    width: 56px;
    height: 56px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #ef4444;
    margin-bottom: 1.25rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem;
}

.modal-desc {
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0 0 1rem;
}

.modal-warning-box {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.modal-warning-box ul {
    margin: 0;
    padding: 0 0 0 1.25rem;
    color: #fca5a5;
    font-size: 0.85rem;
    line-height: 1.8;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-modal-cancel {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.btn-modal-confirm {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modal-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-modal-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .settings-page {
        padding: 0 1rem 2rem;
    }

    .settings-header h1 {
        font-size: 1.5rem;
    }
    
    .selection-counter {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        top: 0;
    }
    
    .counter-info {
        flex-direction: column;
    }
    
    .save-section-inner {
        flex-direction: column;
    }

    .save-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .btn-save {
        width: 100%;
        justify-content: center;
    }

    .btn-reset-bottom {
        width: 100%;
        justify-content: center;
    }
    
    .category-card-header {
        padding: 1rem;
    }
    
    .category-card-body {
        padding: 0 1rem 1rem;
    }

    .setting-item-danger {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-danger {
        width: 100%;
        justify-content: center;
    }

    .modal-actions {
        flex-direction: column;
    }

    .btn-modal-cancel,
    .btn-modal-confirm {
        width: 100%;
        justify-content: center;
    }
}
