/* ═══════════════════════════════════════════════════════
   Atlas PWA — Design System (JARVIS Aesthetic)
   ═══════════════════════════════════════════════════════ */

:root {
    /* Palette */
    --cyan: #00d4ff;
    --cyan-dim: #0099bb;
    --cyan-glow: rgba(0, 212, 255, 0.15);
    --cyan-glow2: rgba(0, 212, 255, 0.08);
    --bg: #060a10;
    --bg2: #0a1018;
    --surface: #0d1520;
    --surface2: #111d2b;
    --surface3: #162030;
    --border: #1a2a3a;
    --border-light: #253545;
    --text: #c8d8e8;
    --text-dim: #607080;
    --text-muted: #3a4a5a;
    --red: #ff3b3b;
    --green: #00e676;
    --amber: #ffb300;
    --purple: #b388ff;

    /* Layout */
    --header-h: 52px;
    --nav-h: 64px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ═══ RESET ═══ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
}

a { color: var(--cyan); text-decoration: none; }

/* ═══ APP SHELL ═══ */
#app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
}

/* ═══ HEADER ═══ */
#appHeader {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 50;
}

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

.arc-icon {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px var(--cyan-glow);
}

.arc-core {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 6px var(--cyan);
}

.header-brand {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 4px;
    color: var(--cyan);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.health-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.3s;
}

.health-dot.ok { background: var(--green); box-shadow: 0 0 6px rgba(0,230,118,0.4); }
.health-dot.down { background: var(--red); box-shadow: 0 0 6px rgba(255,59,59,0.4); }
.health-dot.loading { background: var(--amber); animation: pulse-dot 1.5s infinite; }

@keyframes pulse-dot {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.header-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
}

.header-btn:hover {
    color: var(--cyan);
    background: var(--cyan-glow2);
}

/* ═══ PAGE CONTAINER ═══ */
#pageContainer {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

#pageContainer::-webkit-scrollbar { width: 3px; }
#pageContainer::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.page {
    padding: 16px;
    min-height: 100%;
    animation: fadeIn 0.25s ease;
}

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

/* ═══ BOTTOM NAV ═══ */
#bottomNav {
    height: var(--nav-h);
    display: flex;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 50;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-dim);
    font-size: 10px;
    letter-spacing: 0.5px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s;
    position: relative;
}

.nav-item svg {
    transition: stroke 0.2s, filter 0.2s;
}

.nav-item.active {
    color: var(--cyan);
}

.nav-item.active svg {
    stroke: var(--cyan);
    filter: drop-shadow(0 0 4px rgba(0,212,255,0.3));
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 2px;
    background: var(--cyan);
    border-radius: 0 0 2px 2px;
}

/* Badge notification rouge (style iOS/Android) */
.nav-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(16px);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 0 6px rgba(231, 76, 60, 0.5);
    animation: badgePulse 2s ease-in-out infinite;
    z-index: 10;
}
@keyframes badgePulse {
    0%, 100% { transform: translateX(16px) scale(1); }
    50% { transform: translateX(16px) scale(1.1); }
}

/* ═══ CARDS ═══ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

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

.card-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.card-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.card-badge.ok { background: rgba(0,230,118,0.1); color: var(--green); }
.card-badge.warn { background: rgba(255,179,0,0.1); color: var(--amber); }
.card-badge.error { background: rgba(255,59,59,0.1); color: var(--red); }

/* ═══ KPI GRID ═══ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.kpi {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--cyan);
    line-height: 1.2;
}

.kpi-value.green { color: var(--green); }
.kpi-value.amber { color: var(--amber); }
.kpi-value.red { color: var(--red); }

.kpi-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ═══ QUICK ACTIONS ═══ */
.quick-actions {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.quick-actions::-webkit-scrollbar { display: none; }

.action-chip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.action-chip:hover, .action-chip.active {
    border-color: var(--cyan-dim);
    color: var(--cyan);
    background: var(--cyan-glow2);
}

.action-chip:active { transform: scale(0.96); }
.action-chip .icon { font-size: 14px; }

/* ═══ JARVIS TOP BAR ═══ */
.jarvis-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    flex-shrink: 0;
}

