:root {
  --primary: #16a34a;
  --primary-2: #0f8a3d;
  --primary-dark: #14181a;
  --primary-bg: #e6f7ec;
  --navy-1: #101312;
  --navy-2: #171b19;
  --navy-3: #1f2422;
  --accent: #34d399;
  --accent-dark: #1fae6f;
  --gold: #f2a541;
  --success: #16a34a;
  --success-bg: #e7f7ed;
  --warning: #d97706;
  --warning-bg: #fef3e0;
  --danger: #dc2626;
  --danger-bg: #fdecec;
  --info-bg: #e7f2fb;
  --text: #171a1c;
  --text-muted: #667079;
  --text-faint: #9aa4ab;
  --border: #e5e8ea;
  --bg: #f2f4f3;
  --card-bg: #ffffff;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(16, 19, 18, 0.06);
  --shadow: 0 2px 10px rgba(16, 19, 18, 0.07), 0 1px 3px rgba(16, 19, 18, 0.05);
  --shadow-lg: 0 16px 40px rgba(16, 19, 18, 0.2);
  --nav-height: 68px;
  --topbar-height: 58px;
  --sidebar-width: 250px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  letter-spacing: -0.01em;
}
h1, h2, h3, h4 { margin: 0 0 8px; color: var(--primary-dark); letter-spacing: -0.02em; }
p { margin: 0 0 8px; }
a { color: var(--primary); }
button { font-family: inherit; }
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }

#app { min-height: 100vh; }
#app.has-nav { padding-bottom: calc(var(--nav-height) + 14px); }

/* ---------- Topbar (mobile) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-height);
  background: linear-gradient(120deg, var(--navy-1), var(--navy-3));
  color: #fff;
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px;
  padding-top: env(safe-area-inset-top);
}
.topbar .brand { font-weight: 700; font-size: 15px; flex: 1; display: flex; align-items: center; gap: 8px; letter-spacing: -0.01em; min-width: 0; }
.topbar .brand img { width: 27px; height: 27px; border-radius: 8px; flex-shrink: 0; }
.topbar .brand span { display: none; }
.topbar .spacer { flex: 1; }
@media (min-width: 480px) { .topbar .brand span { display: inline; white-space: nowrap; } }
.topbar button.icon-btn {
  background: rgba(255,255,255,0.1); border: none; color: #fff; padding: 8px;
  cursor: pointer; border-radius: 10px; display: flex; align-items: center; justify-content: center;
}
.topbar button.icon-btn:active { background: rgba(255,255,255,0.22); }

.page-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 18px 0 10px;
}
.page-header h1 { font-size: 21px; margin: 0; font-weight: 700; }
.page-header .actions { display: flex; gap: 8px; }

/* ---------- Barre retour / précédent / suivant (fiches détail) ---------- */
.detail-navbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 0 0;
}
.detail-nav-back {
  display: flex; align-items: center; gap: 4px; background: none; border: none;
  color: var(--text-muted); font-size: 13.5px; font-weight: 700; cursor: pointer;
  padding: 6px 6px 6px 0; font-family: inherit;
}
.detail-nav-back:hover { color: var(--primary); }
.detail-nav-arrows { display: flex; gap: 6px; }
.detail-nav-arrow {
  width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--card-bg); color: var(--text);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.detail-nav-arrow:hover:not(:disabled) { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }
.detail-nav-arrow:disabled { opacity: 0.35; cursor: not-allowed; }
.detail-navbar + .page-header { padding-top: 6px; }

.content { padding: 4px 16px 28px; max-width: 900px; margin: 0 auto; }

