/* REGIE LIVE MESSENGER — Styles */

:root {
    --bg-dark: #0d1117;
    --bg-panel: #161b22;
    --bg-card: #1c2128;
    --bg-hover: #262c36;
    --text-primary: #f0f3f6;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --border: #30363d;
    --blue: #388bfd;
    --blue-bg: rgba(56, 139, 253, 0.15);
    --orange: #f0883e;
    --orange-bg: rgba(240, 136, 62, 0.18);
    --red: #f85149;
    --red-bg: rgba(248, 81, 73, 0.2);
    --green: #3fb950;
    --green-bg: rgba(63, 185, 80, 0.18);
    --chat: #a371f7;
    --chat-bg: rgba(163, 113, 247, 0.2);
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
}

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

a:hover {
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem;
}

.container-narrow {
    max-width: 640px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, opacity 0.15s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

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

.btn-large {
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
    min-height: 56px;
}

.btn-small {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--blue);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #4d9aff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red);
}

.btn-danger:hover {
    background: var(--red);
    color: #fff;
}

.btn-send {
    width: 100%;
    background: linear-gradient(135deg, #238636, #2ea043);
    color: #fff;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
    min-height: 64px;
    box-shadow: var(--shadow);
}

.btn-send:hover:not(:disabled) {
    background: linear-gradient(135deg, #2ea043, #3fb950);
}

.btn-ack {
    width: 100%;
    background: var(--green);
    color: #fff;
    font-size: 1.25rem;
    min-height: 64px;
    margin-top: 1rem;
}

.btn-ack:hover {
    background: #46c35a;
}

/* Accueil professionnel */
.page-home {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.home-landing {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

.home-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(56, 139, 253, 0.18), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(163, 113, 247, 0.1), transparent);
}

.home-hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.home-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--green);
    background: var(--green-bg);
    border: 1px solid rgba(63, 185, 80, 0.35);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
}

.home-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.home-title {
    font-size: clamp(1.75rem, 7vw, 2.35rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.home-title span {
    display: block;
    font-size: 0.55em;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--blue);
    margin-top: 0.15rem;
}

.home-tagline {
    font-size: 1.05rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.75rem;
    line-height: 1.45;
}

.home-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
    max-width: 400px;
    margin: 0 auto;
}

.home-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.home-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: inherit;
    text-decoration: none;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s, background 0.15s;
    box-shadow: var(--shadow);
    touch-action: manipulation;
}

.home-btn:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

.home-btn-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.home-btn-text {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.home-btn-text strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.home-btn-text small {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.home-btn-arrow {
    font-size: 1.35rem;
    opacity: 0.5;
    flex-shrink: 0;
}

.home-btn-admin:hover {
    border-color: var(--blue);
    background: var(--blue-bg);
    box-shadow: 0 8px 32px rgba(56, 139, 253, 0.2);
}

.home-btn-admin:hover .home-btn-text strong {
    color: var(--blue);
}

.home-btn-team:hover {
    border-color: var(--green);
    background: var(--green-bg);
    box-shadow: 0 8px 32px rgba(63, 185, 80, 0.15);
}

.home-btn-team:hover .home-btn-text strong {
    color: var(--green);
}

.home-features {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    margin-bottom: 1.5rem;
    padding: 0;
}

.home-features li {
    font-size: 0.8rem;
    color: var(--text-muted);
    position: relative;
    padding-left: 1rem;
}

.home-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-muted);
}

