:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-muted: #eef3f9;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --primary: #0f3d6e;
  --primary-2: #1d5f9e;
  --primary-soft: #e8f0f9;
  --accent: #0ea5a4;
  --accent-strong: #0b8f8e;
  --accent-soft: #e6f7f6;
  --success: #0f766e;
  --warning: #b45309;
  --warning-soft: #fff7ed;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --sidebar: #0a1c33;
  --sidebar-2: #0f2c4f;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 14px 40px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 24px 70px rgba(2, 12, 27, 0.28);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Segoe UI Variable", "Segoe UI", Inter, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at 100% 0%, rgba(29, 95, 158, 0.08), transparent 32rem),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--primary-2); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
.icone { width: 18px; height: 18px; flex: 0 0 auto; }
.muted { color: var(--muted); }
.num { text-align: right !important; }
.destaque td { background: #f0f7ff; font-weight: 700; }

/* Buttons */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
button:hover { background: var(--primary-2); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: 3px solid rgba(14, 165, 164, 0.3); outline-offset: 2px; }
button:disabled { cursor: default; opacity: 0.5; transform: none; }
button .icone { width: 17px; height: 17px; }
.secondary-button {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}
.secondary-button:hover { background: var(--surface-soft); color: var(--primary); border-color: #b8c6d6; }
.danger-button { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.danger-button:hover { background: #fee2e2; color: var(--danger); border-color: #fca5a5; }
.ghost-button { background: transparent; color: var(--muted); border-color: transparent; box-shadow: none; }
.ghost-button:hover { background: var(--surface-muted); color: var(--text); }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 12px;
}
.icon-button .icone { width: 19px; height: 19px; }
.menu-toggle { display: none; background: var(--surface); color: var(--primary); border-color: var(--line); box-shadow: var(--shadow-xs); }
.menu-backdrop { display: none; }
.menu-toggle:hover { background: var(--surface-soft); color: var(--primary); }

/* Login */
.login-dialog {
  width: min(1000px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.login-dialog::backdrop {
  background:
    radial-gradient(circle at 18% 18%, rgba(14, 165, 164, 0.2), transparent 26rem),
    radial-gradient(circle at 82% 82%, rgba(29, 95, 158, 0.35), transparent 28rem),
    rgba(3, 12, 26, 0.72);
  backdrop-filter: blur(10px);
}
.login-shell {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  min-height: 560px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 42px;
  color: #fff;
  background:
    radial-gradient(circle at 84% 12%, rgba(14, 165, 164, 0.45), transparent 18rem),
    radial-gradient(circle at 8% 92%, rgba(56, 189, 248, 0.16), transparent 18rem),
    linear-gradient(145deg, #08182c 0%, #0c2a4d 55%, #0d3a63 100%);
}
.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.08;
  pointer-events: none;
  background-image: radial-gradient(circle, #fff 1px, transparent 1px);
  background-size: 22px 22px;
}
.login-brand > * { position: relative; z-index: 1; }
.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  padding: 8px 12px 8px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.login-logo img { display: block; width: 104px; height: auto; }
.login-logo strong { display: block; color: var(--primary); font-size: 18px; line-height: 1; }
.login-logo span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 3px; }
.login-brand h2 { margin-top: 8px; font-size: 32px; line-height: 1.18; letter-spacing: -0.02em; }
.login-brand > p { color: #c7d8ec; font-size: 14px; line-height: 1.65; max-width: 34ch; }
.login-features { display: grid; gap: 12px; margin: 2px 0 0; padding: 0; list-style: none; }
.login-features li { display: flex; align-items: flex-start; gap: 10px; color: #dce8f6; font-size: 13px; line-height: 1.45; }
.login-features .feature-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
  color: #5eead4;
}
.login-features .icone { width: 16px; height: 16px; }
.login-brand-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.12); color: #8fb0cf; font-size: 11px; }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 54px 48px; background: var(--surface); }
.login-panel-head { margin-bottom: 26px; }
.badge-acesso {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.login-panel h2 { font-size: 26px; letter-spacing: -0.02em; }
.login-panel-head p { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.login-field { display: grid; gap: 7px; margin-bottom: 16px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > .icone { position: absolute; left: 13px; color: var(--muted-2); pointer-events: none; }
.input-icon input {
  width: 100%;
  min-height: 46px;
  padding: 0 44px 0 42px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.input-icon input:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(14, 165, 164, 0.12); }
.input-icon .toggle-senha {
  position: absolute;
  right: 6px;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.input-icon .toggle-senha:hover { background: var(--surface-muted); color: var(--text); }
.login-submit { width: 100%; min-height: 48px; margin-top: 6px; border-radius: 11px; font-size: 14px; font-weight: 800; background: linear-gradient(135deg, var(--primary-2), var(--primary)); box-shadow: 0 10px 24px rgba(15, 61, 110, 0.22); }
.login-submit:hover { background: linear-gradient(135deg, #246ca9, #0d355f); }
.login-submit .icone { width: 18px; height: 18px; }
.login-hint { margin-top: 18px; color: var(--muted-2); font-size: 11px; text-align: center; }
.login-panel .status { min-height: 18px; margin: 2px 0 0; font-size: 12px; }
body.auth-locked .app-shell { filter: blur(2px); opacity: 0.55; pointer-events: none; }

/* Shell */
.app-shell { display: grid; grid-template-columns: 286px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns 0.2s ease; }
body.menu-collapsed .app-shell { grid-template-columns: 0 minmax(0, 1fr); }
body.menu-collapsed .sidebar { opacity: 0; transform: translateX(-10px); pointer-events: none; }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  color: #e2eaf4;
  background:
    radial-gradient(circle at 90% 0%, rgba(14, 165, 164, 0.2), transparent 19rem),
    linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.brand { display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 16px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.brand-logo { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 auto; padding: 3px; border-radius: 12px; background: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); }
.brand-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-text { min-width: 0; }
.brand-text strong { display: block; color: #fff; font-size: 19px; line-height: 1.1; letter-spacing: -0.01em; }
.brand-text span { display: block; margin-top: 3px; overflow: hidden; color: #9fb8d3; font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-search { padding: 16px 16px 12px; }
.search-field { position: relative; display: flex; align-items: center; }
.search-field .icone { position: absolute; left: 12px; color: #8aa6c3; }
.search-field input { width: 100%; min-height: 40px; padding: 0 12px 0 38px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 10px; background: rgba(255, 255, 255, 0.07); color: #fff; font-size: 12.5px; font-weight: 500; }
.search-field input::placeholder { color: #8aa6c3; }
.search-field input:focus { outline: none; border-color: rgba(94, 234, 212, 0.55); background: rgba(255, 255, 255, 0.1); box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.15); }
.table-menu { flex: 1; overflow-y: auto; padding: 2px 10px 18px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
.menu-home-wrap { padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.menu-home { min-height: 42px; }
.menu-group { margin: 4px 0; }
.menu-group-title {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8fa9c6;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
}
.menu-group-title:hover { background: rgba(255, 255, 255, 0.06); color: #d7e5f5; }
.menu-group-title .icone { width: 15px; height: 15px; opacity: 0.85; }
.chevron { width: 7px; height: 7px; margin-left: auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; opacity: 0.6; transform: rotate(45deg); transition: transform 0.15s ease; }
.menu-group.collapsed .chevron { transform: rotate(-45deg); }
.menu-group-items { display: grid; gap: 2px; padding: 3px 0 4px; }
.menu-group.collapsed .menu-group-items { display: none; }
.table-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #c3d5e9;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}
.table-button:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.table-button.active { background: rgba(255, 255, 255, 0.11); color: #fff; box-shadow: inset 3px 0 0 #2dd4bf; }
.table-button .menu-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: 0 0 auto; border-radius: 7px; background: rgba(255, 255, 255, 0.06); color: #9fb8d3; }
.table-button .menu-icon .icone { width: 15px; height: 15px; }
.table-button.active .menu-icon { background: rgba(45, 212, 191, 0.16); color: #5eead4; }
.table-button .menu-item-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-button small { margin-left: auto; color: #8fa9c6; font-size: 10.5px; font-weight: 700; }
.sidebar-footer { padding: 14px 16px 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px; background: linear-gradient(135deg, #2dd4bf, #0e7490); color: #042f2e; font-size: 12px; font-weight: 900; letter-spacing: 0.03em; }
.user-meta { min-width: 0; }
.user-meta strong { display: block; overflow: hidden; color: #fff; font-size: 12.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { display: block; margin-top: 2px; color: #8fa9c6; font-size: 10.5px; font-weight: 600; }
.sidebar-logout { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 36px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 9px; background: rgba(255, 255, 255, 0.04); color: #c3d5e9; font-size: 12px; font-weight: 700; }
.sidebar-logout:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
.sidebar-logout .icone { width: 15px; height: 15px; }

/* Content */
.content { min-width: 0; padding: 24px 30px 42px; }
.topbar { display: flex; align-items: flex-start; gap: 16px; max-width: 1600px; margin: 0 auto 22px; }
.title-area { min-width: 0; flex: 1; }
.breadcrumb { display: flex; align-items: center; gap: 7px; margin: 0 0 7px; color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.breadcrumb .sep { color: var(--muted-2); }
.breadcrumb .atual { color: var(--primary-2); }
.title-area h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.025em; }
.screen-description { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-xs); }
.user-chip .avatar { width: 32px; height: 32px; border-radius: 9px; font-size: 10.5px; }
.user-chip strong { display: block; color: var(--text); font-size: 11.5px; line-height: 1.2; }
.user-chip span { display: block; color: var(--muted); font-size: 10px; font-weight: 600; }
#conteudo { max-width: 1600px; margin: 0 auto; }

/* Cards and panels */
.panel { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-title { color: var(--text); font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.panel-subtitle { margin-top: 4px; color: var(--muted); font-size: 12px; }
.grid-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.result-stack { display: grid; gap: 16px; }
.dashboard { display: grid; gap: 16px; }
.dashboard-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  padding: 28px 30px;
  border-radius: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 20%, rgba(45, 212, 191, 0.32), transparent 16rem),
    radial-gradient(circle at 12% 100%, rgba(56, 189, 248, 0.18), transparent 18rem),
    linear-gradient(135deg, #0a1c33 0%, #0f3d6e 58%, #11608f 100%);
  box-shadow: var(--shadow-md);
}
.dashboard-hero::after { content: ""; position: absolute; inset: 0; opacity: 0.08; background-image: radial-gradient(circle, #fff 1px, transparent 1px); background-size: 24px 24px; pointer-events: none; }
.dashboard-hero > * { position: relative; z-index: 1; }
.dashboard-hero .eyebrow { color: #5eead4; }
.dashboard-hero h2 { margin-top: 4px; font-size: 26px; letter-spacing: -0.025em; }
.dashboard-hero p { margin-top: 7px; max-width: 56ch; color: #c7d8ec; font-size: 13px; line-height: 1.55; }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.hero-actions button { background: #fff; color: var(--primary); border-color: transparent; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16); }
.hero-actions button:hover { background: #eef7ff; color: var(--primary); }
.hero-actions .secondary-button { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.28); box-shadow: none; }
.hero-actions .secondary-button:hover { background: rgba(255, 255, 255, 0.17); color: #fff; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 12px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.metric-icon { grid-row: 1 / span 3; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-2); }
.metric-icon .icone { width: 20px; height: 20px; }
.metric-label { color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.metric-value { margin-top: 3px; color: var(--text); font-size: 27px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.metric-caption { margin-top: 4px; color: var(--muted); font-size: 11px; }
.metric-link { grid-column: 2; justify-self: start; margin-top: 8px; padding: 0; border: 0; background: transparent; color: var(--primary-2); font-size: 11.5px; font-weight: 800; }
.metric-link:hover { background: transparent; color: var(--accent-strong); }
.metric.accent .metric-icon { background: var(--accent-soft); color: var(--accent-strong); }
.metric-card { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.metric-card span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.metric-card strong { color: var(--text); font-size: 23px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; }
.metric-card small { color: var(--muted); font-size: 11px; }
.metric-card.accent { background: var(--primary); border-color: var(--primary); }
.metric-card.accent span, .metric-card.accent small { color: #b9d3ea; }
.metric-card.accent strong { color: #fff; }
.dashboard-row { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr); gap: 16px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.quick-button { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); color: var(--text); font-size: 12px; font-weight: 700; text-align: left; }
.quick-button:hover { background: var(--primary-soft); color: var(--primary); border-color: #bcd2e8; }
.quick-button .icone { color: var(--primary-2); }
.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini-table th { padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-align: left; text-transform: uppercase; }
.mini-table td { padding: 9px 10px; border-bottom: 1px solid #edf2f7; }
.mini-table tbody tr { cursor: pointer; }
.mini-table tbody tr:hover { background: var(--surface-soft); }
.mini-table tbody tr:last-child td { border-bottom: 0; }
.mini-table .valor { color: var(--primary); font-weight: 800; text-align: right; }

/* Filters and forms */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.filter-bar input, .filter-bar select { min-height: 38px; }
.filter-bar input[type="search"] { min-width: 240px; flex: 1; max-width: 380px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.filter-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
input, select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.12); }
input[readonly] { background: var(--surface-soft); color: var(--muted); }
input[type="checkbox"], input[type="radio"] { width: 18px; min-height: 0; height: 18px; padding: 0; accent-color: var(--accent); }
label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.field { display: grid; gap: 6px; }
.field > span { color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.inline { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.inline input, .inline select { width: auto; min-width: 90px; min-height: 38px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.tabs button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; box-shadow: none; }
.tabs button:hover { background: #fff; color: var(--primary); }
.tabs button.active { background: var(--primary); color: #fff; box-shadow: 0 4px 10px rgba(15, 61, 110, 0.18); }

/* Tables */
.data-table-wrap { overflow: auto; border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th { position: sticky; top: 0; z-index: 1; padding: 11px 12px; border-bottom: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { max-width: 280px; padding: 10px 12px; border-bottom: 1px solid #edf2f7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table tbody tr { transition: background 0.12s ease; }
.data-table tbody tr:hover { background: #f4f9ff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .valor { color: var(--primary); font-weight: 800; }
.row-actions { width: 1%; white-space: nowrap; text-align: right; }
.row-actions .secondary-button, .row-actions .danger-button { min-height: 30px; padding: 0 9px; gap: 5px; font-size: 11px; }
.row-actions .icone { width: 14px; height: 14px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap; }
.badge-azul { background: #e0f2fe; color: #075985; }
.badge-verde { background: #dcfce7; color: #166534; }
.badge-convencional { background: #f1f5f9; color: #475569; }
.badge-ok { background: var(--accent-soft); color: var(--accent-strong); }
.badge-alerta { background: var(--warning-soft); color: var(--warning); }
.status-ativo { background: var(--accent-soft); color: var(--accent-strong); }
.status-inativo { background: var(--surface-muted); color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: 11px; font-weight: 700; }
.pager-actions { display: inline-flex; gap: 7px; }
.pager-actions .secondary-button { min-height: 30px; padding: 0 10px; font-size: 11px; }
.empty-state { display: grid; place-items: center; min-height: 240px; padding: 26px; text-align: center; }
.empty-state .empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 10px; border-radius: 14px; background: var(--surface-muted); color: var(--muted); }
.empty-state h2 { font-size: 17px; }
.empty-state p { margin-top: 5px; color: var(--muted); font-size: 12.5px; }

/* Dialogs */
.login-dialog, .editor-dialog { border: 0; padding: 0; }
.editor-dialog { width: min(980px, calc(100vw - 32px)); max-width: none; border-radius: 18px; box-shadow: var(--shadow-lg); }
.editor-dialog::backdrop { background: rgba(3, 12, 26, 0.55); backdrop-filter: blur(5px); }
.editor-dialog form { display: grid; gap: 16px; width: 100%; max-height: calc(100vh - 48px); overflow: auto; padding: 24px; background: var(--surface); }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.editor-head h2 { font-size: 18px; letter-spacing: -0.01em; }
.editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.campo { display: grid; gap: 6px; color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.campo > span { color: var(--muted); }
.campo input, .campo select, .campo textarea { font-size: 13px; font-weight: 500; letter-spacing: normal; text-transform: none; }
.ajuda { color: var(--muted-2); font-size: 10.5px; font-weight: 500; letter-spacing: normal; text-transform: none; }
.editor-actions { display: flex; align-items: center; gap: 9px; padding-top: 14px; border-top: 1px solid var(--line); }
.status { min-height: 18px; margin: 0; color: var(--danger); font-size: 12px; font-weight: 700; }
.logo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.logo-upload { display: grid; gap: 9px; align-content: start; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface-soft); color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.logo-upload input { padding: 7px; font-size: 11px; text-transform: none; }
.logo-preview { max-width: 220px; max-height: 80px; object-fit: contain; padding: 5px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }

/* Account editor */
.conta-editor { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 18px; align-items: start; }
.conta-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.conta-side { position: sticky; top: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.conta-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.conta-head h2 { font-size: 19px; letter-spacing: -0.015em; }
.conta-head p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.conta-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; color: var(--muted); font-size: 11.5px; }
.conta-meta strong { color: var(--text); font-weight: 700; }
.conta-head-actions, .conta-acoes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.conta-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.conta-form-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.conta-form-grid input, .conta-form-grid select { font-size: 13px; font-weight: 500; letter-spacing: normal; text-transform: none; }
.conta-grid { width: 100%; border-collapse: collapse; font-size: 12px; }
.conta-grid th { padding: 9px 10px; border-bottom: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.conta-grid td { padding: 6px 8px; border-bottom: 1px solid #edf2f7; }
.conta-grid tbody tr:last-child td { border-bottom: 0; }
.conta-grid input { min-height: 34px; min-width: 90px; padding: 5px 8px; font-size: 12.5px; }
.total-hero { display: grid; gap: 3px; padding: 16px; border-radius: 13px; background: linear-gradient(135deg, #0b2442, #135183); color: #fff; box-shadow: 0 10px 24px rgba(15, 61, 110, 0.22); }
.total-hero span { color: #a9c5e1; font-size: 10px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.total-hero strong { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; }
.total-hero.compact { min-width: 210px; padding: 12px 16px; }
.total-hero.compact strong { font-size: 22px; }
.resultado-grid { display: grid; grid-template-columns: 1fr; gap: 2px; margin-top: 8px; }
.resultado-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #edf2f7; }
.resultado-item:last-child { border-bottom: 0; }
.resultado-item span { color: var(--muted); font-size: 11.5px; }
.resultado-item strong { color: var(--text); font-size: 12px; font-weight: 800; white-space: nowrap; }
.resultado-item.total { margin-top: 4px; padding-top: 11px; border-top: 2px solid var(--line); border-bottom: 0; }
.resultado-item.total span { color: var(--text); font-size: 12px; font-weight: 800; }
.resultado-item.total strong { color: var(--primary); font-size: 17px; }
.resultado-item small { color: var(--muted); font-size: 10.5px; }
.tecnicos { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10.5px; }
.tecnicos strong { color: var(--text); }
.aviso { padding: 9px 11px; border: 1px solid #fde68a; border-radius: 9px; background: var(--warning-soft); color: #92400e; font-size: 11.5px; line-height: 1.45; }
.conta-side .conta-acoes { display: grid; grid-template-columns: 1fr 1fr; }
.conta-side .conta-acoes button { width: 100%; min-height: 36px; font-size: 11.5px; }
.conta-side .conta-acoes button:last-child { grid-column: 1 / -1; }

/* Opportunities and statistics */
.resumo-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.resumo-panel h2 { font-size: 18px; }
.resumo-panel p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.total-atual { display: grid; gap: 2px; text-align: right; }
.total-atual span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.total-atual strong { color: var(--primary); font-size: 25px; font-weight: 800; letter-spacing: -0.03em; }
.comparison-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.comparison-card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.comparison-card span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.comparison-card strong { display: block; margin-top: 5px; color: var(--text); font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.comparison-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.comparison-card.positivo { background: var(--accent-soft); border-color: #bdece6; }
.comparison-card.positivo strong { color: var(--accent-strong); }
.comparison-card.negativo { background: var(--danger-soft); border-color: #fecaca; }
.comparison-card.negativo strong { color: var(--danger); }
.stats-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stats-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.stats-card span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.stats-card strong { display: block; margin-top: 4px; color: var(--primary); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }

/* Toast */
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: flex; align-items: center; gap: 9px; max-width: 440px; padding: 12px 16px; border-radius: 11px; background: #0f172a; color: #fff; font-size: 12.5px; font-weight: 700; box-shadow: var(--shadow-lg); }
.toast::before { content: ""; width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #2dd4bf; }
.toast.erro { background: #7f1d1d; }
.toast.erro::before { background: #fca5a5; }

/* Utility */
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%; animation: girar 0.7s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.hint { margin: 0; color: var(--muted); font-size: 11.5px; }
.section-divider { height: 1px; margin: 16px 0; background: var(--line); }

@media (max-width: 1200px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-row { grid-template-columns: 1fr; }
  .conta-editor { grid-template-columns: minmax(0, 1fr); }
  .conta-side { position: static; }
}
@media (max-width: 920px) {
  .app-shell, body.menu-collapsed .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: 286px; height: 100vh; box-shadow: var(--shadow-lg); }
  body.menu-collapsed .sidebar { display: none; }
  body:not(.menu-collapsed) .menu-backdrop { display: block; position: fixed; inset: 0; z-index: 35; border: 0; background: rgba(2, 12, 27, 0.5); backdrop-filter: blur(2px); }
  .menu-toggle { display: inline-grid; }
  .content { padding: 18px 16px 32px; }
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .title-area { flex: 1 1 0; }
  .top-actions { flex: 1 0 100%; width: 100%; justify-content: flex-start; }
  .login-shell { grid-template-columns: 1fr; min-height: 0; }
  .login-brand { display: none; }
  .login-panel { padding: 34px 26px; }
  .comparison-cards, .stats-cards { grid-template-columns: 1fr; }
  .editor-fields { grid-template-columns: 1fr; }
  .tecnicos { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .metric-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr; }
  .logo-grid { grid-template-columns: 1fr; }
  .resumo-panel { align-items: flex-start; }
  .total-atual { text-align: left; }
  .dashboard-hero { flex-direction: column; align-items: flex-start; }
  .panel-head { flex-direction: column; align-items: stretch; }
  .panel-head .filter-actions { width: 100%; }
  .panel-head .filter-actions button { flex: 1; }
  .conta-form-grid { grid-template-columns: 1fr; }
  .conta-head > div { min-width: 0; }
  .conta-head-actions { width: 100%; }
  .conta-head-actions button { flex: 1 1 0; min-width: 0; }
  .conta-acoes button { flex: 1; }
  .total-hero.compact { min-width: 0; width: 100%; }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .toast, .no-print { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; }
  .panel, .grid-panel { box-shadow: none; }
}
