:root {
    --bg-primary: #12151b;
    --bg-card: #1b212c;
    --border: #2a3446;
    --accent-blastov: #e65100;
    --accent-blastov-glow: rgba(230, 81, 0, 0.2);
    --accent-jw: #0288d1;
    --accent-jw-glow: rgba(2, 136, 209, 0.2);
    --accent-gold: #c5a059;
    --accent-shield: #ffd54f;
    --text-main: #e0e6ed;
    --text-muted: #8b9bb4;
    --danger: #ef5350;
    --postit-bg: #fff3a8;
    --postit-text: #2c2505;
    --postit-header: #eedb6d;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    padding: 20px;
    min-height: 100vh;
}

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

.title-area h1 {
    font-size: 1.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--accent-gold);
}

.sync-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

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

.sound-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.sound-toggle:hover {
    border-color: var(--accent-gold);
}

.clock-area {
    font-family: monospace;
    font-size: 1.3rem;
    color: var(--text-main);
    background: var(--bg-card);
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* Bandeau Météo */
.weather-strip {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 14px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.95rem;
}

.weather-city {
    font-weight: 600;
    color: var(--accent-gold);
    letter-spacing: 0.5px;
}

.weather-details {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-main);
    font-family: monospace;
    font-size: 0.95rem;
}

.weather-sep {
    color: var(--border);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.card-blastov { border-top: 4px solid var(--accent-blastov); }
.card-jw { border-top: 4px solid var(--accent-jw); }
.card-agenda { border-top: 4px solid var(--accent-gold); }
.card-notes { border-top: 4px solid #a855f7; }

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

.card-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
}

.card-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-reorder {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.75rem;
    cursor: pointer;
    line-height: 1;
}

.btn-reorder:hover {
    color: var(--text-main);
    border-color: var(--accent-gold);
    background: rgba(255, 255, 255, 0.1);
}

.badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
}

.badge-blastov { background: var(--accent-blastov-glow); color: var(--accent-blastov); }
.badge-jw { background: var(--accent-jw-glow); color: var(--accent-jw); }
.badge-agenda { background: rgba(197, 160, 89, 0.2); color: var(--accent-gold); }
.badge-notes { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

/* Minuteurs */
.timer-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timer-item {
    background: rgba(0, 0, 0, 0.25);
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timer-item.shield {
    border-left: 3px solid var(--accent-shield);
    background: rgba(255, 213, 79, 0.05);
}

.timer-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.timer-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.timer-countdown {
    font-family: monospace;
    font-size: 1.15rem;
    font-weight: bold;
    color: #fff;
}

.timer-actions button {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.timer-actions button:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.add-timer-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.15);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.timer-row-voice {
    display: grid;
    grid-template-columns: 1fr 32px 45px 45px 45px 34px;
    gap: 5px;
}

input {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 6px 8px;
    border-radius: 4px;
    outline: none;
    font-size: 0.85rem;
}

input:focus { border-color: var(--accent-gold); }

.btn-add {
    background: var(--border);
    border: none;
    color: var(--text-main);
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

.btn-add:hover { background: #38455c; }

/* Boutons Dictée Vocale */
.btn-voice {
    background: #7e22ce;
    border: none;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.2s ease;
}

.btn-voice.recording {
    background: var(--danger) !important;
    animation: pulse-rec 0.9s infinite alternate;
}

@keyframes pulse-rec {
    from { opacity: 0.7; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1.08); }
}

/* Agenda */
.agenda-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.agenda-subtitle {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-gold);
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding-bottom: 4px;
}

.merge-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(168, 85, 247, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--accent-gold);
}

.agenda-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.agenda-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.88rem;
    gap: 8px;
}

.agenda-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.agenda-cb {
    accent-color: var(--accent-gold);
    cursor: pointer;
}

.agenda-time {
    font-family: monospace;
    color: var(--accent-gold);
    font-weight: 600;
}

.agenda-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
}

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

.add-agenda-row {
    display: grid;
    grid-template-columns: 75px 1fr 32px 34px;
    gap: 5px;
    margin-top: 4px;
}

/* Notes & Fusion */
.notes-input-bar {
    display: flex;
    gap: 6px;
}

.notes-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    min-height: 28px;
}

.btn-merge {
    background: #9333ea;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.75rem;
}

.btn-merge:hover { background: #a855f7; }

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
}

.note-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.note-checkbox {
    cursor: pointer;
    accent-color: #a855f7;
}

.note-text {
    flex: 1;
    word-break: break-word;
    white-space: pre-line;
}

.note-btn-group {
    display: flex;
    gap: 4px;
}

.note-btn-group button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 2px 4px;
}

.note-btn-group button:hover {
    color: #fff;
}

.migrate-pop {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 8px;
    border-radius: 6px;
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 6px;
}

/* Post-it Flottant */
#postit-layer {
    position: fixed;
    top: 90px;
    right: 20px;
    width: 260px;
    background: var(--postit-bg);
    color: var(--postit-text);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border-radius: 2px;
    z-index: 1000;
    display: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transform: rotate(-1deg);
}

.postit-bar {
    background: var(--postit-header);
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    font-weight: 600;
    font-size: 0.8rem;
}

.postit-close {
    background: none;
    border: none;
    font-weight: bold;
    font-size: 1.4rem;
    line-height: 1;
    padding: 4px 10px;
    cursor: pointer;
    color: var(--postit-text);
}

.postit-body {
    padding: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    white-space: pre-wrap;
    max-height: 320px;
    overflow-y: auto;
}

