/* ── Capydoo Design Tokens ── */
:root {
  --primary: #f04233;
  --primary-hover: #d13629;
  --bg: #1a1a1a;
  --sidebar-bg: #1a1a1a;
  --card-bg: #1a1a1a;
  --text-main: #f5f5f5;
  --text-muted: #b3b3b3;
  --border: #2a2a2a;
  --border-light: #333333;
  --radius-lg: 24px;
  --radius-md: 12px;
  --shadow-neo: 3px 3px 0 #0f0f0f;
  --star-color: #ffffff;
  --transition-smooth: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #1a1a1a;
  --sidebar-bg: #1a1a1a;
  --card-bg: #1a1a1a;
  --text-main: #f5f5f5;
  --text-muted: #b3b3b3;
  --border: #2a2a2a;
  --border-light: #333333;
  --shadow-neo: 3px 3px 0 rgba(0, 0, 0, 0.9);
}

[data-theme="light"] {
  --bg: #f6f8fc;
  --sidebar-bg: #ffffff;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #d3dce9;
  --border-light: #e2e8f0;
  --shadow-neo: 3px 3px 0 rgba(148, 163, 184, 0.35);
  --star-color: #0f172a;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s, color 0.3s;
  overflow: hidden;
  position: relative;
}

body.theme-switch-flash #app-shell,
body.theme-switch-flash #login-screen {
  animation: themeSwitchPulse 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes themeSwitchPulse {
  0% { filter: brightness(0.95) saturate(0.92); transform: scale(0.998); }
  50% { filter: brightness(1.08) saturate(1.08); transform: scale(1); }
  100% { filter: brightness(1) saturate(1); transform: scale(1); }
}

#space-boot-loader {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: none;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  opacity: 0;
  transition: opacity 0.28s ease;
}

#space-boot-loader.is-visible {
  opacity: 1;
}

#space-boot-loader .space-loader-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

#space-boot-loader .space-loader-core {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  color: #e1e1e1;
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
  text-align: center;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
}

#space-boot-loader .space-loader-word {
  display: block;
  width: 100%;
  margin: 0 auto;
  text-align: center !important;
  font-size: clamp(2.8rem, 11vw, 7.4rem);
  letter-spacing: 0.18em;
  font-weight: 700;
  text-transform: uppercase;
  text-indent: 0;
  animation: spaceLoaderWordPulse 2.2s ease-in-out infinite;
}

#space-boot-loader .space-loader-status {
  display: block;
  width: max-content;
  max-width: 96vw;
  margin: 0 auto;
  font-size: clamp(0.82rem, 1.6vw, 1rem);
  letter-spacing: 0.03em;
  color: #b8c0cf;
  font-weight: 600;
  text-align: center !important;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

#space-boot-loader .space-loader-arrow {
  position: absolute;
  bottom: -3.7rem;
  left: 50%;
  transform: translateX(-50%);
}

#space-boot-loader .space-loader-mouse {
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-radius: 20px;
  position: relative;
}

#space-boot-loader .space-loader-wheel {
  width: 2px;
  height: 8px;
  background: #fff;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
  animation: spaceLoaderWheel 1.35s infinite;
}

@keyframes spaceLoaderWordPulse {
  0%, 100% {
    opacity: 0.7;
    filter: blur(0.6px);
  }
  50% {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes spaceLoaderWheel {
  0% {
    transform: translate(-50%, 0);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, 14px);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #space-boot-loader .space-loader-word,
  #space-boot-loader .space-loader-wheel {
    animation: none;
  }
}

@media (max-width: 768px) {
  #space-boot-loader .space-loader-core {
    max-width: 100%;
    padding: 0 max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  }

  #space-boot-loader .space-loader-word {
    font-size: clamp(2.1rem, 13.5vw, 3.4rem);
    letter-spacing: 0.08em;
  }

  #space-boot-loader .space-loader-status {
    max-width: calc(100vw - 28px);
    width: max-content;
    left: 50%;
    transform: translateX(-50%);
  }
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  contain: strict;
}

.star {
  opacity: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--star-color);
  border-radius: 100%;
  transform-origin: 0 0;
  animation-name: starFly, starFade;
  animation-timing-function: linear, linear;
  animation-iteration-count: infinite, infinite;
  will-change: transform, opacity;
}

.size-1 {
  width: 1px;
  height: 1px;
}

.size-2 {
  width: 2px;
  height: 2px;
}

@keyframes starFly {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(var(--dx), var(--dy), 0); }
}

@keyframes starFade {
  0% { opacity: 0; }
  12% { opacity: 0; }
  22% { opacity: var(--peak-opacity, 0.9); }
  100% { opacity: var(--peak-opacity, 0.9); }
}

.wheel-and-hamster {
  --dur: 1s;
  position: fixed;
  width: 12em;
  height: 12em;
  font-size: 11px;
  right: 20px;
  bottom: 18px;
  z-index: 4;
  pointer-events: none;
  opacity: 0.85;
  transform: translate(0, 0) scale(1);
  transition: right 0.45s ease, bottom 0.45s ease, transform 0.45s ease, opacity 0.25s ease;
}

.wheel-and-hamster.is-loading {
  right: 50%;
  bottom: 50%;
  transform: translate(50%, 50%) scale(1.14);
  z-index: 2800;
  opacity: 1;
}