.jarvis-modes {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.mode-chip {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.mode-chip.active {
    background: var(--cyan);
    color: var(--bg);
    border-color: var(--cyan);
    font-weight: 600;
}

/* msg-meta inside voice messages */
.voice-msg .msg-meta {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Council scores tableau */
.council-scores {
    background: rgba(0, 200, 255, 0.06);
    border: 1px solid rgba(0, 200, 255, 0.2);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 11px;
}
.council-scores table {
    width: 100%;
    border-collapse: collapse;
}
.council-scores th {
    text-align: left;
    padding: 4px 8px;
    color: var(--cyan);
    font-size: 10px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(0, 200, 255, 0.15);
}
.council-scores td {
    padding: 4px 8px;
    font-size: 11px;
}
.council-scores tr.council-winner td {
    color: var(--cyan);
    font-weight: 600;
}
.council-caption {
    margin-top: 6px;
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
}
.council-pdf-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 14px;
    background: rgba(0, 200, 255, 0.12);
    color: var(--cyan);
    border: 1px solid rgba(0, 200, 255, 0.3);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}
.council-pdf-btn:hover {
    background: rgba(0, 200, 255, 0.25);
}

.typing-dots span {
    display: inline-block;
    width: 5px; height: 5px;
    background: var(--cyan);
    border-radius: 50%;
    animation: blink 1.4s infinite;
    margin: 0 1px;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 1; }
}

/* ═══ VOICE / JARVIS PAGE ═══ */
.voice-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: calc(100dvh - var(--header-h) - var(--nav-h));
    padding: 0 16px;
}

.voice-status {
    margin-top: 12px;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
    transition: color 0.3s;
}

.voice-status.connected { color: var(--green); }
.voice-status.recording { color: var(--cyan); }
.voice-status.processing { color: var(--cyan-dim); }
.voice-status.error { color: var(--red); }

.voice-actions {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.voice-actions::-webkit-scrollbar { display: none; }

.voice-conversation {
    flex: 1;
    overflow-y: auto;
    width: 100%;
    max-width: 560px;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.voice-conversation::-webkit-scrollbar { width: 2px; }
.voice-conversation::-webkit-scrollbar-thumb { background: var(--border); }

.voice-msg {
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 88%;
    animation: fadeIn 0.3s ease;
    transition: transform 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.voice-msg.user {
    align-self: flex-end;
    background: var(--surface2);
    border: 1px solid var(--border);
}

.voice-msg.jarvis {
    align-self: flex-start;
    background: linear-gradient(135deg, rgba(0,212,255,0.04), var(--surface));
    border: 1px solid rgba(0,212,255,0.12);
    color: var(--cyan);
}

.voice-msg .sender {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 4px;
    opacity: 0.4;
}

.voice-msg .content {
    font-size: 14px;
    line-height: 1.5;
}

.voice-msg .meta {
    font-size: 9px;
    opacity: 0.2;
    margin-top: 4px;
    text-align: right;
}

.voice-thinking {
    display: none;
    align-self: flex-start;
    padding: 10px 14px;
    color: var(--cyan-dim);
    font-size: 12px;
    align-items: center;
    gap: 8px;
}

.voice-thinking.visible { display: flex; }

@keyframes pulse-cyan {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0,212,255,0.3); }
    50% { box-shadow: 0 0 0 12px rgba(0,212,255,0); }
}

/* ═══ VOICE INPUT AREA (text + mic + attach + send) ═══ */
.voice-input-area {
    width: 100%;
    max-width: 560px;
    padding: 8px 0 12px;
    flex-shrink: 0;
}

.voice-file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    margin-bottom: 6px;
    background: var(--surface2);
    border: 1px solid var(--cyan-dim);
    border-radius: 8px;
    font-size: 12px;
    color: var(--cyan);
}

.voice-file-preview .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-input-row {
    display: flex;
    gap: 6px;
    align-items: flex-end;
}

.voice-text-input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    resize: none;
    max-height: 80px;
    line-height: 1.4;
}

.voice-text-input:focus { border-color: var(--cyan); }
.voice-text-input::placeholder { color: var(--text-muted); }

.voice-attach-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.voice-attach-btn:hover { border-color: var(--cyan); color: var(--cyan); }

