/* ═══════════════════════════════════════════════════════════════════════════
   CDP·NET – Design System v2 · Moderne · Cohérent · Accessible
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────────────────────────── */
:root {
  /* Orange brand */
  --orange-50:  #FFF4EE;
  --orange-100: #FFE4D0;
  --orange-500: #E8631A;
  --orange-600: #C95514;
  --orange-700: #A8440E;

  /* Slate neutrals */
  --slate-50:  #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --slate-900: #0F172A;

  /* Semantic tokens */
  --color-primary:       var(--orange-500);
  --color-primary-dark:  var(--orange-600);
  --color-primary-light: var(--orange-50);
  --color-secondary:     var(--slate-800);
  --color-bg:            var(--slate-100);
  --color-bg-card:       #FFFFFF;
  --color-text:          var(--slate-800);
  --color-text-secondary:var(--slate-500);
  --color-text-light:    var(--slate-400);
  --color-border:        var(--slate-200);
  --color-success:       #10B981;
  --color-success-bg:    #D1FAE5;
  --color-warning:       #F59E0B;
  --color-warning-bg:    #FEF3C7;
  --color-danger:        #EF4444;
  --color-danger-bg:     #FEE2E2;
  --color-info:          #3B82F6;
  --color-info-bg:       #DBEAFE;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  /* Radius */
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.04);
  --shadow-md: 0 8px 16px -4px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);

  /* Transitions */
  --ease:       cubic-bezier(.4,0,.2,1);
  --transition: 180ms var(--ease);

  /* Layout */
  --navbar-h:     62px;
  --container-max:1240px;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.625;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary-dark); }
ul, ol { list-style: none; }

/* ── Layout ──────────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.main-content {
  flex: 1;
  padding: 1.75rem 0 3rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--navbar-h);
  background: #FFFFFF;
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.navbar-container {
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}

/* Brand */
.navbar-brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; flex-shrink: 0; }
.navbar-logo { height: 36px; width: auto; }
.navbar-brand-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -.5px;
}

/* Hidden checkbox */
.nav-toggle { display: none; }

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  margin-left: auto;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--color-secondary);
  flex-shrink: 0;
  transition: background var(--transition);
}
.nav-hamburger:hover { background: var(--slate-100); }
.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: var(--radius-full);
  transition: transform var(--transition), opacity var(--transition);
  transform-origin: center;
}

/* Desktop menu */
.navbar-menu {
  display: flex;
  align-items: center;
  gap: .125rem;
  margin-left: auto;
}

/* Nav links */
.nav-link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 .875rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.nav-link:hover { background: var(--slate-100); color: var(--color-text); }
.nav-link.active {
  background: var(--orange-50);
  color: var(--color-primary);
  font-weight: 600;
}
.nav-link--stub { opacity: .45; cursor: default; pointer-events: none; }

/* Dropdown (admin emails) */
.nav-dropdown { position: relative; }
.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  height: 36px;
  padding: 0 .875rem;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.nav-dropdown-btn:hover, .nav-dropdown-btn.active {
  background: var(--slate-100);
  color: var(--color-text);
}
.nav-dropdown-btn.active { background: var(--orange-50); color: var(--color-primary); font-weight: 600; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + .5rem);
  left: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: .375rem;
  z-index: 300;
}
.nav-dropdown-menu.open { display: block; }
.nav-dropdown:hover .nav-dropdown-menu { display: block; }

/* Dropdown items */
.dropdown-item {
  display: block;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--color-text);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.dropdown-item:hover { background: var(--slate-100); color: var(--color-text); text-decoration: none; }
.dropdown-item--danger { color: var(--color-danger); }
.dropdown-item--danger:hover { background: var(--color-danger-bg); }
.dropdown-divider { height: 1px; background: var(--color-border); margin: .375rem 0; }

/* User menu */
.nav-user { position: relative; margin-left: .5rem; }
.nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  height: 36px;
  padding: 0 .625rem 0 .375rem;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 500;
  color: var(--color-text);
  transition: background var(--transition), border-color var(--transition);
}
.nav-user-btn:hover { background: var(--slate-100); border-color: var(--slate-300); }
.nav-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-caret { font-size: .6rem; color: var(--color-text-light); }
.nav-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: .375rem;
  z-index: 300;
}
.nav-user-dropdown.open { display: block; }

