/* Apkallu — Design System & Stylesheet (Material 1 Structure + Material 2/3 Sleek Depth & Motion) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ------------------------------------------------------------------
     Paleta extraida do proprio logo (app/static/logo.jpg).
     Amostragem dos pixels do simbolo deu hue 188-215 — ciano/azul-teal.
     NAO ha indigo nem violeta no logo: a paleta antiga usava #256d8f e
     #1b4a66, que brigavam com a marca. Os nomes das variaveis foram
     mantidos para nao quebrar o CSS existente; so os valores mudaram.
     ------------------------------------------------------------------ */

  /* Superficies — teal escuro, nao azul-violeta */
  --bg-dark: #030b10;
  --bg-surface-0: #061520;
  --bg-surface-1: #0a1f2c;
  --bg-surface-2: #0f2b3a;
  --bg-surface-3: #16394b;
  --bg-card: #0b2331;
  --bg-card-hover: #103042;
  --bg-input: #04121a;

  /* Vidro e translucidez */
  --glass-bg: rgba(10, 31, 44, 0.66);
  --glass-nav: rgba(3, 11, 16, 0.84);
  --glass-border: rgba(190, 240, 250, 0.09);
  --glass-border-hover: rgba(78, 200, 221, 0.38);

  /* Marca — direto do simbolo */
  --apk-glow: #d6fbff;      /* estrela no topo do A: #edfdfd */
  --apk-cyan: #4ec8dd;      /* ciano do A: #40a0b0 realcado */
  --apk-cyan-glow: rgba(78, 200, 221, 0.26);
  --apk-blue: #2f93ad;      /* azul medio: #307090 */
  --apk-indigo: #256d8f;    /* era violeta; agora o azul profundo do A */
  --apk-indigo-glow: rgba(37, 109, 143, 0.28);
  --apk-violet: #1b4a66;    /* era violeta; agora o azul mais escuro */
  --apk-steel: #8fb4c2;     /* cinza-azulado do traco: #608090 */

  /* Status — verde puxado pro agua, pra conviver com o teal */
  --ok-green: #2fd6a5;
  --ok-bg: rgba(47, 214, 165, 0.14);
  --ok-glow: rgba(47, 214, 165, 0.3);
  --off-gray: #6b8b98;
  --off-bg: rgba(107, 139, 152, 0.15);
  --warn-amber: #f0b429;
  --warn-bg: rgba(240, 180, 41, 0.15);
  --danger-red: #f2555a;
  --danger-bg: rgba(242, 85, 90, 0.15);

  /* Texto */
  --text-main: #e6f6fa;
  --text-muted: #a8c8d4;
  --text-dim: #6f909e;

  /* Bordas e sombras */
  --border-subtle: rgba(190, 240, 250, 0.08);
  --border-medium: rgba(190, 240, 250, 0.14);
  --border-active: rgba(78, 200, 221, 0.48);
  --shadow-elevation-1: 0 4px 20px -2px rgba(0, 8, 12, 0.55);
  --shadow-elevation-2: 0 12px 35px -5px rgba(0, 8, 12, 0.72), 0 0 25px rgba(78, 200, 221, 0.09);
  --shadow-elevation-3: 0 25px 60px -10px rgba(0, 8, 12, 0.86), 0 0 45px rgba(78, 200, 221, 0.16);

  /* Typography & Structure */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --sidebar-width: 275px;
  --topbar-height: 64px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  
  /* Transitions & Curves */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.18s var(--ease-out-expo);
  --transition-normal: 0.32s var(--ease-out-expo);
  --transition-slow: 0.6s var(--ease-out-expo);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg-dark);
  color: #f1f5f9;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==========================================================================
   ANIMATIONS ENGINE (FADING, BLUR, PARALLAX, PULSE)
   ========================================================================== */

/* Fade In / Out */
.fade-in {
  animation: fadeIn 0.45s var(--ease-out-expo) forwards;
}

.fade-out {
  animation: fadeOut 0.3s var(--ease-in-out-smooth) forwards;
}

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

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-18px); }
}