.mic-btn-sm {
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 2px solid var(--cyan);
    background: var(--surface);
    color: var(--cyan);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
}

.mic-btn-sm:hover { border-color: var(--cyan); color: var(--cyan); }
.mic-btn-sm:disabled { opacity: 0.3; cursor: default; }

.mic-btn-sm.recording {
    border-color: var(--cyan);
    background: rgba(0, 212, 255, 0.08);
    color: var(--cyan);
    animation: pulse-cyan 1.5s infinite;
}

.voice-send-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--cyan);
    border: none;
    color: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.1s;
}

.voice-send-btn:active { transform: scale(0.92); }

/* ═══ JARVIS TABLE (markdown) ═══ */
.jarvis-table {
    width: 100%;
    border-collapse: collapse;
    margin: 6px 0;
    font-size: 12px;
}

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

.jarvis-table th {
    background: var(--surface2);
    color: var(--cyan);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jarvis-table td { color: var(--text); }

/* Voice msg content with markdown */
.voice-msg .content ul, .voice-msg .content ol {
    margin: 4px 0;
    padding-left: 16px;
}

/* Markdown headers in messages */
.voice-msg .content .md-h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--cyan);
    margin: 12px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(0, 200, 255, 0.15);
}
.voice-msg .content .md-h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 10px 0 4px;
}
.voice-msg .content .md-h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 8px 0 3px;
}
.voice-msg .content .md-hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 8px 0;
}
.voice-msg .content code {
    background: var(--surface2);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 11px;
    font-family: 'SF Mono', 'Fira Code', monospace;
}
.voice-msg .content strong {
    color: var(--cyan);
    font-weight: 600;
}

.voice-msg .content li {
    margin: 2px 0;
    font-size: 13px;
}

.voice-msg .content strong { color: var(--cyan); }

/* ═══ COMPTA PAGE ═══ */
.compta-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.compta-result {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ═══ NEOBEDS PAGE ═══ */
.apt-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
}

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

.apt-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.apt-status {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 500;
}

.apt-status.vacant { background: rgba(0,230,118,0.1); color: var(--green); }
.apt-status.occupied { background: rgba(0,212,255,0.1); color: var(--cyan); }

.apt-detail {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
}

/* ═══ WELCOME SUGGESTIONS ═══ */
.welcome-suggestions {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 400px;
}

.suggest-chip {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 10px 16px;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.suggest-chip:hover, .suggest-chip:active {
    background: var(--cyan-glow);
    border-color: var(--cyan-dim);
    color: var(--cyan);
}

/* ═══ MODAL ═══ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: opacity 0.3s;
}

.modal.hidden { display: none; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-body {
    padding: 16px 20px 24px;
}

.setting-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

.setting-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
}

.setting-info {
    font-size: 13px;
    color: var(--text);
    text-align: right;
}

/* ═══ BUTTONS ═══ */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover { border-color: var(--cyan); color: var(--cyan); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-primary { background: var(--cyan); color: var(--bg); border-color: var(--cyan); }
.btn-primary:hover { opacity: 0.9; color: var(--bg); }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: rgba(255,59,59,0.1); }

/* ═══ LOADING ═══ */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 32px; height: 32px;
    border: 2px solid var(--border);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ═══ EMPTY STATE ═══ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,212,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.empty-icon::before {
    content: '';
    width: 24px; height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,212,255,0.2), transparent 70%);
    box-shadow: 0 0 16px rgba(0,212,255,0.1);
}

.empty-title {
    font-size: 15px;
    font-weight: 200;
    letter-spacing: 4px;
    color: rgba(0,212,255,0.25);
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 12px;
    color: var(--text-dim);
}

/* ═══ SECTION TITLE ═══ */
.section-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 10px;
}

/* ═══ RESULT CARD (compta/neobeds results) ═══ */
.result-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.result-card strong { color: var(--cyan); }

