
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=JetBrains+Mono:wght@300;400;500;600&display=swap');
  
:root {
  --bg:      #080b10;
  --bg2:     #0d1117;
  --bg3:     #131920;
  --bg4:     #1a2230;
  --bg5:     #202c3a;
  --border:  #1e2d3d;
  --border2: #263546;
  --text:    #e2eaf4;
  --text2:   #7a99b8;
  --text3:   #3d5570;
  --accent:  #00c8ff;
  --accent2: #0099cc;
  --accent-dim: rgba(0,200,255,0.10);
  --accent-glow: 0 0 24px rgba(0,200,255,0.18);
  --gold:    #f0a500;
  --green:   #00e5a0;
  --red:     #ff4d6a;
  --yellow:  #f0b429;
  --purple:  #a78bfa;
  --orange:  #fb923c;
  --radius:  14px;
  --radius-sm: 9px;
  --shadow:  0 4px 32px rgba(0,0,0,0.5);
  --font:    'Syne', sans-serif;
  --mono:    'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Starfield background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,200,255,0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(167,139,250,0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── LAYOUT ── */
.app-shell {
  display: grid;
  grid-template-rows: 58px 1fr;
  grid-template-columns: 230px 1fr;
  grid-template-areas: "sidebar topbar" "sidebar content";
  min-height: 100vh;
  position: relative;
  z-index: 1;
}
.brand-name,
.auth-card h1 {
  background: linear-gradient(120deg,
    #FFC93C 0%,
    #FF9B42 22%,
    #FF3D8B 48%,
    #A22DBF 72%,
    #5B21A8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
/* ── SIDEBAR ── */
.sidebar {
  grid-area: sidebar;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(0,200,255,0.05) 0%, transparent 100%);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(0,200,255,0.3);
}

.brand-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.brand-sub {
  font-size: 9.5px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 2px;
  font-family: var(--mono);
}

.sidebar-section-label {
  padding: 14px 18px 6px;
  font-size: 9px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-family: var(--mono);
}

.sidebar-nav {
  flex: 1;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text2);
  font-weight: 600;
  font-size: 13px;
  position: relative;
  user-select: none;
}

.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(0,200,255,0.15);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  box-shadow: 2px 0 8px rgba(0,200,255,0.4);
}

.nav-icon { font-size: 15px; width: 20px; text-align: center; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #001a2e;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  font-family: var(--mono);
  min-width: 18px;
  text-align: center;
}

.nav-badge.red { background: var(--red); color: white; }
.nav-badge.yellow { background: var(--yellow); color: #1a1000; }

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text3);
  text-align: center;
  font-family: var(--mono);
}

/* ── TOPBAR ── */
.topbar {
  grid-area: topbar;
  background: rgba(13,17,23,0.95);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.3px;
}

.topbar-spacer { flex: 1; }

.topbar-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  color: var(--text3);
  font-family: var(--mono);
}

.topbar-pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse-dot 2s infinite;
}
@keyframes shine-badge {
  0%, 100% { 
    box-shadow: 0 4px 16px rgba(242,146,29,0.4), inset 0 1px 0 rgba(255,255,255,0.4);
  }
  50% { 
    box-shadow: 0 4px 24px rgba(242,146,29,0.7), inset 0 1px 0 rgba(255,255,255,0.6);
  }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

/* ── CONTENT ── */
.content {
  grid-area: content;
  padding: 24px;
  overflow-y: auto;
  max-height: calc(100vh - 58px);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.2s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── CARDS ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,200,255,0.2), transparent);
  pointer-events: none;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--mono);
}

.card-title-lg {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}

/* ── KPI GRID ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  cursor: default;
}

.kpi-card:hover { transform: translateY(-2px); border-color: var(--border2); }

.kpi-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--kpi-color, var(--accent));
  opacity: 0.5;
}

.kpi-label {
  font-size: 10px;
  color: var(--text3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  font-family: var(--mono);
}

.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--mono);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.kpi-value.positive { color: var(--green); }
.kpi-value.negative { color: var(--red); }
.kpi-value.warning  { color: var(--yellow); }
.kpi-value.accent   { color: var(--accent); }
.kpi-value.gold     { color: var(--gold); }

.kpi-icon {
  position: absolute;
  right: 14px; top: 12px;
  font-size: 20px;
  opacity: 0.15;
}

.kpi-delta {
  font-size: 10px;
  color: var(--text3);
  font-family: var(--mono);
  margin-top: 4px;
}

/* ── GRID LAYOUTS ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }

/* ── FORM ── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full { grid-column: 1 / -1; }
.form-group.span2 { grid-column: span 2; }

label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-family: var(--mono);
  display: flex;
  align-items: center;
  gap: 5px;
}

.label-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: 50%;
  font-size: 9px;
  color: var(--text3);
  cursor: help;
  position: relative;
  font-family: var(--mono);
  font-weight: 600;
}

.label-hint:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-family: var(--font);
  color: var(--text);
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  box-shadow: var(--shadow);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

input, select, textarea {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,200,255,0.1);
}

input[type="number"] { font-family: var(--mono); }
input[type="month"]  { font-family: var(--mono); }
select option { background: var(--bg3); }
textarea { resize: vertical; min-height: 70px; }

input.field-ok { border-color: var(--green) !important; }
input.field-warn { border-color: var(--yellow) !important; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s;
  white-space: nowrap;
  user-select: none;
  letter-spacing: 0.2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #001a2e;
  box-shadow: 0 2px 12px rgba(0,200,255,0.2);
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,200,255,0.35); }

.btn-secondary {
  background: var(--bg4);
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn-secondary:hover { background: var(--bg3); border-color: var(--accent); color: var(--accent); }

.btn-danger {
  background: rgba(255,77,106,0.10);
  color: var(--red);
  border: 1px solid rgba(255,77,106,0.25);
}
.btn-danger:hover { background: rgba(255,77,106,0.2); }

.btn-success {
  background: rgba(0,229,160,0.10);
  color: var(--green);
  border: 1px solid rgba(0,229,160,0.25);
}
.btn-success:hover { background: rgba(0,229,160,0.2); }

.btn-ghost {
  background: transparent;
  color: var(--text2);
  padding: 7px 12px;
}
.btn-ghost:hover { color: var(--text); background: var(--bg3); }

.btn-gold {
  background: rgba(240,165,0,0.12);
  color: var(--gold);
  border: 1px solid rgba(240,165,0,0.25);
}
.btn-gold:hover { background: rgba(240,165,0,0.22); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 9px; font-size: 11px; }

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 9px 12px;
  color: var(--text3);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg3); }

tbody td {
  padding: 10px 12px;
  color: var(--text);
}

tbody td.mono { font-family: var(--mono); font-size: 12.5px; }
tbody td.muted { color: var(--text2); font-size: 12px; }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--mono);
  white-space: nowrap;
}

.badge-cyan    { background: rgba(0,200,255,0.12); color: var(--accent); border: 1px solid rgba(0,200,255,0.2); }
.badge-green   { background: rgba(0,229,160,0.12); color: var(--green); border: 1px solid rgba(0,229,160,0.2); }
.badge-yellow  { background: rgba(240,180,41,0.12); color: var(--yellow); border: 1px solid rgba(240,180,41,0.2); }
.badge-red     { background: rgba(255,77,106,0.12); color: var(--red); border: 1px solid rgba(255,77,106,0.2); }
.badge-purple  { background: rgba(167,139,250,0.12); color: var(--purple); border: 1px solid rgba(167,139,250,0.2); }
.badge-orange  { background: rgba(251,146,60,0.12); color: var(--orange); border: 1px solid rgba(251,146,60,0.2); }
.badge-gold    { background: rgba(240,165,0,0.12); color: var(--gold); border: 1px solid rgba(240,165,0,0.2); }

/* ── PROGRESS BAR ── */
.progress-bar {
  background: var(--bg4);
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(0,200,255,0.3);
}

