/* ============================================================
   Formation · Sauvetage de Genève — Design System
   ============================================================ */

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

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: #ffffff;
  color: #092054;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: #092054; text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Topbar ----------------------------------------------- */
.topbar {
  background: #092054;
  height: 72px;
  padding: 0 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-logo {
  height: 48px;
  width: auto;
  display: block;
}

.topbar-org {
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-link {
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  text-decoration: none;
  transition: color .15s;
}
.topbar-link:hover { color: #ffffff; text-decoration: none; }

.topbar-btn {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 4px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.topbar-btn:hover { background: rgba(255,255,255,0.2); text-decoration: none; color: #fff; }

/* Admin badge in topbar */
.admin-badge {
  background: #facc15;
  color: #092054;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.topbar-admin-quit {
  color: #facc15;
  font-size: 13px;
  text-decoration: none;
  opacity: 0.9;
}
.topbar-admin-quit:hover { opacity: 1; text-decoration: underline; color: #facc15; }

/* --- Breadcrumb bar --------------------------------------- */
.breadcrumb-bar {
  background: #f0f2f5;
  border-bottom: 1px solid #e4e8ee;
  height: 40px;
  padding: 0 52px;
  display: flex;
  align-items: center;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 13px;
  color: #64748b;
  list-style: none;
}

.breadcrumb li { display: flex; align-items: center; }
.breadcrumb li + li::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-top: 1px solid #9ca3af;
  border-right: 1px solid #9ca3af;
  transform: rotate(45deg);
  margin: 0 10px;
  flex-shrink: 0;
}
.breadcrumb a { color: #64748b; text-decoration: none; }
.breadcrumb a:hover { color: #092054; text-decoration: underline; }
.breadcrumb li:last-child { color: #092054; font-weight: 500; }

/* --- Page layout ------------------------------------------ */
.page-content {
  padding: 40px 52px 60px;
  max-width: 1100px;
  width: 100%;
  flex: 1;
  margin: 0 auto;
  box-sizing: border-box;
}

.page-header {
  margin-bottom: 36px;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: #092054;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.page-header p {
  font-size: 15px;
  color: #64748b;
}

.section-rule {
  width: 36px;
  height: 3px;
  background: #092054;
  border: none;
  margin: 14px 0 0;
  border-radius: 2px;
}

/* --- Cards grid ------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

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

.card {
  background: #f4f6fa;
  border: 1px solid #e4e8ee;
  border-radius: 4px;
  padding: 28px 26px;
  display: block;
  text-decoration: none;
  color: #092054;
  transition: background .15s, border-color .15s;
  cursor: pointer;
}
.card:hover {
  background: #eaecf5;
  border-color: #092054;
  text-decoration: none;
  color: #092054;
}

.card-icon {
  width: 22px;
  height: 22px;
  color: #092054;
  margin-bottom: 14px;
  display: block;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.card-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

/* Card variants */
.card-flat {
  background: #f4f6fa;
  border: 1px solid #e4e8ee;
  border-radius: 4px;
  padding: 24px 26px;
}

/* --- Flat panel (non-clickable) --------------------------- */
.panel {
  background: #f4f6fa;
  border: 1px solid #e4e8ee;
  border-radius: 4px;
  padding: 28px 26px;
  margin-bottom: 20px;
}

/* --- Notice / info box ------------------------------------ */
.notice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 16px 20px;
  font-size: 14px;
  color: #78350f;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.notice-admin {
  background: #fefce8;
  border-color: #facc15;
  color: #92400e;
}

.notice svg { flex-shrink: 0; margin-top: 1px; }

/* --- Auth / login card ------------------------------------ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f6fa;
  padding: 32px 16px;
}

.auth-card {
  background: #ffffff;
  border: 1px solid #e4e8ee;
  border-radius: 4px;
  padding: 40px 44px;
  width: 100%;
  max-width: 420px;
}

.auth-logo-wrap {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  height: 52px;
  width: auto;
}

.auth-title {
  font-size: 18px;
  font-weight: 700;
  color: #092054;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 28px;
}

.auth-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 18px;
}

/* --- Form elements ---------------------------------------- */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #092054;
  margin-bottom: 6px;
}

.form-label-required::after {
  content: ' *';
  color: #dc2626;
}

.form-control {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e4e8ee;
  border-radius: 4px;
  font-size: 14px;
  color: #092054;
  background: #ffffff;
  transition: border-color .15s;
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  border-color: #092054;
}
.form-control:disabled {
  background: #f4f6fa;
  color: #9ca3af;
}

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23092054' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

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

.form-hint {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}

.form-section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #9ca3af;
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e4e8ee;
}

/* --- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
  font-family: inherit;
  line-height: 1;
}

.btn-primary {
  background: #092054;
  color: #ffffff;
}
.btn-primary:hover { background: #0d2d73; color: #fff; text-decoration: none; }

.btn-secondary {
  background: #ffffff;
  color: #092054;
  border: 1px solid #e4e8ee;
}
.btn-secondary:hover { background: #f4f6fa; border-color: #092054; text-decoration: none; color: #092054; }

.btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.btn-danger:hover { background: #fee2e2; text-decoration: none; color: #dc2626; }

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-full { width: 100%; }

/* --- Table ------------------------------------------------ */
.table-wrap {
  overflow-x: auto;
  border: 1px solid #e4e8ee;
  border-radius: 4px;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  background: #f4f6fa;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid #e4e8ee;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f2f5;
  color: #092054;
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f9fafb; }

/* --- Tags / badges ---------------------------------------- */
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.tag-navy { background: #e8ecf5; color: #092054; }
.tag-green { background: #dcfce7; color: #166534; }
.tag-amber { background: #fffbeb; color: #78350f; border: 1px solid #fde68a; }
.tag-red { background: #fef2f2; color: #991b1b; }
.tag-grey { background: #f1f5f9; color: #64748b; }
.tag-oblig { background: #dc2626; color: #ffffff; font-weight: 700; }

/* --- Chart container -------------------------------------- */
.chart-card {
  background: #f4f6fa;
  border: 1px solid #e4e8ee;
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 20px;
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: #092054;
  margin-bottom: 16px;
}

.chart-wrap {
  position: relative;
  height: 220px;
}

/* --- Tabs ------------------------------------------------- */
.tabs {
  display: flex;
  border-bottom: 1px solid #e4e8ee;
  margin-bottom: 24px;
  gap: 0;
}

.tab-link {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.tab-link:hover { color: #092054; text-decoration: none; }
.tab-link.active { color: #092054; border-bottom-color: #092054; }

/* --- Empty state ------------------------------------------ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
}

.empty-state svg {
  display: block;
  margin: 0 auto 16px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 14px;
}

/* --- Programme event card --------------------------------- */
.event-card {
  background: #f4f6fa;
  border: 1px solid #e4e8ee;
  border-radius: 4px;
  margin-bottom: 10px;
  overflow: hidden;
}

.event-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 16px;
  transition: background .12s;
}
.event-header:hover { background: #eaecf5; }

.event-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.event-date-block {
  text-align: center;
  min-width: 46px;
  flex-shrink: 0;
}

.event-date-day {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: #092054;
}

.event-date-month {
  font-size: 11px;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.05em;
}

.event-title-wrap { flex: 1; min-width: 0; }

.event-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.event-chevron {
  flex-shrink: 0;
  color: #64748b;
  transition: transform .2s;
}
.event-card.open .event-chevron { transform: rotate(90deg); }

.event-body {
  display: none;
  padding: 20px 20px 20px 80px;
  border-top: 1px solid #e4e8ee;
  background: #ffffff;
}
.event-card.open .event-body { display: block; }

.event-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 32px;
  margin-bottom: 16px;
}

.event-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  margin-bottom: 2px;
}

.event-field-value {
  font-size: 14px;
  color: #092054;
}

.event-body-text {
  font-size: 14px;
  color: #374151;
  white-space: pre-wrap;
  line-height: 1.6;
}

/* --- Programme admin actions ------------------------------ */
.event-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* --- Progress / logbook entries --------------------------- */
.entry-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #f0f2f5;
}
.entry-row:last-child { border-bottom: none; }

.entry-date {
  font-size: 12px;
  color: #9ca3af;
  min-width: 90px;
  flex-shrink: 0;
  padding-top: 2px;
}

.entry-content { flex: 1; }

.entry-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.entry-note {
  font-size: 13px;
  color: #64748b;
}

/* --- Section heading -------------------------------------- */
.section-heading {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #9ca3af;
  margin: 32px 0 14px;
}

/* --- Stat cards (dashboard) ------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  background: #f4f6fa;
  border: 1px solid #e4e8ee;
  border-radius: 4px;
  padding: 18px 20px;
}

.stat-label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #092054;
  line-height: 1;
}

.stat-sub {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}

/* --- User picker (logbook login) -------------------------- */
.user-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-pick-btn {
  background: #f4f6fa;
  border: 1px solid #e4e8ee;
  border-radius: 4px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #092054;
  transition: background .12s, border-color .12s;
  text-decoration: none;
  width: 100%;
}
.user-pick-btn:hover { background: #eaecf5; border-color: #092054; }

/* --- Footer ----------------------------------------------- */
footer {
  padding: 24px 52px;
  border-top: 1px solid #e4e8ee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #9ca3af;
  flex-shrink: 0;
}

footer a { color: #64748b; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* --- Responsive ------------------------------------------- */
@media (max-width: 900px) {
  .topbar { padding: 0 20px; height: 60px; }
  .topbar-logo { height: 36px; }
  .topbar-org { display: none; }
  .breadcrumb-bar { padding: 0 20px; }
  .page-content { padding: 24px 20px 40px; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  footer { padding: 16px 20px; flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 600px) {
  .topbar { padding: 0 16px; }
  .breadcrumb-bar { padding: 0 16px; }
  .page-content { padding: 18px 16px 32px; }
  .card-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .event-body-grid { grid-template-columns: 1fr; }
  .table-wrap { font-size: 13px; }
}
