:root {
  --bg: #080808;
  --bg-card: #101010;
  --bg-hover: #181818;
  --border: #2a2a2a;
  --text: #f4f4f4;
  --text-muted: #9a9a9a;
  --accent: #ffffff;
  --accent-hover: #e8e8e8;
  --accent-soft: rgba(255, 255, 255, 0.07);
  --accent-mid: rgba(255, 255, 255, 0.12);
  --accent-border: rgba(255, 255, 255, 0.2);
  --success: #d4d4d4;
  --warning: #b0b0b0;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --steam: #1a1a1a;
  --steam-hover: #2a2a2a;
  --radius: 10px;
  --sidebar-w: 260px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: none; }
}

@keyframes chatMsgIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: radial-gradient(ellipse at top, #1a1a1a 0%, var(--bg) 65%); }
.login-screen { width: 100%; max-width: 420px; padding: 1rem; }
.login-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem 2rem; text-align: center; }
.login-brand h1 { font-size: 1.4rem; margin: 1rem 0 0.5rem; }
.login-brand p { color: var(--text-muted); font-size: 0.9rem; }
.login-hint { color: var(--text-muted); font-size: 0.8rem; margin-top: 1.5rem; }
.brand-icon { width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg, #fff, #a3a3a3); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.4rem; color: #0a0a0a; }
.brand-icon.sm { width: 40px; height: 40px; font-size: 0.9rem; border-radius: 10px; }
.brand-logo { width: 80px; height: 80px; object-fit: contain; border-radius: 16px; }
.brand-logo.sm { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; }
.dev-login { margin-top: 1.25rem; text-align: left; }
.dev-login-divider { display: flex; align-items: center; gap: 0.75rem; color: var(--text-muted); font-size: 0.75rem; margin-bottom: 0.85rem; }
.dev-login-divider::before, .dev-login-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.dev-login-form label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.dev-login-form select { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 0.55rem 0.7rem; border-radius: 8px; font-size: 0.9rem; margin-bottom: 0.75rem; }
.btn-dev { background: rgba(255,255,255,0.2); color: var(--accent-hover); border: 1px solid rgba(255,255,255,0.35); width: 100%; }
.btn-dev:hover { background: rgba(255,255,255,0.3); color: #fff; }
.dev-hint { margin-top: 0.65rem !important; font-size: 0.72rem !important; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.65rem 1.25rem; border-radius: 8px; border: none; font-size: 0.95rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: background 0.15s, transform 0.1s; }
.btn:active { transform: scale(0.98); }
.btn-steam { background: var(--steam); color: #c7d5e0; width: 100%; margin-top: 1rem; gap: 0.65rem; }
.btn-steam:hover { background: var(--steam-hover); color: #fff; }
.steam-logo-btn { object-fit: contain; flex-shrink: 0; filter: brightness(1.1); }

.sidebar-top-row { display: flex; align-items: stretch; gap: 0.35rem; padding: 0.75rem 0.75rem 0.25rem; }
.sidebar-top-row .nav-home { flex: 1; text-align: left; font-weight: 600; }
.notif-wrap { position: relative; flex-shrink: 0; }
.notif-bell { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid var(--border); background: var(--bg-hover); border-radius: 8px; color: var(--text-muted); cursor: pointer; position: relative; transition: border-color 0.15s, color 0.15s; }
.notif-bell:hover { border-color: var(--accent); color: var(--text); }
.notif-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; background: #d4d4d4; color: #0a0a0a; font-size: 0.65rem; font-weight: 700; border-radius: 999px; display: flex; align-items: center; justify-content: center; line-height: 1; }
.notif-badge[hidden] { display: none !important; }
.notif-panel { position: fixed; width: 300px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 48px rgba(0,0,0,0.5); z-index: 1000; overflow: hidden; }
.notif-panel[hidden] { display: none !important; }
.notif-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.notif-panel-head .btn { flex-shrink: 0; font-size: 0.75rem; padding: 0.35rem 0.6rem; }
.notif-list { overflow: visible; }
.notif-item { display: block; width: 100%; text-align: left; padding: 0.75rem 1rem; border: none; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; transition: background 0.12s; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-hover); }
.notif-item-title { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.2rem; }
.notif-item-msg { display: block; font-size: 0.75rem; color: var(--text-muted); line-height: 1.35; }
.notif-more { display: block; width: 100%; padding: 0.65rem 1rem; border: none; border-top: 1px solid var(--border); background: rgba(255,255,255,0.08); color: var(--accent-hover); font-size: 0.8rem; font-weight: 600; cursor: pointer; text-align: center; }
.notif-more:hover { background: rgba(255,255,255,0.14); }
.notif-empty { padding: 1.25rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; margin: 0; }

.filter-select, .filter-date { background: var(--bg-hover); border: 1px solid var(--border); color: var(--text); padding: 0.55rem 0.75rem; border-radius: 8px; font-size: 0.85rem; min-height: 42px; }
.panel-filters { flex-wrap: wrap; }
.panel-filters .search-input { flex: 1; min-width: 160px; }
.log-action-filter { margin-bottom: 1rem; max-width: 280px; }

.dashboard { display: flex; flex-direction: column; gap: 1rem; }
.dash-alert { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 1rem; border-radius: 10px; border: 1px solid var(--border); flex-wrap: wrap; }
.dash-alert-warn { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.35); }
.dash-alert-info { background: rgba(180,180,180,0.1); border-color: rgba(180,180,180,0.35); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.dash-notif-card { display: block; width: 100%; text-align: left; padding: 0.75rem; margin-bottom: 0.5rem; background: var(--bg-hover); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; color: var(--text); transition: border-color 0.15s; }
.dash-notif-card:hover { border-color: var(--accent); }
.dash-notif-card strong { display: block; font-size: 0.9rem; margin-bottom: 0.2rem; }
.dash-notif-card span { font-size: 0.8rem; color: var(--text-muted); }
.dash-ann-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.dash-ann-block { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.dash-ann-block h3 { font-size: 0.85rem; margin-bottom: 0.65rem; color: var(--accent-hover); }
.dash-ann-item { font-size: 0.85rem; padding: 0.35rem 0; border-bottom: 1px solid var(--border); }
.dash-ann-item small { color: var(--text-muted); }
.dash-quick-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.dash-quick { padding: 0.55rem 1rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; color: var(--text); cursor: pointer; font-size: 0.85rem; transition: border-color 0.15s; }
.dash-quick:hover { border-color: var(--accent); color: var(--accent-hover); }
.dash-role-badge { display: inline-block; margin-bottom: 0.75rem; }
.dash-top-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.dash-stat-card { padding: 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-hover); }
.dash-stat-card strong { display: block; font-size: 1.75rem; line-height: 1.1; margin-bottom: 0.2rem; }
.dash-stat-card span { font-size: 0.8rem; color: var(--text-muted); }
.dash-avail-card .avail-btns { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.65rem; }
.avail-btn { padding: 0.4rem 0.7rem; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text-muted); font-size: 0.78rem; cursor: pointer; }
.avail-btn.active { color: #fff; border-color: transparent; }
.avail-btn[data-status="online"].active { background: #22c55e; }
.avail-btn[data-status="busy"].active { background: #eab308; color: #111; }
.avail-btn[data-status="offline"].active { background: #6b7280; }
.avail-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.35rem; }
.avail-dot.online { background: #22c55e; }
.avail-dot.busy { background: #eab308; }
.avail-dot.offline { background: #6b7280; }
.dash-staff-online { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.dash-staff-chip { font-size: 0.75rem; padding: 0.2rem 0.5rem; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); }
.sa-req-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.sa-req-table th, .sa-req-table td { padding: 0.45rem 0.35rem; border-bottom: 1px solid var(--border); text-align: left; }
.sa-req-table th { color: var(--text-muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; }
.global-search-overlay { position: fixed; inset: 0; z-index: 1200; background: rgba(0,0,0,0.65); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 1rem 1rem; }
.global-search-modal { width: min(720px, 100%); background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.45); }
.global-search-group-label { padding: 0.45rem 1rem 0.25rem; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); background: var(--bg-hover); border-bottom: 1px solid var(--border); }
.global-search-input { width: 100%; border: none; border-bottom: 1px solid var(--border); background: var(--bg); color: var(--text); padding: 0.9rem 1rem; font-size: 1rem; outline: none; }
.global-search-results { max-height: 50vh; overflow-y: auto; }
.global-search-item { display: block; width: 100%; text-align: left; padding: 0.7rem 1rem; border: none; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; }
.global-search-item:hover { background: var(--bg-hover); }
.global-search-item small { display: block; color: var(--text-muted); font-size: 0.72rem; margin-top: 0.15rem; }
.global-search-empty { padding: 1rem; color: var(--text-muted); font-size: 0.85rem; }
.kbd-hint { font-size: 0.65rem; padding: 0.1rem 0.35rem; border: 1px solid var(--border); border-radius: 4px; margin-left: 0.35rem; opacity: 0.8; }
.page-header-row { gap: 0.75rem; }
.global-search-trigger { flex-shrink: 0; }
.task-card { padding: 0.85rem 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-hover); margin-bottom: 0.65rem; }
.task-card.done { opacity: 0.65; }
.task-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.35rem; }
.task-card-title { font-weight: 700; font-size: 0.95rem; }
.task-card-meta { font-size: 0.75rem; color: var(--text-muted); }
.task-card-desc { font-size: 0.85rem; color: var(--text-muted); margin: 0.35rem 0 0.65rem; line-height: 1.45; }
.broadcast-item { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.broadcast-item:last-child { border-bottom: none; }
.staff-info-link-row .btn { margin-bottom: 0.15rem; }
.btn-primary { background: #fff; color: #0a0a0a; }
.btn-primary:hover { background: #e0e0e0; color: #000; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }

.alert { padding: 0.75rem 1rem; border-radius: 8px; margin: 1rem 0; font-size: 0.9rem; text-align: left; }
.alert-error { background: rgba(200,200,200,0.12); border: 1px solid rgba(200,200,200,0.3); color: var(--danger); }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--bg-card); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 10; transition: width 0.25s var(--ease-out), opacity 0.2s; }
.app.sidebar-collapsed .sidebar { width: 0; min-width: 0; overflow: hidden; opacity: 0; pointer-events: none; border-right: none; }
.sidebar-brand { display: flex; align-items: center; gap: 0.75rem; padding: 1.25rem; border-bottom: 1px solid var(--border); }
.sidebar-brand-text { flex: 1; min-width: 0; }
.sidebar-brand strong { display: block; font-size: 0.95rem; }
.sidebar-brand span { font-size: 0.75rem; color: var(--text-muted); }
.sidebar-collapse-btn {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); cursor: pointer; line-height: 1; font-size: 1.1rem;
}
.sidebar-collapse-btn:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-toggle { flex-shrink: 0; min-width: 2.25rem; padding-left: 0.55rem; padding-right: 0.55rem; }
.site-logo-link { display: flex; align-items: center; flex-shrink: 0; line-height: 0; }
.site-header-logo { width: 38px; height: 38px; object-fit: contain; border-radius: 9px; display: block; }
.sidebar-nav { flex: 1; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.25rem; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.28) transparent; }
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.22); border-radius: 999px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }
.nav-section { margin-bottom: 0.5rem; }
.nav-section-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-hover); padding: 0.5rem 0.85rem 0.35rem; opacity: 0.9; }
.nav-sa-request { display: block; width: calc(100% - 1.5rem); margin: 0.35rem 0.75rem 0.65rem; padding: 0.55rem 0.75rem; border-radius: 8px; border: 1px solid rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.12); color: #fca5a5; font-weight: 700; font-size: 0.82rem; cursor: pointer; text-align: center; transition: background 0.15s, color 0.15s; }
.nav-sa-request:hover { background: rgba(239, 68, 68, 0.22); color: #fff; }
.nav-item { display: block; width: 100%; text-align: left; padding: 0.65rem 0.85rem; border: 1px solid transparent; background: transparent; color: var(--text-muted); border-radius: 8px; font-size: 0.9rem; cursor: pointer; transition: background 0.2s var(--ease-out), color 0.2s, transform 0.15s, border-color 0.2s; }
.nav-item:hover { background: var(--bg-hover); color: var(--text); transform: translateX(3px); }
.nav-item.active { background: var(--accent-mid); color: var(--accent); font-weight: 600; border-color: var(--accent-border); }
.sidebar-user { padding: 1rem; border-top: 1px solid var(--border); }
.user-info { margin-bottom: 0.75rem; }
.user-name { display: block; font-weight: 600; font-size: 0.9rem; }
.user-role { margin-top: 0.25rem; }

.main { margin-left: var(--sidebar-w); flex: 1; padding: 2rem; min-width: 0; overflow-x: hidden; transition: margin-left 0.25s var(--ease-out); }
.app.sidebar-collapsed .main { margin-left: 0; }
.content { overflow-x: hidden; max-width: 100%; }
.page-header { margin-bottom: 1.5rem; }
.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-header-titles { min-width: 0; flex: 1; }
.page-header h1 { font-size: 1.6rem; font-weight: 700; }
.page-header p { color: var(--text-muted); margin-top: 0.25rem; font-size: 0.9rem; }

.server-status-widget {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.75rem; border-radius: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 0.85rem; white-space: nowrap; flex-shrink: 0;
}
.server-status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0;
}
.server-status-widget.online .server-status-dot { background: var(--success); box-shadow: 0 0 6px rgba(255,255,255,0.6); }
.server-status-widget.offline .server-status-dot { background: var(--danger); }
.server-status-text strong { color: var(--text); font-weight: 700; }

