/* ============================================================
   Centre de Pilotage — style.css
   Design : Mission Control / Industrial Dark, Mobile-First
   Fonts : Cabinet Grotesk + DM Sans + JetBrains Mono
   ============================================================ */

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

/* ─── Custom Properties ─── */
:root {
  --bg: #08080C;
  --bg-surface: #0F0F16;
  --bg-elevated: #181820;
  --bg-hover: #20202E;
  --border: #1E1E2A;
  --border-light: #2A2A3A;
  --text: #E8E8F0;
  --text-secondary: #8A8A9E;
  --text-muted: #5A5A70;
  --amber: #F5A623;
  --amber-dim: rgba(245, 166, 35, 0.12);
  --teal: #2DD4BF;
  --teal-dim: rgba(45, 212, 191, 0.12);
  --green: #22C55E;
  --green-dim: rgba(34, 197, 94, 0.12);
  --red: #EF4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --yellow: #EAB308;
  --yellow-dim: rgba(234, 179, 8, 0.12);
  --gray: #6B7280;
  --gray-dim: rgba(107, 114, 128, 0.12);

  --font-display: 'Cabinet Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;

  --sidebar-w: 220px;
  --topbar-h: 52px;

  --easing: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-micro: 80ms;
  --dur-short: 150ms;
  --dur-med: 250ms;
  --dur-long: 400ms;
}

/* ─── Base ─── */
html, body {
  height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(245, 166, 35, 0.3); color: var(--text); }

a { color: inherit; text-decoration: none; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Spinner ─── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border); border-top-color: var(--amber);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── State message ─── */
.state-msg {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; height: 100%; color: var(--text-muted); font-size: 13px; padding: 32px;
  text-align: center;
}
.state-msg svg { width: 36px; height: 36px; color: var(--border-light); }

/* ─── Toast ─── */
.toast-container {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 6px;
  pointer-events: none; max-width: 90vw; width: 400px;
}
.toast {
  padding: 10px 16px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500;
  animation: toast-in 250ms var(--easing) both;
  pointer-events: auto;
}
.toast-success { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.toast-error   { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.toast-info    { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(245,166,35,0.2); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast.out { opacity: 0; transition: opacity 300ms; }

/* ================================================================
   LAYOUT
   ================================================================ */

/* Sidebar overlay */
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 98; opacity: 0; pointer-events: none;
  transition: opacity var(--dur-med) var(--easing);
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }

/* Sidebar */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w); background: var(--bg-surface);
  border-right: 1px solid var(--border); z-index: 99;
  display: flex; flex-direction: column;
  transition: transform var(--dur-med) var(--easing);
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px; border-bottom: 1px solid var(--border);
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; }
.sidebar-logo { width: 24px; height: 24px; color: var(--amber); }
.sidebar-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.sidebar-close {
  display: none; background: none; border: none; color: var(--text-muted);
  font-size: 22px; cursor: pointer; line-height: 1; padding: 2px;
}

/* Sidebar nav */
.sidebar-nav { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  transition: all var(--dur-short) var(--easing); cursor: pointer;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--amber-dim); color: var(--amber); }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* Sidebar footer */
.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
.connection-status { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); }
.conn-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; transition: background var(--dur-short); }
.conn-dot.online { background: var(--green); box-shadow: 0 0 4px var(--green-dim); }
.conn-dot.connecting { background: var(--yellow); animation: pulse-dot 1s infinite; }
.conn-dot.offline { background: var(--text-muted); }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.3} }
.sidebar-version { font-size: 9px; color: var(--text-muted); margin-top: 6px; font-family: var(--font-mono); }

/* Main */
.main { margin-left: var(--sidebar-w); height: 100vh; display: flex; flex-direction: column; }

/* Topbar */
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 14px; border-bottom: 1px solid var(--border);
  background: var(--bg-surface); flex-shrink: 0;
}
.topbar-menu {
  display: none; background: none; border: none; color: var(--text-secondary);
  cursor: pointer; padding: 6px; border-radius: var(--radius-sm);
  transition: background var(--dur-short);
}
.topbar-menu:hover { background: var(--bg-hover); }
.topbar-menu svg { width: 20px; height: 20px; }
.topbar-info { flex: 1; min-width: 0; }
.topbar-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.topbar-subtitle { font-size: 11px; color: var(--text-muted); display: block; margin-top: -1px; }
.topbar-action {
  display: none; background: none; border: none; color: var(--text-secondary);
  cursor: pointer; padding: 6px; border-radius: var(--radius-sm);
  transition: all var(--dur-short);
}
.topbar-action:hover { background: var(--bg-hover); color: var(--teal); }
.topbar-action svg { width: 18px; height: 18px; }
.topbar-action.spinning svg { animation: spin 0.8s linear infinite; }

