  :root {
    --bg-deep:    #050505;
    --bg-navy:    #090909;
    --bg-card:    #101010;
    --bg-card2:   #171717;
    --nav-bg:     rgba(5,5,5,0.97);
    --sidebar-bg: rgba(8,8,8,0.96);
    --overlay-bg: rgba(12,12,12,0.99);
    --border:     rgba(255,255,255,0.11);
    --border-hi:  rgba(0,220,130,0.45);
    --accent-g:   #00e676;
    --accent-b:   #00b4ff;
    --accent-y:   #ffd600;
    --accent-r:   #ff5252;
    --text-1:     #f5f5f5;
    --text-2:     #b7b7b7;
    --text-3:     #777777;
    --sidebar-w:  220px;
    --nav-h:      58px;
    --font-head:  'Rajdhani', sans-serif;
    --font-body:  'Inter', sans-serif;
    --radius:     14px;
    --radius-sm:  8px;
  }

.toast-host {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  display: grid;
  gap: 10px;
  max-width: min(420px, calc(100vw - 44px));
}

.toast {
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-1);
  box-shadow: 0 16px 38px rgba(10, 28, 45, .18);
  font-size: 13px;
  line-height: 1.35;
}

.toast-error {
  border-color: rgba(255, 82, 82, .45);
  color: var(--accent-r);
}

.info-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 7, 30, .45);
  backdrop-filter: blur(5px);
}

.info-modal-backdrop[hidden] {
  display: none;
}

.info-modal {
  width: min(720px, calc(100vw - 32px));
  max-height: min(88vh, 760px);
  position: relative;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent-g);
  border-radius: 14px;
  background: var(--bg-card);
  color: var(--text-1);
  box-shadow: 0 24px 60px rgba(10, 28, 45, .28);
  overflow: hidden;
}

.info-modal-title {
  margin: 0 42px 10px 0;
  font-family: var(--font-head);
  font-size: 20px;
  line-height: 1.1;
  font-weight: 800;
}

.info-modal-body {
  display: grid;
  gap: 6px;
  max-height: calc(min(88vh, 760px) - 72px);
  overflow-y: auto;
  padding-right: 6px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.38;
}

.info-modal-body p {
  margin: 0;
}

/* Identificação do produto */
.info-modal-body p:first-child {
  color: var(--text-1);
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 2px;
}

/* Títulos das seções */
.info-modal-body .info-section-title {
  color: var(--text-1);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-top: 6px;
}

/* Nomes dos responsáveis */
.info-modal-body p:nth-child(7),
.info-modal-body p:nth-child(9),
.info-modal-body p:nth-child(11) {
  color: var(--text-1);
  font-size: 12px;
  font-weight: 700;
  margin-top: 3px;
}

/* Créditos finais */
.info-modal-body p:nth-child(n+14) {
  font-size: 11.5px;
  line-height: 1.3;
}

.info-modal-body::-webkit-scrollbar {
  width: 5px;
}

.info-modal-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.info-modal-close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-card2);
  color: var(--text-1);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 620px) {
  .info-modal-backdrop {
    padding: 12px;
  }

  .info-modal {
    width: 100%;
    max-height: 92vh;
    padding: 16px;
  }

  .info-modal-title {
    font-size: 18px;
  }

  .info-modal-body {
    max-height: calc(92vh - 68px);
    font-size: 11.5px;
  }
}
.info-modal-body p {
  margin: 0;
}