/* Blur In / Out */
.blur-in {
  animation: blurIn 0.5s var(--ease-out-expo) forwards;
}

.blur-out {
  animation: blurOut 0.35s var(--ease-in-out-smooth) forwards;
}

@keyframes blurIn {
  from { opacity: 0; filter: blur(16px); transform: scale(0.97); }
  to { opacity: 1; filter: blur(0px); transform: scale(1); }
}

@keyframes blurOut {
  from { opacity: 1; filter: blur(0px); transform: scale(1); }
  to { opacity: 0; filter: blur(16px); transform: scale(0.97); }
}

/* Scroll Reveal Elements */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  filter: blur(8px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo), filter 0.8s var(--ease-out-expo);
}

.reveal-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0px);
}

/* Parallax Ambient Glowing Spheres */
.parallax-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  transition: transform 0.2s linear;
}

.parallax-orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(78, 200, 221, 0.18) 0%, rgba(37, 109, 143, 0.08) 50%, transparent 75%);
  top: 5%;
  left: 50%;
  transform: translate(-50%, calc(var(--scroll-y, 0) * -0.2px));
}

.parallax-orb-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(27, 74, 102, 0.16) 0%, rgba(78, 200, 221, 0.06) 50%, transparent 75%);
  top: 45%;
  right: -100px;
  transform: translateY(calc(var(--scroll-y, 0) * 0.15px));
}

/* Parallax Mesopotamian Seal Watermark */
.apkallu-seal-bg {
  position: absolute;
  pointer-events: none;
  opacity: 0.04;
  z-index: 0;
  transition: transform 0.1s ease-out;
  transform: translateY(calc(var(--scroll-y, 0) * -0.12px)) rotate(calc(var(--scroll-y, 0) * 0.02deg));
}

/* Glassmorphism Panel (Material 2 & 3 Aesthetic) */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-elevation-1);
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
}

.glass-panel:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-elevation-2);
}

/* Base Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  color: #f8fafc;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.mono {
  font-family: var(--font-mono);
}

/* Base Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none !important;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--apk-cyan), var(--apk-blue));
  color: #040814;
  box-shadow: 0 4px 16px rgba(78, 200, 221, 0.32);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #7dd3fc, var(--apk-cyan));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(78, 200, 221, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: #f1f5f9;
  border-color: var(--border-medium);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--apk-cyan);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline-cyan {
  background: transparent;
  border-color: rgba(78, 200, 221, 0.4);
  color: var(--apk-cyan);
}

.btn-outline-cyan:hover {
  background: rgba(78, 200, 221, 0.12);
  border-color: var(--apk-cyan);
  box-shadow: 0 0 16px var(--apk-cyan-glow);
}

.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 30px; font-size: 15px; border-radius: var(--radius-md); }

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
}

.badge-ok {
  background: var(--ok-bg);
  color: var(--ok-green);
  border: 1px solid rgba(47, 214, 165, 0.35);
  box-shadow: 0 0 12px rgba(47, 214, 165, 0.15);
}

.badge-off {
  background: var(--off-bg);
  color: var(--off-gray);
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.badge-warn {
  background: var(--warn-bg);
  color: var(--warn-amber);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger-red);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-cyan {
  background: rgba(78, 200, 221, 0.12);
  color: var(--apk-cyan);
  border: 1px solid rgba(78, 200, 221, 0.3);
}

.badge-purple {
  background: rgba(37, 109, 143, 0.14);
  color: #8fb4c2;
  border: 1px solid rgba(37, 109, 143, 0.3);
}

.dot {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block;
}
.dot-ok { background: var(--ok-green); box-shadow: 0 0 8px var(--ok-green); animation: pulseDot 2s infinite; }
.dot-off { background: var(--off-gray); }
.dot-warn { background: var(--warn-amber); box-shadow: 0 0 8px var(--warn-amber); }

@keyframes pulseDot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   LANDING PAGE (MATERIAL 1 STRUCTURE + MATERIAL 2/3 VISUALS)
   ========================================================================== */
.landing-body {
  background: transparent;
  position: relative;
}