.panel-event-screen {
  display: block; max-width: 100%; max-height: 320px; margin-top: 0.35rem;
  border-radius: 8px; border: 1px solid var(--border); cursor: pointer;
}
.panel-releve-media {
  display: block; max-width: 100%; max-height: 360px; margin-top: 0.35rem;
  border-radius: 8px; border: 1px solid var(--border); background: #000;
}
.panel-screen-preview { display: block; max-width: 200px; max-height: 120px; margin-top: 0.5rem; border-radius: 6px; border: 1px solid var(--border); }
.import-warn { margin-bottom: 1.25rem; padding: 0.75rem 1rem; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.25); border-radius: 8px; }
.import-status { margin-top: 1rem; }
.form-hint-file { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }
.content { animation: fadeInUp 0.42s var(--ease-out); }
.sidebar { animation: slideInLeft 0.5s var(--ease-out); }
.page-header-titles { animation: fadeInUp 0.38s var(--ease-out) 0.05s backwards; }
.server-status-widget { animation: fadeInUp 0.4s var(--ease-out) 0.08s backwards; }
.card { transition: transform 0.22s var(--ease-out), border-color 0.2s, box-shadow 0.22s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.modal-overlay { animation: fadeIn 0.2s ease; }
.modal { animation: fadeInUp 0.32s var(--ease-out); }
.loading { display: flex; align-items: center; justify-content: center; gap: 0.65rem; padding: 3rem; color: var(--text-muted); animation: pulseDot 1.2s ease infinite; }
.loading::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulseDot 0.9s ease infinite; }
.view-enter { animation: fadeInUp 0.42s var(--ease-out); }
.chat-msg-in { animation: chatMsgIn 0.28s var(--ease-out) backwards; }
.toast { animation: fadeInUp 0.3s var(--ease-out); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Badges */
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-fondateur { background: rgba(0, 0, 0, 0.55); color: #e8e8e8; border: 1px solid rgba(255, 255, 255, 0.35); }
.badge-responsable_serveur { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.45); }
.badge-super_admin { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.45); }
.badge-admin { background: rgba(234, 179, 8, 0.18); color: #fde047; border: 1px solid rgba(234, 179, 8, 0.45); }
.badge-animateur { background: rgba(59, 130, 246, 0.18); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.45); }
.badge-moderateur { background: rgba(34, 197, 94, 0.18); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.45); }
.badge-hg { background: rgba(249, 115, 22, 0.18); color: #fdba74; border: 1px solid rgba(249, 115, 22, 0.45); }
.badge-modo_test { background: rgba(57, 255, 20, 0.12); color: #39ff14; border: 1px solid rgba(57, 255, 20, 0.55); text-shadow: 0 0 8px rgba(57, 255, 20, 0.35); }
.badge-formateur { background: rgba(180,180,180,0.15); color: #c8c8c8; margin-top: 0.25rem; }

/* Cards & Tables */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; }
.card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h2 { font-size: 1rem; font-weight: 600; }
.card-body { padding: 0; overflow-x: hidden; }
.card-body:has(.planning-table) { overflow-x: auto; }
.card-body.padded { padding: 1.25rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.data-table { table-layout: fixed; width: 100%; font-size: 0.78rem; }
table.data-table th,
table.data-table td { padding: 0.38rem 0.42rem; line-height: 1.35; }
th, td { padding: 0.65rem 1rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; word-wrap: break-word; overflow-wrap: anywhere; }
th { background: var(--bg-hover); color: var(--text-muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
table.data-table th { font-size: 0.68rem; padding-top: 0.45rem; padding-bottom: 0.45rem; }
table.data-table .col-date { width: 5.2rem; }
table.data-table .col-id { width: 2.4rem; }
table.data-table .col-short { width: 4.6rem; }
table.data-table .col-person { width: 11%; }
table.data-table .col-text { width: auto; min-width: 0; }
.data-table th:last-child,
.data-table td.actions-cell {
  width: 6.4rem;
  min-width: 6.4rem;
  white-space: normal;
  vertical-align: middle;
  padding-right: 0.55rem;
  padding-left: 0.35rem;
}
.data-table th:last-child { text-align: left; }
.actions-wrap .btn-sm {
  padding: 0.28rem 0.4rem;
  font-size: 0.7rem;
  line-height: 1.2;
  width: 100%;
  justify-content: center;
}
table.data-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.045); }
table.data-table tbody tr:hover td { background: rgba(255, 255, 255, 0.09); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }
.statut-present { color: var(--success); }
.statut-absent { color: var(--danger); }

.grade-section { margin-bottom: 1.5rem; }
.grade-title { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-hover); padding: 0.5rem 0; border-bottom: 2px solid var(--accent); margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.grade-count { background: var(--bg-hover); padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.7rem; color: var(--text-muted); }

/* Planning grid */
.planning-controls { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.planning-controls select { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); padding: 0.5rem 0.75rem; border-radius: 8px; font-size: 0.9rem; }
.planning-table { table-layout: fixed; width: 100%; border-collapse: collapse; }
.planning-table th,
.planning-table td {
  vertical-align: top;
  border: 1px solid var(--border);
  padding: 0.4rem 0.45rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.planning-table thead th:not(.time-col) { text-align: center; font-size: 0.72rem; }
.planning-table tbody td:not(.time-col) { width: calc((100% - 6.5rem) / 7); }
.planning-cell { min-height: 40px; }
.planning-cell .anim { font-weight: 600; color: var(--success); line-height: 1.3; }
.planning-cell .company { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; line-height: 1.3; }
.time-col { font-weight: 600; white-space: nowrap; color: var(--text-muted); background: var(--bg-hover) !important; width: 6.5rem; min-width: 6.5rem; max-width: 6.5rem; }

/* Training form */
.form-grid { display: grid; gap: 1rem; max-width: 600px; }
.form-grid-wide { max-width: none; width: 100%; }
.form-grid-wide .form-group textarea { min-height: 100px; }
.page-split { display: grid; grid-template-columns: 1fr; gap: 1.25rem; align-items: start; width: 100%; }
.registre-layout { display: grid; grid-template-columns: 1fr; gap: 1.25rem; width: 100%; }
.accounts-layout { display: grid; grid-template-columns: 1fr; gap: 1.25rem; width: 100%; }
.staff-info-page { display: grid; grid-template-columns: 1fr; gap: 1rem; width: 100%; max-width: none; }
@media (min-width: 1100px) {
  .page-split.has-list { grid-template-columns: minmax(380px, 460px) 1fr; }
  .registre-layout.has-list { grid-template-columns: minmax(380px, 480px) 1fr; }
  .accounts-layout { grid-template-columns: minmax(380px, 460px) 1fr; }
  .staff-info-page { grid-template-columns: 1fr 1fr; }
  .staff-info-page .staff-info-edit-card { grid-column: 1 / -1; }
}
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--text-muted); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 0.6rem 0.75rem; border-radius: 8px; font-size: 0.9rem; font-family: inherit;
}
.form-group textarea { min-height: 80px; resize: vertical; }

/* Champs date : popup clair + icône calendrier visible sur fond sombre */
input[type="date"] {
  color-scheme: light;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 0.75rem;
  padding-right: 2.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  min-height: 42px;
  position: relative;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 1;
  width: 18px;
  height: 18px;
  margin-left: 0.25rem;
  filter: invert(1) brightness(1.15);
  background-size: 18px 18px;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  filter: invert(1) brightness(1.4);
}
/* Icône calendrier blanche (Chrome / Edge / Safari) */
@supports (-webkit-appearance: none) {
  input[type="date"]::-webkit-calendar-picker-indicator {
    filter: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23f0f0f0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
  }
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.report-list { display: flex; flex-direction: column; gap: 0.75rem; }
.report-card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.report-card .report-date { font-weight: 700; color: var(--accent-hover); margin-bottom: 0.5rem; }
.report-card dl { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; font-size: 0.85rem; }
.report-card dt { color: var(--text-muted); }
.report-card dd { margin: 0; }

.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); }
.loading { text-align: center; padding: 2rem; color: var(--text-muted); }

.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; background: var(--bg-card); border: 1px solid var(--border); padding: 0.75rem 1.25rem; border-radius: 8px; font-size: 0.9rem; z-index: 100; animation: fadeIn 0.2s; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }

