/* ============================================================
   ImmoGest Pro — Feuille de styles principale
   Design SaaS moderne, mode clair/sombre, responsive
   ============================================================ */

/* Variables CSS — Thème clair */
:root {
  --primary:        #2563EB;
  --primary-dark:   #1d4ed8;
  --primary-light:  #dbeafe;
  --secondary:      #64748b;
  --success:        #10B981;
  --success-light:  #d1fae5;
  --warning:        #F59E0B;
  --warning-light:  #fef3c7;
  --danger:         #EF4444;
  --danger-light:   #fee2e2;
  --teal:           #0D9488;
  --purple:         #7C3AED;
  --orange:         #EA580C;

  --bg:             #f1f5f9;
  --bg-card:        #ffffff;
  --bg-input:       #ffffff;
  --border:         #e2e8f0;
  --border-light:   #f1f5f9;

  --text:           #1e293b;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;

  --sidebar-bg:     #1e293b;
  --sidebar-text:   #cbd5e1;
  --sidebar-hover:  #334155;
  --sidebar-active: #2563EB;
  --sidebar-width:  260px;

  --header-h:       64px;
  --radius:         10px;
  --radius-sm:      6px;
  --radius-lg:      16px;
  --shadow:         0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:      0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:      0 10px 15px -3px rgba(0,0,0,.1);

  --transition:     0.2s ease;
  --font:           'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Dark mode */
[data-theme="dark"] {
  --bg:             #0f172a;
  --bg-card:        #1e293b;
  --bg-input:       #334155;
  --border:         #334155;
  --border-light:   #1e293b;
  --text:           #f1f5f9;
  --text-muted:     #94a3b8;
  --text-light:     #64748b;
  --sidebar-bg:     #0f172a;
  --sidebar-hover:  #1e293b;
  --primary-light:  rgba(37,99,235,.2);
  --success-light:  rgba(16,185,129,.2);
  --warning-light:  rgba(245,158,11,.2);
  --danger-light:   rgba(239,68,68,.2);
}

/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
ul, ol { list-style: none; }
input, select, textarea, button { font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Layout principal ─────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  z-index: 1000;
  transition: transform var(--transition);
  overflow-y: auto;
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  min-height: var(--header-h);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-size: 18px; font-weight: 700;
}
.sidebar-logo i { font-size: 22px; color: var(--primary); }
.sidebar-close { display: none; background: none; border: none; color: var(--sidebar-text); cursor: pointer; font-size: 18px; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-section { margin-bottom: 8px; }
.nav-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-light);
  padding: 12px 20px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; color: var(--sidebar-text);
  transition: background var(--transition), color var(--transition);
  border-radius: 0; cursor: pointer; text-decoration: none;
  font-size: 14px;
}
.nav-item:hover, .nav-item.active {
  background: var(--sidebar-hover); color: #fff; text-decoration: none;
}
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item i { width: 18px; text-align: center; font-size: 15px; }

.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); text-decoration: none;
  transition: background var(--transition);
}
.user-card:hover { background: var(--sidebar-hover); text-decoration: none; color: #fff; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-role { font-size: 11px; color: var(--text-light); }

/* ── Header ───────────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin var(--transition);
}
.header {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.header-left, .header-right { display: flex; align-items: center; min-width: 0; }
.header-left { gap: 16px; flex: 1; }
.header-right { gap: 8px; flex-shrink: 0; }
.menu-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 18px; padding: 6px;
  border-radius: var(--radius-sm);
  display: none;
}
.menu-toggle:hover { color: var(--primary); background: var(--primary-light); }
.breadcrumb {
  font-weight: 600; color: var(--text); font-size: 15px;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); position: relative;
}
.icon-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.content { flex: 1; padding: 24px; max-width: 1400px; width: 100%; margin: 0 auto; }
.footer { text-align: center; padding: 16px 24px; font-size: 12px; color: var(--text-light); border-top: 1px solid var(--border); }

.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 999;
}

/* ── Notifications dropdown ───────────────────────────────── */
.notif-dropdown, .user-dropdown { position: relative; }
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: #fff; font-size: 9px;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; padding: 0 3px;
}
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: min(360px, calc(100vw - 24px)); max-width: calc(100vw - 24px);
  background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none; z-index: 200;
}
.notif-panel.open { display: block; }
.notif-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.notif-header h4 { font-size: 14px; font-weight: 600; }
.notif-count { font-size: 12px; color: var(--text-muted); }
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item {
  display: flex; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer; transition: background var(--transition);
}
.notif-item:hover { background: var(--border-light); }
.notif-item.unread { background: var(--primary-light); }
.notif-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 14px;
}
.notif-warning { background: var(--warning-light); color: var(--warning); }
.notif-success { background: var(--success-light); color: var(--success); }
.notif-info    { background: var(--primary-light);  color: var(--primary); }
.notif-title   { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.notif-msg     { font-size: 12px; color: var(--text-muted); }
.notif-time    { font-size: 11px; color: var(--text-light); }
.notif-empty   { padding: 30px; text-align: center; color: var(--text-muted); }
.notif-empty i { font-size: 32px; color: var(--success); display: block; margin-bottom: 8px; }

/* User dropdown */
.user-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 5px 10px; cursor: pointer; color: var(--text);
  transition: all var(--transition);
}
.user-btn:hover { background: var(--border-light); }
.user-btn-name { font-size: 13px; font-weight: 600; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  min-width: 180px; max-width: calc(100vw - 24px); display: none; z-index: 200;
}
.dropdown-menu.open { display: block; }
.dropdown-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--text); font-size: 13px;
  transition: background var(--transition);
}
.dropdown-menu a:hover { background: var(--border-light); text-decoration: none; }
.dropdown-menu a i { width: 16px; color: var(--text-muted); }
.dropdown-divider { border-top: 1px solid var(--border); margin: 4px 0; }
.dropdown-danger { color: var(--danger) !important; }
.dropdown-danger i { color: var(--danger) !important; }

