@charset "utf-8";

/* =============================================
   Monitor Atividade WP — App Dashboard
   Layout em SPA com tabs, drawer e bottom nav.
   ============================================= */

.ma-app,
.ma-login-shell,
.ma-login-shell *,
.ma-app *,
.ma-footer {
  box-sizing: border-box;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Hide host theme chrome behind the dashboard. */
html:has(.ma-app),
body:has(.ma-app),
html:has(.ma-login-shell),
body:has(.ma-login-shell),
html.ma-login-fullscreen,
body.ma-login-fullscreen,
body.ma-fullscreen,
html.ma-fullscreen {
  height: 100%;
  margin: 0;
  overflow: hidden;
  padding: 0;
}

body.ma-fullscreen > *:not(.ma-app):not(.monitoratividade-geo-popup):not(script):not(style):not(noscript) {
  display: none !important;
}

.ma-login-shell {
  align-items: center;
  background:
    radial-gradient(80% 80% at 12% 0%, rgba(108, 163, 230, 0.22) 0%, rgba(108, 163, 230, 0) 52%),
    radial-gradient(70% 70% at 90% 10%, rgba(243, 217, 44, 0.12) 0%, rgba(243, 217, 44, 0) 48%),
    linear-gradient(180deg, #08152d 0%, #07142b 100%);
  color: #e8edf4;
  display: flex;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  height: 100vh;
  height: 100dvh;
  inset: 0;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  position: fixed;
  width: 100vw;
  z-index: 1000000;
}

.ma-login-panel {
  background: rgba(13, 34, 64, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  max-width: 420px;
  padding: 28px;
  width: min(100%, 420px);
}

.ma-login-brand {
  align-items: center;
  display: flex;
  gap: 14px;
  margin-bottom: 22px;
}

.ma-login-logo {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: flex;
  flex: 0 0 76px;
  height: 52px;
  justify-content: center;
  padding: 8px;
  width: 76px;
}

.ma-login-logo img {
  display: block;
  height: auto;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.ma-login-brand h1 {
  color: #fff;
  font-size: 20px;
  line-height: 1.2;
  margin: 0 0 4px;
}

.ma-login-brand p {
  color: #8da8cc;
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.ma-login-alert {
  background: rgba(255, 139, 148, 0.13);
  border: 1px solid rgba(255, 139, 148, 0.28);
  border-radius: 8px;
  color: #ffd8dc;
  font-size: 13px;
  margin-bottom: 16px;
  padding: 10px 12px;
}

.ma-login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ma-login-form label {
  color: #8da8cc;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ma-login-form input[type="text"],
.ma-login-form input[type="password"] {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  min-height: 44px;
  outline: none;
  padding: 10px 12px;
  width: 100%;
}

.ma-login-form input[type="text"]:focus,
.ma-login-form input[type="password"]:focus {
  border-color: rgba(243, 217, 44, 0.72);
  box-shadow: 0 0 0 3px rgba(243, 217, 44, 0.14);
}

.ma-login-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 2px 0 8px;
}

.ma-login-check {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  letter-spacing: 0;
  text-transform: none;
}

.ma-login-check span {
  color: #8da8cc;
  font-size: 13px;
  font-weight: 500;
}

.ma-login-form button {
  background: #f3d92c;
  border: 0;
  border-radius: 8px;
  color: #07142b;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  min-height: 46px;
  padding: 11px 16px;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.ma-login-form button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.ma-app {
  --ma-bg-0: #08152d;
  --ma-bg-1: #0d2240;
  --ma-bg-2: #102a52;
  --ma-surface: rgba(255, 255, 255, 0.04);
  --ma-surface-2: rgba(255, 255, 255, 0.07);
  --ma-border: rgba(255, 255, 255, 0.08);
  --ma-border-strong: rgba(255, 255, 255, 0.16);
  --ma-text: #e8edf4;
  --ma-text-dim: #8da8cc;
  --ma-text-muted: #5e84b0;
  --ma-text-deep: #3e6090;
  --ma-accent: #f3d92c;
  --ma-accent-deep: #e6c918;
  --ma-blue: #6ca3e6;
  --ma-green: #6bd27c;
  --ma-purple: #c792ea;
  --ma-orange: #ff9f43;
  --ma-red: #ff8b94;
  --ma-radius: 12px;
  --ma-radius-sm: 8px;
  --ma-shell-pad: 28px;

  background: radial-gradient(120% 80% at 0% 0%, #122e58 0%, #0a1e3d 35%, #07142b 100%);
  color: var(--ma-text);
  inset: 0;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 0 96px;
  position: fixed;
  z-index: 99999;
}

.ma-app.ma-no-scroll {
  overflow: hidden;
}

.ma-app a { color: inherit; }

/* ---------- App bar ---------- */
.ma-appbar {
  align-items: center;
  background: rgba(8, 18, 38, 0.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ma-border);
  display: flex;
  gap: 16px;
  padding: 14px var(--ma-shell-pad);
  position: sticky;
  top: 0;
  z-index: 30;
}

.ma-appbar__brand {
  align-items: center;
  display: flex;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.ma-logo {
  background-image: url(https://www.radiofmodia.com.br/wp-content/themes/fmodia-jr/images/logo_FM_O_DIA_P&B_Branco.png);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  color: transparent;
  display: block;
  flex-shrink: 0;
  height: 42px;
  width: 50px;
}

.ma-appbar__titles {
  min-width: 0;
}

.ma-appbar__titles h1 {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ma-appbar__sub {
  color: var(--ma-text-dim);
  font-size: 12px;
  margin: 2px 0 0;
}

.ma-appbar__actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.ma-appbar__time {
  color: var(--ma-text-muted);
  font-size: 12px;
}

/* ---------- Buttons ---------- */
.ma-btn {
  align-items: center;
  background: transparent;
  border: 1px solid var(--ma-border-strong);
  border-radius: 999px;
  color: var(--ma-text);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
}

.ma-btn:hover { background: var(--ma-surface-2); border-color: rgba(255,255,255,0.28); }
.ma-btn:active { transform: translateY(1px); }

.ma-btn--ghost { background: var(--ma-surface); }

.ma-btn--primary {
  background: linear-gradient(180deg, #f7e34a 0%, #e6c918 100%);
  border-color: var(--ma-accent);
  color: #0e3c72;
}

.ma-btn--primary:hover {
  border-color: var(--ma-accent);
  box-shadow: 0 6px 18px rgba(243, 217, 44, 0.28);
}

/* ---------- Tabs (top) ---------- */
.ma-tabs {
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--ma-border);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px var(--ma-shell-pad);
  position: sticky;
  scrollbar-width: none;
  top: 70px;
  z-index: 20;
}

.ma-tabs::-webkit-scrollbar { display: none; }

.ma-tab {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--ma-text-dim);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  gap: 8px;
  letter-spacing: 0.01em;
  padding: 10px 16px;
  position: relative;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.ma-tab:hover { color: var(--ma-text); background: var(--ma-surface); }

.ma-tab.is-active {
  color: var(--ma-accent);
}

.ma-tab.is-active::after {
  background: var(--ma-accent);
  border-radius: 2px 2px 0 0;
  bottom: -8px;
  content: '';
  height: 3px;
  left: 12px;
  position: absolute;
  right: 12px;
}

.ma-tab svg { flex-shrink: 0; opacity: 0.85; }

/* ---------- Filter chips ---------- */
.ma-chips {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px var(--ma-shell-pad) 0;
}

.ma-chip {
  align-items: center;
  background: var(--ma-surface);
  border: 1px solid var(--ma-border);
  border-radius: 999px;
  color: var(--ma-text-dim);
  display: inline-flex;
  font-size: 12px;
  gap: 6px;
  padding: 6px 12px;
}

/* ---------- Alerts ---------- */
.ma-alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px var(--ma-shell-pad) 0;
}

.ma-alert {
  border: 1px solid transparent;
  border-radius: var(--ma-radius-sm);
  font-size: 13px;
  padding: 10px 14px;
}

.ma-alert--warning {
  background: rgba(255, 217, 100, 0.08);
  border-color: rgba(255, 217, 100, 0.22);
  color: #ffe082;
}

.ma-alert--error {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.22);
  color: var(--ma-red);
}

/* ---------- Content / panes ---------- */
.ma-content {
  padding: 18px var(--ma-shell-pad) 32px;
}

.ma-pane {
  display: none;
  animation: ma-fade-in 0.18s ease;
}

.ma-pane.is-active {
  display: block;
}

@keyframes ma-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Grids ---------- */
.ma-grid {
  display: grid;
  gap: 14px;
}

.ma-grid--metrics {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 18px;
}

.ma-grid--charts {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-bottom: 18px;
}

/* ---------- Metrics ---------- */
.ma-metric {
  background: var(--ma-surface);
  border: 1px solid var(--ma-border);
  border-radius: var(--ma-radius);
  overflow: hidden;
  padding: 16px 18px;
  position: relative;
  transition: background 0.15s, transform 0.15s;
}

.ma-metric:hover { background: var(--ma-surface-2); transform: translateY(-1px); }

.ma-metric::before {
  background: var(--ma-accent);
  border-radius: 3px 0 0 3px;
  content: '';
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 3px;
}

.ma-metric--blue::before { background: var(--ma-blue); }
.ma-metric--yellow::before { background: var(--ma-accent); }
.ma-metric--green::before { background: var(--ma-green); }
.ma-metric--purple::before { background: var(--ma-purple); }
.ma-metric--orange::before { background: var(--ma-orange); }

.ma-metric__label {
  color: var(--ma-text-dim);
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.ma-metric__value {
  color: #fff;
  display: block;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 4px;
  word-break: break-word;
}

.ma-metric__note {
  color: var(--ma-text-muted);
  display: block;
  font-size: 12px;
}

/* ---------- Cards ---------- */
.ma-card {
  background: var(--ma-surface);
  border: 1px solid var(--ma-border);
  border-radius: var(--ma-radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ma-card + .ma-card { margin-top: 14px; }

.ma-card__head {
  align-items: baseline;
  border-bottom: 1px solid var(--ma-border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 14px 18px;
}

.ma-card__head h2 {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.ma-card__sub {
  color: var(--ma-text-muted);
  font-size: 12px;
}

.ma-card__body { padding: 16px 18px; }

.ma-geo-charts {
  align-items: stretch;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-bottom: 18px;
}

.ma-geo-card {
  min-width: 0;
}

.ma-geo-charts .ma-card + .ma-card {
  margin-top: 0;
}

.ma-geo-summary {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(96px, 128px) minmax(0, 1fr);
  padding: 18px;
}

.ma-geo-summary__stamp {
  border-left: 3px solid var(--ma-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding-left: 16px;
}

.ma-geo-summary__stamp span {
  color: var(--ma-text-muted);
  font-size: 12px;
  line-height: 1.35;
  max-width: 120px;
}

.ma-geo-summary__chart {
  min-width: 0;
}

.ma-geo-summary .ma-donut {
  justify-content: flex-start;
  padding: 0;
}

.ma-geo-summary .ma-donut__svg {
  height: 150px;
  width: 150px;
}

.ma-empty {
  color: var(--ma-text-muted);
  font-size: 13px;
  margin: 0;
  padding: 24px;
  text-align: center;
}

/* ---------- Bar chart ---------- */
.ma-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
}

.ma-bars--geo-city {
  flex: 1 1 auto;
  justify-content: center;
  min-height: 150px;
}

.ma-bar { display: flex; flex-direction: column; gap: 6px; }

.ma-bar__head {
  align-items: baseline;
  display: flex;
  font-size: 13px;
  gap: 12px;
  justify-content: space-between;
}

.ma-bar__name {
  color: var(--ma-text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ma-bar__val {
  color: var(--ma-accent);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.ma-bar__track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
}

.ma-bar__fill {
  background: linear-gradient(90deg, #f3d92c 0%, #ffb547 100%);
  border-radius: 6px;
  height: 100%;
  transition: width 0.4s ease;
}

.ma-bar__fill--alt {
  background: linear-gradient(90deg, #6ca3e6 0%, #c792ea 100%);
}

.ma-bar__fill--green {
  background: linear-gradient(90deg, #6bd27c 0%, #4caf50 100%);
}

.ma-bar__fill--geo {
  background: linear-gradient(90deg, #6ca3e6 0%, #6bd27c 100%);
}

/* ---------- Geo map ---------- */
.ma-geo-map-card {
  margin-bottom: 18px;
}

.ma-geo-map {
  min-height: 420px;
  position: relative;
}

.ma-geo-map__canvas {
  height: 420px;
  width: 100%;
}

.ma-geo-map__fallback {
  align-items: center;
  color: var(--ma-text-muted);
  display: flex;
  inset: 0;
  justify-content: center;
  margin: 0;
  padding: 18px;
  pointer-events: none;
  position: absolute;
}

.ma-geo-map.is-ready .ma-geo-map__fallback {
  display: none;
}

.ma-geo-map .leaflet-container {
  background: #0b1a33;
  color: #172033;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.ma-geo-map .leaflet-control-attribution {
  font-size: 10px;
}

.ma-geo-pin {
  align-items: center;
  background: rgba(243, 217, 44, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  color: #07142a;
  display: flex;
  font-size: 12px;
  font-weight: 800;
  height: var(--ma-pin-size, 34px);
  justify-content: center;
  line-height: 1;
  width: var(--ma-pin-size, 34px);
}

.ma-geo-popup {
  font-size: 12px;
  line-height: 1.35;
}

.ma-geo-popup strong {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}

/* ---------- Donut ---------- */
.ma-donut {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  padding: 18px;
}

.ma-donut__svg {
  flex-shrink: 0;
  height: 168px;
  width: 168px;
}

.ma-donut__total {
  fill: #fff;
  font-size: 22px;
  font-weight: 700;
}

.ma-donut__hint {
  fill: var(--ma-text-muted);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ma-donut__legend {
  display: flex;
  flex: 1 1 160px;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.ma-donut__legend li {
  align-items: center;
  display: flex;
  font-size: 12px;
  gap: 8px;
}

.ma-donut__swatch {
  border-radius: 3px;
  flex-shrink: 0;
  height: 12px;
  width: 12px;
}

.ma-donut__name { color: var(--ma-text-dim); flex: 1 1 auto; }

.ma-donut__value {
  color: #fff;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ---------- Sparkline ---------- */
.ma-spark {
  height: 80px;
  margin: 0 18px 18px;
}

.ma-spark__svg { display: block; height: 100%; width: 100%; }

/* ---------- Line history charts ---------- */
.ma-history-section {
  margin-bottom: 18px;
}

.ma-section-head {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ma-section-head h2 {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.ma-section-head span {
  color: var(--ma-text-muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.ma-history-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.ma-history-tile {
  background: var(--ma-surface);
  border: 1px solid var(--ma-border);
  border-radius: var(--ma-radius);
  min-width: 0;
  padding: 14px;
}

.ma-history-tile__head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.ma-history-tile__title {
  min-width: 0;
}

.ma-history-tile__title strong {
  color: #fff;
  display: block;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ma-history-tile__title span {
  color: var(--ma-text-muted);
  display: block;
  font-family: Consolas, Monaco, monospace;
  font-size: 11px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ma-history-tile__stats {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
}

.ma-history-tile__stats span {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.ma-history-tile__stats small {
  color: var(--ma-text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ma-history-tile__stats strong {
  color: #fff;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.ma-history-tile__stats span:nth-child(2) strong {
  color: var(--ma-accent);
}

.ma-history-chart {
  height: 150px;
  margin-top: 12px;
  position: relative;
}

.ma-history-canvas {
  display: block;
  height: 100% !important;
  width: 100% !important;
}

.ma-history-key {
  color: var(--ma-text-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 10px;
  gap: 10px;
  line-height: 1;
  margin-top: 8px;
}

.ma-history-key span {
  align-items: center;
  display: inline-flex;
  gap: 4px;
  white-space: nowrap;
}

.ma-history-key i {
  border-radius: 999px;
  display: inline-block;
  height: 5px;
  width: 12px;
}

.ma-history-key .today i { background: #6ec6ff; }
.ma-history-key .yesterday i { background: #ffd166; }
.ma-history-key .last-week i { background: #c792ea; }

.ma-history-tile__meta {
  color: var(--ma-text-muted);
  font-size: 11px;
  margin-top: 8px;
}

/* ---------- Ranking list (cards) ---------- */
.ma-list {
  display: flex;
  flex-direction: column;
}

.ma-row {
  align-items: center;
  border-top: 1px solid var(--ma-border);
  display: grid;
  gap: 14px;
  grid-template-columns: 56px 1fr auto;
  padding: 14px 18px;
  transition: background 0.12s;
}

.ma-row:first-child { border-top: 0; }
.ma-row:hover { background: var(--ma-surface); }

.ma-row.is-selected {
  background: rgba(243, 217, 44, 0.06);
  box-shadow: inset 3px 0 0 var(--ma-accent);
}

.ma-row__pos {
  color: var(--ma-text-muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.ma-row__main { min-width: 0; }

.ma-row__title {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.ma-row__title strong {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
}

.ma-row__id {
  color: var(--ma-text-muted);
  font-family: Consolas, Monaco, monospace;
  font-size: 11px;
}

.ma-row__stats {
  color: var(--ma-text-dim);
  font-size: 12px;
  margin-top: 4px;
}

.ma-row__meta {
  color: var(--ma-text-muted);
  font-size: 11px;
  margin-top: 2px;
}

.ma-row__metrics {
  align-items: center;
  display: flex;
  gap: 16px;
}

.ma-row__metric {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.ma-row__metric-label {
  color: var(--ma-text-muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ma-row__metric strong {
  color: #fff;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.ma-row__metric:nth-child(2) strong { color: var(--ma-accent); }

.ma-arrow {
  align-items: center;
  display: inline-flex;
  font-size: 14px;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.ma-arrow--up { color: var(--ma-green); }
.ma-arrow--down { color: var(--ma-red); }
.ma-arrow--same { color: var(--ma-accent); }
.ma-arrow--new { color: var(--ma-blue); }

/* ---------- Tables ---------- */
.ma-table-wrap {
  overflow-x: auto;
}

.ma-table {
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ma-text);
  font-size: 13px;
  width: 100%;
}

.ma-table thead th {
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 2px solid rgba(243, 217, 44, 0.28);
  color: var(--ma-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.ma-table tbody td {
  border-top: 1px solid var(--ma-border);
  padding: 10px 14px;
  vertical-align: middle;
}

.ma-table tbody tr:hover td { background: var(--ma-surface); }

.ma-table__num { text-align: right; white-space: nowrap; }

.ma-table__empty {
  color: var(--ma-text-muted);
  padding: 24px !important;
  text-align: center;
}

/* Pills (badges) for permission state */
.ma-pill {
  background: var(--ma-surface);
  border: 1px solid var(--ma-border);
  border-radius: 999px;
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  white-space: nowrap;
}

.ma-pill--granted { background: rgba(107, 210, 124, 0.14); border-color: rgba(107, 210, 124, 0.4); color: var(--ma-green); }
.ma-pill--denied  { background: rgba(255, 139, 148, 0.14); border-color: rgba(255, 139, 148, 0.4); color: var(--ma-red); }
.ma-pill--ip_auto { background: rgba(108, 163, 230, 0.14); border-color: rgba(108, 163, 230, 0.4); color: var(--ma-blue); }
.ma-pill--prompt  { background: rgba(243, 217, 44, 0.14); border-color: rgba(243, 217, 44, 0.4); color: var(--ma-accent); }

/* ---------- Págination ---------- */
.ma-pagination {
  align-items: center;
  border-top: 1px solid var(--ma-border);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  padding: 14px 18px;
}

.ma-pagination__btn {
  background: var(--ma-surface);
  border: 1px solid var(--ma-border);
  border-radius: 6px;
  color: var(--ma-text-dim);
  cursor: pointer;
  display: inline-block;
  font-size: 13px;
  min-width: 36px;
  padding: 7px 12px;
  text-align: center;
  text-decoration: none;
  transition: all 0.15s;
}

.ma-pagination a.ma-pagination__btn:hover {
  background: var(--ma-surface-2);
  border-color: var(--ma-border-strong);
  color: #fff;
}

.ma-pagination__btn.is-current {
  background: linear-gradient(180deg, #f7e34a 0%, #e6c918 100%);
  border-color: var(--ma-accent);
  color: #0e3c72;
  font-weight: 700;
}

.ma-pagination__btn.is-disabled {
  color: var(--ma-text-deep);
  cursor: default;
  opacity: 0.45;
}

.ma-pagination__ellipsis {
  color: var(--ma-text-muted);
  padding: 0 4px;
}

/* ---------- Filter Drawer ---------- */
.ma-drawer {
  inset: 0;
  pointer-events: none;
  position: fixed;
  visibility: hidden;
  z-index: 100000;
}

.ma-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.ma-drawer__backdrop {
  background: rgba(4, 11, 25, 0.55);
  inset: 0;
  opacity: 0;
  position: absolute;
  transition: opacity 0.2s;
}

.ma-drawer.is-open .ma-drawer__backdrop { opacity: 1; }

.ma-drawer__panel {
  background: linear-gradient(180deg, #0d2240 0%, #08152d 100%);
  border-left: 1px solid var(--ma-border);
  bottom: 0;
  display: flex;
  flex-direction: column;
  max-width: 92vw;
  position: absolute;
  right: 0;
  top: 0;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  width: 420px;
}

.ma-drawer.is-open .ma-drawer__panel { transform: translateX(0); }

.ma-drawer__head {
  align-items: center;
  border-bottom: 1px solid var(--ma-border);
  display: flex;
  justify-content: space-between;
  padding: 16px 20px;
}

.ma-drawer__head h2 {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.ma-drawer__close {
  background: transparent;
  border: 0;
  color: var(--ma-text-dim);
  cursor: pointer;
  font-size: 26px;
  height: 32px;
  line-height: 1;
  width: 32px;
}

.ma-drawer__close:hover { color: #fff; }

.ma-drawer__form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 18px 20px;
}

.ma-field { display: flex; flex-direction: column; gap: 6px; }

.ma-field label {
  color: var(--ma-text-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ma-field input,
.ma-field select {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(67, 114, 172, 0.4);
  border-radius: 8px;
  color: #1a3a66;
  font-size: 13px;
  height: 38px;
  padding: 0 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.ma-field input:focus,
.ma-field select:focus {
  border-color: var(--ma-accent);
  box-shadow: 0 0 0 3px rgba(243, 217, 44, 0.22);
  outline: none;
}

.ma-field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #4372ac 50%), linear-gradient(135deg, #4372ac 50%, transparent 50%);
  background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  cursor: pointer;
  padding-right: 32px;
}

.ma-drawer__row {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.ma-drawer__actions {
  border-top: 1px solid var(--ma-border);
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding: 14px 20px;
}

.ma-drawer__actions .ma-btn { flex: 1 1 auto; justify-content: center; }

/* ---------- Bottom nav (mobile) ---------- */
.ma-bottom-nav {
  background: rgba(8, 18, 38, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--ma-border);
  bottom: 0;
  display: none;
  left: 0;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  position: fixed;
  right: 0;
  z-index: 99999;
}

.ma-bottom-nav__list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.ma-bottom-nav__btn {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--ma-text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font-size: 10px;
  font-weight: 600;
  gap: 3px;
  letter-spacing: 0.04em;
  padding: 6px 4px;
  text-transform: uppercase;
  transition: color 0.15s;
  width: 100%;
}

.ma-bottom-nav__btn svg {
  height: 22px;
  opacity: 0.78;
  width: 22px;
}

.ma-bottom-nav__btn.is-active {
  color: var(--ma-accent);
}

.ma-bottom-nav__btn.is-active svg { opacity: 1; }

/* ---------- Footer ---------- */
.ma-footer {
  color: var(--ma-text-deep);
  font-size: 11px;
  padding: 18px var(--ma-shell-pad) 24px;
  text-align: right;
}

/* ---------- Utility ---------- */
.ma-mono {
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
}

.ma-truncate {
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 1024px) {
  .ma-app { --ma-shell-pad: 20px; }
  .ma-tabs { top: 66px; }
}

@media (max-width: 720px) {
  .ma-app { --ma-shell-pad: 14px; padding-bottom: 88px; }

  .ma-appbar { gap: 10px; padding: 10px 14px; position: sticky; top: 0; }
  .ma-appbar__time { display: none; }
  .ma-appbar__titles h1 { font-size: 16px; }
  .ma-appbar__sub { display: none; }
  .ma-logo { height: 36px; width: 42px; }

  .ma-tabs { display: none; }

  .ma-content { padding: 14px var(--ma-shell-pad); }

  .ma-grid--metrics { gap: 10px; }
  .ma-metric { padding: 12px 14px; }
  .ma-metric__value { font-size: 20px; }
  .ma-history-grid { grid-template-columns: 1fr; }
  .ma-history-tile { padding: 12px; }
  .ma-history-tile__head {
    flex-direction: column;
  }
  .ma-history-tile__stats {
    justify-content: space-between;
    width: 100%;
  }
  .ma-history-chart { height: 132px; }
  .ma-geo-charts {
    grid-template-columns: 1fr;
  }
  .ma-geo-summary {
    grid-template-columns: 1fr;
    padding: 14px;
  }
  .ma-geo-summary__stamp {
    min-height: 0;
  }
  .ma-geo-summary .ma-donut {
    justify-content: center;
  }

  /* Tables become card-style stacks */
  .ma-table-wrap { overflow-x: visible; }
  .ma-table thead { display: none; }
  .ma-table,
  .ma-table tbody,
  .ma-table tr,
  .ma-table td { display: block; width: 100%; }
  .ma-table tr {
    background: var(--ma-surface);
    border: 1px solid var(--ma-border);
    border-radius: var(--ma-radius-sm);
    margin: 10px 14px;
    padding: 8px 0;
  }
  .ma-table tr:hover td { background: transparent; }
  .ma-table tbody td {
    align-items: baseline;
    border: 0;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 6px 14px;
  }
  .ma-table tbody td::before {
    color: var(--ma-text-muted);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .ma-table__num { text-align: right; }
  .ma-table__empty { padding: 18px !important; text-align: center; }
  .ma-table__empty::before { display: none; }

  /* Ranking rows: stack metrics under title */
  .ma-row {
    align-items: flex-start;
    grid-template-columns: 36px 1fr;
    grid-template-areas:
      'pos main'
      '.   metrics';
    padding: 12px 14px;
    row-gap: 8px;
  }
  .ma-row__pos { grid-area: pos; padding-top: 2px; text-align: left; }
  .ma-row__main { grid-area: main; }
  .ma-row__metrics {
    grid-area: metrics;
    gap: 14px;
    justify-content: flex-start;
  }
  .ma-row__metric { text-align: left; }

  .ma-bottom-nav { display: block; }

  .ma-drawer__panel { max-width: 100vw; width: 100vw; border-left: 0; }

  .ma-footer { padding-bottom: 16px; }
}

@media (max-width: 480px) {
  .ma-appbar__brand { gap: 8px; }
  .ma-appbar__titles h1 { font-size: 15px; }
  .ma-bars { gap: 10px; padding: 12px 14px; }
  .ma-card__head { padding: 12px 14px; }
  .ma-donut { gap: 12px; padding: 14px; }
  .ma-donut__svg { height: 140px; width: 140px; }
}
