/* =========================================================================
   Estibill — app-shell design system
   Mobile-first, app-style UI. Deep indigo + purple primary, teal accent
   for totals/success, dark navy ink, light grey/white surfaces. Built to
   feel like a native app (large touch targets, bottom nav, card-based
   lists) and to be WebView-ready.
   ========================================================================= */

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

:root{
  --eb-primary:#2F38D9;
  --eb-primary-2:#5B4DF7;
  --eb-primary-dark:#242DB0;
  --eb-primary-light:#EEF0FD;
  --eb-accent:#12B8A6;
  --eb-accent-light:#E4F9F6;
  --eb-danger:#DC2626;
  --eb-danger-light:#FEF2F2;
  --eb-warn:#D97706;
  --eb-warn-light:#FFFBEB;
  --eb-ink:#172033;
  --eb-ink-soft:#5B6478;
  --eb-ink-faint:#9CA3B4;
  --eb-bg:#F6F8FC;
  --eb-card:#FFFFFF;
  --eb-border:#E8EAF3;
  --eb-radius:18px;
  --eb-radius-sm:12px;
  --eb-shadow:0 2px 10px rgba(23,32,51,.06), 0 1px 2px rgba(23,32,51,.04);
  --eb-shadow-lg:0 14px 32px rgba(47,56,217,.20);
  --eb-topbar-h:60px;
  --eb-bottomnav-h:76px;
  --eb-font: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body.estibill-body{
  font-family:var(--eb-font);
  background:var(--eb-bg);
  color:var(--eb-ink);
  -webkit-font-smoothing:antialiased;
  -webkit-tap-highlight-color:transparent;
  overscroll-behavior-y:contain;
  overflow-wrap:break-word;
  word-break:break-word;
}
a{color:inherit;text-decoration:none;}
button{font-family:inherit;}
input,select,textarea{font-family:inherit;}

/* ---------- Layout shells ---------- */
.eb-app{min-height:100vh;display:flex;flex-direction:column;}
.eb-topbar{
  position:sticky;top:0;z-index:40;
  height:var(--eb-topbar-h);
  background:var(--eb-primary);
  color:#fff;
  display:flex;align-items:center;gap:10px;
  padding:0 14px;
  box-shadow:0 2px 10px rgba(47,56,217,.25);
}
.eb-topbar__back{
  width:36px;height:36px;border-radius:10px;background:rgba(255,255,255,.14);
  display:flex;align-items:center;justify-content:center;border:0;color:#fff;flex-shrink:0;
}
.eb-topbar__title{font-size:17px;font-weight:700;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.eb-topbar__logo{
  width:34px;height:34px;object-fit:contain;flex-shrink:0;margin-right:2px;
  padding:7px;background:#fff;border-radius:7px;
  box-shadow:0 2px 8px rgba(8,33,91,.16);
}
.eb-topbar__action{
  width:36px;height:36px;border-radius:10px;background:rgba(255,255,255,.14);
  display:flex;align-items:center;justify-content:center;border:0;color:#fff;flex-shrink:0;
}

.eb-main{flex:1;padding:16px 14px calc(var(--eb-bottomnav-h) + 66px + env(safe-area-inset-bottom));max-width:720px;margin:0 auto;width:100%;}
.eb-main--auth{max-width:460px;padding:0 14px 24px;display:block;min-height:100vh;}
.eb-main--no-bottomnav{padding-bottom:24px;max-width:980px;}

/* ---------- Premium floating bottom navigation ----------
   Four equal navigation slots + a dedicated fixed-width centre slot for
   the primary + action. This prevents the active tab from ever touching
   or overlapping the FAB on narrow phones while retaining the approved
   floating premium-dock look. */
.eb-bottomnav{
  position:fixed;
  left:14px;right:14px;
  bottom:max(10px, env(safe-area-inset-bottom));
  z-index:40;
  width:auto;max-width:620px;
  height:var(--eb-bottomnav-h);
  margin:0 auto;
  background:rgba(255,255,255,.97);
  border:1px solid rgba(86,73,220,.12);
  border-radius:30px;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) 72px minmax(0,1fr) minmax(0,1fr);
  align-items:center;
  gap:4px;
  padding:8px 9px;
  box-shadow:0 14px 38px rgba(58,52,168,.16),0 4px 14px rgba(23,32,51,.07);
  -webkit-backdrop-filter:blur(16px);
  backdrop-filter:blur(16px);
}
.eb-bottomnav a{
  position:relative;
  grid-row:1;
  min-width:0;width:100%;height:58px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  color:#8C95A8;font-size:10.5px;font-weight:600;line-height:1;
  border-radius:20px;
  transition:color .18s ease,background .18s ease,transform .16s ease,box-shadow .18s ease;
}
.eb-bottomnav a:nth-child(1){grid-column:1;}
.eb-bottomnav a:nth-child(2){grid-column:2;}
.eb-bottomnav a:nth-child(4){grid-column:4;}
.eb-bottomnav a:nth-child(5){grid-column:5;}
.eb-bottomnav a:not(.eb-bottomnav__fab) svg{
  width:26px;height:26px;padding:0;
  border-radius:0;background:transparent;
  transition:color .18s ease,transform .16s ease;
}
.eb-bottomnav a:not(.eb-bottomnav__fab):active{transform:scale(.96);}
.eb-bottomnav a.is-active{
  color:#fff;
  background:linear-gradient(145deg,#3137F2 0%,#5A35F1 58%,#743AF0 100%);
  box-shadow:0 8px 20px rgba(75,55,235,.27),inset 0 1px 0 rgba(255,255,255,.20);
  transform:translateY(-1px);
  font-weight:700;
}
.eb-bottomnav a.is-active svg{
  color:#fff;background:transparent!important;transform:scale(1.04);
}
.eb-bottomnav__fab{
  grid-column:3;
  justify-self:center;
  align-self:start;
  width:62px!important;height:62px!important;
  min-width:62px!important;
  border-radius:50%!important;
  background:linear-gradient(145deg,#2256F5 0%,#4035F2 52%,#812FF0 100%);
  color:#fff;
  display:flex!important;align-items:center!important;justify-content:center!important;
  margin:-31px 0 0!important;
  padding:0!important;
  border:4px solid #fff;
  box-shadow:0 11px 25px rgba(71,51,235,.31),0 0 0 2px rgba(108,86,255,.13),0 4px 10px rgba(23,32,51,.09);
  transition:transform .16s ease,box-shadow .18s ease;
  overflow:visible;
}
.eb-bottomnav__fab::before{
  content:"";position:absolute;inset:-7px;border-radius:50%;
  border:1.5px solid rgba(102,78,248,.19);
  box-shadow:0 0 0 3px rgba(108,86,255,.045);
  pointer-events:none;
}
.eb-bottomnav__fab::after{
  content:"";position:absolute;inset:5px;border-radius:50%;
  border:1px solid rgba(255,255,255,.25);pointer-events:none;
}
.eb-bottomnav__fab:active{
  transform:translateY(2px) scale(.95);
  box-shadow:0 7px 18px rgba(71,51,235,.25),0 0 0 2px rgba(108,86,255,.10);
}
.eb-bottomnav__fab svg{width:29px!important;height:29px!important;flex:0 0 auto;}

@media (max-width:380px){
  .eb-bottomnav{
    left:7px;right:7px;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) 64px minmax(0,1fr) minmax(0,1fr);
    gap:2px;padding-left:6px;padding-right:6px;border-radius:27px;
  }
  .eb-bottomnav a{height:56px;font-size:9.5px;border-radius:18px;gap:3px;}
  .eb-bottomnav a:not(.eb-bottomnav__fab) svg{width:24px;height:24px;}
  .eb-bottomnav__fab{
    width:56px!important;height:56px!important;min-width:56px!important;
    margin-top:-27px!important;border-width:4px;
  }
  .eb-bottomnav__fab::before{inset:-6px;}
  .eb-bottomnav__fab svg{width:27px!important;height:27px!important;}
}

@media (min-width:760px){
  .eb-bottomnav{bottom:16px;}
}

/* ---------- Cards / surfaces ---------- */
.eb-card{background:var(--eb-card);border-radius:var(--eb-radius);box-shadow:var(--eb-shadow);padding:18px;margin-bottom:14px;}
.eb-card--flush{padding:0;overflow:hidden;}
.eb-section-title{font-size:13px;font-weight:700;color:var(--eb-ink-soft);text-transform:uppercase;letter-spacing:.04em;margin:20px 2px 10px;}
.eb-section-title:first-child{margin-top:0;}

/* ---------- Buttons ---------- */
.eb-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:48px;padding:0 20px;border-radius:12px;font-size:15px;font-weight:700;
  border:0;cursor:pointer;transition:transform .08s ease, opacity .15s ease;width:100%;
}
.eb-btn:active{transform:scale(.98);}
.eb-btn:disabled{opacity:.55;cursor:not-allowed;}
.eb-btn--primary{background:var(--eb-primary);color:#fff;}
.eb-btn--accent{background:var(--eb-accent);color:#fff;}
.eb-btn--ghost{background:var(--eb-primary-light);color:var(--eb-primary);}
.eb-btn--outline{background:#fff;color:var(--eb-ink);border:1.5px solid var(--eb-border);}
.eb-btn--danger{background:var(--eb-danger-light);color:var(--eb-danger);}
.eb-btn--sm{min-height:38px;padding:0 14px;font-size:13.5px;width:auto;}
.eb-btn--icon{width:44px;padding:0;flex:0 0 44px;}
.eb-btn-row{display:flex;gap:10px;}
.eb-btn-row .eb-btn{flex:1;}

/* ---------- Forms ---------- */
.eb-field{margin-bottom:14px;}
.eb-label{display:block;font-size:13px;font-weight:600;color:var(--eb-ink-soft);margin-bottom:6px;}
.eb-input,.eb-select,.eb-textarea{
  width:100%;min-height:48px;padding:0 14px;border-radius:12px;border:1.5px solid var(--eb-border);
  font-size:15px;color:var(--eb-ink);background:#fff;
}
.eb-input:focus,.eb-select:focus,.eb-textarea:focus{outline:none;border-color:var(--eb-primary);}
.eb-textarea{min-height:90px;padding:12px 14px;resize:vertical;}
.eb-checkbox-row{display:flex;align-items:center;gap:10px;min-height:44px;}
.eb-checkbox-row input{width:20px;height:20px;accent-color:var(--eb-primary);}
.eb-help{font-size:12.5px;color:var(--eb-ink-faint);margin-top:5px;}
.eb-error-text{font-size:12.5px;color:var(--eb-danger);margin-top:5px;}
.eb-form-row2{display:grid;grid-template-columns:1fr 1fr;gap:12px;}

/* ---------- Auth screens ---------- */
.eb-auth-screen{position:relative;min-height:100vh;padding:28px 0 18px;overflow:hidden;}
.eb-auth-screen::before,
.eb-auth-screen::after{
  content:"";position:absolute;pointer-events:none;z-index:0;filter:blur(8px);
}
.eb-auth-screen::before{
  width:280px;height:280px;right:-110px;top:-40px;border-radius:50%;
  background:radial-gradient(circle at center, rgba(83,105,255,.42), rgba(83,105,255,0));
}
.eb-auth-screen::after{
  width:210px;height:210px;left:-90px;top:120px;border-radius:50%;
  background:radial-gradient(circle at center, rgba(120,87,255,.18), rgba(120,87,255,0));
}
.eb-auth-brand{position:relative;z-index:1;text-align:center;padding:20px 10px 18px;color:var(--eb-ink);}
.eb-auth-logo{width:64px;height:64px;display:block;object-fit:contain;margin:0 auto 18px;}
.eb-auth-logo--hero{width:78px;height:78px;margin-bottom:10px;filter:drop-shadow(0 10px 20px rgba(47,56,217,.20));}
.eb-auth-logo--full{width:156px;height:156px;object-fit:contain;margin-bottom:10px;filter:drop-shadow(0 10px 20px rgba(47,56,217,.12));}
.eb-auth-brand__name{font-size:15px;font-weight:700;color:var(--eb-primary);letter-spacing:.02em;}
.eb-auth-card{
  position:relative;z-index:1;background:rgba(255,255,255,.97);border:1px solid rgba(201,213,255,.72);
  border-radius:32px;padding:22px 18px 20px;box-shadow:0 24px 50px rgba(48,56,217,.14),0 8px 18px rgba(23,32,51,.07);
  backdrop-filter:blur(8px);
}
.eb-auth-title{font-size:26px;line-height:1.15;font-weight:800;text-align:center;margin:0 0 6px;color:#102B65;}
.eb-auth-sub{font-size:14.5px;color:var(--eb-ink-soft);text-align:center;margin:0 0 22px;line-height:1.55;}
.eb-auth-switch{text-align:center;font-size:14px;color:var(--eb-ink-soft);margin-top:18px;}
.eb-auth-switch a{color:var(--eb-primary);font-weight:700;}
.eb-auth-alert{
  display:flex;align-items:center;justify-content:center;text-align:center;
  border-radius:16px;padding:12px 14px;font-size:13px;font-weight:600;margin:0 0 16px;
}
.eb-auth-alert--danger{background:var(--eb-danger-light);color:var(--eb-danger);}
.eb-auth-alert--success{background:var(--eb-accent-light);color:var(--eb-accent);}
.eb-auth-input{position:relative;}
.eb-auth-input__icon{
  position:absolute;left:14px;top:50%;transform:translateY(-50%);color:#7F8DB0;
  width:22px;height:22px;display:flex;align-items:center;justify-content:center;pointer-events:none;
}
.eb-auth-input__icon svg,.eb-auth-eye svg{width:20px;height:20px;display:block;}
.eb-auth-input .eb-input{
  min-height:56px;padding-left:46px;padding-right:46px;border-radius:16px;border-color:#DCE4FA;
  background:#fff;box-shadow:inset 0 1px 0 rgba(255,255,255,.7);
}
.eb-auth-input .eb-input:focus{border-color:var(--eb-primary);box-shadow:0 0 0 4px rgba(47,56,217,.08);}
.eb-auth-eye{
  position:absolute;right:10px;top:50%;transform:translateY(-50%);border:0;background:transparent;
  color:#6E7DA2;width:32px;height:32px;border-radius:10px;display:flex;align-items:center;justify-content:center;
}
.eb-auth-eye.is-visible{color:var(--eb-primary);background:rgba(47,56,217,.06);}
.eb-auth-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:2px 0 16px;flex-wrap:wrap;}
.eb-auth-check{min-height:28px;gap:8px;margin:0;}
.eb-auth-check label{font-size:13.5px;color:var(--eb-ink-soft);}
.eb-auth-link{font-size:13px;font-weight:700;color:var(--eb-primary);}
.eb-auth-primary{
  min-height:56px;border-radius:16px;background:linear-gradient(135deg,#5B34F1 0%, #2F38D9 60%, #1E7DFF 100%);
  box-shadow:0 14px 26px rgba(47,56,217,.24);display:flex;justify-content:center;gap:10px;
}
.eb-auth-primary svg{width:18px;height:18px;flex:0 0 auto;}
.eb-auth-hints{display:flex;flex-wrap:wrap;gap:8px;margin:-2px 0 16px;}
.eb-auth-hints span{
  display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;
  background:#F4F7FF;color:#58709A;font-size:12px;font-weight:600;
}

/* ---------- Built-in PDF viewer ---------- */
.eb-pdf-viewer{display:flex;flex-direction:column;gap:12px;}
.eb-pdf-meta{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;}
.eb-pdf-meta__eyebrow{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--eb-primary);margin-bottom:4px;}
.eb-pdf-meta__title{font-size:20px;font-weight:800;color:#102B65;line-height:1.2;}
.eb-pdf-meta__sub{font-size:13.5px;color:var(--eb-ink-soft);margin-top:4px;}
.eb-pdf-meta__actions{display:flex;gap:8px;flex-wrap:wrap;}
.eb-pdf-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;}
.eb-pdf-toolbar__group{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.eb-pdf-toolbar__btn{
  min-width:48px;min-height:40px;padding:0 14px;border-radius:12px;border:1px solid var(--eb-border);
  background:#fff;color:var(--eb-ink);font-size:14px;font-weight:700;
}
.eb-pdf-toolbar__btn:disabled{opacity:.45;}
.eb-pdf-toolbar__status{min-width:74px;text-align:center;font-size:13px;font-weight:700;color:var(--eb-ink-soft);}
.eb-pdf-stage{
  position:relative;background:linear-gradient(180deg,#EEF2FA 0%, #E8EEF8 100%);border-radius:24px;
  padding:14px;border:1px solid #E0E8F7;min-height:68vh;box-shadow:var(--eb-shadow);
}
.eb-pdf-stage__loading,.eb-pdf-stage__error{
  display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;
  min-height:62vh;color:var(--eb-ink-soft);padding:26px 18px;line-height:1.6;
}
.eb-pdf-stage__loading{font-weight:700;}
.eb-pdf-stage__error strong{font-size:16px;color:var(--eb-ink);margin-bottom:6px;}
.eb-pdf-canvas-wrap{display:flex;justify-content:center;align-items:flex-start;min-height:62vh;overflow:auto;}
.eb-pdf-canvas-wrap canvas{max-width:100%;background:#fff;border-radius:10px;box-shadow:0 18px 32px rgba(23,32,51,.15);}

@media (max-width:520px){
  .eb-auth-screen{padding-top:20px;}
  .eb-auth-card{padding:20px 16px 18px;border-radius:28px;}
  .eb-auth-title{font-size:24px;}
  .eb-pdf-meta__actions,.eb-pdf-toolbar__group{width:100%;}
  .eb-pdf-meta__actions .eb-btn,.eb-pdf-toolbar__group .eb-pdf-toolbar__btn{flex:1;}
  .eb-pdf-toolbar__status{min-width:62px;flex:0 0 auto;}
}

/* ---------- Dashboard ---------- */
.eb-greet{font-size:20px;font-weight:800;margin:2px 0 2px;}
.eb-greet-sub{font-size:13.5px;color:var(--eb-ink-soft);margin:0 0 18px;}
.eb-greet-row{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-bottom:2px;}
.eb-greet-row .eb-greet{margin:0;}
.eb-premium-badge{display:inline-flex;align-items:center;gap:4px;padding:5px 9px;border-radius:999px;background:linear-gradient(135deg,#102B65,#1677F2);color:#fff;font-size:10.5px;font-weight:800;letter-spacing:.04em;box-shadow:0 4px 10px rgba(22,119,242,.18);white-space:nowrap;}
.eb-premium-card{display:flex;align-items:center;gap:12px;padding:15px 16px;margin-bottom:14px;border:1px solid #C9D8FF;border-radius:var(--eb-radius);background:linear-gradient(135deg,#F3F7FF 0%,#FFFFFF 72%);box-shadow:var(--eb-shadow);}
.eb-premium-card__icon{width:42px;height:42px;flex:0 0 42px;border-radius:13px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#102B65,#1677F2);color:#fff;font-size:20px;box-shadow:0 7px 16px rgba(22,119,242,.20);}
.eb-premium-card__body{min-width:0;flex:1;}
.eb-premium-card__title{font-size:15px;font-weight:800;color:#102B65;margin-bottom:3px;}
.eb-premium-card__meta{font-size:12px;color:var(--eb-ink-soft);line-height:1.55;}
.eb-premium-card__meta strong{color:var(--eb-ink);font-weight:700;}
.eb-premium-card__status{flex:0 0 auto;padding:5px 8px;border-radius:999px;background:#E7F9F5;color:#07917F;font-size:10px;font-weight:800;letter-spacing:.05em;}
.eb-premium-card.is-expired{border-color:#F4D5D5;background:#FFF8F8;}
.eb-premium-card.is-expired .eb-premium-card__icon{background:#9CA3AF;box-shadow:none;}
.eb-premium-card.is-expired .eb-premium-card__title{color:#7F1D1D;}
.eb-premium-card.is-expired .eb-premium-card__status{background:#FDECEC;color:#B91C1C;}
.eb-stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:6px;}
.eb-stat{background:var(--eb-card);border-radius:var(--eb-radius);padding:16px;box-shadow:var(--eb-shadow);}
.eb-stat__label{font-size:12px;color:var(--eb-ink-soft);font-weight:600;}
.eb-stat__value{font-size:22px;font-weight:800;margin-top:4px;}
.eb-stat--accent .eb-stat__value{color:var(--eb-accent);}
.eb-stat--warn .eb-stat__value{color:var(--eb-warn);}

.eb-quick-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.eb-quick-action{
  background:var(--eb-card);border-radius:var(--eb-radius);padding:16px;box-shadow:var(--eb-shadow);
  display:flex;flex-direction:column;gap:8px;
}
.eb-quick-action__icon{width:38px;height:38px;border-radius:10px;background:var(--eb-primary-light);color:var(--eb-primary);
  display:flex;align-items:center;justify-content:center;}
.eb-quick-action__icon svg{width:20px;height:20px;}
.eb-quick-action__label{font-size:13.5px;font-weight:700;}

/* ---------- Lists (customers, documents) ---------- */
.eb-search{position:relative;margin-bottom:14px;}
.eb-search .eb-input{padding-left:42px;}
.eb-search svg{position:absolute;left:14px;top:50%;transform:translateY(-50%);width:18px;height:18px;color:var(--eb-ink-faint);}

.eb-list-item{
  display:flex;align-items:center;gap:12px;padding:14px 16px;background:#fff;border-radius:var(--eb-radius);
  box-shadow:var(--eb-shadow);margin-bottom:10px;
}
.eb-list-item__avatar{
  width:42px;height:42px;border-radius:12px;background:var(--eb-primary-light);color:var(--eb-primary);
  display:flex;align-items:center;justify-content:center;font-weight:800;font-size:15px;flex-shrink:0;
}
.eb-list-item__body{flex:1;min-width:0;}
.eb-list-item__title{font-size:14.5px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.eb-list-item__sub{font-size:12.5px;color:var(--eb-ink-soft);margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.eb-list-item__meta{text-align:right;flex-shrink:0;}
.eb-list-item__amount{font-size:14.5px;font-weight:800;}
.eb-list-item__chevron{color:var(--eb-ink-faint);width:18px;height:18px;flex-shrink:0;}

.eb-badge{display:inline-flex;align-items:center;padding:3px 9px;border-radius:99px;font-size:11px;font-weight:700;}
.eb-badge--estimate{background:var(--eb-primary-light);color:var(--eb-primary);}
.eb-badge--quotation{background:#FFFBEB;color:#B45309;}
.eb-badge--invoice{background:var(--eb-accent-light);color:#0D8C7E;}

.eb-filter-tabs{display:flex;gap:8px;margin-bottom:14px;overflow-x:auto;padding-bottom:2px;}
.eb-filter-tab{
  flex-shrink:0;padding:9px 16px;border-radius:99px;font-size:13px;font-weight:700;background:#fff;
  border:1.5px solid var(--eb-border);color:var(--eb-ink-soft);
}
.eb-filter-tab.is-active{background:var(--eb-primary);color:#fff;border-color:var(--eb-primary);}

.eb-empty{text-align:center;padding:50px 20px;color:var(--eb-ink-soft);}
.eb-empty svg{width:56px;height:56px;color:var(--eb-ink-faint);margin-bottom:14px;}
.eb-empty__title{font-weight:700;color:var(--eb-ink);margin-bottom:4px;}

/* ---------- Document builder ---------- */
.eb-cat-card{
  background:#fff;border-radius:var(--eb-radius);
  border:1.5px solid var(--eb-border);
  box-shadow:0 6px 20px rgba(23,32,51,.10), 0 2px 6px rgba(23,32,51,.05);
  margin-bottom:16px;overflow:hidden;
}
.eb-cat-card__head{
  background:var(--eb-primary);color:#fff;padding:12px 14px;display:flex;align-items:center;gap:10px;
}
.eb-cat-card__head input.eb-cat-name{background:transparent;border:0;color:#fff;font-weight:700;font-size:15px;flex:1;min-width:0;padding:6px 0;}
.eb-cat-card__head input.eb-cat-name::placeholder{color:rgba(255,255,255,.7);}
.eb-cat-card__body{padding:14px;}
.eb-row-grid{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;align-items:center;margin-bottom:10px;}
.eb-row-grid input{
  min-height:42px;font-size:14px;min-width:0;
  background:var(--eb-bg);border:1.5px solid var(--eb-border);
}
.eb-row-grid input:focus{background:#fff;border-color:var(--eb-primary);}
.eb-row-del{
  width:38px;height:38px;min-width:38px;flex-shrink:0;box-sizing:border-box;padding:0;margin:0;
  border-radius:10px;background:var(--eb-danger-light);color:var(--eb-danger);
  border:1px solid rgba(220,38,38,.18);
  display:flex;align-items:center;justify-content:center;line-height:1;font-size:15px;
}
.eb-cat-meta-row{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;margin-bottom:12px;}
.eb-cat-meta-row select,.eb-cat-meta-row input{
  min-height:42px;font-size:13.5px;background:var(--eb-bg);border:1.5px solid var(--eb-border);
}
.eb-cat-meta-row select:focus,.eb-cat-meta-row input:focus{background:#fff;border-color:var(--eb-primary);}
.eb-cat-total{
  display:flex;justify-content:space-between;align-items:center;
  padding:12px 14px;margin:12px -14px -14px;
  background:var(--eb-accent-light);border-top:1.5px solid var(--eb-border);
  font-weight:700;
}
.eb-cat-total span:first-child{color:var(--eb-ink-soft);font-weight:600;font-size:13.5px;}
.eb-cat-total span:last-child{color:var(--eb-accent);font-size:16px;font-weight:800;}

.eb-add-row-btn{
  width:100%;min-height:42px;border-radius:10px;
  background:#fff;border:1.5px dashed var(--eb-primary);color:var(--eb-primary);
  font-weight:700;font-size:13.5px;margin-top:4px;
}
.eb-add-cat-btn{width:100%;min-height:50px;border-radius:var(--eb-radius);background:#fff;border:2px dashed var(--eb-border);color:var(--eb-primary);font-weight:700;margin-bottom:14px;}

.eb-summary-row{display:flex;justify-content:space-between;padding:8px 0;font-size:14px;}
.eb-summary-row.total{font-size:17px;font-weight:800;border-top:1px solid var(--eb-border);margin-top:6px;padding-top:14px;}
.eb-summary-row.total span:last-child{color:var(--eb-accent);}

.eb-sticky-actions{
  position:sticky;bottom:0;background:#fff;border-top:1px solid var(--eb-border);
  padding:12px 14px calc(12px + env(safe-area-inset-bottom));margin:0 -14px -16px;
}

/* ---------- Document view / PDF options ---------- */
.eb-doc-hero{background:linear-gradient(135deg,var(--eb-primary),var(--eb-primary-2));border-radius:var(--eb-radius);color:#fff;padding:22px;margin-bottom:14px;}
.eb-doc-hero__type{font-size:12px;opacity:.85;text-transform:uppercase;letter-spacing:.05em;font-weight:700;}
.eb-doc-hero__number{font-size:22px;font-weight:800;margin:4px 0;}
.eb-doc-hero__amount{font-size:28px;font-weight:800;margin-top:10px;}
.eb-doc-hero__amount span{font-size:13px;opacity:.85;font-weight:600;display:block;}

.eb-action-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:14px;}
.eb-action-btn{
  background:#fff;border-radius:var(--eb-radius-sm);box-shadow:var(--eb-shadow);padding:14px 10px;
  display:flex;flex-direction:column;align-items:center;gap:6px;font-size:12.5px;font-weight:700;color:var(--eb-ink);border:0;
}
.eb-action-btn svg{width:22px;height:22px;color:var(--eb-primary);}
.eb-action-btn--whatsapp svg{color:#25D366;}

/* ---------- Upgrade banner / page ---------- */
.eb-upgrade-banner{
  background:linear-gradient(135deg,#F59E0B,#D97706);color:#fff;border-radius:var(--eb-radius);
  padding:16px;display:flex;align-items:center;gap:12px;margin-bottom:14px;flex-wrap:wrap;
}
.eb-upgrade-banner__icon{width:38px;height:38px;flex-shrink:0;}
.eb-upgrade-banner__text{flex:1;min-width:150px;}
.eb-upgrade-banner__title{font-weight:800;font-size:14.5px;}
.eb-upgrade-banner__sub{font-size:12.5px;opacity:.92;}
.eb-upgrade-banner__btn{
  flex-shrink:0;margin-left:auto;background:#fff;color:#B45309;font-weight:700;font-size:13px;
  padding:9px 16px;border-radius:10px;white-space:nowrap;
}

.eb-plan-card{background:#fff;border-radius:var(--eb-radius);box-shadow:var(--eb-shadow);padding:22px;text-align:center;margin-bottom:14px;border:2px solid transparent;}
.eb-plan-card.is-current{border-color:var(--eb-primary);}
.eb-plan-card__name{font-weight:800;font-size:16px;}
.eb-plan-card__price{font-size:30px;font-weight:800;margin:10px 0;}
.eb-plan-card__price small{font-size:13px;font-weight:600;color:var(--eb-ink-soft);}
.eb-plan-card__cta{
  width:clamp(190px,72%,320px);min-height:46px;margin:0 auto;padding:0 18px;
  display:flex;text-align:center;text-decoration:none;font-size:clamp(13.5px,3.8vw,15px);
  transition:transform .12s ease,box-shadow .18s ease,opacity .15s ease;
  box-shadow:0 5px 14px rgba(47,56,217,.16);
}
.eb-plan-card__cta:hover{box-shadow:0 7px 18px rgba(47,56,217,.22);}
.eb-plan-card__cta:active{transform:scale(.975);}
@media (min-width:700px){
  .eb-plan-card__cta{width:240px;}
}

/* ---------- Toast / modal / loader ---------- */
.eb-toast-wrap{position:fixed;top:calc(var(--eb-topbar-h) + 10px);left:50%;transform:translateX(-50%);z-index:100;display:flex;flex-direction:column;gap:8px;width:calc(100% - 28px);max-width:420px;}
.eb-toast{background:var(--eb-ink);color:#fff;padding:12px 16px;border-radius:12px;font-size:13.5px;font-weight:600;box-shadow:var(--eb-shadow-lg);animation:eb-toast-in .18s ease;}
.eb-toast--error{background:var(--eb-danger);}
.eb-toast--success{background:var(--eb-accent);}
@keyframes eb-toast-in{from{opacity:0;transform:translateY(-8px);}to{opacity:1;transform:translateY(0);}}

.eb-modal-overlay{position:fixed;inset:0;background:rgba(23,32,51,.5);z-index:90;display:flex;align-items:flex-end;justify-content:center;}
.eb-modal{background:#fff;border-radius:20px 20px 0 0;width:100%;max-width:480px;padding:20px;max-height:85vh;overflow-y:auto;animation:eb-modal-in .2s ease;}
@keyframes eb-modal-in{from{transform:translateY(24px);opacity:0;}to{transform:translateY(0);opacity:1;}}
.eb-modal__title{font-size:17px;font-weight:800;margin-bottom:14px;}

.eb-spinner{width:18px;height:18px;border-radius:50%;border:2.5px solid rgba(255,255,255,.4);border-top-color:#fff;animation:eb-spin .6s linear infinite;}
.eb-btn--outline .eb-spinner,.eb-btn--ghost .eb-spinner{border-color:rgba(47,56,217,.22);border-top-color:var(--eb-primary);}
@keyframes eb-spin{to{transform:rotate(360deg);}}

.eb-page-loader{position:fixed;inset:0;background:#fff;z-index:200;display:flex;align-items:center;justify-content:center;}
.eb-page-loader .eb-spinner{width:34px;height:34px;border-width:3px;border-color:rgba(47,56,217,.18);border-top-color:var(--eb-primary);}

/* ---------- Misc ---------- */
.eb-avatar-upload{width:84px;height:84px;border-radius:18px;background:var(--eb-primary-light);display:flex;align-items:center;justify-content:center;overflow:hidden;margin:0 auto 14px;position:relative;}
.eb-avatar-upload img{width:100%;height:100%;object-fit:cover;}
.eb-avatar-upload svg{width:28px;height:28px;color:var(--eb-primary);}

@media (min-width:640px){
  .eb-stat-grid,.eb-quick-actions{grid-template-columns:repeat(4,1fr);}
  .eb-action-grid{grid-template-columns:repeat(4,1fr);}
}

/* ---------- Small-phone compacting (≤380px) — tightens spacing/sizes
   that feel oversized on the smallest screens, without changing the
   layout, colors, or component design used everywhere else. ---------- */
@media (max-width:380px){
  .eb-main{padding-left:12px;padding-right:12px;}
  .eb-card{padding:14px;}
  .eb-doc-hero{padding:16px;}
  .eb-doc-hero__amount{font-size:24px;}
  .eb-plan-card{padding:16px;}
  .eb-plan-card__price{font-size:26px;}
  .eb-empty{padding:36px 14px;}
  .eb-empty svg{width:44px;height:44px;margin-bottom:10px;}
  .eb-cat-meta-row select,.eb-cat-meta-row input{font-size:12.5px;}
  .eb-row-grid{gap:6px;}
}

/* ---------- Area/Room smart selector (builder parity with Sajavat Estimate) ---------- */
.eb-room-dropdown{
  position:fixed;background:#fff;border:1px solid var(--eb-border);border-radius:10px;
  box-shadow:0 8px 24px rgba(16,24,40,.15);max-height:220px;overflow-y:auto;
  -webkit-overflow-scrolling:touch;z-index:1000;
}
.eb-room-option{
  padding:10px 14px;font-size:13.5px;color:var(--eb-ink);cursor:pointer;
  border-bottom:1px solid var(--eb-border);min-height:40px;display:flex;align-items:center;
}
.eb-room-option:last-child{border-bottom:none;}
.eb-room-option:hover,.eb-room-option:active{background:var(--eb-bg);}
.eb-room-hint{color:var(--eb-ink-faint);font-style:italic;cursor:default;}
.eb-room-hint:hover{background:transparent;}

/* ---------- Public marketing/legal pages (Pricing, Contact, Privacy,
   Terms, Refund Policy) — no login required, no app chrome ---------- */
.eb-main--public{max-width:820px;padding-top:24px;}
.eb-public-hero{text-align:center;margin-bottom:28px;}
.eb-public-hero__logo{width:148px;height:148px;object-fit:contain;margin:0 auto 10px;display:block;padding:6px;}
.eb-public-hero h1{font-size:26px;font-weight:800;margin:0 0 8px;color:var(--eb-ink);}
.eb-public-hero p{font-size:14.5px;color:var(--eb-ink-soft);margin:0;max-width:480px;margin:0 auto;}
.eb-public-nav{display:flex;justify-content:center;gap:18px;flex-wrap:wrap;margin-bottom:28px;font-size:13.5px;font-weight:600;}
.eb-public-nav a{color:var(--eb-ink-soft);text-decoration:none;}
.eb-public-nav a.is-active,.eb-public-nav a:hover{color:var(--eb-primary);}
.eb-public-footer{max-width:820px;margin:40px auto 0;padding:24px 14px calc(24px + env(safe-area-inset-bottom));text-align:center;border-top:1px solid var(--eb-border);}
.eb-public-footer__links{display:flex;justify-content:center;gap:16px;flex-wrap:wrap;margin-bottom:10px;}
.eb-public-footer__links a{font-size:12.5px;color:var(--eb-ink-soft);text-decoration:none;font-weight:600;}
.eb-public-footer__links a:hover{color:var(--eb-primary);}
.eb-public-footer__copy{font-size:11.5px;color:var(--eb-ink-faint);margin:0;}

.eb-plans-grid{display:grid;grid-template-columns:1fr;gap:16px;margin-bottom:8px;}
.eb-plan-card--featured{border-color:var(--eb-primary);box-shadow:var(--eb-shadow-lg);position:relative;}
.eb-plan-card__badge{position:absolute;top:-11px;right:18px;background:var(--eb-primary);color:#fff;font-size:11px;font-weight:700;padding:4px 12px;border-radius:99px;}
.eb-plan-card__desc{font-size:13px;color:var(--eb-ink-soft);margin:0 0 16px;}
.eb-plan-card__features{list-style:none;margin:0 0 18px;padding:0;text-align:left;}
.eb-plan-card__features li{display:flex;align-items:flex-start;gap:8px;font-size:13.5px;color:var(--eb-ink);padding:6px 0;}
.eb-plan-card__features li svg{flex-shrink:0;margin-top:2px;color:var(--eb-accent);}
.eb-legal-content{font-size:14px;line-height:1.7;color:var(--eb-ink);}
.eb-legal-content h2{font-size:17px;font-weight:700;margin:26px 0 10px;color:var(--eb-ink);}
.eb-legal-content h2:first-child{margin-top:0;}
.eb-legal-content p{margin:0 0 12px;}
.eb-legal-content ul{margin:0 0 12px;padding-left:20px;}
.eb-legal-content li{margin-bottom:6px;}
.eb-contact-card{display:flex;align-items:center;gap:14px;padding:16px;background:#fff;border:1px solid var(--eb-border);border-radius:var(--eb-radius-sm);margin-bottom:12px;}
.eb-contact-card__icon{width:42px;height:42px;border-radius:12px;background:var(--eb-primary-light);color:var(--eb-primary);display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.eb-contact-card__label{font-size:12px;color:var(--eb-ink-faint);font-weight:600;text-transform:uppercase;letter-spacing:.03em;}
.eb-contact-card__value{font-size:14.5px;color:var(--eb-ink);font-weight:600;}

@media (min-width:640px){
  .eb-plans-grid{grid-template-columns:repeat(3,1fr);}
}


/* ---------- Payment/plan page viewport + bottom-nav clearance ----------
   Upgrade/Plan Details intentionally include the verification/policy footer
   while keeping the logged-in bottom navigation. The footer used to sit
   underneath the fixed bottom nav/FAB and flex:1 also pushed it to the far
   bottom of tall/desktop viewports. Keep these two routes content-height,
   fully scrollable, and reserve enough safe space above the fixed nav. */
.eb-route-upgrade .eb-main,
.eb-route-plan-details .eb-main{
  flex:0 0 auto;
  padding-bottom:20px;
}

.eb-has-bottomnav.eb-has-public-footer .eb-public-footer{
  width:100%;
  max-width:720px;
  flex:0 0 auto;
  margin:18px auto 0;
  padding:20px 14px calc(var(--eb-bottomnav-h) + 34px + env(safe-area-inset-bottom));
}

.eb-has-bottomnav.eb-has-public-footer .eb-public-footer__links{
  row-gap:10px;
}

/* Keep payment CTAs visually consistent while still clearly disabled until
   Razorpay keys are configured. */
.eb-route-plan-details .eb-btn--primary:disabled{
  opacity:.68;
}

@media (max-width:480px){
  .eb-route-upgrade .eb-main,
  .eb-route-plan-details .eb-main{
    padding-bottom:14px;
  }
  .eb-has-bottomnav.eb-has-public-footer .eb-public-footer{
    margin-top:12px;
    padding-top:18px;
    padding-bottom:calc(var(--eb-bottomnav-h) + 40px + env(safe-area-inset-bottom));
  }
  .eb-has-bottomnav.eb-has-public-footer .eb-public-footer__links{
    gap:10px 14px;
  }
}
