/* =========================================================================
   CORE.CSS — Styles communs à tous les formulaires "Ordre de Mission"
   ========================================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container { max-width: 900px; margin: 0 auto; }

.header {
  background: white;
  border-radius: 15px;
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  text-align: center;
}
.header h1 { color: #333; font-size: 28px; margin-bottom: 10px; }
.header .subtitle { color: #666; font-size: 14px; }

.main-content {
  background: white;
  border-radius: 15px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid #e0e0e0;
}
.tab {
  padding: 12px 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  color: #666;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
}
.tab.active { color: #667eea; border-bottom-color: #667eea; }
.tab:hover { color: #667eea; }

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

body:not(.is-admin) .admin-only { display: none !important; }
.admin-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
  margin-top: -8px;
}
.admin-bar a {
  font-size: 13px;
  color: #666;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(0,0,0,0.08);
  margin-left: 10px;
}
.admin-bar a:hover { color: #333; background: rgba(255,255,255,0.9); }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 8px; color: #333; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { outline: none; border-color: #667eea; }

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

.form-group-inline { display: flex; align-items: center; gap: 10px; }
.form-group-inline input[type="checkbox"] { width: auto; height: 20px; cursor: pointer; }

.calculated-field { background: #f5f5f5; font-weight: 600; color: #667eea; }

.total-display {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  margin: 20px 0;
}
.total-display .label { font-size: 14px; opacity: 0.9; margin-bottom: 5px; }
.total-display .amount { font-size: 32px; font-weight: bold; }

.btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 30px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: transform 0.2s;
  margin-top: 10px;
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary { background: #6c757d; }

.info-note {
  margin-top: 15px;
  padding: 15px;
  background: #fff3cd;
  border-radius: 8px;
  font-size: 13px;
  color: #856404;
}

.success-message, .error-message {
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  display: none;
}
.success-message { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.error-message { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.missions-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.missions-table th, .missions-table td {
  padding: 12px; text-align: left; border-bottom: 1px solid #e0e0e0;
}
.missions-table th { background: #f5f5f5; font-weight: 600; }
.missions-table tr:hover { background: #f9f9f9; }

.config-box {
  background: #fff3cd; border: 2px solid #ffc107; border-radius: 10px;
  padding: 20px; margin-bottom: 20px;
}
.config-box h3 { color: #856404; margin-bottom: 15px; }

.loader { display: none; text-align: center; padding: 20px; }
.loader.active { display: block; }
.spinner {
  border: 4px solid #f3f3f3; border-top: 4px solid #667eea; border-radius: 50%;
  width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
