/* ==========================================================
   BOSS — Business Operating Success System
   Dashboard mockup styles
   ========================================================== */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --border: #e7ebf3;
  --border-strong: #d6dcea;
  --text: #19213a;
  --muted: #667089;
  --faint: #98a1b8;

  --primary: #3358e6;
  --primary-dark: #2748c9;
  --primary-soft: #e8eefe;

  --green: #1fa35c;       --green-soft: #e2f6ea;
  --blue: #3f6df0;        --blue-soft: #e6edff;
  --red: #e5484d;         --red-soft: #fdeaea;
  --orange: #f26b2d;      --orange-soft: #fff1e8;
  --purple: #9a3df0;      --purple-soft: #f3e8ff;
  --violet: #6c4bf0;      --violet-soft: #eeeaff;
  --indigo: #4a5de0;      --indigo-soft: #eaecfd;
  --cyan: #1394d8;        --cyan-soft: #e1f3fd;

  --accent: var(--orange);      /* active business module (set from JS) */
  --accent-soft: var(--orange-soft);

  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(25, 33, 58, .04), 0 4px 14px rgba(25, 33, 58, .05);
  --shadow-hover: 0 2px 4px rgba(25, 33, 58, .05), 0 10px 26px rgba(25, 33, 58, .10);

  --topbar-h: 72px;
  --sidebar-w: 250px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; text-align: left; -webkit-tap-highlight-color: transparent; }
hr { border: 0; border-top: 1px solid var(--border); margin: 10px 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Layout shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) 1fr;
  min-height: 100vh;
}

