:root {
  --av-forest: #0d4c3a;
  --av-forest-2: #17684f;
  --av-deep: #163d31;
  --av-mint: #e9f2ee;
  --av-bg: #f3f6f4;
  --av-card: #ffffff;
  --av-ink: #17251f;
  --av-muted: #75817c;
  --av-line: #e1e8e4;
  --av-gold: #c48a3a;
  --av-danger: #b84343;
  --av-shadow: 0 10px 32px rgba(23, 61, 49, .07);
  --av-radius: 20px;
}

html { background: var(--av-bg); }
body.avento-global-ui {
  margin: 0;
  background: var(--av-bg) !important;
  color: var(--av-ink) !important;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  min-height: 100vh;
}
body.avento-global-ui h1,
body.avento-global-ui h2,
body.avento-global-ui .display-title {
  color: var(--av-ink);
  font-family: Georgia, "Times New Roman", serif !important;
  font-weight: 600;
  letter-spacing: -.02em;
}
body.avento-global-ui a { color: var(--av-forest); }
body.avento-global-ui :focus-visible {
  outline: 3px solid rgba(196, 138, 58, .55) !important;
  outline-offset: 3px;
}

/* Shared desktop rail */
.av-shell-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  width: 108px;
  padding: 24px 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-right: 1px solid var(--av-line);
}
.av-shell-logo,
body.avento-portal .side .logo {
  width: 49px !important;
  height: 49px !important;
  margin: 0 auto 28px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(145deg, #207b5a, #0b4d37) !important;
  color: white !important;
  box-shadow: 0 12px 25px rgba(18, 100, 72, .2);
  font: 700 27px Georgia, serif !important;
}
.av-shell-nav { width: 100%; display: grid; gap: 7px; }
.av-shell-link,
body.avento-portal .side > a {
  min-height: 62px;
  margin: 0 !important;
  padding: 8px 4px !important;
  border-radius: 14px !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #7e8984 !important;
  background: transparent !important;
  text-decoration: none;
  text-align: center;
  font-size: 9px !important;
  line-height: 1.15;
}
.av-shell-link svg,
body.avento-portal .side > a svg { width: 19px; height: 19px; stroke-width: 1.7; }
.av-shell-link:hover,
.av-shell-link.active,
body.avento-portal .side > a:hover,
body.avento-portal .side > a.on {
  color: var(--av-forest) !important;
  background: var(--av-mint) !important;
  box-shadow: inset 3px 0 var(--av-forest);
}
body.avento-portal .side > a.av-alarm-nav { color: #a74545 !important; }
body.avento-portal .side > a.av-alarm-nav:hover,
body.avento-portal .side > a.av-alarm-nav.on { color: #9c3030 !important; background: #fff0ed !important; box-shadow: inset 3px 0 #c64a40; }
.av-alarm-console-link { background: #9f332f !important; color: #fff !important; border-color: #9f332f !important; }

.av-alarm-launchers { margin: 0 0 18px; padding: 16px; border: 1px solid var(--av-line); border-radius: 16px; background: var(--av-bg); }
.av-alarm-guide { display: grid; gap: 3px; margin-bottom: 12px; }
.av-alarm-guide strong { font: 600 20px Georgia,serif; color: var(--av-ink); }
.av-alarm-guide span { color: var(--av-muted); font-size: 11px; }
.av-alarm-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.av-alarm-buttons button { min-height: 76px; padding: 12px !important; display: flex; align-items: center; gap: 11px; text-align: left; color: var(--av-ink) !important; background: var(--av-card) !important; border: 1px solid var(--av-line) !important; border-radius: 14px !important; }
.av-alarm-buttons button:hover,.av-alarm-buttons button.selected { border-color: #d45a4f !important; box-shadow: 0 0 0 3px rgba(212,90,79,.12) !important; }
.av-alarm-buttons b { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: #fff0ed; color: #b64037; font-size: 22px; }
.av-alarm-buttons span { display: grid; gap: 2px; }
.av-alarm-buttons strong { font-size: 14px; }
.av-alarm-buttons small { color: var(--av-muted); font-size: 9px; }
.av-alarm-launchers > p { margin: 12px 0 0; color: var(--av-muted); font-size: 10px; }
html[data-av-theme="night"] .av-alarm-launchers { background: #091711; }
html[data-av-theme="night"] .av-alarm-buttons b { background: #3a1e20; color: #ff9a92; }
html[data-av-theme="classic"] body.avento-portal .side > a.av-alarm-nav { color: #ffd3cd !important; }
html[data-av-theme="classic"] body.avento-portal .side > a.av-alarm-nav:hover { background: #783832 !important; color: #fff !important; }
.av-device-setup { margin: 16px 0; padding: 15px; display: grid; grid-template-columns: minmax(190px,1fr) minmax(230px,1.2fr); align-items: center; gap: 12px; border: 1px solid #e5c8c4; border-radius: 17px; background: #fff7f5; color: #542822; }
.av-device-setup > div { display: flex; align-items: center; gap: 11px; }
.av-device-setup > div > b { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 14px; background: #ffe4df; font-size: 22px; }
.av-device-setup span { display: grid; gap: 2px; }
.av-device-setup small { font-size: 8px; letter-spacing: .11em; font-weight: 800; }
.av-device-setup button { min-height: 53px; padding: 10px 14px; display: grid; gap: 2px; border: 0; border-radius: 13px; background: #a63832; color: #fff; text-align: left; cursor: pointer; }
.av-device-setup button span { font-size: 9px; opacity: .82; }
.av-device-setup > p { grid-column: 2; margin: -7px 4px 0; color: #8c6661; font-size: 9px; }
.av-device-setup.enabled { border-color: #b9ddce; background: #eef8f3; color: #164f3b; }
.av-device-setup.enabled button { background: #17684f; }
.av-device-alarm { position: fixed; inset: 0; z-index: 10000; padding: 20px; display: grid; place-items: center; background: rgba(62,5,5,.92); backdrop-filter: blur(12px); }
.av-device-alarm-card { width: min(560px,100%); padding: clamp(25px,6vw,52px); border: 3px solid rgba(255,255,255,.72); border-radius: 30px; background: #9e241f; color: #fff; text-align: center; box-shadow: 0 30px 90px rgba(0,0,0,.5); }
.av-device-alarm[data-type="earthquake"] .av-device-alarm-card { background: #8a4c0e; }
.av-device-alarm-signal { width: 94px; height: 94px; margin: 0 auto 17px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.16); font-size: 48px; animation: avAlarmPulse .72s infinite alternate; }
.av-device-alarm small { font-weight: 900; letter-spacing: .17em; }
.av-device-alarm h2 { margin: 8px 0 16px; color: #fff !important; font-size: clamp(42px,11vw,74px) !important; }
.av-device-alarm p { font-size: clamp(15px,3vw,19px); }
.av-device-alarm-actions { margin-top: 24px; display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.av-device-alarm-actions button,.av-device-alarm-actions a { min-height: 53px; padding: 10px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.55); border-radius: 13px; background: #fff; color: #6f1714 !important; font-weight: 850; text-decoration: none; cursor: pointer; }
.av-device-alarm-actions button:first-child { background: transparent; color: #fff !important; }
.av-device-alarm.silenced .av-device-alarm-signal { animation: none; opacity: .65; }
body.av-alarm-ringing .av-global-header,body.av-alarm-ringing .top { box-shadow: inset 0 -4px #e04b42; }
@keyframes avAlarmPulse { from { transform: scale(.9); box-shadow: 0 0 0 0 rgba(255,255,255,.2); } to { transform: scale(1.08); box-shadow: 0 0 0 22px rgba(255,255,255,0); } }
html[data-av-theme="night"] .av-device-setup { background: #291716; color: #ffd8d3; border-color: #63312c; }
html[data-av-theme="night"] .av-device-setup.enabled { background: #10271e; color: #c8f2df; border-color: #285b47; }
.av-shell-more { margin-top: auto; width: 100%; }
.av-shell-user {
  padding-top: 14px;
  border-top: 1px solid var(--av-line);
  color: var(--av-forest);
  text-align: center;
  font-weight: 900;
  font-size: 11px;
}
.av-shell-user small { display: block; margin-top: 3px; color: var(--av-muted); font-size: 8px; font-weight: 600; }

/* Shared header */
.av-global-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 99px;
  margin-left: 108px;
  padding: 0 clamp(20px, 3.5vw, 58px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--av-line);
  backdrop-filter: blur(18px);
}
.av-global-header small {
  display: block;
  color: #89938f;
  font-size: 8px;
  letter-spacing: .16em;
  font-weight: 800;
  text-transform: uppercase;
}
.av-global-header h1 { margin: 6px 0 0; font-size: clamp(24px, 2.4vw, 31px); }
.av-status { color: var(--av-muted); font-size: 9px; white-space: nowrap; }
.av-status::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #27b779; }
.av-notification {
  width: 42px; height: 42px; margin-left: 18px;
  display: inline-grid; place-items: center;
  color: var(--av-forest); background: #fff;
  border: 1px solid var(--av-line); border-radius: 13px;
  text-decoration: none;
}
.av-header-actions { display: flex; align-items: center; }
.av-theme-trigger {
  width: 42px; height: 42px; margin-left: 12px; padding: 0 !important;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--av-forest) !important; background: #fff !important;
  border: 1px solid var(--av-line) !important; border-radius: 13px !important;
  box-shadow: none !important;
}
.av-theme-trigger svg { width: 20px; height: 20px; }
.av-theme-trigger span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
body.avento-portal .top .av-theme-trigger { margin-left: auto; margin-right: 10px; }

.av-theme-panel {
  position: fixed; z-index: 130; top: 82px; right: 28px; width: min(370px,calc(100vw - 28px));
  padding: 18px; color: var(--av-ink); background: var(--av-card);
  border: 1px solid var(--av-line); border-radius: 20px; box-shadow: 0 24px 70px rgba(9,35,27,.22);
}
.av-theme-panel[hidden] { display: none !important; }
.av-theme-title { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.av-theme-title small { display: block; color: var(--av-muted); font-size: 8px; letter-spacing: .15em; font-weight: 800; }
.av-theme-title strong { display: block; margin-top: 4px; font: 600 20px Georgia,serif; }
.av-theme-close { width: 34px; height: 34px; padding: 0 !important; color: var(--av-muted) !important; background: transparent !important; border: 1px solid var(--av-line) !important; border-radius: 10px !important; font-size: 22px; line-height: 1; }
.av-theme-options { display: grid; gap: 8px; }
.av-theme-option {
  width: 100%; min-height: 70px; padding: 9px 10px !important;
  display: grid; grid-template-columns: 78px 1fr 24px; align-items: center; gap: 11px;
  color: var(--av-ink) !important; background: transparent !important;
  border: 1px solid var(--av-line) !important; border-radius: 14px !important; text-align: left;
}
.av-theme-option:hover,.av-theme-option[aria-pressed="true"] { background: var(--av-mint) !important; border-color: rgba(23,104,79,.35) !important; }
.av-theme-option > span:nth-child(2) { display: grid; gap: 3px; }
.av-theme-option > span:nth-child(2) strong { font-size: 13px; }
.av-theme-option > span:nth-child(2) small { color: var(--av-muted); font-size: 9px; }
.av-theme-check { color: var(--av-forest); font-style: normal; opacity: 0; font-weight: 900; }
.av-theme-option[aria-pressed="true"] .av-theme-check { opacity: 1; }
.av-theme-preview { height: 49px; padding: 5px; display: grid; grid-template-columns: 11px 1fr; grid-template-rows: 12px 1fr; gap: 4px; border: 1px solid rgba(120,140,130,.2); border-radius: 9px; overflow: hidden; }
.av-theme-preview i { grid-row: 1/3; border-radius: 3px; }
.av-theme-preview b { border-radius: 3px; }
.av-theme-preview em { border-radius: 4px; }
.av-preview-original { background: #f3f6f4; }.av-preview-original i{background:#fff}.av-preview-original b{background:#fff}.av-preview-original em{background:#14533f}
.av-preview-day { background: #fffaf1; }.av-preview-day i{background:#fff}.av-preview-day b{background:#fff}.av-preview-day em{background:#2f7b5f}
.av-preview-night { background: #08140f; }.av-preview-night i{background:#10231b}.av-preview-night b{background:#10231b}.av-preview-night em{background:#1d7554}
.av-preview-classic { background: #edf3f0; }.av-preview-classic i{background:#053b35}.av-preview-classic b{background:#edf3f0}.av-preview-classic em{background:#176c60}
.av-theme-panel > p { margin: 12px 3px 0; color: var(--av-muted); font-size: 9px; }

/* Three selectable appearances */
html[data-av-theme="day"] {
  --av-forest: #17684f; --av-forest-2: #258264; --av-deep: #195943;
  --av-mint: #eef7f1; --av-bg: #fffaf3; --av-card: #ffffff;
  --av-ink: #18231e; --av-muted: #718078; --av-line: #e9e2d8;
  --av-shadow: 0 12px 34px rgba(80,65,35,.07);
}
html[data-av-theme="day"] body.avento-global-ui { background: linear-gradient(180deg,#fffdf9,#fff8ef) !important; }
html[data-av-theme="day"] .av-shell-sidebar,
html[data-av-theme="day"] .av-global-header,
html[data-av-theme="day"] body.avento-portal .side,
html[data-av-theme="day"] body.avento-portal .top { background: rgba(255,255,255,.97) !important; }
html[data-av-theme="day"] body.avento-portal .hero { background: radial-gradient(circle at 88% 0,rgba(102,190,145,.46),transparent 36%),linear-gradient(120deg,#1d5945,#19805b) !important; }

html[data-av-theme="night"] {
  color-scheme: dark;
  --av-forest: #67d6a5; --av-forest-2: #2a9a70; --av-deep: #267a5a;
  --av-mint: #17382b; --av-bg: #07120e; --av-card: #102119;
  --av-ink: #f3f7f5; --av-muted: #9fb2aa; --av-line: #274237;
  --av-gold: #e1b875; --av-danger: #ff8989;
  --av-shadow: 0 18px 45px rgba(0,0,0,.24);
}
html[data-av-theme="night"],html[data-av-theme="night"] body.avento-global-ui { background: radial-gradient(circle at 90% 0,#133b2b 0,transparent 32%),#07120e !important; }
html[data-av-theme="night"] .av-shell-sidebar,
html[data-av-theme="night"] .av-global-header,
html[data-av-theme="night"] .av-mobile-nav,
html[data-av-theme="night"] body.avento-portal .side,
html[data-av-theme="night"] body.avento-portal .top { background: rgba(9,25,18,.97) !important; border-color: var(--av-line) !important; }
html[data-av-theme="night"] body.avento-global-ui .card,
html[data-av-theme="night"] body.avento-global-ui .panel,
html[data-av-theme="night"] body.avento-global-ui article.card,
html[data-av-theme="night"] body.avento-global-ui section.card,
html[data-av-theme="night"] body.avento-global-ui table,
html[data-av-theme="night"] body.avento-global-ui .wrap > .top:first-child,
html[data-av-theme="night"] .av-theme-panel { background: var(--av-card) !important; color: var(--av-ink) !important; }
html[data-av-theme="night"] body.avento-global-ui input,
html[data-av-theme="night"] body.avento-global-ui select,
html[data-av-theme="night"] body.avento-global-ui textarea { background: #091711 !important; color: var(--av-ink) !important; border-color: var(--av-line) !important; }
html[data-av-theme="night"] .av-theme-trigger,
html[data-av-theme="night"] .av-notification,
html[data-av-theme="night"] body.avento-global-ui .btn.secondary,
html[data-av-theme="night"] body.avento-global-ui a.secondary,
html[data-av-theme="night"] body.avento-global-ui button.secondary { background: #102119 !important; color: var(--av-forest) !important; border-color: var(--av-line) !important; }
html[data-av-theme="night"] body.avento-portal .hero { background: radial-gradient(circle at 88% 0,rgba(48,151,106,.35),transparent 36%),linear-gradient(120deg,#0b241a,#0c553b) !important; }
html[data-av-theme="night"] body.avento-global-ui .ok,
html[data-av-theme="night"] body.avento-global-ui .flash { background: #123225 !important; color: #baf4d7 !important; border-color: #285a44 !important; }
html[data-av-theme="night"] body.avento-global-ui .bad,
html[data-av-theme="night"] body.avento-global-ui .error { background: #3a1e20 !important; color: #ffc7c7 !important; border-color: #704047 !important; }

/* Classic: faithfully restores the earlier Avento administration look */
html[data-av-theme="classic"] {
  --av-forest: #075f54; --av-forest-2: #16756a; --av-deep: #075f54;
  --av-mint: #e3f4ef; --av-bg: #f0f5f3; --av-card: #ffffff;
  --av-ink: #08201c; --av-muted: #667d77; --av-line: #e5ece9;
  --av-shadow: none; --av-radius: 19px;
}
html[data-av-theme="classic"] body.avento-global-ui,
html[data-av-theme="classic"] body.avento-global-ui h1,
html[data-av-theme="classic"] body.avento-global-ui h2,
html[data-av-theme="classic"] body.avento-global-ui .display-title { font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif !important; letter-spacing: -.02em; }
html[data-av-theme="classic"] .av-shell-sidebar,
html[data-av-theme="classic"] body.avento-portal .side {
  width: 235px !important; padding: 27px 13px 20px !important;
  align-items: stretch; background: #043b35 !important; border: 0 !important;
}
html[data-av-theme="classic"] .av-shell-logo,
html[data-av-theme="classic"] body.avento-portal .side .logo {
  width: auto !important; height: 48px !important; margin: 0 7px 26px !important;
  display: flex !important; align-items: center; justify-content: flex-start;
  color: transparent !important; background: transparent !important; border-radius: 0 !important;
  box-shadow: none !important; overflow: visible;
}
html[data-av-theme="classic"] .av-shell-logo::after,
html[data-av-theme="classic"] body.avento-portal .side .logo::after {
  content: "AVENTO ONE"; color: #fff; font: 900 23px/1 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; letter-spacing: -.04em;
}
html[data-av-theme="classic"] .av-shell-link,
html[data-av-theme="classic"] body.avento-portal .side > a {
  min-height: 46px; padding: 11px 13px !important; flex-direction: row; justify-content: flex-start; gap: 0;
  color: #d7eeea !important; border-radius: 12px !important; font-size: 16px !important; text-align: left;
}
html[data-av-theme="classic"] .av-shell-link svg,
html[data-av-theme="classic"] body.avento-portal .side > a svg { display: none; }
html[data-av-theme="classic"] .av-shell-link:hover,
html[data-av-theme="classic"] .av-shell-link.active,
html[data-av-theme="classic"] body.avento-portal .side > a:hover,
html[data-av-theme="classic"] body.avento-portal .side > a.on { color: #fff !important; background: #155c53 !important; box-shadow: none; }
html[data-av-theme="classic"] .av-shell-user { display: none; }
html[data-av-theme="classic"] .av-global-header { height: 92px; margin-left: 235px; background: var(--av-bg); border: 0; }
html[data-av-theme="classic"] .av-global-header h1 { font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif !important; font-size: 20px; font-weight: 800; }
html[data-av-theme="classic"] body.av-shell-enabled > main,
html[data-av-theme="classic"] body.av-shell-enabled > .wrap,
html[data-av-theme="classic"] body.av-shell-enabled > .container { margin-left: 235px !important; padding-top: 27px !important; }
html[data-av-theme="classic"] body.avento-portal .main { margin-left: 235px !important; background: var(--av-bg); }
html[data-av-theme="classic"] body.avento-portal .top { min-height: 92px; margin-bottom: 0 !important; background: var(--av-bg) !important; border: 0; }
html[data-av-theme="classic"] body.avento-portal .top strong { font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; font-size: 16px; font-weight: 800; }
html[data-av-theme="classic"] body.avento-portal .hero {
  min-height: 182px; margin-top: 0; padding: 31px !important; border-radius: 24px !important;
  background: linear-gradient(110deg,#0c5149,#197568) !important; box-shadow: none;
}
html[data-av-theme="classic"] body.avento-portal .hero::after { display: none; }
html[data-av-theme="classic"] body.avento-portal .hero h1 { margin: 13px 0 7px; font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif !important; font-size: 34px !important; font-weight: 850; }
html[data-av-theme="classic"] body.avento-portal .cards { margin-top: 20px; }
html[data-av-theme="classic"] body.avento-portal .card,
html[data-av-theme="classic"] body.avento-portal .panel { border: 0 !important; box-shadow: none !important; }
html[data-av-theme="classic"] body.avento-global-ui .card h2,
html[data-av-theme="classic"] body.avento-global-ui .card h3,
html[data-av-theme="classic"] body.avento-global-ui .panel h2,
html[data-av-theme="classic"] body.avento-global-ui .panel h3 { font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif !important; font-weight: 800; }
html[data-av-theme="classic"] .av-theme-trigger,
html[data-av-theme="classic"] .av-notification { background: transparent !important; }

/* Legacy pages normalized into the editorial system */
body.av-shell-enabled > main,
body.av-shell-enabled > .wrap,
body.av-shell-enabled > .container {
  width: auto !important;
  max-width: 1480px !important;
  margin: 0 auto 0 108px !important;
  padding: 30px clamp(18px, 3.5vw, 58px) 90px !important;
}
body.avento-global-ui .wrap > .top:first-child {
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid var(--av-line);
  border-radius: 14px;
  background: rgba(255,255,255,.75);
}
body.avento-global-ui .wrap > h1,
body.avento-global-ui .container > h1 {
  margin: 22px 0 6px !important;
  color: var(--av-ink) !important;
  font-size: clamp(35px, 5vw, 58px) !important;
  line-height: 1.02;
}
body.avento-global-ui .muted { color: var(--av-muted) !important; }
body.avento-global-ui .grid { gap: 18px !important; }
body.avento-global-ui .card,
body.avento-global-ui .panel,
body.avento-global-ui article.card,
body.avento-global-ui section.card {
  background: var(--av-card) !important;
  color: var(--av-ink) !important;
  border: 1px solid var(--av-line) !important;
  border-radius: var(--av-radius) !important;
  box-shadow: var(--av-shadow) !important;
}
body.avento-global-ui .card h2,
body.avento-global-ui .card h3,
body.avento-global-ui .panel h2,
body.avento-global-ui .panel h3 { color: var(--av-ink) !important; }
body.avento-global-ui .item { border-color: var(--av-line) !important; }
body.avento-global-ui .pill,
body.avento-global-ui .badge,
body.avento-global-ui .tag {
  border: 0 !important;
  background: var(--av-mint) !important;
  color: var(--av-forest) !important;
  font-weight: 800;
}
body.avento-global-ui .btn,
body.avento-global-ui button[type="submit"] {
  border: 0 !important;
  border-radius: 11px !important;
  background: var(--av-deep) !important;
  color: #fff !important;
  box-shadow: none !important;
  font-weight: 800;
}
body.avento-global-ui .btn.secondary,
body.avento-global-ui a.secondary,
body.avento-global-ui button.secondary {
  background: #fff !important;
  color: var(--av-forest) !important;
  border: 1px solid var(--av-line) !important;
}
body.avento-global-ui input,
body.avento-global-ui select,
body.avento-global-ui textarea {
  background: #fff !important;
  color: var(--av-ink) !important;
  border: 1px solid #d8e2dd !important;
  border-radius: 11px !important;
}
body.avento-global-ui input::placeholder,
body.avento-global-ui textarea::placeholder { color: #98a39e !important; }
body.avento-global-ui table { background: #fff; border-radius: 14px; overflow: hidden; }
body.avento-global-ui th { color: var(--av-muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
body.avento-global-ui th,
body.avento-global-ui td { border-color: var(--av-line) !important; }
body.avento-global-ui .bad,
body.avento-global-ui .error { background: #fff0f0 !important; color: #8e3030 !important; border: 1px solid #f0cccc !important; }
body.avento-global-ui .ok,
body.avento-global-ui .flash { background: #e8f6ef !important; color: #145d43 !important; border: 1px solid #bfe2d1 !important; }

/* Portal: exact structure of the reference dashboard */
body.avento-portal .shell { display: block !important; min-height: 100vh; }
body.avento-portal .side {
  position: fixed !important; inset: 0 auto 0 0; z-index: 80;
  width: 108px !important; height: 100vh !important;
  padding: 24px 12px 18px !important;
  background: #fff !important; border-right: 1px solid var(--av-line);
  color: var(--av-ink) !important; overflow-y: auto;
}
body.avento-portal .main {
  max-width: none !important; width: auto !important;
  margin-left: 108px !important; padding: 0 0 70px !important;
}
body.avento-portal .top {
  position: sticky; top: 0; z-index: 50; min-height: 99px;
  margin: 0 0 30px !important; padding: 0 clamp(20px,3.5vw,58px);
  align-items: center; background: #fff; border-bottom: 1px solid var(--av-line);
}
body.avento-portal .top small { font-size: 8px; letter-spacing: .15em; font-weight: 800; }
body.avento-portal .top strong { margin-top: 5px; font: 600 28px Georgia, serif; }
body.avento-portal .main > section,
body.avento-portal .main > div:not(.top):not(.flash) { margin-left: clamp(18px,3.5vw,58px); margin-right: clamp(18px,3.5vw,58px); }
body.avento-portal .hero {
  min-height: 285px; padding: 34px 31px !important;
  border-radius: 26px !important;
  background: radial-gradient(circle at 88% 0,rgba(72,174,128,.38),transparent 36%),linear-gradient(120deg,#173c31,#0c593f) !important;
  box-shadow: 0 20px 42px rgba(16,78,56,.16);
  position: relative; overflow: hidden;
}
body.avento-portal .hero::after {
  content: ""; position: absolute; width: 330px; height: 330px; right: -100px; bottom: -185px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(255,255,255,.06),0 0 0 110px rgba(255,255,255,.04);
}
body.avento-portal .hero h1 { color: #fff !important; font-size: clamp(34px,4vw,48px) !important; }
body.avento-portal .hero p,
body.avento-portal .hero small { color: #d5e6df !important; }
body.avento-portal .cards { gap: 14px !important; }
body.avento-portal .card,
body.avento-portal .panel { border: 1px solid var(--av-line); box-shadow: var(--av-shadow); }

.av-mobile-nav { display: none; }
body.avento-global-ui .bottom { display: none !important; }

@media (max-width: 900px) {
  .av-shell-sidebar,
  body.avento-portal .side { display: none !important; }
  .av-global-header { height: 77px; margin-left: 0; padding: 0 16px; }
  .av-global-header h1 { font-size: 22px; }
  .av-status { display: none; }
  .av-theme-panel { top: 70px; right: 10px; width: calc(100vw - 20px); }
  body.av-shell-enabled > main,
  body.av-shell-enabled > .wrap,
  body.av-shell-enabled > .container { margin-left: 0 !important; padding: 20px 14px 92px !important; }
  body.avento-portal .main { margin-left: 0 !important; padding-bottom: 88px !important; }
  html[data-av-theme="classic"] .av-global-header { margin-left: 0; }
  html[data-av-theme="classic"] body.av-shell-enabled > main,
  html[data-av-theme="classic"] body.av-shell-enabled > .wrap,
  html[data-av-theme="classic"] body.av-shell-enabled > .container,
  html[data-av-theme="classic"] body.avento-portal .main { margin-left: 0 !important; }
  body.avento-portal .top { min-height: 77px; padding: 0 16px; margin-bottom: 18px !important; }
  body.avento-portal .top strong { font-size: 22px; }
  body.avento-portal .main > section,
  body.avento-portal .main > div:not(.top):not(.flash) { margin-left: 14px; margin-right: 14px; }
  body.avento-portal .cards { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  .av-mobile-nav {
    position: fixed; inset: auto 0 0; z-index: 100;
    height: 72px; padding: 5px max(5px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom));
    display: flex; align-items: center; justify-content: space-around;
    background: rgba(255,255,255,.97); border-top: 1px solid var(--av-line); backdrop-filter: blur(18px);
  }
  .av-mobile-nav a {
    min-width: 54px; min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: #7d8983 !important; text-decoration: none; font-size: 8px;
  }
  .av-mobile-nav a.active { color: var(--av-forest) !important; }
  .av-mobile-nav svg { width: 20px; height: 20px; }
}

@media (max-width: 560px) {
  body.avento-global-ui .grid,
  body.avento-global-ui .fields,
  body.avento-global-ui .two { grid-template-columns: 1fr !important; }
  body.avento-portal .cards { grid-template-columns: 1fr 1fr !important; }
  body.avento-portal .hero { min-height: 320px; padding: 27px 21px !important; }
  body.avento-global-ui .card,
  body.avento-global-ui .panel { border-radius: 17px !important; }
  .av-alarm-buttons { grid-template-columns: 1fr; }
  .av-device-setup { grid-template-columns: 1fr; }
  .av-device-setup > p { grid-column: 1; margin: -4px 2px 0; }
  .av-device-alarm { padding: 10px; }
  .av-device-alarm-card { border-radius: 22px; }
  .av-device-alarm-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* AVENTO CONVERSATIONS V1 */

.av-shell-link{
    position:relative;
}

.av-conversations-badge{
    margin-left:auto;
    min-width:19px;
    height:19px;
    padding:0 5px;
    border-radius:999px;
    display:inline-grid;
    place-items:center;
    background:#d94d4d;
    color:#fff;
    font-size:10px;
    line-height:1;
    font-weight:900;
}

html[data-av-theme="night"] .av-conversations-badge{
    background:#ff7474;
    color:#210707;
}

html[data-av-theme="day"] .av-conversations-badge{
    background:#c94343;
    color:#fff;
}