/* Landing Header Nav */
.landing-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 72px;
  z-index: 100;
  background: var(--glass-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  transition: all var(--transition-fast);
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.landing-brand svg {
  width: 34px; height: 34px;
  filter: drop-shadow(0 0 10px rgba(78, 200, 221, 0.4));
}

.landing-menu {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.landing-menu a {
  color: #94a3b8;
  font-weight: 500;
  font-size: 14px;
}

.landing-menu a:hover {
  color: #fff;
}

.landing-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Hero Section */
.hero-section {
  position: relative;
  padding: 160px 24px 110px;
  max-width: 1240px;
  margin: 0 auto;
  text-align: center;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 880px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(78, 200, 221, 0.08);
  border: 1px solid rgba(78, 200, 221, 0.25);
  color: var(--apk-cyan);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 26px;
  backdrop-filter: blur(10px);
}

.hero-title {
  font-size: 56px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title span {
  background: linear-gradient(135deg, var(--apk-cyan), #4ec8dd);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 18.5px;
  line-height: 1.6;
  color: #94a3b8;
  max-width: 740px;
  margin: 0 auto 38px;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 50px;
}

.hero-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  color: var(--off-gray);
  font-size: 13px;
  font-weight: 500;
}

/* Material 1 Structured Panel + Material 2/3 Glass Depth Mockup */
.hero-preview {
  margin-top: 54px;
  position: relative;
  z-index: 3;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-medium);
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow-elevation-3);
  overflow: hidden;
  text-align: left;
  transition: transform 0.3s var(--ease-out-expo);
}

.hero-preview:hover {
  transform: translateY(-4px);
  border-color: var(--border-active);
}

.preview-bar {
  background: rgba(5, 7, 12, 0.9);
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.preview-dots { display: flex; gap: 7px; }
.preview-dot { width: 11px; height: 11px; border-radius: 50%; }
.preview-dot.red { background: #ef4444; }
.preview-dot.yellow { background: #f59e0b; }
.preview-dot.green { background: #2fd6a5; }

.preview-title {
  color: #64748b;
  font-size: 12px;
  font-family: var(--font-mono);
  margin-left: auto;
}

.preview-body {
  padding: 28px;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 24px;
  min-height: 390px;
}

/* Sections */
.landing-section {
  padding: 100px 24px;
  max-width: 1240px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 64px;
}

.section-tag {
  color: var(--apk-cyan);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: block;
}

.section-title {
  font-size: 38px;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.section-desc {
  color: #94a3b8;
  font-size: 16.5px;
}

/* Material 1 Panel Layout Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }

.problem-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 30px;
  transition: all var(--transition-normal);
}

.problem-card:hover {
  border-color: rgba(239, 68, 68, 0.45);
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}

.problem-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-md);
  background: var(--danger-bg);
  color: var(--danger-red);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}

.problem-title { font-size: 18.5px; font-weight: 700; margin-bottom: 10px; }
.problem-desc { color: #94a3b8; font-size: 14.5px; line-height: 1.6; }

/* Step Process Cards */
.step-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 34px;
  position: relative;
  transition: all var(--transition-normal);
}

.step-card:hover {
  border-color: var(--border-active);
  transform: translateY(-4px);
  box-shadow: var(--shadow-elevation-2);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--apk-cyan);
  background: rgba(78, 200, 221, 0.12);
  padding: 4px 14px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 18px;
}

.step-title { font-size: 21px; font-weight: 700; margin-bottom: 12px; }
.step-desc { color: #94a3b8; font-size: 15px; line-height: 1.6; }

/* Family Showcase Panels (Material 1 Structure + Material 2/3 Glow) */
.family-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 26px;
}

.family-box {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 26px;
  transition: all var(--transition-normal);
}

.family-box:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-elevation-2);
}

.family-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.family-title { font-size: 17.5px; font-weight: 700; }

.family-card-item {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 15px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

.family-card-item:hover {
  background: var(--bg-surface-3);
  border-color: var(--border-medium);
}

.family-card-name { font-weight: 600; font-size: 14px; color: #fff; }
.family-card-sub { font-size: 12px; color: #64748b; margin-top: 2px; }

/* Security Banner */
.security-banner {
  background: linear-gradient(135deg, rgba(47, 147, 173, 0.1), rgba(37, 109, 143, 0.1));
  border: 1px solid rgba(78, 200, 221, 0.3);
  border-radius: var(--radius-xl);
  padding: 40px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  box-shadow: var(--shadow-elevation-2);
}

.sec-pill {
  background: var(--bg-dark);
  border: 1px solid var(--border-medium);
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--apk-cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Future BI Teaser Panels */
.bi-teaser-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.bi-teaser-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.bi-teaser-card:hover {
  border-color: rgba(37, 109, 143, 0.4);
  transform: translateY(-3px);
  box-shadow: var(--shadow-elevation-2);
}

.bi-teaser-card::before {
  content: "EM BREVE";
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(37, 109, 143, 0.15);
  color: #8fb4c2;
  border: 1px solid rgba(37, 109, 143, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.bi-teaser-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  background: rgba(78, 200, 221, 0.12);
  color: var(--apk-cyan);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}

.bi-teaser-title { font-size: 16.5px; font-weight: 700; margin-bottom: 6px; }
.bi-teaser-desc { color: #64748b; font-size: 13.5px; line-height: 1.5; }

/* Footer */
.landing-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 60px 40px 36px;
  background: #030408;
  position: relative;
  z-index: 2;
}

.footer-content {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 50px;
  margin-bottom: 50px;
}

.footer-bottom {
  max-width: 1240px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: space-between;
  color: #64748b;
  font-size: 12.5px;
}

/* ==========================================================================
   APP SHELL (LOGGED-IN MATERIAL 1 STRUCTURE + MATERIAL 2/3 DEPTH)
   ========================================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  background: transparent;
}

/* Sidebar Navigation */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface-0);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 50;
}

.sidebar-header {
  height: var(--topbar-height);
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  padding: 14px 10px 6px;
}

.sidebar-menu { list-style: none; margin-bottom: 20px; }
.sidebar-item { margin-bottom: 3px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: #94a3b8;
  font-weight: 500;
  font-size: 13.5px;
  transition: all var(--transition-fast);
  text-decoration: none !important;
}

.sidebar-link svg {
  width: 19px; height: 19px;
  color: #64748b;
  transition: color var(--transition-fast);
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.sidebar-link:hover svg { color: var(--apk-cyan); }

.sidebar-link.active {
  background: rgba(78, 200, 221, 0.12);
  color: var(--apk-cyan);
  font-weight: 600;
  border: 1px solid rgba(78, 200, 221, 0.2);
}

.sidebar-link.active svg { color: var(--apk-cyan); }

.sidebar-link.disabled { opacity: 0.65; cursor: pointer; }
.sidebar-link.disabled:hover { background: rgba(37, 109, 143, 0.08); }

.sidebar-tag-soon {
  margin-left: auto;
  background: rgba(37, 109, 143, 0.16);
  color: #8fb4c2;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
}

.sidebar-tenant-box {
  padding: 14px 18px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.25);
}

.tenant-selector {
  width: 100%;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 9px 13px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  outline: none;
}

/* Main Area Wrapper */
.app-main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Topbar Header */
.app-topbar {
  height: var(--topbar-height);
  background: var(--glass-nav);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-page-title { font-size: 18.5px; font-weight: 700; }

.status-pill-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 18px;
  border-left: 1px solid var(--border-subtle);
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--apk-cyan), var(--apk-indigo));
  color: #040814;
  font-weight: 800;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 12px var(--apk-cyan-glow);
}

/* App Main Container */
.app-container {
  padding: 32px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ==========================================================================
   APP SCREENS & COMPONENTS (MATERIAL 1 STRUCTURE + MATERIAL 2/3 DEPTH)
   ========================================================================== */

/* App Card / Panel */
.app-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 26px;
  box-shadow: var(--shadow-elevation-1);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title { font-size: 18.5px; font-weight: 700; }
.card-subtitle { color: #64748b; font-size: 13.5px; margin-top: 2px; }

/* Automations Screen — Family Panels & Switch Cards */
.automations-group { margin-bottom: 36px; }

.group-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.group-name {
  font-size: 16.5px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
}

.automations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(370px, 1fr));
  gap: 18px;
}

.auto-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-fast);
  position: relative;
}

.auto-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-surface-3);
  box-shadow: var(--shadow-elevation-1);
}