/* Mobile overlay backdrop */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.35);
  z-index: 190;
  backdrop-filter: blur(2px);
}
.nav-backdrop.open { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-card);
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}
.card-body { padding: 1.25rem; }
.card-body.p-0 { padding: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-header h1 {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.25;
  letter-spacing: -.3px;
}
.page-subtitle {
  margin-top: .25rem;
  font-size: .9375rem;
  color: var(--color-text-secondary);
}
.page-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  height: 38px;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
  -webkit-user-select: none;
  user-select: none;
  line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 1px 2px rgba(232,99,26,.2);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(232,99,26,.3);
}

.btn-secondary {
  background: var(--color-bg-card);
  color: var(--color-text);
  border-color: var(--color-border);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background: var(--slate-100);
  border-color: var(--slate-300);
  color: var(--color-text);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}
.btn-danger:hover {
  background: #DC2626;
  border-color: #DC2626;
  color: #fff;
  box-shadow: 0 4px 12px rgba(239,68,68,.25);
}

.btn-warning {
  background: var(--color-warning);
  color: #fff;
  border-color: var(--color-warning);
}
.btn-warning:hover { background: #D97706; border-color: #D97706; color: #fff; }

.btn-success {
  background: var(--color-success);
  color: #fff;
  border-color: var(--color-success);
}
.btn-success:hover { background: #059669; border-color: #059669; color: #fff; }

.btn-sm { height: 30px; padding: 0 .75rem; font-size: .8125rem; border-radius: var(--radius-xs); }
.btn-sm:hover { transform: none; }
.btn-lg { height: 46px; padding: 0 1.5rem; font-size: 1rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 1.125rem; }
.form-group:last-child { margin-bottom: 0; }
.form-label {
  display: block;
  margin-bottom: .375rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--color-text);
}
.form-control, .form-select {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 .75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-text);
  font-family: var(--font);
  font-size: .9375rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.form-control::placeholder { color: var(--color-text-light); }
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(232,99,26,.15);
}
.form-control:disabled, .form-select:disabled {
  background: var(--slate-100);
  color: var(--color-text-secondary);
  cursor: not-allowed;
}
textarea.form-control {
  height: auto;
  padding: .625rem .75rem;
  resize: vertical;
  min-height: 96px;
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}
.form-check-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9375rem;
  cursor: pointer;
}
.form-check-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-xs);
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-group small { display: block; margin-top: .35rem; font-size: .8125rem; color: var(--color-text-secondary); }
.form-control[type="file"] {
  height: auto;
  padding: .5rem .75rem;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════════════════ */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.table thead tr { border-bottom: 2px solid var(--color-border); }
.table th {
  padding: .75rem 1rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.table td {
  padding: .875rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--slate-50); }

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-success   { background: var(--color-success-bg); color: #065F46; }
.badge-warning   { background: var(--color-warning-bg); color: #92400E; }
.badge-danger    { background: var(--color-danger-bg);  color: #991B1B; }
.badge-info      { background: var(--color-info-bg);    color: #1E40AF; }
.badge-secondary { background: var(--slate-200);        color: var(--slate-700); }
.badge-primary   { background: var(--orange-100);       color: var(--orange-700); }

/* ═══════════════════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════════════════ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .875rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: .9375rem;
  margin-bottom: 1.25rem;
}
.alert-success { background: var(--color-success-bg); border-color: #A7F3D0; color: #065F46; }
.alert-warning { background: var(--color-warning-bg); border-color: #FDE68A; color: #92400E; }
.alert-danger  { background: var(--color-danger-bg);  border-color: #FECACA; color: #991B1B; }
.alert-info    { background: var(--color-info-bg);    border-color: #BFDBFE; color: #1E40AF; }
.alert-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: .6;
  font-size: 1.125rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  transition: opacity var(--transition);
}
.alert-close:hover { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--color-primary);
  border-radius: 0 0 var(--radius-xs) var(--radius-xs);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-number {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -.5px;
  line-height: 1.1;
}
.stat-number small { font-size: 1rem; font-weight: 600; }
.stat-label {
  margin-top: .375rem;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  line-height: 1.3;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MISSIONS LIST & GRID
   ═══════════════════════════════════════════════════════════════════════════ */
.missions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.mission-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 1.25rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.mission-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--orange-100);
  text-decoration: none;
}
.mission-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.mission-card-title { font-size: 1rem; font-weight: 600; color: var(--color-text); line-height: 1.3; }
.mission-card-subtitle { font-size: .8125rem; color: var(--color-text-secondary); margin-top: .2rem; }
.mission-card-footer { display: flex; align-items: center; gap: .75rem; font-size: .8125rem; color: var(--color-text-secondary); }

.missions-list { display: flex; flex-direction: column; gap: .5rem; }
.mission-list-item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.mission-list-item:hover {
  border-color: var(--orange-100);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.mission-list-item-info { flex: 1; min-width: 0; }
.mission-list-item-title { font-size: .9375rem; font-weight: 600; color: var(--color-text); }
.mission-list-item-meta { font-size: .8125rem; color: var(--color-text-secondary); margin-top: .15rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   MISSION DETAIL
   ═══════════════════════════════════════════════════════════════════════════ */
.mission-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.info-list { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; align-items: baseline; }
.info-list dt { font-size: .8125rem; font-weight: 600; color: var(--color-text-secondary); white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
.info-list dd { font-size: .9375rem; color: var(--color-text); }

.chef-info { display: flex; flex-direction: column; gap: .5rem; }
.chef-name strong { font-size: 1rem; }
.chef-contacts { display: flex; flex-direction: column; gap: .25rem; }
.contact-link { font-size: .875rem; color: var(--color-primary); display: inline-flex; align-items: center; gap: .35rem; }
.contact-link:hover { color: var(--color-primary-dark); }

.members-list { display: flex; flex-direction: column; }
.member-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}
.member-item:last-child { border-bottom: none; }
.member-avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--orange-100);
  color: var(--color-primary);
  font-size: .8125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.member-info { flex: 1; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.member-name { font-size: .9rem; font-weight: 500; }

/* Actions list */
.actions-list { display: flex; flex-direction: column; gap: .375rem; }
.action-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  color: var(--color-text);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition);
  font-size: .9375rem;
}
.action-item:hover {
  background: var(--slate-50);
  border-color: var(--color-border);
  text-decoration: none;
  color: var(--color-text);
}
.action-icon { font-size: 1.1rem; flex-shrink: 0; width: 24px; text-align: center; }
.action-item span:nth-child(2) { flex: 1; font-weight: 500; }
.action-item--disabled { opacity: .45; cursor: default; pointer-events: none; }
.action-item--disabled:hover { background: transparent; border-color: transparent; }

/* ═══════════════════════════════════════════════════════════════════════════
   TEAM
   ═══════════════════════════════════════════════════════════════════════════ */
.team-page { display: grid; grid-template-columns: 1fr 300px; gap: 1.25rem; align-items: start; }
.team-members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
  padding: 1.25rem;
}
.member-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .5rem;
  padding: 1.25rem .75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-card);
  transition: box-shadow var(--transition);
}
.member-cell:hover { box-shadow: var(--shadow-sm); }
.member-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--orange-500), var(--orange-700));
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.member-avatar.is-chef { background: linear-gradient(135deg, #F59E0B, #D97706); }
.member-role-badge { margin-top: -.25rem; }
.member-cell strong { font-size: .9rem; color: var(--color-text); }
.member-cell span { font-size: .8125rem; color: var(--color-text-secondary); }
.team-actions { display: flex; flex-direction: column; gap: .5rem; }

/* Tabs */
.tabs { display: flex; gap: .25rem; margin-bottom: 1rem; background: var(--slate-100); padding: .25rem; border-radius: var(--radius-sm); width: fit-content; }
.tab-btn {
  height: 32px;
  padding: 0 .875rem;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.tab-btn:hover { color: var(--color-text); }
.tab-btn--active { background: #fff; color: var(--color-text); box-shadow: var(--shadow-xs); }
.tab-panel { display: none; }
.tab-panel--active { display: block; }

/* Search */
.search-box { position: relative; }
.search-input { width: 100%; }
.search-results {
  display: none;
  position: absolute;
  top: calc(100% + .5rem);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
}
.search-results.visible { display: block; }
.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  gap: 1rem;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--slate-50); }
.search-result-name { font-size: .9rem; font-weight: 500; }
.search-result-email { font-size: .8125rem; color: var(--color-text-secondary); }

/* Selected user preview */
.selected-preview {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1rem;
  background: var(--orange-50);
  border: 1px solid var(--orange-100);
  border-radius: var(--radius);
  margin-top: .75rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PROFILE
   ═══════════════════════════════════════════════════════════════════════════ */
.profile-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  align-items: start;
}
.profile-photo-section { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.profile-photo-preview {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 3px solid var(--orange-100);
}
.profile-photo-upload-btn { font-size: .875rem; }
.profile-initials {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--orange-500), var(--orange-700));
  color: #fff;
  font-size: 2.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════ */
.user-filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.user-filters .form-group { margin: 0; }
.user-filters .form-control, .user-filters .form-select { min-width: 160px; }

.seasons-layout { display: grid; grid-template-columns: 380px 1fr; gap: 1.25rem; align-items: start; }
.season-card { padding: .875rem 1rem; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-bg-card); margin-bottom: .5rem; display: flex; align-items: center; gap: 1rem; }
.season-card:hover { border-color: var(--orange-100); box-shadow: var(--shadow-xs); }
.season-status { font-size: .8125rem; font-weight: 600; }
.season-missions-list { font-size: .875rem; }

/* SMTP config */
.smtp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.config-card p { margin-bottom: .5rem; font-size: .9375rem; }
.smtp-test-row { display: flex; align-items: flex-end; gap: 1rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH
   ═══════════════════════════════════════════════════════════════════════════ */
.auth-body {
  background: linear-gradient(145deg, var(--slate-900) 0%, var(--slate-800) 60%, #2D1A0E 100%);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-wrapper {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.auth-logo { text-align: center; }
.auth-logo img { height: 52px; width: auto; margin: 0 auto; }
.auth-logo-text {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -1px;
}
.auth-card {
  width: 100%;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.08);
}
.auth-card .card-body { padding: 2rem; }
.auth-card .page-header { margin-bottom: 1.5rem; }
.auth-card .page-header h1 { font-size: 1.375rem; }
.auth-footer-text { font-size: .8125rem; color: rgba(255,255,255,.4); text-align: center; }

/* ═══════════════════════════════════════════════════════════════════════════
   FORM BUILDER (Phase 2)
   ═══════════════════════════════════════════════════════════════════════════ */
.field-list { list-style: none; padding: 0; margin: 0; }
.field-item {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-card);
  transition: background var(--transition);
}
.field-item:last-child { border-bottom: none; }
.field-item:hover { background: var(--slate-50); }
.field-item-handle {
  color: var(--color-text-light);
  font-size: 1rem;
  flex-shrink: 0;
  padding: .25rem;
}
.field-item-handle.draggable { cursor: grab; }
.field-item-handle.draggable:active { cursor: grabbing; }
.field-item-info { flex: 1; min-width: 0; }
.field-item-actions { display: flex; gap: .5rem; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════════════ */
.footer {
  margin-top: auto;
  padding: 1.25rem 0;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-card);
}
.footer p {
  text-align: center;
  font-size: .8125rem;
  color: var(--color-text-light);
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH SPECIFICS
   ═══════════════════════════════════════════════════════════════════════════ */
.auth-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: .375rem;
  letter-spacing: -.3px;
}
.auth-subtitle {
  font-size: .9375rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.auth-links { margin-top: 1rem; text-align: center; }
.auth-link { font-size: .875rem; color: var(--color-text-secondary); }
.auth-link:hover { color: var(--color-primary); }
.btn-block { width: 100%; justify-content: center; }

/* ═══════════════════════════════════════════════════════════════════════════
   FILTER BAR
   ═══════════════════════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .625rem;
  margin-bottom: 1.25rem;
  padding: .875rem 1.125rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.filter-group { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.filter-label { font-size: .8125rem; font-weight: 600; color: var(--color-text-secondary); white-space: nowrap; }
.filter-count { margin-left: auto; font-size: .8125rem; color: var(--color-text-secondary); white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════════════════════
   DOCUMENTS
   ═══════════════════════════════════════════════════════════════════════════ */
.doc-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}
.doc-main { min-width: 0; }
.doc-sidebar { position: sticky; top: calc(var(--navbar-h) + 1rem); }

.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}
.doc-item:last-child { border-bottom: none; }
.doc-icon { font-size: 1.375rem; flex-shrink: 0; }
.doc-info { flex: 1; min-width: 0; }
.doc-name {
  display: block;
  font-weight: 600;
  font-size: .9375rem;
  color: var(--color-text-primary);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-name:hover { color: var(--color-primary); }
.doc-meta {
  display: block;
  font-size: .8125rem;
  color: var(--color-text-secondary);
  margin-top: .125rem;
}
.doc-delete-form { margin-left: auto; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   FEED (FIL DE DISCUSSION)
   ═══════════════════════════════════════════════════════════════════════════ */
.feed { display: flex; flex-direction: column; gap: 1rem; }

.feed-post {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.feed-post-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .875rem;
}

.feed-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--orange-500);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .875rem;
  flex-shrink: 0;
}
.feed-avatar--sm {
  width: 28px;
  height: 28px;
  font-size: .75rem;
  background: var(--slate-200);
  color: var(--color-text-secondary);
}

.feed-post-meta { flex: 1; line-height: 1.3; }
.feed-post-meta strong { font-size: .9375rem; display: block; }
.feed-date { font-size: .8rem; color: var(--color-text-secondary); }

.feed-post-body {
  font-size: .9375rem;
  line-height: 1.6;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
}

.feed-comments {
  border-top: 1px solid var(--color-border);
  padding-top: .75rem;
  display: flex;
  flex-direction: column;
  gap: .625rem;
  margin-bottom: .75rem;
}

.feed-comment {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.feed-comment-content { flex: 1; min-width: 0; }
.feed-comment-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .125rem;
  flex-wrap: wrap;
}
.feed-comment-header strong { font-size: .875rem; }
.feed-comment-body {
  font-size: .875rem;
  color: var(--color-text-primary);
  line-height: 1.5;
}

.feed-reply { border-top: 1px solid var(--color-border); padding-top: .75rem; }
.feed-reply-toggle {
  font-size: .875rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.feed-reply-toggle::-webkit-details-marker { display: none; }
.feed-reply-toggle:hover { color: var(--color-primary); }

.btn-link-danger {
  background: none;
  border: none;
  padding: 0 .25rem;
  cursor: pointer;
  color: var(--color-danger);
  font-size: .875rem;
  line-height: 1;
}
.btn-link-danger:hover { opacity: .7; }

/* ═══════════════════════════════════════════════════════════════════════════
   PAYMENTS
   ═══════════════════════════════════════════════════════════════════════════ */
.payment-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
  align-items: start;
}
.payment-main  { min-width: 0; }
.payment-sidebar { /* sticky set inline in view */ }

/* ═══════════════════════════════════════════════════════════════════════════
   RAPPORT DE MISSION
   ═══════════════════════════════════════════════════════════════════════════ */
.report-form .form-control { font-size: .9375rem; line-height: 1.6; }

.report-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .25rem 0 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   REPORTING
   ═══════════════════════════════════════════════════════════════════════════ */
.reporting-charts {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.pagination-info {
  font-size: .875rem;
  color: var(--color-text-secondary);
  margin-bottom: .75rem;
}
.pagination-pages {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.pagination-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 .5rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--color-text-primary);
  text-decoration: none;
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.pagination-page:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pagination-page.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  cursor: default;
}
.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: .875rem;
  color: var(--color-text-secondary);
}
.btn.disabled {
  opacity: .45;
  cursor: default;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════════════════ */
.mt-4 { margin-top: 1.5rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: .5rem; }
.ms-1 { margin-left: .25rem; }
.ms-2 { margin-left: .5rem; }
.p-0 { padding: 0; }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-secondary); }
.text-nowrap { white-space: nowrap; }
.inline-form { display: inline; }
.icon-pin { font-size: .875rem; }