.progress-fill.green  { background: linear-gradient(90deg, var(--green), #00b87a); }
.progress-fill.yellow { background: linear-gradient(90deg, var(--yellow), #c88a00); }
.progress-fill.red    { background: linear-gradient(90deg, var(--red), #cc2040); }

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ── SECTION TITLE ── */
.section-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.3px;
}

/* ── SUMMARY TABLES ── */
.summary-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }

.summary-table { border-collapse: collapse; width: 100%; }
.summary-table td { padding: 7px 10px; font-size: 13px; }
.summary-table tr { border-bottom: 1px solid var(--border); }
.summary-table tr:last-child { border-bottom: none; }
.summary-table .s-label { color: var(--text2); }
.summary-table .s-value { text-align: right; font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.summary-table .s-total td { color: var(--accent); font-weight: 700; font-size: 14px; }

/* ── MARGIN DISPLAY ── */
.margin-display {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  background: var(--bg3);
  margin-top: 14px;
  flex-wrap: wrap;
}

.margin-item { display: flex; flex-direction: column; gap: 2px; min-width: 70px; }
.margin-item span:first-child { font-size: 9px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text3); font-weight: 700; font-family: var(--mono); }
.margin-item span:last-child { font-family: var(--mono); font-size: 15px; font-weight: 700; }

.margin-sep { width: 1px; height: 30px; background: var(--border); flex-shrink: 0; }

/* ── SEARCH ── */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.search-bar input { flex: 1; }

/* ── HEALTH INDICATOR ── */
.health-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg3);
  margin-bottom: 10px;
}

.health-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse-dot 2s infinite;
}

.health-text { font-size: 12.5px; color: var(--text2); }

/* ── COPY BOX ── */
.copy-box {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  white-space: pre-wrap;
  max-height: 280px;
  overflow-y: auto;
  line-height: 1.7;
}

/* ── OVERLAY / MOBILE ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 99;
  backdrop-filter: blur(3px);
}

/* ── TOAST ── */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 999;
  max-width: 320px;
  font-weight: 600;
}

#toast.show { transform: translateY(0); opacity: 1; }
#toast.success { border-color: var(--green); color: var(--green); }
#toast.error   { border-color: var(--red); color: var(--red); }
#toast.info    { border-color: var(--accent); color: var(--accent); }
#toast.warn    { border-color: var(--yellow); color: var(--yellow); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text3);
}

.empty-state .icon { font-size: 40px; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 13px; font-family: var(--mono); }

/* ── STATUS SELECT ── */
.status-select {
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  cursor: pointer;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text);
  width: auto;
}

/* ── MINI CHART ── */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 80px;
  padding: 4px 0;
}

.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: var(--accent);
  opacity: 0.7;
  transition: opacity 0.2s;
  min-height: 3px;
  position: relative;
  cursor: default;
}

.chart-bar:hover { opacity: 1; }

.chart-bar-label {
  font-size: 9px;
  color: var(--text3);
  font-family: var(--mono);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* ── IMPRESSORAS ── */
.impressora-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  position: relative;
}

.impressora-card.fdm { border-left: 3px solid var(--purple); }
.impressora-card.resina { border-left: 3px solid var(--accent); }

