/* ── BatiKraft Website — Shared Styles ── */
:root {
  --bg: #0f1117;
  --bg2: #161b27;
  --bg3: #1e2535;
  --border: #2a3347;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --text: #e2e8f0;
  --text-muted: #8892a4;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 10px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.nav-logo svg { color: var(--primary); }

.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-links a {
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: all 0.15s;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--bg3);
  text-decoration: none;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); background: var(--bg3); text-decoration: none; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.85; text-decoration: none; }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── CARD ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ── FORM ── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 10px 13px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.15s;
  outline: none;
}

.form-input:focus { border-color: var(--primary); }
select.form-input { cursor: pointer; }

/* ── ALERTS ── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.alert-success {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-blue   { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.badge-green  { background: rgba(34, 197, 94,  0.15); color: #86efac; }
.badge-orange { background: rgba(251, 146, 60, 0.15); color: #fdba74; }
.badge-red    { background: rgba(239, 68, 68,  0.15); color: #fca5a5; }

/* ── TABLE ── */
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(42, 51, 71, 0.5);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  width: 100%;
  max-width: 440px;
}

.modal h3 { font-size: 1.1rem; margin-bottom: 4px; }
.modal p { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 20px; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ── SPINNER ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.8s linear infinite; display: inline-block; }

/* ── SECTION CARD (partagé entre portal et admin) ── */
.section-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.section-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-card-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1;
}

.section-card-body { padding: 20px; }

/* ── UTILITIES ── */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.78rem; }
.mono { font-family: monospace; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