/* ── Alerts / Flash messages ─────────────────────────────── */
.flash-messages { padding: 0 24px; margin-top: 16px; }
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  margin-bottom: 10px; font-size: 14px; font-weight: 500;
  position: relative;
}
.alert i { font-size: 16px; }
.alert-close {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; opacity: .6;
  font-size: 14px; color: inherit;
}
.alert-success { background: var(--success-light); color: #065f46; border-left: 4px solid var(--success); }
.alert-error, .alert-danger { background: var(--danger-light); color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning { background: var(--warning-light); color: #92400e; border-left: 4px solid var(--warning); }
.alert-info    { background: var(--primary-light);  color: #1e40af; border-left: 4px solid var(--primary); }

/* ── Page header ─────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-title  { font-size: 22px; font-weight: 700; color: var(--text); }
.page-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  min-width: 0;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 {
  font-size: 14px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.card-header h3 i { color: var(--primary); }
.card-body { padding: 20px; }
.card-body.p-0 {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.card-body.p-0 { padding: 0; }
.card-danger-border { border-left: 4px solid var(--danger); }
.card-success-border { border-left: 4px solid var(--success); }

/* ── Stats cards ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; align-items: flex-start; gap: 16px;
  box-shadow: var(--shadow); transition: transform var(--transition), box-shadow var(--transition);
  min-width: 0;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.stat-blue  .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-green .stat-icon { background: var(--success-light); color: var(--success); }
.stat-red   .stat-icon { background: var(--danger-light);  color: var(--danger); }
.stat-teal  .stat-icon { background: rgba(13,148,136,.15); color: var(--teal); }
.stat-purple .stat-icon{ background: rgba(124,58,237,.15); color: var(--purple); }
.stat-orange .stat-icon{ background: rgba(234,88,12,.15);  color: var(--orange); }
.stat-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }
.stat-sub   { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.stats-mini-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.stat-mini {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  border-left: 4px solid transparent;
}
.stat-mini.stat-green { border-left-color: var(--success); }
.stat-mini.stat-blue  { border-left-color: var(--primary); }
.stat-mini.stat-red   { border-left-color: var(--danger); }
.stat-mini.stat-orange { border-left-color: var(--orange); }
.stat-mini-value { font-size: 20px; font-weight: 700; color: var(--text); }
.stat-mini-label { font-size: 12px; color: var(--text-muted); }

/* ── Tables ───────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.card-body.p-0 > .table { min-width: 640px; }
.table th, .table td {
  padding: 11px 16px; text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.table th {
  background: var(--bg); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); white-space: nowrap;
}
.table-hover tbody tr:hover { background: var(--border-light); }
.table td:last-child, .table th:last-child { }
.row-danger td { background: rgba(239,68,68,.04) !important; }
.text-right { text-align: right !important; }
.table-actions { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.py-xl { padding-top: 40px; padding-bottom: 40px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn i { font-size: 12px; }
.btn-primary  { background: var(--primary);  color: #fff; border-color: var(--primary); }
.btn-success  { background: var(--success);  color: #fff; border-color: var(--success); }
.btn-danger   { background: var(--danger);   color: #fff; border-color: var(--danger); }
.btn-warning  { background: var(--warning);  color: #fff; border-color: var(--warning); }
.btn-secondary{ background: var(--secondary);color: #fff; border-color: var(--secondary); }
.btn-outline  { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--border-light); }
.btn-full { width: 100%; justify-content: center; }
.btn-lg   { padding: 11px 22px; font-size: 15px; }
.btn-sm   { padding: 5px 12px; font-size: 12px; }
.btn-xs   { padding: 3px 8px; font-size: 11px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.d-inline { display: inline; }
.ml-sm { margin-left: 6px; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-success  { background: var(--success-light); color: #065f46; }
.badge-danger   { background: var(--danger-light);  color: #991b1b; }
.badge-warning  { background: var(--warning-light); color: #92400e; }
.badge-primary  { background: var(--primary-light); color: #1e40af; }
.badge-secondary{ background: var(--border); color: var(--text-muted); }

/* ── Forms ────────────────────────────────────────────────── */
.form-card { display: flex; flex-direction: column; gap: 0; }
.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }
.form-label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text); margin-bottom: 6px;
}
.required::after { content: ' *'; color: var(--danger); }
.form-control {
  width: 100%; padding: 9px 12px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { display: block; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 20px 0; margin-top: 4px;
}
.input-group {
  display: flex; align-items: stretch; position: relative;
}
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); flex: 1; }
.input-group .form-control:last-child { border-radius: var(--radius-sm); }
.input-addon {
  display: flex; align-items: center; padding: 0 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-left: none; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted); font-size: 13px; cursor: pointer;
}
.toggle-password { background: var(--bg); border: 1px solid var(--border); border-left: none; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 0 12px; cursor: pointer; color: var(--text-muted); }