.result-answer {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.result-meta {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* ═══ ATLAS CHAT BAR (universal) ═══ */
.atlas-bar {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.atlas-bar-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: 8px;
    background: var(--surface2);
    border: 1px solid var(--cyan-dim);
    border-radius: 10px;
    font-size: 12px;
    color: var(--cyan);
}

.atlas-bar-preview .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.atlas-bar-preview .file-remove,
.voice-file-preview .file-remove {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.atlas-bar-input {
    display: flex;
    gap: 6px;
    align-items: flex-end;
}

.atlas-bar-attach,
.voice-attach-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.atlas-bar-attach:hover,
.voice-attach-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.atlas-bar-text {
    flex: 1;
    padding: 8px 14px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    resize: none;
    max-height: 100px;
    line-height: 1.4;
}

.atlas-bar-text:focus { border-color: var(--cyan); }
.atlas-bar-text::placeholder { color: var(--text-muted); }

.atlas-bar-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cyan);
    border: none;
    color: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.1s;
}

.atlas-bar-send:disabled { opacity: 0.3; }
.atlas-bar-send:active { transform: scale(0.92); }


/* ═══ EMAIL CARDS ═══ */
.email-list { display: flex; flex-direction: column; gap: 8px; }
.email-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
}
.email-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.email-from { font-size: 12px; color: var(--cyan); font-weight: 600; }
.email-date { font-size: 11px; color: var(--text-dim); }
.email-subject { font-size: 13px; color: var(--text-main); font-weight: 500; margin-bottom: 4px; }
.email-pj { font-size: 11px; color: var(--cyan-glow); margin-bottom: 3px; }
.email-preview { font-size: 12px; color: var(--text-dim); line-height: 1.4; }

/* ═══ SCAN LINE (subtle HUD feel) ═══ */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan-glow), transparent);
    z-index: 300;
    pointer-events: none;
}

/* ═══ DASHBOARD WIDGETS ═══ */
.apt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.apt-card {
    text-align: center;
}

.apt-card .apt-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.apt-stat {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 3px 0;
    border-bottom: 1px solid var(--border);
}

.apt-stat:last-child { border-bottom: none; }

.apt-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.apt-lbl {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Bar chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 140px;
    padding-top: 10px;
}

.bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    min-width: 0;
}

.bar-val {
    font-size: 9px;
    color: var(--text-dim);
    margin-bottom: 4px;
    white-space: nowrap;
}

.bar-fill {
    width: 100%;
    max-width: 36px;
    background: linear-gradient(180deg, var(--cyan), var(--cyan-dim));
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: height 0.5s ease;
}

.bar-col.current .bar-fill {
    background: linear-gradient(180deg, var(--cyan), var(--green));
    box-shadow: 0 0 8px var(--cyan-glow);
}

.bar-col.future .bar-fill {
    background: linear-gradient(180deg, var(--cyan-dim), rgba(0,255,255,0.15));
    opacity: 0.5;
}

.bar-label {
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 4px;
}

/* KPI grid 4 cols */
.kpi-grid-4 {
    grid-template-columns: repeat(4, 1fr) !important;
}

/* Channel bars */
.channel-bars { display: flex; flex-direction: column; gap: 8px; }
.channel-row { display: flex; align-items: center; gap: 10px; }
.channel-info { flex: 0 0 140px; }
.channel-name { font-size: 13px; font-weight: 600; color: var(--text); display: block; }
.channel-meta { font-size: 11px; color: var(--text-dim); }
.channel-bar-bg { flex: 1; height: 8px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.channel-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.channel-pct { font-size: 13px; font-weight: 700; color: var(--text); flex: 0 0 40px; text-align: right; }

/* Sync button */
.sync-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--cyan);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.sync-btn:hover { background: var(--cyan); color: #000; }
.sync-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Today's movements */
.today-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text);
}

.today-row:last-child { border-bottom: none; }

.today-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.today-badge.in { background: rgba(0,230,118,0.15); color: var(--green); }
.today-badge.out { background: rgba(255,179,0,0.15); color: var(--amber); }

.today-channel {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: auto;
}

.today-date {
    font-size: 11px;
    color: var(--cyan-dim);
    font-weight: 600;
    flex-shrink: 0;
    min-width: 40px;
}

.section-subtitle {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 12px 0 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* ═══ COMPTA TABLE ═══ */
.rappr-gauge {
    height: 8px;
    background: var(--surface2);
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}

.rappr-gauge-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.tx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 8px;
}