.auto-card.off { opacity: 0.78; }
.auto-card.disabled-gate { border-color: rgba(245, 158, 11, 0.3); }

.auto-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.auto-card-label {
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auto-card-detail { color: #94a3b8; font-size: 13.5px; line-height: 1.45; }

.auto-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.schedule-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--apk-cyan);
  background: rgba(78, 200, 221, 0.1);
  padding: 3px 10px;
  border-radius: 6px;
}

.effect-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #64748b;
}

/* Custom Toggle Switch (Material 3 Motion Physics) */
.switch-wrap {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 27px;
  flex-shrink: 0;
}

.switch-wrap input { opacity: 0; width: 0; height: 0; }

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #1e293b;
  transition: all 0.25s var(--ease-out-expo);
  border-radius: 34px;
  border: 1px solid var(--border-medium);
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 19px; width: 19px;
  left: 3px; bottom: 3px;
  background-color: #94a3b8;
  transition: all 0.25s var(--ease-out-expo);
  border-radius: 50%;
}

input:checked + .switch-slider {
  background: linear-gradient(135deg, var(--ok-green), #059669);
  border-color: rgba(47, 214, 165, 0.5);
  box-shadow: 0 0 12px var(--ok-glow);
}

input:checked + .switch-slider:before {
  transform: translateX(21px);
  background-color: #ffffff;
}

input:disabled + .switch-slider {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Gate Lock & Safety Warnings */
.gate-warning {
  background: var(--warn-bg);
  color: var(--warn-amber);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 12.5px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nfe-safety-warning {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 12.5px;
  margin-top: 12px;
}

/* Executions / Audit Log Table (Material 1 Structured Data Table) */
.data-table-wrap {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-elevation-1);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: var(--bg-surface-2);
  padding: 16px 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
  color: #f1f5f9;
  font-size: 13.5px;
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255, 255, 255, 0.025); }

.count-raw {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--apk-cyan);
}