/* View switching */
.view { display: none; flex: 1; overflow: hidden; }
.view.active { display: flex; }

/* ================================================================
   DASHBOARD VIEW
   ================================================================ */
.dashboard {
  flex: 1; overflow-y: auto; padding: 12px;
  display: grid; grid-template-columns: 1fr;
  gap: 12px; align-content: start;
}

/* Widget base */
.dash-widget {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
  display: flex; flex-direction: column;
  animation: widget-in 300ms var(--easing) both;
}
@keyframes widget-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dash-widget-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  background: var(--bg-elevated); flex-shrink: 0;
}
.dash-widget-icon { width: 14px; height: 14px; color: var(--amber); flex-shrink: 0; }
.dash-widget-title {
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;
  flex: 1; min-width: 0;
}
.dash-widget-badge {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: var(--radius-pill);
  background: var(--amber-dim); color: var(--amber);
}
.dash-widget-refresh {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 2px; border-radius: var(--radius-sm);
  display: flex; align-items: center; transition: color var(--dur-short);
}
.dash-widget-refresh:hover { color: var(--teal); }
.dash-widget-refresh svg { width: 13px; height: 13px; }
.dash-widget-refresh.spinning svg { animation: spin 0.8s linear infinite; }

.dash-widget-body {
  flex: 1; overflow-y: auto; padding: 8px;
  min-height: 100px; max-height: 320px;
}

/* Activity feed items */
.activity-item {
  display: flex; gap: 8px; padding: 6px 8px;
  border-bottom: 1px solid var(--border); align-items: flex-start;
  animation: item-in 200ms var(--easing) both;
}
.activity-item:last-child { border-bottom: none; }
@keyframes item-in {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: translateX(0); }
}
.activity-dot {
  width: 6px; height: 6px; border-radius: 50%;
  margin-top: 5px; flex-shrink: 0;
}
.activity-dot.system { background: var(--amber); }
.activity-dot.alert { background: var(--red); }
.activity-dot.user { background: var(--teal); }
.activity-dot.mission { background: var(--amber); }
.activity-content { flex: 1; min-width: 0; }
.activity-sender {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
.activity-sender.mame { color: var(--amber); }
.activity-sender.mak { color: var(--teal); }
.activity-text {
  font-size: 12px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.4;
}
.activity-time {
  font-size: 9px; color: var(--text-muted); font-family: var(--font-mono);
  white-space: nowrap; flex-shrink: 0; margin-top: 2px;
}

/* Mission list in dashboard */
.dash-mission-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-bottom: 1px solid var(--border);
  font-size: 12px; cursor: pointer;
  transition: background var(--dur-short);
}
.dash-mission-item:hover { background: var(--bg-hover); }
.dash-mission-item:last-child { border-bottom: none; }
.dash-mission-id { font-family: var(--font-mono); font-size: 9px; color: var(--text-muted); flex-shrink: 0; }
.dash-mission-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.dash-mission-badge {
  font-size: 9px; padding: 1px 6px; border-radius: var(--radius-pill);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* System status grid */
.sys-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px;
}
.sys-item {
  background: var(--bg-elevated); border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.sys-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.sys-value {
  font-family: var(--font-mono); font-size: 14px; font-weight: 600;
  color: var(--text); margin-top: 2px;
}
.sys-value.green { color: var(--green); }
.sys-value.amber { color: var(--amber); }
.sys-value.teal { color: var(--teal); }
.sys-value.muted { color: var(--text-muted); }

/* ================================================================
   CHAT VIEW
   ================================================================ */
.chat { display: flex; flex-direction: column; height: 100%; background: var(--bg); }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 6px; scroll-behavior: smooth;
}

/* Message */
.msg {
  display: flex; gap: 8px; max-width: 88%;
  animation: msg-in var(--dur-med) var(--easing) both;
}
.msg-user { align-self: flex-end; flex-direction: row-reverse; }
.msg-system { align-self: flex-start; }
.msg-alert { align-self: center; max-width: 94%; }
.msg-mission { align-self: flex-start; }