.tabs { display: flex; gap: 0.25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab { padding: 0.6rem 1rem; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--accent-hover); border-bottom-color: var(--accent); font-weight: 600; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar .search-input { flex: 1; min-width: 200px; max-width: 100%; }
.toolbar-inset { padding: 0.75rem 1.25rem 0.25rem; margin-bottom: 0; }
.search-input { flex: 1; min-width: 180px; max-width: 100%; background: var(--bg-hover); border: 1px solid var(--border); color: var(--text); padding: 0.65rem 1rem; border-radius: 8px; font-size: 0.9rem; line-height: 1.4; }
.search-input::placeholder { color: #9aa3b8; opacity: 1; }
.search-input:focus { outline: none; border-color: var(--accent); background: var(--bg); }
.toolbar-inset .search-input { max-width: 420px; }
.sortable-th { cursor: pointer; user-select: none; }
.sortable-th:hover { color: var(--text); }
.sortable-th.sorted { color: var(--accent-hover); }
.empty-cell { text-align: center; color: var(--text-muted); padding: 2rem !important; }

.combobox-wrap { position: relative; z-index: 1; margin-bottom: 0.25rem; }
.combobox-wrap:focus-within { z-index: 1000; }
.combobox-hint { margin-top: 0.85rem !important; margin-bottom: 1.25rem !important; }
.combobox-input { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 0.6rem 0.75rem; border-radius: 8px; font-size: 0.9rem; }
.combobox-list { display: none; position: fixed; max-height: 240px; overflow-y: auto; background: var(--bg-card); border: 1px solid var(--accent); border-radius: 8px; z-index: 10000; list-style: none; box-shadow: 0 12px 32px rgba(0,0,0,0.55); }
.card-body.padded, .form-grid, .modal-body { overflow: visible; }
.combobox-list.open { display: block; }
.combobox-option { padding: 0.55rem 0.75rem; cursor: pointer; font-size: 0.85rem; border-bottom: 1px solid var(--border); }
.combobox-option:hover { background: var(--bg-hover); color: var(--accent-hover); }
.combobox-option:last-child { border-bottom: none; }

.badge-training { background: rgba(255,255,255,0.15); color: var(--warning); }

.apprenti-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.apprenti-card { text-align: left; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; cursor: pointer; transition: border-color 0.15s, background 0.15s; color: var(--text); font-family: inherit; }
.apprenti-card:hover, .apprenti-card.active { border-color: var(--accent); background: rgba(255,255,255,0.08); }
.apprenti-card strong { display: block; margin-bottom: 0.35rem; }
.apprenti-meta { display: block; font-size: 0.8rem; color: var(--text-muted); }
.apprenti-formateur { display: block; font-size: 0.75rem; color: var(--accent-hover); margin-top: 0.35rem; }

.announcements-feed { display: flex; flex-direction: column; gap: 1rem; }
.panel-compose { margin-bottom: 1rem; }
.panel-entries-list { display: flex; flex-direction: column; gap: 1rem; }

.ann-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.ann-tab { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 1rem; background: var(--bg-card); border: 2px solid var(--border); border-radius: 12px; cursor: pointer; color: var(--text-muted); transition: border-color 0.15s, background 0.15s, transform 0.1s; font-family: inherit; }
.ann-tab:hover { background: var(--bg-hover); color: var(--text); transform: translateY(-1px); }
.ann-tab.active { font-weight: 700; color: var(--text); }
.ann-tab.ann-staff.active { border-color: #e5e5e5; background: rgba(255,255,255,0.08); }
.ann-tab.ann-formation.active { border-color: #c8c8c8; background: rgba(180,180,180,0.08); }
.ann-tab.ann-animation.active { border-color: #b8b8b8; background: rgba(255,255,255,0.08); }
.ann-tab-label { font-size: 0.95rem; }
.ann-tab-count { font-size: 0.7rem; background: var(--bg-hover); padding: 0.1rem 0.5rem; border-radius: 999px; }

.world-bar { position: relative; border-radius: 14px; padding: 1.35rem 1.75rem; text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,0.25); transition: transform 0.15s; }
.world-bar:hover { transform: translateY(-1px); }
.world-bar.ann-staff { background: linear-gradient(180deg, rgba(255,255,255,0.14) 0%, rgba(8,8,8,0.92) 100%); border: 2px solid rgba(255,255,255,0.45); }
.world-bar.ann-formation { background: linear-gradient(180deg, rgba(180,180,180,0.14) 0%, rgba(8,8,8,0.92) 100%); border: 2px solid rgba(180,180,180,0.45); }
.world-bar.ann-animation { background: linear-gradient(180deg, rgba(255,255,255,0.14) 0%, rgba(8,8,8,0.92) 100%); border: 2px solid rgba(255,255,255,0.45); }
.world-bar.pinned { box-shadow: 0 0 24px rgba(255,255,255,0.2); }
.ann-card-title { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; opacity: 0.85; }
.world-bar-content { font-size: 1.05rem; line-height: 1.65; word-break: break-word; }
.world-bar-content b, .world-bar-content strong { font-weight: 800; }
.world-bar-meta { margin-top: 0.85rem; font-size: 0.75rem; color: var(--text-muted); }
.ann-author { color: var(--text); font-weight: 600; }
.world-bar-actions { margin-top: 0.85rem; display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.pin-badge { position: absolute; top: 0.6rem; right: 0.85rem; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--warning); font-weight: 700; }

.ann-compose-card { overflow: hidden; margin-bottom: 1rem; width: 100%; }
.ann-compose-card.ann-staff { border-color: rgba(255,255,255,0.35); }
.ann-compose-card.ann-formation { border-color: rgba(180,180,180,0.35); }
.ann-compose-card.ann-animation { border-color: rgba(255,255,255,0.35); }
.ann-compose-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.ann-compose-header h2 { font-size: 1.05rem; margin-bottom: 0.2rem; }
.ann-compose-header p { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.ann-compose-card.ann-staff .ann-compose-header { background: linear-gradient(90deg, rgba(255,255,255,0.12), transparent); }
.world-bar.ann-patch { background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(8,8,8,0.94) 100%); border: 2px solid rgba(255,255,255,0.3); }
.ann-compose-card.ann-patch { border-color: rgba(255,255,255,0.28); }
.ann-compose-card.ann-patch .ann-compose-header { background: linear-gradient(90deg, rgba(255,255,255,0.08), transparent); }
.ann-patch .richtext-editor:focus { border-color: #d4d4d4; box-shadow: 0 0 0 3px rgba(255,255,255,0.12); }
.patch-version-badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 0.12rem 0.45rem; margin-right: 0.45rem; border-radius: 999px; border: 1px solid rgba(255,255,255,0.35); color: #e5e5e5; vertical-align: middle; }

/* Patch notes - mise en page document (pas style annonce centree) */
.patch-notes-feed { display: flex; flex-direction: column; gap: 1.25rem; max-width: 920px; }
.patch-note-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  text-align: left;
  box-shadow: none;
}
.patch-note-card.pinned { border-color: rgba(255, 255, 255, 0.35); }
.patch-note-card:hover { transform: none; }
.patch-note-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.patch-note-title { font-size: 1.15rem; font-weight: 700; line-height: 1.35; margin: 0; }
.patch-note-meta { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.patch-note-body { text-align: left; font-size: 0.92rem; line-height: 1.6; color: var(--text); }
.patch-note-body h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.75rem; }
.patch-note-body h3 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 1.15rem 0 0.5rem;
  padding-top: 0.15rem;
}
.patch-note-body h3:first-child { margin-top: 0; }
.patch-note-body p { margin: 0 0 0.65rem; }
.patch-note-body ul, .patch-note-body ol {
  margin: 0 0 0.85rem;
  padding-left: 1.35rem;
  list-style-position: outside;
}
.patch-note-body ul { list-style-type: disc; }
.patch-note-body ol { list-style-type: decimal; }
.patch-note-body li { margin: 0.28rem 0; padding-left: 0.15rem; }
.patch-note-body li::marker { color: #a3a3a3; }
.patch-note-body small { color: var(--text-muted); font-size: 0.8rem; }
.patch-note-actions {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.patch-note-card .pin-badge { top: 1rem; right: 1rem; }
.patch-compose-card .card-header h2 { margin: 0; }
.patch-compose-card .card-subtitle { margin: 0.25rem 0 0; font-size: 0.85rem; color: var(--text-muted); }
.patch-editor-left.richtext-editor,
.patch-preview-body.patch-note-body {
  text-align: left;
  min-height: 200px;
}
.patch-preview-panel .patch-preview-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  min-height: 200px;
  max-height: 320px;
  overflow-y: auto;
}
.ann-compose-card.ann-formation .ann-compose-header { background: linear-gradient(90deg, rgba(180,180,180,0.12), transparent); }
.ann-compose-card.ann-animation .ann-compose-header { background: linear-gradient(90deg, rgba(255,255,255,0.12), transparent); }
.ann-form.form-grid { max-width: none; width: 100%; }
.ann-form .form-group:not(.richtext-wrap) { max-width: 520px; }
.ann-submit { width: auto; min-width: 220px; padding: 0.85rem 2rem; font-size: 1rem; }
.ann-empty { border: 1px dashed var(--border); border-radius: 12px; padding: 2.5rem !important; }

.ann-editor-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: stretch; width: 100%; }
.ann-editor-main { display: flex; flex-direction: column; min-width: 0; }
.ann-preview-panel { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.ann-preview-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 700; }
.ann-preview-box { flex: 1; min-height: 220px; display: flex; align-items: center; justify-content: center; padding: 1.25rem !important; }
.preview-placeholder { color: var(--text-muted); font-style: italic; font-size: 0.9rem; }

.richtext-wrap { width: 100%; max-width: none; }
.richtext-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.65rem; align-items: center; padding: 0.65rem; background: var(--bg-hover); border-radius: 10px; border: 1px solid var(--border); }
.rt-group { display: flex; align-items: center; gap: 0.25rem; padding-right: 0.5rem; border-right: 1px solid var(--border); }
.rt-group:last-of-type { border-right: none; }
.rt-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-right: 0.35rem; font-weight: 700; }
.rt-btn { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); padding: 0.4rem 0.65rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem; min-width: 34px; transition: border-color 0.15s, color 0.15s; }
.rt-btn:hover { border-color: var(--accent); color: var(--accent-hover); }
.rt-color { width: 44px; min-width: 44px; height: 38px; padding: 3px; background: #1a1d26; border: 2px solid var(--text-muted); border-radius: 8px; cursor: pointer; overflow: hidden; }
.rt-color::-webkit-color-swatch-wrapper { padding: 2px; }
.rt-color::-webkit-color-swatch { border: 2px solid #fff; border-radius: 4px; }
.rt-color::-moz-color-swatch { border: 2px solid #fff; border-radius: 4px; }
.richtext-editor, .world-bar-editor { flex: 1; min-height: 220px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; text-align: center; font-size: 1rem; line-height: 1.55; overflow-y: auto; transition: border-color 0.15s, box-shadow 0.15s; }
.richtext-editor:focus, .world-bar-editor:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,255,255,0.15); }
.richtext-editor:empty::before { content: attr(data-placeholder); color: var(--text-muted); font-style: italic; pointer-events: none; }
.ann-staff .richtext-editor:focus { border-color: #e5e5e5; box-shadow: 0 0 0 3px rgba(255,255,255,0.15); }
.ann-formation .richtext-editor:focus { border-color: #c8c8c8; box-shadow: 0 0 0 3px rgba(180,180,180,0.15); }
.ann-animation .richtext-editor:focus { border-color: #b8b8b8; box-shadow: 0 0 0 3px rgba(255,255,255,0.15); }

.form-hint { font-size: 0.8rem; color: var(--text-muted); margin: 0; line-height: 1.4; }

@media (max-width: 900px) {
  .ann-tabs { grid-template-columns: 1fr; }
  .ann-editor-layout { grid-template-columns: 1fr; }
}
.btn-danger { background: rgba(239, 68, 68, 0.14); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.45); }
.btn-danger:hover { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-del-icon,
.btn-todo-del,
.panel-actions .btn-danger,
.modal-footer .btn-danger { color: #f87171 !important; border-color: rgba(239, 68, 68, 0.45) !important; }
.btn-todo-del { background: transparent; border: none; font-size: 1.15rem; line-height: 1; padding: 0.2rem 0.45rem; border-radius: 6px; cursor: pointer; }
.btn-todo-del:hover { background: rgba(239, 68, 68, 0.18); color: #fff !important; }
.actions-cell { white-space: normal; vertical-align: middle; }
.actions-wrap { display: flex; flex-direction: column; gap: 0.28rem; align-items: stretch; width: 100%; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; animation: fadeIn 0.15s; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 16px 48px rgba(0,0,0,0.5); }
.modal-wide { max-width: min(960px, 96vw); }
.modal-wide .form-grid { max-width: none; width: 100%; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1rem; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.modal-body { padding: 1.25rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 1rem 1.25rem; border-top: 1px solid var(--border); }

/* Toggle switch */
.toggle-wrap { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0; }
.toggle-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--border); border-radius: 999px; cursor: pointer; transition: background 0.2s; }
.toggle-slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 0.2s; }
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Planning clickable cells */
.planning-clickable { cursor: pointer; transition: background 0.15s; vertical-align: top; }
.planning-clickable:hover { background: rgba(255,255,255,0.08) !important; }
.planning-readonly { vertical-align: top; }
.planning-readonly:has(.event-chip) { cursor: pointer; transition: background 0.15s; }
.planning-readonly:has(.event-chip) { cursor: pointer; transition: background 0.15s; }
.planning-readonly:has(.event-chip):hover { background: rgba(255,255,255,0.05) !important; }
.planning-readonly .event-chip { cursor: default; }
.planning-readonly .event-chip:hover { border-color: rgba(255,255,255,0.18); transform: none; }
.cell-empty { color: var(--text-muted); opacity: 0.5; font-size: 0.75rem; }
.event-chip { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.18); border-radius: 6px; padding: 0.35rem 0.5rem; margin-bottom: 0.35rem; cursor: pointer; transition: border-color 0.2s, transform 0.15s; max-width: 100%; box-sizing: border-box; }
.event-chip .anim,
.event-chip .company { overflow-wrap: anywhere; word-break: break-word; }
.event-chip:hover { border-color: #fff; transform: translateY(-1px); }
.event-chip:last-child { margin-bottom: 0; }
.event-chip-recurring { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.28); cursor: default; }
.event-chip-recurring:hover { border-color: rgba(255,255,255,0.28); }
.event-chip-recurring .anim { color: var(--text); }

.week-nav { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 1rem; padding: 1rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.week-nav-center { text-align: center; flex: 1; }
.week-label { display: block; font-size: 1.1rem; margin-bottom: 0.15rem; }
.week-dates { display: block; font-size: 0.85rem; color: var(--text-muted); }
.week-counter { display: inline-block; margin-top: 0.35rem; font-size: 0.75rem; color: var(--accent-hover); background: rgba(255,255,255,0.12); padding: 0.15rem 0.6rem; border-radius: 999px; }
.week-arrow { font-size: 1.4rem; padding: 0.5rem 1rem; min-width: 48px; }
.week-arrow:disabled { opacity: 0.3; cursor: not-allowed; }
.planning-toolbar { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }

.event-list { display: flex; flex-direction: column; gap: 0.5rem; }
.event-list-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.empty-hint { color: var(--text-muted); font-size: 0.9rem; text-align: center; padding: 1rem 0; }

/* Registre Staff */
.panel-tabs-wrap { overflow-x: auto; margin-bottom: 1rem; }
.panel-tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.panel-tab { padding: 0.5rem 0.85rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; color: var(--text-muted); cursor: pointer; font-size: 0.8rem; font-family: inherit; white-space: nowrap; }
.panel-tab:hover { color: var(--text); border-color: var(--accent); }
.panel-tab.active { background: rgba(255,255,255,0.12); border-color: var(--accent); color: var(--accent-hover); font-weight: 600; }
.panel-entry-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.panel-entry-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.panel-entry-date { margin-left: auto; font-size: 0.75rem; color: var(--text-muted); }
.panel-dl { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 0.35rem 1rem; font-size: 0.9rem; }
.panel-dl dt { color: var(--text-muted); font-weight: 600; }
.panel-dl dd { margin: 0; }
.panel-discord-preview { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; font-size: 0.8rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; margin-bottom: 0.75rem; max-height: 400px; overflow-y: auto; }
.panel-actions { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }
.panel-readonly-hint { padding: 1rem 1.25rem; margin-bottom: 1rem; background: var(--bg-card); border: 1px dashed var(--border); border-radius: 10px; }
.badge-danger-soft { background: rgba(200,200,200,0.15); color: var(--danger); padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.7rem; }
.form-section { margin-top: 0.5rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.form-section-title { font-size: 0.85rem; font-weight: 700; color: var(--accent-hover); margin: 0 0 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.panel-sa.panel-entry-card, .panel-sa.panel-compose { border-color: rgba(200,200,200,0.3); }

/* Information Staff */
.staff-info-links { display: flex; flex-direction: column; gap: 0.65rem; }
.staff-info-link-row { align-items: flex-end; }
.staff-info-link { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 1rem; background: var(--bg-hover); border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; transition: border-color 0.15s, background 0.15s; }
.staff-info-link:hover { border-color: var(--accent); background: rgba(255,255,255,0.08); color: var(--accent-hover); }
.staff-info-link-label { font-weight: 600; font-size: 0.95rem; }
.staff-info-link-arrow { color: var(--text-muted); font-size: 0.9rem; }
.staff-info-meeting .card-header { background: linear-gradient(90deg, rgba(255,255,255,0.1), transparent); }
.staff-info-highlight { font-size: 1rem; line-height: 1.5; margin: 0 0 1.25rem; }
.staff-info-required { color: #d4d4d4; font-weight: 700; }
.staff-info-dl { margin: 0; }
.staff-info-dl dt { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.25rem; }
.staff-info-dl dd { margin: 0 0 1rem; font-size: 0.95rem; }
.staff-info-dl dd:last-child { margin-bottom: 0; }
.staff-info-ts { font-size: 1.05rem; padding: 0.35rem 0.6rem; background: var(--bg); border-radius: 6px; }
.staff-info-dl-link { color: var(--accent-hover); text-decoration: none; font-weight: 500; }
.staff-info-dl-link:hover { text-decoration: underline; }
.panel-absence.panel-entry-card, .panel-absence.panel-compose { border-color: rgba(255,255,255,0.35); }
.panel-event.panel-entry-card, .panel-event.panel-compose { border-color: rgba(255,255,255,0.35); }
.panel-form-cr.panel-entry-card, .panel-form-cr.panel-compose { border-color: rgba(180,180,180,0.35); }

/* Personnel */
.card-header.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.note-card { padding: 1rem; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 0.75rem; background: var(--bg-hover); }
.note-card-head { display: flex; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.note-date { font-size: 0.75rem; color: var(--text-muted); }
.note-body { white-space: pre-wrap; font-size: 0.9rem; line-height: 1.5; margin-bottom: 0.75rem; }
.todo-add-form { display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 1rem; }
.todo-input {
  width: 100%;
  min-height: 76px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.45;
  resize: vertical;
}
.todo-input::placeholder { color: var(--text-muted); opacity: 1; }
.todo-input:focus { outline: none; border-color: rgba(255, 255, 255, 0.45); background: var(--bg); }
.todo-add-meta { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.todo-date-label { display: flex; align-items: center; gap: 0.45rem; font-size: 0.82rem; color: var(--text-muted); }
.todo-date { min-width: 10.5rem; }
.todo-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.todo-item.done { opacity: 0.55; }
.todo-item.done span { text-decoration: line-through; }
.todo-check { display: flex; align-items: flex-start; gap: 0.5rem; flex: 1; cursor: pointer; }
.todo-check span { white-space: pre-wrap; line-height: 1.4; }
.todo-due { color: var(--text-muted); font-size: 0.75rem; }
.todo-done-title { margin: 1.25rem 0 0.5rem; font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Chat */
.chat-panel { display: flex; flex-direction: column; height: calc(100vh - 11rem); min-height: 420px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px 12px 0 0; display: flex; flex-direction: column; gap: 0.65rem; }
.chat-compose { display: flex; padding: 0.75rem; background: var(--bg-card); border: 1px solid var(--border); border-top: none; border-radius: 0 0 12px 12px; }
.chat-compose-main { flex: 1; display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.chat-compose-row { display: flex; gap: 0.5rem; align-items: stretch; }
.chat-compose-row .btn-primary { flex-shrink: 0; min-width: 5.5rem; display: flex; align-items: center; justify-content: center; }
.chat-editor-wrap { flex: 1; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); overflow: hidden; min-height: 42px; }
.chat-toolbar { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.chat-fmt-btn { background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 6px; width: 1.85rem; height: 1.85rem; cursor: pointer; font-size: 0.82rem; line-height: 1; }
.chat-fmt-btn:hover { background: var(--bg-hover); }
.chat-fmt-color { width: 1.85rem; height: 1.85rem; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: transparent; cursor: pointer; }
.chat-editor { min-height: 42px; max-height: 140px; overflow-y: auto; padding: 0.55rem 0.75rem; color: var(--text); font-size: 0.9rem; line-height: 1.45; outline: none; flex: 1; }
.chat-editor:empty::before { content: attr(data-placeholder); color: var(--text-muted); pointer-events: none; }
.chat-image-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chat-image-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.45rem 0.2rem 0.55rem; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-hover); font-size: 0.78rem; max-width: 100%; }
.chat-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.chat-chip-rm { flex-shrink: 0; }
.chat-images { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.chat-image-link { display: block; margin-top: 0.35rem; }
.chat-image { display: block; max-width: min(280px, 100%); max-height: 220px; border-radius: 8px; cursor: pointer; object-fit: contain; }
.chat-text:empty { display: none; }
.chat-msg { display: flex; }
.chat-msg.mine { justify-content: flex-end; }
.chat-bubble { max-width: 75%; padding: 0.55rem 0.75rem; border-radius: 10px; background: var(--bg-hover); border: 1px solid var(--border); }
.chat-msg.mine .chat-bubble { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.35); }
.chat-author { font-size: 0.72rem; font-weight: 700; color: var(--text); margin-bottom: 0.2rem; }
.chat-text { white-space: pre-wrap; font-size: 0.9rem; line-height: 1.45; word-break: break-word; }
.chat-text.chat-rich { white-space: normal; }
.chat-text.chat-rich a { color: #93c5fd; text-decoration: underline; }
.chat-time { font-size: 0.65rem; color: var(--text-muted); margin-top: 0.25rem; text-align: right; }

/* Dossiers event */
.dossier-card { padding: 1rem; border: 1px solid rgba(255,255,255,0.25); border-radius: 10px; margin-bottom: 0.75rem; background: rgba(255,255,255,0.05); }
.dossier-head { display: flex; flex-direction: column; gap: 0.2rem; margin-bottom: 0.5rem; }
.dossier-meta { font-size: 0.75rem; color: var(--text-muted); }
.dossier-desc { font-size: 0.88rem; color: var(--text-muted); margin: 0 0 0.65rem; }

.notif-item[data-type="sa_request"] { border-left: 3px solid #ef4444; }

@media (max-width: 768px) {
  .sidebar { width: 100%; position: relative; height: auto; }
  .main { margin-left: 0; padding: 1rem; }
  .app { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
}
