:root {
  --bg: #000000;
  --bg-elevated: #1c1c1e;
  --bg-grouped: #000000;
  --card: #1c1c1e;
  --card-2: #2c2c2e;
  --fill: #3a3a3c;
  --line: rgba(84, 84, 88, 0.65);
  --separator: rgba(84, 84, 88, 0.45);
  --text: #ffffff;
  --muted: #8e8e93;
  --label-2: #ebebf5;
  --accent: #30d158;
  --blue: #0a84ff;
  --warn: #ffd60a;
  --danger: #ff453a;
  --ok: #30d158;
  --input: #2c2c2e;
  --radius: 12px;
  --radius-lg: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", system-ui, sans-serif;
  font-family: var(--font);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
body { padding-bottom: calc(188px + var(--safe-bottom)); }
button, input, select { font: inherit; }

.auth-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at top, #1c1c1e 0%, #000 70%);
}
.auth-card {
  width: min(400px, 100%);
  background: var(--card);
  border-radius: 20px;
  padding: 28px 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.auth-card h1 {
  margin: 0 0 8px;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.auth-card p { margin: 0 0 20px; color: var(--muted); font-size: 0.95rem; line-height: 1.4; }
.auth-card label {
  display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; font-weight: 600;
}
.auth-card input {
  width: 100%;
  border: 0;
  background: var(--input);
  color: var(--text);
  border-radius: 12px;
  padding: 15px 14px;
  font-size: 1.08rem;
  margin-bottom: 14px;
}
.auth-card button {
  appearance: none; border: 0; border-radius: 12px;
  background: var(--blue); color: #fff;
  font-weight: 600; padding: 15px 16px; width: 100%;
  font-size: 1.02rem; cursor: pointer;
}
.auth-error { color: var(--danger); min-height: 1.2em; font-size: 0.85rem; margin-top: 10px; }

.app { display: none; min-height: 100vh; background: var(--bg-grouped); }
.app.is-on { display: block; }

.top {
  position: sticky; top: 0; z-index: 20;
  padding: calc(8px + var(--safe-top)) 16px 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
}
.top-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.top h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.top .sub { color: var(--muted); font-size: 0.8rem; margin-top: 4px; font-weight: 400; }
.top-pills { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.pill-user, .pill-sync {
  flex: 0 0 auto;
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 7px 11px;
  font-weight: 600;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill-user {
  background: rgba(10, 132, 255, 0.22);
  color: var(--blue);
}
.pill-sync {
  background: rgba(48, 209, 88, 0.14);
  color: var(--accent);
}
.pill-sync.is-saving { color: var(--warn); background: rgba(255,214,10,.12); }
.pill-sync.is-error { color: var(--danger); background: rgba(255,69,58,.12); }
.dock-secondary { opacity: 0.85; }

.back-nav {
  display: flex;
  margin-top: 12px;
}
.back-link {
  text-decoration: none;
  color: var(--blue);
  background: rgba(10,132,255,.12);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
}
.back-link:active { opacity: 0.85; }
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin: 10px 0 12px;
  padding: 3px;
  background: var(--fill);
  border-radius: 10px;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: background .15s ease, color .15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.15;
}
.tab .tab-name { font-size: 0.72rem; font-weight: 700; }
.tab .tab-pct { font-size: 0.7rem; font-weight: 600; opacity: 0.95; }
.tab .tab-kwh {
  font-size: 0.62rem;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}
.tab .tab-delta {
  font-size: 0.62rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.tab .tab-delta.is-up { color: #ff453a; }
.tab .tab-delta.is-down { color: #ffd60a; }
.tab .tab-delta.is-ok { color: #30d158; }
.tab.is-on {
  background: var(--card-2);
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
  color: #fff;
}
.tab.is-on .tab-kwh { color: #fff; opacity: 1; }

.stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 14px 16px 0;
}
.stat {
  background: var(--card);
  border: 0;
  border-radius: var(--radius-lg);
  padding: 12px 14px;
}
.stat .lbl {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.stat .val {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat.wide { grid-column: 1 / -1; }
.stat.warn .val { color: var(--warn); }
.stat.danger .val { color: var(--danger); }
.stat.ok .val { color: var(--ok); }

.orient-box {
  margin: 12px 16px 0;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--card-2);
  border: 1px solid var(--line);
  color: #fff;
}
.orient-box.is-bad {
  background: #3a1515;
  border-color: #ff453a;
}
.orient-box.is-warn {
  background: #3a3210;
  border-color: #ffd60a;
}
.orient-box.is-ok {
  background: #12301c;
  border-color: #30d158;
}
.orient-k {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 4px;
}
.orient-v {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #fff;
}
.orient-v strong {
  color: #fff;
  font-weight: 800;
}
.orient-usinas {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.18);
  display: grid;
  gap: 6px;
}
.orient-usina-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.orient-usina-row.is-active { font-weight: 800; }
.orient-usina-row .ou-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.orient-usina-row .ou-pct,
.orient-usina-row .ou-soma {
  font-weight: 600;
  opacity: 0.95;
}
.ticker {
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.ticker.is-up { color: #ff453a; }
.ticker.is-down { color: #ffd60a; }
.ticker.is-ok { color: #30d158; }

.media-box, .cap-box, .exfishes, .resumo-box {
  margin: 12px 16px 0;
  background: var(--card);
  border: 0;
  border-radius: var(--radius-lg);
  padding: 14px;
}
.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.media-item {
  background: var(--card-2);
  border-radius: 12px;
  padding: 12px;
}
.media-item .k {
  color: var(--muted); font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.02em;
}
.media-item .v {
  font-size: 1.12rem; font-weight: 700; margin-top: 4px;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.media-item .h { color: var(--muted); font-size: 0.72rem; margin-top: 5px; line-height: 1.3; }
.media-item.recom .v { color: var(--accent); }
.media-item.cons .v { color: var(--blue); }
.media-calc {
  margin-top: 10px; font-size: 0.82rem; line-height: 1.4; color: var(--label-2);
  background: var(--card-2); border-radius: 12px; padding: 10px 12px;
}
.media-calc .bad { color: var(--danger); font-weight: 600; }
.media-calc .warn { color: var(--warn); font-weight: 600; }
.media-calc .ok { color: var(--ok); font-weight: 600; }
.bar.twin { margin-top: 10px; }
.bar-legend {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  margin-top: 8px; color: var(--muted); font-size: 0.7rem;
}
.bar-legend strong { color: var(--text); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

.cap-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px; margin-bottom: 10px;
}
.cap-title { font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; }
.cap-hint { color: var(--muted); font-size: 0.78rem; margin-top: 3px; line-height: 1.35; }
.cap-status {
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--fill);
  color: var(--muted);
  white-space: nowrap;
}
.cap-status.is-updating {
  background: rgba(255,214,10,.14);
  color: var(--warn);
}
.cap-status.is-updated {
  background: rgba(48,209,88,.14);
  color: var(--ok);
}
.cap-box {
  overflow: hidden;
}
.cap-preview {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--card-2);
  border-radius: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.cap-now {
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--blue);
  min-width: 0;
  word-break: break-word;
}
.cap-arrow {
  color: var(--muted);
  font-weight: 700;
  flex: 0 0 auto;
}
.cap-media {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--warn);
  min-width: 0;
  word-break: break-word;
}
.cap-media-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #102012;
  background: var(--warn);
  border-radius: 999px;
  padding: 3px 8px;
  flex: 0 0 auto;
}
.cap-preview.is-same .cap-arrow,
.cap-preview.is-same .cap-media-tag { opacity: 0.55; }
.cap-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.cap-row input {
  width: 100%;
  border: 0;
  background: var(--input);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 12px;
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.cap-row .btn-use-media {
  width: 100%;
  border: 0;
  background: rgba(255,214,10,.16);
  color: var(--warn);
  border-radius: 12px;
  padding: 13px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: normal;
  line-height: 1.25;
  text-align: center;
}
.cap-row .btn-use-media:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.bar {
  margin-top: 12px; height: 6px; border-radius: 999px; background: var(--fill); overflow: hidden;
}
.bar > span, .bar #mediaBarFill {
  display: block; height: 100%; background: var(--accent); width: 0%;
  transition: width .25s ease;
  border-radius: 999px;
}
.bar.over > span, .bar.over #mediaBarFill { background: var(--danger); }

.exfishes h2, .resumo-head h2 {
  margin: 0 0 10px; font-size: 1rem; font-weight: 700; letter-spacing: -0.02em;
}
.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ex-grid .item {
  background: var(--card-2); border-radius: 12px; padding: 10px 12px;
}
.ex-grid .item .k { color: var(--muted); font-size: 0.7rem; font-weight: 600; }
.ex-grid .item .v { font-weight: 700; font-size: 0.98rem; margin-top: 3px; font-variant-numeric: tabular-nums; }
.ex-note { margin-top: 10px; color: var(--muted); font-size: 0.76rem; line-height: 1.35; }

.resumo-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.resumo-head h2 { margin: 0; }
.linkish {
  border: 0; background: transparent; color: var(--blue);
  font-weight: 600; font-size: 0.9rem; cursor: pointer; padding: 4px 0;
}
.resumo-meta { color: var(--muted); font-size: 0.8rem; margin: 10px 0; line-height: 1.4; }
.resumo-list {
  margin: 0; padding-left: 18px; max-height: 220px; overflow: auto;
  font-size: 0.84rem; line-height: 1.4;
}
.resumo-list li { margin-bottom: 10px; color: var(--text); }
.resumo-list .who { color: var(--blue); font-weight: 600; }
.resumo-list .when { color: var(--muted); font-size: 0.74rem; }

.toolbar {
  position: sticky; top: 148px; z-index: 15;
  display: flex; gap: 8px; padding: 10px 16px 8px;
  background: rgba(0,0,0,.72);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}
.toolbar input, .toolbar select {
  border: 0; background: var(--fill); color: var(--text);
  border-radius: 12px; padding: 12px 12px; font-size: 0.95rem;
}
.toolbar input { flex: 1; }
.toolbar select { max-width: 40%; font-weight: 600; }

.list {
  padding: 4px 16px 24px;
  display: flex; flex-direction: column; gap: 12px;
}

.card {
  background: var(--card);
  border: 0;
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset;
}
.card.is-exfishes { outline: 1px solid rgba(48,209,88,.35); }
.card.is-alterado { box-shadow: inset 3px 0 0 var(--warn); }
.card.is-out { opacity: 0.55; }
.card.is-out .name { text-decoration: line-through; color: var(--muted); }
.card.is-open { outline: 1px solid rgba(10,132,255,.45); }
.card-head {
  display: flex; justify-content: space-between; gap: 10px; align-items: flex-start;
  cursor: pointer;
}
.name {
  font-weight: 650; font-size: 1rem; line-height: 1.25; letter-spacing: -0.01em;
}
.meta { color: var(--muted); font-size: 0.74rem; margin-top: 4px; line-height: 1.35; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.badge {
  font-size: 0.68rem; font-weight: 650; border-radius: 999px; padding: 4px 8px;
  background: rgba(10,132,255,.16); color: var(--blue);
}
.badge.warn { background: rgba(255,214,10,.14); color: var(--warn); }
.badge.danger { background: rgba(255,69,58,.16); color: var(--danger); }

.fields {
  display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 8px; margin-top: 12px;
}
.fields label, .move-panel .move-label {
  display: block; font-size: 0.72rem; color: var(--muted); margin-bottom: 6px; font-weight: 600;
}
.fields input {
  width: 100%; border: 0; background: var(--input); color: var(--text);
  border-radius: 12px; padding: 12px 12px; font-size: 1.05rem;
  font-variant-numeric: tabular-nums; font-weight: 600;
}
.pct-line {
  margin-top: 10px; display: flex; justify-content: space-between; gap: 8px;
  font-size: 0.8rem; color: var(--muted);
}
.pct-line strong { color: var(--text); font-variant-numeric: tabular-nums; }

.sugestao {
  margin-top: 12px;
  background: var(--card-2);
  border: 0;
  border-radius: 12px;
  padding: 12px;
}
.sugestao .s-title {
  font-size: 0.7rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.03em; font-weight: 700;
}
.sugestao .s-body { margin-top: 5px; font-size: 0.88rem; line-height: 1.4; color: var(--label-2); }
.sugestao .s-body strong { color: var(--warn); }
.sugestao.ok .s-body strong { color: var(--ok); }

.locked-note {
  margin-top: 12px;
  background: var(--card-2);
  color: var(--muted);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.84rem;
  line-height: 1.35;
  font-weight: 500;
}

/* Move — iOS style */
.move-panel {
  margin-top: 12px;
  background: var(--card-2);
  border-radius: 14px;
  padding: 12px;
}
.move-panel .move-label { margin-bottom: 8px; }
.move-dest {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.move-chip {
  border: 0;
  background: var(--fill);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 6px;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: background .15s ease, color .15s ease, transform .12s ease;
}
.move-chip.is-current {
  opacity: 0.38;
  pointer-events: none;
}
.move-chip.is-on {
  background: rgba(10,132,255,.22);
  color: #7ab8ff;
  box-shadow: inset 0 0 0 1px rgba(10,132,255,.45);
}
.move-chip:active:not(.is-current) { transform: scale(0.97); }
.btn-move {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 14px 12px;
  font-size: 0.98rem;
  font-weight: 650;
  cursor: pointer;
  background: var(--blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: -0.01em;
  box-shadow: 0 6px 16px rgba(10,132,255,.28);
}
.btn-move .arrow {
  font-size: 1.05rem;
  font-weight: 700;
  opacity: 0.95;
}
.btn-move:disabled {
  opacity: 0.35;
  box-shadow: none;
  cursor: not-allowed;
}
.btn-move:active:not(:disabled) { transform: scale(0.985); }

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.actions button {
  border: 0;
  background: var(--fill);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 10px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}
.actions button.danger { color: var(--danger); background: rgba(255,69,58,.12); }
.actions button.ok { color: var(--ok); background: rgba(48,209,88,.12); }
.actions button.accent {
  color: #003d14;
  background: var(--accent);
  grid-column: 1 / -1;
}
.actions button.ghost-accent { color: var(--blue); background: rgba(10,132,255,.12); }
.actions button:disabled { opacity: 0.35; }

.detail-mini {
  margin-top: 12px; font-size: 0.8rem; color: var(--muted); line-height: 1.4;
  border-top: 0.5px solid var(--separator); padding-top: 10px;
}
.detail-mini strong { color: var(--text); }
.detail-mini li { margin-bottom: 5px; }

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 10px 16px calc(10px + var(--safe-bottom));
  background: rgba(28,28,30,.86);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--separator);
  display: flex; flex-direction: column; gap: 8px;
}
.dock-stats {
  display: grid; grid-template-columns: 1fr 0.7fr 1.3fr; gap: 6px;
}
.dock-stats > div {
  background: rgba(58,58,60,.55); border: 0; border-radius: 12px;
  padding: 8px 9px; min-width: 0;
}
.dock-stats .k {
  display: block; color: var(--muted); font-size: 0.64rem;
  text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600;
}
.dock-stats strong {
  display: block; margin-top: 2px; font-size: 0.9rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.dock-stats.flash strong { color: var(--blue); }
.dock-stats.is-over strong { color: var(--danger); }
.dock-stats.is-under strong { color: var(--warn); }
.dock-stats.is-ok strong { color: var(--ok); }
.dock-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dock-actions-one { grid-template-columns: 1fr; }
.dock-actions-pdf { grid-template-columns: 1fr 1fr; }

.pdf-box {
  margin: 10px 0 14px;
  padding: 14px 14px 12px;
  border-radius: 16px;
  background: linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.pdf-box h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: #f8fafc;
}
.pdf-hint {
  margin-top: 4px;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.35;
}
.pdf-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}
@media (min-width: 420px) {
  .pdf-actions { grid-template-columns: 1fr 1fr 1fr; }
}
.btn-pdf-view,
.btn-pdf-one,
.btn-pdf-all {
  border: 0;
  border-radius: 12px;
  padding: 12px 10px;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}
.btn-pdf-view { background: #334155; color: #f8fafc; }
.btn-pdf-one { background: #2563eb; color: #fff; }
.btn-pdf-all { background: #0d9488; color: #fff; }
.btn-pdf-view:active,
.btn-pdf-one:active,
.btn-pdf-all:active { opacity: 0.88; }

.report-sheet { max-height: min(88vh, 760px); }
.report-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0 10px;
}
.report-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.report-kpi {
  background: var(--fill);
  border-radius: 12px;
  padding: 10px;
}
.report-kpi .k { font-size: 0.72rem; color: var(--muted); }
.report-kpi .v { font-size: 0.98rem; font-weight: 750; color: var(--text); margin-top: 2px; font-variant-numeric: tabular-nums; }
.report-usina-block { margin-bottom: 16px; }
.report-usina-block h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--text);
}
.report-saidas {
  margin-top: 28px;
  padding-top: 8px;
  border-top: 1px dashed rgba(248, 113, 113, 0.35);
}
.report-saidas-banner {
  background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 55%, #dc2626 100%);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 12px;
  color: #fff;
}
.report-saidas-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
  font-weight: 700;
  margin-bottom: 4px;
}
.report-saidas-banner h3 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  color: #fff;
  font-weight: 800;
}
.report-saidas-sub {
  margin-top: 6px;
  font-size: 0.86rem;
  opacity: 0.95;
}
.report-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}
.report-table th,
.report-table td {
  text-align: left;
  padding: 6px 6px;
  border-bottom: 1px solid rgba(148,163,184,.25);
  white-space: nowrap;
}
.report-table th { color: var(--muted); font-weight: 650; }
.report-table th.num,
.report-table td.num { text-align: center; font-variant-numeric: tabular-nums; }
.report-table tr.is-alt td { color: #38bdf8; }

/* Colunas métricas com cores distintas */
.report-table th.col-kwh,
.report-table td.col-kwh {
  background: rgba(37, 99, 235, 0.18);
  color: #93c5fd;
  font-weight: 700;
}
.report-table th.col-pct,
.report-table td.col-pct {
  background: rgba(124, 58, 237, 0.18);
  color: #c4b5fd;
  font-weight: 700;
}
.report-table th.col-m3,
.report-table td.col-m3 {
  background: rgba(13, 148, 136, 0.18);
  color: #5eead4;
  font-weight: 700;
}
.report-table th.col-m6,
.report-table td.col-m6 {
  background: rgba(217, 119, 6, 0.18);
  color: #fdba74;
  font-weight: 700;
}
.report-table th.col-maior,
.report-table td.col-maior {
  background: rgba(225, 29, 72, 0.14);
  color: #fda4af;
  font-weight: 650;
}
.report-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.4;
}
.dock button, .confirm-actions button, .sheet-close {
  border: 0; border-radius: 12px; padding: 13px 10px; font-weight: 650; cursor: pointer; font-size: 0.88rem;
}
.dock .primary { background: var(--blue); color: #fff; }
.dock .ghost, .confirm-actions .ghost {
  background: var(--fill); color: var(--text);
}
.confirm-actions .danger {
  background: var(--danger); color: #fff;
}

.confirm-overlay, .sheet-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,.45);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 12px; padding-bottom: calc(12px + var(--safe-bottom));
}
.confirm-overlay[hidden], .sheet-overlay[hidden] { display: none !important; }
.confirm-card, .sheet {
  width: min(440px, 100%);
  background: var(--card);
  border: 0;
  border-radius: 18px;
  padding: 10px 18px 18px;
  max-height: min(80vh, 640px);
  overflow: auto;
  box-shadow: 0 -8px 40px rgba(0,0,0,.4);
}
.sheet-grab {
  width: 36px; height: 5px; border-radius: 999px; background: #636366;
  margin: 4px auto 14px;
}
.confirm-card h2, .sheet h2 {
  margin: 8px 0 8px; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; text-align: center;
}
.confirm-card p {
  margin: 0 0 18px; color: var(--muted); font-size: 0.95rem; line-height: 1.4; text-align: center;
}
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet-body { color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.sheet-body .row { margin-bottom: 12px; }
.sheet-body strong { color: var(--text); }
.sheet-close {
  width: 100%; margin-top: 14px; background: var(--fill); color: var(--blue); font-weight: 650;
}
.retire-sheet .retire-lead {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
  text-align: center;
}
.retire-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}
.retire-dest {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.retire-chip {
  border: 0;
  background: var(--fill);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 6px;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}
.retire-chip.is-current {
  opacity: 0.35;
  pointer-events: none;
}
.retire-chip.is-on {
  background: rgba(10,132,255,.22);
  color: #7ab8ff;
  box-shadow: inset 0 0 0 1px rgba(10,132,255,.45);
}
.btn-retire-move {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 14px 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--blue);
  color: #fff;
  margin-bottom: 8px;
}
.btn-retire-move:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.btn-retire-only {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 13px 12px;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  background: rgba(255,69,58,.14);
  color: var(--danger);
}

.toast {
  position: fixed; left: 50%; bottom: calc(108px + var(--safe-bottom));
  transform: translateX(-50%);
  background: rgba(44,44,46,.94); color: var(--text);
  border: 0; border-radius: 14px; padding: 11px 16px; font-size: 0.86rem; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; max-width: 90vw;
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}
.toast.show { opacity: 1; }

@media (min-width: 720px) {
  .app-inner { max-width: 560px; margin: 0 auto; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stat.wide { grid-column: span 2; }
}

.btn-sisgd-all {
  flex: 1 1 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: #0d9488;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}
.btn-sisgd-all:active { opacity: 0.9; }
.sisgd-detail .sisgd-mini { margin: 8px 0 10px; padding-left: 18px; }
.sisgd-acao-pill {
  display: inline-block;
  margin: 4px 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.sisgd-acao--aumentar { background: #dbeafe; color: #1d4ed8; }
.sisgd-acao--reduzir { background: #fee2e2; color: #b91c1c; }
.sisgd-acao--manter { background: #dcfce7; color: #15803d; }
.sisgd-acao--sem-fatura,
.sisgd-acao--verificar,
.sisgd-acao--outro { background: #f1f5f9; color: #475569; }
.btn-sisgd-apply {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
  background: #0f766e;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}
.btn-sisgd-apply.is-done,
.btn-sisgd-apply:disabled {
  background: #94a3b8;
}

.bq-progress {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(118px + var(--safe-bottom));
  z-index: 55;
  pointer-events: none;
}
.bq-progress[hidden] {
  display: none !important;
}
.bq-progress__card {
  background: rgba(28, 28, 30, 0.96);
  border: 1px solid rgba(10, 132, 255, 0.35);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
}
.bq-progress__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.bq-progress__head strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.bq-progress__sub {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--muted);
}
.bq-progress__spinner {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 2px solid rgba(10, 132, 255, 0.25);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: bq-spin 0.75s linear infinite;
  flex-shrink: 0;
}
@keyframes bq-spin {
  to { transform: rotate(360deg); }
}
.bq-progress__bar {
  height: 8px;
  background: rgba(58, 58, 60, 0.9);
  border-radius: 999px;
  overflow: hidden;
}
.bq-progress__fill {
  height: 100%;
  width: 32%;
  background: linear-gradient(90deg, #0a84ff, #64d2ff);
  border-radius: 999px;
}
.bq-progress__bar.is-indeterminate .bq-progress__fill {
  width: 34%;
  animation: bq-indeterminate 1.15s ease-in-out infinite;
}
@keyframes bq-indeterminate {
  0% { transform: translateX(-130%); }
  100% { transform: translateX(320%); }
}
.bq-progress__bar.is-done .bq-progress__fill {
  width: 100% !important;
  animation: none;
  background: var(--ok);
}
.bq-progress.is-done .bq-progress__spinner {
  animation: none;
  border-color: rgba(48, 209, 88, 0.35);
  border-top-color: var(--ok);
  background: var(--ok);
}
.bq-progress__meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}
.bq-progress.is-error .bq-progress__card {
  border-color: rgba(255, 69, 58, 0.45);
}
.bq-progress.is-error .bq-progress__spinner {
  animation: none;
  border-color: rgba(255, 69, 58, 0.35);
  border-top-color: var(--danger);
}

.report-table th.col-saldo,
.report-table td.col-saldo {
  background: rgba(190, 24, 93, 0.18);
  color: #f9a8d4;
  font-weight: 700;
}