.residual-highlight {
  color: var(--warn-amber);
  font-weight: 600;
}

/* Modals with Blur & Scale */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(3, 5, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out-expo);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  padding: 34px;
  box-shadow: var(--shadow-elevation-3);
  transform: scale(0.94) translateY(20px);
  filter: blur(8px);
  transition: transform 0.35s var(--ease-out-expo), filter 0.35s var(--ease-out-expo);
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
  filter: blur(0px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-title { font-size: 21px; font-weight: 700; }
.modal-close {
  background: transparent; border: 0; color: #64748b; font-size: 26px; cursor: pointer; padding: 4px;
}
.modal-close:hover { color: #fff; }

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .app-sidebar { width: 230px; }
  .app-main-wrapper { margin-left: 230px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .landing-nav { padding: 0 20px; }
  .landing-menu { display: none; }
  .hero-title { font-size: 36px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .app-sidebar { display: none; }
  .app-main-wrapper { margin-left: 0; }
  .security-banner { flex-direction: column; text-align: center; }
  .bi-teaser-grid { grid-template-columns: 1fr; }
}

.ok-msg{color:var(--ok);font-size:13px}

/* ==========================================================================
   MATERIAL 2 DYNAMIC BACKGROUND WAVES & DOT MESH SYSTEM
   ========================================================================== */
.material-bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.9;
}



.material-surface-glow {
  position: relative;
}

.material-surface-glow::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px; right: -1px; bottom: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(78, 200, 221, 0.25), rgba(37, 109, 143, 0.15), transparent 60%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.material-surface-glow:hover::before {
  opacity: 1;
}

.material-ripple-effect {
  position: relative;
  overflow: hidden;
}

.material-ripple-effect .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: rippleAnimation 0.6s linear;
  background-color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

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