/* ==========================================================================
   WAVHub 3D design layer — Apple depth & glass · Slack sidebar · Monday color
   Loaded after app.css. Styles:  :root[data-style="wavhub" | "apple" | "slack" | "monday"]
   ========================================================================== */

:root {
  --r: 16px;
  --r-sm: 10px;
  --r-lg: 22px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --card-top: #ffffff;
  --card-border: rgba(15, 23, 42, .06);
  --hl: inset 0 1px 0 rgba(255, 255, 255, .9);
  --elev-1: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 12px -2px rgba(15, 23, 42, .06);
  --elev-2: 0 2px 4px rgba(15, 23, 42, .05), 0 12px 28px -6px rgba(15, 23, 42, .14);
  --elev-3: 0 8px 16px -4px rgba(15, 23, 42, .10), 0 28px 56px -12px rgba(15, 23, 42, .28);
  --glass: color-mix(in srgb, var(--card) 72%, transparent);
  --glass-border: rgba(255, 255, 255, .55);
  /* Monday.com-inspired status palette */
  --m-green: #00c875; --m-orange: #fdab3d; --m-red: #e2445c; --m-purple: #a25ddc;
  --m-blue: #579bfc; --m-teal: #00a9a5; --m-pink: #ff5ac4; --m-grey: #8d93a5; --m-dark: #323338;
  --bg: #f5f5f7;
}
:root[data-theme="dark"] {
  --card-top: #313133;
  --card: #29292b;
  --bg: #1c1c1e;
  --card-border: rgba(255, 255, 255, .06);
  --hl: inset 0 1px 0 rgba(255, 255, 255, .06);
  --elev-1: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px -2px rgba(0, 0, 0, .35);
  --elev-2: 0 2px 4px rgba(0, 0, 0, .4), 0 12px 28px -6px rgba(0, 0, 0, .5);
  --elev-3: 0 8px 16px -4px rgba(0, 0, 0, .5), 0 28px 56px -12px rgba(0, 0, 0, .65);
  --glass-border: rgba(255, 255, 255, .08);
}

/* ---------- Animated ambient background (Apple-style soft color glow) ---------- */
body { background: var(--bg); }
body::before {
  content: ""; position: fixed; inset: -25%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 32% at 18% 12%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(34% 30% at 88% 18%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    radial-gradient(40% 34% at 70% 92%, color-mix(in srgb, var(--accent2) 13%, transparent), transparent 70%);
  animation: drift 32s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(4%, -3%, 0) rotate(8deg) scale(1.05); } }

/* ---------- Glass top bar ---------- */
.topbar {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--card-border);
}
.topbar::after { background-size: 200% 100%; animation: flow 8s linear infinite; height: 2px; }
@keyframes flow { to { background-position: 200% 0; } }
.search input { border-radius: 12px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06); }
.icon-btn { border-radius: 12px; transition: background .2s, transform .25s var(--spring); }
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active { transform: scale(.92); }
#bell.ring svg { animation: ring .9s var(--ease); transform-origin: 50% 0; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }
.icon-btn .dot { box-shadow: 0 0 0 2px var(--card); animation: pop-in .4s var(--spring); }

/* ---------- Sidebar (Slack-style navigation) ---------- */
.sidebar {
  background-color: var(--side);
  background-image: radial-gradient(120% 40% at 0% 0%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(0, 0, 0, .12));
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .04);
}
.nav a { border-radius: 10px; transition: background .2s, color .2s, transform .3s var(--spring); }
.nav a:hover { transform: translateX(3px); }
.nav a:hover svg { animation: icon-pop .45s var(--spring); }
.nav a.active {
  background-size: 200% 100%; animation: flow 10s linear infinite;
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--brand) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -1px 0 rgba(0, 0, 0, .12);
}
.nav a .count { box-shadow: 0 2px 6px rgba(239, 68, 68, .45); }
@keyframes icon-pop { 40% { transform: scale(1.25) rotate(-8deg); } }
.logo .mark, .logo .mark-img { transition: transform .5s var(--spring); }
.logo:hover .mark, .logo:hover .mark-img { transform: rotate(-8deg) scale(1.08); }
.side-foot .avatar { position: relative; overflow: visible; }
.side-foot .avatar::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: #2bac76; box-shadow: 0 0 0 2px var(--side); }