body.space-boot-loading #app-shell {
  filter: saturate(0.9) brightness(0.92);
}

.wheel,
.hamster,
.hamster div,
.spoke {
  position: absolute;
}

.wheel,
.spoke {
  border-radius: 50%;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.wheel {
  background: radial-gradient(100% 100% at center,hsla(0,0%,60%,0) 47.8%,hsl(0,0%,60%) 48%);
  z-index: 2;
}

.hamster {
  animation: hamster var(--dur) ease-in-out infinite;
  top: 50%;
  left: calc(50% - 3.5em);
  width: 7em;
  height: 3.75em;
  transform: rotate(4deg) translate(-0.8em,1.85em);
  transform-origin: 50% 0;
  z-index: 1;
}

.hamster__head {
  animation: hamsterHead var(--dur) ease-in-out infinite;
  background: hsl(30,90%,55%);
  border-radius: 70% 30% 0 100% / 40% 25% 25% 60%;
  box-shadow: 0 -0.25em 0 hsl(30,90%,80%) inset,
    0.75em -1.55em 0 hsl(30,90%,90%) inset;
  top: 0;
  left: -2em;
  width: 2.75em;
  height: 2.5em;
  transform-origin: 100% 50%;
}

.hamster__ear {
  animation: hamsterEar var(--dur) ease-in-out infinite;
  background: hsl(0,90%,85%);
  border-radius: 50%;
  box-shadow: -0.25em 0 hsl(30,90%,55%) inset;
  top: -0.25em;
  right: -0.25em;
  width: 0.75em;
  height: 0.75em;
  transform-origin: 50% 75%;
}

.hamster__eye {
  animation: hamsterEye var(--dur) linear infinite;
  background-color: hsl(0,0%,0%);
  border-radius: 50%;
  top: 0.375em;
  left: 1.25em;
  width: 0.5em;
  height: 0.5em;
}

.hamster__nose {
  background: hsl(0,90%,75%);
  border-radius: 35% 65% 85% 15% / 70% 50% 50% 30%;
  top: 0.75em;
  left: 0;
  width: 0.2em;
  height: 0.25em;
}

.hamster__body {
  animation: hamsterBody var(--dur) ease-in-out infinite;
  background: hsl(30,90%,90%);
  border-radius: 50% 30% 50% 30% / 15% 60% 40% 40%;
  box-shadow: 0.1em 0.75em 0 hsl(30,90%,55%) inset,
    0.15em -0.5em 0 hsl(30,90%,80%) inset;
  top: 0.25em;
  left: 2em;
  width: 4.5em;
  height: 3em;
  transform-origin: 17% 50%;
  transform-style: preserve-3d;
}

.hamster__limb--fr,
.hamster__limb--fl {
  clip-path: polygon(0 0,100% 0,70% 80%,60% 100%,0% 100%,40% 80%);
  top: 2em;
  left: 0.5em;
  width: 1em;
  height: 1.5em;
  transform-origin: 50% 0;
}

.hamster__limb--fr {
  animation: hamsterFRLimb var(--dur) linear infinite;
  background: linear-gradient(hsl(30,90%,80%) 80%,hsl(0,90%,75%) 80%);
  transform: rotate(15deg) translateZ(-1px);
}

.hamster__limb--fl {
  animation: hamsterFLLimb var(--dur) linear infinite;
  background: linear-gradient(hsl(30,90%,90%) 80%,hsl(0,90%,85%) 80%);
  transform: rotate(15deg);
}

.hamster__limb--br,
.hamster__limb--bl {
  border-radius: 0.75em 0.75em 0 0;
  clip-path: polygon(0 0,100% 0,100% 30%,70% 90%,70% 100%,30% 100%,40% 90%,0% 30%);
  top: 1em;
  left: 2.8em;
  width: 1.5em;
  height: 2.5em;
  transform-origin: 50% 30%;
}

.hamster__limb--br {
  animation: hamsterBRLimb var(--dur) linear infinite;
  background: linear-gradient(hsl(30,90%,80%) 90%,hsl(0,90%,75%) 90%);
  transform: rotate(-25deg) translateZ(-1px);
}

.hamster__limb--bl {
  animation: hamsterBLLimb var(--dur) linear infinite;
  background: linear-gradient(hsl(30,90%,90%) 90%,hsl(0,90%,85%) 90%);
  transform: rotate(-25deg);
}

.hamster__tail {
  animation: hamsterTail var(--dur) linear infinite;
  background: hsl(0,90%,85%);
  border-radius: 0.25em 50% 50% 0.25em;
  box-shadow: 0 -0.2em 0 hsl(0,90%,75%) inset;
  top: 1.5em;
  right: -0.5em;
  width: 1em;
  height: 0.5em;
  transform: rotate(30deg) translateZ(-1px);
  transform-origin: 0.25em 0.25em;
}

.spoke {
  animation: spoke var(--dur) linear infinite;
  background: radial-gradient(100% 100% at center,hsl(0,0%,60%) 4.8%,hsla(0,0%,60%,0) 5%),
    linear-gradient(hsla(0,0%,55%,0) 46.9%,hsl(0,0%,65%) 47% 52.9%,hsla(0,0%,65%,0) 53%) 50% 50% / 99% 99% no-repeat;
}

@keyframes hamster {
  from, to { transform: rotate(4deg) translate(-0.8em,1.85em); }
  50% { transform: rotate(0) translate(-0.8em,1.85em); }
}

@keyframes hamsterHead {
  from, 25%, 50%, 75%, to { transform: rotate(0); }
  12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(8deg); }
}