@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0; margin-top: 2px;
}
.msg-user .msg-avatar { background: var(--teal-dim); color: var(--teal); }
.msg-system .msg-avatar { background: var(--amber-dim); color: var(--amber); font-family: var(--font-mono); font-size: 9px; }
.msg-alert .msg-avatar { background: var(--red-dim); color: var(--red); }
.msg-mission .msg-avatar { background: var(--amber-dim); color: var(--amber); font-family: var(--font-mono); font-size: 9px; }

.msg-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.msg-header { display: flex; align-items: baseline; gap: 6px; padding: 0 2px; }
.msg-sender { font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.msg-user .msg-sender { color: var(--teal); }
.msg-system .msg-sender { color: var(--amber); }
.msg-alert .msg-sender { color: var(--red); }
.msg-mission .msg-sender { color: var(--amber); }
.msg-time { font-size: 9px; color: var(--text-muted); font-family: var(--font-mono); }
.msg-text {
  padding: 7px 12px; border-radius: var(--radius-lg);
  font-size: 13px; line-height: 1.5; word-wrap: break-word; overflow-wrap: break-word;
}
.msg-user .msg-text { background: var(--teal-dim); color: var(--text); border-bottom-right-radius: var(--radius-sm); }
.msg-system .msg-text { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border); border-bottom-left-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 12px; }
.msg-alert .msg-text { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.2); text-align: center; font-weight: 500; font-size: 12px; }
.msg-mission .msg-text { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(245,166,35,0.2); border-bottom-left-radius: var(--radius-sm); font-size: 12px; }

/* Chat status banner */
.chat-status {
  text-align: center; font-size: 10px; color: var(--text-muted);
  padding: 4px 12px 0; font-family: var(--font-mono);
}

/* Typing */
.chat-typing {
  padding: 0 16px 2px; font-size: 11px; color: var(--text-muted);
  font-style: italic; height: 18px; transition: opacity var(--dur-short) var(--easing);
  opacity: 0;
}
.chat-typing.visible { opacity: 1; }

/* Chat input */
.chat-input-area { padding: 6px 10px 10px; background: var(--bg-surface); border-top: 1px solid var(--border); }
.chat-input-wrap {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2px;
  transition: border-color var(--dur-short) var(--easing);
}
.chat-input-wrap:focus-within { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-dim); }
.chat-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 13px; font-family: var(--font-body);
  padding: 8px 10px; resize: none;
}
.chat-input::placeholder { color: var(--text-muted); }
.chat-send {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--teal); border: none; color: #08080C;
  cursor: pointer; transition: all var(--dur-short) var(--easing); flex-shrink: 0;
}
.chat-send:hover { background: #26b8a5; }
.chat-send:active { transform: scale(0.92); }
.chat-send svg { width: 14px; height: 14px; }
.chat-send:disabled { opacity: 0.25; cursor: default; transform: none; }

/* ================================================================
   MISSIONS VIEW
   ================================================================ */
.missions { display: flex; flex-direction: column; height: 100%; background: var(--bg); }

.missions-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  background: var(--bg-surface); flex-shrink: 0; flex-wrap: wrap;
}
.missions-search {
  flex: 1; position: relative; min-width: 140px;
}
.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-muted); pointer-events: none;
}
.search-input {
  width: 100%; padding: 7px 10px 7px 30px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-body); font-size: 13px; outline: none;
  transition: border-color var(--dur-short);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--amber); }

.missions-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  padding: 4px 10px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 500;
  border: none; cursor: pointer; background: var(--bg-elevated); color: var(--text-secondary);
  font-family: var(--font-body); transition: all var(--dur-short) var(--easing);
}
.chip:hover { background: var(--bg-hover); color: var(--text); }
.chip.active { background: var(--amber-dim); color: var(--amber); }

.missions-refresh {
  background: none; border: 1px solid var(--border); color: var(--text-secondary);
  cursor: pointer; padding: 6px; border-radius: var(--radius-sm);
  display: flex; align-items: center; transition: all var(--dur-short); flex-shrink: 0;
}
.missions-refresh:hover { background: var(--bg-hover); color: var(--amber); border-color: var(--border-light); }
.missions-refresh svg { width: 16px; height: 16px; }
.missions-refresh.spinning svg { animation: spin 0.8s linear infinite; }

.missions-grid {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}

/* Mission card */
.mission-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px;
  animation: card-in var(--dur-med) var(--easing) both;
  transition: border-color var(--dur-short);
}
.mission-card:hover { border-color: var(--border-light); }

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

.mission-card-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
}
.mission-id { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); font-weight: 600; }
.mission-title { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; line-height: 1.3; margin-top: 1px; }