.tx-table th {
    text-align: left;
    padding: 6px 8px;
    background: var(--surface2);
    color: var(--cyan);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.tx-table td {
    padding: 5px 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

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

.tx-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.tx-status.ok { background: var(--green); }
.tx-status.ko { background: var(--red); }

.monthly-bars {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 60px;
    margin-top: 8px;
}

.monthly-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.monthly-bar-fill {
    width: 100%;
    max-width: 28px;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
}

.monthly-bar-label {
    font-size: 9px;
    color: var(--text-dim);
    margin-top: 3px;
}

/* ═══ NEOBEDS CARDS ═══ */
.neobeds-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.neo-apt-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.neo-apt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.neo-apt-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 1px;
}

.neo-apt-occ {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
}

.neo-apt-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.neo-stat {
    text-align: center;
    padding: 8px 4px;
    background: var(--surface2);
    border-radius: 8px;
}

.neo-stat-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.neo-stat-lbl {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.neo-resa-list {
    font-size: 12px;
    color: var(--text-dim);
}

.neo-resa-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
}

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

.neo-resa-dates {
    font-size: 11px;
    color: var(--cyan-dim);
    font-weight: 600;
    flex-shrink: 0;
}

.neo-resa-guest {
    flex: 1;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.neo-resa-price {
    font-size: 11px;
    color: var(--green);
    font-weight: 600;
    flex-shrink: 0;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 480px) {
    .apt-grid { grid-template-columns: 1fr; gap: 8px; }
    .kpi-grid-4 { grid-template-columns: repeat(4, 1fr) !important; gap: 6px; }
    .kpi-grid-4 .kpi { padding: 8px 4px; }
    .kpi-grid-4 .kpi-value { font-size: 16px; }
    .kpi-grid-4 .kpi-label { font-size: 9px; }
    .channel-info { flex: 0 0 100px; }
    .channel-name { font-size: 12px; }
}

@media (min-width: 768px) {
    .page { padding: 20px 24px; max-width: 640px; margin: 0 auto; }
    .kpi-grid { grid-template-columns: repeat(4, 1fr); }
    .compta-summary { grid-template-columns: repeat(4, 1fr); }
    .modal-content { border-radius: 16px; margin-bottom: 20px; }
    .neobeds-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .page { max-width: 720px; }
}

/* ═══ LOGIN SCREEN ═══ */
#loginOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-box {
    width: 100%;
    max-width: 340px;
    text-align: center;
}
.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}
.login-logo .arc-icon {
    width: 56px;
    height: 56px;
    animation: pulse-glow 3s ease-in-out infinite;
}
.login-logo .arc-core {
    width: 22px;
    height: 22px;
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.3); }
    50% { box-shadow: 0 0 40px rgba(0, 212, 255, 0.6); }
}
.login-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 6px;
    color: var(--cyan);
    margin: 0 0 4px;
}
.login-subtitle {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin: 0 0 32px;
    text-transform: uppercase;
}
.login-field {
    margin-bottom: 12px;
}
.login-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.login-input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}
.login-input::placeholder {
    color: var(--text-dim);
}
/* Masquer le mot de passe avec des disques (sans type=password qui déclenche autofill) */
.login-input-masked {
    -webkit-text-security: disc;
    text-security: disc;
    font-family: text-security-disc, monospace;
    letter-spacing: 3px;
}
.login-error {
    color: #ff4444;
    font-size: 13px;
    min-height: 20px;
    margin-bottom: 8px;
}
.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--cyan);
    color: var(--bg);
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s, transform 0.1s;
}
.login-btn:hover { opacity: 0.9; }
.login-btn:active { transform: scale(0.98); }
.login-btn:disabled { opacity: 0.5; cursor: wait; }
.login-biometric {
    margin-top: 16px;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-dim);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: color 0.2s, border-color 0.2s;
}
.login-biometric:hover {
    color: var(--cyan);
    border-color: var(--cyan-dim);
}