/* Toggle switch */
.toggle-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; padding-top: 8px; }
.toggle-switch input { display: none; }
.toggle-slider {
  width: 40px; height: 22px; background: var(--border); border-radius: 11px;
  position: relative; transition: background var(--transition); flex-shrink: 0;
}
.toggle-slider::after {
  content: ''; position: absolute; width: 16px; height: 16px;
  background: #fff; border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--success); }
.toggle-switch input:checked + .toggle-slider::after { transform: translateX(18px); }
.toggle-label { font-size: 13px; color: var(--text-muted); }

/* Checkbox */
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.form-remember  { justify-content: space-between; align-items: center; }

/* ── Upload zone ──────────────────────────────────────────── */
.upload-zone {
  position: relative; border: 2px dashed var(--border);
  border-radius: var(--radius); padding: 30px;
  text-align: center; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-content i { font-size: 36px; color: var(--text-light); display: block; margin-bottom: 8px; }
.upload-content p { color: var(--text-muted); font-size: 13px; }
.upload-link { color: var(--primary); font-weight: 600; }
.photo-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.photo-preview img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); border: 2px solid var(--border); }
.existing-photos { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.existing-photo img { width: 100px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); }

/* ── Filter bar ───────────────────────────────────────────── */
.filter-card { padding: 0; margin-bottom: 16px; }
.filter-form { display: flex; align-items: center; gap: 10px; padding: 14px 16px; flex-wrap: wrap; }
.filter-group { flex-shrink: 0; }
.filter-group .form-control { margin: 0; }
.filter-grow { flex: 1; min-width: 200px; }

/* Tab filters */
.tab-filters { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid var(--border); }
.tab-filter {
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); text-decoration: none; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all var(--transition);
}
.tab-filter:hover  { color: var(--primary); text-decoration: none; }
.tab-filter.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--primary-light); }

/* ── Property cards ───────────────────────────────────────── */
.properties-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px; margin-bottom: 20px;
}
.property-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.property-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.property-img { position: relative; height: 200px; overflow: hidden; background: var(--bg); }
.property-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.property-card:hover .property-img img { transform: scale(1.04); }
.property-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; color: var(--text-light);
}
.property-status-badge { position: absolute; top: 10px; left: 10px; }
.property-type-badge {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,.55); color: #fff;
  padding: 3px 8px; border-radius: 20px; font-size: 11px;
}
.property-body { padding: 16px; }
.property-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.property-title a { color: var(--text); }
.property-title a:hover { color: var(--primary); }
.property-address { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; display: flex; align-items: center; gap: 5px; }
.property-meta { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.property-meta span { display: flex; align-items: center; gap: 4px; }
.property-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; border-top: 1px solid var(--border-light);
  gap: 12px; flex-wrap: wrap;
}
.price-main   { font-size: 18px; font-weight: 700; color: var(--primary); }
.price-period { font-size: 12px; color: var(--text-muted); }
.property-actions { display: flex; gap: 5px; }