@keyframes hamsterEye {
  from, 90%, to { transform: scaleY(1); }
  95% { transform: scaleY(0); }
}

@keyframes hamsterEar {
  from, 25%, 50%, 75%, to { transform: rotate(0); }
  12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(12deg); }
}

@keyframes hamsterBody {
  from, 25%, 50%, 75%, to { transform: rotate(0); }
  12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(-2deg); }
}

@keyframes hamsterFRLimb {
  from, 25%, 50%, 75%, to { transform: rotate(50deg) translateZ(-1px); }
  12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(-30deg) translateZ(-1px); }
}

@keyframes hamsterFLLimb {
  from, 25%, 50%, 75%, to { transform: rotate(-30deg); }
  12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(50deg); }
}

@keyframes hamsterBRLimb {
  from, 25%, 50%, 75%, to { transform: rotate(-60deg) translateZ(-1px); }
  12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(20deg) translateZ(-1px); }
}

@keyframes hamsterBLLimb {
  from, 25%, 50%, 75%, to { transform: rotate(20deg); }
  12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(-60deg); }
}

@keyframes hamsterTail {
  from, 25%, 50%, 75%, to { transform: rotate(30deg) translateZ(-1px); }
  12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(10deg) translateZ(-1px); }
}

@keyframes spoke {
  from { transform: rotate(0); }
  to { transform: rotate(-1turn); }
}

.space-capy-scene {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2600;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.92);
  transition: opacity 0.24s ease, transform 0.24s ease, visibility 0s linear 0.24s;
}

.space-capy-scene.show {
  visibility: visible;
  opacity: 1;
  transform: scale(1);
  transition-delay: 0s;
}

.space-capy-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.22);
}

.space-capy-scene .backg {
  position: relative;
  height: 280px;
  width: 280px;
  border-radius: 50%;
  background-color: #1a1a1a;
  border: 2px solid var(--border);
  animation: loader-ring 1.8s ease-in-out infinite;
  z-index: 1;
}

.space-capy-scene .planet {
  height: 140px;
  width: 140px;
  border-radius: 50%;
  position: relative;
  background-color: #ff9933;
  top: 18px;
  left: 64px;
}

.space-capy-scene .r1 { background-color:#ffbf80; height:12px; width:66px; border-radius:10px; position:relative; top:36px; left:51px; }
.space-capy-scene .r2 { background-color:#ffbf80; height:9px; width:54px; border-radius:6px; position:relative; top:48px; left:66px; }
.space-capy-scene .r3 { background-color:#ffbf80; height:18px; width:72px; border-radius:15px; position:relative; top:46px; left:30px; }
.space-capy-scene .r4 { background-color:#ffbf80; height:13px; width:54px; border-radius:11px; position:relative; top:42px; left:8px; }
.space-capy-scene .r5 { background-color:rgba(204,102,0,.3); height:9px; width:24px; border-radius:7px; position:relative; bottom:30px; left:42px; }
.space-capy-scene .r6 { background-color:rgba(204,102,0,.3); height:12px; width:36px; border-radius:11px; position:relative; bottom:15px; left:6px; }
.space-capy-scene .r7 { background-color:rgba(204,102,0,.3); height:9px; width:27px; border-radius:7px; position:relative; top:24px; left:78px; }
.space-capy-scene .r8 { background-color:rgba(255,255,255,.4); height:7px; width:18px; border-radius:7px; position:relative; top:4px; left:19px; }
.space-capy-scene .shad {
  background-color: transparent;
  box-shadow: 9px 9px rgba(204, 102, 0, 0.3);
  position: relative;
  height: 120px;
  width: 120px;
  border-radius: 50%;
  bottom: 99px;
  right: 9px;
}

.space-capy-scene .an {
  animation: capy-float 1.6s ease-in-out infinite;
  position: relative;
  bottom: 144px;
  left: 34px;
}

@keyframes capy-float {
  50% { transform: translateY(10px); }
}

@keyframes loader-ring {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(5deg); }
}

.space-capy-scene .stars .s1,
.space-capy-scene .stars .s2,
.space-capy-scene .stars .s3,
.space-capy-scene .stars .s4,
.space-capy-scene .stars .s5,
.space-capy-scene .stars .s6 {
  background-color: white;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  position: relative;
}

.space-capy-scene .s1 { bottom: 92px; left: 180px; }
.space-capy-scene .s2 { top: 6px; left: 32px; }
.space-capy-scene .s3 { bottom: 60px; left: 39px; }
.space-capy-scene .s4 { top: 34px; left: 149px; }
.space-capy-scene .s5 { top: 77px; left: 72px; }
.space-capy-scene .s6 { top: 36px; left: 210px; }

.space-capy-scene .capybara svg {
  display: block;
  width: 185px;
  height: 185px;
}

/* ── Auth Screens ── */
#login-screen {
  display: none; 
  align-items: center;
  justify-content: center;
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 1000;
}
.auth-box {
  background: var(--card-bg);
  border: 2.5px solid var(--border);
  border-radius: 30px;
  padding: 50px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-neo);
  text-align: center;
}
.auth-wa-highlight {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  margin-left: 4px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--primary);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.01em;
  box-shadow: 0 0 0 0 rgba(240, 66, 51, 0.55), 3px 3px 0 var(--border);
  animation: billingPayPulse 1.5s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}
