/* =========================================================
   Javi — Polished UI Theme (Light + Dark)
   Drop-in replacement for your existing class names.
   ========================================================= */

/* ---------- Design tokens ---------- */
:root{
  /* base */
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #0f172a;         /* slate-900 */
  --muted: #64748b;        /* slate-500 */
  --border: #e5e7eb;       /* gray-200 */

  /* interactive */
  /* brand — blue + yellow */
  --accentA: #2563EB;      /* brand blue */
  --accentB: #EAB308;      /* brand yellow */
  --accentC: #2563EB;      /* alias → blue */
  --accentD: #EAB308;      /* alias → yellow */

  --btn: #2563eb; /* JS overrides this via __applyTheme */
  --btnGrad: none;
  --btnGradHover: none;
  --btnText: #ffffff; /* JS overrides this via __applyTheme */
  --btn2: transparent;
  --btn2Text: #0f172a;
  --danger: #dc2626;

  /* decorative gradients */
  --gradGlowA: radial-gradient(900px 280px at 12% -12%, color-mix(in srgb, var(--accentA) 14%, transparent), transparent 62%);
  --gradGlowB: radial-gradient(820px 260px at 92% -10%, color-mix(in srgb, var(--accentB) 10%, transparent), transparent 62%);
  --gradGlowC: radial-gradient(760px 240px at 50% 0%, color-mix(in srgb, var(--accentA) 7%, transparent), transparent 65%);
  /* --gradHairline removed — use solid border instead */

  /* elevation + rounding */
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 22px;

  --shadow-xs: 0 1px 3px rgba(15,23,42,.05);
  --shadow-sm: 0 1px 2px rgba(15,23,42,.03), 0 2px 6px rgba(15,23,42,.05), 0 6px 16px rgba(15,23,42,.06), 0 16px 32px rgba(15,23,42,.04);
  --shadow-md: 0 2px 4px rgba(15,23,42,.04), 0 6px 14px rgba(15,23,42,.06), 0 16px 32px rgba(15,23,42,.07), 0 32px 56px rgba(15,23,42,.05);

  /* focus ring */
  --focus: rgba(59, 130, 246, .22); /* blue-ish ring */
  --ring: 0 0 0 4px var(--focus);

  /* surfaces */
  --surface-1: color-mix(in srgb, var(--bg) 94%, var(--text) 2%);
  --surface-2: color-mix(in srgb, var(--bg) 90%, var(--text) 3%);

  /* motion */
  --ease: cubic-bezier(.2,.8,.2,1);
  --dur: 180ms;
}

[data-theme="dark"]{
  --bg:#16161f;
  --panel:#1c1c27;
  --text:#f4f4f5;
  --muted:#a1a1aa;
  --border:#2e2e3a;

  --btn: #3b82f6; /* JS overrides this via __applyTheme */
  --btnGrad: none;
  --btnGradHover: none;
  --btnText:#ffffff; /* JS overrides this via __applyTheme */
  --btn2:transparent;
  --btn2Text:#f4f4f5;
  --danger:#ef4444;

  /* softer shadows in dark; lean on borders */
  --shadow-xs: 0 1px 3px rgba(0,0,0,.20);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.12), 0 3px 8px rgba(0,0,0,.16), 0 10px 24px rgba(0,0,0,.18), 0 24px 48px rgba(0,0,0,.12);
  --shadow-md: 0 2px 4px rgba(0,0,0,.16), 0 8px 20px rgba(0,0,0,.20), 0 20px 40px rgba(0,0,0,.22), 0 40px 72px rgba(0,0,0,.14);

  --focus: rgba(96, 165, 250, .22);

  --surface-1: color-mix(in srgb, var(--panel) 94%, #fff 6%);
  --surface-2: color-mix(in srgb, var(--panel) 88%, #fff 12%);

  /* Stronger gradient glows in dark so cards pop against the bg */
  --gradGlowA: radial-gradient(ellipse 80% 40% at 10% 0%, color-mix(in srgb, var(--accentA) 18%, transparent), transparent 65%);
  --gradGlowB: radial-gradient(ellipse 70% 35% at 95% 5%, color-mix(in srgb, var(--accentA) 10%, transparent), transparent 60%);
  --gradGlowC: radial-gradient(ellipse 100% 30% at 50% 100%, color-mix(in srgb, var(--accentA) 7%, transparent), transparent 70%);
}

/* ---------- Global reset ---------- */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  /* subtle gradient “wash” like your reference homepage */
  background:
    var(--gradGlowA),
    var(--gradGlowB),
    var(--gradGlowC),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a{color:inherit; text-decoration:none}
p{margin:0}
h1{font-size:26px; margin:0; letter-spacing:-.02em}
h2{font-size:16px; margin:0; letter-spacing:-.01em}

.muted{color:var(--muted)}
.small{font-size:12px}

/* ---------- Layout ---------- */
.container{
  max-width:1100px;
  margin:0 auto;
  padding:16px;
}

/* Auth pages — no topbar, no container padding */
body.auth-page .container{
  padding:0;
  max-width:100%;
}
body.auth-page{
  overflow-y:auto;
}

/* ---------- Topbar ---------- */
.topbar{
  position: sticky;
  top:0;
  z-index:10;
  transition: transform 0.22s ease, opacity 0.22s ease;

  /* glassy */
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom:1px solid color-mix(in srgb, var(--border) 85%, transparent);
}

.topbar.hdr-hidden{
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}

/* gradient hairline under the topbar (adds “pop” without being loud) */
.topbar::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:-1px;
  height:2px;
  background: var(--gradHairline);
  opacity:.55;
  pointer-events:none;
}

.topbarInner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  max-width:1100px;
  margin:0 auto;

  /* safe-area padding so Javi clears the notification bar */
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px 16px;
}

.brand{
  font-weight:800;
  letter-spacing:-.03em;
  font-size:18px;
}

