@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root{
  /* Surfaces */
  --bg: #F7F8FB;
  --surface: #FFFFFF;
  --surface-2: #F1F4F9;
  --surface-3: #FAFBFD;

  /* Text */
  --text: #0F172A;
  --text-2: #475569;
  --text-3: #94A3B8;

  /* Primary palette - Indigo */
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-light: #EEF2FF;
  --primary-soft: #E0E7FF;

  /* Accent - Emerald */
  --accent: #10B981;
  --accent-light: #ECFDF5;

  /* Status colors */
  --success: #10B981;
  --success-bg: #ECFDF5;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --info: #0EA5E9;
  --info-bg: #F0F9FF;

  /* Borders */
  --border: #E2E8F0;
  --border-2: #CBD5E1;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04);
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md: 0 4px 6px -1px rgba(15,23,42,.07), 0 2px 4px -2px rgba(15,23,42,.05);
  --shadow-lg: 0 10px 15px -3px rgba(15,23,42,.08), 0 4px 6px -4px rgba(15,23,42,.05);
}

html, body{ height: 100%; }
body{
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app{ display: flex; flex-direction: column; height: 100vh; width: 100%; }

h1, h2, h3, h4 { font-weight: 700; color: var(--text); letter-spacing: -0.02em; }

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

/* ── TOPBAR ───────────────────────────── */
.topbar{
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.logo-name{ line-height: 1.1; }
.logo-name .l1{
  font-size: 18px; font-weight: 800; color: var(--primary);
  letter-spacing: -0.03em;
}
.logo-name .l2{
  font-size: 9px; font-weight: 600; color: var(--text-3);
  letter-spacing: 1.5px; text-transform: uppercase; margin-top: 2px;
}
.topbar-sep{ width: 1px; height: 24px; background: var(--border); margin: 0 4px; }
.page-title{
  font-size: 16px; font-weight: 600; color: var(--text);
  flex: 1; margin-left: 4px; letter-spacing: -0.01em;
}

.api-chip{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 500; border: 1px solid;
  background: var(--surface);
}
.api-chip.ok{ background: var(--success-bg); border-color: #BBF7D0; color: #047857; }
.api-chip.off{ background: var(--surface-2); border-color: var(--border); color: var(--text-3); }

.dot{ width: 6px; height: 6px; border-radius: 50%; }
.dot.green{ background: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.dot.purple{ background: var(--text-3); }

.search-box{
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text);
  width: 240px;
  outline: none;
  font-family: inherit;
  transition: all .15s;
}
.search-box::placeholder{ color: var(--text-3); }
.search-box:focus{ border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ── BUTTONS ───────────────────────────── */
.btn{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  transition: all .15s ease;
  font-family: inherit; letter-spacing: -0.01em;
  background: none;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{
  background: var(--primary); color: #fff;
  box-shadow: 0 1px 2px rgba(79,70,229,.3);
}
.btn-primary:hover{ background: var(--primary-hover); box-shadow: 0 4px 10px rgba(79,70,229,.25); }
.btn-outline{
  background: var(--surface); border-color: var(--border);
  color: var(--text-2);
}
.btn-outline:hover{ border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-sm{ padding: 5px 11px; font-size: 12px; gap: 4px; }
.btn-green{
  background: var(--success-bg); border-color: #A7F3D0; color: #047857;
}
.btn-green:hover{ background: #D1FAE5; }
.btn-danger{
  background: var(--danger-bg); border-color: #FECACA; color: #B91C1C;
}
.btn-danger:hover{ background: #FEE2E2; }

/* ── USER PILL ───────────────────────────── */
.user-pill{
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 500; border: 1px solid;
  background: var(--surface);
}
.user-pill.admin{ background: #FEF2F2; border-color: #FECACA; color: #B91C1C; }
.user-pill.tech{ background: #EFF6FF; border-color: #BFDBFE; color: #1D4ED8; }
.user-pill.commercial{ background: #ECFDF5; border-color: #BBF7D0; color: #047857; }

.logout-btn{
  padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.logout-btn:hover{ border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }

/* ── SIDEBAR ───────────────────────────── */
.sidebar{
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto; flex-shrink: 0;
  padding: 12px 0;
}
.sidebar::-webkit-scrollbar{ width: 4px; }
.sidebar::-webkit-scrollbar-thumb{ background: var(--border); border-radius: 2px; }
.nav-section{
  padding: 16px 16px 6px;
  font-size: 11px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .8px;
  font-weight: 600;
}
.nav-item{
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; margin: 1px 8px;
  border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 500;
  color: var(--text-2);
  transition: all .15s;
}
.nav-item:hover{ background: var(--surface-2); color: var(--text); }
.nav-item.active{
  background: var(--primary-light); color: var(--primary);
  font-weight: 600;
}
.nav-badge{
  margin-left: auto; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
}
.nb-green{ background: var(--success-bg); color: #047857; }
.nb-red{ background: var(--danger-bg); color: #B91C1C; }
.nb-navy{ background: var(--info-bg); color: #0369A1; }

/* ── CONTENT ───────────────────────────── */
.content{ flex: 1; overflow-y: auto; padding: 24px; }
.content::-webkit-scrollbar{ width: 6px; }
.content::-webkit-scrollbar-thumb{ background: var(--border-2); border-radius: 3px; }

.grid4{ display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 20px; }
.grid3{ display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 20px; }
.grid2{ display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }

/* ── CARDS ───────────────────────────── */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.card:hover{ box-shadow: var(--shadow); }
.card-title{
  font-size: 14px; font-weight: 700; color: var(--text);
  margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  letter-spacing: -0.01em;
}

/* ── STATS ───────────────────────────── */
.stat-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all .2s;
}
.stat-card:hover{ box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card::before{
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.sg::before{ background: linear-gradient(90deg, var(--success), #34D399); }
.stat-card.sn::before{ background: linear-gradient(90deg, var(--primary), #818CF8); }
.stat-card.sr::before{ background: linear-gradient(90deg, var(--danger), #F87171); }
.stat-card.so::before{ background: linear-gradient(90deg, var(--warning), #FBBF24); }
.stat-card.sp::before{ background: linear-gradient(90deg, #8B5CF6, #A78BFA); }
.stat-label{
  font-size: 11px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .6px;
  font-weight: 600; margin-bottom: 10px;
}
.stat-value{
  font-size: 28px; font-weight: 700;
  color: var(--text); letter-spacing: -0.03em;
}

/* ── TABLES ───────────────────────────── */
table{ width: 100%; border-collapse: collapse; font-size: 13px; }
th{
  text-align: left; padding: 11px 16px;
  background: var(--surface-3);
  color: var(--text-2);
  font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
}
td{
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
tbody tr{ transition: background .15s; }
tbody tr:hover{ background: var(--surface-3); }
tbody tr:last-child td{ border-bottom: none; }

/* ── TAGS ───────────────────────────── */
.tag{
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: -0.01em;
  border: 1px solid transparent;
}
.tg{ background: var(--success-bg); color: #047857; border-color: #BBF7D0; }
.tn{ background: var(--info-bg); color: #0369A1; border-color: #BAE6FD; }
.tr{ background: var(--danger-bg); color: #B91C1C; border-color: #FECACA; }
.to{ background: var(--warning-bg); color: #B45309; border-color: #FDE68A; }
.tp{ background: #F3E8FF; color: #6B21A8; border-color: #E9D5FF; }
.tz{ background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.tlive{ background: var(--success-bg); color: #047857; font-size: 10px; }

/* ── FORMS ───────────────────────────── */
.fl{
  display: block;
  font-size: 12px; color: var(--text-2);
  margin-bottom: 6px; margin-top: 12px;
  font-weight: 500;
}
.fl:first-child{ margin-top: 0; }
.fi{
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  margin-bottom: 4px;
  transition: all .15s;
}
.fi:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
select.fi{ cursor: pointer; }
textarea.fi{ resize: vertical; min-height: 70px; line-height: 1.5; }

/* ── NOTIFICATIONS ───────────────────────────── */
.notif{
  position: fixed; top: 20px; right: 20px;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px; font-weight: 500;
  z-index: 9999;
  box-shadow: var(--shadow-lg);
  border: 1px solid;
  animation: slidein .3s ease;
}
.notif.ok{ background: var(--success-bg); color: #047857; border-color: #A7F3D0; }
.notif.err{ background: var(--danger-bg); color: #B91C1C; border-color: #FECACA; }
.notif.info{ background: var(--info-bg); color: #0369A1; border-color: #BAE6FD; }
@keyframes slidein{ from{ transform: translateX(40px); opacity: 0; } to{ transform: translateX(0); opacity: 1; } }

/* ── MODALS ───────────────────────────── */
.modal-overlay{
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadein .2s;
}
@keyframes fadein{ from { opacity: 0; } to { opacity: 1; } }
.modal-overlay.hidden{ display: none; }
.modal{
  background: var(--surface);
  border-radius: 14px;
  padding: 24px;
  width: 480px; max-width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideup .25s;
}
@keyframes slideup{ from{ opacity: 0; transform: translateY(20px); } to{ opacity: 1; transform: translateY(0); } }

/* ── LOGIN ───────────────────────────── */
.login-screen{
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #EEF2FF 0%, #F0F9FF 50%, #ECFDF5 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-direction: column;
}
.login-screen::before{
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(79,70,229,.08), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(16,185,129,.08), transparent 40%);
}
.login-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px;
  width: 400px;
  box-shadow: 0 20px 60px rgba(15,23,42,.10), 0 8px 16px rgba(15,23,42,.05);
  position: relative; z-index: 2;
}
.login-title{
  font-size: 28px; font-weight: 800;
  color: var(--primary);
  text-align: center; margin-bottom: 4px;
  letter-spacing: -0.04em;
}
.login-sub{
  text-align: center;
  font-size: 11px; color: var(--text-3);
  margin-bottom: 24px; letter-spacing: 1.5px; font-weight: 600;
}

/* ── CHAT ───────────────────────────── */
.chat-wrap{
  height: 460px;
  overflow-y: auto;
  padding: 16px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 12px;
}
.chat-msg{ display: flex; gap: 10px; align-items: flex-start; }
.chat-msg.user{ flex-direction: row-reverse; }
.av{
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; font-weight: 700;
  background: var(--surface); border: 1px solid var(--border);
}
.bubble{
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px; line-height: 1.55;
  max-width: 78%;
}
.bubble.bot{
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.bubble.user{
  background: var(--primary);
  color: #fff;
}
.chat-inp{
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: all .15s;
}
.chat-inp:focus{ border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ── CALENDAR ───────────────────────────── */
.cal-grid{ display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.cal-day{
  aspect-ratio: 1;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-2);
  position: relative;
  font-weight: 500;
}
.cal-day.today{
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}
.cal-day.ev::after{
  content: ''; position: absolute; bottom: 4px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent);
}

/* ── SPINNER ───────────────────────────── */
.spin{
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: sp .7s linear infinite;
}
@keyframes sp{ to { transform: rotate(360deg); } }
.loading-row{
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-2);
  padding: 16px;
}

/* ── LUCIDE ICONS ───────────────────────────── */
.ico{ width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
.ico-sm{ width: 14px; height: 14px; stroke-width: 2.2; flex-shrink: 0; }
.ico-xs{ width: 12px; height: 12px; stroke-width: 2.4; flex-shrink: 0; }
.ico-lg{ width: 24px; height: 24px; stroke-width: 1.8; flex-shrink: 0; }
.ico-xl{ width: 32px; height: 32px; stroke-width: 1.6; flex-shrink: 0; }

.nav-item .ico{ color: var(--text-3); transition: color .15s; }
.nav-item:hover .ico{ color: var(--text); }
.nav-item.active .ico{ color: var(--primary); }

/* ── WARNING BANNER ───────────────────────────── */
.warn-banner{
  background: var(--warning-bg);
  border-bottom: 1px solid #FDE68A;
  padding: 10px 24px;
  font-size: 13px;
  color: #B45309;
  display: flex; align-items: center; gap: 12px;
  font-weight: 500;
  animation: slide-down .3s ease;
}
.warn-close{
  margin-left: auto;
  background: transparent; border: none;
  color: #B45309; cursor: pointer;
  padding: 4px; border-radius: 6px;
  display: flex; align-items: center;
  transition: background .15s;
}
.warn-close:hover{ background: rgba(180,83,9,.1); }
@keyframes slide-down{ from{ transform: translateY(-100%); opacity: 0; } to{ transform: translateY(0); opacity: 1; } }

/* ── ENHANCED ANIMATIONS ───────────────────────────── */
.content-loaded > *{ animation: fade-up .5s ease backwards; }
.content-loaded > *:nth-child(1){ animation-delay: .05s; }
.content-loaded > *:nth-child(2){ animation-delay: .12s; }
.content-loaded > *:nth-child(3){ animation-delay: .19s; }
.content-loaded > *:nth-child(4){ animation-delay: .26s; }
.content-loaded > *:nth-child(5){ animation-delay: .33s; }
@keyframes fade-up{
  from{ opacity: 0; transform: translateY(12px); }
  to{ opacity: 1; transform: translateY(0); }
}

.grid4 > *, .grid3 > *, .grid2 > *{
  animation: fade-in-stagger .4s ease backwards;
}
.grid4 > *:nth-child(1), .grid3 > *:nth-child(1), .grid2 > *:nth-child(1){ animation-delay: .05s; }
.grid4 > *:nth-child(2), .grid3 > *:nth-child(2), .grid2 > *:nth-child(2){ animation-delay: .12s; }
.grid4 > *:nth-child(3), .grid3 > *:nth-child(3){ animation-delay: .19s; }
.grid4 > *:nth-child(4){ animation-delay: .26s; }
@keyframes fade-in-stagger{
  from{ opacity: 0; transform: scale(.96) translateY(8px); }
  to{ opacity: 1; transform: scale(1) translateY(0); }
}

/* Card hover lift */
.card{ transition: all .25s cubic-bezier(.4,0,.2,1); }
.card:hover{ transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-card{ transition: all .3s cubic-bezier(.4,0,.2,1); }
.stat-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(15,23,42,.08), 0 4px 8px rgba(15,23,42,.04);
}
.stat-card .stat-value{
  display: inline-block;
  animation: counter-pop .6s cubic-bezier(.34,1.56,.64,1) backwards;
  animation-delay: .3s;
}
@keyframes counter-pop{
  from{ opacity: 0; transform: scale(.7); }
  to{ opacity: 1; transform: scale(1); }
}

/* Table row stagger */
tbody tr{ animation: row-in .35s ease backwards; }
tbody tr:nth-child(1){ animation-delay: .05s; }
tbody tr:nth-child(2){ animation-delay: .1s; }
tbody tr:nth-child(3){ animation-delay: .15s; }
tbody tr:nth-child(4){ animation-delay: .2s; }
tbody tr:nth-child(5){ animation-delay: .25s; }
tbody tr:nth-child(n+6){ animation-delay: .3s; }
@keyframes row-in{ from{ opacity: 0; transform: translateX(-8px); } to{ opacity: 1; transform: translateX(0); } }

/* Buttons - more dynamic */
.btn{ position: relative; overflow: hidden; }
.btn::after{
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,.3), transparent 60%);
  opacity: 0; transition: opacity .3s;
}
.btn:hover::after{ opacity: 1; }
.btn-primary{ box-shadow: 0 1px 2px rgba(79,70,229,.3), 0 0 0 0 rgba(79,70,229,.4); }
.btn-primary:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(79,70,229,.3), 0 0 0 4px rgba(79,70,229,.08);
}

/* Tag hover */
.tag{ transition: all .15s; }
a .tag:hover, .tag:hover{ transform: scale(1.05); }

/* ── TOASTS (Alpine driven) ───────────────────────────── */
.toast-container{
  position: fixed; top: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast{
  pointer-events: auto;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  border: 1px solid;
  min-width: 280px;
  display: flex; align-items: center; gap: 10px;
  backdrop-filter: blur(8px);
}
.toast-ok{ background: rgba(236,253,245,.95); color: #047857; border-color: #A7F3D0; }
.toast-err{ background: rgba(254,242,242,.95); color: #B91C1C; border-color: #FECACA; }
.toast-enter{ animation: toast-in .35s cubic-bezier(.34,1.56,.64,1); }
.toast-leave{ animation: toast-out .25s ease forwards; }
@keyframes toast-in{
  from{ opacity: 0; transform: translateX(60px) scale(.9); }
  to{ opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out{
  to{ opacity: 0; transform: translateX(40px); }
}

/* ── NAV ITEM HOVER ENHANCEMENT ───────────────────────────── */
.nav-item{ position: relative; }
.nav-item::before{
  content: ''; position: absolute; left: 0; top: 50%;
  width: 3px; height: 0;
  background: var(--primary); border-radius: 0 3px 3px 0;
  transform: translateY(-50%);
  transition: height .2s;
}
.nav-item.active::before{ height: 60%; }
.nav-item:hover{ transform: translateX(2px); }
.nav-item.active{ transform: translateX(0); }

/* ── TOPBAR API CHIPS ───────────────────────────── */
.api-chip{ transition: all .2s; }
.api-chip:hover{ transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* ── MODAL ENHANCED ───────────────────────────── */
.modal{
  animation: modal-in .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modal-in{
  from{ opacity: 0; transform: translateY(30px) scale(.95); }
  to{ opacity: 1; transform: translateY(0) scale(1); }
}

/* ── PAGE HEADER ───────────────────────────── */
.page-header{
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 16px;
}
.page-header h1{
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.025em;
  display: flex; align-items: center; gap: 10px;
}
.page-header h1 .ico-lg{ color: var(--primary); }
.page-actions{ display: flex; gap: 8px; align-items: center; }

/* ── EMPTY STATE ───────────────────────────── */
.empty-state{
  text-align: center; padding: 48px 24px;
  color: var(--text-3);
}
.empty-state .ico-xl{
  margin: 0 auto 12px; color: var(--text-3); display: block;
}
.empty-state-title{
  font-size: 14px; font-weight: 600; color: var(--text-2);
  margin-bottom: 4px;
}

/* ── FILTER PILLS ───────────────────────────── */
.filter-pills{ display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill{
  padding: 6px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer;
  transition: all .2s; text-decoration: none;
}
.filter-pill:hover{ border-color: var(--primary); color: var(--primary); }
.filter-pill.active{
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 2px 6px rgba(79,70,229,.25);
}

/* Drop zone active state */
.drop-zone:hover{ border-color: var(--primary) !important; background: var(--primary-light) !important; }
.drop-zone-active{
  border-color: var(--primary) !important;
  background: var(--primary-soft) !important;
  transform: scale(1.01);
}
.drop-zone-active i{ color: var(--primary) !important; }

/* Smooth scroll */
*{ scroll-behavior: smooth; }
::selection{ background: var(--primary-soft); color: var(--primary); }

/* Prevent emoji rendering (just in case any slip through) */
body, button, input, select, textarea{
  font-feature-settings: "tnum" 1, "ss01" 1;
}

/* ===================================================== */
/*  APPLE STYLE OVERRIDE                                  */
/* ===================================================== */
:root {
  --bg: #F2F2F7;
  --surface: #FFFFFF;
  --surface-2: #F5F5F7;
  --surface-3: #FAFAFC;
  --text: #1D1D1F;
  --text-2: #424245;
  --text-3: #86868B;
  --primary: #007AFF;
  --primary-hover: #0051D5;
  --primary-light: #E7F0FF;
  --primary-soft: #CFE0FF;
  --accent: #34C759;
  --accent-light: #E6FAEC;
  --success: #34C759;
  --success-bg: #E6FAEC;
  --warning: #FF9500;
  --warning-bg: #FFF4E5;
  --danger: #FF3B30;
  --danger-bg: #FFEAE8;
  --info: #5AC8FA;
  --info-bg: #E6F7FF;
  --border: rgba(60,60,67,.12);
  --border-2: rgba(60,60,67,.2);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 2px 8px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 6px 16px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.08), 0 4px 8px rgba(0,0,0,.04);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif !important;
  letter-spacing: -0.01em;
  background: var(--bg) !important;
}
h1, h2, h3, h4 {
  letter-spacing: -0.025em !important;
  font-weight: 600 !important;
}
.card {
  border-radius: 16px !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow) !important;
  background: var(--surface) !important;
}
.topbar {
  background: rgba(255,255,255,0.72) !important;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border) !important;
  box-shadow: none !important;
}
.logo-name .l1 {
  color: var(--text) !important;
  font-weight: 700 !important;
}
.btn {
  border-radius: 10px !important;
  font-weight: 500 !important;
  letter-spacing: -0.005em;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-primary {
  background: var(--primary) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 1px 2px rgba(0,122,255,0.3);
}
.btn-primary:hover {
  background: var(--primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,122,255,0.35);
}
.btn-secondary {
  background: var(--surface-2) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
}
.btn-secondary:hover {
  background: #EBEBF0 !important;
  transform: translateY(-1px);
}
.fi {
  border-radius: 10px !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  font-size: 15px !important;
  padding: 10px 14px !important;
  transition: all 0.15s ease;
  font-family: inherit;
}
.fi:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px rgba(0,122,255,0.12);
  outline: none;
}
.fl {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--text-2) !important;
  letter-spacing: -0.005em;
  margin-bottom: 6px;
  display: block;
}
.stat-card {
  border-radius: 16px !important;
  border: 1px solid var(--border) !important;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-3) 100%) !important;
  box-shadow: var(--shadow) !important;
}
.stat-card .stat-value {
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
}
table {
  border-radius: 12px;
  overflow: hidden;
  border-collapse: separate !important;
  border-spacing: 0;
}
table thead {
  background: var(--surface-2) !important;
}
table th {
  font-weight: 600 !important;
  color: var(--text-2) !important;
  font-size: 11px !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px !important;
}
table tbody tr {
  transition: background 0.12s ease;
}
table tbody tr:hover {
  background: var(--surface-2) !important;
}
table td {
  padding: 12px !important;
  border-bottom: 1px solid var(--border) !important;
}
.tag {
  border-radius: 8px !important;
  font-weight: 500 !important;
  font-size: 11px !important;
  letter-spacing: -0.005em;
  padding: 3px 8px !important;
}
.page-header h1 {
  font-size: 28px !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
}
.notif-panel {
  border-radius: 14px !important;
  background: rgba(255,255,255,0.92) !important;
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  box-shadow: 0 20px 50px rgba(0,0,0,.12), 0 6px 16px rgba(0,0,0,.06) !important;
  border: 1px solid var(--border) !important;
}
.api-chip {
  border-radius: 999px !important;
  padding: 4px 10px !important;
  font-weight: 500 !important;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 10px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.25);
}
* {
  -webkit-tap-highlight-color: transparent;
}
a, button {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================================== */
/*  APPLE DYNAMIC ANIMATIONS                              */
/* ===================================================== */

/* Easing courbes Apple */
:root {
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring: cubic-bezier(0.5, 1.5, 0.5, 1);
}

/* Card hover lift */
.card {
  transition: transform 0.3s var(--ease-out-quint), box-shadow 0.3s var(--ease-out-quint) !important;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg) !important;
}

/* Stat card spring hover */
.stat-card {
  transition: transform 0.4s var(--ease-out-back), box-shadow 0.3s ease !important;
  cursor: default;
}
.stat-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--shadow-lg) !important;
}
.stat-card .stat-value {
  transition: transform 0.3s var(--ease-out-back);
}
.stat-card:hover .stat-value {
  transform: scale(1.05);
}

/* Buttons : press effect + ripple feel */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.15s var(--ease-spring), background 0.2s ease, box-shadow 0.25s ease !important;
}
.btn:active {
  transform: scale(0.96) !important;
  transition: transform 0.08s ease !important;
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s ease;
}
.btn-primary:hover::before {
  left: 100%;
}

/* Input focus glow expansion */
.fi {
  transition: border-color 0.2s ease, box-shadow 0.25s var(--ease-out-quint), transform 0.2s ease !important;
}
.fi:focus {
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgba(0,122,255,0.15), 0 4px 12px rgba(0,122,255,0.08) !important;
}

/* Page entrance : fade-in + slide up */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-header, .card, .stat-card, .grid2, .grid3 {
  animation: pageIn 0.5s var(--ease-out-quint) backwards;
}
.page-header { animation-delay: 0.0s; }
.grid3 > *, .grid2 > * {
  animation: pageIn 0.5s var(--ease-out-quint) backwards;
}
.grid3 > *:nth-child(1), .grid2 > *:nth-child(1) { animation-delay: 0.05s; }
.grid3 > *:nth-child(2), .grid2 > *:nth-child(2) { animation-delay: 0.1s; }
.grid3 > *:nth-child(3), .grid2 > *:nth-child(3) { animation-delay: 0.15s; }
.grid3 > *:nth-child(4), .grid2 > *:nth-child(4) { animation-delay: 0.2s; }
.card { animation-delay: 0.2s; }

/* Table rows : stagger reveal */
@keyframes rowIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
table tbody tr {
  animation: rowIn 0.35s var(--ease-out-quint) backwards;
}
table tbody tr:nth-child(1) { animation-delay: 0.03s; }
table tbody tr:nth-child(2) { animation-delay: 0.06s; }
table tbody tr:nth-child(3) { animation-delay: 0.09s; }
table tbody tr:nth-child(4) { animation-delay: 0.12s; }
table tbody tr:nth-child(5) { animation-delay: 0.15s; }
table tbody tr:nth-child(6) { animation-delay: 0.18s; }
table tbody tr:nth-child(7) { animation-delay: 0.21s; }
table tbody tr:nth-child(8) { animation-delay: 0.24s; }
table tbody tr:nth-child(9) { animation-delay: 0.27s; }
table tbody tr:nth-child(n+10) { animation-delay: 0.3s; }

table tbody tr {
  transition: background 0.15s ease, transform 0.2s var(--ease-out-quint) !important;
}
table tbody tr:hover {
  transform: translateX(2px);
}

/* Tags : pulse soft */
.tag {
  transition: transform 0.2s var(--ease-out-back), box-shadow 0.2s ease !important;
}
.tag:hover {
  transform: scale(1.05);
}
.tag.tlive, .tag.tg {
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,199,89,0.3); }
  50%      { box-shadow: 0 0 0 6px rgba(52,199,89,0); }
}

/* Topbar : slide down on load */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: translateY(0); }
}
.topbar {
  animation: slideDown 0.5s var(--ease-out-quint);
}

/* Sidebar items hover */
nav a, .sidebar a, aside a {
  transition: background 0.2s ease, transform 0.2s var(--ease-out-quint), color 0.2s ease !important;
}
nav a:hover, .sidebar a:hover, aside a:hover {
  transform: translateX(3px);
}

/* Notification bell : ring on hover */
.notif-bell-btn {
  transition: transform 0.3s var(--ease-out-back), background 0.2s ease !important;
}
.notif-bell-btn:hover {
  transform: rotate(-8deg) scale(1.08);
}
.notif-bell-badge {
  animation: badgePulse 1.5s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}

/* Notif panel : drop with bounce */
.notif-panel {
  animation: dropBounce 0.35s var(--ease-out-back);
  transform-origin: top right;
}
@keyframes dropBounce {
  from { opacity: 0; transform: scale(0.92) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Logo subtle breathing */
.logo-name .l1 {
  background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: filter 0.3s ease;
}
.logo-name:hover .l1 {
  filter: brightness(1.2);
}

/* Skeleton shimmer pour les chargements */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton, .loading-row {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* Modal/dialog spring entrance */
.modal, [role="dialog"], dialog {
  animation: modalIn 0.4s var(--ease-out-back);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Toasts (toast top-right slide) */
.toast, [x-show="toast"], [x-show="toastErr"] {
  animation: toastSlide 0.4s var(--ease-out-back);
}
@keyframes toastSlide {
  from { opacity: 0; transform: translateX(40px) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* Reduce motion accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01s !important;
    transition-duration: 0.01s !important;
  }
}

/* Page prospection : desactiver animations sur les rows pour eviter lag avec 50+ prospects */
.page-header + .modal-overlay + .card table tbody tr,
.card:has(.card-title:contains("Mes prospects")) table tbody tr {
  animation: none !important;
  transition: background 0.1s ease !important;
}
.card:has(.card-title:contains("Mes prospects")) table tbody tr:hover {
  transform: none !important;
}

/* ===================================================== */
/*  RESPONSIVE — Tablet & Mobile                          */
/* ===================================================== */

.mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text-2);
  margin-right: 4px;
  align-items: center;
  justify-content: center;
}
.mobile-toggle:hover { background: var(--surface-2); color: var(--text); }

body.sidebar-open::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 100;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== Tablet portrait & small desktop (≤1180px) ===== */
@media (max-width: 1180px) {
  .api-chip { display: none; }
  .search-box { width: 180px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}

/* ===== Tablet (≤1024px) ===== */
@media (max-width: 1024px) {
  .topbar { padding: 0 14px; gap: 10px; height: 60px; }
  .search-box { width: 150px; font-size: 12px; }
  .sidebar { width: 200px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 24px; }
  .modal { max-width: 90vw !important; }
  .card table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .card table thead, .card table tbody { display: table; width: 100%; min-width: max-content; }
  .user-pill .tag { display: none; }
}

/* ===== Mobile (≤768px) ===== */
@media (max-width: 768px) {
  .mobile-toggle { display: inline-flex; }

  .topbar {
    padding: 0 10px;
    gap: 6px;
    height: 56px;
  }
  .topbar-sep,
  .page-title,
  .search-box,
  .topbar form[action*="clients"] {
    display: none !important;
  }
  .logo-name .l2 { display: none; }
  .logo-name .l1 { font-size: 16px; }
  .logo-name img { height: 34px !important; width: 34px !important; }
  .logo-name { gap: 6px !important; }

  .user-pill {
    padding: 4px 8px;
    font-size: 12px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .logout-btn { padding: 6px 8px; }
  .logout-btn span { display: none; }
  .logout-btn i { margin-right: 0 !important; }

  .sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 6px 0 24px rgba(0,0,0,.2);
    overflow-y: auto;
    background: var(--surface);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }

  .content { padding: 12px; }

  .grid2, .grid3 {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .modal [style*="grid-template-columns:1fr 1fr"],
  .modal [style*="grid-template-columns:2fr 1fr"],
  .modal [style*="grid-template-columns:1fr 2fr"],
  .card [style*="grid-template-columns:1fr 1fr"],
  .card [style*="grid-template-columns:2fr 1fr"],
  .card [style*="grid-template-columns:1fr 2fr"],
  .card [style*="grid-template-columns:2fr 1fr 1fr"],
  form [style*="grid-template-columns:2fr 1fr 1fr auto"] {
    grid-template-columns: 1fr !important;
  }

  .card { padding: 14px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 22px; }

  .page-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px;
  }
  .page-header h1 { font-size: 18px; line-height: 1.3; }
  .page-header > div:last-child,
  .page-header .page-actions {
    width: 100%;
    display: flex !important;
    flex-wrap: wrap;
  }

  .modal-overlay { padding: 6px; align-items: flex-start !important; padding-top: 12px !important; }
  .modal {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 94vh !important;
    overflow-y: auto;
  }

  .btn { padding: 8px 12px; font-size: 12px; }
  .fi { font-size: 14px; padding: 9px 11px; }

  .filter-pills, .filter-pill { font-size: 11px; padding: 4px 10px; }

  /* Barre d'action bulk : full width sticky bottom */
  [style*="position:fixed;bottom:24px"][style*="min-width:720px"],
  [style*="position:fixed;bottom:20px"] {
    min-width: calc(100vw - 12px) !important;
    width: calc(100vw - 12px) !important;
    left: 6px !important;
    right: 6px !important;
    transform: none !important;
    bottom: 8px !important;
    padding: 12px !important;
    border-radius: 14px !important;
  }
  [style*="position:fixed;bottom:24px"] > div:first-child,
  [style*="position:fixed;bottom:20px"] > div:first-child {
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px !important;
  }
  [style*="position:fixed;bottom:24px"] form,
  [style*="position:fixed;bottom:20px"] form {
    width: 100% !important;
    justify-content: space-between;
  }

  .notif-panel {
    width: calc(100vw - 16px);
    right: 8px;
  }

  .warn-banner {
    flex-wrap: wrap;
    padding: 10px 12px;
    font-size: 12px;
  }
  .warn-banner span { width: 100%; }
}

/* ===== Small mobile (≤480px) ===== */
@media (max-width: 480px) {
  .topbar { height: 52px; gap: 4px; }
  .logo-name .l1 { font-size: 14px; }
  .stat-value { font-size: 20px; }
  .card { padding: 10px; }
  .content { padding: 8px; }
  .user-pill { display: none; }
  .page-header h1 { font-size: 16px; }
  .card table { font-size: 12px; }
  .card table th, .card table td { padding: 6px 8px; }
  .modal .card-title { font-size: 14px; }
  .modal-overlay { padding-top: 6px !important; }
  .stat-card { padding: 10px; }
}

/* ===== Touch-friendly ===== */
@media (hover: none) and (pointer: coarse) {
  .btn, .filter-pill, .nav-item, button {
    min-height: 40px;
  }
  .card table tbody tr { min-height: 44px; }
}

/* ===== Landscape phone ===== */
@media (max-width: 920px) and (orientation: landscape) and (max-height: 600px) {
  .modal { max-height: 88vh !important; }
  .topbar { height: 50px; }
  .sidebar { top: 50px; }
}

/* ===================================================== */
/*  MODE APP (commerciaux) — pas de sidebar, look mobile  */
/* ===================================================== */

body.role-commercial .sidebar { display: none !important; }
body.role-commercial .content {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
body.role-commercial .topbar .api-chip { display: none; }
body.role-commercial .topbar .search-box { display: none; }
body.role-commercial .topbar form[action*="clients"] { display: none; }
body.role-commercial .topbar .topbar-sep { display: none; }
body.role-commercial .topbar .page-title { display: none; }
body.role-commercial .mobile-toggle { display: none !important; }

/* Logo cliquable visible comme un bouton home */
body.role-commercial .logo-name {
  cursor: pointer;
  transition: opacity 0.2s;
}
body.role-commercial .logo-name:hover { opacity: 0.7; }

/* Bouton home floating en bas a droite sur les pages d'app */
body.role-commercial:not(.launcher-mode) .content::after {
  content: '';
}
.home-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #4338CA);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
  text-decoration: none;
  z-index: 1000;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
body.role-commercial:not(.launcher-mode) .home-fab {
  display: flex;
}
.home-fab:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.5);
}
.home-fab:active { transform: scale(0.95); }

/* Pour admin/tech qui basculent en mode launcher : meme effet */
body.launcher-mode .sidebar { display: none !important; }
body.launcher-mode .topbar .api-chip,
body.launcher-mode .topbar .search-box,
body.launcher-mode .topbar form[action*="clients"],
body.launcher-mode .topbar .topbar-sep,
body.launcher-mode .topbar .page-title { display: none; }


/* ===================================================== */

/* ===================================================== */

/* ===================================================== */
/*  WALLPAPERS (fond uniquement, UI reste opaque)         */
/* ===================================================== */

body.wallpaper-default { background: var(--bg) !important; }
body.wallpaper-blue { background: linear-gradient(135deg,#667eea 0%,#764ba2 100%) fixed !important; }
body.wallpaper-sunset { background: linear-gradient(135deg,#fa709a 0%,#fee140 100%) fixed !important; }
body.wallpaper-ocean { background: linear-gradient(135deg,#4facfe 0%,#00f2fe 100%) fixed !important; }
body.wallpaper-forest { background: linear-gradient(135deg,#43e97b 0%,#38f9d7 100%) fixed !important; }
body.wallpaper-night { background: linear-gradient(135deg,#30cfd0 0%,#330867 100%) fixed !important; }
body.wallpaper-warm { background: linear-gradient(135deg,#f6d365 0%,#fda085 100%) fixed !important; }
body.wallpaper-purple { background: linear-gradient(135deg,#a8edea 0%,#fed6e3 100%) fixed !important; }
body.wallpaper-mint { background: linear-gradient(135deg,#84fab0 0%,#8fd3f4 100%) fixed !important; }
body.wallpaper-coral { background: linear-gradient(135deg,#ff9a9e 0%,#fad0c4 100%) fixed !important; }
body.wallpaper-dark { background: linear-gradient(135deg,#1f2937 0%,#111827 100%) fixed !important; }
body.wallpaper-rose { background: linear-gradient(135deg,#fbc2eb 0%,#a6c1ee 100%) fixed !important; }
body.wallpaper-aurora { background: linear-gradient(135deg,#74ebd5 0%,#9face6 100%) fixed !important; }

/* UI reste opaque sur tous les fonds */
body[class*="wallpaper-"]:not(.wallpaper-default) .topbar,
body[class*="wallpaper-"]:not(.wallpaper-default) .sidebar,
body[class*="wallpaper-"]:not(.wallpaper-default) .card,
body[class*="wallpaper-"]:not(.wallpaper-default) .stat-card,
body[class*="wallpaper-"]:not(.wallpaper-default) .modal,
body[class*="wallpaper-"]:not(.wallpaper-default) .launcher-tile {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
}
body[class*="wallpaper-"]:not(.wallpaper-default) .launcher-tile-name { color: var(--text) !important; }

/* Texte directement sur le fond (greeting launcher) - adapte selon clair/sombre */
body.wallpaper-blue .launcher-hello,
body.wallpaper-night .launcher-hello,
body.wallpaper-dark .launcher-hello {
  color:#fff !important; text-shadow:0 2px 8px rgba(0,0,0,.3);
}
body.wallpaper-blue .launcher-date,
body.wallpaper-night .launcher-date,
body.wallpaper-dark .launcher-date {
  color:rgba(255,255,255,.85) !important;
}
body.wallpaper-sunset .launcher-hello,
body.wallpaper-ocean .launcher-hello,
body.wallpaper-forest .launcher-hello,
body.wallpaper-warm .launcher-hello,
body.wallpaper-purple .launcher-hello,
body.wallpaper-mint .launcher-hello,
body.wallpaper-coral .launcher-hello,
body.wallpaper-rose .launcher-hello,
body.wallpaper-aurora .launcher-hello {
  color:#1f2937 !important; text-shadow:0 1px 3px rgba(255,255,255,.5);
}

/* Bouton palette flottant */
.wallpaper-picker-btn {
  position: fixed; top: 80px; right: 20px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-2); box-shadow: 0 4px 12px rgba(0,0,0,.15);
  z-index: 50; transition: all .2s;
}
.wallpaper-picker-btn:hover { transform: scale(1.08); }

/* Grille thumbs */
.wallpapers-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.wallpaper-thumb {
  aspect-ratio: 1; border-radius: 14px; cursor: pointer;
  border: 3px solid transparent; transition: all .2s;
}
.wallpaper-thumb:hover { transform: scale(1.05); }
.wallpaper-thumb.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}
.wallpaper-thumb-default { background: #f7f8fb; border: 1px solid var(--border); }
.wallpaper-thumb-blue { background: linear-gradient(135deg,#667eea,#764ba2); }
.wallpaper-thumb-sunset { background: linear-gradient(135deg,#fa709a,#fee140); }
.wallpaper-thumb-ocean { background: linear-gradient(135deg,#4facfe,#00f2fe); }
.wallpaper-thumb-forest { background: linear-gradient(135deg,#43e97b,#38f9d7); }
.wallpaper-thumb-night { background: linear-gradient(135deg,#30cfd0,#330867); }
.wallpaper-thumb-warm { background: linear-gradient(135deg,#f6d365,#fda085); }
.wallpaper-thumb-purple { background: linear-gradient(135deg,#a8edea,#fed6e3); }
.wallpaper-thumb-mint { background: linear-gradient(135deg,#84fab0,#8fd3f4); }
.wallpaper-thumb-coral { background: linear-gradient(135deg,#ff9a9e,#fad0c4); }
.wallpaper-thumb-dark { background: linear-gradient(135deg,#1f2937,#111827); }
.wallpaper-thumb-rose { background: linear-gradient(135deg,#fbc2eb,#a6c1ee); }
.wallpaper-thumb-aurora { background: linear-gradient(135deg,#74ebd5,#9face6); }