/* ── KANBAN ── */
.kanban-wrap {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.kanban-col {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  min-width: 160px;
  transition: border-color .18s, background-color .18s, box-shadow .18s;
}
.kanban-col.is-drop-target {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.kanban-col-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-family: var(--mono);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.kanban-stage-icon { width: 23px; height: 23px; flex: none; overflow: visible; }
.kanban-stage-icon svg { width: 100%; height: 100%; display: block; }
.kanban-col-header:hover .stage-hourglass { animation: kanban-hourglass 2.5s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.kanban-col-header:hover .stage-sand { animation: kanban-sand 2.5s linear infinite; transform-origin: center; transform-box: fill-box; }
.kanban-col-header:hover .stage-nozzle { animation: kanban-printer 1.3s ease-in-out infinite alternate; }
.kanban-col-header:hover .stage-print-layer { animation: kanban-layer 1.3s ease-in-out infinite alternate; }
.kanban-col-header:hover .stage-sparkle { animation: kanban-sparkle 1.15s ease-in-out infinite alternate; transform-origin: center; transform-box: fill-box; }
.kanban-col-header:hover .stage-lid { animation: kanban-lid 1.3s ease-in-out infinite alternate; transform-origin: 3px 9px; }
.kanban-col-header:hover .stage-check { animation: kanban-check 1.4s ease-in-out infinite; }
@keyframes kanban-hourglass { 0%,32% {transform:rotate(0deg)} 48%,82% {transform:rotate(180deg)} 100% {transform:rotate(360deg)} }
@keyframes kanban-sand { 0%,30% {opacity:1;transform:scaleY(1)} 45%,80% {opacity:.35;transform:scaleY(.25)} 100% {opacity:1;transform:scaleY(1)} }
@keyframes kanban-printer { from {transform:translateX(-4px)} to {transform:translateX(4px)} }
@keyframes kanban-layer { from {opacity:.35} to {opacity:1} }
@keyframes kanban-sparkle { from {opacity:.35;transform:scale(.7)} to {opacity:1;transform:scale(1.18)} }
@keyframes kanban-lid { from {transform:rotate(0deg)} to {transform:rotate(-12deg)} }
@keyframes kanban-check { 0%,20% {stroke-dashoffset:17} 55%,100% {stroke-dashoffset:0} }
@media (prefers-reduced-motion: reduce) {
  .kanban-col-header:hover .kanban-stage-icon * { animation:none !important; }
}

.kanban-count {
  background: var(--bg4);
  color: var(--text3);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  font-family: var(--mono);
}

.kanban-item {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  font-size: 12px;
}

.kanban-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.kanban-item[draggable="true"] { cursor: grab; }
.kanban-item.is-dragging { opacity:.38; cursor:grabbing; }
.kanban-item:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.kanban-item:last-child { margin-bottom: 0; }

.kanban-cliente { font-weight: 700; color: var(--text); font-size: 12px; margin-bottom: 3px; }
.kanban-desc { color: var(--text2); font-size: 11px; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-footer { display: flex; align-items: center; justify-content: space-between; }
.kanban-valor { font-family: var(--mono); font-size: 11px; color: var(--accent); font-weight: 600; }
.kanban-data { font-family: var(--mono); font-size: 10px; color: var(--text3); }

/* ── TIPO SWITCH ── */
.tipo-switch {
  display: flex;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  margin-bottom: 16px;
  width: fit-content;
}

.tipo-btn {
  padding: 7px 18px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  font-family: var(--font);
  border: none;
  background: transparent;
  color: var(--text2);
  transition: all 0.2s;
}

.tipo-btn.active {
  background: var(--accent);
  color: #001a2e;
  box-shadow: 0 2px 10px rgba(0,200,255,0.25);
}

.tipo-btn.fdm-active {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 2px 10px rgba(167,139,250,0.3);
}

/* ── ALERT BANNER ── */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 14px;
}

.alert-banner.red    { background: rgba(255,77,106,0.08); border: 1px solid rgba(255,77,106,0.2); color: var(--red); }
.alert-banner.yellow { background: rgba(240,180,41,0.08); border: 1px solid rgba(240,180,41,0.2); color: var(--yellow); }
.alert-banner.green  { background: rgba(0,229,160,0.08); border: 1px solid rgba(0,229,160,0.2); color: var(--green); }

/* ── MISC ── */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.text-right { text-align: right; }
.text-muted  { color: var(--text2); }
.text-small  { font-size: 11.5px; }
.font-mono   { font-family: var(--mono); }
.row  { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }

/* ── BREAKDOWN LOSS CARD ── */
.breakeven-display {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.breakeven-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.breakeven-label {
  font-size: 10px;
  color: var(--text3);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}

.breakeven-value {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--yellow);
}

/* ── MODAL ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.open { display: flex; }

/* Assistente inicial do orçamento */
.quote-wizard { max-width:620px; width:min(92vw,620px); }
.quote-wizard-steps { display:flex; gap:8px; margin:0 0 22px; }
.quote-wizard-step { flex:1; border-top:3px solid var(--border2); padding-top:8px; color:var(--text3); font-size:11px; font-weight:700; }
.quote-wizard-step.active { border-color:var(--accent); color:var(--accent); }
.quote-wizard-step.done { border-color:var(--green); color:var(--text2); }
.quote-wizard-panel[hidden] { display:none; }
.quote-wizard .form-group[hidden] { display:none; }
.quote-wizard-panel h3 { font-size:17px; margin-bottom:5px; }
.quote-wizard-panel p { color:var(--text2); font-size:12px; margin-bottom:16px; }
.quote-type-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; }
.quote-type-option { cursor:pointer; text-align:left; padding:15px 12px; border-radius:12px; border:1px solid var(--border2); background:var(--bg3); color:var(--text); font:inherit; }
.quote-type-option strong { display:block; font-size:14px; }
.quote-type-option small { display:block; color:var(--text2); font-size:11px; line-height:1.4; margin-top:5px; }
.quote-type-option.selected { border-color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); background:var(--accent-dim); }
.quote-wizard-actions { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:24px; }
.quote-image-preview { display:flex; align-items:center; gap:12px; padding:9px; border:1px dashed var(--border2); border-radius:10px; min-height:64px; color:var(--text3); font-size:11px; }
.quote-image-preview img { width:64px; height:64px; object-fit:contain; border-radius:7px; background:#fff; }
.quote-image-preview[hidden], .quote-image-remove[hidden] { display:none; }
.quote-product-meta { border:1px solid var(--border); background:var(--bg3); padding:12px 14px; border-radius:10px; margin:0 0 14px; font-size:12px; color:var(--text2); }
.quote-product-meta strong { color:var(--text); }
.quote-item-thumb { width:38px; height:38px; object-fit:contain; vertical-align:middle; margin-right:8px; border-radius:5px; background:#fff; }
@media(max-width:560px) { .quote-type-grid { grid-template-columns:1fr; } .quote-wizard { max-height:88vh; } }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s;
}

.modal-close:hover { color: var(--text); }

/* ── LIGHT MODE ── */
body.light-mode {
  --bg:      #f0f4f8;
  --bg2:     #ffffff;
  --bg3:     #e8edf4;
  --bg4:     #dde4ef;
  --bg5:     #d0d9e8;
  --border:  #c8d3e0;
  --border2: #b8c7d8;
  --text:    #0f1923;
  --text2:   #3d5570;
  --text3:   #7a95b0;
  --accent-dim: rgba(0,150,200,0.10);
}
body.light-mode::before { display: none; }
body.light-mode .sidebar { background: #ffffff; }
body.light-mode .topbar { background: rgba(255,255,255,0.95); }
body.light-mode .card { background: #ffffff; }
body.light-mode input, body.light-mode select, body.light-mode textarea {
  background: #f0f4f8; border-color: var(--border2); color: var(--text);
}
body.light-mode .nav-item:hover { background: var(--bg3); }
body.light-mode .copy-box { background: var(--bg3); }
body.light-mode .kanban-col { background: var(--bg3); }
body.light-mode .kanban-item { background: #ffffff; }
body.light-mode .health-bar, body.light-mode .impressora-card, body.light-mode .breakeven-item { background: var(--bg3); }
body.light-mode #toast { background: #ffffff; }
@media print {
  @page {
    size: A4 portrait;
    margin: 18mm 15mm 18mm 15mm;
  }
  .app-shell { display: block; }
  .sidebar, .topbar, .no-print, .mobile-bottom-nav { display: none !important; }
  .content { max-height: none; padding: 0; overflow: visible; }
  .tab-panel { display: none !important; }
  #tab-orcamento { display: block !important; }
  .internal-cost-section { display: none !important; }
  .print-show { display: block !important; }
  body { background: white !important; color: black !important; }
  body::before { display: none; }
  * { color: black !important; background: white !important; border-color: #ddd !important; box-shadow: none !important; }
  .print-client-header { display: block !important; margin-bottom: 24px; }
  .btn-group, .form-grid, .no-print { display: none !important; }
  .card { border: 1px solid #ccc !important; page-break-inside: avoid; }
  .galaem-print-logo { display: flex !important; }
  #print-footer-msgs { display: block !important; }
  #pix-display-proposta { display: block !important; }
  /* ── Ocultar TUDO que expõe dados internos ── */
  #margem-badge { display: none !important; }
  #margem-alerta { display: none !important; }
  #margin-display { display: none !important; }
  .margin-display { display: none !important; }
  /* Campos técnicos que o cliente não precisa ver */
  #print-tech-fields { display: none !important; }
  /* Garantia extra: nenhum % de margem vaza */
  [data-margem] { display: none !important; }
}

.print-client-header { display: none; }
.print-show { display: none; }
.galaem-print-logo { display: none; }

/* ══════════════════════════════════════════
   MULTI-ITEM SYSTEM
══════════════════════════════════════════ */

/* Tabela de itens do orçamento */
.orcamento-itens-wrap {
  margin-top: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  overflow: hidden;
}

.orcamento-itens-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

.orcamento-itens-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-count-badge {
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 20px;
  font-family: var(--mono);
}

.orcamento-itens-table {
  width: 100%;
  border-collapse: collapse;
}

.orcamento-itens-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3);
  font-weight: 700;
  font-family: var(--mono);
  padding: 9px 12px;
  text-align: left;
  background: var(--bg4);
  border-bottom: 1px solid var(--border);
}

.orcamento-itens-table td {
  padding: 10px 12px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.orcamento-itens-table tr:last-child td { border-bottom: none; }
.orcamento-itens-table tr:hover td { background: var(--bg4); }

.item-categoria-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--mono);
}
.item-cat-normal { background: rgba(0,200,255,0.12); color: var(--accent); }
.item-cat-kit    { background: rgba(240,165,0,0.15); color: var(--gold); }
.item-cat-combo  { background: rgba(167,139,250,0.15); color: var(--purple); }

.orcamento-total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg3);
  border-top: 2px solid var(--accent);
  border-radius: 0 0 var(--radius) var(--radius);
}

.orcamento-total-bar .total-label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 600;
}

.orcamento-total-bar .total-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--mono);
}