.home-stats {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.home-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.hint {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Login */
.login-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.login-box h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.login-box p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.login-box input {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1.125rem;
    text-align: center;
}

.login-box input:focus {
    outline: none;
    border-color: var(--blue);
}

.error-msg {
    color: var(--red);
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.back-link {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Admin panel */
.admin-panel {
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: 2rem;
}

.admin-header {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.admin-header h1 {
    font-size: 1.35rem;
}

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

.status-line {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

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

.status-dot.online {
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
}

/* Admin onglets */
.admin-tabs {
    display: flex;
    gap: 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 56px;
    z-index: 90;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-tab {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 0.5rem;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation;
}

.admin-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.admin-tab.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
}

.admin-tab-chat.active {
    color: var(--chat);
    border-bottom-color: var(--chat);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.tab-panel[hidden] {
    display: none !important;
}

.admin-main {
    padding: 1rem 1.25rem;
    max-width: 900px;
    margin: 0 auto;
}

.tab-panel-chat {
    max-width: none;
    padding: 0;
    margin: 0 -1.25rem;
}

@media (min-width: 768px) {
    .tab-panel-chat {
        margin: 0 auto;
        max-width: 900px;
    }
}

/* Admin chat */
.chat-intro {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.75rem 1.25rem 0;
    margin: 0;
}

.chat-layout {
    display: flex;
    min-height: calc(100dvh - 180px);
    max-height: calc(100dvh - 140px);
    border-top: 1px solid var(--border);
}

.chat-contacts {
    width: 38%;
    max-width: 200px;
    min-width: 120px;
    border-right: 1px solid var(--border);
    background: var(--bg-panel);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
}

.chat-contacts-empty {
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

.chat-contact {
    display: block;
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    border-left: 3px solid transparent;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.chat-contact:hover {
    background: var(--bg-hover);
}

.chat-contact.active {
    background: var(--chat-bg);
    border-left-color: var(--chat);
    color: var(--chat);
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-dark);
}

.chat-main-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.chat-header-name {
    font-weight: 700;
    font-size: 1rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.chat-placeholder {
    color: var(--text-muted);
    text-align: center;
    margin: auto;
    font-size: 0.9rem;
    padding: 1rem;
}

.chat-bubble {
    max-width: 92%;
    align-self: flex-end;
    padding: 0.65rem 0.85rem;
    border-radius: 14px 14px 4px 14px;
    background: var(--chat-bg);
    border: 1px solid rgba(163, 113, 247, 0.35);
}

.chat-bubble-out p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
}

.chat-bubble-time {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    text-align: right;
}

.chat-bubble-seen {
    color: var(--green);
}

.chat-compose {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    background: var(--bg-panel);
    align-items: flex-end;
}

.chat-compose textarea {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    min-height: 44px;
}

.chat-compose textarea:focus {
    outline: none;
    border-color: var(--chat);
}

.btn-chat-send {
    flex-shrink: 0;
    min-height: 44px;
    background: var(--chat);
}

.btn-chat-send:hover {
    filter: brightness(1.1);
}

.chat-mode-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
}

.chat-mode-btn {
    flex: 1;
    padding: 0.65rem 0.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.chat-mode-btn.active {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--blue-bg);
}

.chat-mode-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-broadcast-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.chat-broadcast-bar .input-large {
    flex: 1;
    font-size: 0.95rem;
}

.btn-broadcast {
    flex-shrink: 0;
    white-space: nowrap;
}

.inbox-badge {
    display: inline-block;
    min-width: 1.1rem;
    padding: 0.1rem 0.35rem;
    margin-left: 0.25rem;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
}

.chat-inbox-wrap {
    flex: 1;
    min-height: 280px;
    max-height: calc(100dvh - 220px);
    display: flex;
    flex-direction: column;
}

.chat-messages-inbox {
    flex: 1;
    min-height: 280px;
}

.chat-bubble-in {
    align-self: flex-start;
    max-width: 92%;
    background: var(--green-bg);
    border: 1px solid rgba(63, 185, 80, 0.35);
    border-radius: 14px 14px 14px 4px;
}

.chat-bubble-from {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--green);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.receiver-to-admin {
    flex-shrink: 0;
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    padding: 0.85rem 1rem;
}

.receiver-to-admin h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--green);
    margin-bottom: 0.35rem;
}

.receiver-to-admin textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
}

.receiver-to-admin textarea:focus {
    outline: none;
    border-color: var(--green);
}

/* Paramètres admin */
.settings-form {
    max-width: 420px;
}

.settings-hint {
    margin-bottom: 1rem;
}

/* Palettes — sélection admin */
.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
}

.palette-swatch {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    cursor: pointer;
    font-family: inherit;
    color: var(--text-primary);
    transition: border-color 0.15s, transform 0.1s;
    touch-action: manipulation;
}

.palette-swatch:hover {
    border-color: var(--swatch-accent, var(--blue));
}

.palette-swatch.selected {
    border-color: var(--swatch-accent, var(--blue));
    box-shadow: 0 0 0 1px var(--swatch-accent, var(--blue));
}

.palette-swatch-preview {
    display: block;
    height: 36px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--bg-dark) 40%, var(--swatch-accent, var(--blue)) 100%);
    border: 1px solid var(--border);
}

.palette-swatch-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.sound-toggle {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sound-opt {
    flex: 1;
    min-width: 140px;
    padding: 0.85rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.sound-opt:hover {
    background: var(--bg-hover);
}

.sound-opt.active {
    border-color: var(--green);
    background: var(--green-bg);
    color: var(--green);
}

/* Liens partagés — admin */
.shared-links-list {
    list-style: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.shared-link-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

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

.shared-link-info {
    flex: 1;
    min-width: 180px;
}

.shared-link-info strong {
    display: block;
    margin-bottom: 0.35rem;
}

.shared-link-url {
    display: block;
    font-size: 0.85rem;
    word-break: break-all;
    color: var(--blue);
    text-decoration: none;
}

.shared-link-url:hover {
    text-decoration: underline;
}

.shared-link-time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.shared-link-empty {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.shared-link-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

/* Lien membre → régie */
.receiver-share {
    flex-shrink: 0;
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    padding: 0.85rem 1rem;
}

.receiver-share h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.share-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    line-height: 1.4;
}

.share-link-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.share-link-form .input-large {
    font-size: 0.95rem;
}

.share-link-status {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.share-link-status.success {
    color: var(--green);
}

.share-link-status.error {
    color: var(--red);
}

.share-link-current {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

/* Pop-up message membre (fenêtre réduite / arrière-plan) */
.toast-container {
    position: fixed;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(360px, calc(100vw - 1.5rem));
    pointer-events: none;
}

.message-toast {
    pointer-events: auto;
    padding: 1rem 1.1rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    background: var(--bg-card);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
    cursor: pointer;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.message-toast.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.message-toast-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
    opacity: 0.85;
}

.message-toast-text {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.25;
    word-break: break-word;
}

.message-toast-time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

.message-toast.toast-blue {
    border-color: var(--blue);
    background: var(--blue-bg);
}

.message-toast.toast-blue .message-toast-text { color: var(--blue); }

.message-toast.toast-orange {
    border-color: var(--orange);
    background: var(--orange-bg);
}

.message-toast.toast-orange .message-toast-text { color: var(--orange); }

.message-toast.toast-red {
    border-color: var(--red);
    background: var(--red-bg);
}

.message-toast.toast-red .message-toast-text { color: var(--red); }

.message-toast.toast-chat {
    border-color: var(--chat);
    background: var(--chat-bg);
}

.message-toast.toast-chat .message-toast-text {
    color: #d2a8ff;
    font-size: 1.35rem;
}

@media (max-width: 480px) {
    .toast-container {
        right: 0.5rem;
        bottom: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }
}

.panel-section {
    margin-bottom: 1.75rem;
}

.panel-section h2 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.optional {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
}

/* Recipient grid */
.recipient-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
}

.recipient-btn {
    padding: 1rem 0.75rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    touch-action: manipulation;
}

.recipient-btn:hover {
    background: var(--bg-hover);
    border-color: var(--blue);
}

.recipient-btn.selected {
    background: var(--blue-bg);
    border-color: var(--blue);
    color: var(--blue);
}

.selected-label {
    margin-top: 0.6rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.selected-label.has-selection {
    color: var(--blue);
    font-weight: 600;
}

.recipient-empty {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: 1rem;
    text-align: center;
}

/* Team management */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.section-header-row h2 {
    margin-bottom: 0;
}

.team-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.form-row {
    margin-bottom: 0.85rem;
}

.form-row label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.form-hint code {
    color: var(--blue);
    font-size: 0.85em;
}

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

.input-readonly {
    opacity: 0.7;
    cursor: not-allowed;
}

.team-feedback {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
}

.team-feedback.success {
    color: var(--green);
    background: var(--green-bg);
}

.team-feedback.error {
    color: var(--red);
    background: var(--red-bg);
}

.team-list {
    list-style: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.team-list li {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
}

.team-list li:last-child {
    border-bottom: none;
}

.team-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.team-item-info {
    flex: 1;
    min-width: 140px;
}

.team-item-info strong {
    display: block;
    font-size: 1rem;
}

.team-item-link {
    display: block;
    font-size: 0.75rem;
    color: var(--blue);
    font-family: monospace;
}

.team-item-link-alt {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.team-item-actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.team-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 1.25rem !important;
}

/* Type grid */
.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
}

.type-btn {
    padding: 0.85rem 0.6rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    touch-action: manipulation;
}

.type-btn.type-blue { border-color: rgba(56, 139, 253, 0.4); }
.type-btn.type-orange { border-color: rgba(240, 136, 62, 0.4); }
.type-btn.type-red { border-color: rgba(248, 81, 73, 0.4); }

.type-btn:hover {
    background: var(--bg-hover);
}

.type-btn.selected {
    font-weight: 700;
}

.type-btn.type-blue.selected {
    background: var(--blue-bg);
    border-color: var(--blue);
    color: var(--blue);
}

.type-btn.type-orange.selected {
    background: var(--orange-bg);
    border-color: var(--orange);
    color: var(--orange);
}

.type-btn.type-red.selected {
    background: var(--red-bg);
    border-color: var(--red);
    color: var(--red);
}

.input-large {
    width: 100%;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: inherit;
}

.input-large:focus {
    outline: none;
    border-color: var(--blue);
}

.send-feedback {
    text-align: center;
    margin-top: 0.75rem;
    font-weight: 600;
    padding: 0.5rem;
    border-radius: var(--radius);
}

.send-feedback.success {
    color: var(--green);
    background: var(--green-bg);
}

.send-feedback.error {
    color: var(--red);
    background: var(--red-bg);
}

/* History */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.history-list {
    list-style: none;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.history-list li {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.history-list li:last-child {
    border-bottom: none;
}

.history-item-top {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.history-recipient {
    font-weight: 700;
    color: var(--blue);
}

.history-time {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.history-text {
    color: var(--text-primary);
}

.history-status {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.history-status.seen {
    color: var(--green);
}

.history-status.sent {
    color: var(--orange);
}

.history-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 1.5rem !important;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-chat { background: var(--chat-bg); color: var(--chat); }

/* Receiver — liste des postes */
.page-receiver-picker {
    min-height: 100vh;
    min-height: 100dvh;
}

.picker-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 1.25rem;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.picker-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.picker-header h1 {
    font-size: 1.5rem;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.picker-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    flex: 1;
}

.picker-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    touch-action: manipulation;
    min-height: 72px;
}

.picker-card:hover,
.picker-card:active {
    background: var(--blue-bg);
    border-color: var(--blue);
    color: var(--blue);
    text-decoration: none;
    transform: scale(0.98);
}

.picker-card-name {
    flex: 1;
}

.picker-card-arrow {
    font-size: 1.25rem;
    opacity: 0.6;
}

.picker-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 1rem;
    line-height: 1.6;
}

.picker-footer {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.card-receiver {
    margin-top: 0;
}

/* Receiver page */
.page-receiver {
    overflow-x: hidden;
}

.receiver-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.receiver-back:hover {
    background: var(--bg-hover);
    border-color: var(--blue);
    color: var(--blue);
    text-decoration: none;
}

.receiver-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.receiver-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.receiver-role {
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.connection-status {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.connection-status.active {
    color: var(--green);
}

.receiver-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    justify-content: center;
}

.message-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    min-height: 40vh;
    transition: background 0.3s, border-color 0.3s;
    border: 3px solid var(--border);
    background: var(--bg-card);
}

.message-display.message-empty {
    border-style: dashed;
}

.message-display .waiting-text {
    color: var(--text-muted);
    font-size: 1.25rem;
}

.message-display .message-text {
    font-size: clamp(1.75rem, 8vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
    word-break: break-word;
    animation: pulse-in 0.4s ease-out;
}

/* Chat régie — affichage très grand chez le membre */
.message-display.message-chat {
    min-height: 50vh;
    border-width: 4px;
}

.message-display.message-chat .message-text {
    font-size: clamp(2.25rem, 11vw, 4.75rem);
    line-height: 1.15;
}

.message-display.color-chat {
    background: var(--chat-bg);
    border-color: var(--chat);
}

.message-display.color-chat .message-text {
    color: #d2a8ff;
}

.message-display.message-chat.is-new {
    animation: flash-new 0.6s ease-out, urgent-pulse 2s ease-in-out infinite;
}

.message-display.color-blue {
    background: var(--blue-bg);
    border-color: var(--blue);
}

.message-display.color-blue .message-text {
    color: var(--blue);
}

.message-display.color-orange {
    background: var(--orange-bg);
    border-color: var(--orange);
}

.message-display.color-orange .message-text {
    color: var(--orange);
}

.message-display.color-red {
    background: var(--red-bg);
    border-color: var(--red);
    animation: urgent-pulse 1.5s ease-in-out infinite;
}

.message-display.color-red .message-text {
    color: var(--red);
}

.message-display.color-green {
    background: var(--green-bg);
    border-color: var(--green);
}

.message-display.color-green .message-text {
    color: var(--green);
}

.message-display.is-new {
    animation: flash-new 0.6s ease-out;
}

@keyframes pulse-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes flash-new {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 40px rgba(255, 255, 255, 0.15); }
}

@keyframes urgent-pulse {
    0%, 100% { border-color: var(--red); }
    50% { border-color: #ff8a84; }
}

.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding: 0 0.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.type-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Receiver history sidebar */
.receiver-history {
    flex-shrink: 0;
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    padding: 0.75rem 1rem 1.25rem;
    max-height: 28vh;
    overflow-y: auto;
}

.receiver-history h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

#receiver-history-list {
    list-style: none;
}

#receiver-history-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    display: flex;
    gap: 0.5rem;
}

#receiver-history-list li:last-child {
    border-bottom: none;
}

#receiver-history-list .hist-time {
    color: var(--text-muted);
    min-width: 52px;
    font-variant-numeric: tabular-nums;
}

#receiver-history-list .hist-text {
    flex: 1;
    color: var(--text-secondary);
}

#receiver-history-list li.hist-current .hist-text {
    color: var(--text-primary);
    font-weight: 600;
}

#receiver-history-list .hist-seen {
    color: var(--green);
    font-size: 0.7rem;
}

/* Error page */
.page-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.error-box {
    text-align: center;
    max-width: 400px;
}

.error-box h1 {
    margin-bottom: 1rem;
}

.error-box p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.error-box code {
    background: var(--bg-card);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Responsive */
@media (min-width: 768px) {
    .admin-main {
        padding: 1.5rem 2rem;
    }

    .recipient-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .receiver-wrap {
        max-width: 800px;
        margin: 0 auto;
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
}

@media (max-width: 480px) {
    .type-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .recipient-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Alertes mobile (membre) */
.mobile-alerts-banner {
    margin: 0;
    padding: 0.85rem 1rem;
    background: linear-gradient(180deg, rgba(63, 185, 80, 0.18) 0%, rgba(63, 185, 80, 0.06) 100%);
    border-bottom: 2px solid rgba(63, 185, 80, 0.45);
}

.mobile-alerts-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--green);
    margin-bottom: 0.35rem;
}

.mobile-alerts-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.65rem;
    line-height: 1.35;
}

.mobile-alerts-hint {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    line-height: 1.3;
}

.mobile-alerts-status {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.mobile-alerts-status.success {
    color: var(--green);
}

.mobile-alerts-status.error {
    color: var(--red);
}

.mobile-alerts-banner .btn-large {
    width: 100%;
}

/* Compte à rebours global */
.countdown-banner {
    position: sticky;
    top: 0;
    z-index: 200;
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 50%, #ef4444 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.45);
    border-bottom: 3px solid rgba(255, 255, 255, 0.25);
}

.countdown-banner-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.65rem 1rem;
    text-align: center;
}

.countdown-banner-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.92;
}

.countdown-banner-time {
    font-size: clamp(2.25rem, 10vw, 3.5rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: 0.04em;
}

.countdown-banner.countdown-urgent {
    animation: countdown-pulse 0.85s ease-in-out infinite;
}

@keyframes countdown-pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.countdown-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.countdown-admin-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1.25rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 2px solid var(--border);
    text-align: center;
}

.countdown-admin-display.countdown-active {
    border-color: var(--red);
    background: rgba(248, 81, 73, 0.08);
}

.countdown-admin-display .countdown-admin-time,
#countdown-admin-time {
    font-size: 2.5rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.countdown-admin-display.countdown-active #countdown-admin-time {
    color: var(--red);
}

.countdown-admin-label,
#countdown-admin-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.countdown-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.countdown-custom {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.countdown-custom .input-large {
    flex: 1;
    min-width: 100px;
}

.page-receiver-picker .countdown-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

.page-receiver-picker .picker-wrap {
    padding-top: 0;
}

.page-receiver-picker:has(.countdown-banner:not([hidden])) .picker-wrap {
    padding-top: 5.5rem;
}

/* Utility */
[hidden] {
    display: none !important;
}
