/* ══════════════════════════════════════════════════════
   Gestion de Patrimoine — Design soft & professionnel
   ══════════════════════════════════════════════════════ */

:root {
  --primary:       #4F6AF0;
  --primary-light: #EEF1FE;
  --primary-dark:  #3A52C4;
  --success:       #2E9E6B;
  --success-light: #E8F7F1;
  --warning:       #E8971E;
  --warning-light: #FEF5E7;
  --danger:        #E05353;
  --danger-light:  #FDEAEA;
  --purple:        #7B61E8;
  --purple-light:  #F0EDFD;

  --text-dark:     #1A2035;
  --text-muted:    #6B7A99;
  --text-light:    #A0AABF;

  --border:        #E8EBF3;
  --bg:            #F4F6FB;
  --white:         #FFFFFF;

  --sidebar-w:     256px;
  --topbar-h:      60px;

  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     14px;

  --shadow-xs:     0 1px 3px rgba(26,32,53,.06);
  --shadow-sm:     0 2px 8px rgba(26,32,53,.08);
  --shadow-md:     0 4px 16px rgba(26,32,53,.10);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: .9375rem;
  color: var(--text-dark);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ──────────────────────────────────────────────────────
   AUTH — Login / Inscription
   ────────────────────────────────────────────────────── */

.auth-page {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.auth-brand-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
}

.auth-brand-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.2rem;
}

.auth-brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}

.auth-brand-sub {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 400;
}

.auth-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: .25rem;
  text-align: center;
}

.auth-subtitle {
  font-size: .85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.75rem;
}

/* Form controls */
.form-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: .4rem;
}

.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .55rem .8rem;
  font-size: .9rem;
  color: var(--text-dark);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,106,240,.12);
  outline: none;
}

.form-control::placeholder { color: var(--text-light); }

.form-text {
  font-size: .76rem;
  color: var(--text-muted);
  margin-top: .3rem;
}

.input-group-text {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-right: none;
  color: var(--text-muted);
  font-size: .9rem;
}

.input-group .form-control { border-left: none; }
.input-group .form-control:focus { border-left: none; }

