/* ── VARIABLES ───────────────────────────────────────── */
:root {
  --orange:        #FF6A00;
  --orange-dark:   #D95800;
  --orange-light:  #FFF0E6;
  --orange-mid:    #FFE0C2;
  --sidebar-bg:    #111318;
  --sidebar-w:     232px;
  --bg:            #F4F2EF;
  --surface:       #FFFFFF;
  --border:        #E8E5E1;
  --border-light:  #F0EDE9;
  --text:          #141414;
  --text-2:        #555;
  --text-3:        #999;
  --danger:        #DC2626;
  --success:       #16A34A;
  --info:          #2563EB;
  --warn:          #D97706;
  --radius:        12px;
  --radius-lg:     16px;
  --radius-sm:     8px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:        0 2px 8px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.05);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
}

/* ── RESET ───────────────────────────────────────────── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-size:15px;-webkit-text-size-adjust:100%}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',sans-serif;background:var(--bg);color:var(--text);line-height:1.5;-webkit-font-smoothing:antialiased}
a{text-decoration:none;color:inherit}
button{cursor:pointer;border:none;background:none;font:inherit;color:inherit}
input,textarea,select{font:inherit;color:inherit}
img{max-width:100%;display:block}
textarea{resize:vertical}

/* ── LOGIN ───────────────────────────────────────────── */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0e0f12 0%, #1a1d25 100%);
  padding: 24px;
}
.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
}
.login-brand { text-align: center; margin-bottom: 36px; }
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.login-logo .crm-logo-icon { height: 28px; width: auto; color: var(--orange); margin-right: 9px; flex-shrink: 0; }
.login-logo .ll-bena { font-size: 28px; font-weight: 200; text-transform: uppercase; letter-spacing: .04em; line-height: 1; color: var(--sidebar-bg); }
.login-logo .ll-key  { font-size: 28px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; line-height: 1; color: var(--orange); }
.login-tagline { font-size: 13px; color: var(--text-3); margin-top: 6px; letter-spacing: .5px; text-transform: uppercase; }
.login-error {
  background: #FEF2F2;
  color: var(--danger);
  border: 1px solid #FECACA;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: none;
}
.login-error:not(:empty) { display: block; }
.login-field { margin-bottom: 14px; }
.login-field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.login-field input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
  background: var(--bg);
}
.login-field input:focus { outline: none; border-color: var(--orange); background: #fff; box-shadow: 0 0 0 3px rgba(255,106,0,.1); }
.login-btn {
  width: 100%;
  background: var(--orange);
  color: #fff;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  margin-top: 8px;
  transition: background .15s, transform .1s;
  letter-spacing: .2px;
}
.login-btn:hover { background: var(--orange-dark); }
.login-btn:active { transform: scale(.99); }
.login-hint { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 18px; }

/* ── APP LAYOUT ──────────────────────────────────────── */
#app { display: none; flex-direction: row; height: 100vh; overflow: hidden; }

/* ── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0;
}
.brand-logo .crm-logo-icon { height: 22px; width: auto; color: var(--orange); margin-right: 8px; flex-shrink: 0; }
.brand-logo .bl-bena { font-size: 21px; font-weight: 200; text-transform: uppercase; letter-spacing: .04em; line-height: 1; color: rgba(255,255,255,0.84); }
.brand-logo .bl-key  { font-size: 21px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; line-height: 1; color: var(--orange); }
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.55);
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.85); }
.nav-item.active { background: var(--orange); color: #fff; font-weight: 600; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .7; transition: opacity .15s; }
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.agent-card { display: flex; align-items: center; gap: 10px; }
.agent-avatar {
  width: 36px; height: 36px;
  background: var(--orange);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.agent-info { flex: 1; min-width: 0; }
.agent-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-role { font-size: 11px; color: rgba(255,255,255,.45); text-transform: capitalize; }
.btn-logout { color: rgba(255,255,255,.35); padding: 4px; border-radius: 6px; transition: color .15s, background .15s; }
.btn-logout:hover { color: rgba(255,255,255,.8); background: rgba(255,255,255,.08); }

/* ── MAIN AREA ───────────────────────────────────────── */
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ── TOP BAR ─────────────────────────────────────────── */
.top-bar {
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  flex-shrink: 0;
}
.search-wrap { position: relative; flex: 1; max-width: 400px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  background: var(--bg);
  transition: border-color .15s, background .15s;
}
.search-input:focus { outline: none; border-color: var(--orange); background: #fff; }
#search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  max-height: 380px;
  overflow-y: auto;
}
.search-section { padding: 6px 0; }
.search-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-3);
  padding: 6px 16px 3px;
}
.search-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; cursor: pointer;
  transition: background .1s;
}
.search-item:hover { background: var(--bg); }
.search-item-icon { font-size: 18px; width: 28px; text-align: center; }
.search-item-body { flex: 1; min-width: 0; }
.search-item-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item-sub { font-size: 12px; color: var(--text-3); }
/* ── TOPBAR USER MENU ────────────────────────────────── */
.topbar-user { position: relative; flex-shrink: 0; }
.topbar-avatar {
  width: 36px; height: 36px;
  background: var(--orange); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  cursor: pointer;
  transition: box-shadow .15s;
  user-select: none;
}
.topbar-avatar:hover { box-shadow: 0 0 0 3px var(--orange-mid); }
.topbar-menu {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  min-width: 200px;
  z-index: 400;
  display: none;
}
.topbar-menu.open { display: block; }
.topbar-menu-name { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.topbar-menu-role { font-size: 12px; color: var(--text-3); text-transform: capitalize; margin-bottom: 14px; }
.topbar-logout {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 14px;
  background: #FEE2E2; color: var(--danger);
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  transition: background .15s;
}
.topbar-logout:hover { background: #FECACA; }

.btn-add {
  display: flex; align-items: center; gap: 6px;
  background: var(--orange);
  color: #fff;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  white-space: nowrap;
  transition: background .15s;
}
.btn-add:hover { background: var(--orange-dark); }
.btn-add span { font-size: 18px; line-height: 1; margin-top: -2px; }

/* ── PAGE CONTENT ────────────────────────────────────── */
.page-content { flex: 1; overflow-y: auto; padding: 24px; }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--orange); color: #fff;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  transition: background .15s;
}
.btn-primary:hover { background: var(--orange-dark); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); color: var(--text);
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  border: 1.5px solid var(--border);
  transition: background .15s, border-color .15s;
}
.btn-secondary:hover { background: var(--bg); border-color: #d0ccc7; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon {
  background: var(--bg); padding: 7px 10px;
  border-radius: var(--radius-sm); font-size: 14px;
  border: 1.5px solid var(--border);
  transition: background .12s;
}
.btn-icon:hover { background: #eae7e3; }
.btn-icon-del { color: var(--danger); border-color: transparent; }
.btn-icon-del:hover { background: #ffeaea; border-color: var(--danger); }

.card-del-btn {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.5); color: #fff;
  border: none; border-radius: 50%;
  width: 28px; height: 28px; font-size: 13px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.card-del-btn:hover { background: rgba(220,38,38,.9); }

/* ── CARD ────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
}
.card-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .7px;
  color: var(--text-3); margin-bottom: 16px;
}

/* ── LAYOUT HELPERS ──────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.info-item { }
.info-item.full { grid-column: 1/-1; }
.info-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-3); margin-bottom: 4px; }
.info-value { font-size: 14px; font-weight: 500; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; gap: 16px; }
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.page-subtitle { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ── DETAIL HEADER ───────────────────────────────────── */
.detail-header {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
}
.detail-ref { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); margin-bottom: 6px; }
.detail-title { font-size: 26px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 6px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  background: var(--bg); color: var(--text);
  border: 1.5px solid var(--border);
  transition: background .15s;
}
.action-btn:hover { background: #eae7e3; }
.action-btn.primary { background: var(--orange); color: #fff; border: none; }
.action-btn.primary:hover { background: var(--orange-dark); }
.action-btn.whatsapp { background: #25D366; color: #fff; border: none; }
.action-btn.whatsapp:hover { background: #1aab52; }
.action-btn.danger { color: var(--danger); border-color: var(--danger); }
.action-btn.danger:hover { background: var(--danger); color: #fff; }

/* ── BADGES ──────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-green  { background: #DCFCE7; color: #15803D; }
.badge-red    { background: #FEE2E2; color: #B91C1C; }
.badge-orange { background: #FFEDD5; color: #C2410C; }
.badge-yellow { background: #FEF9C3; color: #854D0E; }
.badge-blue   { background: #DBEAFE; color: #1D4ED8; }
.badge-gray   { background: #F3F4F6; color: #374151; }

/* ── TABLE ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead { background: var(--bg); }
th { padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-3); white-space: nowrap; border-bottom: 1px solid var(--border); }
td { padding: 13px 16px; border-top: 1px solid var(--border-light); vertical-align: middle; }
tr:hover td { background: #FAFAF9; }

/* ── FILTERS ─────────────────────────────────────────── */
.filters { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-search, .filter-select {
  padding: 9px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; background: var(--surface);
  transition: border-color .15s;
}
.filter-search { flex: 1; min-width: 200px; }
.filter-search:focus, .filter-select:focus { outline: none; border-color: var(--orange); }

/* ── BIEN CARDS ──────────────────────────────────────── */
.biens-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.bien-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
}
.bien-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.bien-card-img {
  height: 110px;
  background: linear-gradient(135deg, var(--orange-light), var(--orange-mid));
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; position: relative;
}
.bien-card-badge { position: absolute; top: 10px; right: 10px; }
.bien-card-body { padding: 16px 18px; }
.bien-ref { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); margin-bottom: 4px; }
.bien-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.bien-price { font-size: 18px; font-weight: 800; color: var(--orange); margin-bottom: 10px; }
.bien-details { display: flex; flex-wrap: wrap; gap: 6px; }
.bien-detail { font-size: 12px; background: var(--bg); padding: 3px 9px; border-radius: 20px; color: var(--text-2); font-weight: 500; }

/* ── PHOTOS ──────────────────────────────────────────── */
.photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.photo-thumb { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 4/3; background: var(--bg); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: transform .2s; }
.photo-thumb:hover img { transform: scale(1.05); }
.photo-cat { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; font-size: 11px; font-weight: 600; padding: 20px 8px 6px; }
.photo-del {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(220,38,38,.85); color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s; cursor: pointer;
}
.photo-thumb:hover .photo-del { opacity: 1; }
.photo-note { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 4px; max-width: 85%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── PHOTO CAPTURE BTNS ──────────────────────────────── */
.photo-capture-btn, .photo-gallery-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 18px;
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  font-size: 14px; font-weight: 600; color: var(--orange);
  cursor: pointer; transition: background .15s, border-color .15s;
  margin-bottom: 10px;
}
.photo-capture-btn:hover, .photo-gallery-btn:hover { background: var(--orange-light); border-color: var(--orange); }

/* ── MON JOUR ────────────────────────────────────────── */
.monjour-header {
  background: linear-gradient(135deg, #FF6A00 0%, #D95800 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.monjour-header::after {
  content: '';
  position: absolute; top: -30px; right: -30px;
  width: 180px; height: 180px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}
.monjour-greeting { font-size: 23px; font-weight: 800; letter-spacing: -.3px; margin-bottom: 3px; }
.monjour-date { font-size: 14px; opacity: .8; margin-bottom: 18px; text-transform: capitalize; }
.monjour-pills { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  background: rgba(0,0,0,.18); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.2);
}

.kpi-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 22px;
}
.kpi-card {
  background: var(--surface); border-radius: var(--radius); padding: 16px 12px;
  border: 1px solid var(--border-light); box-shadow: var(--shadow-sm);
  text-align: center; cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.kpi-card:hover { box-shadow: var(--shadow-md); border-color: var(--orange-mid); }
.kpi-num { font-size: 28px; font-weight: 900; color: var(--orange); line-height: 1; }
.kpi-label { font-size: 12px; color: var(--text-3); font-weight: 600; margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }

.actions-rapides { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.action-rap {
  flex: 1; min-width: 70px;
  padding: 11px 8px; border-radius: var(--radius);
  border: 1.5px solid var(--border);
  font-size: 13px; font-weight: 600;
  background: var(--surface); text-align: center;
  transition: all .15s;
}
.action-rap:hover { background: var(--orange-light); border-color: var(--orange); color: var(--orange); }

.monjour-section { margin-bottom: 28px; }
.section-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-3); margin-bottom: 10px; padding-left: 2px;
  display: flex; align-items: center; gap: 8px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── TASK CARD ───────────────────────────────────────── */
.task-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
  border: 1px solid var(--border-light);
  transition: box-shadow .15s;
}
.task-card:hover { box-shadow: var(--shadow); }
.task-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 8px; }
.task-type-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--orange); }
.task-due { font-size: 12px; color: var(--text-3); font-weight: 500; text-align: right; white-space: nowrap; }
.task-retard { color: var(--danger) !important; font-weight: 700; }
.task-client {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.task-client-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; letter-spacing: -.2px; }
.task-client-tel { font-size: 14px; color: var(--info); margin-bottom: 8px; font-weight: 500; }
.task-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.tag { background: var(--surface); border: 1px solid var(--border); padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.task-note { font-size: 13px; color: var(--text-2); margin-top: 6px; }
.task-meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.task-bien { font-size: 13px; color: var(--text-2); background: #EFF6FF; border-left: 3px solid var(--info); padding: 8px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-bottom: 10px; }
.task-comment { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.task-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.tbtn { display: inline-flex; align-items: center; gap: 5px; padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; transition: all .15s; white-space: nowrap; }
.tbtn-call  { background: #EFF6FF; color: var(--info); }
.tbtn-call:hover  { background: #DBEAFE; }
.tbtn-wa    { background: #F0FDF4; color: #16A34A; }
.tbtn-wa:hover    { background: #DCFCE7; }
.tbtn-view  { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.tbtn-view:hover  { background: #eae7e3; }
.tbtn-done  { background: var(--orange); color: #fff; }
.tbtn-done:hover  { background: var(--orange-dark); }

/* ── VISITE CARD (opérationnel) ──────────────────────── */
.visite-op-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
}
.visite-op-header { margin-bottom: 14px; }
.visite-op-time { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.today-badge { background: var(--orange); color: #fff; font-size: 10px; font-weight: 800; padding: 3px 9px; border-radius: 6px; letter-spacing: .5px; }
.visite-heure { font-size: 17px; font-weight: 800; color: var(--orange); letter-spacing: -.3px; }
.visite-op-ref { font-size: 16px; font-weight: 700; letter-spacing: -.2px; margin-bottom: 2px; }
.visite-op-prix { font-size: 15px; font-weight: 700; color: var(--orange); }

/* ── CONTACT BLOCKS ──────────────────────────────────── */
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.contact-blk { border-radius: var(--radius); padding: 14px 16px; }
.contact-client  { background: #EFF6FF; border: 1px solid #BFDBFE; }
.contact-prop    { background: #F0FDF4; border: 1px solid #BBF7D0; }
.contact-gardien { background: #FEFCE8; border: 1px solid #FDE68A; }
.contact-lbl { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); margin-bottom: 8px; }
.contact-nom { font-size: 15px; font-weight: 700; margin-bottom: 2px; letter-spacing: -.1px; }
.contact-tel { font-size: 13px; color: var(--info); font-weight: 500; margin-bottom: 5px; }
.contact-info { font-size: 12px; color: var(--text-2); margin-bottom: 2px; }
.contact-btns-row { display: flex; gap: 8px; margin-top: 12px; }
.cbtn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; transition: all .15s; }
.cbtn-call { background: #DBEAFE; color: var(--info); }
.cbtn-call:hover { background: #BFDBFE; }
.cbtn-wa   { background: #25D366; color: #fff; }
.cbtn-wa:hover { background: #1aab52; }

/* ── MAP / ADRESSE ───────────────────────────────────── */
.visite-adresse {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 13px; margin-bottom: 12px; gap: 10px;
  border: 1px solid var(--border);
}
.map-btn { background: var(--orange); color: #fff; padding: 7px 13px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; white-space: nowrap; transition: background .15s; }
.map-btn:hover { background: var(--orange-dark); }

/* ── CONTACT LOG ─────────────────────────────────────── */
.contacts-log { background: var(--bg); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 12px; border: 1px solid var(--border); }
.log-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-3); margin-bottom: 10px; }
.log-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; padding: 6px 0; border-top: 1px solid var(--border-light); }
.log-row:first-of-type { border-top: none; }
.log-type { font-weight: 700; }
.log-nom { color: var(--text-2); }
.log-time { font-size: 12px; color: var(--text-3); margin-left: auto; }
.log-note { font-size: 12px; color: var(--text-2); width: 100%; padding-left: 4px; font-style: italic; }

/* ── VISITE OP ACTIONS ───────────────────────────────── */
.visite-op-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-light); }
.vbtn { padding: 9px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; background: var(--bg); border: 1.5px solid var(--border); transition: all .15s; }
.vbtn:hover { background: #eae7e3; }
.vbtn-log { background: #EFF6FF; color: var(--info); border: none; }
.vbtn-log:hover { background: #DBEAFE; }
.vbtn-cr { background: var(--orange); color: #fff; border: none; }
.vbtn-cr:hover { background: var(--orange-dark); }

/* ── TIMELINE ────────────────────────────────────────── */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 1px; }
.timeline-item { position: relative; margin-bottom: 14px; }
.timeline-dot { position: absolute; left: -19px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); border: 2px solid var(--surface); box-shadow: 0 0 0 2px var(--border); }
.timeline-content { background: var(--bg); border-radius: var(--radius-sm); padding: 10px 14px; border: 1px solid var(--border); }
.timeline-type { font-size: 11px; font-weight: 700; color: var(--orange); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 3px; }
.timeline-desc { font-size: 14px; margin-bottom: 4px; }
.timeline-time { font-size: 11px; color: var(--text-3); }

/* ── VISITE CARD (liste) ─────────────────────────────── */
.visite-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 16px 20px; box-shadow: var(--shadow-sm);
  margin-bottom: 10px; display: flex; gap: 18px; align-items: flex-start;
  border: 1px solid var(--border-light); transition: box-shadow .15s;
}
.visite-card:hover { box-shadow: var(--shadow); }
.visite-date { text-align: center; min-width: 50px; padding: 6px 0; }
.visite-day { font-size: 26px; font-weight: 900; line-height: 1; color: var(--orange); letter-spacing: -.5px; }
.visite-month { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-3); margin-top: 2px; }
.visite-body { flex: 1; }
.visite-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; letter-spacing: -.2px; }
.visite-meta { font-size: 13px; color: var(--text-2); }

/* ── TYPE VISITE SELECTOR ────────────────────────────── */
.type-visite-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 20px;
}
.type-visite-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 2px solid var(--border-light); border-radius: var(--radius-lg);
  padding: 14px 8px; cursor: pointer; transition: all .15s; user-select: none;
  background: var(--surface-2);
}
.type-visite-card input[type=radio] { display: none; }
.type-visite-card:hover { border-color: var(--orange); }
.type-visite-card.selected { border-color: var(--orange); background: rgba(255,106,0,.06); }
.type-visite-icon { font-size: 22px; line-height: 1; }
.type-visite-label { font-size: 13px; font-weight: 700; color: var(--text-1); }
.type-visite-sub { font-size: 10px; color: var(--text-3); text-align: center; }
@media(max-width:600px) { .type-visite-grid { grid-template-columns: repeat(2,1fr); } }

/* ── PIPELINE ────────────────────────────────────────── */
.pipeline-wrap { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; }
.pipeline-col { min-width: 210px; flex-shrink: 0; display: flex; flex-direction: column; }
.pipeline-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-radius: var(--radius) var(--radius) 0 0;
  font-size: 12px; font-weight: 700; color: #fff;
}
.pipeline-count { background: rgba(0,0,0,.2); border-radius: 10px; padding: 2px 8px; font-size: 12px; }
.pipeline-body {
  background: var(--surface); border-radius: 0 0 var(--radius) var(--radius);
  border: 1px solid var(--border); border-top: none;
  min-height: 100px; padding: 8px; flex: 1;
}
.pipeline-item {
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 10px 12px; margin-bottom: 6px;
  cursor: pointer; transition: box-shadow .15s;
  border: 1px solid var(--border);
}
.pipeline-item:hover { box-shadow: var(--shadow); background: var(--surface); }
.pipeline-item-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.pipeline-item-budget { font-size: 13px; color: var(--orange); font-weight: 700; }

/* ── TÂCHES ──────────────────────────────────────────── */
.tache-item {
  background: var(--surface); border-radius: var(--radius);
  padding: 14px 18px; box-shadow: var(--shadow-sm);
  margin-bottom: 8px; display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--border-light);
}
.tache-check { width: 18px; height: 18px; cursor: pointer; accent-color: var(--orange); flex-shrink: 0; }
.tache-body { flex: 1; }
.tache-title { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.tache-meta { font-size: 13px; color: var(--text-2); }
.agent-badge { display: inline-block; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; margin-left: 4px; }
.tache-priority { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.priority-haute   { background: #FEE2E2; color: var(--danger); }
.priority-normale { background: #FFEDD5; color: #C2410C; }
.priority-basse   { background: #F3F4F6; color: var(--text-2); }

/* ── FORMS ───────────────────────────────────────────── */
.form-section {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-3);
  padding-top: 18px; margin-bottom: 12px;
  border-top: 1px solid var(--border);
}
.form-section:first-child { border-top: none; padding-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.form-group { display: flex; flex-direction: column; }
.form-group.full { grid-column: 1/-1; }
.form-label { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-2); }
.form-input, .form-select, .form-textarea {
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; background: var(--bg); width: 100%;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--orange);
  background: #fff; box-shadow: 0 0 0 3px rgba(255,106,0,.08);
}
.form-textarea { min-height: 80px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin-bottom: 4px; }
.checkbox-item { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; padding: 7px 10px; border-radius: var(--radius-sm); transition: background .1s; }
.checkbox-item:hover { background: var(--bg); }
.checkbox-item input[type=checkbox] { accent-color: var(--orange); width: 16px; height: 16px; flex-shrink: 0; }

/* ── MODAL ───────────────────────────────────────────── */
#modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: none; align-items: flex-start; justify-content: center;
  padding: 32px 20px;
  overflow-y: auto;
  backdrop-filter: blur(2px);
}
#modal-overlay.open { display: flex; }
#modal-box {
  background: var(--surface);
  border-radius: 18px;
  width: 100%; max-width: 700px;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 64px);
  box-shadow: var(--shadow-lg);
  margin: auto;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
#modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#modal-title { font-size: 18px; font-weight: 800; letter-spacing: -.2px; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
#modal-body { padding: 22px 26px; overflow-y: auto; flex: 1; }
#modal-footer {
  padding: 16px 26px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  flex-shrink: 0;
}

/* ── TOAST ───────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 28px; right: 28px;
  background: var(--sidebar-bg); color: #fff;
  padding: 13px 22px; border-radius: 12px;
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  opacity: 0; transform: translateY(8px);
  transition: all .22s; pointer-events: none;
}
#toast.show { opacity: 1; transform: none; }
#toast.error   { background: var(--danger); }
#toast.success { background: var(--success); }

/* ── EMPTY STATE ─────────────────────────────────────── */
.empty-state { text-align: center; padding: 64px 24px; }
.empty-state .emoji { font-size: 48px; margin-bottom: 16px; line-height: 1; }
.empty-state h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty-state p { color: var(--text-3); font-size: 14px; }

/* ── CONCIERGERIE ────────────────────────────────────── */
.conc-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.conc-stat {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.conc-stat-val { font-size: 22px; font-weight: 800; color: var(--orange); letter-spacing: -.5px; }
.conc-stat-lbl { font-size: 12px; color: var(--text-3); margin-top: 2px; font-weight: 500; }

.filter-pill {
  padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
  background: var(--surface); border: 1.5px solid var(--border);
  color: var(--text-2); transition: all .15s; cursor: pointer;
}
.filter-pill:hover { border-color: var(--orange); color: var(--orange); }
.filter-pill.active { background: var(--orange); color: #fff; border-color: var(--orange); }

.conc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.conc-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  display: flex; flex-direction: column; gap: 12px;
}
.conc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.conc-card-top { display: flex; align-items: center; justify-content: space-between; position: relative; }
.conc-card-ref { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); }
.conc-card-title { font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.conc-card-addr { font-size: 13px; color: var(--text-2); }
.conc-card-metrics { display: flex; gap: 12px; flex-wrap: wrap; }
.conc-metric { display: flex; flex-direction: column; align-items: center; background: var(--bg); border-radius: var(--radius-sm); padding: 10px 14px; min-width: 72px; }
.conc-metric-val { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -.3px; }
.conc-metric-lbl { font-size: 10px; color: var(--text-3); text-align: center; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }
.conc-metric-green .conc-metric-val { color: var(--success); }
.conc-platefos { display: flex; gap: 6px; flex-wrap: wrap; }
.platef-tag { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; background: #F0FDF4; color: #15803D; border: 1px solid #BBF7D0; }
.conc-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--border-light); font-size: 13px; }
.conc-prop { font-weight: 500; flex: 1; overflow: hidden; }

.conc-metrics-big { display: flex; gap: 10px; flex-wrap: wrap; }
.conc-big-metric { background: var(--bg); border-radius: var(--radius-sm); padding: 14px 16px; flex: 1; min-width: 110px; border: 1px solid var(--border); }
.conc-big-val { font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
.conc-big-lbl { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-top: 4px; }
.conc-big-green .conc-big-val { color: var(--success); }
.conc-big-orange .conc-big-val { color: var(--orange); }

/* ── CALCULATEUR ─────────────────────────────────────── */
.btn-calc {
  font-size: 20px; padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg); border: 1.5px solid var(--border);
  transition: background .15s;
}
.btn-calc:hover { background: var(--orange-light); border-color: var(--orange); }

.calc-tabs { display: flex; gap: 4px; margin-bottom: 20px; background: var(--bg); border-radius: var(--radius-sm); padding: 4px; }
.calc-tab { flex: 1; padding: 9px 12px; border-radius: 6px; font-size: 14px; font-weight: 600; color: var(--text-2); transition: all .15s; }
.calc-tab.active { background: #fff; color: var(--orange); box-shadow: var(--shadow-sm); }
.calc-tab:hover:not(.active) { color: var(--text); }
.calc-panel { }
.calc-row { margin-bottom: 14px; }
.calc-presets { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.preset-btn { padding: 6px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; background: var(--bg); border: 1.5px solid var(--border); color: var(--text-2); transition: all .15s; }
.preset-btn:hover { background: var(--orange-light); border-color: var(--orange); color: var(--orange); }
.calc-presets .form-input { width: 90px; flex-shrink: 0; }
.calc-result { background: var(--bg); border-radius: var(--radius); padding: 16px 18px; margin-top: 16px; border: 1px solid var(--border); }
.calc-line { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border-light); font-size: 14px; }
.calc-line:last-child { border-bottom: none; }
.calc-line.highlight { background: var(--orange-light); margin: 6px -18px; padding: 10px 18px; border-bottom: none; border-radius: 0; }
.calc-line.highlight strong { color: var(--orange); font-size: 17px; }
.calc-line.muted { color: var(--text-3); font-size: 13px; }
.calc-sep { height: 1px; background: var(--border); margin: 8px 0; }
.calc-empty { text-align: center; color: var(--text-3); font-size: 14px; padding: 20px 0; }

/* ── BIEN FORM — PHOTO ZONE ──────────────────────────── */
.photo-add-zone {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px;
}
.photo-add-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 2px solid var(--border); background: var(--bg);
  transition: border-color .15s, background .15s, color .15s;
  white-space: nowrap;
}
.photo-add-camera { color: var(--orange); border-color: var(--orange-mid); }
.photo-add-camera:hover { background: var(--orange-light); border-color: var(--orange); }
.photo-add-gallery { color: var(--info); border-color: #BFDBFE; background: #EFF6FF; }
.photo-add-gallery:hover { background: #DBEAFE; border-color: var(--info); }
.photos-preview-strip {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px;
}
.photo-preview-wrap {
  position: relative; display: inline-block;
}
.photo-preview-wrap img {
  width: 80px; height: 60px; object-fit: cover;
  border-radius: 8px; border: 2px solid var(--orange); display: block;
}
.photo-preview-del {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--danger); color: #fff; border: none;
  font-size: 11px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; padding: 0;
}

/* ── MOBILE ──────────────────────────────────────────── */
/* ── FAB MOBILE ──────────────────────────────────────── */
.mob-fab {
  display: none;
  position: fixed; bottom: 24px; right: 20px; z-index: 900;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--orange); color: #fff;
  font-size: 28px; font-weight: 300; line-height: 1;
  align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(255,106,0,.45);
  border: none; cursor: pointer;
  transition: transform .15s, background .15s;
}
.mob-fab:active { transform: scale(.93); background: var(--orange-dark); }

@media (max-width: 768px) {
  #app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; flex-direction: row; border-bottom: 1px solid rgba(255,255,255,.08); overflow-x: auto; overflow-y: visible; flex-shrink: 0; }
  .sidebar-brand { padding: 12px 16px; border-bottom: none; border-right: 1px solid rgba(255,255,255,.08); flex-shrink: 0; }
  .brand-logo .bl-bena, .brand-logo .bl-key { font-size: 18px; }
  .brand-logo .crm-logo-icon { height: 18px; }
  .sidebar-nav { flex-direction: row; padding: 6px; gap: 2px; }
  .nav-item { flex-direction: column; gap: 2px; padding: 8px 10px; font-size: 10px; min-width: 56px; text-align: center; white-space: nowrap; }
  .nav-icon { width: 20px; height: 20px; }
  .sidebar-footer { display: none; }
  .main-area { min-height: 0; }
  .top-bar { padding: 0 12px; height: 52px; gap: 8px; }
  .search-wrap { max-width: 160px; }
  .search-input { font-size: 13px; padding: 7px 10px 7px 32px; }
  .btn-add { display: none; }
  .btn-calc { padding: 7px 10px; font-size: 16px; }
  .mob-fab { display: flex; }
  .page-content { padding: 14px 14px 80px; }
  .biens-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .pipeline-col { min-width: 180px; }
  .contacts-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .detail-header { padding: 18px 20px; }
  .detail-title { font-size: 21px; }
  .task-btns { gap: 6px; }
  .tbtn { padding: 8px 10px; font-size: 12px; }
  .detail-actions { gap: 6px; }
  .action-btn { padding: 8px 12px; font-size: 13px; }
  #modal-overlay { padding: 0; align-items: flex-end; }
  #modal-box { border-radius: 20px 20px 0 0; max-height: 92vh; animation: none; }
  .photos-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .monjour-header { padding: 20px 18px; }
  .monjour-greeting { font-size: 19px; }
  .kpi-row { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
  .kpi-num { font-size: 22px; }
  .actions-rapides { gap: 6px; }
  .action-rap { font-size: 12px; padding: 9px 6px; }
  #toast { bottom: 80px; right: 16px; left: 16px; text-align: center; }
}

/* ── Publication form ────────────────────────────── */
.form-section { background: var(--card); border-radius: 14px; padding: 20px 22px; margin-bottom: 16px; border: 1px solid var(--border); }
.pub-form-title { font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--orange); margin-bottom: 16px; }
.presta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.presta-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg); border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 500; border: 1.5px solid var(--border); transition: all .15s; user-select: none; }
.presta-item:hover { border-color: #ffb380; }
.presta-item:has(.presta-check:checked) { border-color: var(--orange); background: #fff5ef; color: var(--orange); font-weight: 700; }
.presta-check { accent-color: var(--orange); width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }

/* ── Publication page ─────────────────────────────── */
.pub-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.pub-list { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.pub-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px; background: var(--card); border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.pub-row:last-child { border-bottom: none; }
.pub-row:hover { background: var(--bg); }
.pub-info { flex: 1; min-width: 0; }
.pub-title { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.pub-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.pub-empty { padding: 24px; text-align: center; color: var(--text-3); font-size: 13px; background: var(--card); }
.btn-pub {
  font-size: 12px; font-weight: 700; padding: 7px 14px; border-radius: 8px;
  border: none; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn-pub-on { background: #e6f4ea; color: #1a7f37; }
.btn-pub-on:hover { background: #fce8e8; color: #c0392b; }
.btn-pub-off { background: var(--orange); color: #fff; }
.btn-pub-off:hover { background: #e05e00; }

@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
  .visite-card { gap: 12px; }
  .task-card { padding: 14px 16px; }
  .visite-op-card { padding: 14px 16px; }
}

/* ── AGENDA / CALENDRIER SEMAINE ─────────────────────── */
.agenda-wrap {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 24px;
  overflow: hidden;
}
.agenda-nav {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border-light);
  background: var(--surface);
}
.agenda-period {
  flex: 1; text-align: center; font-size: 14px; font-weight: 700; color: var(--text);
}
.agenda-scroll { overflow-x: auto; }
.agenda-row {
  display: flex; border-bottom: 1px solid var(--border-light); min-width: 680px;
}
.agenda-row:last-child { border-bottom: none; }
.agenda-row-head { background: var(--surface-2, #fafafa); }
.agenda-hlabel {
  width: 44px; flex-shrink: 0; font-size: 11px; color: var(--text-3);
  padding: 4px 6px 0; text-align: right; line-height: 1; padding-top: 6px;
}
.agenda-col-hd {
  flex: 1; min-width: 80px; padding: 6px 4px 4px;
  border-left: 1px solid var(--border-light); text-align: center;
}
.agenda-col-today { background: rgba(255,106,0,.04); }
.agenda-dname {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-3);
}
.agenda-dnum {
  font-size: 16px; font-weight: 900; color: var(--text); line-height: 1.1;
}
.agenda-today-num {
  font-size: 14px; font-weight: 900; line-height: 1;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--orange); color: #fff;
  display: flex; align-items: center; justify-content: center; margin: 0 auto;
}
.agenda-dmonth { font-size: 10px; color: var(--text-3); margin-top: 1px; }
.agenda-nt {
  margin-top: 6px; display: flex; flex-direction: column; gap: 2px; text-align: left;
}
.agenda-chip {
  border-radius: 4px; padding: 3px 6px; margin-bottom: 2px;
  cursor: pointer; position: relative; display: flex; flex-direction: column; gap: 1px;
}
.agenda-chip:hover { filter: brightness(.97); }
.agenda-chip:hover .agenda-del { opacity: 1; }
.agenda-chip-title { font-size: 11px; font-weight: 700; line-height: 1.3; }
.agenda-del {
  position: absolute; top: 1px; right: 3px; background: none; border: none;
  cursor: pointer; font-size: 13px; opacity: 0; line-height: 1; padding: 0; color: inherit;
  transition: opacity .15s;
}
.agenda-del:hover { opacity: 1 !important; }

/* Time grid (absolute-positioned events) */
.agenda-time-grid { display: flex; min-width: 680px; overflow-y: auto; max-height: 520px; }
.agenda-hour-col { width: 44px; flex-shrink: 0; display: flex; flex-direction: column; }
.agenda-hlabel-t {
  font-size: 11px; color: var(--text-3); text-align: right;
  padding: 3px 6px 0 0; box-sizing: border-box;
  border-top: 1px solid var(--border-light); flex-shrink: 0;
  display: flex; align-items: flex-start; justify-content: flex-end;
}
.agenda-days-grid { flex: 1; display: flex; overflow: hidden; }
.agenda-day-col {
  flex: 1; min-width: 80px; position: relative;
  border-left: 1px solid var(--border-light);
}
.agenda-day-col-today { background: rgba(255,106,0,.04); }
.agenda-hline {
  position: absolute; left: 0; right: 0; height: 0;
  border-top: 1px solid var(--border-light); pointer-events: none; z-index: 0;
}
.agenda-hslot {
  position: absolute; left: 0; right: 0; z-index: 1;
  transition: background .1s;
}
.agenda-hslot:hover { background: rgba(255,106,0,.05); }
.agenda-ev-block {
  position: absolute; left: 2px; right: 2px;
  border-radius: 4px; padding: 4px 6px;
  overflow: hidden; cursor: pointer; z-index: 3;
  box-sizing: border-box; transition: filter .1s;
}
.agenda-ev-block:hover { filter: brightness(.93); }
.agenda-ev-block:hover .agenda-del { opacity: 1; }
.agenda-ev-time { font-size: 10px; font-weight: 700; opacity: .85; white-space: nowrap; }
.agenda-ev-title { font-size: 11px; font-weight: 700; line-height: 1.3; }
@media(max-width: 768px) {
  .agenda-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .agenda-row { min-width: 600px; }
  .agenda-time-grid, .agenda-days-grid { min-width: 560px; }
}
