/**
 * LCDC42 Components CSS v2.0
 * Composants réutilisables pour toutes les apps
 * Basé sur le design Entrées (mobile-first)
 * 
 * Usage: <link rel="stylesheet" href="/public/components.css">
 * Requiert: lcdc42.css (variables)
 */

/* ===== VARIABLES ===== */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-height: 56px;
  --bottom-nav-height: 64px;
  --touch-target: 48px;
}

/* ===== RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  background: var(--gray-100);
  overscroll-behavior: none;
}

/* ===== APP LAYOUT ===== */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
  max-width: 100vw;
  overflow-x: clip;
}

.app--no-bottom-nav {
  padding-bottom: 0;
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header__back {
  width: var(--touch-target);
  height: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  color: var(--gray-700);
  text-decoration: none;
  font-size: 20px;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.header__back:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.header__logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  object-fit: cover;
}

.header__title {
  flex: 1;
  min-width: 0;
}

.header__title h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header__title p {
  font-size: 12px;
  color: var(--gray-500);
  margin: 2px 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header__avatar {
  width: var(--touch-target);
  height: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  border: none;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
}

.header__avatar:active {
  transform: scale(0.95);
}

.header__avatar:hover {
  box-shadow: 0 2px 8px rgba(97, 162, 41, 0.4);
}

.header__avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* ===== USER MENU DROPDOWN ===== */
.user-menu {
  position: fixed;
  top: 70px;
  right: 16px;
  width: 280px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.user-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu__backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s;
}

.user-menu__backdrop.open {
  opacity: 1;
  visibility: visible;
}

.user-menu__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.user-menu__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.user-menu__avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-menu__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.user-menu__name {
  font-size: 16px;
  font-weight: 600;
  color: var(--secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu__email {
  font-size: 13px;
  color: var(--gray-500);
  margin: 2px 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu__divider {
  height: 1px;
  background: var(--gray-200);
  margin: 4px 0;
}

.user-menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  font-size: 15px;
  color: var(--gray-700);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: background 0.15s;
}

.user-menu__item:hover {
  background: var(--gray-100);
}

.user-menu__item span {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.user-menu__item--danger {
  color: var(--danger);
}

.user-menu__item--danger:hover {
  background: #fef2f2;
}

/* ===== STATS BAR ===== */
.stats-bar {
  position: sticky;
  top: 72px;
  z-index: 95;
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: var(--gray-100);
  transition: all 0.2s ease;
  justify-content: center;
}

.stats-bar::-webkit-scrollbar {
  display: none;
}

/* Version compacte au scroll */
.stats-bar.compact {
  padding: 6px 16px;
  gap: 6px;
}

.stat {
  flex: 0 1 auto;
  min-width: 60px;
  background: var(--gray-100);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  text-align: center;
  transition: all 0.2s ease;
}

.stats-bar.compact .stat {
  padding: 6px 8px;
  min-width: 50px;
  border-radius: var(--radius-sm);
}

.stat--primary { background: var(--stat-green); }
.stat--blue { background: var(--stat-blue); }
.stat--orange { background: var(--stat-orange); }
.stat--purple { background: #f3e5f5; }
.stat--gray { background: var(--gray-200); }

.stat__value {
  font-size: 24px;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1;
  transition: font-size 0.2s ease;
}

.stats-bar.compact .stat__value {
  font-size: 18px;
}

.stat--primary .stat__value { color: var(--primary); }
.stat--blue .stat__value { color: var(--info); }
.stat--orange .stat__value { color: var(--warning); }
.stat--purple .stat__value { color: #7b1fa2; }

.stat__label {
  font-size: 11px;
  color: var(--gray-600);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.stats-bar.compact .stat__label {
  font-size: 9px;
  margin-top: 2px;
}

/* ===== SEARCH BAR ===== */
.search-bar {
  padding: 12px 16px;
  background: var(--gray-100);
}

.search-input {
  width: 100%;
  height: var(--touch-target);
  padding: 0 16px 0 44px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-size: 16px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") 14px center no-repeat;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.search-input::placeholder {
  color: var(--gray-400);
}

/* ===== FILTER BAR / CHIPS ===== */
.filter-bar {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: var(--gray-100);
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
}

.filter-chip:hover {
  border-color: var(--primary);
}

.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.filter-chip__count {
  background: rgba(0,0,0,0.1);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.filter-chip.active .filter-chip__count {
  background: rgba(255,255,255,0.2);
}

/* ===== CONTENT AREA ===== */
.content {
  flex: 1;
  padding: 16px;
  box-sizing: border-box;
}

/* ===== CARDS (generic) ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
  animation: cardSlideIn 0.3s ease-out backwards;
}

.card:active {
  transform: scale(0.98);
}

.card--checked,
.card--present {
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
  border-left: 4px solid var(--primary);
}

.card--warning,
.card--pouvoir {
  background: linear-gradient(135deg, #fff8e1 0%, #fffde7 100%);
  border-left: 4px solid var(--warning);
}

.card__header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-600);
  flex-shrink: 0;
}

.card--checked .card__avatar,
.card--present .card__avatar {
  background: var(--primary);
  color: var(--white);
}

.card--warning .card__avatar,
.card--pouvoir .card__avatar {
  background: var(--warning);
  color: var(--white);
}

.card__info {
  flex: 1;
  min-width: 0;
}

.card__name {
  font-size: 16px;
  font-weight: 600;
  color: var(--secondary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card__details {
  font-size: 13px;
  color: var(--gray-500);
  margin: 4px 0 0 0;
}

.card__badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.card__badge--bureau { background: #e3f2fd; color: #1976d2; }
.card__badge--asso { background: #f3e5f5; color: #7b1fa2; }
.card__badge--success { background: #e8f5e9; color: #2e7d32; }
.card__badge--warning { background: #fff3e0; color: #e65100; }
.card__badge--danger { background: #ffebee; color: #c62828; }

.card__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-600);
  flex-wrap: wrap;
  margin-top: 8px;
}

.card__status--success { color: var(--success); font-weight: 600; }
.card__status--warning { color: var(--warning); font-weight: 600; }

.card__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.card__actions .btn {
  flex: 1;
  min-width: 120px;
}

/* Card list */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===== BUTTONS ===== */
.btn {
  height: var(--touch-target);
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s, opacity 0.15s;
  text-decoration: none;
}

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

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

.btn--primary { background: var(--primary); color: white; }
.btn--secondary { background: var(--gray-200); color: var(--secondary); }
.btn--warning { background: var(--warning); color: white; }
.btn--danger { background: #ffebee; color: var(--error); }
.btn--info { background: var(--info); color: white; }

.btn--primary:hover { background: var(--primary-dark, #4a8c1f); }
.btn--secondary:hover { background: var(--gray-300); }

.btn--full { width: 100%; }
.btn--sm { height: 36px; padding: 0 12px; font-size: 13px; }

.btn--outline {
  background: transparent;
  border: 2px solid var(--gray-200);
  color: var(--gray-700);
}

.btn--outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-500);
}

.empty-state__icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--secondary);
  margin: 0 0 8px 0;
}

.empty-state__text {
  font-size: 14px;
  margin: 0;
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  display: flex;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--gray-500);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s;
  text-decoration: none;
  padding: 8px;
}

.bottom-nav__item--active {
  color: var(--primary);
}

.bottom-nav__item:active {
  background: var(--gray-100);
}

.bottom-nav__icon {
  font-size: 24px;
  line-height: 1;
}

/* Special scan button */
.bottom-nav__item--scan {
  position: relative;
  top: -20px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(97, 162, 41, 0.5);
  flex: 0 0 auto;
}

.bottom-nav__item--scan .bottom-nav__icon {
  font-size: 28px;
}

.bottom-nav__item--scan:active {
  background: var(--primary-dark, #4a8c1f);
  transform: scale(0.95);
}

/* ===== CONFIG PANEL (slide up) ===== */
.config-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  display: none;
}

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

.config-panel__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
}

.config-panel__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-radius: 24px 24px 0 0;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  padding-bottom: calc(24px + var(--safe-bottom));
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.config-panel__handle {
  width: 100%;
  height: 28px;
  margin: 0 0 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.config-panel__handle::after {
  content: '';
  width: 40px;
  height: 4px;
  background: var(--gray-300);
  border-radius: 2px;
}

.config-panel__handle:active::after {
  background: var(--gray-400);
}

.config-panel__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--secondary);
  margin: 0 0 20px 0;
}

.config-group {
  margin-bottom: 16px;
}

.config-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 8px;
}

.config-group input,
.config-group select,
.config-group textarea {
  width: 100%;
  height: var(--touch-target);
  padding: 0 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 16px;
  background: var(--white);
}

.config-group textarea {
  height: 150px;
  padding: 12px 16px;
  resize: vertical;
}

.config-group input:focus,
.config-group select:focus,
.config-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.config-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

/* ===== MODAL TABS ===== */
.modal-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-tabs::-webkit-scrollbar {
  display: none;
}

.modal-tab {
  padding: 10px 16px;
  background: var(--gray-100);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  white-space: nowrap;
  transition: all 0.15s;
}

.modal-tab:hover {
  background: var(--gray-200);
}

.modal-tab.active {
  background: var(--primary);
  color: var(--white);
}

.tab-content {
  display: none;
}

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

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 16px);
  left: 16px;
  right: 16px;
  background: var(--secondary);
  color: white;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  font-weight: 500;
  text-align: center;
  z-index: 1001;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.warning { background: var(--warning); }

/* ===== SKELETON LOADING ===== */
.skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-content {
  flex: 1;
}

.skeleton-line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-bottom: 8px;
}

.skeleton-line:last-child {
  width: 60%;
  margin-bottom: 0;
}

.skeleton-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/* ===== ANIMATIONS ===== */
@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation delay */
.card:nth-child(1) { animation-delay: 0ms; }
.card:nth-child(2) { animation-delay: 30ms; }
.card:nth-child(3) { animation-delay: 60ms; }
.card:nth-child(4) { animation-delay: 90ms; }
.card:nth-child(5) { animation-delay: 120ms; }
.card:nth-child(6) { animation-delay: 150ms; }
.card:nth-child(7) { animation-delay: 180ms; }
.card:nth-child(8) { animation-delay: 210ms; }
.card:nth-child(9) { animation-delay: 240ms; }
.card:nth-child(10) { animation-delay: 270ms; }

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

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== QUORUM BAR ===== */
.quorum-bar {
  background: var(--white);
  margin: 0 16px;
  padding: 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.quorum-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.quorum-label {
  font-size: 13px;
  color: var(--gray-600);
}

.quorum-value {
  font-size: 18px;
  font-weight: 700;
}

.quorum-value.reached { color: var(--success); }
.quorum-value.not-reached { color: var(--warning); }

.quorum-track {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.quorum-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.quorum-fill.reached { background: var(--success); }
.quorum-fill.not-reached { background: var(--warning); }

.quorum-marker {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: var(--danger);
}

.quorum-details {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--gray-600);
  flex-wrap: wrap;
}

/* ===== SIGNATURE PAD ===== */
.signature-container {
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px 0;
}

.signature-pad {
  width: 100%;
  height: 150px;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  touch-action: none;
  cursor: crosshair;
}

.signature-hint {
  text-align: center;
  color: var(--gray-500);
  font-size: 13px;
  margin-top: 8px;
}

.signature-preview {
  width: 60px;
  height: 30px;
  object-fit: contain;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  background: var(--white);
}

/* ===== TABLET & DESKTOP ===== */
@media screen and (min-width: 768px) {
  .app {
    max-width: 100%;
    padding-bottom: 20px;
  }
  
  .bottom-nav {
    display: none !important;
  }
  
  .header {
    position: sticky;
    top: 0;
    padding: 16px 40px;
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    z-index: 100;
  }
  
  .stats-bar {
    position: sticky;
    top: 72px;
    padding: 12px 40px;
    justify-content: center;
    gap: 12px;
    background: var(--gray-100);
    z-index: 95;
  }
  
  .stats-bar.compact {
    padding: 8px 40px;
    gap: 8px;
  }
  
  .stat {
    min-width: 80px;
    flex: 0 1 auto;
    padding: 12px 16px;
  }
  
  .stats-bar.compact .stat {
    padding: 8px 12px;
    min-width: 70px;
  }
  
  .stat__value { font-size: 20px; }
  .stats-bar.compact .stat__value { font-size: 16px; }
  .stat__label { font-size: 11px; }
  .stats-bar.compact .stat__label { font-size: 10px; }
  
  .quorum-bar {
    margin: 16px 40px;
  }
  
  .search-bar {
    position: sticky;
    top: 130px;
    padding: 12px 40px;
    background: var(--gray-100);
    z-index: 90;
    display: flex;
    gap: 12px;
    align-items: center;
  }
  
  .search-input {
    flex: 1;
  }
  
  .filter-bar {
    padding: 0 40px 12px;
  }
  
  .content {
    padding: 16px 40px 24px;
  }
  
  .card-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .card {
    min-width: 0;
    box-shadow: none;
    border: 1px solid var(--gray-200);
  }
  
  .card:hover {
    border-color: var(--primary);
  }
  
  .config-panel__content {
    max-width: 500px;
    margin: 0 auto;
    border-radius: 24px;
    bottom: 50%;
    transform: translateY(50%);
  }
  
  .toast {
    bottom: 24px;
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(100px);
    max-width: 400px;
  }
  
  .toast.show {
    transform: translateX(-50%) translateY(0);
  }
}

@media screen and (min-width: 1200px) {
  .header,
  .stats-bar,
  .search-bar,
  .filter-bar,
  .content {
    padding-left: 60px !important;
    padding-right: 60px !important;
  }
  
  .quorum-bar {
    margin-left: 60px;
    margin-right: 60px;
  }
  
  .card-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (min-width: 1600px) {
  .header,
  .stats-bar,
  .search-bar,
  .filter-bar,
  .content {
    padding-left: 100px !important;
    padding-right: 100px !important;
  }
  
  .quorum-bar {
    margin-left: 100px;
    margin-right: 100px;
  }
  
  .card-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Desktop actions (hidden on mobile) */
.desktop-actions {
  display: none;
}

@media (min-width: 768px) {
  .desktop-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
  }
  
  .desktop-btn {
    padding: 10px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--gray-700);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
  }
  
  .desktop-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
  }
  
  .desktop-btn--primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
  }
  
  .desktop-btn--primary:hover {
    background: var(--primary-dark, #4a8c1f);
    border-color: var(--primary-dark, #4a8c1f);
  }
}