/* ── Detail layout ────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.detail-main { min-width: 0; }
.detail-side { display: flex; flex-direction: column; gap: 16px; }

.info-card .card-body { padding: 16px; }
.info-row  { display: flex; justify-content: space-between; align-items: flex-start; padding: 7px 0; gap: 12px; }
.info-label { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.info-highlight { padding: 10px 0; }
.info-divider { border-top: 1px solid var(--border-light); margin: 8px 0; }

.property-photos { }
.photo-main { height: 240px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.photo-main img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumbs { display: flex; gap: 6px; padding: 8px; background: var(--bg); flex-wrap: wrap; }
.photo-thumb { width: 60px; height: 46px; object-fit: cover; border-radius: 4px; cursor: pointer; opacity: .7; border: 2px solid transparent; }
.photo-thumb.active, .photo-thumb:hover { opacity: 1; border-color: var(--primary); }

.tenant-mini { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.user-info-cell { display: flex; align-items: center; gap: 10px; }

/* ── Avatar ───────────────────────────────────────────────── */
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-avatar-sm {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.user-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; margin: 0 auto;
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-current { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.avatar-placeholder {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ── Charts ───────────────────────────────────────────────── */
.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 20px; }
.chart-card .card-body { padding: 16px; }
.chart-donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.chart-donut-wrap canvas { max-width: 180px; max-height: 180px; }
.chart-legend { flex: 1; }

/* ── Dashboard grids ─────────────────────────────────────── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

/* ── Progress ─────────────────────────────────────────────── */
.progress-bar-sm {
  height: 6px; background: var(--border);
  border-radius: 3px; overflow: hidden; margin-top: 4px;
}
.progress-fill {
  height: 100%; background: var(--primary); border-radius: 3px;
  transition: width .5s ease;
}
.bg-success { background: var(--success) !important; }
.bg-warning { background: var(--warning) !important; }
.bg-danger  { background: var(--danger)  !important; }

/* ── Invoice specific ─────────────────────────────────────── */
.invoice-container {}
.invoice-doc {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px; margin-bottom: 20px;
  position: relative; overflow: hidden; box-shadow: var(--shadow-md);
}
.invoice-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; }
.invoice-brand { display: flex; align-items: center; gap: 14px; }
.invoice-logo { width: 48px; height: 48px; background: var(--primary); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; }
.invoice-brand h2 { font-size: 20px; color: var(--primary); }
.invoice-meta h1 { font-size: 28px; color: var(--primary); letter-spacing: 2px; margin-bottom: 8px; }
.invoice-meta-table td { padding: 3px 10px 3px 0; font-size: 13px; }
.invoice-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.invoice-party { background: var(--bg); border-radius: var(--radius-sm); padding: 16px; }
.invoice-party h4 { font-size: 10px; text-transform: uppercase; color: var(--primary); letter-spacing: .08em; margin-bottom: 8px; }
.invoice-property { background: var(--primary-light); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 20px; font-size: 13px; }
.invoice-lines { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.invoice-lines thead tr { background: var(--primary); color: #fff; }
.invoice-lines th, .invoice-lines td { padding: 12px 16px; }
.invoice-lines tfoot { background: var(--bg); font-weight: 700; }
.invoice-total { font-size: 18px; color: var(--primary); }
.invoice-paid-stamp {
  position: absolute; top: 80px; right: 40px;
  border: 5px solid var(--success); color: var(--success);
  font-size: 52px; font-weight: 900;
  transform: rotate(-20deg); opacity: .25;
  padding: 8px 20px; border-radius: 8px;
}
.invoice-preview-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
.invoice-preview-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 16px; }
.invoice-preview-details { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--text-muted); }
.invoice-preview-details span { display: flex; align-items: center; gap: 6px; }
.invoice-notes { background: var(--bg); padding: 14px; border-radius: var(--radius-sm); margin-top: 16px; font-size: 13px; }

/* ── Expense category cards ───────────────────────────────── */
.expenses-categories { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.expense-cat-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px; min-width: 180px;
}
.expense-cat-icon { font-size: 20px; color: var(--primary); }
.expense-cat-label { font-size: 12px; color: var(--text-muted); }
.expense-cat-value { font-size: 16px; font-weight: 700; }
.expense-cat-count { font-size: 11px; color: var(--text-light); }

/* ── Modal ────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; padding: 20px;
}
.modal-dialog {
  background: var(--bg-card); border-radius: var(--radius);
  width: 100%; max-width: 480px; box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted); padding: 4px; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); }

/* ── Auth layout ──────────────────────────────────────────── */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e293b 0%, #2563EB 100%); padding: 20px; position: relative; overflow: hidden; }
.auth-container { width: 100%; max-width: 460px; position: relative; z-index: 1; }
.auth-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow-lg); }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-icon { width: 60px; height: 60px; background: var(--primary); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 26px; color: #fff; margin: 0 auto 12px; }
.auth-logo h1 { font-size: 22px; font-weight: 700; }
.auth-logo p { color: var(--text-muted); font-size: 13px; }
.auth-form h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.auth-subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.auth-footer-text { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 16px; }

.auth-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.auth-bg-shape { position: absolute; border-radius: 50%; background: rgba(255,255,255,.05); }
.shape-1 { width: 400px; height: 400px; top: -100px; right: -100px; }
.shape-2 { width: 300px; height: 300px; bottom: -80px; left: -60px; }
.shape-3 { width: 200px; height: 200px; top: 50%; right: 30%; }

/* ── Utility classes ──────────────────────────────────────── */
.text-primary  { color: var(--primary)   !important; }
.text-success  { color: var(--success)   !important; }
.text-danger   { color: var(--danger)    !important; }
.text-warning  { color: var(--warning)   !important; }
.text-muted    { color: var(--text-muted)!important; }
.text-light    { color: var(--text-light)!important; }
.text-center   { text-align: center !important; }
.text-right    { text-align: right  !important; }
.text-sm       { font-size: 12px !important; }
.font-medium   { font-weight: 500 !important; }
.font-bold     { font-weight: 700 !important; }
.mt-sm  { margin-top: 8px  !important; }
.mt-md  { margin-top: 16px !important; }
.mb-md  { margin-bottom: 16px !important; }
.required { }
.required::after { content: ' *'; color: var(--danger); }

.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state i { font-size: 52px; color: var(--text-light); display: block; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; color: var(--text); margin-bottom: 8px; }
.empty-state-inline {
  text-align: center; padding: 32px; color: var(--text-muted);
}
.empty-state-inline i { font-size: 36px; color: var(--text-light); display: block; margin-bottom: 8px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .charts-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { flex-direction: row; flex-wrap: wrap; }
  .detail-side .card { flex: 1; min-width: 240px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .overlay.show { display: block; }
  .sidebar-close { display: block; }
  .main-wrapper { margin-left: 0; }
  .menu-toggle { display: flex; }
  .header { padding: 0 16px; }
  .content { padding: 16px; }
  .form-row-2 { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .invoice-parties { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .page-header .btn-group { width: 100%; }
  .page-header .btn-group > * { flex: 1 1 100%; }
  .user-btn-name { display: none; }
  .filter-grow { min-width: 0; width: 100%; }
  .filter-form { flex-direction: column; align-items: stretch; }
  .filter-form .btn { justify-content: center; }
  .properties-grid { grid-template-columns: 1fr; }
  .property-meta { flex-wrap: wrap; }
  .invoice-doc { padding: 20px; }
  .invoice-header { flex-direction: column; gap: 20px; margin-bottom: 24px; }
  .invoice-meta { width: 100%; }
  .invoice-lines { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .invoice-lines th, .invoice-lines td { white-space: nowrap; }
  .invoice-paid-stamp {
    position: static; transform: rotate(-8deg); display: inline-block;
    margin-top: 8px; font-size: 34px;
  }
}
@media (max-width: 480px) {
  .header { height: auto; min-height: var(--header-h); padding-top: 10px; padding-bottom: 10px; }
  .header-right { gap: 6px; }
  .notif-panel {
    position: fixed; top: calc(var(--header-h) + 8px);
    left: 8px; right: 8px; width: auto; max-width: none;
  }
  .dropdown-menu { right: 0; max-width: min(220px, calc(100vw - 16px)); }
  .stats-grid { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .stats-mini-grid { grid-template-columns: 1fr; }

  .auth-card { padding: 24px 20px; }
}
@media print {
  .sidebar, .header, .footer, .btn, .filter-card, .tab-filters, .no-print { display: none !important; }
  .main-wrapper { margin-left: 0; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