/* ═══ MESSAGE ACTIONS (reply, copy, email) ═══ */
.msg-text {
    white-space: pre-wrap;
    word-break: break-word;
}
.msg-reply-quote {
    font-size: 11px;
    color: var(--cyan-dim);
    background: var(--cyan-glow2);
    border-left: 2px solid var(--cyan);
    padding: 4px 8px;
    margin-bottom: 6px;
    border-radius: 0 6px 6px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.msg-actions-bar {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    display: flex;
    gap: 2px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    animation: fadeUp 0.15s ease;
}
.voice-msg.jarvis .msg-actions-bar {
    left: 0; right: auto;
}
.voice-msg.user .msg-actions-bar {
    right: 0; left: auto;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.msg-action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 10px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
}
.msg-action-btn:hover, .msg-action-btn:active {
    background: var(--cyan-glow);
}
.msg-action-btn span:first-child {
    font-size: 16px;
}

/* ── Inline action icons (visible on every message) ── */
.msg-inline-actions {
    display: flex;
    gap: 2px;
    margin-top: 4px;
    opacity: 0.35;
    transition: opacity 0.2s;
}
.voice-msg:hover .msg-inline-actions {
    opacity: 1;
}
@media (hover: none) {
    .msg-inline-actions { opacity: 0.5; }
}
.msg-icon-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    padding: 3px 6px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s, background 0.15s;
}
.msg-icon-btn:hover, .msg-icon-btn:active {
    color: var(--cyan);
    background: var(--cyan-glow2);
}
.voice-msg.user .msg-inline-actions {
    justify-content: flex-end;
}

/* ── Stop audio FAB ── */
.stop-audio-fab {
    position: fixed;
    bottom: calc(var(--nav-h) + 80px);
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--red, #e74c3c);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    z-index: 200;
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}
.stop-audio-fab.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}
.stop-audio-fab:active {
    transform: scale(0.9);
}

/* Reply Banner */
.reply-banner {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--surface2);
    border-top: 1px solid var(--border);
    gap: 8px;
    animation: fadeUp 0.15s ease;
}
.reply-bar-left {
    width: 3px;
    height: 24px;
    background: var(--cyan);
    border-radius: 2px;
    flex-shrink: 0;
}
.reply-text {
    flex: 1;
    font-size: 12px;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.reply-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.reply-close:hover { color: var(--red); }

/* Retry Button */
.retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 6px 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--cyan);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.retry-btn:hover {
    background: var(--cyan-glow);
    border-color: var(--cyan-dim);
}
.error-msg {
    border-left: 2px solid var(--red) !important;
}
.error-msg .msg-text {
    color: var(--red);
}

/* ═══ MISSIONS — Todo gamifié TDAH ═══ */

.mission-coach {
    background: linear-gradient(135deg, rgba(0,212,255,0.08) 0%, rgba(0,212,255,0.02) 100%);
    border: 1px solid rgba(0,212,255,0.15);
    text-align: center;
    padding: 12px 16px;
    margin-bottom: 8px;
}

/* "Toutes les missions" — full width row above project filters */
.filter-all-row {
    padding: 4px 0 0;
}
.filter-all-row .filter-all {
    width: 100%;
    text-align: center;
    font-weight: 600;
}

/* Project filter chips — 4 equal columns */
.mission-filters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 4px 0 8px;
}

.filter-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 7px 6px;
    border-radius: 10px;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    text-align: center;
}
.filter-chip.active {
    background: rgba(0,212,255,0.12);
    border-color: var(--cyan);
    color: var(--cyan);
}

.mission-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: relative;
    overflow: hidden;
}
.mission-card.in-progress {
    border-left: 3px solid var(--cyan);
}

.mission-check {
    flex-shrink: 0;
    cursor: pointer;
    padding-top: 2px;
}
.mission-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mission-check:hover .mission-checkbox {
    border-color: var(--cyan);
    background: rgba(0,212,255,0.1);
}

.mission-body {
    flex: 1;
    min-width: 0;
}
.mission-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
    word-break: break-word;
}
.mission-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
    align-items: center;
    font-size: 11px;
}
.mission-project {
    font-weight: 600;
}
.mission-badge-qw {
    background: rgba(0,212,255,0.15);
    color: var(--cyan);
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
}
.mission-effort {
    color: var(--text-dim);
    font-size: 10px;
    letter-spacing: 1px;
}
.mission-time {
    color: var(--text-dim);
}
.mission-due {
    color: var(--text-dim);
}
.mission-due-time {
    color: var(--cyan);
    font-weight: 500;
}

