/* =========================================================
   SMM WhatsApp Bot — Clean Light/Dark UI V2
   Designed for Mohamed Saad
   No external icon or font dependency is required.
   ========================================================= */

:root {
  color-scheme: light;
  --app-bg: #eef3f8;
  --app-bg-2: #f7f9fc;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --surface-tint: #f0f7f5;
  --sidebar: #0b1726;
  --sidebar-2: #10253a;
  --sidebar-soft: rgba(255, 255, 255, .06);
  --text: #142236;
  --text-strong: #091426;
  --muted: #68778b;
  --muted-2: #8c99aa;
  --white: #ffffff;
  --line: #e2e9f0;
  --line-strong: #d3dce7;
  --primary: #15b979;
  --primary-dark: #0b8e5b;
  --primary-soft: #e3f8ef;
  --secondary: #4388ff;
  --secondary-soft: #eaf2ff;
  --purple: #7659f7;
  --purple-soft: #f0edff;
  --warning: #f2a51a;
  --warning-soft: #fff5dc;
  --danger: #e64b67;
  --danger-soft: #fff0f3;
  --success: #17a96d;
  --success-soft: #e8f9f1;
  --sidebar-width: 282px;
  --radius-sm: 12px;
  --radius-md: 17px;
  --radius-lg: 23px;
  --shadow-sm: 0 8px 25px rgba(15, 35, 57, .07);
  --shadow: 0 18px 55px rgba(15, 35, 57, .10);
  --shadow-hover: 0 24px 70px rgba(15, 35, 57, .15);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 3%, rgba(67, 136, 255, .09), transparent 24%),
    radial-gradient(circle at 92% 8%, rgba(21, 185, 121, .10), transparent 22%),
    linear-gradient(145deg, var(--app-bg-2), var(--app-bg));
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(21, 185, 121, .22); color: var(--text-strong); }
a { color: inherit; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #edf2f7; }
::-webkit-scrollbar-thumb { border: 2px solid #edf2f7; border-radius: 99px; background: #b6c3d1; }
::-webkit-scrollbar-thumb:hover { background: #94a5b8; }

.background-grid {
  position: fixed;
  inset: 0;
  z-index: -4;
  pointer-events: none;
  opacity: .55;
  background-image:
    linear-gradient(rgba(23, 45, 70, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 45, 70, .025) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 88%);
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}

.ambient {
  position: fixed;
  z-index: -3;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  opacity: .14;
  animation: ambientMove 14s ease-in-out infinite;
}
.ambient-one { top: -190px; right: -120px; background: #42d79b; }
.ambient-two { bottom: -200px; left: -120px; background: #6da5ff; animation-delay: -7s; }
.ambient-three { top: 38%; left: 42%; width: 250px; height: 250px; background: #a88cff; opacity: .06; animation-delay: -3s; }
@keyframes ambientMove { 50% { transform: translate3d(30px, 22px, 0) scale(1.08); } }

/* ---------- Local SVG icon system ---------- */
i[class*="fa-"] {
  display: inline-grid;
  place-items: center;
  width: 1em;
  height: 1em;
  line-height: 1;
  font-style: normal;
  vertical-align: -.12em;
}
.svg-icon {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- App shell ---------- */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  position: relative;
}
.app-stage {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.sidebar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 15px;
  color: rgba(255,255,255,.88);
  border-left: 1px solid rgba(255,255,255,.07);
  background:
    radial-gradient(circle at 50% -10%, rgba(21, 185, 121, .24), transparent 37%),
    linear-gradient(180deg, var(--sidebar-2), var(--sidebar));
  box-shadow: -20px 0 60px rgba(10, 24, 39, .14);
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 72%);
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}
.sidebar-glow {
  position: absolute;
  top: -140px;
  right: -100px;
  width: 290px;
  height: 290px;
  border-radius: 50%;
  background: rgba(21, 185, 121, .18);
  filter: blur(80px);
  pointer-events: none;
}
.sidebar-head {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 5px 17px;
  position: relative;
  z-index: 2;
}
.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-mark {
  position: relative;
  width: 49px;
  height: 49px;
  flex: 0 0 49px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, #27d18b, #0b9e65);
  box-shadow: 0 13px 32px rgba(7, 18, 30, .35), inset 0 1px 0 rgba(255,255,255,.35);
}
.brand-mark > i { font-size: 1.5rem; }
.brand-mark b {
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(70, 230, 164, .28);
  border-radius: 20px;
  animation: brandPulse 2.8s ease-in-out infinite;
}
@keyframes brandPulse { 50% { transform: scale(1.07); opacity: .28; } }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { color: #fff; font-size: .92rem; font-weight: 800; white-space: nowrap; }
.brand-copy small { margin-top: 1px; color: rgba(255,255,255,.48); font-size: .59rem; letter-spacing: .9px; text-transform: uppercase; white-space: nowrap; }
.icon-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: .2s ease;
}
.icon-button:hover { transform: translateY(-2px); border-color: #c9d5e2; }
.icon-button i { font-size: 1.05rem; }
.sidebar-close {
  display: none;
  color: #fff;
  border-color: rgba(255,255,255,.1);
  background: rgba(255,255,255,.06);
  box-shadow: none;
}
.mobile-menu { display: none; }
.sidebar-status {
  position: relative;
  z-index: 2;
  min-height: 69px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0 3px 16px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 17px;
  background: rgba(255,255,255,.055);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.status-orb {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255,255,255,.07);
}
.status-orb i { width: 9px; height: 9px; border-radius: 50%; background: #8897a8; box-shadow: 0 0 0 6px rgba(136,151,168,.09); }
.sidebar-status small, .sidebar-status strong { display: block; }
.sidebar-status small { color: rgba(255,255,255,.45); font-size: .58rem; letter-spacing: .55px; text-transform: uppercase; }
.sidebar-status strong { margin-top: 1px; color: #fff; font-size: .74rem; text-transform: capitalize; }
.status-signal { color: rgba(255,255,255,.35); font-size: .9rem; }
.sidebar-status.state-connected .status-orb i { background: #48e6a4; box-shadow: 0 0 0 6px rgba(72,230,164,.11), 0 0 16px rgba(72,230,164,.65); animation: statusPulse 1.8s infinite; }
.sidebar-status.state-connected .status-signal { color: #65eab1; }
.sidebar-status.state-error .status-orb i,
.sidebar-status.state-logged_out .status-orb i { background: #ff758b; box-shadow: 0 0 0 6px rgba(255,117,139,.1); }
@keyframes statusPulse { 50% { box-shadow: 0 0 0 10px rgba(72,230,164,0), 0 0 20px rgba(72,230,164,.65); } }
.sidebar-nav {
  position: relative;
  z-index: 2;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 1px 3px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.17) transparent;
}
.nav-label {
  display: block;
  padding: 14px 10px 6px;
  color: rgba(255,255,255,.34);
  font-size: .57rem;
  font-weight: 800;
  letter-spacing: .9px;
  text-transform: uppercase;
}
.sidebar-nav a {
  min-height: 47px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin: 3px 0;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: rgba(255,255,255,.64);
  text-decoration: none;
  font-size: .76rem;
  font-weight: 700;
  transition: .2s ease;
}
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar-nav a.active {
  color: #fff;
  border-color: rgba(75,228,166,.22);
  background: linear-gradient(135deg, rgba(30,192,126,.25), rgba(255,255,255,.055));
  box-shadow: 0 10px 28px rgba(3,12,20,.2), inset 0 1px 0 rgba(255,255,255,.07);
}
.nav-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.055);
}
.sidebar-nav a.active .nav-icon { color: #102336; background: #63e5ae; }
.nav-icon i { font-size: .92rem; }
.nav-arrow { color: rgba(255,255,255,.22); font-size: .58rem; }
.sidebar-nav a.active .nav-arrow { color: #65e4ad; }
.sidebar-footer-card {
  position: relative;
  z-index: 2;
  min-height: 61px;
  display: grid;
  grid-template-columns: 39px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 7px 3px 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.045);
}
.developer-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #0b2730;
  background: linear-gradient(145deg, #fff, #78e9b9);
  font-size: .7rem;
  font-weight: 900;
}
.sidebar-footer-card small, .sidebar-footer-card strong { display: block; }
.sidebar-footer-card small { color: rgba(255,255,255,.36); font-size: .56rem; }
.sidebar-footer-card strong { color: #fff; font-size: .68rem; }
.version-badge { padding: 3px 7px; border: 1px solid rgba(98,231,176,.18); border-radius: 99px; color: #84efbe; background: rgba(21,185,121,.08); font-size: .57rem; font-weight: 900; }
.sidebar-overlay { display: none; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  border-bottom: 1px solid rgba(214,224,234,.88);
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 8px 30px rgba(21,39,61,.04);
}
.topbar-inner {
  width: min(1500px, calc(100% - 42px));
  min-height: 72px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-start, .header-actions { display: flex; align-items: center; gap: 10px; }
.topbar-title span, .topbar-title strong { display: block; }
.topbar-title span { color: var(--muted-2); font-size: .58rem; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; }
.topbar-title strong { margin-top: 1px; color: var(--text-strong); font-size: .91rem; font-weight: 800; }
.topbar-action {
  position: relative;
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: #516278;
  background: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: .2s ease;
}
.topbar-action:hover { color: var(--primary-dark); border-color: #bfe8d7; transform: translateY(-2px); }
.topbar-action i { font-size: 1rem; }
.action-dot {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #94a0af;
}
.action-dot.state-connected { background: var(--primary); box-shadow: 0 0 9px rgba(21,185,121,.75); }
.action-dot.state-error, .action-dot.state-logged_out { background: var(--danger); }
.header-separator { width: 1px; height: 27px; margin-inline: 2px; background: var(--line); }
.logout-button {
  min-height: 41px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid #f2d8de;
  border-radius: 13px;
  color: #c33f58;
  background: var(--danger-soft);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 800;
  transition: .2s ease;
}
.logout-button:hover { transform: translateY(-2px); border-color: #efb8c4; background: #ffe7ec; }

/* ---------- Main content / hero ---------- */
.container {
  width: min(1440px, calc(100% - 42px));
  margin: 0 auto;
  flex: 1;
  position: relative;
}
.page-hero {
  position: relative;
  min-height: 178px;
  margin: 24px 0 21px;
  padding: 29px 31px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 8% 10%, rgba(53,218,155,.29), transparent 28%),
    radial-gradient(circle at 90% 85%, rgba(86,141,255,.28), transparent 27%),
    linear-gradient(125deg, #0d1b2a, #13304a 56%, #0f3c47);
  box-shadow: 0 22px 65px rgba(17,38,59,.18);
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .19;
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 72%);
  mask-image: linear-gradient(90deg, #000, transparent 72%);
}
.hero-copy { min-width: 0; position: relative; z-index: 2; }
.hero-breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: rgba(255,255,255,.58); font-size: .65rem; font-weight: 700; }
.hero-breadcrumb i:first-child { color: #63e3ad; }
.hero-breadcrumb i:not(:first-child) { font-size: .5rem; }
.hero-breadcrumb strong { color: rgba(255,255,255,.86); }
.eyebrow { display: block; color: var(--primary-dark); font-size: .61rem; font-weight: 900; letter-spacing: 1.3px; text-transform: uppercase; }
.page-hero .eyebrow { color: #7ff0bf; }
.page-hero h1 { margin: 3px 0 4px; color: #fff; font-size: clamp(1.85rem, 3.5vw, 3rem); line-height: 1.18; font-weight: 900; letter-spacing: -.8px; }
.page-hero p { max-width: 650px; margin: 0; color: rgba(255,255,255,.67); font-size: .81rem; }
.hero-visual { position: relative; z-index: 2; width: 126px; height: 126px; flex: 0 0 126px; display: grid; place-items: center; }
.hero-ring { position: absolute; border: 1px solid rgba(130,245,194,.32); border-radius: 50%; }
.ring-one { width: 116px; height: 116px; animation: rotateRing 11s linear infinite; }
.ring-two { width: 84px; height: 84px; border-style: dashed; animation: rotateRingReverse 8s linear infinite; }
.ring-one::before, .ring-one::after, .ring-two::before { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #63e5ad; box-shadow: 0 0 14px #63e5ad; }
.ring-one::before { top: -4px; left: 50%; }
.ring-one::after { right: -4px; bottom: 27px; background: #6ea4ff; box-shadow: 0 0 14px #6ea4ff; }
.ring-two::before { left: 6px; bottom: 4px; width: 6px; height: 6px; }
.hero-core { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 19px; color: #fff; background: linear-gradient(145deg, #27d18b, #0d9b64); box-shadow: inset 0 1px 0 rgba(255,255,255,.38), 0 18px 44px rgba(0,0,0,.3), 0 0 35px rgba(40,211,140,.28); animation: coreFloat 3.8s ease-in-out infinite; }
.hero-core i { font-size: 1.7rem; }
.hero-particle { position: absolute; border-radius: 50%; background: #74e9b8; box-shadow: 0 0 10px #74e9b8; animation: particleFloat 4s ease-in-out infinite; }
.particle-one { width: 5px; height: 5px; top: 9px; right: 18px; }
.particle-two { width: 3px; height: 3px; bottom: 16px; left: 11px; animation-delay: -1.3s; }
.particle-three { width: 4px; height: 4px; top: 27px; left: 4px; animation-delay: -2.4s; }
@keyframes rotateRing { to { transform: rotate(360deg); } }
@keyframes rotateRingReverse { to { transform: rotate(-360deg); } }
@keyframes coreFloat { 50% { transform: translateY(-6px) rotate(4deg); } }
@keyframes particleFloat { 50% { transform: translate3d(5px,-8px,0); opacity: .45; } }

/* ---------- Cards / layout ---------- */
.grid { display: grid; gap: 17px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.section-pair { align-items: start; }
.stack { display: flex; flex-direction: column; gap: 15px; }
.stack.compact { gap: 12px; }
.card {
  --mouse-x: 50%;
  --mouse-y: 50%;
  position: relative;
  margin-bottom: 18px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--text);
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
  isolation: isolate;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.card::before { content: ""; position: absolute; inset: 0; z-index: -2; opacity: 0; border-radius: inherit; background: radial-gradient(390px circle at var(--mouse-x) var(--mouse-y), rgba(21,185,121,.075), transparent 42%); transition: opacity .25s ease; }
.card::after { content: ""; position: absolute; top: 0; right: 8%; left: 8%; height: 3px; z-index: -1; border-radius: 0 0 99px 99px; background: linear-gradient(90deg, transparent, rgba(21,185,121,.7), transparent); opacity: .5; }
.card:hover { transform: translateY(-3px); border-color: #cad8e5; box-shadow: var(--shadow-hover); }
.card:hover::before { opacity: 1; }
.card h2 { margin: 0; color: var(--text-strong); font-size: 1.1rem; line-height: 1.4; font-weight: 850; }
.card p { margin: .35rem 0 0; color: var(--muted); font-size: .79rem; }
.card-head, .section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card-head { margin-bottom: 18px; }
.section-head { margin-bottom: 16px; }
.section-icon {
  width: 47px;
  height: 47px;
  flex: 0 0 47px;
  display: grid;
  place-items: center;
  border: 1px solid #ccecdf;
  border-radius: 15px;
  color: var(--primary-dark);
  background: linear-gradient(145deg, #eefbf5, #dff7ed);
  box-shadow: inset 0 1px 0 #fff, 0 10px 24px rgba(20,100,72,.08);
}
.section-icon i { font-size: 1.1rem; }
.cards .card { min-height: 154px; margin-bottom: 0; }
.metric-card { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 20px; }
.metric-card::after { right: 18px; left: auto; width: 58px; height: 4px; background: linear-gradient(90deg, var(--primary), #6ce8b2); opacity: 1; }
.metric-card.metric-info::after { background: linear-gradient(90deg, var(--secondary), #7bb0ff); }
.metric-card.metric-warning::after { background: linear-gradient(90deg, var(--warning), #ffd370); }
.metric-card.metric-danger::after { background: linear-gradient(90deg, var(--danger), #ff91a5); }
.metric-copy span, .metric-copy strong, .metric-copy small { display: block; }
.metric-copy span { color: #53647a; font-size: .7rem; font-weight: 800; }
.metric-copy strong { margin: 7px 0 4px; color: var(--text-strong); font-size: 1.9rem; line-height: 1; font-weight: 900; letter-spacing: -.6px; }
.metric-copy small { color: var(--muted); font-size: .64rem; }
.metric-icon { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid #c9ecde; border-radius: 17px; color: var(--primary-dark); background: var(--primary-soft); box-shadow: inset 0 1px 0 #fff; }
.metric-icon i { font-size: 1.18rem; }
.metric-card.metric-info .metric-icon { color: #2e71da; border-color: #d0e0fb; background: var(--secondary-soft); }
.metric-card.metric-warning .metric-icon { color: #b97800; border-color: #f2dfae; background: var(--warning-soft); }
.metric-card.metric-danger .metric-icon { color: #c63d58; border-color: #f4cbd3; background: var(--danger-soft); }

.muted, .hint, .block { color: var(--muted) !important; }
.muted { font-size: .78rem; }
.block { display: block; direction: ltr; text-align: right; font-size: .7rem; }
.hint { padding: 12px 14px; border: 1px dashed #cbd8e4; border-radius: 14px; background: #f7fafc; font-size: .76rem; }
.empty { min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 25px; border: 1px dashed #cfd9e4; border-radius: 15px; color: var(--muted); background: #fafcfe; text-align: center; font-size: .77rem; }
.empty i { width: 28px; height: 28px; color: #8aa0b4; font-size: 1.25rem; }

/* ---------- Forms ---------- */
label { display: flex; flex-direction: column; gap: 7px; color: #33455b; font-size: .75rem; font-weight: 800; }
label small { color: var(--muted); font-size: .64rem; font-weight: 400; }
input, select, textarea {
  width: 100%;
  min-height: 45px;
  padding: 11px 12px;
  border: 1px solid #d8e1ea;
  border-radius: 13px;
  color: var(--text);
  background: #fbfdff;
  box-shadow: inset 0 1px 1px rgba(17,38,59,.02);
  transition: .2s ease;
}
textarea { min-height: 105px; resize: vertical; line-height: 1.65; }
input::placeholder, textarea::placeholder { color: #a2adba; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #71d6ac; background: #fff; box-shadow: 0 0 0 4px rgba(21,185,121,.10); }
select option { color: var(--text); background: #fff; }
.toggle { min-height: 53px; display: grid; grid-template-columns: 43px minmax(0,1fr); align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid #e0e8ef; border-radius: 14px; background: #fbfdff; cursor: pointer; font-weight: 400; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle > span { position: relative; width: 42px; height: 24px; border-radius: 99px; background: #cfd8e2; transition: .2s ease; }
.toggle > span::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 7px rgba(16,34,54,.18); transition: .2s ease; }
.toggle input:checked + span { background: var(--primary); }
.toggle input:checked + span::after { right: 21px; }
.toggle b { color: #34465a; font-size: .72rem; }
.inline-form { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.inline-form > label { flex: 1 1 210px; }
.mini-form { display: flex; gap: 7px; margin-top: 8px; }
.settings-form { gap: 18px; }
.input-icon-wrap { position: relative; }
.input-icon-wrap > i:first-child { position: absolute; top: 50%; right: 14px; z-index: 2; width: 18px; height: 18px; color: #8b99a9; transform: translateY(-50%); }
.input-icon-wrap input { padding-right: 43px; }
.password-toggle { position: absolute; top: 50%; left: 10px; z-index: 3; width: 35px; height: 35px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; color: #708094; background: transparent; cursor: pointer; transform: translateY(-50%); }
.password-toggle:hover { color: var(--primary-dark); background: var(--primary-soft); }

/* ---------- Buttons ---------- */
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid #d9e2eb;
  border-radius: 12px;
  color: #34465a;
  background: #fff;
  box-shadow: 0 6px 18px rgba(21,39,60,.05);
  cursor: pointer;
  text-decoration: none;
  font-size: .72rem;
  font-weight: 800;
  transition: .2s ease;
}
.button:hover { transform: translateY(-2px); border-color: #bccbd9; box-shadow: 0 10px 24px rgba(21,39,60,.1); }
.button.primary { color: #fff; border-color: transparent; background: linear-gradient(135deg, #1bc584, #0d9d65); box-shadow: 0 12px 28px rgba(21,185,121,.22); }
.button.primary:hover { box-shadow: 0 15px 34px rgba(21,185,121,.3); }
.button.ghost { color: #246249; border-color: #cae7da; background: #f2fbf7; }
.button.danger { color: #c23e56; border-color: #f1cbd3; background: var(--danger-soft); }
.button.small { min-height: 34px; padding: 6px 10px; border-radius: 10px; font-size: .66rem; }
.button.large { min-height: 49px; padding: 12px 21px; font-size: .79rem; }
.actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.actions.between { justify-content: space-between; margin-bottom: 15px; }
.connection-actions form { flex: 1 1 180px; }
.connection-actions .button { width: 100%; }
.save-dock { position: sticky; bottom: 12px; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 15px; border: 1px solid #d6e2ea; border-radius: 18px; background: rgba(255,255,255,.92); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 18px 45px rgba(14,37,58,.16); }
.save-dock strong, .save-dock small { display: block; }
.save-dock strong { color: var(--text-strong); font-size: .78rem; }
.save-dock small { color: var(--muted); font-size: .64rem; }

/* ---------- Alerts / badges ---------- */
.alert { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 11px; margin-bottom: 17px; padding: 12px 13px; border: 1px solid; border-radius: 15px; }
.alert-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; }
.alert strong, .alert small { display: block; }
.alert strong { font-size: .76rem; }
.alert small { margin-top: 2px; font-size: .66rem; }
.alert-success { color: #146b4a; border-color: #bfe8d6; background: #ecfbf4; }
.alert-success .alert-icon { background: #d8f6e9; }
.alert-error { color: #a93148; border-color: #f0c3cd; background: #fff1f4; }
.alert-error .alert-icon { background: #ffe0e7; }
.alert-close { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; color: inherit; background: transparent; cursor: pointer; opacity: .65; }
.alert-close:hover { background: rgba(255,255,255,.65); opacity: 1; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-height: 25px; padding: 3px 8px; border: 1px solid #dbe3eb; border-radius: 99px; color: #53657a; background: #f5f8fb; font-size: .62rem; font-weight: 800; white-space: nowrap; }
.badge-success, .badge-connected, .badge-accepted, .badge-resolved, .badge-completed { color: #08774b; border-color: #bee8d6; background: var(--success-soft); }
.badge-danger, .badge-error, .badge-failed, .badge-stopped, .badge-logged_out, .badge-cancelled, .badge-canceled { color: #b4354e; border-color: #f0c3cd; background: var(--danger-soft); }
.badge-warning, .badge-pending, .badge-processing, .badge-active, .badge-inprogress { color: #9a6500; border-color: #edd9a7; background: var(--warning-soft); }
.badge-info, .badge-unknown { color: #2461b3; border-color: #cadcf8; background: var(--secondary-soft); }
.status-connected { color: var(--success) !important; }
.status-error, .status-logged_out { color: var(--danger) !important; }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
table { width: 100%; min-width: 780px; border-collapse: collapse; }
th, td { padding: 12px 13px; border-bottom: 1px solid #ebf0f5; text-align: right; vertical-align: middle; }
th { position: sticky; top: 0; z-index: 1; color: #637287; background: #f7f9fc; font-size: .64rem; font-weight: 900; letter-spacing: .2px; }
td { color: #3d4e63; font-size: .69rem; }
tbody tr { transition: .18s ease; }
tbody tr:hover { background: #f8fbfd; }
tbody tr:last-child td { border-bottom: 0; }
.cell-title { display: flex; align-items: center; gap: 9px; font-weight: 800; }
.cell-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; border: 1px solid #d7e8e1; border-radius: 10px; color: var(--primary-dark); background: var(--primary-soft); }
.context { max-width: 430px; max-height: 150px; overflow: auto; font-size: .63rem; }
pre { margin: 0; padding: 14px; overflow: auto; white-space: pre-wrap; direction: ltr; text-align: left; border: 1px solid #dce5ed; border-radius: 14px; color: #245342; background: #f5faf8; font: 12px/1.7 Consolas, Monaco, monospace; }
code { padding: 2px 6px; border: 1px solid #cce8dc; border-radius: 7px; color: #08764a; background: #eaf8f2; font-family: Consolas, Monaco, monospace; font-size: .68rem; }

/* ---------- Details / QR ---------- */
.details { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 0; margin: 0 0 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; }
.details dt, .details dd { min-height: 47px; display: flex; align-items: center; padding: 10px 12px; border-bottom: 1px solid #ebf0f5; }
.details dt { color: #5c6d81; background: #f7f9fc; font-size: .68rem; font-weight: 800; }
.details dd { margin: 0; color: #2b3e54; background: #fff; font-size: .7rem; }
.details dt:nth-last-of-type(1), .details dd:last-child { border-bottom: 0; }
.qr-card { text-align: center; }
.qr-frame { min-height: 360px; display: grid; place-items: center; padding: 18px; border: 1px dashed #cfdbe6; border-radius: 18px; background: linear-gradient(145deg, #f9fbfd, #f0f5f9); }
.qr-frame img { width: min(330px, 100%); padding: 10px; border-radius: 19px; background: #fff; box-shadow: 0 16px 45px rgba(20,42,63,.14); }

/* ---------- Templates / ticket preview ---------- */
.template-builder { margin-top: 17px; }
.template-list { display: grid; gap: 17px; }
.template-shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(195px,1fr)); gap: 9px; margin-top: 14px; }
.template-shortcuts > span { display: flex; flex-direction: column; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #f8fafc; }
.template-shortcuts b { display: flex; align-items: center; gap: 7px; color: #33465c; font-size: .68rem; }
.template-shortcuts code { width: max-content; }
.ticket-preview { margin-top: 16px; padding: 14px; border: 1px solid #dce8e3; border-radius: 16px; background: linear-gradient(145deg, #f8fcfa, #f1f8f5); }
.ticket-preview > span { display: block; margin-bottom: 8px; color: var(--primary-dark); font-size: .6rem; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; }
.command-box { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid #d8e2eb; border-radius: 9px; color: #3d5065; background: #f7f9fc; font-family: Consolas, monospace; font-size: .64rem; }

/* ---------- Footer ---------- */
.footer { width: min(1440px, calc(100% - 42px)); min-height: 86px; margin: 16px auto 20px; padding: 19px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid #dce4ec; color: var(--muted); font-size: .66rem; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-logo { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg, #25c985, #0c955f); box-shadow: 0 10px 24px rgba(21,185,121,.2); }
.footer-brand strong, .footer-brand small, .footer-rights span, .footer-rights small { display: block; }
.footer-brand strong { color: #2b3d52; font-size: .7rem; }
.footer-brand small, .footer-rights small { margin-top: 2px; font-size: .58rem; }
.footer-rights { text-align: left; }
.footer-rights strong { color: var(--primary-dark); }

/* ---------- Login ---------- */
.guest-topbar { width: min(1280px, calc(100% - 34px)); min-height: 79px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.guest-topbar .brand-copy strong { color: var(--text-strong); }
.guest-topbar .brand-copy small { color: var(--muted); }
.guest-secure { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #cfe6dc; border-radius: 99px; color: #277254; background: #edf9f4; font-size: .65rem; font-weight: 800; }
.guest-container { width: min(1280px, calc(100% - 34px)); min-height: calc(100vh - 155px); display: grid; align-items: center; }
.login-shell { width: 100%; min-height: 620px; display: grid; grid-template-columns: 1.08fr .92fr; overflow: hidden; border: 1px solid #d7e0e9; border-radius: 30px; background: #fff; box-shadow: 0 35px 100px rgba(16,37,58,.16); }
.login-showcase { position: relative; overflow: hidden; padding: 53px; color: #fff; background: radial-gradient(circle at 10% 10%, rgba(55,225,158,.24), transparent 26%), radial-gradient(circle at 90% 90%, rgba(82,137,255,.32), transparent 28%), linear-gradient(135deg, #0d1b2a, #12314c 58%, #0f4650); }
.login-showcase::after { content: ""; position: absolute; inset: 0; opacity: .17; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 34px 34px; }
.login-showcase-content, .login-showcase-footer { position: relative; z-index: 2; }
.login-kicker { display: inline-flex; align-items: center; gap: 7px; color: #80f0bf; font-size: .68rem; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; }
.login-showcase h1 { margin: 16px 0 12px; max-width: 620px; font-size: clamp(2.25rem, 5vw, 4rem); line-height: 1.15; }
.login-showcase p { max-width: 600px; color: rgba(255,255,255,.66); font-size: .83rem; }
.login-features { display: grid; gap: 10px; margin-top: 29px; }
.login-feature { display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 11px; padding: 11px; border: 1px solid rgba(255,255,255,.1); border-radius: 15px; background: rgba(255,255,255,.055); }
.login-feature > i { width: 41px; height: 41px; padding: 11px; border-radius: 12px; color: #8aefc1; background: rgba(255,255,255,.07); }
.login-feature strong, .login-feature small { display: block; }
.login-feature strong { font-size: .72rem; }
.login-feature small { color: rgba(255,255,255,.5); font-size: .61rem; }
.login-showcase-footer { margin-top: 42px; color: rgba(255,255,255,.48); font-size: .62rem; }
.login-card { min-height: 620px; margin: 0; padding: 50px; display: flex; flex-direction: column; justify-content: center; border: 0; border-radius: 0; box-shadow: none; }
.login-card:hover { transform: none; box-shadow: none; }
.login-card::after { display: none; }
.login-icon { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 17px; border: 1px solid #c9eadc; border-radius: 18px; color: var(--primary-dark); background: var(--primary-soft); }
.login-icon i { font-size: 1.45rem; }
.login-card-head h2 { margin: 4px 0 5px; font-size: 1.5rem; }
.login-card-head p { margin: 0 0 23px; }
.login-security { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 11px 12px; border: 1px solid #dfe7ee; border-radius: 13px; color: #607186; background: #f8fafc; font-size: .64rem; }
.guest-footer { min-height: 70px; display: grid; place-items: center; color: var(--muted); font-size: .62rem; }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(11px); animation: reveal .5s ease forwards; animation-delay: var(--reveal-delay, 0ms); }
@keyframes reveal { to { opacity: 1; transform: none; } }
.alert-hiding { opacity: 0; transform: translateY(-8px); transition: .2s ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  :root { --sidebar-width: 258px; }
  .container, .footer { width: min(100% - 30px, 1440px); }
  .topbar-inner { width: min(100% - 30px, 1500px); }
  .grid.cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .login-showcase, .login-card { padding: 40px; }
}

@media (max-width: 1080px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: min(310px, calc(100vw - 34px));
    border-left: 1px solid rgba(255,255,255,.08);
    transform: translateX(105%);
    transition: transform .3s cubic-bezier(.2,.75,.25,1);
  }
  body.sidebar-open { overflow: hidden; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 90; display: block; visibility: hidden; opacity: 0; background: rgba(7,18,30,.58); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); transition: .25s ease; }
  body.sidebar-open .sidebar-overlay { visibility: visible; opacity: 1; }
  .sidebar-close, .mobile-menu { display: inline-grid; }
  .topbar-title { display: none; }
}

@media (max-width: 900px) {
  .grid.two { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-showcase { min-height: auto; }
}

@media (max-width: 720px) {
  .topbar-inner, .container, .footer { width: min(100% - 20px, 1440px); }
  .topbar-inner { min-height: 66px; }
  .topbar-action { display: none; }
  .header-separator { display: none; }
  .page-hero { min-height: 145px; margin: 15px 0 16px; padding: 23px 20px; border-radius: 21px; }
  .page-hero h1 { font-size: clamp(1.7rem, 8vw, 2.25rem); }
  .page-hero p { max-width: 320px; font-size: .7rem; }
  .hero-breadcrumb { margin-bottom: 8px; }
  .hero-visual { width: 82px; height: 82px; flex-basis: 82px; }
  .ring-one { width: 76px; height: 76px; }
  .ring-two { width: 56px; height: 56px; }
  .hero-core { width: 42px; height: 42px; border-radius: 14px; }
  .hero-core i { font-size: 1.18rem; }
  .hero-particle { display: none; }
  .card { padding: 17px; border-radius: 19px; }
  .card-head, .section-head, .actions.between { flex-direction: column; align-items: stretch; }
  .section-icon { position: absolute; top: 15px; left: 15px; width: 41px; height: 41px; }
  .card-head > div { padding-left: 48px; }
  .inline-form { display: grid; grid-template-columns: 1fr; }
  .inline-form > label { width: 100%; }
  .details { grid-template-columns: 110px minmax(0,1fr); }
  .save-dock { bottom: 8px; }
  .save-dock > div { display: none; }
  .save-dock .button { width: 100%; }
  .footer { flex-direction: column; text-align: center; }
  .footer-rights { text-align: center; }
}

@media (max-width: 560px) {
  .brand-mark { width: 43px; height: 43px; flex-basis: 43px; border-radius: 14px; }
  .brand-copy strong { font-size: .84rem; }
  .brand-copy small { font-size: .54rem; }
  .logout-button { width: 41px; padding: 0; }
  .logout-button span { display: none; }
  .hero-visual { display: none; }
  .page-hero { min-height: 132px; }
  .grid.cards { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .metric-card { min-height: 143px !important; padding: 15px; display: flex !important; flex-direction: column-reverse; align-items: flex-start; justify-content: space-between; }
  .metric-icon { width: 43px; height: 43px; border-radius: 14px; }
  .metric-copy strong { font-size: 1.62rem; }
  .metric-copy span { font-size: .62rem; }
  .metric-copy small { font-size: .58rem; }
  .actions .button, .inline-form .button { width: 100%; }
  .mini-form { display: grid; grid-template-columns: 1fr; }
  .mini-form .button { width: 100%; }
  .login-showcase { display: none; }
  .login-shell { min-height: auto; border-radius: 23px; }
  .login-card { min-height: 535px; padding: 28px 21px; }
  .qr-frame { min-height: 320px; }
}

@media (max-width: 390px) {
  .grid.cards { grid-template-columns: 1fr; }
  .metric-card { min-height: 119px !important; display: grid !important; grid-template-columns: minmax(0,1fr) auto; }
  .details { grid-template-columns: 1fr; }
  .details dt { min-height: 32px; padding-bottom: 2px; border-bottom: 0; }
  .details dd { min-height: 36px; padding-top: 2px; }
}