.auth-wa-highlight::after {
  content: '';
  position: absolute;
  top: -35%;
  left: -40%;
  width: 36%;
  height: 170%;
  background: rgba(255, 255, 255, 0.38);
  transform: rotate(20deg);
  animation: billingPayShine 2.2s ease-in-out infinite;
  pointer-events: none;
}
.auth-benefits-block {
  margin: 0 0 22px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
}
.auth-benefits-list {
  color: var(--text-muted);
  margin: 0;
  padding-left: 18px;
  text-align: left;
  line-height: 1.6;
}

/* ── App Shell ── */
#app-shell { display: none; flex-direction: column; height: 100vh; overflow: hidden; position: relative; z-index: 1; }

header {
  height: 90px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--sidebar-bg);
  border-bottom: 2.5px solid var(--border);
  flex-shrink: 0;
}

.header-left { display: flex; align-items: center; gap: 15px; }
.header-logo-text { font-size: 1.6rem; font-weight: 900; letter-spacing: -0.05em; }
.header-right { display:flex; align-items:center; gap:10px; }
.company-switch {
  min-width: 180px;
  padding: 9px 10px;
  border: 2.5px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  font-weight: 800;
}
.notif-btn {
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  min-width:44px; height:44px; padding:0 10px; border-radius:14px;
  border:2.5px solid var(--border); background:var(--card-bg); box-shadow:var(--shadow-neo);
  color: var(--text-main);
  font-weight:900; cursor:pointer;
}
.notif-badge {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:20px; height:20px; padding:0 6px; border-radius:999px;
  background:var(--primary); color:#fff; font-size:0.7rem; border:2px solid var(--border);
}