/* Mobile */
@media (max-width: 600px) {
    body { padding: 8px; }
    header {
        margin-bottom: 8px;
        padding-bottom: 6px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .title-area h1 { font-size: 1.15rem; }
    .header-controls { width: 100%; justify-content: space-between; }
    .sound-toggle { padding: 4px 8px; font-size: 0.75rem; }
    .clock-area { font-size: 1rem; padding: 3px 8px; }
    .weather-strip { margin-bottom: 10px; padding: 6px 8px; font-size: 0.8rem; gap: 6px; }
    .weather-details { font-size: 0.8rem; gap: 6px; }
    .dashboard-grid { grid-template-columns: 1fr; gap: 10px; }
    .card { padding: 10px; gap: 8px; border-radius: 6px; }
    .card-title { font-size: 1rem; }
    .badge { font-size: 0.65rem; padding: 1px 6px; }
    .btn-reorder { padding: 3px 8px; font-size: 0.8rem; }
    .timer-list { gap: 5px; }
    .timer-item { padding: 5px 8px; }
    .timer-label { font-size: 0.75rem; }
    .timer-countdown { font-size: 0.95rem; }
    .timer-actions button { padding: 2px 6px; font-size: 0.8rem; }
    .add-timer-box { padding: 6px; gap: 5px; }
    .timer-row-voice { grid-template-columns: 1fr 28px 36px 36px 36px 28px; gap: 4px; }
    input { padding: 4px 5px; font-size: 0.75rem; }
    .btn-add { font-size: 0.85rem; }
    .btn-voice { font-size: 0.8rem; padding: 0 4px; }
    .agenda-subtitle { font-size: 0.75rem; padding-bottom: 2px; }
    .agenda-list { gap: 4px; }
    .agenda-item { padding: 5px 8px; font-size: 0.8rem; }
    .agenda-time { font-size: 0.8rem; }
    .add-agenda-row { grid-template-columns: 55px 1fr 28px 28px; gap: 4px; }
    #postit-layer { width: 85%; right: 7.5%; top: 70px; }
}
/* Entretien & Atelier */
.card-maintenance { border-top: 4px solid #10b981; }
.badge-maintenance { background: rgba(16, 185, 129, 0.2); color: #34d399; }

.maintenance-input-bar { display: flex; gap: 6px; }
.maintenance-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
}

.maintenance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.task-info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.task-title { font-weight: 500; color: var(--text-main); }
.task-last-date { font-size: 0.72rem; color: var(--text-muted); font-family: monospace; }

.task-actions { display: flex; gap: 4px; align-items: center; }
.btn-done-today {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.72rem;
    cursor: pointer;
}
.btn-done-today:hover { background: rgba(16, 185, 129, 0.3); }

.btn-plan-agenda {
    background: rgba(197, 160, 89, 0.15);
    border: 1px solid rgba(197, 160, 89, 0.4);
    color: var(--accent-gold);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.72rem;
    cursor: pointer;
}
.btn-plan-agenda:hover { background: rgba(197, 160, 89, 0.3); }

/* Foot & Pronostics */
.card-foot { border-top: 4px solid #3b82f6; }
.badge-foot { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }

.foot-section-title {
    font-size: 0.8rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.table-compact-wrapper { overflow-x: auto; }
.foot-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    text-align: left;
}
.foot-table th, .foot-table td {
    padding: 5px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.foot-table th { color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase; }
.foot-table tr.highlight-team {
    background: rgba(59, 130, 246, 0.12);
    font-weight: bold;
    color: #93c5fd;
}

.prono-summary-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 8px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.prono-status { font-size: 0.75rem; color: var(--text-muted); }
.parieur-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    padding: 3px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.parieur-me {
    font-weight: bold;
    color: #ffd54f;
    background: rgba(255, 213, 79, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
}
/* Cartes L1 & TTN */
.card-l1 { border-top: 4px solid #3b82f6; }
.badge-l1 { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }

.card-ttn { border-top: 4px solid #f59e0b; }
.badge-ttn { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }

/* Résultats des matchs de la journée */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 220px;
    overflow-y: auto;
}
.match-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}
.match-item.highlight-match {
    border-left: 3px solid #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}
.match-teams { flex: 1; display: flex; align-items: center; gap: 6px; }
.match-team { font-weight: 500; }
.match-score {
    font-family: monospace;
    font-weight: bold;
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    min-width: 40px;
    text-align: center;
}
.match-status {
    font-size: 0.7rem;
    color: var(--text-muted);
    min-width: 45px;
    text-align: right;
}

/* Simulation en direct TTN */
.live-prono-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 8px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.live-prono-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}
.live-score-badge {
    font-size: 0.95rem;
    font-weight: bold;
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.live-matches-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
}
.live-match-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.78rem;
}
.live-match-pts {
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 3px;
}
.pts-exact { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.pts-good { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.pts-zero { background: rgba(239, 68, 68, 0.1); color: #f87171; }

/* Bandeau discret d'éclairage */
.lights-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card, #1c212b);
    border: 1px solid var(--border, #2d3748);
    border-radius: 8px;
    padding: 6px 14px;
    margin: 6px auto 14px auto;
    max-width: 1400px;
    font-size: 0.85rem;
}

.lights-title {
    color: var(--text-muted, #94a3b8);
    font-weight: 500;
}

.light-toggle-btn {
    background: transparent;
    border: 1px solid var(--border, #374151);
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Bouton action simple (Toutes) : neutre */
.light-toggle-btn.action-only {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.05);
}
.light-toggle-btn.action-only:active {
    background: rgba(255, 255, 255, 0.15);
}

/* État ÉTEINT : terne et discret */
.light-toggle-btn.is-off {
    color: #64748b;
    border-color: #334155;
    background: rgba(0, 0, 0, 0.2);
}

/* État ALLUMÉ : highlight doré éclatant */
.light-toggle-btn.is-on {
    color: #0f172a;
    background: #f59e0b;
    border-color: #fbbf24;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
}