/* ============================================================
   ImmoGestion — Styles personnalisés
   ============================================================
   Complète Tailwind avec des styles spécifiques au projet.
   ============================================================ */

/* ── Variables de marque ─────────────────────────────────── */
:root {
  --brand-primary: #1a365d;
  --brand-dark: #1e3a5f;
  --brand-light: #dbeafe;
  --brand-lighter: #eff6ff;
  --brand-accent: #2563eb;
  --brand-accent-light: #93c5fd;
}

/* ── Scrollbar personnalisée ─────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}
.dark ::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ── Logo texte ──────────────────────────────────────────── */
.brand-logo {
  font-weight: 700;
  color: var(--brand-primary);
}
.brand-logo span {
  color: var(--brand-accent-light);
}

/* ── Sidebar active link ─────────────────────────────────── */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  transition: all 0.15s ease;
}
.sidebar-link:hover {
  background: var(--brand-lighter);
  color: var(--brand-primary);
}
.sidebar-link.active {
  background: var(--brand-light);
  color: var(--brand-primary);
  font-weight: 600;
}
.dark .sidebar-link {
  color: #94a3b8;
}
.dark .sidebar-link:hover {
  background: #1e293b;
  color: #e2e8f0;
}
.dark .sidebar-link.active {
  background: #1e293b;
  color: #93c5fd;
}

/* ── Cards KPI ───────────────────────────────────────────── */
.kpi-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.2s ease;
}
.kpi-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.dark .kpi-card {
  background: #1e293b;
  border-color: #334155;
}

/* ── Badge statut ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25rem;
}
.badge-success {
  background: #dcfce7;
  color: #166534;
}
.badge-warning {
  background: #fef3c7;
  color: #92400e;
}
.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}
.badge-info {
  background: var(--brand-light);
  color: var(--brand-primary);
}
.dark .badge-success {
  background: #14532d;
  color: #86efac;
}
.dark .badge-warning {
  background: #78350f;
  color: #fde68a;
}
.dark .badge-danger {
  background: #7f1d1d;
  color: #fca5a5;
}
.dark .badge-info {
  background: #1e3a5f;
  color: #93c5fd;
}

/* ── DPE / GES badges ────────────────────────────────────── */
.dpe-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  font-weight: 700;
  font-size: 0.875rem;
  color: white;
}
.dpe-A { background: #22c55e; }
.dpe-B { background: #84cc16; }
.dpe-C { background: #eab308; }
.dpe-D { background: #f97316; }
.dpe-E { background: #ef4444; }
.dpe-F { background: #dc2626; }
.dpe-G { background: #991b1b; }

/* ── Formulaires ─────────────────────────────────────────── */
.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  background: white;
  color: #111827;
}
.form-input:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.dark .form-input {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}
.dark .form-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.375rem;
}
.dark .form-label {
  color: #d1d5db;
}

/* ── Boutons ─────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: var(--brand-primary);
  color: white;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s ease;
  border: none;
  cursor: pointer;
}
.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.15s ease;
  cursor: pointer;
}
.btn-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}
.dark .btn-secondary {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #475569;
}
.dark .btn-secondary:hover {
  background: #334155;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: #dc2626;
  color: white;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s ease;
  border: none;
  cursor: pointer;
}
.btn-danger:hover {
  background: #b91c1c;
}

/* ── Tables ──────────────────────────────────────────────── */
.table-container {
  overflow-x: auto;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
}
.dark .table-container {
  border-color: #334155;
}

/* ── Photo gallery ───────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}
.photo-grid img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
}
.dark .photo-grid img {
  border-color: #475569;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  animation: spin 0.8s linear infinite;
  border: 2px solid #e2e8f0;
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  width: 1.25rem;
  height: 1.25rem;
}

/* ── Theme cards (settings page) ─────────────────────────── */
.theme-card {
  background: white;
  border-color: #e5e7eb;
}
.theme-card:hover {
  border-color: #93c5fd;
  background: #f0f7ff;
}
.theme-card-active {
  border-color: #2563eb !important;
  background: #eff6ff;
}
.theme-label {
  color: #111827;
}
.theme-sub {
  color: #6b7280;
}
.dark .theme-card {
  background: #1e293b;
  border-color: #475569;
}
.dark .theme-card:hover {
  border-color: #60a5fa;
  background: #1e3a5f;
}
.dark .theme-card-active {
  border-color: #3b82f6 !important;
  background: #1e3a5f;
}
.dark .theme-label {
  color: #e2e8f0;
}
.dark .theme-sub {
  color: #94a3b8;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar-mobile-hidden {
    display: none;
  }
}