.nav{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.nav a{
  font-size:14px;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid transparent;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.nav a:hover{
  background: var(--surface-1);
  border-color: color-mix(in srgb, var(--border) 75%, transparent);
}

.nav a.active{
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}



/* Nav icons — visible on mobile, hidden on desktop */
.navIcon {
  display: none;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.navLabel {
  /* on desktop: just the text as before */
}

.settingsWrap{position:relative}
.settingsMenu{
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  min-width:220px;
  display:none;
  z-index:30;
}

/* Account nav avatar icon */
.navAccountIcon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:26px;
  height:26px;
  border-radius:50%;
  overflow:hidden;
  flex-shrink:0;
}
.navAccountIcon img{
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:50%;
}
.navAccountIcon svg{
  width:22px;
  height:22px;
}

/* Desktop account button — sits to the right of topbarInner */
.nav-account-btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  cursor: pointer;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  position: relative;
}
.nav-account-btn:hover{
  background: var(--surface-1);
}
.nav-account-btn.active{
  background: var(--surface-2);
}
.nav-account-name{
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Dropdown */
.nav-account-dropdown{
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  background: color-mix(in srgb, var(--panel) 97%, transparent);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
  z-index: 9000;
  overflow: hidden;
  padding: 6px 0;
}
.nav-account-dropdown.open{ display: block; }
.nav-account-dropdown-item{
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  font-family: inherit;
  transition: background .1s;
}
.nav-account-dropdown-item:hover{
  background: var(--surface-2, rgba(255,255,255,.06));
}
.nav-account-dropdown-item.danger{ color: var(--danger, #ef4444); }
.nav-account-dropdown-sep{
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
/* Mobile slide-up sheet */
.account-sheet-overlay{
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9990;
  backdrop-filter: blur(2px);
}
.account-sheet-overlay.open{ display: block; }
.account-sheet{
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--panel, var(--bg));
  border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--border);
  z-index: 9991;
  padding: 0 0 calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.32,.72,0,1);
}
.account-sheet.open{ transform: translateY(0); }
.account-sheet-handle{
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 12px auto 16px;
}
.account-sheet-header{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.account-sheet-avatar{
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.account-sheet-avatar img{ width:100%; height:100%; object-fit:cover; }
.account-sheet-item{
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  font-family: inherit;
  text-decoration: none;
}
.account-sheet-item:active{ background: var(--surface-1); }
.account-sheet-item.danger{ color: var(--danger, #ef4444); }
.account-sheet-icon{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
/* Hide on mobile — bottom nav handles it */
@media (max-width: 560px){
  .nav-account-btn{ display: none !important; }
}
.settingsMenu.open{display:block}
.settingsMenu .btn{width:100%; justify-content:flex-start}

/* ---------- Buttons ---------- */
.btn{
  border:1px solid color-mix(in srgb, var(--btn) 80%, transparent);
  background: var(--btn);
  color:var(--btnText);
  padding:9px 12px;
  border-radius:999px;
  font-weight:700;
  font-size:14px;
  cursor:pointer;
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    opacity var(--dur) var(--ease);
  box-shadow: var(--shadow-xs);
}

.btn:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  background: color-mix(in srgb, var(--btn) 88%, #000 12%);
}

.btn:active{
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

.btn.secondary{
  background:var(--btn2);
  color:var(--btn2Text);
  box-shadow:none;
}

.btn.secondary:hover{
  background: var(--surface-1);
  box-shadow:none;
  transform: translateY(0);
}

.btn.secondary:hover{
  border-color: color-mix(in srgb, var(--accentA) 30%, var(--border));
}

.btn.danger,
.btn.remove{
  background:var(--danger);
  color:#fff;
  border-color: color-mix(in srgb, var(--danger) 72%, var(--border));
}
.btn.danger:hover,
.btn.remove:hover{
  background: color-mix(in srgb, var(--danger) 88%, #000 12%);
}

/* Round × dismiss button — outline only, no fill */
.btnX{
  width:24px; height:24px; padding:0; border-radius:999px;
  border:1px solid color-mix(in srgb, var(--border) 90%, transparent);
  background: transparent;
  color: var(--muted);
  font-size:14px; line-height:1; cursor:pointer; flex-shrink:0;
  display:inline-flex; align-items:center; justify-content:center;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btnX:hover{
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.btn:focus{outline:none; box-shadow: var(--ring), var(--shadow-xs)}

/* ---------- Rows / Grids ---------- */
.row{display:flex; gap:10px; flex-wrap:wrap; align-items:center}
.grid{display:grid; gap:12px}
.grid.two{grid-template-columns: repeat(2, minmax(0, 1fr));}

/* ---------- Cards ---------- */
.card{
  position: relative;
  border-radius: var(--radius-lg);
  padding:14px;
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.card:hover{
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accentA) 35%, var(--border));
}

.card::before,
.card::after{ display:none; }

/* Flat variant — no hover effect (event detail inner cards) */
.card--flat:hover{
  box-shadow: var(--shadow-sm);
  border-color: color-mix(in srgb, var(--border) 90%, transparent);
}

/* listItems inside cards — no double border/shadow */
.card .listItem{
  border:none;
  background:transparent;
  box-shadow:none;
}
.card .listItem:hover{
  transform:none;
  box-shadow:none;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  border-radius: var(--radius);
}
/* Outer event-list cards: listItem is the clickable face */
.card > a.listItem,
.card > .listItem{
  border-radius:var(--radius-lg);
  padding:14px;
}
.card > a.listItem:hover,
.card > .listItem:hover{
  background:transparent;
}
/* Ensure inner panels don't add extra backgrounds */
.card .innerPanel,
.card .cardBody,
.card .lowerSection{
  background: transparent !important;
}




.teamProfileCard{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:12px;
}

.teamProfileHeadshot{
  width:148px;
  height:148px;
  border-radius:22px;
  overflow:hidden;
  border:1px solid var(--border);
  flex:0 0 auto;
  background:color-mix(in srgb, var(--bg) 86%, transparent);
}

.teamProfileInitial{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  font-size:30px;
}

.teamProfileInfo{
  width:100%;
  min-width:0;
  align-items:center;
}

.teamProfileName{
  font-weight:800;
  width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}


/* ===== Team profile cards (card-like layout) ===== */
.card.teamProfileCard{
  padding:0;
  overflow:hidden;
  text-align:left;
  align-items:stretch;
  gap:0;
}
.card.teamProfileCard:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0,0,0,.10);
}

.teamProfileHeadshot{
  width:100%;
  height:170px;
  border-radius: 16px 16px 0 0;
  border:0;
}

.teamProfileInfo{
  padding:14px 14px 10px;
  text-align:left;
  align-items:flex-start;
  gap:8px;
}

.teamContactRow{
  justify-content:flex-start;
}

.teamProfileActions{
  width:100%;
  display:flex;
  justify-content:flex-end;
  padding:10px 14px 14px;
  border-top:1px solid var(--border);
  background: var(--bg);
  border-top:1px solid color-mix(in srgb, var(--border) 82%, transparent);
  background: color-mix(in srgb, var(--bg) 96%, transparent);
}

/* ---------- Team profile contact buttons ---------- */
.teamContactRow{
  justify-content:center;
  gap:8px;
  flex-wrap:nowrap;
}
.teamContactBtn{
  padding:7px 12px;
  font-size:13px;
}

/* ---------- Event assignee avatars (cards + detail) ---------- */
.eventAssigneeStrip{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:8px;
  min-width:0;
}
.eventAssigneeChip{
  width:28px;
  height:28px;
  border-radius:999px;
  overflow:hidden;
  border:1px solid var(--border);
  background: var(--panel);
  border:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  flex:0 0 auto;
}
.eventAssigneeInitial{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:12px;
}

.eventAssignedHeadshot{
  width:40px;
  height:40px;
  border-radius:14px;
  overflow:hidden;
  border:1px solid var(--border);
  background: var(--panel);
  border:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  flex:0 0 auto;
}
.eventAssignedInitial{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:14px;
}

/* ---------- Inputs ---------- */
.input, .select, .textarea{
  width:100%;
  padding:11px 12px;
  border-radius: 14px;
  border:1px solid color-mix(in srgb, var(--border) 92%, transparent);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  color:var(--text);
  font-size:14px;
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.input:focus, .select:focus, .textarea:focus{
  outline:none;
  box-shadow: var(--ring);
  border-color: color-mix(in srgb, var(--border) 55%, #60a5fa);
}

.textarea{min-height:90px; resize:vertical}

/* ---------- Badges / Pills ---------- */
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--border) 90%, transparent);
  font-size:12px;
  color:var(--text);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, transparent), color-mix(in srgb, var(--panel) 86%, transparent));
}

.badge.warn{
  background: rgba(255,184,77,.16);
  border:1px solid rgba(255,184,77,.40);
}

/* ---------- List items ---------- */
.listItem{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:12px;
  border-radius: var(--radius);
  border:1px solid var(--border);
  background: var(--surface-1);
  box-shadow: var(--shadow-sm);
  align-items:flex-start;
  border:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  background: var(--surface-1);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.listItem:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--border) 92%, transparent);
}

.stack{display:flex; flex-direction:column; gap:6px}
.kv{font-size:12px; color:var(--muted)}
hr.sep{border:0; border-top:1px solid color-mix(in srgb, var(--border) 90%, transparent); margin:12px 0}

/* ---------- Toast ---------- */
.toast{
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  bottom:16px;
  background: color-mix(in srgb, var(--panel) 86%, var(--text) 6%);
  border:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  color:var(--text);
  padding:10px 12px;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  display:none;
  max-width:min(520px, 92vw);
}
.toast.show{display:block}

/* =========================================================
   Calendar (Month view) — keep your existing class names
   ========================================================= */
.calHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.calHeader .row{gap:8px}
.calTitle{font-weight:800; letter-spacing:-.01em}

.calGrid{
  display:grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap:8px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  padding-bottom: 2px;
}

.calDow{
  font-size:12px;
  color:var(--muted);
  text-align:center;
  padding:6px 0;
}

.calDay{
  border:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  border-radius: 14px;
  padding:8px;
  min-height:0;
  aspect-ratio: 1 / 1;
  background: var(--surface-1);
  display:flex;
  flex-direction:column;
  gap:6px;
  cursor:pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.calDay:hover{
  background: var(--surface-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.calDay.isOtherMonth{opacity:.55}

.calDay.isToday{
  box-shadow: inset 0 0 0 2px color-mix(in srgb, #60a5fa 55%, transparent), var(--shadow-xs);
}

.calDayTop{display:flex; align-items:center; justify-content:space-between; gap:8px}
.calDayNum{font-size:12px; font-weight:900}

.calCount{
  font-size:11px;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  background: color-mix(in srgb, var(--panel) 88%, var(--text) 4%);
}

.calItems{
  display:flex;
  flex-direction:column;
  gap:6px;
  overflow:hidden;
}

.calItem{
  font-size:12px;
  padding:5px 8px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: var(--panel);
  border:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.calMore{font-size:12px; color:var(--muted)}

@media (max-width: 860px){
  .calGrid{ gap:6px; }
  .calDay{
    aspect-ratio: auto;
    padding:7px;
    min-height:74px;
  }
  .calItem{ display:none; } /* tap day to see events */
}

/* =========================================================
   Dashboard "Google-ish" Calendar (your existing classes)
   ========================================================= */
.gcalToolbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.gcalTitle{font-weight:900; letter-spacing:-.01em}
.gcalPeriod{font-weight:700; color:var(--muted); margin-left:6px}
.gcalBody{min-height:120px}

.seg{
  display:inline-flex;
  border:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  border-radius:999px;
  overflow:hidden;
  background: var(--surface-1);
}

.segBtn{
  border:0;
  background:transparent;
  padding:8px 12px;
  font-weight:800;
  font-size:13px;
  color:var(--btn2Text);
  cursor:pointer;
  transition: background var(--dur) var(--ease);
}

.segBtn.active{
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 92%, transparent);
}

.gcalAgenda{margin-bottom:10px}
.gcalAgendaHeader{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:baseline;
  margin-bottom:10px;
}

.gcalAgendaItem{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:12px;
  border:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  border-radius: var(--radius);
  background: var(--surface-1);
  cursor:pointer;
  margin-bottom:8px;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.gcalAgendaItem:hover{
  background: var(--surface-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.gcalDot{width:10px; height:10px; border-radius:999px; margin-top:6px; flex:0 0 auto}

.gcalWeekWrap{
  border:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  border-radius: var(--radius-lg);
  overflow:hidden;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
}

.gcalWeekHeader{
  display:grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  background: var(--surface-1);
}
.gcalWeekColHead{
  padding:10px 10px 8px 10px;
  border-right:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  display:flex; align-items:baseline; justify-content:space-between;
}
.gcalWeekColHead:last-child{border-right:0}
.gcalWeekDayNum{font-weight:900}
.gcalWeekDayNum.today{
  display:inline-flex;
  width:24px; height:24px;
  align-items:center; justify-content:center;
  border-radius:999px;
  background: color-mix(in srgb, var(--text) 12%, var(--bg));
}

.gcalWeekGrid{
  display:grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-height:220px;
}
.gcalWeekCol{
  padding:10px;
  border-right:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  min-width:0;
}
.gcalWeekCol:last-child{border-right:0}

.gcalChip{
  border:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  border-left:6px solid color-mix(in srgb, var(--border) 88%, transparent);
  border-radius: 14px;
  padding:7px 9px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  cursor:pointer;
  margin-bottom:8px;
  min-width:0;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.gcalChip:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.gcalChip.month{
  border:0;
  border-radius: 12px;
  padding:5px 9px;
  color:#fff;
  box-shadow: var(--shadow-xs);
}
.gcalChipTitle{
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.gcalMonthWrap{
  border:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  border-radius: var(--radius-lg);
  overflow:hidden;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
}
.gcalMonthDow{
  display:grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  background: var(--surface-1);
}
.gcalDowCell{
  text-align:center;
  padding:8px 0;
  font-size:12px;
  color:var(--muted);
  border-right:1px solid color-mix(in srgb, var(--border) 88%, transparent);
}
.gcalDowCell:last-child{border-right:0}

.gcalMonthGrid{
  display:grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.gcalDayCell{
  border-right:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  border-bottom:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  padding:8px;
  min-height:92px;
  background: var(--surface-1);
  cursor:pointer;
  display:flex;
  flex-direction:column;
  gap:6px;
  transition: background var(--dur) var(--ease);
}
.gcalDayCell:hover{ background: var(--surface-2); }
.gcalDayCell:nth-child(7n){border-right:0}
.gcalDayCell.other{opacity:.55}
.gcalDayCell.today{ box-shadow: inset 0 0 0 2px color-mix(in srgb, #60a5fa 55%, transparent); }
.gcalDayTop{display:flex; justify-content:space-between; align-items:center}
.gcalDayNum{font-weight:900; font-size:12px}
.gcalDayDots{display:flex; gap:4px; align-items:center}
.gcalDotSm{width:7px; height:7px; border-radius:999px; display:inline-block}
.gcalMonthChips{display:flex; flex-direction:column; gap:6px; min-width:0}

/* ---------- Dashboard spacing ---------- */
.grid.two .card a.listItem + a.listItem{ margin-top: 12px; }

/* ---------- Dashboard scroll-snap carousels ---------- */
.dashSnapRow{
  display:flex;
  overflow-x:auto;
  overflow-y:visible;
  padding-bottom:10px;
  padding-top:4px;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;
  scroll-behavior:smooth;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  gap:0;
}
.dashSnapRow > *{ min-width:0; }

.dashSnapRow::-webkit-scrollbar{ height:8px; }
.dashSnapRow::-webkit-scrollbar-thumb{
  background: color-mix(in srgb, var(--text) 18%, transparent);
  border-radius:999px;
}

.dashSnapPage{
  flex:0 0 100%;
  scroll-snap-align:start;
  display:flex;
  flex-direction:column;
  gap:10px;
  padding-right:12px;
  padding-left:2px;
  padding-bottom:4px;
  box-sizing:border-box;
}
.dashSnapPage:last-child{ padding-right:0; }

/* Inner event cards inside snap containers — contained shadow + lift on hover */
.dashSnapPage .card{
  box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.08);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.dashSnapPage .card:hover{
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0,0,0,.16), 0 6px 16px rgba(0,0,0,.10);
  border-color: color-mix(in srgb, var(--accentA) 30%, var(--border));
}

.dashSnapDots{
  display:flex;
  justify-content:center;
  gap:8px;
  margin-top:10px;
}
.dashSnapDot{
  width:8px;
  height:8px;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  background: var(--surface-1);
  cursor:pointer;
  padding:0;
}
.dashSnapDot.active{
  background: color-mix(in srgb, var(--text) 22%, var(--bg));
  border-color: color-mix(in srgb, var(--text) 22%, var(--border));
}

/* =========================================================
   Mobile UI fixes (keep your behavior, polish the look)
   ========================================================= */
@media (max-width: 860px){
  .grid.two{ grid-template-columns: 1fr !important; }
  .card{ overflow:hidden; }
  .gcalToolbar{flex-direction:column; align-items:stretch}
  .gcalToolbar .row{justify-content:flex-start}
  .gcalWeekWrap{overflow-x:auto}
  .gcalWeekHeader, .gcalWeekGrid{min-width:720px}
}

@media (max-width: 560px){
  /* Gear modal — single column on mobile */
  .gear-modal-grid{
    grid-template-columns: 1fr !important;
  }

  /* Hide topbar entirely — everything lives in the bottom nav */
  .topbar{ display: none !important; }

  /* Push content up from bottom nav */
  .container{
    padding: 14px 14px calc(72px + env(safe-area-inset-bottom, 0px)) 14px !important;
  }

  .grid.two{ grid-template-columns: 1fr !important; }

  /* ── Bottom nav bar ── */
  #bottom-nav{
    display: flex !important;
  }
}

/* Bottom nav — hidden on desktop, shown on mobile via media query above */
/* Also hidden on the sign-in / sign-up screen */
body.is-auth-screen #bottom-nav{ display: none !important; }

#bottom-nav{
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: max(8px, env(safe-area-inset-left, 0px));
  padding-right: max(8px, env(safe-area-inset-right, 0px));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  align-items: stretch;
  justify-content: space-around;
}

#bottom-nav a{
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  color: var(--muted);
  text-decoration: none;
  border: none;
  background: none;
  transition: color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  min-width: 44px;
}

#bottom-nav a.active{
  color: var(--text);
}

#bottom-nav a:hover{
  color: var(--text);
}

#bottom-nav .navIcon{
  display: block;
  width: 26px;
  height: 26px;
  stroke: currentColor;
}

#bottom-nav .navLabel{
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Account avatar in bottom nav */
#bottom-nav-account .navAccountIcon{
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#bottom-nav-account .navAccountIcon img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

  .formRow,
  .row.formRow,
  .formGrid,
  .grid.formGrid,
  .grid.three,
  .grid.four{
    grid-template-columns: 1fr !important;
  }

  input, select, textarea, button{ max-width: 100%; }
  textarea{ min-height: 96px; }

  .modal,
  dialog{
    width: min(96vw, 560px) !important;
    max-height: 86vh !important;
    overflow: auto !important;
    border-radius: var(--radius-lg);
  }

  .modal .actions,
  dialog .actions,
  .modalActions{
    position: sticky;
    bottom: 0;
    background: color-mix(in srgb, var(--panel) 92%, transparent);
    padding-top: 10px;
    padding-bottom: 10px;
    border-top: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
    gap:10px;
  }

  .modal .actions button,
  dialog .actions button,
  .modalActions button{ flex:1 1 auto; }

  input[type="file"]{ width: 100%; }

  .listRow{ padding: 10px !important; }
  .pill, .badge{ max-width: 100%; }

  .gcalDayCell{ min-height:64px; padding:6px }
  .gcalMonthChips{ display:none }
}

/* ===== Hard overrides for inline grid styles inside modals (Android/phone) ===== */
@media (max-width: 560px){
  body > div[style*="position:fixed"][style*="z-index:50"]{
    padding:10px !important;
  }
  body > div[style*="position:fixed"][style*="z-index:50"] > .card{
    width: 96vw !important;
    max-height: 90vh !important;
    overflow: auto !important;
  }

  .card .grid{ grid-template-columns: 1fr !important; }
  .card .grid[style]{ grid-template-columns: 1fr !important; }
  .card div[style*="grid-template-columns"]{
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .card .row{
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  .card input:not([type="checkbox"]):not([type="radio"]),
  .card select,
  .card textarea{
    width: 100% !important;
  }

  .card .row[style*="justify-content:flex-end"],
  .card .row[style*="justify-content:space-between"]{
    flex-wrap: wrap !important;
  }
  .card .btn{ width: auto; }
}


/* ===== Team cards: vertical playing-card style with round avatar (matches Events) ===== */
.teamCardsGrid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap:10px;
}
@media (min-width: 920px){
  .teamCardsGrid{ grid-template-columns: repeat(4, 1fr); gap:12px; }
}

/* Override earlier banner-style team cards */
.card.teamProfileCard{
  padding:14px 10px 12px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:8px;
  cursor:pointer;
  min-width:0;
}
.card.teamProfileCard:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Round avatar */
.teamProfileHeadshot{
  width:56px;
  height:56px;
  border-radius:999px;
  overflow:hidden;
  border:1px solid var(--border);
  background: var(--panel);
  flex:0 0 auto;
  margin-top:2px;
}

/* Initial inside avatar */
.teamProfileInitial{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:18px;
}

.teamProfileInfo{
  width:100%;
  min-width:0;
  align-items:center;
  text-align:center;
  padding:0;
  gap:4px;
}

.teamProfileName{
  font-weight:900;
  font-size:13px;
  width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  text-align:center;
}

.teamContactRow{
  width:100%;
  justify-content:center;
  gap:6px;
  margin-top:4px;
}

.teamContactBtn{
  flex:1;
  justify-content:center;
  padding:6px 8px;
  font-size:12px;
}

/* Actions pinned to bottom */
.teamProfileActions{
  width:100%;
  display:flex;
  margin-top:auto;
  padding-top:10px;
  border-top:1px solid var(--border);
  justify-content:center;
  background: transparent;
}
.teamProfileActions .btn{
  width:100%;
}

/* Mobile: keep them card-like and tappable */
@media (max-width: 560px){
  .teamCardsGrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap:12px; }
  .card.teamProfileCard{ padding:12px; }
  .teamProfileHeadshot{ width:64px; height:64px; }
  .teamContactRow{ flex-direction:column; gap:8px; }
}


/* ---------- Empty-state "ghost" onboarding cards ---------- */
.card.ghostCard{
  border:2px dashed color-mix(in srgb, var(--border) 70%, transparent);
  background: var(--surface-1);
  box-shadow:none;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  min-height:140px;
}
.card.ghostCard.isClickable{ cursor:pointer; }
.card.ghostCard:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
  border-color: color-mix(in srgb, var(--border) 85%, transparent);
  background: var(--surface-2);
}

.ghostBody{ align-items:center; }
.ghostPlus{
  font-size:34px;
  font-weight:900;
  line-height:1;
  margin-bottom:8px;
}
.ghostTitle{
  font-weight:900;
  font-size:16px;
}
.ghostSubtitle{ margin-top:6px; }
.ghostCta{ margin-top:12px; }
/* === Event Date Hero (Google Calendar–style) === */
.eventDateHeroCal{
  display:flex;
  align-items:center;
  gap:16px;
  padding:16px 16px;
}

.eventDateLeft{
  display:flex;
  align-items:center;
  gap:10px;
  flex:0 0 auto;
}

.eventDateBadge{
  width:62px;
  min-width:62px;
  height:72px;
  border-radius:16px;
  border:1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  line-height:1;
  box-shadow: 0 6px 18px color-mix(in srgb, #000 10%, transparent);
}

.eventDateBadgeMonth{
  font-size:.72rem;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  opacity:.85;
}

.eventDateBadgeDay{
  font-size:1.55rem;
  font-weight:900;
  margin-top:4px;
}

.eventDateBadgeWk{
  font-size:.72rem;
  font-weight:700;
  margin-top:4px;
  opacity:.7;
}

.eventDateBadgeArrow{
  font-size:1.15rem;
  font-weight:900;
  opacity:.55;
  margin:0 2px;
}

.eventDateInfo{
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:0;
}

.eventDateTitle{
  font-size:1.05rem;
  font-weight:900;
  letter-spacing:.2px;
}

.eventDateRow{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:.95rem;
  font-weight:650;
  opacity:.9;
}

.eventDateIcon{
  width:20px;
  text-align:center;
  opacity:.85;
}

.eventDateText{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Mobile: keep it clean + compact */
@media (max-width: 520px){
  .eventDateHeroCal{
    align-items:flex-start;
  }
  .eventDateTitle{
    font-size:1rem;
  }
  .eventDateRow{
    font-size:.9rem;
  }
}
/* ===== Location autocomplete (OpenStreetMap) ===== */
.location-autocomplete {
  position: absolute;
  z-index: 9999;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  overflow: hidden;
  margin-top: 4px;
}

.location-autocomplete-item {
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
}

.location-autocomplete-item:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}


/* ===== Event color tag (small dot) ===== */
.eventRight{display:flex; align-items:center; gap:8px}
.eventColorDot{width:10px; height:10px; border-radius:999px; border:1px solid color-mix(in srgb, var(--border) 88%, transparent); box-shadow: var(--shadow-xs); flex:0 0 auto}
.eventColorDot.lg{width:12px; height:12px}

/* =========================================================
   Skeleton Loading (shimmer)
   - Use .isLoading on container to disable hover lift
   - Use .sk, .skLine, .skAvatar, .skChip, .skBar, .skCard
   ========================================================= */

.isLoading .card:hover{ transform:none; box-shadow: var(--shadow-sm); }

.sk{
  position:relative;
  overflow:hidden;
  background: color-mix(in srgb, var(--panel) 88%, var(--bg));
  border:1px solid color-mix(in srgb, var(--border) 85%, transparent);
}

.sk::after{
  content:"";
  position:absolute;
  inset:-60% -60%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--text) 8%, transparent) 45%,
    color-mix(in srgb, var(--text) 14%, transparent) 55%,
    transparent 100%
  );
  transform: translateX(-40%);
  animation: skShimmer 1.2s linear infinite;
  pointer-events:none;
}

@keyframes skShimmer{
  0%{ transform: translateX(-45%); }
  100%{ transform: translateX(45%); }
}

@media (prefers-reduced-motion: reduce){
  .sk::after{ animation:none; opacity:.45; }
}

.skCard{
  border-radius: var(--radius-lg);
  padding:14px;
  box-shadow: var(--shadow-sm);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}

.skRow{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.skCol{ display:flex; flex-direction:column; gap:10px; }

.skLine{
  height:12px;
  border-radius:999px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
}
.skLine.sm{ height:10px; opacity:.85; }
.skLine.lg{ height:16px; border-radius:10px; }
.skLine.w40{ width:40%; }
.skLine.w55{ width:55%; }
.skLine.w70{ width:70%; }
.skLine.w85{ width:85%; }
.skLine.w100{ width:100%; }

.skAvatar{
  width:40px; height:40px;
  border-radius:14px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
}
.skDot{
  width:10px; height:10px;
  border-radius:999px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
}
.skChip{
  height:26px;
  width:88px;
  border-radius:999px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
}

.skGrid2{ display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:12px; }
@media (max-width: 860px){
  .skGrid2{ grid-template-columns: 1fr; }
}


/* =========================================================
   Mobile polish — Event list items (Dashboard + Events tab)
   Fixes the awkward "floating" avatar on small screens and
   makes the cards feel tighter + more modern.
   ========================================================= */
@media (max-width: 560px){
  /* Turn list rows into a 2-row grid:
     Row 1: info (left) + status/gear (right)
     Row 2: assignees full-width */
  .dashSnapRow .listItem,
  .listItem.eventListItem{
    display:grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "info right"
      "avatars avatars";
    align-items:start !important;
    gap:10px !important;
    padding:14px !important;
  }

  .dashSnapRow .listItem > .stack,
  .listItem.eventListItem > .stack{
    grid-area: info;
    min-width:0;
  }

  .dashSnapRow .listItem > .eventRight,
  .listItem.eventListItem > .eventRight{
    grid-area: right;
    justify-self:end;
    align-self:start;
    flex-wrap:nowrap;
  }

  .dashSnapRow .listItem > .eventAssigneeStrip,
  .listItem.eventListItem > .eventAssigneeStrip{
    grid-area: avatars;
    margin-top:2px;
    margin-bottom:0;
    justify-content:flex-start;
  }

  /* Make the assignee strip look like a fun "stack" of faces */
  .eventAssigneeStrip{ gap:0; }
  .eventAssigneeStrip .eventAssigneeChip{
    width:30px;
    height:30px;
    border-radius:999px;
    box-shadow: var(--shadow-xs);
  }
  .eventAssigneeStrip .eventAssigneeChip + .eventAssigneeChip{
    margin-left:-10px; /* overlap */
  }
  .eventAssigneeStrip .small.muted{ margin-left:8px; }

  /* Slightly tighten secondary text on mobile */
  .listItem .kv{
    font-size:12px;
    line-height:1.25;
  }

  /* Keep pills compact so they don't crowd the row */
  .eventRight .badge{
    padding:4px 9px;
    font-size:11.5px;
    white-space:nowrap;
  }
  .gearCountBadge{ display:none; } /* optional: reduces clutter on narrow phones */
}

/* Medium phones: keep gear badge visible if there's space */
@media (min-width: 561px) and (max-width: 740px){
  .gearCountBadge{ display:inline-flex; }
}



/* =========================================================
   Pro Welcome Page
   - Used by route #pro-welcome (renderProWelcome)
   ========================================================= */

.proWelcomeCard{
  max-width: 860px;
  margin: 0 auto;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.proWelcomeCard::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(800px 220px at 20% -10%, color-mix(in srgb, #60a5fa 35%, transparent), transparent 60%),
    radial-gradient(640px 220px at 80% -10%, color-mix(in srgb, #a78bfa 28%, transparent), transparent 60%),
    radial-gradient(520px 240px at 50% 0%, color-mix(in srgb, #34d399 18%, transparent), transparent 60%);
  pointer-events:none;
  opacity:.9;
}

.proWelcomeCard > *{ position: relative; }

.proWelcomeHeader{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom: 10px;
}

.proWelcomeHero{
  min-width: 240px;
}

.proWelcomeTitle{
  font-weight: 950;
  font-size: 20px;
  letter-spacing: -.01em;
  display:flex;
  align-items:center;
  gap:10px;
}

.proWelcomeTitle::after{
  content:"PRO";
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: color-mix(in srgb, var(--panel) 84%, transparent);
  box-shadow: var(--shadow-xs);
}

.proWelcomeSubtitle{
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.proWelcomeHeaderActions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.proWelcomeGrid{
  margin-top: 14px;
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.proWelcomeFeature{
  padding: 14px;
  box-shadow: var(--shadow-xs);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}

.proWelcomeFeature:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.proWelcomeFeatureTitle{
  font-weight: 900;
  letter-spacing: -.01em;
}

.proWelcomeFeatureBody{
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.proWelcomeCtas{
  margin-top: 14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.proWelcomeTip{
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

/* Mobile */
@media (max-width: 860px){
  .proWelcomeGrid{ grid-template-columns: 1fr; }
}

@media (max-width: 560px){
  .proWelcomeCard{ padding: 14px; }
  .proWelcomeHeaderActions .btn{ flex: 1 1 auto; }
  .proWelcomeCtas .btn{ flex: 1 1 auto; }
  .proWelcomeTitle{ font-size: 19px; }
}

/* =========================================================
   Kits — Hard Case Card + Lid + Drawer (click to open)
   Works with .card.kitCard + .kitLid + .kitDrawer in app.js
   ========================================================= */

.card.kitCard{
  position:relative;
  overflow:hidden;
  cursor:pointer;
  border-radius: 18px;
  transform-style:preserve-3d;
  perspective: 1100px;
  background:
    radial-gradient(520px 160px at 18% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
    radial-gradient(520px 160px at 88% 0%, color-mix(in srgb, var(--accent2, var(--accent)) 8%, transparent), transparent 60%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--panel) 94%, #000 6%) 0%,
      color-mix(in srgb, var(--panel) 88%, #000 12%) 100%
    );
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
}

/* Reinforced rim */
.card.kitCard::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: 18px;
  pointer-events:none;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.38),
    inset 0 0 0 6px rgba(0,0,0,.12);
  opacity:.9;
}

/* Lid block = top half */
.kitLid{
  position:relative;
  padding: 14px;
  padding-bottom: 16px;
  transform-origin: 18% 100%;
  transform: rotateX(0deg);
  transition: transform 420ms cubic-bezier(.2,.8,.2,1), box-shadow 420ms cubic-bezier(.2,.8,.2,1);
  z-index: 3;
}

/* Lid surface (sits behind lid contents) */
.kitLid::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: 18px 18px 16px 16px;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--panel) 92%, #000 8%) 0%,
      color-mix(in srgb, var(--panel) 84%, #000 16%) 100%
    );
  border-bottom: 1px solid rgba(0,0,0,.35);
  z-index: -1;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 10px 22px rgba(0,0,0,.22);
}

/* Seam line between lid and body */
.kitLid::after{
  content:"";
  position:absolute;
  left:0; right:0;
  bottom:-1px;
  height:2px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,.12), transparent);
  opacity:.9;
  pointer-events:none;
}

/* Latch hints */
.card.kitCard .kitLid{
  background:
    linear-gradient(#2a2f36,#1c2026) left 16px bottom 10px / 28px 10px no-repeat,
    linear-gradient(#2a2f36,#1c2026) right 16px bottom 10px / 28px 10px no-repeat;
  border-radius: 18px 18px 16px 16px;
}

/* Drawer (hidden by default) */
.kitDrawer{
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px);
  transition: max-height 420ms cubic-bezier(.2,.8,.2,1),
              opacity 260ms ease,
              transform 420ms cubic-bezier(.2,.8,.2,1);
  z-index: 2;
}

.kitDrawerInner{
  padding: 14px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
}

/* OPEN STATE */
.card.kitCard.isOpen .kitLid{
  transform: perspective(1100px) rotateX(-62deg);
  box-shadow: 0 18px 40px rgba(0,0,0,.28);
}

.card.kitCard.isOpen .kitDrawer{
  max-height: 520px; /* enough for tags + actions */
  opacity: 1;
  transform: translateY(0);
}

/* Make it feel alive */
.card.kitCard:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

@media (prefers-reduced-motion: reduce){
  .kitLid, .kitDrawer{ transition:none; }
}
/* Ensure gradient buttons always use white text */
.btn{
  color: #ffffff !important;
}

/* Keep secondary buttons readable */
.btn.secondary{
  color: var(--btn2Text) !important;
}

/* Ensure Settings dropdown overlays instead of pushing layout */
#settingsWrap{ display: none !important; }

#settingsMenu{
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  display: none;
  z-index: 9999;

  /* make it look like a proper floating menu */
  padding: 10px;
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

#settingsMenu.open{ display: block; }

/* make menu buttons full width like your class version */
#settingsMenu .btn{
  width: 100%;
  justify-content: flex-start;
}
/* ===== Fix background gradient seam (Chrome compositing artifact) ===== */
html, body{
  background: var(--bg);
}

body{
  /* disable the multi-gradient on body itself */
  background: none !important;
}

/* render the gradient wash as one fixed layer behind everything */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;

  background: var(--bg);

  background-repeat: no-repeat;
  transform: translateZ(0);
  will-change: transform;
}
/* =========================================================
   Modern Rounded Scrollbars (Cards, Modals, Panels)
   ========================================================= */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color:
    color-mix(in srgb, var(--text) 22%, transparent)
    transparent;
}

/* Webkit (Chrome / Edge / Safari) */
*::-webkit-scrollbar{
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track{
  background: transparent;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb{
  background: color-mix(in srgb, var(--border) 90%, var(--text) 20%);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
  transition: background 160ms ease, opacity 160ms ease;
  opacity: .7;
}

*::-webkit-scrollbar-thumb:hover{
  opacity: .9;
}

/* Make scrollbars inside cards feel embedded */
.card::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb,
.calGrid::-webkit-scrollbar-thumb,
.gcalWeekWrap::-webkit-scrollbar-thumb{
  background: color-mix(in srgb, var(--border) 85%, var(--text) 25%);
}

/* Dark mode tuning */
[data-theme="dark"] *::-webkit-scrollbar-thumb{
  opacity:.75;
}
/* =========================================================
   QR Scanner (html5-qrcode) — mobile-friendly styling
   ========================================================= */
.html5qr-modal-wrap{ width:100%; }

#html5qr-reader{
  width: 100% !important;
  max-width: 560px;
}

#html5qr-reader video,
#html5qr-reader__scan_region video{
  width: 100% !important;
  height: auto !important;
  border-radius: 14px !important;
}

#html5qr-reader__scan_region{
  border-radius: 14px !important;
  overflow: hidden !important;
}



/* =========================================================
   Studio Theme Picker (Workspace tab)
   ========================================================= */
.themeColor{
  width: 100%;
  height: 40px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  padding: 0;
  cursor: pointer;
}
.themeColor::-webkit-color-swatch-wrapper{ padding: 0; border-radius: 14px; }
.themeColor::-webkit-color-swatch{ border: none; border-radius: 14px; }

.studioThemeGrid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 860px){
  .studioThemeGrid{ grid-template-columns: 1fr; }
}

.studioThemeItem .label{
  margin-bottom: 6px;
}

.studioLockedWrap{
  opacity: .55;
  filter: grayscale(.25);
  pointer-events: none;
  user-select: none;
}

.studioLockNotice{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  border: 1px dashed color-mix(in srgb, var(--border) 70%, transparent);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
}

.btn:disabled,
button:disabled{
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* =========================================================
   Personality Animations
   ========================================================= */

/* ── Keyframes ──────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes navBounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); }
  70%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

@keyframes overdueGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  50%       { box-shadow: 0 0 0 5px rgba(239,68,68,0.28); }
}

@keyframes rippleOut {
  to { transform: scale(4); opacity: 0; }
}

@keyframes scanLine {
  0%   { top: 8%; }
  50%  { top: 86%; }
  100% { top: 8%; }
}

@keyframes donutDraw {
  from { stroke-dashoffset: var(--dash-total, 340); }
  to   { stroke-dashoffset: var(--dash-offset, 0); }
}

@keyframes progressBar {
  0%   { width: 0%; opacity: 1; }
  85%  { width: 90%; opacity: 1; }
  100% { width: 100%; opacity: 0; }
}

/* ── Page-load progress bar ─────────────────────────────── */
#pageProgress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--accentA);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  border-radius: 0 2px 2px 0;
}
#pageProgress.running {
  animation: progressBar 1.8s var(--ease) forwards;
}

/* ── Card entry stagger ─────────────────────────────────── */
.card {
  opacity: 0;
  animation: fadeUp 320ms var(--ease) forwards;
}
.card:nth-child(1)  { animation-delay:  30ms; }
.card:nth-child(2)  { animation-delay:  70ms; }
.card:nth-child(3)  { animation-delay: 110ms; }
.card:nth-child(4)  { animation-delay: 150ms; }
.card:nth-child(5)  { animation-delay: 190ms; }
.card:nth-child(6)  { animation-delay: 230ms; }
.card:nth-child(7)  { animation-delay: 270ms; }
.card:nth-child(8)  { animation-delay: 310ms; }
.card:nth-child(n+9){ animation-delay: 350ms; }

/* list items inside cards slide in from left */
.card .listItem {
  opacity: 0;
  animation: slideInLeft 240ms var(--ease) forwards;
}
.card .listItem:nth-child(1) { animation-delay: 100ms; }
.card .listItem:nth-child(2) { animation-delay: 140ms; }
.card .listItem:nth-child(3) { animation-delay: 180ms; }
.card .listItem:nth-child(4) { animation-delay: 220ms; }
.card .listItem:nth-child(5) { animation-delay: 260ms; }
.card .listItem:nth-child(n+6){ animation-delay: 300ms; }

/* skeleton cards must not animate */
.skCard, .skCard .listItem {
  animation: none !important;
  opacity: 1 !important;
}

/* ── Nav active bounce ──────────────────────────────────── */
.nav a.active {
  animation: navBounce 300ms var(--ease) forwards;
}

/* ── Overdue badge pulse ────────────────────────────────── */
.badge.overdue {
  background: var(--danger);
  color: #fff;
  animation: overdueGlow 2s ease-in-out infinite;
}

/* ── Ripple effect on buttons ───────────────────────────── */
.btn {
  overflow: hidden;
  position: relative;
}
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  margin-left: -20px;
  background: rgba(255,255,255,0.35);
  pointer-events: none;
  transform: scale(0);
  animation: rippleOut 500ms var(--ease) forwards;
}
.btn.secondary .ripple {
  background: rgba(37,99,235,0.12);
}
.btn.danger .ripple {
  background: rgba(255,255,255,0.25);
}

/* ── QR scan line ───────────────────────────────────────── */
.qrScanLine {
  position: absolute;
  left: 6%; right: 6%;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    var(--accentA) 30%,
    var(--accentA) 70%,
    transparent
  );
  border-radius: 2px;
  box-shadow: 0 0 6px color-mix(in srgb, var(--accentA) 50%, transparent);
  animation: scanLine 2s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

/* ── Row/list flash on state change ─────────────────────── */
@keyframes flashGreen {
  0%   { background: color-mix(in srgb, #22c55e 18%, transparent); }
  100% { background: transparent; }
}
@keyframes flashBlue {
  0%   { background: color-mix(in srgb, var(--accentA) 14%, transparent); }
  100% { background: transparent; }
}
.flash-green { animation: flashGreen 600ms var(--ease) forwards; }
.flash-blue  { animation: flashBlue 600ms var(--ease) forwards; }

/* ── Gear shimmer on card hover ─────────────────────────── */
.teamProfileCard::after,
.card.teamCard::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255,255,255,0.07) 50%,
    transparent 60%
  );
  background-size: 200% 100%;
  background-position: 200% 0;
  transition: background-position 500ms ease;
  pointer-events: none;
}
.teamProfileCard:hover::after,
.card.teamCard:hover::after {
  background-position: -100% 0;
}

/* =========================================================
   Kit View Sheet (2D slide-up)
   ========================================================= */

@keyframes kitSheetIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes kitSheetOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(12px); }
}
@keyframes kitOverlayIn  { from { background: rgba(0,0,0,0); } to { background: rgba(0,0,0,.45); } }
@keyframes kitOverlayOut { from { background: rgba(0,0,0,.45); } to { background: rgba(0,0,0,0); } }

.kitViewOverlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
  background: rgba(0,0,0,0);
}
.kitViewOverlay.kitViewOpen {
  animation: kitOverlayIn 220ms ease forwards;
}
.kitViewOverlay.kitViewClosing {
  animation: kitOverlayOut 240ms ease forwards;
}
.kitViewOverlay.kitViewClosing .kitViewSheet {
  animation: kitSheetOut 240ms var(--ease) forwards;
}

.kitViewSheet {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: min(580px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  animation: kitSheetIn 240ms var(--ease) forwards;
}

.kitViewHeader {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
}

.kitViewThumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--panel) 80%, var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
}

.kitViewFooter {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

/* ── Overdue warning banner ─────────────────────────────── */
.dashOverdueWarn {
  background: var(--danger);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  animation: fadeUp 320ms var(--ease) forwards;
  opacity: 0;
}
.dashOverdueWarn a {
  color: inherit;
}
:root { --logo-invert: 0; }
[data-theme="dark"] { --logo-invert: 1; }

.brand-logo {
  height: 28px;
  width: auto;
  /* no filter = natural colors in light mode */
}

[data-theme="dark"] .brand-logo {
  filter: brightness(0) invert(1);
}
.bh-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #666;
  text-decoration: none;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-top: 6px;
  transition: border-color 0.2s, color 0.2s;
}
.bh-search-btn:hover {
  border-color: #333;
  color: #333;
}