/* ── Refined Balance Box (Matches Screenshot) ── */
.credit-box {
  background: var(--card-bg);
  border: 2.5px solid var(--border);
  padding: 8px 32px;
  border-radius: 20px;
  display: flex;
  align-items: center; /* Vodorovné zarovnání na střed */
  gap: 32px; /* Větší mezera mezi labelem a částkou */
  box-shadow: 4px 4px 0px var(--border);
}
.credit-label { 
  font-size: 0.85rem; 
  font-weight: 900; 
  color: #8a8880; 
  text-transform: uppercase; 
  letter-spacing: 0.1em;
  line-height: 1;
}
.credit-value { 
  font-size: 2rem; 
  font-weight: 900; 
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.credit-buy-btn {
  padding: 9px 16px;
  min-height: 44px;
  font-size: 0.82rem;
  font-weight: 900;
  border-radius: 14px;
  justify-content: center;
  white-space: nowrap;
}

/* ── Navigation ── */
.main-layout { display: flex; flex: 1; min-height: 0; overflow: hidden; }

aside {
  width: 260px;
  background: var(--sidebar-bg);
  border-right: 2.5px solid var(--border);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-radius: 16px;
  font-size: 0.95rem; font-weight: 700; color: var(--text-muted); cursor: pointer; transition: 0.15s;
  margin-bottom: 6px;
}
.nav-item:hover { color: var(--text-main); background: rgba(240, 66, 51, 0.12); }
.nav-item.active {
  color: #fff;
  background: var(--primary);
  border: 2.5px solid var(--border);
  box-shadow: none;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-section-label { margin: 10px 10px 6px; font-size: 0.7rem; font-weight: 900; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.nav-item.locked {
  opacity: 0.65;
  background: #ececec;
  border: 2px dashed var(--border);
}
.nav-item.locked:hover { opacity: 0.9; background: #e5e7eb; }
.nav-item.disabled-feature,
.btn-manage.disabled-feature {
  opacity: 0.45;
  filter: grayscale(1);
  cursor: not-allowed !important;
  pointer-events: auto;
}
.nav-item.disabled-feature:hover,
.btn-manage.disabled-feature:hover {
  background: transparent !important;
  color: var(--text-muted) !important;
}
.nav-item.nav-logout { margin-top: auto; }
.nav-item.nav-capy-art { cursor: default; }
.nav-item.nav-capy-art:hover { background: transparent; color: var(--text-muted); }
.nav-item .menu-capy-svg { width: 28px; height: 28px; display: block; }
.nav-item .menu-capy-svg .cls-1 { fill: #4ba11f; }
.nav-item .menu-capy-svg .cls-2 { fill: #5db32b; }
.nav-item .menu-capy-svg .cls-3 { fill: #96c12a; }
.nav-item .menu-capy-svg .cls-4 { fill: #87c827; }
.nav-item .menu-capy-svg .cls-5 { fill: #468d21; }

/* ── Dashboard Grid ── */
main {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  background: transparent;
  scroll-behavior: smooth;
  position: relative;
}
.page { display: none; }
.page.active { display: block; animation: fadeInUp 0.4s ease-out; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

.dashboard-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 15px;
  position: relative;
  min-height: 200px;
}

/* ── Compact Smart Widget ── */
.widget {
  background: var(--card-bg);
  border: 2.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px 12px 18px; /* Minimal bottom padding */
  box-shadow: var(--shadow-neo);
  cursor: grab;
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
  
  resize: none;
  overflow: hidden;
  min-width: 180px;
  min-height: 70px;
  
  width: 320px;
  height: fit-content; 
  display: flex;
  flex-direction: column;
}
.widget.locked {
  background: #f3f4f6;
  border-color: #d1d5db;
  opacity: 0.78;
}
.widget.locked .widget-title,
.widget.locked .widget-body,
.widget.locked .extra-content {
  color: #6b7280 !important;
}
.widget-lock-note {
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 900;
  color: #6b7280;
  background: #e5e7eb;
  border: 2px solid #d1d5db;
  border-radius: 10px;
  padding: 6px 8px;
}

.widget:active { cursor: grabbing; }
.widget.dragging { opacity: 0.05; box-shadow: none; transform: scale(0.98); }
.widget.dragging * { pointer-events: none !important; }
.widget.dragging-manual {
  opacity: 0.96;
  cursor: grabbing !important;
  box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.35);
  transform: none !important;
  pointer-events: none !important;
}
.widget.resizing-manual {
  transition: none !important;
  cursor: nwse-resize !important;
}
body.widget-drag-active {
  user-select: none;
  -webkit-user-select: none;
}
body.widget-drag-active .widget,
body.widget-drag-active .widget-placeholder {
  transition: none !important;
}

.widget-placeholder {
  background: rgba(var(--primary-rgb), 0.03);
  border: 2.5px dashed var(--primary);
  border-radius: var(--radius-lg);
  pointer-events: none;
  transition: width 0.2s ease, height 0.2s ease;
}
.widget-drop-target-before {
  box-shadow: -4px 0 0 var(--primary), var(--shadow-neo) !important;
}
.widget-drop-target-after {
  box-shadow: 4px 0 0 var(--primary), var(--shadow-neo) !important;
}

.widget-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 6px; 
  border-bottom: 1.5px solid var(--border-light); 
  padding-bottom: 6px; 
  flex-shrink: 0;
  pointer-events: auto;
}
.widget-title { font-size: 0.7rem; font-weight: 900; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; pointer-events: none; }

.widget-body { flex: 1; display: flex; flex-direction: column; pointer-events: none; }
.stat-val { font-size: 2.4rem; font-weight: 900; letter-spacing: -0.05em; line-height: 1.1; margin-bottom: 0px; }
.mini-bar { width: 16px; border: 2px solid var(--border); border-radius: 6px 6px 0 0; background: var(--primary); height: 10px; }

/* ── Pill Badges ── */
.badge { 
  padding: 5px 14px; 
  border-radius: 100px; 
  font-size: 0.65rem; 
  font-weight: 900; 
  text-transform: uppercase; 
  border: 2.2px solid var(--border);
  display: inline-flex; 
  align-items: center;
  justify-content: center;
  margin-top: 4px; 
  width: fit-content;
}

.extra-content {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-light);
    font-size: 0.75rem;
    color: var(--text-muted);
    display: none;
}

.widget.expanded .extra-content { display: block; }

.resize-handle {
    position: absolute; bottom: 6px; right: 6px; width: 16px; height: 16px;
    background: var(--primary); border: 2px solid var(--border); border-radius: 50%;
    cursor: nwse-resize; z-index: 10;
    touch-action: none;
}

/* ── WhatsApp Specific UI ── */
.wa-status-card {
    background: var(--card-bg);
    border: 2.5px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 25px;
    box-shadow: var(--shadow-neo);
    margin-bottom: 25px;
}
.wa-icon-circle {
    width: 70px; height: 70px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 3px solid var(--border);
}
.wa-icon-circle.online { background: var(--primary); color: white; }
.wa-icon-circle.offline { background: var(--primary); color: white; }

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}
.config-card {
    background: var(--card-bg);
    border: 2.5px solid var(--border);
    border-radius: 20px;
    padding: 18px 24px;
    box-shadow: 4px 4px 0px var(--border);
}
.config-label { font-size: 0.7rem; font-weight: 900; text-transform: uppercase; color: var(--text-muted); margin-bottom: 5px; display: block; }
.config-value { font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; font-weight: 700; color: var(--text-main); }

/* ── Library & Utils ── */
.btn-manage {
  background: var(--primary);
  color: #fff;
  border: 2.5px solid var(--border);
  padding: 12px 28px;
  border-radius: 100px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s;
  box-shadow: 3px 3px 0 var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.purchase-cta,
.billing-pay-cta {
  position: relative;
  overflow: hidden;
  padding: 10px 20px;
  min-height: 42px;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  box-shadow: 0 0 0 0 rgba(240, 66, 51, 0.55), 3px 3px 0 var(--border);
  animation: billingPayPulse 1.5s ease-in-out infinite;
}

.purchase-cta::after,
.billing-pay-cta::after {
  content: '';
  position: absolute;
  top: -35%;
  left: -40%;
  width: 36%;
  height: 170%;
  background: rgba(255, 255, 255, 0.38);
  transform: rotate(20deg);
  animation: billingPayShine 2.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes billingPayPulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 0 rgba(240, 66, 51, 0.42), 3px 3px 0 var(--border);
  }
  50% {
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 0 0 8px rgba(240, 66, 51, 0), 3px 3px 0 var(--border);
  }
}

@keyframes billingPayShine {
  0% { left: -45%; opacity: 0; }
  25% { opacity: 0.65; }
  55%, 100% { left: 120%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .purchase-cta,
  .purchase-cta::after,
  .billing-pay-cta,
  .billing-pay-cta::after,
  .auth-wa-highlight,
  .auth-wa-highlight::after {
    animation: none !important;
  }
}

#toast { position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--text-main); color: var(--bg); padding: 14px 30px; border-radius: 100px; font-weight: 800; transition: var(--transition-smooth); opacity: 0; z-index: 2000; pointer-events: none; }
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

input {
  width: 100%;
  padding: 14px;
  border: 2.5px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: var(--card-bg);
  color: var(--text-main);
  font-family: inherit;
}

/* Settings layout */
#page-settings > div:nth-child(2) {
  max-width: none !important;
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 18px;
  align-items: start;
}

#page-settings > div:nth-child(2) > div {
  margin: 0 !important;
}

#page-settings > div:nth-child(2) > div:last-child {
  grid-column: 1 / -1;
}

/* Mobile Nav */
.mobile-nav { display: none; }
.mobile-more-sheet { display: none; }
@media (max-width: 1100px) {
    #page-settings > div:nth-child(2) {
      grid-template-columns: 1fr;
    }
    #page-settings > div:nth-child(2) > div:last-child {
      grid-column: auto;
    }
}
@media (max-width: 768px) {
    aside { display: none; }
    .mobile-nav {
      display: none;
      position: fixed;
      bottom: 10px;
      left: 10px;
      right: 10px;
      height: 68px;
      padding: 0 8px;
      background: var(--card-bg);
      border: 2.5px solid var(--border);
      border-radius: 18px;
      justify-content: space-between;
      align-items: center;
      z-index: 1000;
      box-shadow: 3px 3px 0 var(--border);
      pointer-events: auto;
      touch-action: manipulation;
      overflow: hidden;
    }
    body.space-authenticated .mobile-nav { display: flex; }
    .mobile-nav-indicator {
      position: absolute;
      top: 7px;
      left: 0;
      height: 54px;
      border-radius: 12px;
      background: rgba(240, 66, 51, 0.08);
      transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), width 0.24s cubic-bezier(0.22, 1, 0.36, 1);
      pointer-events: none;
      z-index: 0;
    }
    .mobile-nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3px;
      color: var(--text-muted);
      font-size: 0.62rem;
      font-weight: 800;
      width: calc(25% - 4px);
      height: 54px;
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.22s ease;
      position: relative;
      z-index: 1;
      pointer-events: auto;
      touch-action: manipulation;
      -webkit-user-select: none;
      user-select: none;
    }
    .mobile-nav-item svg { width: 18px; height: 18px; }
    .mobile-nav-item.active {
      color: var(--primary);
      transform: translateY(-1px);
    }
    .mobile-nav-item:active { transform: scale(0.98); }
    .mobile-nav-more { border: 1px dashed var(--border); }
    .mobile-more-sheet {
      display: block;
      position: fixed;
      inset: 0;
      z-index: 1400;
      pointer-events: none;
      visibility: hidden;
    }
    .mobile-more-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(0,0,0,0.35);
      opacity: 0;
      transition: opacity 0.25s ease;
    }
    .mobile-more-panel {
      position: absolute;
      left: 10px;
      right: 10px;
      bottom: 88px;
      background: var(--card-bg);
      border: 2.5px solid var(--border);
      border-radius: 18px;
      box-shadow: 3px 3px 0 var(--border);
      transform: translateY(20px) scale(0.98);
      opacity: 0;
      transition: transform 0.24s ease, opacity 0.24s ease;
      padding: 8px;
    }
    .mobile-more-header {
      font-size: 0.78rem;
      font-weight: 900;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      padding: 8px 10px 6px;
    }
    .mobile-more-item {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      border: 0;
      border-radius: 12px;
      background: transparent;
      color: var(--text-main);
      font-weight: 800;
      padding: 11px 10px;
      cursor: pointer;
    }
    .mobile-more-item svg { width: 18px; height: 18px; }
    .mobile-more-item:hover { background: rgba(240, 66, 51, 0.12); }
    .mobile-more-item.disabled-feature {
      opacity: 0.45;
      filter: grayscale(1);
      cursor: not-allowed;
    }
    .mobile-more-item.disabled-feature:hover { background: transparent; }
    .mobile-more-sheet.open { pointer-events: auto; visibility: visible; }
    .mobile-more-sheet.open .mobile-more-backdrop { opacity: 1; }
    .mobile-more-sheet.open .mobile-more-panel { transform: translateY(0) scale(1); opacity: 1; }
    header { height: 64px; padding: 0 12px; }
    .header-logo-text { font-size: 1.2rem; }
    .header-right { gap: 6px; }
    #global-company-switch,
    .company-switch { display: none !important; }
    .credit-box { padding: 6px 10px; border-radius: 12px; gap: 8px; }
    .credit-label { display: none; }
    .credit-value { font-size: 1rem; gap: 6px; }
    .credit-buy-btn { display: none; }
    main {
      padding: 14px;
      padding-bottom: calc(150px + env(safe-area-inset-bottom));
      scroll-padding-bottom: calc(170px + env(safe-area-inset-bottom));
    }
    .page { padding-bottom: 20px; }
    .btn-manage { padding: 10px 14px; font-size: 0.84rem; box-shadow: 3px 3px 0px var(--primary); }
    .purchase-cta,
    .billing-pay-cta { min-height: 38px; padding: 8px 14px; font-size: 0.82rem; }
    #page-aichat > div[style*="display:flex"] { display: block !important; height: auto !important; min-height: 0 !important; }
    #page-aichat > div[style*="display:flex"] > div:first-child { width: 100% !important; margin-bottom: 10px; }
    #page-aichat > div[style*="display:flex"] > div:last-child { min-height: 52vh !important; }
    #page-aichat .ai-target-mobile-select {
      width: 100%;
      margin-bottom: 8px;
      padding: 10px 12px;
      border: 2px solid var(--border);
      border-radius: 10px;
      background: var(--bg);
      color: var(--text-main);
      font-weight: 700;
    }
    #page-aichat #conv-list { display: grid; gap: 6px; }
    #page-aichat #conv-list .ai-target-item {
      margin-bottom: 0 !important;
      min-height: 44px;
      pointer-events: auto;
      touch-action: manipulation;
    }
    #page-aichat #conv-list .ai-target-item:active { transform: scale(0.99); }
    #page-websites { overflow-x: hidden; }
    #page-websites > div[style*="grid-template-columns"] {
      display: block !important;
      min-height: 0 !important;
    }
    #page-websites > div[style*="grid-template-columns"] > * + * {
      margin-top: 12px !important;
    }
    #page-websites [style*="grid-template-columns:260px 1fr"] {
      display: block !important;
      min-height: 0 !important;
    }
    #page-websites [style*="grid-template-columns:260px 1fr"] > * + * {
      margin-top: 12px !important;
    }
    #page-websites #sites-list {
      display: grid !important;
      gap: 12px !important;
      margin-bottom: 12px;
    }
    #page-websites #fm-files {
      min-height: 220px !important;
      max-height: 44vh;
      overflow: auto !important;
      -webkit-overflow-scrolling: touch;
    }
    #page-websites #fm-editor {
      display: block;
      width: 100% !important;
      max-width: 100% !important;
      min-height: 42vh !important;
      overflow: auto;
    }
    #page-websites #fm-current-file {
      overflow-wrap: anywhere;
      word-break: break-word;
    }
    .widget { width: 100% !important; }
    .auth-box { margin: 12px; padding: 28px 20px; border-radius: 18px; }
}