.info-modal-close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card2);
  color: var(--text-1);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

  html[data-theme="light"] {
    --bg-deep:    #f4f7fb;
    --bg-navy:    #ffffff;
    --bg-card:    #ffffff;
    --bg-card2:   #f7fafc;
    --nav-bg:     rgba(255,255,255,0.98);
    --sidebar-bg: rgba(255,255,255,0.96);
    --overlay-bg: rgba(255,255,255,0.99);
    --border:     rgba(22,82,125,0.15);
    --border-hi:  rgba(0,145,85,0.4);
    --accent-g:   #00a85a;
    --accent-b:   #087fbe;
    --accent-y:   #b98200;
    --accent-r:   #d93636;
    --text-1:     #14283b;
    --text-2:     #52677f;
    --text-3:     #7b8da1;
  }

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

  body {
    background: var(--bg-deep);
    color: var(--text-1);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background .2s ease, color .2s ease;
  }

  /* ─── TOP NAV ─── */
  .topnav {
    position: fixed; top:0; left:0; right:0; z-index:100;
    height: var(--nav-h);
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 24px 0 0;
    gap: 0;
  }
  .topnav .logo-area {
    width: var(--sidebar-w);
    padding: 0 20px;
    display: flex; align-items: center; gap: 10px;
    border-right: 1px solid var(--border);
    height: 100%;
    overflow: hidden;
  }
  .brand-wordmark {
    width: 172px;
    height: 40px;
    object-fit: contain;
    object-position: center;
  }
  .brand-wordmark-light { display: none; }
  html[data-theme="light"] .brand-wordmark-dark { display: none; }
  html[data-theme="light"] .brand-wordmark-light { display: block; }
  .logo-text {
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-g);
    letter-spacing: 1px;
    line-height: 1;
  }
  .logo-sub {
    font-size: 9px;
    color: var(--text-3);
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 1;
  }
  .nav-tabs {
    display: flex; align-items: center; gap: 4px;
    padding: 0 16px;
    flex: 1;
  }
  .nav-tab {
    padding: 7px 20px;
    border-radius: 30px;
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    color: var(--text-2);
    transition: all .2s;
    border: 1px solid transparent;
    background: none;
    white-space: nowrap;
  }
  .nav-tab:hover { color: var(--text-1); border-color: var(--border); }
  .nav-tab.active {
    background: var(--accent-g);
    color: #03071e;
    border-color: var(--accent-g);
    font-weight: 700;
  }
  .nav-right {
    display: flex; align-items: center; gap: 12px;
    margin-left: auto;
  }
  .filter-btn {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    cursor: pointer;
    color: var(--text-2);
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all .2s;
  }
  .filter-btn:hover { border-color: var(--accent-b); color: var(--text-1); }
  .icon-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-2);
    cursor: pointer;
    transition: border-color .2s, color .2s, background .2s;
  }
  .refresh-btn {
    display: flex; align-items: center; gap: 7px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 12px;
    cursor: pointer; color: var(--text-2); font: 600 13px var(--font-head); letter-spacing: .5px;
  }
  .refresh-btn:hover { border-color: var(--accent-b); color: var(--text-1); }
  .refresh-btn .ui-icon { width: 14px; height: 14px; }
  .refresh-btn:disabled { opacity: .65; cursor: wait; }
  .refresh-btn.is-loading .ui-icon { animation: refresh-spin .8s linear infinite; }
  @keyframes refresh-spin { to { transform: rotate(360deg); } }

  body.auth-locked .topnav,
  body.auth-locked .filter-bar,
  body.auth-locked .layout {
    display: none !important;
  }

  .auth-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #050505;
    isolation: isolate;
  }
  .auth-screen::before {
    content: '';
    position: absolute;
    inset: -14px;
    z-index: -2;
    background: url('./assets/login-bg.png') center/cover no-repeat;
    filter: blur(5px);
    transform: scale(1.025);
  }
  .auth-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(0,0,0,.62);
  }
  body.auth-locked .auth-screen { display: flex; }
  [hidden] { display: none !important; }
  .auth-card {
    width: min(92vw, 460px);
    padding: 34px 38px 26px;
    border-radius: 24px;
    color: #111820;
    background: #ffffff;
    border: 1px solid rgba(255,255,255,.7);
    box-shadow: 0 28px 80px rgba(0,0,0,.48);
  }
  .auth-logo {
    width: min(100%, 300px);
    height: 94px;
    object-fit: contain;
    object-position: center;
    display: block;
    margin: 0 auto 18px;
  }
  .auth-card h1 {
    font-family: var(--font-head);
    font-size: 24px;
    line-height: 1;
    margin-bottom: 4px;
    text-align: center;
  }
  .auth-card p {
    color: #637083;
    margin-bottom: 22px;
    text-align: center;
  }
  .auth-form { display: grid; gap: 14px; }
  .auth-field,
  .form-field {
    display: grid;
    gap: 7px;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
  }
  .auth-field { color: #39465a; }
  .auth-input {
    width: 100%;
    height: 48px;
    border-radius: 10px;
    border: 1px solid #bdc5cf;
    background: #fff;
    color: #14202e;
    padding: 0 18px;
    font-size: 16px;
    outline: none;
  }
  .auth-input::placeholder { color: #8a95a3; }
  .password-control {
    position: relative;
    display: block;
  }
  .password-control .auth-input,
  .password-control .email-input {
    padding-right: 48px;
  }
  .password-eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #455267;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  .password-eye:hover { background: #eef4f1; color: #087c50; }
  .password-eye .ui-icon { width: 18px; height: 18px; }
  .password-control.light .password-eye { color: var(--text-2); }
  .password-control.light .password-eye:hover { background: rgba(0,180,255,.08); color: var(--text-1); }
  .auth-remember {
    display: flex;
    gap: 9px;
    align-items: center;
    color: #39465a;
    font-size: 14px;
  }
  .page .auth-remember,
  .profile-panel .auth-remember,
  .admin-panel .auth-remember {
    color: var(--text-2);
  }
  .auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .auth-link,
  .auth-secondary {
    border: none;
    background: transparent;
    color: #237454;
    cursor: pointer;
    font-weight: 700;
  }
  .auth-link:hover,
  .auth-secondary:hover { color: #075b3b; text-decoration: underline; }
  .auth-submit {
    height: 52px;
    border: none;
    border-radius: 10px;
    background: #16885b;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(22,136,91,.22);
  }
  .auth-secondary {
    height: 40px;
    border: 1px solid #cad1d9;
    border-radius: 12px;
  }
  .auth-message {
    min-height: 18px;
    margin-top: 12px;
    color: #c52d2d;
    font-size: 13px;
  }
  .auth-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #d8dde3;
    text-align: center;
    color: #8993a0;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
  }
  .auth-footer strong { color: #384455; font-weight: 700; }
  .auth-footer i { width: 3px; height: 3px; border-radius: 50%; background: #16a66c; }
  .auth-footer button {
    border: 0;
    padding: 0 0 0 8px;
    background: transparent;
    color: #087b50;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }
  .auth-footer button:hover { text-decoration: underline; }
  .icon-btn:hover { border-color: var(--accent-b); color: var(--accent-b); }
  .icon-btn .ui-icon { width: 17px; height: 17px; }
  .profile-btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-2);
    padding: 5px 10px;
    font-family: var(--font-head);
    font-weight: 700;
    cursor: pointer;
  }
  .profile-btn:hover { border-color: var(--accent-b); color: var(--text-1); }
  .profile-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-g), var(--accent-b));
    color: #031022;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    background-size: cover;
    background-position: center;
  }
  .profile-avatar.large {
    width: 56px;
    height: 56px;
    font-size: 18px;
  }
  .profile-panel {
    position: fixed;
    top: calc(var(--nav-h) + 10px);
    right: 24px;
    z-index: 180;
    width: min(420px, calc(100vw - 32px));
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--overlay-bg);
    box-shadow: 0 18px 48px rgba(0,0,0,.25);
  }
  .profile-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
  }
  .profile-panel-head > div {
    min-width: 0;
    display: grid;
    gap: 2px;
  }
  .profile-panel-head strong,
  .profile-panel-head small {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .profile-panel .auth-input {
    height: 42px;
    color: var(--text-1);
    border-color: var(--border);
    background: var(--bg-card2);
    border-radius: 10px;
    font-size: 13px;
  }
  .profile-panel .auth-input::placeholder { color: var(--text-3); }
  .profile-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text-2);
    cursor: pointer;
    font-size: 12px;
    width: 100%;
    margin: 4px 0 12px;
    font-weight: 700;
  }
  .profile-panel .form-field {
    margin-bottom: 10px;
  }
  .profile-panel .email-action {
    width: 100%;
    min-height: 44px;
    margin: 2px 0 8px;
  }
  .profile-upload input { display: none; }
  .profile-logout {
    width: 100%;
    min-height: 36px;
    border: 1px solid rgba(255,82,82,.35);
    border-radius: 9px;
    background: rgba(255,82,82,.08);
    color: #ff5252;
    cursor: pointer;
    font-weight: 700;
  }
  .settings-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card2);
  }
  .settings-check-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
    font-size: 13px;
  }
  .admin-hub {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 16px 0;
  }
  .admin-hub-card {
    text-align: left;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-2);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
  }
  .admin-hub-card strong {
    display: block;
    color: var(--text-1);
    font-family: var(--font-head);
    font-size: 20px;
    margin-bottom: 4px;
  }
  .admin-hub-card.active {
    border-color: var(--border-hi);
    box-shadow: inset 0 3px 0 var(--accent-g), 0 10px 28px rgba(0,0,0,.10);
  }
  .admin-panel { display: none; }
  .admin-panel.active { display: block; }
  .settings-back { margin-top: 10px; display: inline-flex; }
  .email-form-grid.one-column { grid-template-columns: 1fr; }
  .whatsapp-session { display: grid; gap: 14px; align-items: start; }
  .whatsapp-qr {
    width: min(320px, 100%);
    aspect-ratio: 1;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 10px;
  }
  .table-scroll { overflow-x: auto; }
  .cell-strong { font-weight: 700; color: var(--text-1); }
  .report-widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card2);
  }
  .email-period-custom {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card2);
  }
  .email-period-custom[hidden] {
    display: none !important;
  }
  .custom-report-summary {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card2);
    color: var(--text-2);
    font-size: 13px;
  }
  .custom-report-summary > div {
    min-width: 0;
    flex: 1;
  }
  .custom-report-selected-list {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
    margin-top: 8px;
    max-height: 136px;
    overflow: auto;
    padding-right: 4px;
  }
  .custom-report-selected-list span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 320px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-2);
    font-size: 11px;
    font-weight: 700;
    cursor: default;
  }
  .custom-report-selected-list span.dragging { opacity: .55; }
  .custom-report-selected-list span b {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: inherit;
  }
  .custom-report-selected-list span button {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: rgba(255,77,87,.12);
    color: var(--accent-r);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
  }
  .custom-report-selected-list em {
    color: var(--text-3);
    font-size: 12px;
    font-style: normal;
  }
  .modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 7, 22, .68);
    backdrop-filter: blur(6px);
  }
  .modal-card {
    width: min(760px, 96vw);
    max-height: 88vh;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 24px 80px rgba(0,0,0,.35);
    display: flex;
    flex-direction: column;
  }
  .modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
  }
  .modal-head strong {
    display: block;
    color: var(--text-1);
    font-family: var(--font-head);
    font-size: 22px;
  }
  .modal-head span {
    display: block;
    color: var(--text-3);
    font-size: 13px;
    margin-top: 4px;
  }
  .custom-report-list {
    padding: 0;
    overflow: auto;
    display: block;
    background: var(--bg);
    min-height: 0;
  }
  .custom-report-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
  }
  .custom-report-tabs button {
    border: 1px solid var(--border);
    background: var(--bg-card2);
    color: var(--text-2);
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 800;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
  }
  .custom-report-tabs button.active {
    background: var(--accent-g);
    border-color: var(--accent-g);
    color: #001b12;
  }
  .custom-report-group {
    margin: 10px 2px 0;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .custom-report-item {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card2);
    cursor: grab;
  }
  .custom-report-item.dragging { opacity: .55; border-color: var(--accent-b); }
  .custom-report-item input { accent-color: var(--accent-g); }
  .custom-report-item strong {
    display: block;
    color: var(--text-1);
    font-size: 14px;
  }
  .custom-report-item span {
    display: block;
    color: var(--text-3);
    font-size: 12px;
    margin-top: 2px;
  }
  .custom-report-modal {
    width: min(1180px, 96vw);
    max-height: 92vh;
  }
  .mini-dashboard-shell {
    background: var(--bg);
    min-height: 560px;
  }
  .mini-dashboard-top {
    height: 58px;
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: static;
  }
  .mini-logo {
    height: 100%;
    border-right: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding-left: 22px;
    font-family: Georgia, serif;
    font-size: 26px;
    font-style: italic;
    color: var(--accent-g);
  }
  .mini-dashboard-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 14px;
    min-width: 0;
  }
  .mini-dashboard-toolbar strong {
    font-family: var(--font-head);
    color: var(--text-1);
    font-size: 16px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mini-dashboard-toolbar span {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--text-2);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
  }
  .mini-dashboard-body {
    padding: 18px;
  }
  .mini-page-title {
    font-family: var(--font-head);
    color: var(--text-1);
    font-size: 18px;
    font-weight: 800;
  }
  .mini-page-sub {
    color: var(--text-3);
    font-size: 12px;
    margin-top: 4px;
    margin-bottom: 14px;
  }
  .mini-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
  }
  .mini-dashboard-section + .mini-dashboard-section {
    margin-top: 18px;
  }
  .custom-report-section-title {
    margin: 2px 0 10px;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .custom-report-visual {
    grid-column: span 4;
    position: relative;
    min-width: 0;
    min-height: 190px;
    display: block;
    padding: 14px;
    cursor: grab;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-card);
  }
  .custom-report-visual.wide {
    grid-column: span 6;
    min-height: 250px;
  }
  .custom-report-visual input[name="custom-report-component"] {
    position: absolute;
    inset: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }
  .custom-report-visual.is-selected {
    border-color: rgba(0, 230, 118, .65);
    box-shadow: inset 0 0 0 1px rgba(0, 230, 118, .2);
  }
  .mini-select-box {
    position: absolute;
    right: 14px;
    top: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--text-1);
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 7px 5px 9px;
    z-index: 2;
    max-width: 162px;
    cursor: pointer;
    user-select: none;
  }
  .mini-select-box span { white-space: nowrap; }
  .mini-select-box i,
  .mini-select-box .mini-check {
    width: 18px;
    height: 18px;
    display: block;
    border: 1.5px solid var(--text-2);
    border-radius: 6px;
    background: var(--bg-card);
    flex: 0 0 auto;
  }
  .custom-report-visual.is-selected .mini-select-box i,
  .custom-report-visual.is-selected .mini-select-box .mini-check {
    border-color: var(--accent-g);
    background: var(--accent-g);
    box-shadow: none;
  }
  .custom-report-visual.is-selected .mini-select-box i::after,
  .custom-report-visual.is-selected .mini-select-box .mini-check::after {
    content: '✓';
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
  }
  .mini-card-title {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-right: 160px;
    color: var(--text-1);
    font-weight: 800;
    min-height: 32px;
  }
  .mini-card-title strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 14px;
    line-height: 1.16;
  }
  .mini-card-title .ui-icon {
    width: 22px;
    height: 22px;
    padding: 4px;
    border-radius: 7px;
    background: rgba(0,180,255,.12);
    color: var(--text-1);
  }
  .mini-card-sub {
    color: var(--text-3);
    font-size: 11px;
    margin: 6px 0 12px;
    min-height: 26px;
  }
  .mini-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .mini-kpi {
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    min-height: 92px;
  }
  .mini-single-kpi {
    display: grid;
    align-content: center;
    gap: 10px;
    min-height: 118px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card2);
  }
  .mini-single-kpi .ui-icon {
    width: 24px;
    height: 24px;
    padding: 5px;
    border-radius: 8px;
    background: rgba(0,180,255,.14);
  }
  .mini-single-kpi strong {
    font-family: var(--font-head);
    font-size: 22px;
    line-height: 1;
  }
  .mini-single-kpi strong.green { color: var(--accent-g); }
  .mini-single-kpi strong.blue { color: var(--accent-b); }
  .mini-single-kpi strong.yellow { color: var(--accent-y); }
  .mini-single-kpi span {
    color: var(--text-3);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }
  .mini-kpi .ui-icon {
    width: 20px;
    height: 20px;
    padding: 3px;
    background: rgba(0,180,255,.14);
    border-radius: 6px;
    margin-bottom: 8px;
  }
  .mini-kpi strong {
    display: block;
    font-family: var(--font-head);
    font-size: 18px;
    line-height: 1;
  }
  .mini-kpi strong.green { color: var(--accent-g); }
  .mini-kpi strong.blue { color: var(--accent-b); }
  .mini-kpi strong.yellow { color: var(--accent-y); }
  .mini-kpi span {
    font-size: 9px;
    color: var(--text-3);
    text-transform: uppercase;
    margin-top: 6px;
  }
  .mini-bars {
    height: 150px;
    display: flex;
    gap: 12px;
    align-items: flex-end;
    padding: 20px 14px 14px;
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .mini-bars span {
    flex: 1;
    min-width: 18px;
    border-radius: 5px 5px 0 0;
    background: linear-gradient(180deg, rgba(0,230,118,.55), rgba(0,180,255,.45));
    position: relative;
  }
  .mini-bars span b {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-3);
    font-size: 9px;
    white-space: nowrap;
  }
  .mini-donut-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 14px;
    align-items: center;
    min-height: 140px;
  }
  .mini-donut {
    width: 118px;
    height: 118px;
    border-radius: 50%;
    background: conic-gradient(var(--accent-g) 0 58%, var(--accent-b) 58% 86%, var(--accent-r) 86% 94%, var(--accent-y) 94% 100%);
    position: relative;
  }
  .mini-donut::after {
    content: '';
    position: absolute;
    inset: 32px;
    border-radius: 50%;
    background: var(--bg-card);
  }
  .mini-legend {
    display: grid;
    gap: 8px;
    font-size: 11px;
    color: var(--text-2);
  }
  .mini-legend i {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 3px;
    margin-right: 6px;
  }
  .green-bg { background: var(--accent-g); }
  .blue-bg { background: var(--accent-b); }
  .red-bg { background: var(--accent-r); }
  .mini-table {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    font-size: 10px;
  }
  .mini-table > div {
    display: grid;
    grid-template-columns: 32px 1fr 60px 56px;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
  }
  .mini-table > div:first-child {
    background: rgba(0,180,255,.08);
    color: var(--text-1);
    text-transform: uppercase;
  }
  .mini-table > div:last-child { border-bottom: 0; }
  .custom-report-visual .drag-handle {
    position: absolute;
    right: 14px;
    bottom: 10px;
  }
  @media (max-width: 1000px) {
    .custom-report-visual { grid-column: span 6; }
    .custom-report-visual.wide { grid-column: span 12; }
  }
  @media (max-width: 620px) {
    .mini-dashboard-top { grid-template-columns: 1fr; height: auto; }
    .mini-logo { border-right: 0; border-bottom: 1px solid var(--border); padding: 10px 16px; }
    .mini-dashboard-toolbar { padding: 10px 16px; }
    .custom-report-visual,
    .custom-report-visual.wide { grid-column: span 12; }
    .mini-card-title { padding-right: 44px; }
    .mini-select-box span { display: none; }
  }
  .drag-handle {
    color: var(--text-3);
    font-weight: 800;
    letter-spacing: 2px;
  }
  .season-metric-pair {
    color: var(--text-2);
    margin-left: 6px;
    font-weight: 700;
  }
  .modal-actions {
    display: flex;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid var(--border);
  }
  .email-picker {
    position: relative;
  }
  .email-picker-btn {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-1);
    text-align: left;
    cursor: pointer;
  }
  .email-picker-btn .ui-icon {
    width: 16px;
    height: 16px;
    color: var(--text-3);
  }
  .email-picker-menu {
    position: absolute;
    z-index: 80;
    top: calc(100% + 6px);
    left: 0;
    width: min(520px, 92vw);
    max-height: 360px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    box-shadow: 0 18px 40px rgba(0,0,0,.22);
  }
  .email-picker-search {
    width: calc(100% - 20px);
    margin: 10px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card2);
    color: var(--text-1);
  }
  .email-picker-actions {
    display: flex;
    gap: 8px;
    padding: 0 10px 10px;
  }
  .email-picker-actions button {
    border: 1px solid var(--border);
    background: var(--bg-card2);
    color: var(--text-2);
    border-radius: 8px;
    padding: 7px 10px;
    cursor: pointer;
    font-weight: 700;
  }
  .email-picker-options {
    max-height: 250px;
    overflow: auto;
    padding: 4px 8px 10px;
  }
  .email-picker-option {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 8px;
    align-items: start;
    padding: 8px;
    border-radius: 8px;
    color: var(--text-2);
    cursor: pointer;
  }
  .email-picker-option:hover {
    background: var(--bg-card2);
    color: var(--text-1);
  }
  .email-picker-option input {
    accent-color: var(--accent-g);
    margin-top: 2px;
  }
  .email-picker-empty {
    padding: 16px;
    color: var(--text-3);
  }
  .form-field select.email-input,
  .form-field input.email-input,
  .form-field textarea.email-input {
    background: var(--bg-card);
    color: var(--text-1);
  }
  html[data-theme="light"] .form-field select.email-input,
  html[data-theme="light"] .form-field input.email-input,
  html[data-theme="light"] .form-field textarea.email-input {
    background: #ffffff;
    color: #14283b;
  }
  .report-widget-grid label {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--text-2);
    font-size: 13px;
  }
  input[type="checkbox"],
  input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    border: 1.5px solid var(--text-3);
    background: var(--bg-card);
    display: inline-grid;
    place-content: center;
    margin: 0;
    cursor: pointer;
  }
  input[type="checkbox"] {
    border-radius: 4px;
  }
  input[type="radio"] {
    border-radius: 50%;
  }
  input[type="checkbox"]::before {
    content: "";
    width: 9px;
    height: 9px;
    transform: scale(0);
    transition: transform .12s ease;
    background: #ffffff;
    clip-path: polygon(14% 44%, 0 59%, 40% 100%, 100% 16%, 84% 0, 38% 62%);
  }
  input[type="radio"]::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: scale(0);
    transition: transform .12s ease;
    background: #ffffff;
  }
  input[type="checkbox"]:checked,
  input[type="radio"]:checked {
    border-color: var(--accent-g);
    background: var(--accent-g);
  }
  input[type="checkbox"]:checked::before,
  input[type="radio"]:checked::before {
    transform: scale(1);
  }
  input[type="checkbox"]:disabled,
  input[type="radio"]:disabled {
    opacity: .55;
    cursor: not-allowed;
  }
  .email-actions-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
  }
  .email-action.secondary {
    min-width: 140px;
    min-height: 44px;
    justify-content: center;
    color: var(--text-1);
    background: var(--bg-card2);
  }
  .filter-icon { width: 16px; height: 16px; }
  .ui-icon {
    width: 1em;
    height: 1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    flex-shrink: 0;
  }
  .ui-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* ─── LAYOUT ─── */
  .layout {
    display: flex;
    padding-top: var(--nav-h);
    min-height: 100vh;
  }

  /* ─── SIDEBAR ─── */
  .sidebar {
    width: var(--sidebar-w);
    min-height: calc(100vh - var(--nav-h));
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    position: fixed;
    top: var(--nav-h);
    bottom: 0;
    overflow-y: auto;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
  }
  .sidebar::-webkit-scrollbar { width: 3px; }
  .sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

  .sidebar-group-label {
    font-size: 9px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--text-3);
    padding: 14px 18px 6px;
    font-weight: 600;
  }
  .sidebar-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 18px;
    cursor: pointer;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all .18s;
    position: relative;
  }
  .sidebar-item:hover { color: var(--text-1); background: rgba(0,180,255,0.06); }
  .sidebar-item.active {
    color: #03071e;
    background: var(--accent-g);
    border-left-color: var(--accent-g);
    font-weight: 700;
    border-radius: 0 30px 30px 0;
    margin-right: 12px;
  }
  .sidebar-item .s-icon { width: 18px; height: 18px; display:flex; align-items:center; justify-content:center; font-size: 16px; flex-shrink: 0; }
  .sidebar-bottom {
    margin-top: auto;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
  }
  .sidebar-info {
    display: flex; align-items: center; gap: 8px;
    color: var(--text-3);
    font-size: 12px;
    cursor: pointer;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    text-align: left;
  }
  .sidebar-info:hover { color: var(--text-2); }

  /* ─── MAIN ─── */
  .main {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 20px;
    overflow-x: hidden;
  }

  /* ─── PAGE ─── */
  .page { display: none; }
  .page.active { display: block; }

  /* ─── LANDING PAGE ─── */
  .landing {
    min-height: calc(100vh - var(--nav-h));
    display: flex; flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: clamp(42px, 7vw, 100px);
  }
  .landing-bg {
    position: absolute; inset: 0; z-index: 0;
    background-image:
      linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 44px 44px;
  }
  html[data-theme="light"] .landing-bg {
    background-image:
      linear-gradient(rgba(20,40,59,.035) 1px, transparent 1px),
      linear-gradient(90deg, rgba(20,40,59,.035) 1px, transparent 1px);
  }
  .landing-content { position: relative; z-index: 1; max-width: min(720px, 46vw); }
  .landing-credit {
    color: var(--text-3);
    font-size: 11px;
    letter-spacing: 0;
    text-transform: uppercase;
    font-weight: 600;
    padding-left: 12px;
    border-left: 2px solid var(--accent-g);
    margin-bottom: 20px;
  }
  .landing-credit span { color: var(--text-2); margin-left: 6px; }
  .landing-title {
    font-family: var(--font-head);
    font-size: clamp(58px, 7vw, 96px);
    font-weight: 700;
    line-height: 1.0;
    color: var(--text-1);
    margin-bottom: 8px;
  }
  .landing-title span { color: var(--accent-g); }
  .landing-subtitle {
    font-family: var(--font-head);
    font-size: clamp(22px, 3vw, 36px);
    font-weight: 400;
    color: var(--text-2);
    margin-bottom: 24px;
    line-height: 1.2;
  }
  .landing-desc {
    font-size: 15px;
    color: var(--text-2);
    line-height: 1.7;
    max-width: 480px;
    margin-bottom: 36px;
  }
  .landing-cta {
    display: inline-flex; align-items: center; gap: 10px;
    background: var(--accent-g);
    color: #03071e;
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 700;
    padding: 13px 28px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    letter-spacing: 0.5px;
    transition: all .2s;
  }
  .landing-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,230,118,0.3); }
  .landing-info-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-2);
    font: 600 12px var(--font-body);
    cursor: pointer;
  }
  .landing-info-btn:hover { border-color: var(--accent-b); color: var(--text-1); }
  .landing-info-btn .ui-icon { width: 15px; height: 15px; }
  .landing-image-area {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 55%;
    display: flex; align-items: center; justify-content: center;
    z-index: 1;
    padding: 5vw;
  }
  .landing-tablet {
    width: min(100%, 760px);
    aspect-ratio: 1.48;
    position: relative;
    padding: clamp(14px, 1.5vw, 22px);
    border: 2px solid #2b2b2b;
    border-radius: 28px;
    background: #080808;
    box-shadow: 0 32px 70px rgba(0,0,0,.48), inset 0 0 0 1px #1d1d1d;
    transform: perspective(1200px) rotateY(-7deg) rotateX(2deg);
  }
  .tablet-camera {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #3a3a3a;
    left: 8px;
    top: 50%;
  }
  .tablet-button {
    position: absolute;
    width: 5px;
    height: 42px;
    border-radius: 4px;
    background: #292929;
    right: 7px;
    top: calc(50% - 21px);
  }
  .tablet-screen {
    height: 100%;
    overflow: hidden;
    border-radius: 15px;
    background: #f5f7f9;
    color: #14283b;
    padding: clamp(14px, 1.6vw, 24px);
  }
  .tablet-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid #dce3e8; }
  .tablet-header img { width: 130px; height: 28px; object-fit: contain; object-position: left center; }
  .tablet-status { display: flex; align-items: center; gap: 6px; color: #708096; font-size: 9px; }
  .tablet-status span { width: 6px; height: 6px; border-radius: 50%; background: #00a85a; }
  .tablet-heading { margin: 15px 0 10px; font: 700 17px/1 var(--font-head); }
  .tablet-heading small { display: block; margin-top: 4px; color: #8190a2; font: 500 8px/1 var(--font-body); }
  .tablet-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .tablet-kpis > div { border: 1px solid #dce3e8; border-top: 2px solid #00a85a; border-radius: 6px; padding: 9px; background: #fff; }
  .tablet-kpis span, .tablet-kpis small { display: block; color: #7b8da1; font-size: 7px; }
  .tablet-kpis strong { display: block; margin: 4px 0 2px; color: #0a6f4c; font: 700 clamp(13px, 1.4vw, 20px)/1 var(--font-head); }
  .tablet-panels { display: grid; grid-template-columns: 1.65fr 1fr; gap: 8px; margin-top: 8px; }
  .tablet-chart, .tablet-gauge { min-height: 126px; border: 1px solid #dce3e8; border-radius: 6px; background: #fff; padding: 9px; }
  .tablet-panel-title { color: #53677e; font-size: 8px; font-weight: 700; }
  .tablet-bars { height: 86px; display: flex; align-items: end; gap: 7px; padding: 10px 5px 0; border-bottom: 1px solid #d9e1e7; }
  .tablet-bars i { flex: 1; height: var(--bar); border-radius: 2px 2px 0 0; background: #21a8da; }
  .tablet-bars i:nth-child(3n+1) { background: #16ad72; }
  .tablet-gauge { display: grid; justify-items: center; align-content: start; }
  .tablet-gauge .tablet-panel-title { justify-self: start; }
  .tablet-ring { width: 72px; height: 72px; margin-top: 8px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(#16ad72 0 82.6%, #e5eaee 82.6% 100%); position: relative; }
  .tablet-ring::after { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: #fff; }
  .tablet-ring span { z-index: 1; font: 700 17px/1 var(--font-head); }
  .tablet-ring small { font-size: 9px; }
  .tablet-legend { margin-top: 5px; color: #718197; font-size: 7px; }
  .tablet-legend span { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #16ad72; margin-right: 4px; }
  .tablet-table { margin-top: 8px; display: grid; grid-template-columns: 1.5fr .8fr .7fr; align-items: center; gap: 5px 8px; color: #5e7085; font-size: 7px; }
  .tablet-table b, .tablet-table em { font-style: normal; font-weight: 600; text-align: right; color: #26394d; }
  .tablet-table em { color: #087fbe; }
  }
  .landing-mock-device {
    width: 520px;
    height: 340px;
    background: var(--bg-card);
    border: 1px solid var(--border-hi);
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 60px rgba(0,180,255,0.08);
    transform: perspective(1000px) rotateY(-8deg) rotateX(3deg);
  }
  .mock-inner {
    padding: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }
  .mock-kpi {
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
  }
  .mock-kpi-val {
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-g);
  }
  .mock-kpi-lbl { font-size: 9px; color: var(--text-3); margin-top: 3px; }
  .mock-chart-area {
    grid-column: 1/-1;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 8px;
    height: 130px;
    display: flex; align-items: flex-end;
    padding: 12px 8px 8px;
    gap: 4px;
  }
  .mock-bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    background: rgba(0,180,255,0.5);
    transition: height .3s;
  }
  .mock-bar.hi { background: var(--accent-g); }

  .landing-badges {
    display: flex; gap: 16px; margin-top: 32px; flex-wrap: wrap;
  }
  .badge {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--text-2);
  }
  .badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-g); }

  /* ─── CARDS & GRID ─── */
  .page-header {
    margin-bottom: 20px;
  }
  .page-title {
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: 0.5px;
  }
  .page-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }

  .kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
  }
  .kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 14px;
    display: flex; flex-direction: column;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    transition: border-color .2s;
    cursor: default;
  }
  .kpi-card:hover { border-color: rgba(0,180,255,0.3); }
  .kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-g), var(--accent-b));
    opacity: 0.6;
  }
  .kpi-icon {
    width: 42px; height: 42px;
    background: rgba(0,180,255,0.1);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    margin-bottom: 10px;
  }
  .kpi-icon .ui-icon { width: 22px; height: 22px; }
  .kpi-val {
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-1);
    line-height: 1;
  }
  .kpi-val.green { color: var(--accent-g); }
  .kpi-val.blue  { color: var(--accent-b); }
  .kpi-val.yellow{ color: var(--accent-y); }
  .kpi-lbl {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* Chart cards */
  .chart-grid {
    display: grid;
    gap: 14px;
  }
  .chart-grid > *, .card { min-width: 0; }
  .g-2   { grid-template-columns: 1fr 1fr; }
  .g-3   { grid-template-columns: 1fr 1fr 1fr; }
  .g-1-2 { grid-template-columns: 2fr 1fr; }
  .g-2-1 { grid-template-columns: 1fr 2fr; }
  .g-3-2 { grid-template-columns: 3fr 2fr; }
  .equipment-chart-stack { grid-template-columns: 1fr; }
  .consumption-chart-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    position: relative;
    overflow: hidden;
  }
  .card-title {
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 14px;
    letter-spacing: 0.3px;
    display: flex; align-items: center; gap: 8px;
  }
  .card-title .dot-g { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-g); flex-shrink: 0; }
  .chart-wrap { position: relative; width: 100%; height: 270px; min-width: 0; overflow: hidden; }
  .chart-wrap.tall { height: 320px; }
  .chart-wrap.sm { height: 220px; }
  .chart-wrap.horizontal { height: 340px; }
  .chart-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: none;
    min-width: 0;
  }
  .chart-empty-inline {
    position: absolute;
    inset: 48px 18px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--text-3);
    background: rgba(255,255,255,0.04);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    pointer-events: none;
  }
  html[data-theme="light"] .chart-empty-inline {
    background: rgba(235,245,250,0.68);
  }

  /* Tables */
  .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
  }
  .data-table th {
    text-align: left;
    padding: 7px 10px;
    color: var(--text-3);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 10px;
    border-bottom: 1px solid var(--border);
  }
  .data-table td {
    padding: 8px 10px;
    color: var(--text-2);
    border-bottom: 1px solid rgba(0,180,255,0.05);
  }
  .data-table tr:hover td { background: rgba(0,180,255,0.04); color: var(--text-1); }
  .season-group-row td {
    background: rgba(0,176,95,.10);
    color: var(--accent-g);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .7px;
    border-top: 1px solid rgba(0,176,95,.28);
  }
  .season-row-0 td { background: rgba(0,180,255,.025); }
  .season-row-1 td { background: rgba(0,230,118,.035); }
  .td-rank {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-3);
  }
  .td-rank.gold { color: var(--accent-y); }
  .td-rank.silver { color: #aaa; }
  .td-rank.bronze { color: #cd7f32; }
  .bar-cell { position: relative; }
  .bar-fill {
    height: 5px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent-g), var(--accent-b));
    margin-top: 4px;
  }
  .badge-val {
    display: inline-block;
    background: rgba(0,230,118,0.12);
    color: var(--accent-g);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    font-family: var(--font-head);
  }
  .badge-val.blue { background: rgba(0,180,255,0.12); color: var(--accent-b); }
  .badge-val.red { background: rgba(255,60,60,0.12); color: #ff5252; }

  .report-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
  }
  .toolbar-label {
    color: var(--text-2);
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .5px;
  }
  .toolbar-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: min(420px, 100%);
  }
  .metric-select {
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card2);
    color: var(--text-1);
    padding: 0 12px;
    font: 600 14px var(--font-body);
    outline: none;
  }
  .page-note {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-2);
    padding: 12px 14px;
    font-size: 14px;
  }
  .page-note.is-warning,
  .comparison-status.is-warning {
    border-color: rgba(197, 140, 0, 0.45);
    background: rgba(255, 193, 7, 0.10);
    color: #8a6200;
  }
  .segmented-control {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card2);
  }
  .segmented-btn {
    border: 0;
    border-radius: 6px;
    padding: 7px 12px;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 700;
  }
  .segmented-btn.active {
    background: var(--accent-g);
    color: #03071e;
  }

  /* Donut legend */
  .donut-legend {
    display: flex; flex-direction: column; gap: 8px;
    margin-top: 12px;
  }
  .legend-item {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px;
    color: var(--text-2);
  }
  .legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

  /* Progress bar cards */
  .progress-list { display: flex; flex-direction: column; gap: 12px; }
  .progress-item { }
  .progress-header { display: flex; justify-content: space-between; margin-bottom: 5px; }
  .progress-label { font-size: 12px; color: var(--text-2); }
  .progress-val { font-size: 12px; font-weight: 600; font-family: var(--font-head); color: var(--text-1); }
  .progress-bar { height: 5px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
  .progress-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent-g), var(--accent-b)); }

  /* State time cards */
  .state-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
  .state-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
  }
  .state-val { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: var(--text-1); }
  .state-lbl { font-size: 10px; color: var(--text-3); margin-top: 2px; }

  /* icon-kpi-grid: definido na seção KPI CARDS VISÃO GERAL abaixo */

  /* Scrollbar global */
  ::-webkit-scrollbar { width: 5px; height: 5px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

  /* Separator line */
  .sep { height: 1px; background: var(--border); margin: 18px 0; }

  /* Responsive tweaks */
  @media (max-width: 1100px) {
    .kpi-row { grid-template-columns: repeat(3, 1fr); }
    .icon-kpi-grid { grid-template-columns: repeat(3, 1fr); }
  }

  .mb-16 { margin-bottom: 16px; }
  .mt-16 { margin-top: 16px; }

  /* Fade-in animation */
  .page.active .card,
  .page.active .kpi-card,
  .page.active .icon-kpi {
    animation: fadein .3s ease both;
  }
  @keyframes fadein {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ─── FILTER BAR (horizontal dropdown style) ─── */
  .filter-bar {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    z-index: 200;
    background: var(--overlay-bg);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 26px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    pointer-events: none;
    transition: opacity .2s, visibility .2s;
  }
  .filter-bar.open {
    visibility: visible;
    opacity: 1;
    pointer-events: all;
    min-height: 260px;
  }

  .filter-bar-title {
    font-family: var(--font-head);
    font-size: 13px; font-weight: 700;
    color: var(--text-1);
    letter-spacing: 1px;
    margin-bottom: 10px;
  }

  .filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 6px;
    margin-bottom: 10px;
    align-items: center;
  }

  .filter-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0;
  }
  .filter-dd-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    padding: 6px 10px 6px 12px;
    font-family: var(--font-body);
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-2);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    border-right: none;
  }
  .filter-dd-btn:hover { border-color: rgba(0,180,255,0.35); color: var(--text-1); }
  .filter-dd-btn .chevron { width: 12px; height: 12px; opacity: 0.65; margin-left: 2px; }
  .filter-dd-btn.active-filter { color: var(--accent-b); border-color: rgba(0,180,255,0.4); }

  .filter-clear-btn {
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--text-3);
    font-size: 11px;
    transition: all .15s;
  }
  .filter-clear-btn .ui-icon { width: 12px; height: 12px; }
  .filter-clear-btn:hover { color: #ff5252; border-color: rgba(255,82,82,0.4); }

  .email-form-grid {
    display: grid;
    gap: 10px;
  }
  .email-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-1);
    padding: 10px 12px;
    font: 13px var(--font-body);
    color-scheme: dark;
  }
  html[data-theme="light"] .email-input {
    background: #fff;
    color-scheme: light;
  }
  select.email-input option { background: #141414; color: #f5f5f5; }
  html[data-theme="light"] select.email-input option { background: #fff; color: #152334; }
  select.contact-select { min-height: 120px; }
  select.contact-select option { padding: 8px 10px; }
  .email-input:focus {
    outline: none;
    border-color: var(--accent-b);
  }
  .email-action {
    min-height: 42px;
  }

  /* Dropdown menu */
  .filter-dropdown-menu {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    background: var(--bg-navy);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    z-index: 300;
    padding: 6px 0;
    max-height: 260px;
    overflow-y: auto;
    transition: opacity .15s, visibility .15s;
  }
  .filter-dropdown-menu.open {
    visibility: visible;
    opacity: 1;
    pointer-events: all;
  }
  .filter-dd-heading {
    padding: 6px 12px 4px;
    font-size: 10px;
    color: var(--text-3);
    letter-spacing: 1px;
    text-transform: uppercase;
  }
  .filter-search {
    width: calc(100% - 20px);
    margin: 6px 10px 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card2);
    color: var(--text-1);
    outline: none;
    font-size: 12px;
  }
  .filter-search:focus { border-color: var(--accent-b); }
  .filter-options { display: contents; }
  .filter-dd-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--text-2);
    cursor: pointer;
    transition: background .12s;
  }
  .filter-dd-item[hidden] { display: none !important; }
  .filter-dd-item:hover { background: rgba(0,180,255,0.08); color: var(--text-1); }
  .filter-dd-item input[type=checkbox] { accent-color: var(--accent-b); width: 13px; height: 13px; flex-shrink: 0; }

  /* Date range */
  .filter-date-row {
    position: relative;
    display: inline-flex;
    min-width: 0;
    max-width: 100%;
  }
  .date-range-trigger {
    width: auto;
    max-width: 100%;
    min-height: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.03);
    color: var(--text-2);
    font-family: var(--font-body);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, background .15s;
  }
  .date-range-trigger:hover,
  .date-range-trigger[aria-expanded="true"] { border-color: var(--accent-b); background: rgba(0,180,255,.05); }
  .date-range-trigger strong { color: var(--accent-g); font-size: 11px; font-weight: 700; white-space: nowrap; }
  .date-range-chevron { width: 13px; height: 13px; margin-left: 2px; }
  .filter-date-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-2);
  }
  .filter-date-label .ui-icon,
  .filter-date-sep.icon-sep {
    width: 13px;
    height: 13px;
  }
  .date-range-popover {
    position: fixed;
    z-index: 250;
    width: min(560px, calc(100vw - 24px));
    overflow-y: auto;
    padding: 14px;
    border: 1px solid var(--border-hi);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-1);
    box-shadow: 0 18px 48px rgba(0,0,0,.38);
  }
  .date-range-popover[hidden] { display: none; }
  .date-range-presets { display: flex; gap: 6px; padding-bottom: 12px; overflow-x: auto; }
  .date-range-presets button {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--bg-card2);
    color: var(--text-2);
    font: 600 11px var(--font-body);
    cursor: pointer;
  }
  .date-range-presets button:hover { border-color: var(--accent-g); color: var(--text-1); }
  .date-range-fields { display: grid; grid-template-columns: 1.35fr 1fr 1.35fr 1fr; gap: 8px; }
  .date-range-fields label { min-width: 0; }
  .date-range-fields label > span { display: block; margin: 0 0 4px 2px; color: var(--text-3); font-size: 10px; }
  .date-range-fields input {
    width: 100%;
    height: 38px;
    padding: 7px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    outline: none;
    background: var(--bg-card2);
    color: var(--text-1);
    color-scheme: dark;
    font: 500 12px var(--font-body);
  }
  html[data-theme="light"] .date-range-fields input { color-scheme: light; }
  .date-range-fields input:focus { border-color: var(--accent-b); }
  .date-range-calendar-head { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; margin: 12px 0 8px; }
  .date-range-calendar-head strong { text-align: center; font: 700 16px var(--font-head); text-transform: capitalize; }
  .date-range-calendar-head .icon-btn { width: 32px; height: 32px; }
  .date-range-weekdays,
  .date-range-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .date-range-weekdays span { padding: 4px; color: var(--text-3); font-size: 10px; font-weight: 700; text-align: center; }
  .date-range-day {
    position: relative;
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--text-2);
    font: 600 12px var(--font-body);
    cursor: pointer;
  }
  .date-range-day::before { content: ""; position: absolute; inset: 3px 0; z-index: 0; }
  .date-range-day span { position: relative; z-index: 1; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
  .date-range-day:hover span { background: rgba(0,230,118,.14); color: var(--text-1); }
  .date-range-day.in-range::before { background: rgba(0,230,118,.12); }
  .date-range-day.selected span { background: var(--accent-g); color: #03140d; }
  .date-range-day.today span { box-shadow: inset 0 0 0 1px var(--accent-b); }
  .date-range-day.outside { color: var(--text-3); opacity: .45; }
  .date-range-day:disabled { opacity: .2; cursor: not-allowed; }
  .date-range-day:disabled:hover span { background: transparent; }
  .date-range-hint { min-height: 19px; padding-top: 7px; color: var(--text-3); font-size: 11px; text-align: center; }
  .date-range-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
  .date-range-actions .filter-submit { flex: 0 0 auto; font-size: 12px; letter-spacing: 0; padding: 9px 14px; }
  .date-range-actions .filter-clear-btn { padding: 9px 14px; }
  .field-invalid { border-color: #ff5252 !important; box-shadow: 0 0 0 2px rgba(255,82,82,.12); }

  /* Filtrar button */
  .filter-action-row {
    padding: 10px 0 14px;
    display: flex; gap: 10px; align-items: center;
  }
  .filter-submit {
    flex: 1;
    background: #1565c0;
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 24px;
    font-family: var(--font-head);
    font-size: 15px; font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background .2s;
  }
  .filter-submit:hover { background: #1976d2; }
  .filter-close-bar {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    color: var(--text-3);
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
  }
  .filter-close-bar .ui-icon { width: 12px; height: 12px; }
  .filter-close-bar:hover { color: var(--text-1); border-color: rgba(255,255,255,0.2); }
  .filter-collapse-row {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    cursor: pointer;
  }
  .filter-collapse-row .ui-icon { width: 16px; height: 16px; }

  /* ─── KPI CARDS VISÃO GERAL (estilo imagem 3) ─── */
  .icon-kpi-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
  }
  .kpi-card-vg {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 14px 14px;
    display: flex; flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: border-color .2s, transform .2s;
    cursor: default;
  }
  .kpi-card-vg::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-g), var(--accent-b));
    opacity: 0.55;
  }
  .kpi-card-vg:hover { border-color: rgba(0,180,255,0.3); transform: translateY(-2px); }
  .kpi-card-vg-top { margin-bottom: 14px; }
  .kpi-card-vg-icon {
    width: 44px; height: 44px;
    background: rgba(0,100,200,0.18);
    border: 1px solid rgba(0,180,255,0.15);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
  }
  .kpi-card-vg-icon .ui-icon,
  .kpi-card-vg-icon svg { width: 22px; height: 22px; }
  .kpi-val-vg {
    font-family: var(--font-head);
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
  }
  .kpi-val-vg.green  { color: var(--accent-g); }
  .kpi-val-vg.blue   { color: var(--accent-b); }
  .kpi-val-vg.yellow { color: var(--accent-y); }
  .kpi-lbl-vg {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-3);
    line-height: 1.3;
  }

  @media (max-width: 1500px) {
    .icon-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .consumption-chart-grid { grid-template-columns: 1fr; }
  }
  @media (max-width: 1100px) {
    .icon-kpi-grid { grid-template-columns: repeat(3, 1fr); }
    .landing { justify-content: flex-start; }
    .landing-content { max-width: 100%; }
    .landing-image-area {
      position: relative;
      inset: auto;
      width: 100%;
      margin-top: 28px;
    }
    .landing-tablet { width: min(100%, 720px); transform: none; }
  }
  .filter-dd-item input[type=radio] { accent-color: var(--accent-b); width:13px; height:13px; flex-shrink:0; }
  .filter-dd-btn.has-value { color: var(--accent-g) !important; border-color: rgba(0,230,118,0.5) !important; }
  .filter-dd-btn.has-value + .filter-clear-btn { color: var(--accent-g); border-color: rgba(0,230,118,0.3); }

  .data-unavailable {
    width: 100%;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: var(--text-2);
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
  }

  .comparison-status {
    margin-bottom: 16px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card2);
    color: var(--text-2);
    font-size: 12px;
    line-height: 1.5;
  }

  #resumo-diario-status.is-loading {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  #resumo-diario-status.is-loading::before {
    content: "";
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    border: 2px solid var(--border);
    border-top-color: var(--accent-g);
    border-radius: 50%;
    animation: dashboard-spin .7s linear infinite;
  }
  @keyframes dashboard-spin { to { transform: rotate(360deg); } }

  .season-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
  }

  .season-metric-value > b {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .season-metric-value .season-metric-combo {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  .season-metric-combo b {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  @media (max-width: 1550px) {
    .season-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }
  @media (max-width: 1120px) {
    .season-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  .season-card {
    min-width: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-1);
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    opacity: .58;
    transition: opacity .18s, border-color .18s, transform .18s, box-shadow .18s;
  }
  .season-card:hover {
    opacity: 1;
    transform: translateY(-2px);
    border-color: var(--accent-b);
  }
  .season-card.active {
    opacity: 1;
    border-color: var(--border-hi);
    box-shadow: inset 0 3px 0 var(--accent-g);
  }
  .season-card-head {
    min-height: 48px;
    padding: 13px 14px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .season-card-head strong {
    font-family: var(--font-head);
    font-size: 18px;
    letter-spacing: 0;
  }
  .season-card-indicators {
    display: flex;
    align-items: center;
    gap: 7px;
  }
  .season-trend {
    min-width: 58px;
    height: 26px;
    padding: 3px 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid currentColor;
    border-radius: 4px;
    font-family: var(--font-head);
    font-size: 12px;
    font-weight: 700;
    cursor: help;
  }
  .season-trend .ui-icon { width: 15px; height: 15px; }
  .season-trend.better { color: var(--accent-g); background: rgba(0,230,118,.09); }
  .season-trend.worse { color: #ff5252; background: rgba(255,82,82,.09); }
  .season-trend.equal { color: var(--accent-b); background: rgba(0,180,255,.09); }
  .season-insight-popover:not([hidden]) {
    position: fixed; z-index: 10020; width: min(400px, calc(100vw - 20px));
    max-height: min(360px, calc(100dvh - 20px)); overflow: auto; pointer-events: none;
    padding: 14px 16px; border: 1px solid var(--border-hi); border-radius: 12px;
    background: var(--bg-card); color: var(--text-1); box-shadow: 0 14px 36px rgba(0,0,0,.22);
    font: 12px/1.5 var(--font-body);
  }
  .season-insight-popover strong { display: block; margin-bottom: 8px; color: var(--accent-g); font: 700 14px var(--font-head); }
  .season-insight-popover small { display: block; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
  .season-insight-popover p { margin: 0; overflow-wrap: anywhere; }
  .season-insight-popover .season-insight-ai { margin-top: 4px; }
  .season-trend:focus-visible, .metric-trend:focus-visible { outline: 2px solid var(--accent-b); outline-offset: 2px; }
  .season-coverage {
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(255,82,82,.12);
    color: #ff5252;
    font-size: 11px;
    font-weight: 700;
  }
  .season-coverage.complete {
    background: rgba(0,230,118,.12);
    color: var(--accent-g);
  }
  .season-period {
    display: block;
    padding: 0 14px 11px;
    color: var(--text-3);
    font-size: 11px;
  }
  .season-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    border-top: 1px solid var(--border);
  }
  .season-metrics > span {
    min-width: 0;
    grid-column: span 2;
    padding: 10px 12px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .season-metrics > span:nth-child(3n) { border-right: 0; }
  .season-metrics > span:last-child { border-right: 0; }
  .season-metrics small,
  .season-metrics b {
    display: block;
    overflow-wrap: anywhere;
  }
  .season-metrics small {
    min-height: 24px;
    color: var(--text-3);
    font-size: 9px;
    line-height: 1.25;
    text-transform: uppercase;
  }
  .season-metrics b {
    margin-top: 3px;
    color: var(--text-1);
    font-family: var(--font-head);
    font-size: 15px;
  }
  .season-metric-value {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }
  .season-metric-value b {
    min-width: 0;
    font-size: 14px;
    white-space: nowrap;
  }
  .season-metric-combo {
    min-width: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    overflow: hidden;
  }
  .season-metric-combo b {
    flex: 0 1 auto;
  }
  .season-metric-pair {
    color: var(--text-2);
    font-size: 12px !important;
  }
  .metric-trend {
    width: 25px;
    min-width: 25px;
    height: 23px;
    padding: 3px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 1px solid currentColor;
    border-radius: 4px;
    font-family: var(--font-head);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
  }
  .metric-trend .ui-icon { width: 13px; height: 13px; }
  .metric-trend.better { color: var(--accent-g); background: rgba(0,230,118,.09); }
  .metric-trend.worse { color: #ff5252; background: rgba(255,82,82,.09); }
  .metric-trend.equal { color: var(--accent-b); background: rgba(0,180,255,.09); }

  .daily-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
  }
  .daily-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 12px; }
  .daily-toolbar label { color: var(--text-2); font: 600 13px var(--font-head); }
  .daily-toolbar select { min-width: 140px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-1); font: 600 13px var(--font-head); }
  .daily-process-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
  }
  .daily-process-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent-g);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-1);
  }
  .daily-process-head {
    min-height: 58px;
    padding: 13px 14px 10px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
  }
  .daily-process-head strong {
    min-width: 0;
    font-family: var(--font-head);
    font-size: 18px;
    line-height: 1.1;
    overflow-wrap: anywhere;
  }
  .daily-process-head span {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 20px;
    background: rgba(0,180,255,.1);
    color: var(--accent-b);
    font-size: 11px;
    font-weight: 700;
  }
  .daily-process-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .daily-process-metrics span {
    min-width: 0;
    padding: 10px 12px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .daily-process-metrics span:nth-child(3n) { border-right: 0; }
  .daily-process-metrics small {
    display: block;
    min-height: 23px;
    color: var(--text-3);
    font-size: 9px;
    line-height: 1.25;
    text-transform: uppercase;
  }
  .daily-process-metrics b {
    display: block;
    margin-top: 4px;
    font-family: var(--font-head);
    font-size: 15px;
    color: var(--text-1);
  }
  .daily-ops {
    padding: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
  }
  .daily-ops span {
    max-width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-2);
    font-size: 11px;
    line-height: 1.2;
    overflow-wrap: anywhere;
    background: rgba(0,180,255,.05);
  }

  .chart-note {
    margin: -4px 16px 14px;
    color: var(--text-3);
    font-size: 12px;
    line-height: 1.4;
  }
  .chart-note strong { color: var(--text-1); }
  .comparison-status:empty { display: none; }

  .chart-empty {
    min-height: 320px;
    padding: 24px;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
  }
  .chart-empty:not([hidden]) { display: flex; }

  html[data-theme="light"] .card,
  html[data-theme="light"] .kpi-card,
  html[data-theme="light"] .kpi-card-vg,
  html[data-theme="light"] .filter-dropdown-menu {
    box-shadow: 0 8px 24px rgba(30,65,95,0.07);
  }

  @media (max-width: 760px) {
    .topnav { padding-right: 4px; }
    .topnav .logo-area { display: none; }
    .nav-tabs { padding: 0 2px; gap: 0; min-width: 0; }
    .nav-tab { padding: 7px 5px; font-size: 12px; }
    .nav-right { gap: 4px; }
    .filter-btn span:last-child { display: none; }
    .filter-btn { width: 36px; height: 36px; justify-content: center; padding: 0; }
    .refresh-btn span:last-child { display: none; }
    .refresh-btn { width: 36px; height: 36px; justify-content: center; padding: 0; }
    .main { padding: 14px; }
    .date-range-popover { position: fixed; left: 12px; right: 12px; top: calc(var(--nav-h) + 12px); width: auto; max-height: calc(100vh - var(--nav-h) - 24px); overflow-y: auto; }
    .date-range-fields { grid-template-columns: 1fr 1fr; }
    .date-range-day { height: 38px; }
    .date-range-trigger strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .landing-info-btn { margin: 10px 0 0; }
    .g-2, .g-3, .g-1-2, .g-2-1, .g-3-2 { grid-template-columns: 1fr; }
    .daily-summary-grid, .daily-process-grid { grid-template-columns: 1fr; }
    .kpi-row, .icon-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .landing { padding: 34px 20px; }
    .landing-content { max-width: 100%; }
    .landing-image-area {
      position: relative;
      inset: auto;
      width: 100%;
      margin-top: 28px;
    }
    .landing-image-area { padding: 0; }
    .landing-tablet { width: 100%; border-radius: 18px; padding: 10px; }
    .tablet-screen { border-radius: 10px; padding: 12px; }
    .tablet-status, .tablet-table, .tablet-gauge { display: none; }
    .tablet-panels { grid-template-columns: 1fr; }
    .tablet-kpis > div { padding: 7px; }
    .tablet-kpis strong { font-size: 13px; }
    .auth-card { padding: 28px 24px 22px; }
    .auth-logo { height: 76px; }
    .chart-wrap, .chart-wrap.tall { height: 250px; }
    .season-card-grid { grid-template-columns: 1fr; }
    .season-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .season-metrics > span { grid-column: auto; }
    .season-metrics > span:nth-child(3n) { border-right: 1px solid var(--border); }
    .season-metrics > span:nth-child(2n) { border-right: 0; }
  }

  /* Compact navigation and report section picker */
  @media (max-width: 1360px) {
    :root { --nav-h: 104px; }
    .topnav {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      grid-template-rows: 54px 50px;
      padding: 0 12px;
    }
    .topnav .logo-area {
      display: flex;
      grid-column: 1;
      grid-row: 1;
      width: auto;
      min-width: 0;
      height: 54px;
      padding: 0;
      border: 0;
    }
    .brand-wordmark { width: clamp(116px, 17vw, 172px); height: 34px; object-position: left center; }
    .nav-right { grid-column: 2; grid-row: 1; gap: 6px; min-width: 0; }
    .nav-tabs {
      grid-column: 1 / -1;
      grid-row: 2;
      display: flex;
      width: 100%;
      min-width: 0;
      height: 50px;
      padding: 0 0 4px;
      gap: 4px;
      overflow-x: auto;
      overflow-y: hidden;
      overscroll-behavior-inline: contain;
      scrollbar-width: none;
      scroll-snap-type: x proximity;
    }
    .nav-tabs::-webkit-scrollbar { display: none; }
    .nav-tab { flex: 0 0 auto; padding: 8px 14px; font-size: 13px; scroll-snap-align: start; }
  }

  @media (max-width: 900px) {
    .layout { display: block; }
    #mainContent { margin-left: 0 !important; width: 100%; min-width: 0; }
    #sidebar {
      position: sticky;
      top: var(--nav-h);
      bottom: auto;
      width: 100%;
      min-height: 0;
      padding: 5px 10px;
      overflow: hidden;
      border-right: 0;
      border-bottom: 1px solid var(--border);
      z-index: 80;
    }
    #sidebarContent {
      display: flex;
      align-items: center;
      gap: 6px;
      width: 100%;
      overflow-x: auto;
      overscroll-behavior-inline: contain;
      scrollbar-width: thin;
    }
    #sidebar .sidebar-item {
      flex: 0 0 auto;
      min-height: 40px;
      padding: 8px 12px;
      border-left: 0;
      border-radius: var(--radius-sm);
      white-space: nowrap;
    }
    #sidebar .sidebar-item.active { margin-right: 0; }
    #sidebar .sidebar-bottom { display: none; }
  }

  @media (max-width: 520px) {
    .topnav { padding: 0 8px; }
    .brand-wordmark { width: 106px; }
    .nav-right { gap: 4px; }
    .nav-right .icon-btn,
    .nav-right .refresh-btn,
    .nav-right .filter-btn,
    .nav-right .profile-btn { width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0; justify-content: center; }
    .nav-right .profile-btn #profileNameTop { display: none; }
    .nav-right .profile-avatar { width: 25px; height: 25px; }
    .main { padding: 12px; }
    .filter-bar { padding: 12px 12px max(18px, env(safe-area-inset-bottom)); max-height: calc(100dvh - var(--nav-h)); }
    .filter-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .filter-dropdown { min-width: 0; }
    .filter-dd-btn { flex: 1; min-width: 0; justify-content: space-between; overflow: hidden; }
    .filter-dd-btn > span:first-child { overflow: hidden; text-overflow: ellipsis; }
    .filter-dropdown:has(.filter-dropdown-menu.open) { grid-column: 1 / -1; flex-wrap: wrap; }
    .filter-dropdown-menu.open { position: static; flex: 0 0 100%; width: 100%; min-width: 0; max-width: 100%; max-height: min(260px, 42dvh); margin-top: 6px; }
    .filter-action-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-action-row .filter-submit { grid-column: 1 / -1; min-height: 44px; }
    .filter-action-row .filter-clear-btn,
    .filter-action-row .filter-close-bar { min-height: 40px; justify-content: center; }
    .kpi-row, .icon-kpi-grid { gap: 8px; }
    .kpi-card, .kpi-card-vg { padding: 12px 10px; }
    .kpi-val, .kpi-val-vg { font-size: clamp(18px, 5.5vw, 26px); overflow-wrap: anywhere; }
    .admin-hub { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .admin-hub-card { padding: 12px; min-width: 0; }
    .admin-hub-card strong { font-size: 16px; overflow-wrap: anywhere; }
    .admin-hub-card span { font-size: 11px; }
    .modal-backdrop { padding: 8px; }
    .modal-card { width: 100%; max-height: calc(100dvh - 16px); }
    .modal-head { padding: 12px; }
    .modal-head strong { font-size: 18px; }
    .modal-actions { flex-wrap: wrap; }
    .profile-panel { right: 8px; width: calc(100vw - 16px); max-height: calc(100dvh - var(--nav-h) - 18px); overflow-y: auto; padding: 14px; }
  }
  @media (max-width: 390px) {
    .filter-row { grid-template-columns: minmax(0, 1fr); }
  }
  @media (max-width: 620px), (max-height: 680px) {
    .auth-screen {
      align-items: flex-start;
      overflow-y: auto;
      overscroll-behavior: contain;
      padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    }
    .auth-card { width: min(100%, 460px); flex-shrink: 0; margin: auto 0; }
    .auth-footer { flex-wrap: wrap; }
  }
