/* ============================================================
   Vestify — Global Styles
   Font: Sora (display) + DM Sans (body) — Google Fonts
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ── Variables ── */
:root {
  --white: #ffffff;
  --bg: #f8f9fc;
  --bg-card: #ffffff;
  --navy: #0f172a;
  --navy-light: #1e293b;
  --blue: #3b82f6;
  --blue-dark: #2563eb;
  --blue-light: #eff6ff;
  --purple: #8b5cf6;
  --purple-light: #f5f3ff;
  --green: #22c55e;
  --green-light: #f0fdf4;
  --red: #ef4444;
  --red-light: #fef2f2;
  --amber: #f59e0b;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 20px 40px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.06);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font-display: 'Sora', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --transition: 0.22s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

/* ── Container ── */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container-sm { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* ── Typography ── */
h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; color: var(--navy); }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }

/* ── Navbar ── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  height: 68px;
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.3rem;
  color: var(--navy); letter-spacing: -.5px;
  text-decoration: none;
}
.brand-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1rem; font-weight: 800;
  font-family: var(--font-display);
}
.navbar-links {
  display: flex; align-items: center; gap: 4px; list-style: none;
}
.navbar-links a {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500; color: var(--text-secondary);
  transition: all var(--transition);
  text-decoration: none;
}
.navbar-links a:hover { background: var(--bg); color: var(--navy); }
.navbar-links .btn-admin {
  background: var(--navy); color: white !important;
  padding: 8px 16px;
}
.navbar-links .btn-admin:hover { background: var(--navy-light) !important; color: white !important; }

/* Hamburger */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--navy); border-radius: 2px;
  transition: all var(--transition); margin: 5px 0;
}
.mobile-menu {
  display: none; position: fixed; top: 68px; left: 0; right: 0;
  background: white; border-bottom: 1px solid var(--border);
  padding: 16px 24px; z-index: 99; box-shadow: var(--shadow-md);
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: flex; align-items: center; gap: 10px; padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary); font-weight: 500; font-size: .95rem;
}
.mobile-menu a:last-child { border: none; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .9375rem; font-weight: 600;
  cursor: pointer; border: none; transition: all var(--transition); text-decoration: none;
}
.btn-primary {
  background: var(--blue); color: white;
  box-shadow: 0 2px 12px rgba(59,130,246,.35);
}
.btn-primary:hover { background: var(--blue-dark); color: white; transform: translateY(-1px); box-shadow: 0 4px 18px rgba(59,130,246,.45); }
.btn-outline {
  background: transparent; color: var(--navy);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { background: var(--bg); border-color: var(--navy); color: var(--navy); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #dc2626; color: white; }
.btn-sm { padding: 9px 16px; font-size: .85rem; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ── Cards ── */
.card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.card-hover { transition: box-shadow var(--transition), transform var(--transition); }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 50px; font-size: .78rem; font-weight: 600;
}
.badge-info { background: #3b82f622; color: #3b82f6; }
.badge-purple { background: #8b5cf622; color: #8b5cf6; }
.badge-green { background: #22c55e22; color: #16a34a; }
.badge-red { background: #ef444422; color: #dc2626; }
.badge-amber { background: #f59e0b22; color: #d97706; }
.badge-gray { background: #94a3b822; color: #64748b; }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; margin-bottom: 7px;
  font-size: .875rem; font-weight: 600; color: var(--navy);
}
.form-control {
  width: 100%; padding: 12px 16px;
  background: white; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-family: var(--font-body); font-size: .9375rem;
  color: var(--text-primary); transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.form-control::placeholder { color: var(--text-muted); }
.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: .8rem; color: var(--red); margin-top: 5px; }
textarea.form-control { resize: vertical; min-height: 120px; }

/* ── Alerts ── */
.alert {
  padding: 14px 18px; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 500; margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: var(--green-light); color: #15803d; border: 1px solid #bbf7d0; }
.alert-error { background: var(--red-light); color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: var(--blue-light); color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead { background: var(--bg); }
th { padding: 13px 16px; text-align: left; font-size: .8rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; }
td { padding: 14px 16px; border-top: 1px solid var(--border-light); color: var(--text-primary); }
tr:hover td { background: var(--bg); }

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: 32px 0; }

/* ── Page header ── */
.page-header {
  padding: 100px 0 64px;
  text-align: center;
}

/* ── Footer ── */
.footer {
  background: var(--navy); color: rgba(255,255,255,.65);
  padding: 56px 0 24px;
  margin-top: auto;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px; margin-bottom: 48px;
}
.footer-brand { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; color: white; margin-bottom: 12px; }
.footer-desc { font-size: .875rem; line-height: 1.7; max-width: 260px; }
.footer-col h4 { font-family: var(--font-display); color: white; font-size: .9rem; font-weight: 700; margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: rgba(255,255,255,.6); font-size: .875rem; transition: color var(--transition); text-decoration: none; }
.footer-col ul li a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 24px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: .8125rem; flex-wrap: wrap; gap: 12px;
}
.footer-bottom a { color: rgba(255,255,255,.5); text-decoration: none; }
.footer-bottom a:hover { color: white; }

/* ── Cookie Banner ── */
.cookie-banner {
  position: fixed; bottom: 24px; left: 24px; right: 24px; z-index: 999;
  background: var(--navy); color: white;
  border-radius: var(--radius); padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .4s ease;
  max-width: 900px; margin: 0 auto;
}
.cookie-banner.hidden { display: none; }
.cookie-text { font-size: .875rem; color: rgba(255,255,255,.8); flex: 1; }
.cookie-text a { color: var(--blue); }
.cookie-actions { display: flex; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Utils ── */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-small { font-size: .875rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* ── Spinner ── */
.spinner {
  width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite;
  display: inline-block;
}
.spinner-blue { border-color: rgba(59,130,246,.3); border-top-color: var(--blue); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Admin layout ── */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; flex-shrink: 0; background: var(--navy);
  padding: 0; display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
  overflow-y: auto;
}
.sidebar-header {
  padding: 22px 24px; border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-brand { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; color: white; }
.sidebar-nav { padding: 16px 12px; flex: 1; }
.sidebar-label { font-size: .7rem; font-weight: 700; color: rgba(255,255,255,.35); text-transform: uppercase; letter-spacing: .1em; padding: 8px 12px 4px; }
.sidebar-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: 8px; color: rgba(255,255,255,.65); font-size: .9rem; font-weight: 500;
  transition: all var(--transition); text-decoration: none; margin-bottom: 2px;
}
.sidebar-link:hover { background: rgba(255,255,255,.08); color: white; }
.sidebar-link.active { background: rgba(59,130,246,.25); color: #93c5fd; }
.sidebar-link svg { width: 17px; height: 17px; flex-shrink: 0; }
.sidebar-footer { padding: 16px 12px; border-top: 1px solid rgba(255,255,255,.08); }
.admin-main { margin-left: 260px; min-height: 100vh; padding: 32px; flex: 1; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.admin-topbar h1 { font-size: 1.6rem; }

/* ── Stat cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: white; border-radius: var(--radius); border: 1px solid var(--border); padding: 22px 24px; }
.stat-label { font-size: .8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--navy); }
.stat-sub { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }

/* ── Print (facture) ── */
@media print {
  .navbar, .footer, .cookie-banner, .btn, .no-print { display: none !important; }
  body { background: white; }
  .invoice-card { box-shadow: none !important; border: none !important; }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .sidebar { width: 220px; }
  .admin-main { margin-left: 220px; padding: 24px; }
}
@media (max-width: 768px) {
  .navbar-links { display: none; }
  .menu-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-desc { max-width: none; }
  .admin-layout { flex-direction: column; }
  .sidebar { position: relative; width: 100%; height: auto; }
  .admin-main { margin-left: 0; padding: 20px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .cookie-banner { flex-direction: column; bottom: 0; left: 0; right: 0; border-radius: var(--radius) var(--radius) 0 0; }
  table { font-size: .8125rem; }
  th, td { padding: 10px 12px; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .btn { padding: 12px 18px; }
}