/* Buttons */
.btn {
  font-size: .875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: .5rem 1rem;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
  border: 1.5px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.btn:active { transform: translateY(1px); }

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

.btn-success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.btn-success:hover { background: #247A54; border-color: #247A54; color: #fff; }

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

.btn-outline-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}
.btn-outline-secondary:hover { background: var(--bg); color: var(--text-dark); border-color: #c5cbe0; }

.btn-outline-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-outline-danger:hover { background: var(--danger-light); color: var(--danger); }

.btn-sm { padding: .35rem .7rem; font-size: .8rem; }
.btn-lg { padding: .65rem 1.4rem; font-size: .95rem; }
.btn-auth { padding: .65rem; width: 100%; justify-content: center; border-radius: var(--radius-sm); }

/* Alerts */
.alert {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: .7rem 1rem;
  font-size: .875rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.alert-danger  { background: var(--danger-light);  border-color: #f8c4c4; color: #b91c1c; }
.alert-warning { background: var(--warning-light); border-color: #fbd98a; color: #92400e; }
.alert-success { background: var(--success-light); border-color: #9ad9bf; color: #166534; }
.alert-info    { background: var(--primary-light); border-color: #c3cefd; color: var(--primary-dark); }

.alert .btn-close { margin-left: auto; font-size: .7rem; opacity: .5; }

/* Badges statut */
.badge-statut   { font-size: .72rem; font-weight: 600; border-radius: 5px; padding: .25em .6em; letter-spacing: .01em; }
.badge-actif    { background: var(--success-light); color: #166534; }
.badge-en_vente { background: var(--warning-light); color: #92400e; }
.badge-vendu    { background: var(--danger-light);  color: #b91c1c; }
.badge-suspendu { background: var(--warning-light); color: #92400e; }
.badge-resilie  { background: var(--danger-light);  color: #b91c1c; }

/* Pill badge (count) */
.pill {
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 700;
  padding: .15em .55em;
}

/* ──────────────────────────────────────────────────────
   LAYOUT ADMIN — Sidebar + Main
   ────────────────────────────────────────────────────── */

.admin-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand-icon {
  width: 36px; height: 36px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.05rem;
  flex-shrink: 0;
}

.sidebar-brand-name {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.3;
}
.sidebar-brand-role {
  font-size: .68rem;
  color: var(--text-muted);
  font-weight: 400;
}

.sidebar-nav { padding: 1rem .75rem; flex: 1; }

.nav-group-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-light);
  padding: .5rem .5rem .3rem;
  font-weight: 600;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}

.sidebar-link i { font-size: 1rem; width: 18px; text-align: center; }
.sidebar-link:hover  { background: var(--bg); color: var(--text-dark); }
.sidebar-link.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sidebar-link.danger { color: var(--danger); }
.sidebar-link.danger:hover { background: var(--danger-light); }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .65rem;
}

/* Main content */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
}

.topbar-sub {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.content-area { padding: 1.5rem; flex: 1; }

/* ──────────────────────────────────────────────────────
   COMPOSANTS
   ────────────────────────────────────────────────────── */

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-xs) !important;
}

.card-header {
  background: var(--white) !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  padding: .9rem 1.25rem !important;
}

.card-header-title {
  font-size: .875rem;
  font-weight: 700;
  color: var(--text-dark);
}

.card-body { padding: 1.25rem; }

/* Stat cards */
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-xs);
}

.stat-icon-wrap {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.stat-icon-blue   { background: var(--primary-light); color: var(--primary); }
.stat-icon-green  { background: var(--success-light); color: var(--success); }
.stat-icon-purple { background: var(--purple-light);  color: var(--purple); }
.stat-icon-orange { background: var(--warning-light); color: var(--warning); }

.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--text-dark); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; }

/* Tables */
.table { font-size: .875rem; margin: 0; }
.table thead th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border) !important;
  padding: .75rem 1rem;
  background: var(--bg);
}
.table tbody td {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-dark);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: #FAFBFF; }

/* Avatar */
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.avatar-md { width: 42px; height: 42px; font-size: .85rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1rem; }

/* Divider */
.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; margin-bottom: .75rem; opacity: .35; display: block; }
.empty-state p { font-size: .875rem; margin: 0; }

/* Form section */
.form-section { margin-bottom: 1.5rem; }
.form-section-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

/* Code tag */
code {
  font-size: .78rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 4px;
  padding: .1em .4em;
}

/* ──────────────────────────────────────────────────────
   LAYOUT CLIENT
   ────────────────────────────────────────────────────── */

.client-navbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.client-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-dark);
}

.client-brand-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
}

.client-brand-icon {
  width: 30px; height: 30px;
  background: var(--primary-light);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: .85rem;
}

.client-body { background: var(--bg); min-height: calc(100vh - var(--topbar-h)); }

.client-hero {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-xs);
}

.client-hero-text h2 { font-size: 1.1rem; font-weight: 700; color: var(--text-dark); margin: 0; }
.client-hero-text p  { font-size: .85rem; color: var(--text-muted); margin: .15rem 0 0; }

/* Dropdown */
.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: .35rem;
  font-size: .85rem;
}
.dropdown-item { border-radius: var(--radius-sm); padding: .45rem .75rem; color: var(--text-dark); }
.dropdown-item:hover { background: var(--bg); }
.dropdown-divider { border-color: var(--border); margin: .3rem 0; }

/* ── Info rows (bien detail) ─────────────────────────── */
.info-row {
  display: flex;
  align-items: baseline;
  padding: .55rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.info-row.last { border-bottom: none; }
.info-row:nth-child(even) { background: var(--bg); }

.info-label {
  flex: 0 0 160px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.info-value {
  flex: 1;
  font-size: .9rem;
  color: var(--text-dark);
}

/* ── Bien cards (client dashboard) ──────────────────── */
.bien-card {
  transition: box-shadow .15s, transform .15s;
}
.bien-card:hover {
  box-shadow: var(--shadow-md) !important;
  transform: translateY(-2px);
}

.bien-icon {
  width: 38px; height: 38px;
  background: var(--primary-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1rem;
  flex-shrink: 0;
}

.bien-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .9rem;
  font-size: .8rem;
  color: var(--text-muted);
}
.bien-meta span { display: flex; align-items: center; gap: .3rem; }

/* ──────────────────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