/* ---------- Top bar ---------- */
.topbar {
  grid-column: 1 / -1;
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; width: calc(var(--sidebar-w) - 40px); flex: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: #1c2a52; color: #fff; display: grid; place-items: center; }
.brand-mark .icon { width: 24px; height: 24px; fill: rgba(255,255,255,.18); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-text strong { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: #1c2a52; }
.brand-text small { font-size: 9.5px; font-weight: 600; letter-spacing: .02em; color: var(--muted); white-space: nowrap; margin-top: 2px; }

.menu-wrap { position: relative; }
.select-btn, .shop-pill {
  display: inline-flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 16px;
  border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface); font-size: 15px; font-weight: 500; white-space: nowrap;
  transition: border-color .15s, box-shadow .15s, transform .12s var(--ease), background .15s;
}
.select-btn { min-width: 204px; justify-content: space-between; }
.select-btn:hover { border-color: #b9c3dc; box-shadow: 0 2px 8px rgba(25,33,58,.07); }
.shop-pill {
  gap: 8px; font-weight: 600; font-size: 14.5px;
  color: var(--accent); background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}
.shop-pill:hover { box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 25%, transparent); }
.select-btn:active, .shop-pill:active { transform: scale(.97); }
.chev { width: 16px; height: 16px; transition: transform .2s var(--ease); }
[aria-expanded="true"] > .chev { transform: rotate(180deg); }

.search {
  flex: 1; max-width: 560px; height: 46px; margin-left: 8px;
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: #f1f4f9; border: 1px solid transparent; border-radius: 12px;
  color: var(--muted); cursor: text;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.search:hover { background: #ebeff6; }
.search:focus-within { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(51,88,230,.12); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14.5px; color: var(--text); }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd {
  font: 600 11px/1 "Inter", sans-serif; color: var(--faint);
  border: 1px solid var(--border-strong); border-radius: 6px; padding: 4px 7px; background: #fff;
}
.search:focus-within kbd { opacity: 0; }

.icon-btn {
  position: relative; width: 44px; height: 44px; border-radius: 12px; margin-left: auto;
  display: grid; place-items: center; color: #27304d;
  transition: background .15s, transform .12s var(--ease);
}
.search + .menu-wrap .icon-btn { margin-left: 0; }
.icon-btn:hover { background: #eef1f8; }
.icon-btn:active { transform: scale(.92); }
.bell-dot {
  position: absolute; top: 9px; right: 11px; width: 9px; height: 9px;
  background: var(--red); border: 2px solid #fff; border-radius: 50%;
  transition: transform .2s var(--ease), opacity .2s;
}
.bell-dot.is-read { transform: scale(0); opacity: 0; }
.bell:hover .icon { animation: ring .6s var(--ease); transform-origin: 50% 0; }
@keyframes ring { 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(7deg); } 80% { transform: rotate(-4deg); } }

.menu-toggle { display: none; margin-left: 0; }

.user {
  display: flex; align-items: center; gap: 12px; padding: 5px 8px 5px 5px; border-radius: 14px;
  transition: background .15s, transform .12s var(--ease);
}
.user:hover { background: #eef1f8; }
.user:active { transform: scale(.97); }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(140deg, #f7b58a, #e36a8b 60%, #8a5be0);
  color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .02em;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--border);
}
.avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.user-text { display: flex; flex-direction: column; line-height: 1.2; }
.user-text strong { font-size: 15px; font-weight: 600; }
.user-text small { font-size: 12.5px; color: var(--muted); }

/* ---------- Dropdown menus ---------- */
.menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; min-width: 230px;
  padding: 8px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 14px 40px rgba(25,33,58,.16);
  transform-origin: top left; animation: pop .16s var(--ease);
}
.menu-right { left: auto; right: 0; transform-origin: top right; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.menu-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 6px 10px 8px; }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: 9px;
  font-size: 14px; font-weight: 500; transition: background .12s, transform .1s;
}
.menu-item .icon { width: 18px; height: 18px; color: var(--muted); }
.menu-item:hover, .menu-item:focus-visible { background: #f1f4fb; }
.menu-item:active { transform: scale(.98); }
.menu-item.accent { color: var(--primary); }
.menu-item.accent .icon { color: var(--primary); }
/* the check icon only shows on the selected item */
.menu-item[data-workspace] .icon, .menu-item[data-shop] .icon { opacity: 0; color: var(--primary); }
.menu-item.is-selected .icon { opacity: 1 !important; }
.menu-item.is-selected { font-weight: 600; }
.menu-item[data-shop] { gap: 10px; }
.menu-item[data-shop] .shop-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--s-soft); color: var(--s-accent); }
.menu-item[data-shop] .shop-ic .icon { width: 16px; height: 16px; opacity: 1; color: inherit; }
.menu-item[data-shop] .shop-name { flex: 1; }
.menu-item[data-shop] .tick { width: 16px; height: 16px; opacity: 0; color: var(--primary); }
.menu-item[data-shop].is-selected .tick { opacity: 1; }

.notif-menu { width: 340px; }
.notif {
  width: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 10px;
  transition: background .12s, transform .1s;
}
.notif:hover { background: #f1f4fb; }
.notif:active { transform: scale(.98); }
.notif b { display: block; font-size: 13.5px; font-weight: 600; }
.notif small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.notif-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.notif-ic .icon { width: 18px; height: 18px; }
.notif-ic.blue { background: var(--blue-soft); color: var(--blue); }
.notif-ic.orange { background: var(--orange-soft); color: var(--orange); }
.notif-ic.green { background: var(--green-soft); color: var(--green); }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: var(--topbar-h); align-self: start;
  height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
  padding: 16px 16px 20px; background: var(--surface); border-right: 1px solid var(--border);
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav hr { margin: 12px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 16px; width: 100%; height: 48px; padding: 0 16px;
  border-radius: 12px; font-size: 16px; font-weight: 500; color: #2a3350;
  transition: background .15s, color .15s, transform .12s var(--ease), padding .2s var(--ease);
}
.nav-item .icon { width: 22px; height: 22px; color: #3d4766; transition: color .15s, transform .2s var(--ease); }
.nav-item:hover { background: #f1f4fb; padding-left: 20px; }
.nav-item:hover .icon { transform: scale(1.1); }
.nav-item:active { transform: scale(.97); }
.nav-item.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item.is-active .icon { color: var(--primary); }
.nav-item.is-active:hover { padding-left: 16px; }

.privacy-card {
  padding: 16px 14px 14px; border: 1px solid var(--border); border-radius: 16px; background: #fff;
  box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s var(--ease);
}
.privacy-card:hover { box-shadow: var(--shadow-hover); }
.privacy-head { display: flex; align-items: center; gap: 8px; }
.privacy-head > .icon { width: 22px; height: 22px; color: #3d4766; }
.privacy-head strong { font-size: 15px; font-weight: 600; flex: 1; white-space: nowrap; }
.privacy-card p { margin: 10px 0 12px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 500; font-size: 14px; }
.link-btn .icon { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.link-btn:hover span { text-decoration: underline; }
.link-btn:hover .icon { transform: translateX(4px); }
.link-btn:active { opacity: .7; }

.switch {
  position: relative; width: 46px; height: 26px; border-radius: 99px; flex: none;
  background: #cdd4e4; transition: background .2s, transform .12s var(--ease);
}
.switch span {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .22s var(--ease), width .15s;
}
.switch.is-on { background: var(--primary); }
.switch.is-on span { transform: translateX(20px); }
.switch:active span { width: 24px; }
.switch.is-on:active span { transform: translateX(16px); }

/* ---------- Main ---------- */
.main { padding: 0 24px 28px; min-width: 0; }

/* entrance animation */
.reveal { animation: rise .55s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Hero ---------- */
.hero {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  min-height: 128px; margin: 0 -24px; padding: 6px 24px 0 24px; overflow: hidden;
}
.hero-copy { position: relative; z-index: 2; max-width: 680px; padding-top: 4px; }
.hero h1 { font-size: 38px; line-height: 1.12; font-weight: 800; letter-spacing: -.025em; }
.hero p { margin-top: 8px; font-size: 17px; color: var(--muted); }

.hero-art {
  position: absolute; right: 0; top: 0; bottom: 0; width: 720px; pointer-events: none;
  background: radial-gradient(120% 140% at 60% 120%, #efe3d3 0%, #f6efe6 45%, rgba(246,239,230,0) 80%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 32%);
          mask-image: linear-gradient(to right, transparent 0, #000 32%);
}
.art-notebook {
  position: absolute; left: 118px; bottom: -18px; width: 116px; height: 124px; padding: 14px 12px;
  background: #fbf8f2; border-radius: 4px 8px 4px 4px; transform: rotate(-5deg);
  box-shadow: 0 6px 16px rgba(60,40,20,.18), inset 0 0 0 1px rgba(0,0,0,.04);
  font-family: "Caveat", "Segoe Print", cursive; font-weight: 600; font-size: 19px; line-height: 1.12; color: #4a4036;
}
.art-notebook i { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); font-style: normal; color: #d98a8a; font-size: 14px; }
.art-plant { position: absolute; left: 258px; bottom: -22px; width: 104px; height: 128px; }
.art-books { position: absolute; left: 390px; bottom: -4px; width: 92px; }
.art-books i { display: block; height: 15px; border-radius: 3px; box-shadow: 0 2px 4px rgba(0,0,0,.14); }
.art-books i:first-child { background: #d9cdbb; width: 92px; margin-bottom: 2px; }
.art-books i:last-child { background: #bdb2a3; width: 80px; margin-left: 6px; order: -1; }
.art-books { display: flex; flex-direction: column-reverse; }
.art-mug {
  position: absolute; left: 488px; bottom: 8px; width: 66px; height: 80px; padding: 10px 6px;
  background: #f7f3ec; border-radius: 6px 6px 16px 16px; text-align: center;
  font-family: "Caveat", cursive; font-weight: 600; font-size: 13px; line-height: 1.05; color: #3d342b;
  box-shadow: 0 6px 12px rgba(60,40,20,.2), inset -8px 0 12px rgba(0,0,0,.05);
}
.art-mug::after { content: ""; position: absolute; right: -16px; top: 18px; width: 22px; height: 34px; border: 6px solid #f7f3ec; border-left: 0; border-radius: 0 18px 18px 0; }

.progress-card {
  position: relative; z-index: 2; display: flex; align-items: center; gap: 14px; flex: none;
  margin-top: 4px; padding: 16px 22px 16px 18px; border-radius: 16px; max-width: 310px;
  background: linear-gradient(135deg, #fff3e6, #ffe9d6); border: 1px solid rgba(242,107,45,.14);
  box-shadow: 0 6px 20px rgba(242,107,45,.12);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.progress-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(242,107,45,.2); }
.progress-card:active { transform: scale(.97); }
.progress-card .sun { color: #f59a1b; }
.progress-card .sun .icon { width: 38px; height: 38px; stroke-width: 1.6; transition: transform .6s var(--ease); }
.progress-card:hover .sun .icon { transform: rotate(90deg); }
.progress-text strong { display: block; font-size: 15px; font-weight: 700; }
.progress-text small { display: block; margin-top: 3px; font-size: 12.5px; color: #6b5c52; line-height: 1.35; }

/* ---------- Cards / shared ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: box-shadow .22s var(--ease), transform .22s var(--ease), border-color .2s;
}

.tile { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tile .icon { width: 24px; height: 24px; }
.tile.green  { background: var(--green-soft);  color: var(--green); }
.tile.blue   { background: var(--blue-soft);   color: var(--blue); }
.tile.red    { background: var(--red-soft);    color: var(--red); }
.tile.orange { background: var(--orange-soft); color: var(--orange); }
.tile.purple { background: var(--purple-soft); color: var(--purple); }
.tile.violet { background: var(--violet-soft); color: var(--violet); }
.tile.indigo { background: var(--indigo-soft); color: var(--indigo); }
.tile.cyan   { background: var(--cyan-soft);   color: var(--cyan); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .12s var(--ease);
}
.btn .icon { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.btn-outline { border: 1px solid var(--border-strong); background: #fff; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); box-shadow: 0 2px 10px rgba(51,88,230,.12); }
.btn-outline:hover .icon { transform: translateX(3px); }
.btn:active { transform: scale(.95); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-top: 12px; }
.stat { display: flex; align-items: center; gap: 16px; padding: 18px 20px; text-align: left; cursor: pointer; }
.stat .tile { width: 58px; height: 58px; border-radius: 14px; }
.stat .tile .icon { width: 28px; height: 28px; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.stat:hover .tile .icon { transform: scale(1.12) rotate(-4deg); }
.stat .tile .icon { transition: transform .25s var(--ease); }
.stat:active { transform: translateY(-1px) scale(.98); }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 14px; color: #2d3652; font-weight: 500; }
.stat-value { font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-value.pop { animation: pop-num .35s var(--ease); }
@keyframes pop-num { 40% { transform: scale(1.18); } }
.stat-trend { display: flex; align-items: center; gap: 4px; font-size: 12.5px; margin-top: 2px; white-space: nowrap; }
.stat-trend .icon { width: 13px; height: 13px; stroke-width: 2.6; }
.stat-trend b { font-weight: 600; }
.stat-trend em { font-style: normal; color: var(--muted); margin-left: 4px; overflow: hidden; text-overflow: ellipsis; }
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--red); }

/* ---------- Content grid ---------- */
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 388px; gap: 16px; margin-top: 16px; align-items: stretch; }
.left-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.row2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }

.panel { padding: 20px 22px 22px; }
.panel-head { display: flex; align-items: center; gap: 12px; }
.panel-head h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.panel-head p { margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.panel-head .btn { margin-left: auto; align-self: flex-start; }
.head-ic { width: 32px; height: 32px; display: grid; place-items: center; flex: none; border-radius: 8px; }
.head-ic .icon { width: 26px; height: 26px; }
.head-ic.blue { color: var(--blue); }
.head-ic.plain { color: #2d3652; }
.head-ic.plain .icon { width: 24px; height: 24px; }
.panel-sub { margin: 4px 0 12px 0; font-size: 13.5px; color: var(--muted); }

/* ---------- AI team ---------- */
.agents { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.agent {
  display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px;
  background: #f6f8fc; border: 1px solid transparent;
  transition: transform .2s var(--ease), box-shadow .2s, background .2s, border-color .2s;
}
.agent:hover { transform: translateY(-3px); background: #fff; border-color: var(--border-strong); box-shadow: var(--shadow-hover); }
.agent:active { transform: translateY(-1px) scale(.97); }
.agent-top { display: flex; align-items: center; gap: 8px; }
.agent-top .tile .icon { width: 20px; height: 20px; }
.agent-top .tile { width: 38px; height: 38px; transition: transform .25s var(--ease); }
.agent:hover .agent-top .tile { transform: scale(1.08) rotate(-4deg); }
.agent-top strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.2; }
.status { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: #1b8c52; font-weight: 500; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: #20b261; box-shadow: 0 0 0 0 rgba(32,178,97,.5); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px rgba(32,178,97,0); } 100% { box-shadow: 0 0 0 0 rgba(32,178,97,0); } }
.agent-desc { font-size: 13px; line-height: 1.45; color: var(--muted); }

/* ---------- Today / tasks ---------- */
.today .panel-head { margin-bottom: 0; }
.count { margin-left: auto; font-size: 13px; color: var(--muted); transition: color .2s; }
.tasks { display: flex; flex-direction: column; }
.task { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); transition: opacity .25s; }
.task:first-child { border-top: 0; }
.check { position: relative; display: block; width: 22px; height: 22px; flex: none; cursor: pointer; }
.check input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.check > span {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px;
  border: 1.8px solid #b5bdd0; background: #fff; color: #fff;
  transition: background .18s, border-color .18s, transform .15s var(--ease);
}
.check .icon { width: 14px; height: 14px; stroke-width: 3; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .25s var(--ease) .05s; }
.check:hover > span { border-color: var(--primary); transform: scale(1.08); }
.check input:active + span { transform: scale(.85); }
.check input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.check input:checked + span { background: var(--primary); border-color: var(--primary); }
.check input:checked + span .icon { stroke-dashoffset: 0; }

.task-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 2px; margin: -4px 0; border-radius: 10px;
  transition: background .15s, transform .12s var(--ease);
}
.task-main:hover { background: #f4f6fb; }
.task-main:hover .chev-r { transform: translateX(3px); color: var(--primary); }
.task-main:active { transform: scale(.98); }
.task-ic { width: 26px; height: 26px; flex: none; display: grid; place-items: center; color: var(--primary); }
.task-ic .icon { width: 20px; height: 20px; }
.task-text { flex: 1; min-width: 0; }
.task-title { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 8px; font-size: 13.5px; font-weight: 600; transition: color .2s; }
.task-text small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--muted); }
.chev-r { width: 15px; height: 15px; color: var(--faint); transition: transform .2s var(--ease), color .15s; }
.pill { font-style: normal; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 99px; line-height: 1.6; }
.pill.high { background: #fff0dc; color: #e8730c; }
.pill.medium { background: #e2f6ee; color: #2077c4; }
.pill.low { background: #eef0f5; color: #6c7590; }
.task.done { opacity: .6; }
.task.done .task-title { text-decoration: line-through; text-decoration-color: var(--faint); color: var(--muted); }

/* ---------- Business modules ---------- */
.modules .panel-head { align-items: flex-start; }
.module-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.module {
  --accent: #98a1b8;
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 14px;
  border: 1.5px solid var(--border); border-radius: 14px; background: #fff;
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s, background .2s;
}
.module .m-tile { width: 36px; height: 36px; border-radius: 10px; background: var(--m-soft, #f1f4f9); color: var(--m-accent, var(--muted)); transition: transform .25s var(--ease); }
.module .m-tile .icon { width: 20px; height: 20px; }
.module-top { display: flex; align-items: center; gap: 10px; padding-right: 22px; }
.module-top strong { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.module-desc { font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.module:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.module:hover .m-tile { transform: scale(1.1) rotate(-5deg); }
.module:active { transform: translateY(-1px) scale(.97); }
.module .radio {
  position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid #c3cadb; background: #fff; display: grid; place-items: center; color: #fff;
  transition: background .2s, border-color .2s, transform .25s var(--ease);
}
.module .radio .icon { width: 12px; height: 12px; stroke-width: 3.2; transform: scale(0); transition: transform .25s var(--ease); }
.module.is-selected { border-color: var(--m-accent); background: var(--m-soft); box-shadow: 0 4px 16px color-mix(in srgb, var(--m-accent) 22%, transparent); }
.module.is-selected .radio { background: var(--primary); border-color: var(--primary); }
.module.is-selected .radio .icon { transform: scale(1); }
.module.is-selected .m-tile { background: color-mix(in srgb, var(--m-accent) 16%, #fff); }

/* ---------- Chat ---------- */
.chat { position: relative; min-height: 560px; }
.chat-inner { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 20px 20px 18px; }
.messages { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; margin: 16px -6px 14px; padding: 0 6px; scroll-behavior: smooth; }
.messages::-webkit-scrollbar { width: 6px; }
.messages::-webkit-scrollbar-thumb { background: #d6dcea; border-radius: 6px; }
.msg { display: flex; gap: 10px; align-items: flex-start; animation: msg-in .35s var(--ease); }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: #dfe9ff; color: #1c2a52; border-radius: 16px 16px 4px 16px; padding: 12px 14px; }
.msg.ai .bubble { background: #fff; border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; padding: 14px 16px; font-size: 13.5px; line-height: 1.5; }
.bubble { max-width: 100%; font-size: 14px; }
.msg.user .bubble { max-width: 80%; }
.msg.ai .bubble p + p, .msg.ai .bubble ol + p, .msg.ai .bubble ul + p { margin-top: 10px; }
.msg.ai .bubble ol, .msg.ai .bubble ul { margin: 8px 0 0; padding-left: 20px; list-style: decimal; }
.msg.ai .bubble ul { list-style: disc; }
.msg.ai .bubble li + li { margin-top: 4px; }
.msg.ai .bubble ol li::marker, .msg.ai .bubble ul li::marker { color: var(--muted); }
.msg.ai .bubble .draft { margin-top: 8px; padding: 10px 12px; background: #f6f8fc; border-left: 3px solid var(--primary); border-radius: 8px; font-size: 13px; color: #2d3652; }
.ai-av { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--blue-soft); color: var(--blue); }
.ai-av .icon { width: 18px; height: 18px; }
.typing { display: inline-flex; gap: 5px; padding: 15px 16px !important; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #b3bbd0; animation: bounce 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); background: var(--primary); } }

.composer {
  display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 8px 0 16px;
  border: 1px solid var(--border-strong); border-radius: 12px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(51,88,230,.12); }
.composer input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14px; }
.composer input::placeholder { color: var(--faint); }
.send { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--primary); transition: background .15s, transform .12s var(--ease), color .15s; }
.send .icon { width: 20px; height: 20px; fill: currentColor; transition: transform .2s var(--ease); }
.send:hover { background: var(--primary-soft); }
.send:hover .icon { transform: translate(2px, -2px); }
.send:active { transform: scale(.88); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  padding: 8px 14px; border-radius: 99px; background: #eaf0ff; color: #2c4fc4; font-size: 12.5px; font-weight: 500;
  transition: background .15s, transform .12s var(--ease), box-shadow .15s, color .15s;
}
.chip:hover { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(51,88,230,.3); transform: translateY(-1px); }
.chip:active { transform: scale(.94); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 100; max-width: calc(100vw - 32px);
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  padding: 12px 20px; border-radius: 12px; background: #1c2a52; color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 32px rgba(15,23,50,.3); transition: opacity .25s, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mobile scrim ---------- */
.scrim { position: fixed; inset: 0; z-index: 45; background: rgba(15,23,50,.4); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1480px) {
  .content-grid { grid-template-columns: minmax(0, 1fr) 340px; }
  .module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat { padding: 16px; gap: 12px; }
  .stat .tile { width: 50px; height: 50px; }
  .hero-art { width: 560px; }
  .art-notebook { left: 40px; } .art-plant { left: 180px; } .art-books { left: 300px; } .art-mug { left: 400px; }
}

@media (max-width: 1280px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  .chat { min-height: 0; height: 560px; }
  .row2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .user-text { display: none; }
}

@media (max-width: 1060px) {
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .shop-switch .shop-pill span { display: inline; }
  .hero-art { display: none; }
  .select-btn { min-width: 0; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .menu-toggle { display: grid; }
  .brand { width: auto; }
  .topbar { gap: 10px; padding: 0 14px; }
  .sidebar {
    position: fixed; z-index: 50; top: 0; left: 0; bottom: 0; width: min(290px, 84vw); height: auto;
    padding-top: 20px; transform: translateX(-100%); transition: transform .3s var(--ease);
  }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(15,23,50,.2); }
  .workspace-switch { display: none; }
  .search { margin-left: 0; }
  .search kbd { display: none; }
  .main { padding: 0 16px 24px; }
  .hero { margin: 0 -16px; padding: 18px 16px 4px; flex-direction: column; align-items: stretch; gap: 16px; }
  .hero h1 { font-size: 30px; }
  .progress-card { max-width: none; margin-top: 0; }
}

@media (max-width: 700px) {
  .search { display: none; }
  .icon-btn.bell { margin-left: auto; }
  .brand-text small { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 10px; }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-head { flex-wrap: wrap; }
  .panel-head .btn { margin-left: 0; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 15px; }
}

@media (max-width: 480px) {
  .brand-text { display: none; }
  .topbar { gap: 8px; padding: 0 12px; }
  .shop-pill .chev, .user .chev { display: none; }
  .user { padding: 0; }
  .avatar { width: 40px; height: 40px; }
  .agents, .module-grid { grid-template-columns: minmax(0, 1fr); }
  .shop-pill { padding: 0 12px; height: 42px; }
  .panel { padding: 18px 16px; }
  .notif-menu { width: calc(100vw - 28px); position: fixed; right: 14px; left: 14px; top: calc(var(--topbar-h) - 6px); }
  .chat { height: 520px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
}