/* ---------- Tableau de bord : en-tête + mise en page en colonnes ---------- */
.dash-greeting { padding: 18px 0 6px; }
.dash-greeting h1 { font-size: 22px; font-weight: 800; margin: 0; }
.dash-greeting p { margin: 3px 0 0; font-size: 13.5px; color: var(--text-muted); }
.dash-columns { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; }
.dash-main-col, .dash-side-col { min-width: 0; }
@media (min-width: 960px) {
  .dash-columns { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: 20px; }
  .dash-side-col { position: sticky; top: 20px; }
  .dash-mobile-only { display: none; }
}
.dash-week-recap { margin-top: 4px; }
.dash-week-day { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.dash-week-day:first-child { margin-top: 12px; }
.dash-week-day h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 0 0 6px; font-weight: 700; }
.dash-agenda-empty { font-size: 13px; color: var(--text-faint); margin: 0; }
.dash-agenda-item {
  display: flex; align-items: baseline; gap: 8px; padding: 7px 4px; border-radius: 9px;
  text-decoration: none; color: var(--text); font-size: 13px;
}
.dash-agenda-item:hover { background: var(--bg); }
.dash-agenda-time { font-weight: 800; color: var(--primary); flex-shrink: 0; font-size: 12.5px; }
.dash-agenda-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Bottom nav (mobile) : floating pill bar ---------- */
.bottom-nav {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20;
  height: var(--nav-height);
  background: linear-gradient(120deg, var(--navy-1), var(--navy-2) 55%, var(--navy-3));
  border-radius: 20px;
  display: flex;
  box-shadow: var(--shadow-lg);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; text-decoration: none; color: rgba(255,255,255,0.55); font-size: 10.5px; font-weight: 600;
  border-radius: 16px; margin: 7px 4px; transition: background 0.15s ease, color 0.15s ease;
}
.bottom-nav a .nav-icon-wrap { display: flex; align-items: center; justify-content: center; }
.bottom-nav a.active { color: #fff; background: rgba(255,255,255,0.12); }
.bottom-nav a.active .nav-icon-wrap { color: var(--accent); }
.bottom-nav .nav-fab {
  flex: 0 0 auto; width: 48px; height: 48px; margin: -16px 3px 0; border-radius: 50%;
  background: var(--primary); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(22, 163, 74, 0.5);
}
.bottom-nav .nav-fab:active { background: var(--primary-2); }

/* ---------- Sidebar (desktop) ---------- */
.sidebar {
  display: none;
}

@media (min-width: 860px) {
  #app.has-nav { display: grid; grid-template-columns: var(--sidebar-width) 1fr; min-height: 100vh; padding-bottom: 0; }
  .topbar { display: none; }
  .bottom-nav { display: none; }
  .sidebar {
    display: flex; flex-direction: column;
    background: linear-gradient(165deg, var(--navy-1) 0%, var(--navy-2) 55%, var(--navy-3) 100%);
    color: #fff; min-height: 100vh; padding: 22px 16px; position: sticky; top: 0;
  }
  .sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 26px; }
  .sidebar-brand img { width: 34px; height: 34px; border-radius: 9px; }
  .sidebar-brand span { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
  .sidebar-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
  .sidebar-nav .nav-group-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.4); padding: 16px 12px 6px; font-weight: 700; }
  .sidebar a.nav-link {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
    color: rgba(255,255,255,0.72); text-decoration: none; font-size: 14.5px; font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .sidebar a.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
  .sidebar a.nav-link.active { background: rgba(255,255,255,0.14); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
  .sidebar-footer { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 14px; margin-top: 10px; }
  .sidebar-user { display: flex; align-items: center; gap: 10px; padding: 0 12px 12px; }
  .sidebar-avatar {
    width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #06281a;
    display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800; flex-shrink: 0;
  }
  .sidebar-user-info { min-width: 0; flex: 1; }
  .sidebar-user-name { font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar-user-role { font-size: 11px; color: rgba(255,255,255,0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar-icon-btn {
    width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,0.08); border: none;
    color: rgba(255,255,255,0.75); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  }
  .sidebar-icon-btn:hover { background: rgba(255,255,255,0.16); color: #fff; }
  .sidebar-footer button.nav-link { width: 100%; background: none; border: none; cursor: pointer; text-align: left; font-family: inherit; }
  .sidebar-footer button.nav-link:hover { background: rgba(255,255,255,0.06); }
  .main-col { min-width: 0; }
  .content { max-width: 1100px; padding: 26px 32px 40px; }
  .page-header { padding-top: 4px; }
}

/* ---------- Cards, grids ---------- */
.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 8px; font-weight: 700; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: var(--card-bg); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  border: 1px solid var(--border); position: relative; overflow: hidden;
}
.stat-card .stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.stat-card .label { font-size: 12px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-card .stat-icon {
  width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: var(--primary-bg); color: var(--primary); flex-shrink: 0;
}
.stat-card.warn .stat-icon { background: var(--warning-bg); color: var(--warning); }
.stat-card.danger .stat-icon { background: var(--danger-bg); color: var(--danger); }
.stat-card.success .stat-icon { background: var(--success-bg); color: var(--success); }
.stat-card .value { font-size: 25px; font-weight: 800; color: var(--primary-dark); line-height: 1.1; letter-spacing: -0.02em; }
.stat-card.warn .value { color: var(--warning); }
.stat-card.danger .value { color: var(--danger); }
.stat-card.clickable { cursor: pointer; transition: box-shadow 0.15s ease, transform 0.1s ease; }
.stat-card.clickable:hover { box-shadow: var(--shadow-lg); }
.stat-card.clickable:active { transform: scale(0.98); }

/* Variante compacte (icône + pastille) : masquée par défaut, activée sur mobile ci-dessous. */
.stat-tile-compact { display: none; }
@media (max-width: 639px) {
  .stat-card { padding: 14px; }
  .stat-card > .stat-top, .stat-card > .value { display: none; }
  .stat-tile-compact { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
  .stat-tile-icon {
    position: relative; width: 44px; height: 44px; border-radius: 13px;
    background: var(--primary-bg); color: var(--primary);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  }
  .stat-card.warn .stat-tile-icon { background: var(--warning-bg); color: var(--warning); }
  .stat-card.danger .stat-tile-icon { background: var(--danger-bg); color: var(--danger); }
  .stat-card.success .stat-tile-icon { background: var(--success-bg); color: var(--success); }
  .stat-tile-badge {
    position: absolute; top: -7px; right: -9px; background: var(--primary-dark); color: #fff;
    font-size: 10.5px; font-weight: 800; padding: 2px 6px; border-radius: 999px;
    min-width: 18px; text-align: center; line-height: 1.4; white-space: nowrap; box-shadow: 0 0 0 2px var(--card-bg);
  }
  .stat-tile-label { font-size: 13px; font-weight: 700; color: var(--text); }
}

/* ---------- Dropdown (menu contextuel type ox_lib) ---------- */
.dropdown-overlay { position: fixed; inset: 0; z-index: 60; background: transparent; }
.dropdown-panel {
  position: fixed; z-index: 61; background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); overflow-y: auto; opacity: 0; transform: translateY(-6px) scale(0.98);
  transition: opacity 0.12s ease, transform 0.12s ease; padding: 8px;
}
.dropdown-panel.open { opacity: 1; transform: translateY(0) scale(1); }
.dropdown-panel.as-sheet {
  left: 10px !important; right: 10px; width: auto !important;
  bottom: calc(10px + env(safe-area-inset-bottom)); top: auto !important;
  border-radius: 16px; transform: translateY(16px); padding: 10px;
}
.dropdown-panel.as-sheet.open { transform: translateY(0); }
.dropdown-panel.as-sheet .dropdown-item { padding: 13px 12px; font-size: 14.5px; }
.dropdown-panel.as-sheet .dropdown-search input { padding: 12px 13px; font-size: 15px; }
.dropdown-panel .dropdown-search { padding: 4px 4px 8px; position: sticky; top: 0; background: #fff; }
.dropdown-panel .dropdown-search input { padding: 9px 11px; font-size: 13.5px; }
.dropdown-panel .dropdown-title { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); padding: 8px 10px 4px; }
.dropdown-panel .dropdown-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 10px; border-radius: 9px;
  cursor: pointer; font-size: 13.5px; color: var(--text);
}
.dropdown-panel .dropdown-item:hover { background: var(--primary-bg); }
.dropdown-panel .dropdown-item .dd-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-panel .dropdown-item .dd-sub { font-size: 11px; color: var(--text-muted); }
.dropdown-panel .dropdown-item strong { flex-shrink: 0; font-weight: 700; color: var(--primary-dark); }
.dropdown-panel .dropdown-empty { padding: 18px 10px; text-align: center; color: var(--text-muted); font-size: 13px; }
.dropdown-panel .dropdown-icon { color: var(--primary); display: flex; flex-shrink: 0; }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; gap: 9px; }
.list-item {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  text-decoration: none; color: inherit; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}
.list-item:hover { box-shadow: var(--shadow); border-color: #bfe6cd; }
.list-item:active { transform: scale(0.99); }
.list-item[data-status] { border-left-width: 3px; border-left-style: solid; border-left-color: transparent; }
.list-item[data-status="brouillon"], .list-item[data-status="annulee"] { border-left-color: #9aa4ab; }
.list-item[data-status="envoyee"], .list-item[data-status="en_cours"] { border-left-color: #1565c0; }
.list-item[data-status="accepte"], .list-item[data-status="payee"], .list-item[data-status="terminee"] { border-left-color: var(--success); }
.list-item[data-status="refuse"], .list-item[data-status="en_retard"] { border-left-color: var(--danger); }
.list-item[data-status="planifiee"] { border-left-color: var(--warning); }
.list-item .li-icon {
  width: 38px; height: 38px; border-radius: 11px; background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.list-item .li-body { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.list-item .li-main { min-width: 0; }
.list-item .li-title { font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.list-item .li-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.list-item .li-right { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.list-item .li-amount { font-weight: 700; color: var(--primary-dark); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state .icon-wrap { width: 56px; height: 56px; border-radius: 16px; background: var(--primary-bg); color: var(--primary); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; letter-spacing: 0.01em; }
.badge.brouillon { background: #eef1f4; color: #5b6b78; }
.badge.envoyee { background: var(--info-bg); color: #1565c0; }
.badge.accepte { background: var(--success-bg); color: var(--success); }
.badge.refuse { background: var(--danger-bg); color: var(--danger); }
.badge.payee { background: var(--success-bg); color: var(--success); }
.badge.en_retard { background: var(--danger-bg); color: var(--danger); }
.badge.planifiee { background: var(--warning-bg); color: var(--warning); }
.badge.en_cours { background: var(--info-bg); color: #1565c0; }
.badge.terminee { background: var(--success-bg); color: var(--success); }
.badge.annulee { background: #eef1f4; color: #5b6b78; }
.badge.particulier { background: #eef1ff; color: #4353b0; }
.badge.professionnel { background: var(--warning-bg); color: #b5730a; }
.badge.syndic { background: #f3e8fd; color: #7b3fb0; }
.badge.produit { background: var(--info-bg); color: #1565c0; }
.badge.prestation { background: #f3e8fd; color: #7b3fb0; }
.badge.a_vie { background: var(--primary-bg); color: var(--primary); }

/* ---------- Prix d'abonnement (paiement PayPal) ---------- */
.billing-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.billing-price-old { font-size: 14px; color: var(--text-faint); text-decoration: line-through; }
.billing-price-final { font-size: 22px; font-weight: 800; color: var(--text); }
.billing-price-period { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-left: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; border-radius: 12px; padding: 11px 18px; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: transform 0.05s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; box-shadow: 0 4px 12px rgba(22, 163, 74, 0.28); }
.btn-primary:hover { box-shadow: 0 6px 16px rgba(22, 163, 74, 0.36); }
.btn-secondary { background: #fff; color: var(--primary); border: 1.5px solid #bfe6cd; }
.btn-secondary:hover { background: var(--primary-bg); }
.btn-danger { background: #fff; color: var(--danger); border: 1.5px solid #f3c8c8; }
.btn-danger:hover { background: var(--danger-bg); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-height) + 26px); z-index: 15;
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); border: none; cursor: pointer;
}
@media (min-width: 860px) { .btn-fab { bottom: 30px; } }

/* ---------- Forms ---------- */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; background: #fff; color: var(--text); font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3.5px rgba(22,163,74,0.13); }
textarea { min-height: 80px; resize: vertical; }
.field-row { display: flex; gap: 10px; }
.field-row > .field { flex: 1; }
.checkbox-row { display: flex; align-items: center; gap: 9px; }
.checkbox-row input { width: auto; }

.form-actions { display: flex; gap: 10px; margin-top: 22px; }
.form-actions .btn { flex: 1; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button {
  background: none; border: none; padding: 11px 14px; font-size: 13.5px; color: var(--text-muted);
  cursor: pointer; border-bottom: 2.5px solid transparent; white-space: nowrap; font-weight: 700;
  margin-bottom: -1.5px;
}
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Line items table (devis/factures) ---------- */
.lines-table { width: 100%; }
.line-row { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; background: #fbfdfe; }
.line-row .line-top { display: flex; gap: 6px; margin-bottom: 9px; }
.line-row .line-top select.product-pick { flex: 1; }
.line-row .line-desc { width: 100%; margin-bottom: 9px; }
.line-row .line-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.line-row .line-grid > div { flex: 1; min-width: 68px; }
.line-row .line-grid label { font-size: 10px; color: var(--text-muted); display: block; margin-bottom: 2px; font-weight: 700; text-transform: uppercase; }
.line-row input, .line-row select { padding: 8px 10px; font-size: 13px; }
.line-row .line-remove { background: none; border: none; color: var(--danger); cursor: pointer; padding: 6px 8px; flex: 0 0 auto; align-self: flex-end; border-radius: 8px; }
.line-row .line-remove:hover { background: var(--danger-bg); }
.line-row .line-total { font-size: 12px; color: var(--text-muted); margin-top: 7px; text-align: right; font-weight: 600; }
.totals-box { margin-top: 16px; border-top: 1.5px solid var(--border); padding-top: 14px; }
.totals-box .row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.totals-box .row.grand { font-size: 19px; font-weight: 800; color: var(--primary-dark); }

/* ---------- Modal / bottom sheet ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(7,42,64,0.5); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(1px);
}
@media (min-width: 640px) { .modal-overlay { align-items: center; } }
.modal-sheet {
  background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 20px; padding-bottom: calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
}
@media (min-width: 640px) { .modal-sheet { border-radius: 18px; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-header h2 { font-size: 18px; margin: 0; font-weight: 700; }
.modal-header button { background: var(--bg); border: none; width: 30px; height: 30px; border-radius: 9px; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ---------- Toasts ---------- */
.toast-container { position: fixed; bottom: calc(var(--nav-height) + 20px + env(safe-area-inset-bottom)); left: 0; right: 0; z-index: 100; display: flex; flex-direction: column-reverse; align-items: center; gap: 8px; pointer-events: none; }
@media (min-width: 860px) { .toast-container { bottom: 24px; } }
.toast { background: var(--navy-1); color: #fff; padding: 11px 20px; border-radius: 999px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); max-width: 90%; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* ---------- Signature pad ---------- */
.signature-wrap { border: 2px dashed #cfd9e0; border-radius: var(--radius-sm); background: #fdfefe; touch-action: none; }
.signature-wrap canvas { width: 100%; height: 200px; display: block; touch-action: none; }

/* ---------- Alerts list ---------- */
.alert-item { display: flex; gap: 11px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.alert-item:last-child { border-bottom: none; }
.alert-item .alert-icon { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.alert-item.high .alert-icon { background: var(--danger-bg); color: var(--danger); }
.alert-item.medium .alert-icon { background: var(--warning-bg); color: var(--warning); }
.alert-item.low .alert-icon { background: var(--bg); color: var(--text-muted); }

/* ---------- Auth ---------- */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--navy-1), var(--navy-3)); padding: 20px; }
.auth-card { background: #fff; border-radius: 22px; padding: 30px 26px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.auth-card .logo-row { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; justify-content: center; }
.auth-card .logo-row img { width: 42px; height: 42px; border-radius: 11px; }
.auth-card .logo-row span { font-size: 20px; font-weight: 800; color: var(--primary-dark); letter-spacing: -0.02em; }
.auth-switch { text-align: center; margin-top: 15px; font-size: 13px; color: var(--text-muted); }
.auth-switch a { cursor: pointer; font-weight: 700; }
.auth-back { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--text-muted); text-decoration: none; margin-bottom: 14px; }
.auth-back:hover { color: var(--primary); }

/* ---------- Photo grid ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 11px; border: 1px solid var(--border); }

/* ---------- Checklist ---------- */
.checklist-item { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.checklist-item:last-child { border-bottom: none; }
.checklist-item input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--primary); }
.checklist-item .txt { flex: 1; font-size: 14px; }
.checklist-item .txt.done { text-decoration: line-through; color: var(--text-muted); }
.checklist-item button { background: none; border: none; color: var(--danger); cursor: pointer; padding: 4px; border-radius: 6px; display: flex; }

.loading-spin { display: flex; align-items: center; justify-content: center; padding: 46px; color: var(--text-muted); font-weight: 600; font-size: 13px; }

.readings-chart { display: flex; align-items: flex-end; gap: 4px; height: 80px; margin-top: 10px; }
.readings-chart .bar { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }

.search-bar { position: relative; margin-bottom: 14px; }
.search-bar input { padding-left: 38px; }
.search-bar .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; display: flex; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; }
.section-title h3 { margin: 0; font-size: 15px; color: var(--text); font-weight: 700; }
.section-title a { font-size: 13px; font-weight: 700; text-decoration: none; }

.offline-banner { background: var(--warning); color: #fff; text-align: center; font-size: 12px; padding: 5px; }

/* ================= Landing page ================= */
.landing { background: #fff; color: var(--text); overflow-x: hidden; }
.btn-lg { padding: 14px 22px; font-size: 15px; border-radius: 13px; }
.btn-ghost-invert { background: rgba(255,255,255,0.08); color: #fff; border: 1.5px solid rgba(255,255,255,0.25); }
.btn-ghost-invert:hover { background: rgba(255,255,255,0.16); }

.landing-nav { position: sticky; top: 0; z-index: 30; background: var(--navy-1); padding: 14px 0; }
.landing-nav-inner { max-width: 1160px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 24px; }
.landing-brand { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 800; font-size: 16.5px; letter-spacing: -0.01em; }
.landing-brand img { width: 28px; height: 28px; border-radius: 8px; }
.landing-nav-links { display: none; gap: 26px; flex: 1; }
.landing-nav-links a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 14px; font-weight: 600; }
.landing-nav-links a:hover { color: #fff; }
.landing-nav-actions { display: flex; gap: 10px; margin-left: auto; }
@media (min-width: 760px) { .landing-nav-links { display: flex; } .landing-nav-actions { margin-left: 0; } }

.landing-hero { background: linear-gradient(160deg, var(--navy-1), var(--navy-3)); padding: 56px 20px 70px; }
.landing-hero-inner { max-width: 1160px; margin: 0 auto; display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .landing-hero-inner { grid-template-columns: 1fr 1fr; gap: 50px; } }
.landing-eyebrow { display: inline-block; color: var(--accent); font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.landing-hero-text h1 { color: #fff; font-size: 34px; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 16px; }
@media (min-width: 640px) { .landing-hero-text h1 { font-size: 44px; } }
.landing-hero-text p { color: rgba(255,255,255,0.72); font-size: 16px; line-height: 1.6; max-width: 480px; margin-bottom: 26px; }
.landing-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.landing-trust { color: rgba(255,255,255,0.45); font-size: 12.5px; }

.landing-mock { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; display: flex; aspect-ratio: 4/3; }
.landing-mock-sidebar { width: 26%; background: var(--navy-2); padding: 18px 10px; display: flex; flex-direction: column; gap: 12px; }
.landing-mock-dot { width: 16px; height: 16px; border-radius: 5px; background: var(--accent); margin-bottom: 6px; }
.landing-mock-line { height: 7px; border-radius: 4px; background: rgba(255,255,255,0.18); }
.landing-mock-line.active { background: var(--accent); }
.landing-mock-main { flex: 1; padding: 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.landing-mock-stats { display: flex; gap: 10px; }
.landing-mock-stat { flex: 1; height: 46px; border-radius: 9px; background: var(--primary-bg); border: 1px solid var(--border); }
.landing-mock-row { height: 34px; border-radius: 9px; background: var(--bg); border: 1px solid var(--border); }
.landing-mock-row.short { width: 65%; }

.landing-section { padding: 64px 20px; }
.landing-section-inner { max-width: 1160px; margin: 0 auto; }
.landing-section h2 { text-align: center; font-size: 28px; letter-spacing: -0.02em; margin-bottom: 10px; }
.landing-section-sub { text-align: center; color: var(--text-muted); font-size: 15px; max-width: 520px; margin: 0 auto 40px; }

.landing-feature-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .landing-feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .landing-feature-grid { grid-template-columns: repeat(3, 1fr); } }
.landing-feature-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.landing-feature-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-bg); color: var(--primary); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.landing-feature-card h3 { font-size: 16.5px; margin-bottom: 6px; }
.landing-feature-card p { color: var(--text-muted); font-size: 14px; line-height: 1.55; margin: 0; }

.landing-steps-section { background: var(--bg); }
.landing-steps { display: grid; gap: 30px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .landing-steps { grid-template-columns: repeat(3, 1fr); } }
.landing-step { text-align: center; }
.landing-step-num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; font-size: 16px;
}
.landing-step h3 { font-size: 16px; margin-bottom: 6px; }
.landing-step p { color: var(--text-muted); font-size: 14px; line-height: 1.55; max-width: 280px; margin: 0 auto; }

.landing-pricing-card {
  max-width: 420px; margin: 0 auto; background: #fff; border: 1.5px solid var(--border); border-radius: 20px;
  padding: 32px 28px; box-shadow: var(--shadow-lg);
}
.landing-pricing-head { text-align: center; margin-bottom: 22px; }
.landing-price { display: flex; align-items: baseline; justify-content: center; gap: 4px; margin: 6px 0; }
.landing-price .amount { font-size: 42px; font-weight: 800; color: var(--primary-dark); letter-spacing: -0.02em; }
.landing-price .period { color: var(--text-muted); font-size: 14px; }
.landing-pricing-head p { color: var(--text-muted); font-size: 13px; margin: 0; }
.landing-pricing-list { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 12px; }
.landing-pricing-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); }
.landing-pricing-list li .icon { color: var(--primary); flex-shrink: 0; }

.landing-cta { background: var(--navy-1); padding: 56px 20px; }
.landing-cta-inner { text-align: center; }
.landing-cta h2 { color: #fff; margin-bottom: 22px; }

.landing-footer { background: var(--navy-1); border-top: 1px solid rgba(255,255,255,0.08); padding: 22px 20px; }
.landing-footer-inner { display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; }
.landing-footer-inner .landing-brand { color: rgba(255,255,255,0.85); }
.landing-footer-inner p { color: rgba(255,255,255,0.4); font-size: 12.5px; margin: 0; }
@media (min-width: 640px) { .landing-footer-inner { flex-direction: row; justify-content: space-between; text-align: left; } }

.quick-link { display: inline-flex; align-items: center; gap: 10px; }

/* ---------- Address autocomplete ---------- */
.address-suggestions {
  position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 30;
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); overflow: hidden; max-height: 220px; overflow-y: auto;
}
.address-suggestion-item { padding: 10px 13px; font-size: 13.5px; cursor: pointer; border-bottom: 1px solid var(--border); }
.address-suggestion-item:last-child { border-bottom: none; }
.address-suggestion-item:hover, .address-suggestion-item.active { background: var(--primary-bg); }

/* ---------- Stock ---------- */
.stock-row { display: flex; align-items: center; gap: 12px; }
.stock-qty-badge { font-size: 15px; font-weight: 800; padding: 5px 12px; border-radius: 10px; background: var(--primary-bg); color: var(--primary); min-width: 44px; text-align: center; }
.stock-qty-badge.low { background: var(--danger-bg); color: var(--danger); }
.movement-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.movement-item:last-child { border-bottom: none; }
.movement-item .mv-delta { font-weight: 800; }
.movement-item .mv-delta.pos { color: var(--success); }
.movement-item .mv-delta.neg { color: var(--danger); }
.movement-item .mv-meta { color: var(--text-muted); font-size: 11.5px; }

/* ---------- Sélecteur de couleur (interventions) ---------- */
.color-picker { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 2px; }
.color-swatch {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.color-swatch.active { border-color: var(--text); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text); }
.color-swatch .check-icon { color: #fff; display: none; }
.color-swatch.active .check-icon { display: block; }
.color-swatch.auto { background: var(--bg); border: 1.5px dashed var(--text-faint); font-size: 9px; font-weight: 700; color: var(--text-muted); }
.color-swatch.auto.active { border-style: solid; border-color: var(--text); }

/* ---------- Toggle type produit / prestation (catalogue) ---------- */
.type-toggle { display: flex; gap: 8px; margin-top: 2px; }
.type-toggle-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--card-bg); color: var(--text-muted); font-weight: 700; font-size: 13.5px;
  cursor: pointer; font-family: inherit;
}
.type-toggle-btn.active { border-color: var(--primary); background: var(--primary-bg); color: var(--primary); }

/* ---------- Week planner (grille horaire) ---------- */
.week-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.week-toolbar .week-nav { display: flex; align-items: center; gap: 8px; }
.week-toolbar h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--primary-dark); white-space: nowrap; }
.week-toolbar .week-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.view-switch { display: flex; background: var(--bg); border-radius: 10px; padding: 3px; }
.view-switch button { border: none; background: none; padding: 7px 13px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--text-muted); cursor: pointer; }
.view-switch button.active { background: var(--primary); color: #fff; }
.week-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.week-grid { display: grid; grid-template-columns: 46px repeat(var(--wk-days, 7), minmax(108px, 1fr)); min-width: 800px; }
.week-grid-header { display: contents; }
.week-day-head { padding: 10px 4px; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--text-muted); border-bottom: 1.5px solid var(--border); border-left: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 2; }
.week-day-head.today { color: var(--primary); background: var(--primary-bg); }
.week-day-head .dow { display: block; text-transform: uppercase; font-size: 10px; letter-spacing: 0.03em; }
.week-day-head .dnum { display: block; font-size: 15px; margin-top: 1px; }
.week-corner { border-bottom: 1.5px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 2; }
.week-time-col { position: relative; }
.week-time-label { position: absolute; right: 6px; transform: translateY(-50%); font-size: 10px; color: var(--text-faint); }
.week-day-col { position: relative; border-left: 1px solid var(--border); background-image: repeating-linear-gradient(to bottom, var(--border) 0, var(--border) 1px, transparent 1px, transparent var(--wk-hour-h, 50px)); cursor: pointer; }
.week-day-col.today { background-color: rgba(15,92,140,0.03); }
.week-event {
  position: absolute; left: 2px; right: 2px; border-radius: 7px; padding: 4px 6px; overflow: hidden;
  color: #fff; font-size: 10.5px; line-height: 1.25; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.25);
}
.week-event .we-time { font-weight: 700; opacity: 0.95; display: block; }
.week-event .we-title { font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-event .we-sub { display: block; opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 3; pointer-events: none; }
.week-now-line::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

/* ---------- Carte piscine (onglet Piscines) ---------- */
.pool-hero-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; cursor: pointer; transition: box-shadow 0.15s ease; }
.pool-hero-card:hover { box-shadow: var(--shadow-lg); }
.pool-hero-top { display: flex; gap: 14px; padding: 16px; align-items: center; }
.pool-hero-visual { width: 76px; height: 76px; flex-shrink: 0; border-radius: 16px; overflow: hidden; position: relative; box-shadow: 0 2px 8px rgba(3, 105, 161, 0.25); }
.pool-hero-visual svg { display: block; width: 100%; height: 100%; }
.pool-hero-info { min-width: 0; flex: 1; }
.pool-hero-info h3 { margin: 0 0 5px; font-size: 16px; font-weight: 800; color: var(--text); text-transform: none; letter-spacing: normal; }
.pool-hero-meta { font-size: 12px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.pool-hero-arrow { color: var(--text-faint); flex-shrink: 0; }
.pool-constants { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border-top: 1px solid var(--border); }
.pool-constant { background: #fff; padding: 11px 12px 9px; }
.pool-constant-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; gap: 4px; }
.pool-constant-label { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pool-constant-status { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.pool-constant-status.ok { background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.pool-constant-status.warn { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.pool-constant-value-row { display: flex; align-items: baseline; gap: 5px; margin-bottom: 6px; flex-wrap: wrap; }
.pool-constant-value { font-size: 17px; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
.pool-constant-delta { font-size: 10.5px; font-weight: 700; }
.pool-constant-delta.up { color: var(--success); }
.pool-constant-delta.down { color: var(--danger); }
.pool-constant-empty { font-size: 11px; color: var(--text-faint); padding: 8px 0 4px; }
.pool-hero-footer { display: flex; border-top: 1px solid var(--border); }
.pool-hero-footer button { flex: 1; border: none; background: #fff; padding: 11px; font-size: 12.5px; font-weight: 700; color: var(--primary); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.pool-hero-footer button:first-child { border-right: 1px solid var(--border); }
.pool-hero-footer button:hover { background: var(--primary-bg); }

/* ---------- Calendar / Agenda ---------- */
.calendar-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); margin-bottom: 14px; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 0 2px; }
.calendar-header h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--primary-dark); text-transform: capitalize; }
.calendar-nav-btn { background: var(--bg); border: none; width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--primary-dark); }
.calendar-nav-btn:hover { background: var(--primary-bg); }
.calendar-today-btn { font-size: 12px; font-weight: 700; color: var(--primary); background: var(--primary-bg); border: none; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; margin-bottom: 4px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.calendar-day {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 11px; cursor: pointer; border: none; background: none; font-size: 13.5px; font-weight: 600;
  color: var(--text); gap: 3px; position: relative;
}
.calendar-day.empty { cursor: default; }
.calendar-day:not(.empty):hover { background: var(--bg); }
.calendar-day.today { color: var(--primary); }
.calendar-day.today .day-num { box-shadow: inset 0 0 0 1.5px var(--primary); border-radius: 50%; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }
.calendar-day.selected { background: var(--primary); color: #fff; }
.calendar-day.selected .day-num { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }
.calendar-day.selected.today .day-num { box-shadow: none; }
.calendar-day .dots { display: flex; gap: 2px; height: 5px; }
.calendar-day .dots span { width: 4.5px; height: 4.5px; border-radius: 50%; background: var(--accent-dark); }
.calendar-day.selected .dots span { background: #fff; }
.agenda-view-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.agenda-view-tabs button {
  flex: 1; padding: 9px; border-radius: 10px; border: 1.5px solid var(--border); background: #fff;
  font-weight: 700; font-size: 13px; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.agenda-view-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Client files (photos / PDF) ---------- */
.file-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.file-tile { position: relative; border-radius: 11px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 1; background: var(--bg); }
.file-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-tile .file-tile-pdf { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 100%; color: var(--primary); text-decoration: none; padding: 6px; text-align: center; }
.file-tile .file-tile-pdf span { font-size: 10.5px; color: var(--text-muted); word-break: break-all; line-height: 1.2; }
.file-tile .file-tile-remove {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0,0,0,0.55); color: #fff; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.file-tile a.file-tile-link { position: absolute; inset: 0; }