.mission-actions {
    flex-shrink: 0;
    display: flex;
    gap: 4px;
}
.mission-snooze {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 4px;
}
.mission-snooze:hover { opacity: 1; }

/* Done animation */
.mission-card.done-slide {
    transform: translateX(100%);
    opacity: 0;
}

/* Points popup — fixed on body, floats up with glow */
.points-popup {
    position: fixed;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: 800;
    color: var(--cyan);
    animation: floatUp 1.5s ease forwards;
    pointer-events: none;
    z-index: 9999;
    text-shadow: 0 0 15px rgba(0,212,255,0.7), 0 0 30px rgba(0,212,255,0.3);
}
@keyframes floatUp {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    30% { opacity: 1; transform: translate(-50%, -50%) scale(1.4); }
    100% { opacity: 0; transform: translate(-50%, calc(-50% - 60px)) scale(0.8); }
}

/* FAB */
.mission-fab {
    position: fixed;
    bottom: calc(var(--nav-h) + 70px);
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--cyan);
    color: var(--bg);
    border: none;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,212,255,0.3);
    z-index: 100;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mission-fab:active { transform: scale(0.9); }

/* Modal ajout mission */
.mission-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9998;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s;
}
.mission-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 500px;
    padding: 20px;
    animation: slideUp 0.25s ease;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.mission-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--cyan);
}
.mission-modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 22px;
    cursor: pointer;
}
.mission-modal-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mission-input {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}
.mission-input:focus {
    outline: none;
    border-color: var(--cyan);
}
.mission-input-sm {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--text);
    font-size: 14px;
    width: 60px;
    text-align: center;
}
.mission-select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--text);
    font-size: 13px;
    flex: 1;
}
.mission-modal-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
/* Skull picker (pénibilité) */
.mm-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mm-label {
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.skull-picker {
    display: flex;
    gap: 8px;
}
.skull {
    font-size: 24px;
    cursor: pointer;
    opacity: 0.25;
    transition: all 0.15s;
    filter: grayscale(1);
    user-select: none;
}
.skull.active {
    opacity: 1;
    filter: grayscale(0);
    transform: scale(1.1);
}
.skull:hover {
    transform: scale(1.2);
}
.skull-hint {
    font-size: 11px;
    color: var(--cyan);
    font-style: italic;
    min-height: 14px;
}

/* Star picker (importance) — same pattern as skulls */
.star-picker { display: flex; gap: 8px; }
.star {
    font-size: 22px; cursor: pointer; opacity: 0.25;
    transition: all 0.15s; filter: grayscale(1); user-select: none;
}
.star.active { opacity: 1; filter: grayscale(0); transform: scale(1.1); }
.star:hover { transform: scale(1.2); }
.star-hint { font-size: 11px; color: #f1c40f; font-style: italic; min-height: 14px; }

/* Time chips */
.time-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.time-chip {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.time-chip.active {
    background: rgba(0,212,255,0.12);
    border-color: var(--cyan);
    color: var(--cyan);
    font-weight: 600;
}
.time-chip:hover {
    border-color: var(--cyan);
}
.mission-modal-save {
    background: var(--cyan);
    color: var(--bg);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    width: 100%;
    transition: opacity 0.2s;
}
.mission-modal-save:active { opacity: 0.8; }

/* Edit modal — actions row */
.mission-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
.mission-modal-actions .mission-modal-save {
    flex: 1;
    margin-top: 0;
}
.mission-modal-delete {
    background: transparent;
    color: #e74c3c;
    border: 1px solid #e74c3c;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.mission-modal-delete:active { background: rgba(231,76,60,0.15); }

/* Mission body clickable hint */
.mission-body { cursor: pointer; }
.mission-body:active { opacity: 0.7; }

/* Section titles missions */
#missionsPage .section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}


/* ═══ STANDALONE PWA (installed) ═══ */
@media (display-mode: standalone) {
    #appHeader {
        padding-top: var(--safe-top);
        height: calc(var(--header-h) + var(--safe-top));
    }
    #bottomNav {
        padding-bottom: var(--safe-bottom);
        height: calc(var(--nav-h) + var(--safe-bottom));
    }
    #loginOverlay {
        padding-top: var(--safe-top);
    }
}