.desconto-volume-tag {
  display: inline-block;
  font-size: 10px;
  color: var(--green);
  font-family: var(--mono);
  background: rgba(0,229,160,0.1);
  border: 1px solid rgba(0,229,160,0.2);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
}

/* Kit builder */
.kit-builder {
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(240,165,0,0.04);
  margin-top: 14px;
}

.kit-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.kit-item-row:last-child { border-bottom: none; }

/* Atacado table */
.atacado-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
}
.atacado-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3);
  padding: 8px 12px;
  background: var(--bg4);
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.atacado-table td {
  padding: 9px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.atacado-table tr.atacado-melhor td { color: var(--green); font-weight: 700; }

/* Empty state */
.itens-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text3);
  font-size: 13px;
}
.itens-empty-icon { font-size: 32px; margin-bottom: 8px; }

/* Print: multi-item table */
@media print {
  .orcamento-itens-wrap { border: 1px solid #ccc !important; }
  .orcamento-itens-table th { background: #f0f4f8 !important; color: #444 !important; }
  .orcamento-itens-table td { color: #111 !important; }
  .orcamento-total-bar { background: #e8f4ff !important; border-top: 2px solid #00c8ff !important; }
  .item-categoria-badge { display: none !important; }
  .btn-group-item-actions { display: none !important; }
  .internal-cost-section { display: none !important; }
}

/* ══════════════════════════════════════════
   RESPONSIVE — MOBILE FIRST (completo)
══════════════════════════════════════════ */

/* Tablet landscape */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Tablet portrait */
@media (max-width: 900px) {
  .kanban-wrap { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

/* Mobile landscape / large phone */
@media (max-width: 768px) {
  .app-shell {
    grid-template-rows: 54px 1fr;
    grid-template-columns: 1fr;
    grid-template-areas: "topbar" "content";
  }

  /* Sidebar como gaveta */
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    z-index: 100;
    width: 240px;
    height: 100vh;
    transition: left 0.25s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay.show { display: block; }
  .hamburger { display: flex !important; align-items:center; justify-content:center; }
  .hamburger { width:38px; height:38px; border-radius:8px; }

  /* Topbar compacta */
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar-title { font-size: 13px; }
  .topbar-pill { display: none; } /* esconde pill no mobile */

  /* Content */
  .content { 
    max-height: calc(100vh - 54px); 
    padding: 12px; 
    overflow-x: hidden;
  }

  /* Grids */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .summary-wrap { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .form-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .breakeven-display { grid-template-columns: 1fr 1fr; }

  /* Cards */
  .card { padding: 14px; border-radius: 12px; }

  /* Kanban — scroll horizontal */
  .kanban-wrap {
    grid-template-columns: repeat(5, 160px);
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .kanban-col { min-width: 160px; }

  /* Tabelas — cards em mobile */
  table, thead, tbody, tr, td, th { display: block; }
  thead { display: none; }
  tbody tr {
    background: var(--bg3);
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 10px;
    margin-bottom: 8px;
    position: relative;
  }
  tbody td {
    padding: 3px 4px;
    font-size: 12.5px;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  tbody td::before {
    content: attr(data-label);
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--mono);
    min-width: 65px;
    flex-shrink: 0;
  }
  /* Células que não precisam de label */
  tbody td.no-label::before { display: none; }
  tbody td.no-label { justify-content: flex-end; }
  /* Primeira célula é o título da linha */
  tbody td:first-child { 
    font-weight: 700; 
    font-size: 13px; 
    color: var(--text);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
  }
  tbody td:first-child::before { display: none; }

  /* Buttons */
  .btn-group { flex-wrap: wrap; gap: 6px; }
  .btn { font-size: 12px; padding: 8px 14px; }
  .btn-xs { padding: 5px 8px; font-size: 11px; }

  /* Section title */
  .section-title { font-size: 15px; }

  /* Margin display — scroll horizontal */
  .margin-display { 
    overflow-x: auto; 
    flex-wrap: nowrap;
    padding: 12px;
    gap: 10px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .margin-item span:last-child { font-size: 13px; }

  /* Search bar */
  .search-bar { flex-wrap: wrap; }
  .search-bar select { width: 100% !important; }

  /* tipo-switch */
  .tipo-switch { width: 100%; }
  .tipo-btn { flex: 1; text-align: center; font-size: 11.5px; padding: 8px 6px; }

  /* Modal */
  .modal { padding: 18px; width: 96%; max-width: 96%; border-radius: 16px; }
  .modal .form-grid { grid-template-columns: 1fr; }

  /* Dashboard row  */
  .row.mb-16 { flex-wrap: wrap; gap: 8px; }
  .row.mb-16 .spacer { display: none; }

  /* Topbar actions */
  #tema-btn { padding: 5px 6px; font-size: 15px; }
}

/* Small phone */
@media (max-width: 480px) {
  .content { padding: 10px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .kpi-card { padding: 12px; }
  .kpi-value { font-size: 18px; }
  .kpi-label { font-size: 9px; }
  .form-grid { grid-template-columns: 1fr; }
  .btn-group { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .btn-xs, .btn-sm { width: auto; }
  .btn-group .btn-xs { flex: none; }
  .kanban-wrap { grid-template-columns: repeat(5, 148px); }
  .breakeven-display { grid-template-columns: 1fr; }
  .card { padding: 12px; }
  .section-title { font-size: 14px; }

  /* Bottom nav bar para mobile */
  .mobile-bottom-nav { display: flex !important; }
  .sidebar { display: none !important; }
  .sidebar.open { display: flex !important; }
  .content { padding-bottom: 70px; }
}

/* ── MOBILE BOTTOM NAV ── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  z-index: 90;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  justify-content: space-around;
  align-items: center;
  backdrop-filter: blur(12px);
}

.mob-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text3);
  font-size: 10px;
  font-family: var(--font);
  font-weight: 600;
  min-width: 52px;
  transition: color 0.15s, background 0.15s;
  position: relative;
}

.mob-nav-btn .mob-icon { font-size: 20px; line-height: 1; }
.mob-nav-btn.active { color: var(--accent); }
.mob-nav-btn.active .mob-icon { filter: drop-shadow(0 0 4px rgba(0,200,255,0.5)); }

.mob-nav-badge {
  position: absolute;
  top: 2px; right: 6px;
  background: var(--red);
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  padding: 1px 4px;
  min-width: 14px;
  text-align: center;
  font-family: var(--mono);
  display: none;
}
.mob-nav-badge.show { display: block; }

/* ── SAFE AREA & TOUCH ── */
@supports (padding-top: env(safe-area-inset-top)) {
  .topbar { padding-top: max(0px, env(safe-area-inset-top)); }
  .sidebar { padding-top: max(0px, env(safe-area-inset-top)); }
}

/* Touch targets mínimos */
@media (pointer: coarse) {
  .btn { min-height: 42px; }
  .btn-xs { min-height: 34px; }
  .nav-item { min-height: 44px; }
  input, select, textarea { min-height: 42px; font-size: 16px !important; } /* previne zoom no iOS */
  .label-hint { width: 20px; height: 20px; font-size: 11px; }
}
/* GALAEM visual refresh — screen only. Print/PDF styles remain untouched. */
@media screen {
  :root {
    --bg: #0c1119;
    --bg2: #131b26;
    --bg3: #1b2633;
    --bg4: #253242;
    --bg5: #2c3b4d;
    --border: #273443;
    --border2: #35465a;
    --text: #f0f4f8;
    --text2: #a9b9c9;
    --text3: #8296ab;
    --accent: #78b9eb;
    --accent2: #569bd1;
    --accent-dim: rgba(120,185,235,.12);
    --accent-glow: 0 0 0 3px rgba(120,185,235,.13);
    --gold: #e2ae72;
    --green: #72d3ac;
    --red: #f37c89;
    --yellow: #eac478;
    --purple: #b8a7ec;
    --orange: #e8a675;
    --radius: 16px;
    --radius-sm: 10px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  }
  body { font-size: 14px; line-height: 1.55; background: var(--bg); }
  body::before {
    background: radial-gradient(ellipse 72% 50% at 74% -12%, rgba(70,130,180,.07), transparent 78%);
  }
  .app-shell { grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: 70px minmax(0, 1fr); }
  .sidebar { background: #101824; border-right: 1px solid var(--border); }
  .sidebar-brand { padding: 24px 20px 21px; background: none; }
  .brand-icon {
    width: 40px; height: 40px; border-radius: 11px;
    background: linear-gradient(145deg, #1e3448, #172a3c); color: #b5d8f3;
    border: 1px solid #416481; box-shadow: none; font-size: 21px; font-weight: 800;
    letter-spacing: -.07em;
  }
  .brand-name { font-size: 16px; letter-spacing: -.035em; font-weight: 800; }
  .brand-sub { font-family: var(--font); font-size: 10px; letter-spacing: .10em; color: var(--text3); margin-top: 4px; }
  .sidebar-nav { padding: 17px 12px 22px; gap: 3px; }
  .sidebar-section-label { padding: 19px 12px 7px; font-family: var(--font); font-size: 10px; letter-spacing: .105em; color: #7890a6; }
  .sidebar-section-label:first-child { padding-top: 2px; }
  .nav-item { padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 550; color: #a8b9c9; gap: 12px; }
  .nav-item:hover { background: #1b2a3b; color: #f4f8fc; }
  .nav-item.active { background: #22374c; color: #d1e9fb; box-shadow: inset 0 0 0 1px #3d5d77; font-weight: 700; }
  .nav-item.active::before { display: none; }
  .nav-icon { width: 19px; height: 19px; display: inline-flex; justify-content: center; align-items: center; flex-shrink: 0; }
  .nav-icon svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.85; fill: none; stroke-linecap: round; stroke-linejoin: round; }
  .nav-badge { background: #355b78; color: #e7f5ff; font-size: 10px; }
  .sidebar-footer { text-align: left; padding: 17px 23px; color: #7189a0; font-family: var(--font); font-size: 11px; }
  .topbar { min-width: 0; background: rgba(16,24,36,.94); padding: 0 32px; gap: 16px; }
  .topbar-title { font-size: 15px; letter-spacing: -.02em; font-weight: 750; }
  .topbar-pill { background: transparent; border-color: #314253; color: #abc1d3; padding: 7px 11px; font-family: var(--font); font-size: 11px; }
  .topbar-pill .dot { width: 7px; height: 7px; box-shadow: none; animation: none; }
  #tema-btn { border: 1px solid var(--border2); border-radius: 9px; min-width: 34px; min-height: 34px; justify-content: center; }
  .content { padding: 30px 34px 56px; max-height: calc(100vh - 70px); min-width: 0; }
  .tab-panel { max-width: 1560px; margin-inline: auto; }
  .section-title { font-size: 22px; font-weight: 750; letter-spacing: -.04em; gap: 9px; margin-bottom: 22px; }
  .card, .kpi-card { background: var(--bg2); border-color: var(--border); box-shadow: 0 8px 32px rgba(0,0,0,.11); }
  .card { padding: 22px 23px; }
  .card::after { display: none; }
  .card-header { margin-bottom: 19px; gap: 12px; }
  .card-title { color: #a8bbcd; font-family: var(--font); text-transform: none; letter-spacing: -.005em; font-size: 13px; font-weight: 700; }
  .card-title-lg { letter-spacing: -.02em; font-size: 16px; }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
  .kpi-card { padding: 20px; min-height: 120px; }
  .kpi-card:hover { transform: translateY(-2px); border-color: #456078; }
  .kpi-card::before { top: 0; bottom: auto; left: 20px; right: auto; width: 35px; height: 3px; border-radius: 0 0 4px 4px; opacity: .85; }
  .kpi-label { font-family: var(--font); text-transform: none; letter-spacing: 0; font-size: 11px; font-weight: 650; margin-bottom: 15px; color: var(--text2); }
  .kpi-value { font-family: var(--font); font-size: clamp(20px, 2vw, 27px); font-weight: 750; letter-spacing: -.045em; }
  .kpi-icon { opacity: .25; top: 16px; right: 17px; }
  .kpi-delta { color: var(--text3); font-family: var(--font); font-size: 11px; margin-top: 7px; }
  .grid-2, .grid-3 { gap: 18px; }
  .form-grid { gap: 16px; }
  .form-group { gap: 7px; }
  label { font-family: var(--font); font-size: 11px; font-weight: 650; letter-spacing: .01em; text-transform: none; color: #b6c7d7; }
  input, select, textarea { background: #172331; border-color: #36495b; border-radius: 9px; min-height: 40px; padding: 10px 12px; font-size: 13px; }
  input::placeholder, textarea::placeholder { color: #8194a7; }
  input:focus, select:focus, textarea:focus { box-shadow: var(--accent-glow); }
  .btn { border-radius: 9px; padding: 10px 15px; font-size: 12px; letter-spacing: 0; min-height: 37px; justify-content: center; }
  .btn-primary { color: #0d2639; background: #a9d4f3; box-shadow: none; }
  .btn-primary:hover { background: #c0e1f7; filter: none; box-shadow: 0 5px 16px rgba(120,185,235,.15); }
  .btn-secondary { background: #202f3e; border-color: #394e62; }
  .btn-secondary:hover { background: #2b4053; border-color: #638caf; color: #eaf6ff; }
  .btn-sm { padding: 7px 12px; min-height: 33px; }
  .btn-xs { padding: 5px 9px; min-height: 29px; }
  .btn-group { gap: 9px; }
  table { font-size: 12.5px; }
  thead th { font-family: var(--font); font-size: 10px; color: #9db0c3; padding: 12px; letter-spacing: .055em; }
  tbody td { padding: 12px; }
  tbody tr:hover { background: rgba(122,178,220,.055); }
  .badge { font-family: var(--font); border-radius: 6px; }
  .tipo-switch { background: #192636; border-color: var(--border); padding: 4px; }
  .tipo-btn { border-radius: 7px; }
  .tipo-btn.active { background: #a9d4f3; color: #0b273a; box-shadow: none; }
  .tipo-btn.fdm-active { background: #a99ce0; color: #111629; box-shadow: none; }
  .modal { box-shadow: 0 24px 80px rgba(0,0,0,.45); }
  .mobile-bottom-nav { background: #101824; }

  body.light-mode {
    --bg: #f4f6f8; --bg2: #ffffff; --bg3: #eef2f6; --bg4: #e4ebf2;
    --bg5: #d7e2eb; --border: #dee5ec; --border2: #c9d5e0;
    --text: #182839; --text2: #536a7e; --text3: #627b90;
    --accent: #216aa2; --accent2: #175782; --accent-dim: rgba(33,106,162,.1);
    --green: #187c56; --red: #bf4051; --yellow: #946413;
  }
  body.light-mode .sidebar { background: #fff; }
  body.light-mode .topbar { background: rgba(255,255,255,.94); }
  body.light-mode .nav-item { color: #51687c; }
  body.light-mode .nav-item.active { background: #e5f1fa; color: #175782; box-shadow: inset 0 0 0 1px #bad6e9; }
  body.light-mode .nav-item:hover { background: #edf3f8; }
  body.light-mode .brand-icon { background: #e5f1fa; color: #175782; border-color: #b9d8ed; }
  body.light-mode .brand-sub, body.light-mode .sidebar-footer { color: #61798d; }
  body.light-mode .sidebar-section-label { color: #627a8e; }
  body.light-mode .topbar-pill { color: #526b7c; border-color: #d4e0e9; }
  body.light-mode .card, body.light-mode .kpi-card { background: #fff; box-shadow: 0 6px 22px rgba(25,53,73,.04); }
  body.light-mode .card-title, body.light-mode label { color: #405a70; }
  body.light-mode .kpi-label, body.light-mode thead th { color: #526b80; }
  body.light-mode input, body.light-mode select, body.light-mode textarea { background: #fff; border-color: #c9d5e0; color: #182839; }
  body.light-mode input::placeholder, body.light-mode textarea::placeholder { color: #697f90; }
  body.light-mode .btn-primary, body.light-mode .tipo-btn.active { background: #1f6b9e; color: #fff; }
  body.light-mode .btn-secondary { background: #f4f7fa; border-color: #c9d5e0; color: #22394b; }
  body.light-mode .tipo-switch { background: #eaf0f5; }
  body.light-mode .mobile-bottom-nav { background: #fff; }
  @media (max-width: 768px) {
    .app-shell { grid-template-columns: 1fr; grid-template-rows: 58px minmax(0, 1fr); }
    .sidebar { width: 248px; left: -268px; }
    .topbar { padding: 0 16px; }
    .content { max-height: calc(100vh - 58px); padding: 18px 16px 80px; }
    .section-title { font-size: 19px; }
    .card { padding: 18px; }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kpi-card { min-height: 108px; padding: 16px; }
    .kpi-value { font-size: 20px; }
    .form-grid { gap: 12px; }
  }
  @media (max-width: 480px) {
    .content { padding: 14px 12px 82px; }
    .card { padding: 15px; }
    .kpi-card { padding: 14px; }
    .kpi-label { font-size: 10px; margin-bottom: 11px; }
    .kpi-value { font-size: 18px; }
    .btn-group { gap: 7px; }
  }
}


/* Dashboard — cartões dimensionados e gráfico financeiro */
@media screen {
  #tab-dashboard .kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
  #tab-dashboard .kpi-card { min-width: 0; min-height: 116px; overflow: visible; }
  #tab-dashboard .kpi-label { max-width: calc(100% - 34px); overflow-wrap: anywhere; }
  #tab-dashboard .kpi-value {
    max-width: 100%; min-width: 0; font-size: clamp(19px, 2vw, 28px);
    line-height: 1.22; overflow-wrap: anywhere; word-break: normal;
    font-variant-numeric: tabular-nums;
  }
  .dashboard-insights-grid { display:grid; grid-template-columns:minmax(0, 1.25fr) minmax(0, 1fr); gap:18px; }
  .dashboard-insights-grid > * { min-width:0; }
  .dashboard-insights-side { min-width:0; }
  .dashboard-insights-side .card { flex:1; min-width:0; }
  .dashboard-chart-subtitle { color:var(--text3); font-size:11px; }
  .finance-chart-layout { min-width:0; }
  .finance-donut {
    width:clamp(168px, 18vw, 232px); aspect-ratio:1; padding:24px;
    border-radius:50%; display:grid; place-items:center;
    filter:drop-shadow(0 8px 14px rgba(0,0,0,.12));
  }
  .finance-donut-center { background:var(--bg2); border-radius:50%; width:100%; height:100%; padding:10px; text-align:center; }
  .finance-donut-caption { font-size:11px; color:var(--text2); line-height:1.3; }
  .finance-donut-value { display:block; max-width:100%; font-size:clamp(14px, 1.45vw, 20px); color:var(--green); line-height:1.25; overflow-wrap:anywhere; }
  .finance-donut-value.is-loss { color:var(--red); }
  .finance-legend { list-style:none; padding:0; margin:0; }
  .finance-legend-row { min-width:0; padding:7px 0; border-bottom:1px solid var(--border); font-size:11px; }
  .finance-legend-row:last-child { border-bottom:0; }
  .finance-legend-dot { width:10px; height:10px; border-radius:3px; }
  .finance-legend-name { color:var(--text2); overflow-wrap:anywhere; }
  .finance-legend-value { color:var(--text); font-size:11px; font-weight:700; text-align:right; white-space:nowrap; }
  .finance-legend-percent { color:var(--text3); min-width:38px; text-align:right; font-family:var(--mono); font-size:10px; }
  .finance-chart-note { color:var(--text3); font-size:11px; line-height:1.5; }
  .dashboard-chart-empty { display:grid; min-height:235px; place-items:center; text-align:center; color:var(--text2); font-size:13px; padding:25px; border:1px dashed var(--border2); border-radius:12px; }
  @media (max-width: 1200px) {
    .dashboard-insights-grid { grid-template-columns:1fr; }
    .dashboard-insights-side { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
    .finance-donut { width:210px; }
  }
  @media (max-width: 900px) { #tab-dashboard .kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
  @media (max-width: 600px) {
    .dashboard-insights-side { display:flex; }
    .finance-chart-layout { flex-direction:column; align-items:stretch; }
    .finance-donut { margin:0 auto; width:208px; }
    #tab-dashboard .kpi-card { min-height:108px; }
    #tab-dashboard .kpi-value { font-size:clamp(17px, 5vw, 22px); }
  }
  @media (max-width: 360px) { #tab-dashboard .kpi-grid { grid-template-columns:1fr; } }
}

@media screen {
  #tab-dashboard .kpi-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
  #tab-dashboard .dashboard-disclosure {
    border:1px solid var(--border); background:var(--bg2);
    border-radius:var(--radius); overflow:hidden;
  }
  #tab-dashboard .dashboard-disclosure > summary {
    display:flex; align-items:center; gap:12px; cursor:pointer;
    padding:17px 21px; color:var(--text); font-size:14px; font-weight:700;
    list-style:none; user-select:none;
  }
  #tab-dashboard .dashboard-disclosure > summary::-webkit-details-marker { display:none; }
  #tab-dashboard .dashboard-disclosure > summary::before {
    content:'+'; width:24px; height:24px; display:grid; place-items:center;
    flex:none; color:var(--accent); background:var(--accent-dim);
    border-radius:7px; font-size:17px; line-height:1;
  }
  #tab-dashboard .dashboard-disclosure[open] > summary::before { content:'−'; }
  #tab-dashboard .dashboard-disclosure > summary span {
    margin-left:auto; text-align:right; color:var(--text3); font-size:11px;
    font-weight:400;
  }
  #tab-dashboard .dashboard-disclosure[open] > summary { border-bottom:1px solid var(--border); }
  #tab-dashboard .dashboard-disclosure .dashboard-chart-card {
    border:0; box-shadow:none; background:transparent; padding:20px;
  }
  #tab-dashboard .dashboard-disclosure .dashboard-detail-grid { padding:18px; }
  #tab-dashboard .dashboard-detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
  #tab-dashboard .dashboard-detail-grid > * { min-width:0; }
  #tab-dashboard .dashboard-recent-card { margin:18px; }
  #tab-dashboard .dashboard-production-grid {
    display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; padding:18px 18px 0;
  }
  #tab-dashboard .dashboard-production-grid .kpi-card { min-width:0; box-shadow:none; }
  #tab-dashboard .dashboard-detail-note { padding:0 18px 18px; color:var(--text3); font-size:11px; }
  #tab-dashboard .dashboard-chart-empty { min-height:92px; padding:15px; }
  #tab-dashboard .finance-donut { width:clamp(170px,18vw,220px); }
  @media (max-width:1100px) {
    #tab-dashboard .kpi-grid, #tab-dashboard .dashboard-production-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  }
  @media (max-width:700px) {
    #tab-dashboard .dashboard-detail-grid { grid-template-columns:1fr; }
    #tab-dashboard .dashboard-disclosure > summary { flex-wrap:wrap; padding:15px; }
    #tab-dashboard .dashboard-disclosure > summary span { flex-basis:100%; margin-left:36px; text-align:left; }
  }
  @media (max-width:360px) {
    #tab-dashboard .kpi-grid, #tab-dashboard .dashboard-production-grid { grid-template-columns:1fr; }
  }
}

@media screen {
  #tab-dashboard .finance-donut { position:relative; cursor:pointer; transition:transform .18s ease; }
  #tab-dashboard .finance-donut:hover { transform:scale(1.025); }
  #tab-dashboard .finance-donut:focus-visible, #tab-dashboard .finance-legend-button:focus-visible {
    outline:2px solid var(--accent); outline-offset:3px;
  }
  #tab-dashboard .finance-donut-tooltip {
    position:absolute; transform:translate(-50%,-125%); pointer-events:none;
    z-index:2; white-space:nowrap; max-width:220px; padding:6px 9px;
    border:1px solid var(--border2); border-radius:7px;
    background:var(--bg3); color:var(--text); box-shadow:var(--shadow);
    font-size:11px; font-family:var(--font);
  }
  #tab-dashboard .finance-donut-tooltip[hidden] { display:none; }
  #tab-dashboard .finance-legend-row { padding:0; }
  #tab-dashboard .finance-legend-button {
    width:100%; display:grid; grid-template-columns:10px minmax(0,1fr) auto 42px;
    align-items:center; gap:10px; padding:8px 9px; border:0;
    background:transparent; color:inherit; text-align:left; cursor:pointer;
    border-radius:8px; font:inherit;
  }
  #tab-dashboard .finance-legend-button:hover, #tab-dashboard .finance-legend-button.is-selected {
    background:var(--accent-dim);
  }
  #tab-dashboard .finance-legend-button.is-selected .finance-legend-name { color:var(--accent); font-weight:700; }
  #dashboard-filter-modal .dashboard-filter-card {
    margin:0 20px 20px; padding:20px; background:var(--bg3);
    border:1px solid var(--border); border-radius:12px;
  }
  #dashboard-filter-modal .dashboard-filter-heading {
    display:flex; align-items:end; justify-content:space-between; gap:20px;
    margin-bottom:18px;
  }
  #dashboard-filter-modal .dashboard-filter-heading h3 { font-size:14px; color:var(--text); margin:0 0 4px; }
  #dashboard-filter-modal .dashboard-filter-heading p { font-size:11px; color:var(--text3); margin:0; }
  #dashboard-filter-modal .dashboard-filter-control { width:min(100%,280px); flex:none; }
  #dashboard-filter-modal .dashboard-filter-control label { display:block; margin-bottom:5px; }
  #dashboard-filter-modal .dashboard-filter-stat {
    display:flex; justify-content:space-between; align-items:center; gap:20px;
    padding:17px; background:var(--bg2); border:1px solid var(--border);
    border-radius:10px;
  }
  #dashboard-filter-modal .dashboard-filter-stat > div { min-width:0; }
  #dashboard-filter-modal .dashboard-filter-kicker, #dashboard-filter-modal .dashboard-filter-share span {
    display:block; color:var(--text2); font-size:11px;
  }
  #dashboard-filter-modal .dashboard-filter-stat strong {
    display:block; margin-top:4px; color:var(--text); font-size:21px;
    line-height:1.2; overflow-wrap:anywhere; font-variant-numeric:tabular-nums;
  }
  #dashboard-filter-modal .dashboard-filter-share { text-align:right; }
  #dashboard-filter-modal .dashboard-filter-share strong { color:var(--accent); font-size:15px; }
  #dashboard-filter-modal .dashboard-filter-rows {
    max-height:260px; overflow-y:auto; margin-top:12px;
    border-top:1px solid var(--border);
  }
  #dashboard-filter-modal .dashboard-filter-row {
    display:flex; align-items:center; justify-content:space-between; gap:20px;
    padding:11px 4px; border-bottom:1px solid var(--border);
  }
  #dashboard-filter-modal .dashboard-filter-row > div { min-width:0; }
  #dashboard-filter-modal .dashboard-filter-row strong, #dashboard-filter-modal .dashboard-filter-row span {
    display:block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  }
  #dashboard-filter-modal .dashboard-filter-row strong { color:var(--text); font-size:12px; }
  #dashboard-filter-modal .dashboard-filter-row span { color:var(--text3); font-size:11px; margin-top:2px; }
  #dashboard-filter-modal .dashboard-filter-row b { color:var(--text); font-size:12px; white-space:nowrap; }
  #dashboard-filter-modal .dashboard-filter-row b.is-loss { color:var(--red); }
  #dashboard-filter-modal .dashboard-filter-empty, #dashboard-filter-modal .dashboard-filter-note {
    color:var(--text3); font-size:11px; margin:12px 0 0;
  }
  @media (max-width:700px) {
    #dashboard-filter-modal .dashboard-filter-heading { flex-direction:column; align-items:stretch; }
    #dashboard-filter-modal .dashboard-filter-control { width:100%; }
    #dashboard-filter-modal .dashboard-filter-card { margin:0 12px 12px; padding:14px; }
    #dashboard-filter-modal .dashboard-filter-stat strong { font-size:17px; }
    #tab-dashboard .finance-legend-button { grid-template-columns:10px minmax(0,1fr) auto 38px; gap:6px; }
  }
}

@media screen {
  body.dashboard-modal-open { overflow:hidden; }
  .dashboard-filter-backdrop {
    display:none; position:fixed; inset:0; z-index:600;
    background:rgba(3,9,16,.78); backdrop-filter:blur(6px);
    padding:20px; align-items:center; justify-content:center;
  }
  .dashboard-filter-backdrop.open { display:flex; }
  .dashboard-filter-dialog {
    width:min(840px,100%); max-height:min(88vh,850px); overflow-y:auto;
    background:var(--bg2); border:1px solid var(--border2);
    border-radius:18px; box-shadow:0 30px 90px rgba(0,0,0,.45);
  }
  .dashboard-modal-header {
    display:flex; justify-content:space-between; align-items:start; gap:16px;
    padding:20px 22px; border-bottom:1px solid var(--border);
  }
  .dashboard-modal-header h2 { color:var(--text); font-size:19px; letter-spacing:-.03em; margin:0; }
  .dashboard-modal-header p { color:var(--text3); font-size:11px; margin:4px 0 0; }
  .dashboard-modal-close {
    flex:none; width:38px; height:38px; border:1px solid var(--border2);
    border-radius:10px; background:var(--bg3); color:var(--text);
    font-size:25px; line-height:1; cursor:pointer;
  }
  .dashboard-modal-close:hover, .dashboard-modal-close:focus-visible {
    border-color:var(--accent); color:var(--accent);
  }
  #dashboard-filter-modal .dashboard-filter-card { margin:18px 20px 20px; }
  #dashboard-filter-modal .dashboard-filter-heading { justify-content:flex-start; align-items:end; }
  #dashboard-filter-modal .dashboard-filter-control { width:min(100%,270px); }
  #tab-dashboard .finance-donut, #tab-dashboard .finance-donut:hover {
    display:block; padding:0; background:none !important; filter:none; transform:none;
  }
  #tab-dashboard .finance-donut-svg { width:100%; height:100%; overflow:visible; display:block; }
  #tab-dashboard .finance-slice {
    cursor:pointer; stroke:var(--bg2); stroke-width:2; outline:none;
    transition:transform .2s ease, filter .2s ease;
    transform-box:view-box; transform-origin:120px 120px;
  }
  #tab-dashboard .finance-slice:focus-visible { stroke:var(--accent); stroke-width:3; }
  #tab-dashboard .finance-slice:hover, #tab-dashboard .finance-slice.is-hovered,
  #tab-dashboard .finance-slice:focus-visible {
    transform:translate(var(--pop-x),var(--pop-y));
    filter:brightness(1.16) drop-shadow(0 4px 7px rgba(0,0,0,.34));
    outline:none;
  }
  #tab-dashboard .finance-donut-center {
    position:absolute; width:53%; height:53%; left:23.5%; top:23.5%;
    pointer-events:none; background:var(--bg2); border-radius:50%;
  }
  #tab-dashboard .finance-donut-tooltip { z-index:3; }
  @media (max-width:700px) {
    .dashboard-filter-backdrop { padding:10px; }
    .dashboard-filter-dialog { max-height:94dvh; }
    .dashboard-modal-header { padding:15px; }
    #dashboard-filter-modal .dashboard-filter-heading { flex-direction:column; align-items:stretch; }
    #dashboard-filter-modal .dashboard-filter-control { width:100%; }
    #dashboard-filter-modal .dashboard-filter-card { margin:10px; }
  }
}