:root[data-sidebar="slack"] { --side: #3f0e40; --side-2: #521653; --side-text: #eadcea; --side-muted: #b99fbb; }
:root[data-sidebar="slack"] .sidebar { background-image: linear-gradient(180deg, #4a154b, #350d36); }
:root[data-sidebar="glass"] { --side: color-mix(in srgb, var(--card) 62%, transparent); --side-2: color-mix(in srgb, var(--text) 7%, transparent); --side-text: var(--text-2); --side-muted: var(--muted); }
:root[data-sidebar="glass"] .sidebar { -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); background-image: none; border-right: 1px solid var(--card-border); }
:root[data-sidebar="glass"] .logo, :root[data-sidebar="glass"] .side-foot .who b, :root[data-sidebar="glass"] .nav a:hover { color: var(--text); }
:root[data-sidebar="light"] .sidebar { background-image: none; }

/* ---------- Cards: layered depth + hover lift ---------- */
.card, .kpi {
  border-radius: var(--r);
  border: 1px solid var(--card-border);
  background: linear-gradient(180deg, var(--card-top), var(--card));
  box-shadow: var(--elev-1), var(--hl);
}
.card { transition: box-shadow .35s var(--ease), transform .35s var(--ease); }
.card-h { border-bottom-color: var(--card-border); }
.card-h h3 { letter-spacing: -.01em; }
.kpi { transition: transform .25s var(--ease), box-shadow .35s var(--ease); will-change: transform; transform-style: preserve-3d; }
.kpi:hover, .tpl-card:hover { box-shadow: var(--elev-3), var(--hl); }
.kpi::after, .tpl-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .28), transparent 45%);
}
.kpi:hover::after, .tpl-card:hover::after { opacity: 1; }
:root[data-theme="dark"] .kpi::after, :root[data-theme="dark"] .tpl-card::after { background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .07), transparent 45%); }
.kpi .val { letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi .ico { transition: transform .5s var(--spring); transform: translateZ(20px); }
.kpi:hover .ico { transform: translateZ(30px) translateY(-2px) rotate(-8deg) scale(1.08); }
.tpl-card { position: relative; transition: transform .25s var(--ease), box-shadow .35s var(--ease); }

/* ---------- Glossy 3D icon tiles (Apple app-icon style, Monday colors) ---------- */
.tone-brand, .tone-ok, .tone-info, .tone-violet, .tone-warn, .tone-bad, .tone-pink, .tone-teal {
  color: #fff !important;
  box-shadow: 0 6px 14px -5px var(--tile-shadow), inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -2px 0 rgba(0, 0, 0, .14);
  border-radius: 11px;
}
.tone-brand { background: linear-gradient(150deg, color-mix(in srgb, var(--brand) 70%, #fff), var(--brand) 50%, color-mix(in srgb, var(--brand) 80%, #000)) !important; color: var(--on-brand) !important; --tile-shadow: var(--brand); }
.tone-ok { background: linear-gradient(150deg, #5ee0a8, var(--m-green) 50%, #00a35e) !important; --tile-shadow: var(--m-green); }
.tone-info { background: linear-gradient(150deg, #8fbcff, var(--m-blue) 50%, #2f7de1) !important; --tile-shadow: var(--m-blue); }
.tone-violet { background: linear-gradient(150deg, #c99bf2, var(--m-purple) 50%, #7f3dbd) !important; --tile-shadow: var(--m-purple); }
.tone-warn { background: linear-gradient(150deg, #ffd08a, var(--m-orange) 50%, #e58a12) !important; --tile-shadow: var(--m-orange); }
.tone-bad { background: linear-gradient(150deg, #f58799, var(--m-red) 50%, #c02a43) !important; --tile-shadow: var(--m-red); }
.tone-pink { background: linear-gradient(150deg, #ff9ad8, var(--m-pink) 50%, #d8309c) !important; --tile-shadow: var(--m-pink); }
.tone-teal { background: linear-gradient(150deg, #5fd6d2, var(--m-teal) 50%, #007f7c) !important; --tile-shadow: var(--m-teal); }
.tl-item .ti { border-radius: 50%; }
.list-item { transition: background .2s; }
.list-item:hover { background: var(--hover); }
.list-item:hover .type-ico { transform: scale(1.08) rotate(-6deg); }
.type-ico { transition: transform .4s var(--spring); }

/* ---------- 3D pressable buttons ---------- */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, var(--card-top), var(--surface-2));
  border-color: var(--card-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08), var(--hl);
  transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .2s, filter .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -4px rgba(15, 23, 42, .18), var(--hl); filter: none; }
.btn:active { transform: translateY(1px) scale(.97); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .14); transition-duration: .06s; }
.btn.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 72%, #fff), var(--brand) 48%, color-mix(in srgb, var(--brand) 86%, #000));
  border-color: color-mix(in srgb, var(--brand) 78%, #000);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--brand) 55%, #000), 0 8px 18px -6px color-mix(in srgb, var(--brand) 75%, transparent), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn.primary:hover { box-shadow: 0 1px 0 color-mix(in srgb, var(--brand) 55%, #000), 0 12px 24px -6px color-mix(in srgb, var(--brand) 85%, transparent), inset 0 1px 0 rgba(255, 255, 255, .5); filter: brightness(1.03); }
.btn.ok { background: linear-gradient(180deg, #33d894, var(--m-green) 50%, #00a860); border-color: #00a35e; box-shadow: 0 6px 14px -6px var(--m-green), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn.danger.solid { background: linear-gradient(180deg, #ee6a7e, var(--m-red) 50%, #c62f48); border-color: #c02a43; box-shadow: 0 6px 14px -6px var(--m-red), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); box-shadow: none; }
.btn:disabled { transform: none; box-shadow: none; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .22; transform: scale(0); animation: ripple .65s var(--ease) forwards; pointer-events: none; z-index: -1; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* Apple segmented control */
.btn-group { background: var(--surface-3); padding: 3px; border-radius: 999px; gap: 2px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .08); }
.btn-group .btn { border: 0 !important; background: transparent; box-shadow: none; border-radius: 999px !important; margin: 0 !important; color: var(--muted); }
.btn-group .btn:hover { transform: none; color: var(--text); background: transparent; }
.btn-group .btn.active { background: var(--card-top); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 1px 1px rgba(0, 0, 0, .06), var(--hl); }

/* ---------- Inputs (Apple) ---------- */
input, select, textarea { border-radius: var(--r-sm); border-color: var(--border); background: var(--card-top); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .04); transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); }
/* iOS toggle switches for labelled checkboxes */
label.chk > input[type=checkbox] {
  -webkit-appearance: none; appearance: none; width: 38px; height: 22px; border-radius: 999px; margin: 0; flex: none; cursor: pointer;
  background: var(--border-2); position: relative; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .18); transition: background .25s var(--ease);
}
label.chk > input[type=checkbox]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .25), 0 0 0 .5px rgba(0, 0, 0, .04); transition: transform .35s var(--spring);
}
label.chk > input[type=checkbox]:checked { background: #34c759; }
label.chk > input[type=checkbox]:checked::after { transform: translateX(16px); }
label.chk > input[type=checkbox]:disabled { opacity: .6; }

/* ---------- Monday-style status pills ---------- */
.badge { border-radius: 999px; padding: 3px 10px; letter-spacing: .01em; transition: transform .2s var(--spring); }
:root:not([data-style="apple"]) .badge { background: var(--m-grey); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px rgba(0, 0, 0, .1); }
:root:not([data-style="apple"]) .badge.ok { background: var(--m-green); color: #fff; }
:root:not([data-style="apple"]) .badge.warn { background: var(--m-orange); color: #fff; }
:root:not([data-style="apple"]) .badge.bad { background: var(--m-red); color: #fff; }
:root:not([data-style="apple"]) .badge.info { background: var(--m-blue); color: #fff; }
:root:not([data-style="apple"]) .badge.violet { background: var(--m-purple); color: #fff; }
:root:not([data-style="apple"]) .badge.teal { background: var(--m-teal); color: #fff; }
:root:not([data-style="apple"]) .badge.dark { background: var(--m-dark); color: #fff; }
:root:not([data-style="apple"]) .badge.brand { background: var(--brand); color: var(--on-brand); }
table.t td .badge:first-child { min-width: 96px; justify-content: center; }
tr:hover .badge { transform: scale(1.04); }
.tag { border-radius: 999px; padding: 1px 9px; }

/* ---------- Tables ---------- */
table.t th { background: transparent; border-bottom-color: var(--card-border); }
table.t td { border-bottom-color: var(--card-border); }
table.t tbody tr { transition: background .15s; }
table.t tbody tr:hover td { background: var(--hover); }
table.t tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--brand); }

/* ---------- Tabs ---------- */
.tabs { border-bottom-color: var(--card-border); }
.tabs button { transition: color .2s, border-color .3s var(--ease); border-radius: 10px 10px 0 0; }
.tabs button:hover { background: var(--hover); }

/* ---------- Kanban (Monday colored columns) ---------- */
.kcol { background: color-mix(in srgb, var(--surface-3) 80%, transparent); border-radius: var(--r); border-top: 4px solid var(--stage, var(--brand)); box-shadow: var(--hl); }
.kcard { border-radius: 12px; border: 1px solid var(--card-border); background: linear-gradient(180deg, var(--card-top), var(--card)); box-shadow: var(--elev-1), var(--hl); border-left: 4px solid var(--stage, var(--brand)); transition: transform .3s var(--spring), box-shadow .3s var(--ease); }
.kcard:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: var(--elev-2), var(--hl); }
.kcard.dragging { opacity: .6; transform: rotate(3deg) scale(1.03); }
.kcol-b.over { background: color-mix(in srgb, var(--stage, var(--brand)) 14%, transparent); }
:root[data-style="monday"] .kcol-h { background: var(--stage, var(--brand)); color: #fff; border-radius: 12px 12px 0 0; margin: -4px 0 6px; padding-top: 14px; }
:root[data-style="monday"] .kcol-h small { color: rgba(255, 255, 255, .85); }
:root[data-style="monday"] .kcol-h .stage-dot { background: #fff !important; }

/* ---------- Calendar ---------- */
.cal { border-radius: 0 0 var(--r) var(--r); overflow: hidden; }
.cal .ev { border-radius: 6px; transition: transform .2s var(--spring), box-shadow .2s; }
.cal .ev:hover { transform: translateY(-1px) scale(1.02); box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .3); }
.cal .day.today .dn { box-shadow: 0 4px 10px -3px color-mix(in srgb, var(--brand) 80%, transparent); }

/* ---------- Apple sheets: modals, dropdowns, toasts ---------- */
.backdrop { background: rgba(10, 10, 14, .38); -webkit-backdrop-filter: blur(8px) saturate(120%); backdrop-filter: blur(8px) saturate(120%); }
.modal { border-radius: var(--r-lg); box-shadow: var(--elev-3), var(--hl); animation: sheet-in .5s var(--spring); background: var(--card); }
.modal-h { border-bottom-color: var(--card-border); }
.modal-f { background: var(--surface-2); border-top-color: var(--card-border); border-radius: 0 0 var(--r-lg) var(--r-lg); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(26px) scale(.95); } }
.dropdown { background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); border: 1px solid var(--glass-border); border-radius: var(--r); box-shadow: var(--elev-3); animation: drop-in .35s var(--spring); transform-origin: top right; }
@keyframes drop-in { from { opacity: 0; transform: scale(.92) translateY(-6px); } }
.search-results { border-radius: var(--r); box-shadow: var(--elev-3); animation: drop-in .3s var(--spring); transform-origin: top center; }
.toast { background: color-mix(in srgb, #1c1c1e 86%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px; box-shadow: var(--elev-3); animation: toast-in .55s var(--spring); }
.toast.ok { background: color-mix(in srgb, #03734a 88%, transparent); }
.toast.bad { background: color-mix(in srgb, #9f1d33 88%, transparent); }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(.9); } }
.alert { border-radius: 12px; }

/* ---------- Page entrance (staggered) ---------- */
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.6); } }
.content > * { animation: fade-up .55s var(--ease) both; }
.content > *:nth-child(2) { animation-delay: .05s; } .content > *:nth-child(3) { animation-delay: .1s; }
.content > *:nth-child(4) { animation-delay: .15s; } .content > *:nth-child(5) { animation-delay: .2s; } .content > *:nth-child(n+6) { animation-delay: .25s; }
.kpis > .kpi { animation: fade-up .6s var(--ease) both; }
.kpis > .kpi:nth-child(2) { animation-delay: .04s; } .kpis > .kpi:nth-child(3) { animation-delay: .08s; } .kpis > .kpi:nth-child(4) { animation-delay: .12s; }
.kpis > .kpi:nth-child(5) { animation-delay: .16s; } .kpis > .kpi:nth-child(6) { animation-delay: .2s; } .kpis > .kpi:nth-child(7) { animation-delay: .24s; } .kpis > .kpi:nth-child(8) { animation-delay: .28s; }
.kpis > .kpi:nth-child(n+9) { animation-delay: .32s; }
.grid > .card, .tpl-grid > .card, .kanban > .kcol { animation: fade-up .6s var(--ease) both; }
.grid > .card:nth-child(2), .tpl-grid > .card:nth-child(2), .kanban > .kcol:nth-child(2) { animation-delay: .07s; }
.grid > .card:nth-child(3), .tpl-grid > .card:nth-child(3), .kanban > .kcol:nth-child(3) { animation-delay: .14s; }
.grid > .card:nth-child(n+4), .tpl-grid > .card:nth-child(n+4), .kanban > .kcol:nth-child(n+4) { animation-delay: .2s; }
.wave-hand { display: inline-block; transform-origin: 70% 70%; animation: wave-hand 2.2s ease-in-out .4s 1; }
@keyframes wave-hand { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
.funnel-row .bar > div { transform-origin: left; animation: grow 1s var(--ease) both .2s; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.progress > div { animation: grow 1s var(--ease) both .2s; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }

/* ---------- Skeleton loading (shimmer) ---------- */
.skeleton { display: grid; gap: 16px; }
.sk { border-radius: var(--r); background: linear-gradient(90deg, var(--surface-3) 25%, color-mix(in srgb, var(--surface-3) 40%, var(--card)) 50%, var(--surface-3) 75%); background-size: 300% 100%; animation: shimmer 1.3s linear infinite; }
.sk-title { height: 30px; width: 280px; border-radius: 10px; }
.sk-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.sk-kpi { height: 104px; }
.sk-block { height: 280px; }
@keyframes shimmer { to { background-position: -300% 0; } }

/* ---------- Login: glass card + floating 3D proposal stack ---------- */
.login-form { background: transparent; position: relative; }
.login-form form {
  background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--glass-border); border-radius: 26px; padding: 38px 34px; box-shadow: var(--elev-3), var(--hl); animation: sheet-in .8s var(--spring);
}
.login-art .logo .mark-img { animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px) rotate(-3deg); } }
.hero3d { position: relative; height: 210px; perspective: 900px; margin: 10px 0 -10px; }
.hero3d .h3 {
  position: absolute; left: 0; width: 280px; padding: 14px 16px; border-radius: 16px; display: flex; gap: 12px; align-items: center;
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14); color: #fff;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .18);
  transform-style: preserve-3d; animation: card-float 7s ease-in-out infinite;
}
.hero3d .h3 b { display: block; font-size: 14px; }
.hero3d .h3 small { opacity: .75; font-size: 12px; }
.hero3d .h3 .type-ico { width: 38px; height: 38px; }
.hero3d .h3:nth-child(1) { top: 0; --rx: 14deg; --ry: -18deg; --tz: 0px; }
.hero3d .h3:nth-child(2) { top: 64px; left: 60px; --rx: 14deg; --ry: -18deg; --tz: 40px; animation-delay: -2.3s; }
.hero3d .h3:nth-child(3) { top: 128px; left: 120px; --rx: 14deg; --ry: -18deg; --tz: 80px; animation-delay: -4.6s; }
@keyframes card-float {
  0%, 100% { transform: rotateX(var(--rx)) rotateY(var(--ry)) translateZ(var(--tz)) translateY(0); }
  50% { transform: rotateX(calc(var(--rx) - 4deg)) rotateY(calc(var(--ry) + 6deg)) translateZ(var(--tz)) translateY(-10px); }
}

/* ---------- Style variants ---------- */
/* Apple: calm, light-first, soft tinted pills, glass everywhere */
:root[data-style="apple"] { --r: 18px; --r-lg: 24px; }
:root[data-style="apple"] body::before { opacity: .6; }
:root[data-style="apple"] .badge { box-shadow: none; }
:root[data-style="apple"] .kpi .ico { border-radius: 12px; }
/* Slack: compact density */
:root[data-style="slack"] .nav a { padding: 7px 10px; font-weight: 600; }
:root[data-style="slack"] .card, :root[data-style="slack"] .kpi { --r: 12px; }
/* Monday: bold & colorful */
:root[data-style="monday"] { --r: 14px; }
:root[data-style="monday"] .page-head h1 { font-weight: 800; }
:root[data-style="monday"] table.t td .badge:first-child { min-width: 128px; border-radius: 6px; padding: 5px 10px; }

/* Style picker cards (Company Settings) */
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.style-card { display: flex; flex-direction: column; justify-content: flex-start; border: 2px solid var(--card-border); border-radius: 14px; padding: 10px; cursor: pointer; background: var(--card-top); box-shadow: var(--elev-1); transition: transform .3s var(--spring), border-color .2s, box-shadow .3s; text-align: left; font: inherit; color: var(--text); }
.style-card:hover { transform: translateY(-3px); box-shadow: var(--elev-2); }
.style-card.active { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent), var(--elev-2); }
.style-card .mini { height: 74px; border-radius: 10px; display: grid; grid-template-columns: 30% 1fr; overflow: hidden; margin-bottom: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.style-card .mini i { display: block; }
.style-card .mini .m { padding: 8px; display: grid; gap: 5px; align-content: start; }
.style-card .mini .m span { height: 8px; border-radius: 4px; display: block; }
.style-card b { display: block; font-size: 13px; }
.style-card small { color: var(--muted); font-size: 11.5px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 18%, transparent); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--text) 30%, transparent); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Accessibility: honour reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .kpi, .tpl-card { transform: none !important; }
}

/* ==========================================================================
   Readability & light-mode polish (WCAG AA contrast)
   ========================================================================== */
:root {
  --bg: #eceef2;                          /* cards (#fff) now lift off the page */
  --brand-strong: #c97a00;                /* set at runtime: brand at ≥3:1 on white */
  --focus: var(--brand-strong);
  --chart-brand: var(--brand-strong);
  --card-border: rgba(15, 23, 42, .08);
  --elev-1: 0 1px 2px rgba(15, 23, 42, .06), 0 6px 16px -4px rgba(15, 23, 42, .10);
}
:root[data-theme="dark"] { --bg: #1c1c1e; --focus: var(--brand); --chart-brand: var(--brand); --card-border: rgba(255, 255, 255, .06); }

/* Keyboard focus that is always visible */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 25%, transparent); outline: none; }
.tabs button.active { border-bottom-color: var(--focus); }
.style-card.active { border-color: var(--focus); }

/* Status pills: vivid Monday colors, text color chosen for ≥4.5:1 */
:root:not([data-style="apple"]) .badge { background: #c9ccd6; color: #262a33; }
/* dark default must come before the colored variants (same specificity) */
:root[data-theme="dark"]:not([data-style="apple"]) .badge { background: #4a4d57; color: #eef0f4; }
:root:not([data-style="apple"]) .badge.ok { background: var(--m-green); color: #04321c; }
:root:not([data-style="apple"]) .badge.warn { background: var(--m-orange); color: #3d2400; }
:root:not([data-style="apple"]) .badge.info { background: var(--m-blue); color: #061e47; }
:root:not([data-style="apple"]) .badge.teal { background: var(--m-teal); color: #002e2c; }
:root:not([data-style="apple"]) .badge.bad { background: #d83350; color: #fff; }
:root:not([data-style="apple"]) .badge.violet { background: #9148d1; color: #fff; }
:root:not([data-style="apple"]) .badge.brand { background: var(--brand); color: var(--on-brand); }
:root:not([data-style="apple"]) .badge.dark { background: var(--m-dark); color: #fff; }
/* Apple style keeps soft tinted pills — deepen their text for contrast */
:root[data-style="apple"] .badge.ok { color: #046c3f; }
:root[data-style="apple"] .badge.warn { color: #8a4b00; }
:root[data-style="apple"] .badge.info { color: #1450b8; }
:root[data-style="apple"] .badge.bad { color: #b3203a; }
:root[data-style="apple"] .badge.violet { color: #6b2fb3; }
:root[data-style="apple"] .badge.teal { color: #006e6a; }

/* Buttons with white text on color: darker fills so labels stay readable */
.btn.ok { background: linear-gradient(180deg, #13a563, #00804a 50%, #006b3e); border-color: #006b3e; box-shadow: 0 6px 14px -6px #00804a, inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn.danger.solid { background: linear-gradient(180deg, #e2516a, #d83350 50%, #b92641); border-color: #b92641; }
:root:not([data-theme="dark"]) .btn.danger { color: #c0283f; }

/* Glossy icon tiles: soft shadow under white glyphs so they read on bright colors */
.tone-ok svg, .tone-info svg, .tone-warn svg, .tone-teal svg, .tone-pink svg, .tone-violet svg, .tone-bad svg { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }

/* Muted text a touch darker on the new light background */
:root:not([data-theme="dark"]) { --muted: #5f6673; }

/* Replies inbox */
.nav a .count.green { background: var(--m-green); color: #04321c; box-shadow: 0 2px 6px rgba(0, 200, 117, .45); }
.rp-item.unread { background: color-mix(in srgb, var(--m-green) 6%, transparent); }
.rp-item.unread .t1::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--m-green); margin-right: 7px; vertical-align: 1px; }

/* Command Center */
.autopilot-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: 999px; font-weight: 650; font-size: 12.5px;
  background: color-mix(in srgb, var(--m-green) 14%, var(--card)); color: color-mix(in srgb, var(--m-green) 70%, var(--text)); border: 1px solid color-mix(in srgb, var(--m-green) 35%, transparent); }
.autopilot-pill svg { animation: spin-slow 6s linear infinite; }
@keyframes spin-slow { to { transform: rotate(360deg); } }
.nav a .count.amber { background: var(--m-orange); color: #3d2400; box-shadow: 0 2px 6px rgba(253, 171, 61, .45); }

/* Sequence builder */
.seq-steps { position: relative; display: grid; gap: 14px; }
.seq-step { position: relative; padding-left: 46px; }
.seq-step::before { content: ""; position: absolute; left: 17px; top: 40px; bottom: -18px; width: 2px; background: var(--card-border); }
.seq-step:last-child::before { display: none; }
.seq-step .dot { position: absolute; left: 0; top: 14px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.seq-step .when { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.seq-card { display: flex; flex-direction: column; gap: 10px; }
.seq-card .stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.seq-card .stats b { color: var(--text); font-size: 15px; display: block; }

/* Smart Upload wizard */
.up-steps { display: flex; gap: 6px; margin-left: 16px; flex-wrap: wrap; }
.up-steps span { font-size: 12px; font-weight: 650; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: var(--surface-3); display: inline-flex; gap: 5px; align-items: center; }
.up-steps span.on { background: var(--brand); color: var(--on-brand); box-shadow: 0 4px 10px -4px var(--brand); }
.up-steps span.done { background: color-mix(in srgb, var(--m-green) 18%, transparent); color: color-mix(in srgb, var(--m-green) 60%, var(--text)); }
.up-steps svg { width: 13px; height: 13px; }
.up-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 700px) { .up-summary { grid-template-columns: repeat(2, 1fr); } .up-steps { display: none; } }
.chip.on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.chip b { margin-left: 4px; }
.quality { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.quality .progress { flex: 1; height: 7px; }
.quality b { font-variant-numeric: tabular-nums; min-width: 26px; text-align: right; }

/* Floating quick-add (phones) */
.fab { display: none; position: fixed; right: 18px; bottom: 22px; width: 58px; height: 58px; border-radius: 50%; border: 0; z-index: 80; cursor: pointer;
  background: linear-gradient(150deg, color-mix(in srgb, var(--brand) 70%, #fff), var(--brand) 50%, color-mix(in srgb, var(--brand) 82%, #000)); color: var(--on-brand);
  box-shadow: 0 12px 28px -8px color-mix(in srgb, var(--brand) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, .5); transition: transform .3s var(--spring); }
.fab svg { width: 24px; height: 24px; }
.fab:active { transform: scale(.9); }
@media (max-width: 900px) {
  .fab { display: grid; place-items: center; }
  #quick-contact, #quick-task { display: none; }
  .topbar .btn.primary.sm span { display: none; }
  .page-head .actions { width: 100%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toasts { left: 12px; right: 12px; bottom: 90px; }
  .toast { max-width: none; }
}

/* Booking settings */
.bk-hours { display: grid; gap: 8px; margin-top: 8px; }
.bk-hours input[type=time] { width: 120px; }
.bk-hours input:disabled { opacity: .45; }