/* Picker Modal */
#picker-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);
    z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px;
}
.picker-container {
    background: var(--bg); width: 100%; max-width: 900px; max-height: 80vh;
    border: 3px solid var(--border); border-radius: 32px; padding: 40px;
    box-shadow: 10px 10px 0px var(--border); overflow-y: auto;
}
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; margin-top: 25px; }
.picker-card {
    background: var(--card-bg); border: 2.5px solid var(--border); padding: 15px; border-radius: 18px;
    cursor: pointer; transition: 0.2s;
}
.picker-card.locked {
  background: #d1d5db;
  border-color: #9ca3af;
  opacity: 0.55;
  filter: grayscale(1);
  cursor: not-allowed;
}
.picker-card.locked:hover { transform: none; border-color: #9ca3af; box-shadow: none; }
.picker-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 4px 4px 0px var(--primary); }
.fm-context-menu {
  position: fixed;
  z-index: 2200;
  min-width: 180px;
  background: var(--card-bg);
  border: 2.5px solid var(--border);
  border-radius: 12px;
  box-shadow: 6px 6px 0 var(--border);
  padding: 6px;
  display: none;
}
.fm-context-item {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}
.fm-context-item:hover { background: rgba(240, 66, 51, 0.12); }
.fm-context-item.danger:hover { background: #fee2e2; color: #b91c1c; }

/* Add-ons Modal */
#addons-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);
  z-index: 1100; display: none; align-items: center; justify-content: center; padding: 20px;
}
.addons-container {
  background: var(--bg); width: 100%; max-width: 980px; max-height: 84vh;
  border: 3px solid var(--border); border-radius: 32px; padding: 28px;
  box-shadow: 10px 10px 0px var(--border); overflow-y: auto;
}
.addons-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap:12px; margin-top:14px; }
.addon-card {
  background: var(--card-bg); border: 2.5px solid var(--border); border-radius: 14px; padding: 14px;
  box-shadow: var(--shadow-neo);
}
.addon-card.locked { opacity: 0.76; background: #f3f4f6; }
.addon-card.active { border-color: var(--primary); }

/* Workflow AI modal */
#workflow-ai-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);
  z-index: 1150; display: none; align-items: center; justify-content: center; padding: 20px;
}
.workflow-ai-container {
  background: var(--bg); width: 100%; max-width: 760px; max-height: 86vh;
  border: 3px solid var(--border); border-radius: 28px; padding: 22px;
  box-shadow: 10px 10px 0 var(--border); overflow-y: auto;
}