.mission-badge {
  display: inline-flex; align-items: center; padding: 2px 7px;
  border-radius: var(--radius-pill); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
}
.badge-ouvert { background: var(--yellow-dim); color: var(--yellow); }
.badge-en_cours { background: var(--amber-dim); color: var(--amber); }
.badge-livre { background: var(--green-dim); color: var(--green); }
.badge-bloque { background: var(--red-dim); color: var(--red); }
.badge-abandonne { background: var(--gray-dim); color: var(--gray); }

.mission-card-body {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  margin-top: 8px; font-size: 11px;
}
.mission-field { display: inline-flex; gap: 4px; align-items: center; }
.mission-field-label { color: var(--text-muted); }
.mission-field-value { color: var(--text-secondary); font-weight: 500; }

.mission-card-note {
  font-size: 11px; color: var(--text-muted); margin-top: 6px; line-height: 1.4;
  padding: 6px 8px; background: var(--bg-elevated); border-radius: var(--radius-sm);
}

/* Mission comments */
.mission-card-comments {
  margin-top: 8px; display: flex; flex-direction: column; gap: 4px;
}
.mission-comment {
  font-size: 11px; color: var(--text-secondary);
  padding: 5px 8px; background: var(--bg); border-radius: var(--radius-sm);
  border-left: 2px solid var(--teal-dim);
}
.mission-comment-meta { font-size: 9px; color: var(--text-muted); font-family: var(--font-mono); }
.mission-comment-text { margin-top: 1px; line-height: 1.4; }

.mission-card-actions {
  display: flex; gap: 6px; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border); flex-wrap: wrap;
}
.mission-btn {
  padding: 5px 12px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 11px; font-weight: 600;
  border: none; cursor: pointer; transition: all var(--dur-short) var(--easing);
}
.mission-btn-primary { background: var(--amber); color: #08080C; }
.mission-btn-primary:hover { background: #e0951a; }
.mission-btn-success { background: var(--green); color: #08080C; }
.mission-btn-success:hover { background: #16a34a; }
.mission-btn-danger { background: var(--red); color: #fff; }
.mission-btn-danger:hover { background: #dc2626; }
.mission-btn-outline {
  background: transparent; color: var(--teal); border: 1px solid var(--teal-dim);
}
.mission-btn-outline:hover { background: var(--teal-dim); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  z-index: 150; display: flex; align-items: center; justify-content: center;
  animation: modal-in 150ms var(--easing);
}
.modal-overlay[hidden] { display: none; }
@keyframes modal-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-surface); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 20px; max-width: 360px; width: 90vw;
  animation: modal-scale 200ms var(--easing);
}
@keyframes modal-scale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.modal-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; }
.modal-text strong { color: var(--text); }
.modal-textarea {
  width: 100%; padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font-body); font-size: 13px;
  resize: vertical; outline: none; transition: border-color var(--dur-short);
  margin-bottom: 12px;
}
.modal-textarea:focus { border-color: var(--teal); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal-btn {
  padding: 7px 16px; border-radius: var(--radius-sm); font-family: var(--font-body);
  font-size: 12px; font-weight: 600; border: none; cursor: pointer;
  transition: all var(--dur-short);
}
.modal-btn-secondary { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border); }
.modal-btn-secondary:hover { background: var(--bg-hover); color: var(--text); }
.modal-btn-primary { background: var(--amber); color: #08080C; }
.modal-btn-primary:hover { background: #e0951a; }

/* ================================================================
   RESPONSIVE : MOBILE-FIRST
   ================================================================ */

/* < 768px : sidebar becomes a drawer */
@media (max-width: 767px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .main { margin-left: 0; }
  .topbar-menu { display: flex; }
  .topbar-action { display: flex; }

  .msg { max-width: 92%; }
  .msg-text { font-size: 14px; }

  .missions-toolbar { padding: 8px 10px; }
  .missions-grid { padding: 10px; }

  .dashboard { padding: 8px; gap: 8px; }
  .dash-widget-body { max-height: 260px; }
}

/* ≥ 768px : sidebar always visible */
@media (min-width: 768px) {
  .sidebar-overlay { display: none !important; }

  .dashboard {
    grid-template-columns: 1fr 1fr;
    padding: 14px; gap: 14px;
  }
}

/* ≥ 1024px : three-column dashboard */
@media (min-width: 1024px) {
  .dashboard { grid-template-columns: 1fr 1fr 1fr; }

  .chat-messages { padding: 16px 20px; }
  .missions-grid { padding: 16px 20px; }
  .msg { max-width: 75%; }

  .dash-widget-body { max-height: 360px; }
}