.link-primary { color: var(--color-primary); font-size: .9375rem; }
.link-primary:hover { color: var(--color-primary-dark); }
.link-muted { color: var(--color-text-secondary); font-size: .875rem; }
.link-muted:hover { color: var(--color-primary); }

.btn-group { display: inline-flex; gap: .375rem; }
.badge-xs { padding: .1rem .45rem; font-size: .6875rem; }

.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--color-text-secondary);
}
.empty-state p { font-size: .9375rem; }

/* Divider */
hr { border: none; border-top: 1px solid var(--color-border); margin: 1.25rem 0; }

/* Code */
code, pre {
  font-family: var(--font-mono);
  font-size: .875em;
  background: var(--slate-100);
  border-radius: var(--radius-xs);
  padding: .15em .4em;
}
pre {
  padding: .875rem;
  overflow-x: auto;
  white-space: pre-wrap;
  border: 1px solid var(--color-border);
}
pre code { background: none; padding: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE – Tablet (≤ 1024px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .team-page { grid-template-columns: 1fr; }
  .seasons-layout { grid-template-columns: 1fr; }
  .smtp-grid { grid-template-columns: 1fr; }
  .mission-detail-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE – Mobile (≤ 768px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Spacing */
  .main-content { padding: 1.25rem 0 5rem; }
  .container { padding: 0 1rem; }

  /* Page header */
  .page-header { flex-direction: column; gap: .75rem; }
  .page-header-actions { width: 100%; }
  .page-header-actions .btn { flex: 1; justify-content: center; }

  /* Hamburger visible */
  .nav-hamburger { display: flex; }

  /* Mobile menu as full-screen overlay */
  .navbar-menu {
    position: fixed;
    top: var(--navbar-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg-card);
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    gap: 0;
    padding: 1rem;
    z-index: 195;
    overflow-y: auto;
    transform: translateX(105%);
    transition: transform var(--transition);
    box-shadow: var(--shadow-lg);
    border-left: 1px solid var(--color-border);
  }
  #nav-toggle:checked ~ .navbar-menu { transform: translateX(0); }

  /* Hamburger → X animation */
  #nav-toggle:checked ~ .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  #nav-toggle:checked ~ .nav-hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  #nav-toggle:checked ~ .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Mobile nav links */
  .nav-link {
    height: 48px;
    padding: 0 1rem;
    border-radius: var(--radius-sm);
    font-size: .9375rem;
    width: 100%;
    justify-content: flex-start;
  }
  .nav-link--stub { display: none; }

  /* Mobile dropdown – always expanded */
  .nav-dropdown { width: 100%; }
  .nav-dropdown-btn {
    width: 100%;
    height: 48px;
    padding: 0 1rem;
    font-size: .9375rem;
    justify-content: space-between;
    border-radius: var(--radius-sm);
  }
  .nav-dropdown-menu {
    display: block;
    position: static;
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--orange-100);
    border-radius: 0;
    margin-left: 1rem;
    padding: .25rem 0;
    background: transparent;
  }
  .nav-dropdown-menu .dropdown-item { height: 44px; display: flex; align-items: center; }

  /* Mobile user section */
  .nav-user { margin-left: 0; margin-top: auto; border-top: 1px solid var(--color-border); padding-top: 1rem; }
  .nav-user-btn {
    width: 100%;
    height: 48px;
    border-radius: var(--radius-sm);
    padding: 0 1rem;
    justify-content: flex-start;
    border: 1px solid var(--color-border);
  }
  .nav-user-name { flex: 1; text-align: left; }
  .nav-user-dropdown {
    position: static;
    display: block;
    box-shadow: none;
    border: 1px solid var(--color-border);
    margin-top: .5rem;
    border-radius: var(--radius-sm);
  }
  .nav-user-dropdown.open { display: block; }

  /* Backdrop */
  .nav-backdrop { display: none; }
  #nav-toggle:checked ~ .nav-backdrop,
  body.nav-open .nav-backdrop { display: block; }

  /* Forms */
  .form-row { grid-template-columns: 1fr; }

  /* Stats */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .stat-number { font-size: 1.75rem; }

  /* Missions */
  .missions-grid { grid-template-columns: 1fr; }
  .mission-card { padding: 1rem; }

  /* Team */
  .team-members-grid { grid-template-columns: repeat(2, 1fr); }

  /* Tables — horizontal scroll */
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table th, .table td { padding: .625rem .75rem; font-size: .8125rem; }

  /* Buttons full-width where wrapped */
  .smtp-test-row { flex-direction: column; }
  .smtp-test-row .btn { width: 100%; justify-content: center; }

  /* Cards */
  .card { border-radius: var(--radius); }

  /* Auth */
  .auth-body { padding: 1.5rem 1rem; align-items: flex-start; padding-top: 3rem; }
  .auth-card .card-body { padding: 1.5rem; }

  /* Field builder */
  .field-item { flex-wrap: wrap; }
  .field-item-actions { width: 100%; }

  /* Documents */
  .doc-layout { grid-template-columns: 1fr; }
  .doc-sidebar { position: static; }

  /* Payments */
  .payment-layout { grid-template-columns: 1fr; }
  .payment-sidebar { position: static; }

  /* Reporting */
  .reporting-charts { grid-template-columns: 1fr; }
  .report-actions { flex-direction: column; }
  .report-actions .btn { width: 100%; justify-content: center; }

  /* Feed */
  .feed-post { padding: 1rem; }

  /* Pagination */
  .pagination { gap: .375rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE – Small mobile (≤ 480px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .stat-card { padding: 1rem; }
  .stat-number { font-size: 1.5rem; }

  .page-header h1 { font-size: 1.375rem; }

  .team-members-grid { grid-template-columns: 1fr 1fr; }

  .missions-grid { grid-template-columns: 1fr; }

  .card-header { padding: .875rem 1rem; }
  .card-body { padding: 1rem; }

  /* Ensure table scrolls */
  .table-responsive { margin: 0 -1rem; border-radius: 0; }
}