/* Space popup modal */
.space-popup-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  z-index: 2400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.space-popup-card {
  width: 100%;
  max-width: 560px;
  background: var(--bg);
  border: 3px solid var(--border);
  border-radius: 20px;
  box-shadow: 10px 10px 0 var(--border);
  padding: 16px;
  display: grid;
  gap: 10px;
}
.space-popup-title { font-size: 1.05rem; font-weight: 900; }
.space-popup-message { color: var(--text-muted); white-space: pre-wrap; font-size: 0.9rem; }
.space-popup-input,
.space-popup-textarea {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--card-bg);
  color: var(--text-main);
  font-family: inherit;
}
.space-popup-textarea {
  min-height: 140px;
  resize: vertical;
  display: none;
}
.space-popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Admin clarity */
.admin-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.admin-tab-btn {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--card-bg);
  font-weight: 900;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.admin-tab-btn:hover { transform: translateY(-1px); box-shadow: 3px 3px 0 var(--primary); }
.admin-tab-btn.active { background: var(--primary); color: #fff; }
.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }
.admin-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.admin-row {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.88rem;
}

/* CRM / Ops clarity */
.crm-module-tabs { display:flex; flex-wrap:wrap; gap:8px; }
.crm-module-btn {
  padding:10px 14px; border:2.5px solid var(--border); border-radius:10px;
  background:var(--bg); font-weight:900; cursor:pointer; transition:transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.crm-module-btn:hover { transform:translateY(-1px); box-shadow:3px 3px 0 var(--primary); }
.crm-module-btn.active { background:var(--primary); color:#fff; }
.crm-tabs { display:flex; flex-wrap:wrap; gap:8px; }
.crm-tab-btn {
  padding:10px 14px; border:2.5px solid var(--border); border-radius:10px;
  background:var(--card-bg); font-weight:800; cursor:pointer; transition:transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.crm-tab-btn:hover { transform:translateY(-1px); box-shadow:3px 3px 0 var(--primary); }
.crm-tab-btn.active { background:var(--primary); color:#fff; }
.crm-panel-animate {
  animation: crmPanelIn 0.28s ease;
}
@keyframes crmPanelIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.crm-summary-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:10px;
  margin-bottom:14px;
  width:100%;
}
.crm-kpi {
  min-width: 0;
  background:var(--card-bg); border:2px solid var(--border); border-radius:10px; padding:8px 10px;
}
.crm-kpi .k { font-size:0.68rem; color:var(--text-muted); font-weight:800; text-transform:uppercase; white-space:nowrap; }
.crm-kpi .v { font-size:1.1rem; font-weight:900; margin-top:2px; }
.crm-row {
  background:var(--card-bg); border:2px solid var(--border); border-radius:12px; padding:12px;
  display:flex; justify-content:space-between; align-items:flex-start; gap:10px;
}
.crm-meta { font-size:0.8rem; color:var(--text-muted); margin-top:4px; }
.chip {
  display:inline-flex; align-items:center; justify-content:center; padding:3px 8px; border:2px solid var(--border);
  border-radius:999px; font-size:0.72rem; font-weight:800; background:var(--bg);
}
.status-open { background:#2a2a2a; }
.status-in_progress { background:#fff3ef; }
.status-waiting { background:#2a2a2a; }
.status-closed { background:#2a2a2a; }

.dashboard-modules {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.module-tile {
  background: var(--card-bg);
  border: 2.5px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow-neo);
  cursor: pointer;
}
.module-tile .meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }
.module-tile.locked { background: #f3f4f6; opacity: 0.78; }
.module-tile.active { border-color: var(--primary); }
.module-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 2px solid var(--border);
  font-size: 0.66rem;
  font-weight: 900;
}

.nav-item.addon-active {
  opacity: 1;
  background: var(--card-bg);
  border: 2px solid var(--border);
  color: var(--text-main);
}

.ops-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(380px, 1.5fr) minmax(260px, 1fr);
  gap: 12px;
}
.ops-col {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-neo);
  min-height: 420px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ops-col-header {
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 900;
  border-bottom: 2px solid var(--border-light);
}
.ops-list { padding: 8px; overflow: auto; display: grid; gap: 8px; }
.ops-thread-item {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--bg);
  cursor: pointer;
}
.ops-thread-item.active { background: #fff3ef; border-color: var(--primary); }
.ops-thread-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.ops-detail { padding: 12px; overflow: auto; display: grid; gap: 10px; }
.ops-msg {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.86rem;
  max-width: 92%;
}
.ops-msg.customer { background: #fff; justify-self: start; }
.ops-msg.agent { background: var(--primary); color: #fff; justify-self: end; }
.ops-msg.internal { background: #fde68a; justify-self: start; }
.ops-msg-header { display:flex; align-items:center; gap:6px; font-size:0.72rem; font-weight:900; margin-bottom:4px; opacity:0.9; }
.ops-lock { font-size: 0.72rem; }
.ops-composer {
  border-top: 2px dashed var(--border-light);
  padding-top: 8px;
  display: grid;
  gap: 8px;
}
.ops-composer-mode { font-size: 0.75rem; font-weight: 900; }
.wf-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-neo);
  padding: 12px;
  display: grid;
  gap: 6px;
}
.wf-line { font-size: 0.8rem; }
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--border);
  margin-right: 6px;
}
.dot.ok { background: var(--primary); }
.dot.err { background: var(--primary-hover); }

@media (max-width: 1200px) {
  .ops-layout { grid-template-columns: 1fr; }
}

/* Master admin (phone 123321123): single-page control center */
body.master-admin-mode aside { display: none !important; }
body.master-admin-mode .mobile-nav { display: none !important; }
body.master-admin-mode main {
  padding: 24px;
}
.wheel-and-hamster,
.space-capy-scene,
.nav-item.nav-capy-art {
  display: none !important;
}
