/* Camada visual consolidada - ITExpress v1.7 */
:root {
  --pv-bg: #f3f6fa;
  --pv-surface: #ffffff;
  --pv-surface-soft: #f8fafc;
  --pv-border: #d9e3ef;
  --pv-border-strong: #c5d2e2;
  --pv-text: #0f172a;
  --pv-muted: #607089;
  --pv-navy: #0b1628;
  --pv-navy-soft: #13233c;
  --pv-blue: #2563eb;
  --pv-blue-soft: #eaf2ff;
  --pv-green: #059669;
  --pv-green-soft: #e7f8f1;
  --pv-orange: #d97706;
  --pv-orange-soft: #fff4df;
  --pv-red: #dc2626;
  --pv-red-soft: #feecec;
  --pv-shadow: 0 10px 26px rgba(15, 23, 42, .07);
  --pv-radius: 8px;
  --pv-sidebar: 272px;
  --pv-sidebar-mini: 80px;
}

html { background: var(--pv-bg); }
body {
  margin: 0;
  color: var(--pv-text);
  background: var(--pv-bg);
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
a { color: inherit; }

.layout {
  display: grid;
  grid-template-columns: var(--pv-sidebar) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--pv-bg);
  transition: grid-template-columns .2s ease;
}
.layout.sidebar-collapsed { grid-template-columns: var(--pv-sidebar-mini) minmax(0, 1fr); }
.content { min-width: 0; padding: 22px 24px 36px; }

.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: auto;
  height: 100vh;
  min-width: 0;
  padding: 18px 14px 16px;
  overflow: hidden;
  color: #e9f0fa;
  background: var(--pv-navy);
  border-right: 1px solid rgba(255,255,255,.07);
}
.sidebar-head {
  position: relative;
  flex: 0 0 auto;
}
.sidebar-logo-card {
  display: grid;
  place-items: center;
  min-height: 78px;
  margin: 0 0 14px;
  padding: 12px 48px 12px 12px;
  background: #fff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--pv-radius);
}
.sidebar-logo-card .side-logo { width: auto; max-width: 136px; height: 48px; object-fit: contain; }
.premium-user-box {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  gap: 3px;
  margin-bottom: 14px;
  padding: 13px 14px 13px 17px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--pv-radius);
  overflow: hidden;
}
.premium-user-box::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--pv-blue); }
.premium-user-box .user-box-label,
.nav-section-label {
  color: #8fa2bd;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.premium-user-box strong { color: #fff; font-size: 14px; }
.premium-user-box > span:last-child { color: #aebbd0; font-size: 12px; }
.module-nav {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  gap: 4px;
  margin-right: -5px;
  padding-right: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #455773 transparent;
}
.module-nav::-webkit-scrollbar { width: 5px; }
.module-nav::-webkit-scrollbar-track { background: transparent; }
.module-nav::-webkit-scrollbar-thumb { border-radius: 999px; background: #455773; }
.nav-section-label { display: block; margin: 14px 10px 5px; }
.module-nav a,
.sidebar .exit {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  color: #dce6f3;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 7px;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.module-nav a:hover, .sidebar .exit:hover { color: #fff; background: rgba(255,255,255,.07); }
.module-nav a.active {
  color: #fff;
  background: #173363;
  border-color: #31558b;
  box-shadow: inset 3px 0 0 #65a2ff;
}
.rh-module-nav a.active { background: #0a433e; border-color: #17645b; box-shadow: inset 3px 0 0 #34d399; }
.module-nav a.featured-nav-link:not(.active) { color: #d8fff3; background: rgba(5,150,105,.1); border-color: rgba(52,211,153,.18); }
.nav-ico {
  display: inline-grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #b8cff3;
  background: rgba(37,99,235,.13);
  border: 1px solid rgba(96,165,250,.16);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.rh-sidebar .nav-ico { color: #8ee4cb; background: rgba(5,150,105,.14); border-color: rgba(52,211,153,.17); }
.module-nav a.active .nav-ico { color: #1d4ed8; background: #eaf2ff; border-color: #b9d3ff; }
.rh-module-nav a.active .nav-ico { color: #047857; background: #dff8ee; border-color: #a7ead4; }
.sidebar .itexpress-badge { flex: 0 0 auto; margin-top: 12px; border-radius: var(--pv-radius); }
.sidebar .exit { flex: 0 0 auto; margin-top: 12px; background: rgba(255,255,255,.045); }
.sidebar-toggle {
  position: absolute;
  z-index: 4;
  top: 50%;
  right: 10px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  color: #fff;
  background: #12213a;
  border: 1px solid #324865;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(2,8,23,.2);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.sidebar-toggle:hover { color: #fff; border-color: #7aa7ff; background: #245bd7; }
.rh-sidebar .sidebar-toggle:hover { border-color: #64d7b8; background: #087f68; }
.layout.sidebar-collapsed .sidebar-head { display: grid; min-height: 50px; place-items: center; }
.layout.sidebar-collapsed .sidebar-toggle { position: static; transform: none; }
.layout.sidebar-collapsed .sidebar-logo-card { display: none; }
.layout.sidebar-collapsed .sidebar-head {
  position: relative;
  flex: 0 0 auto;
}
.layout.sidebar-collapsed .side-logo { max-width: 45px; height: 34px; }
.layout.sidebar-collapsed .premium-user-box,
.layout.sidebar-collapsed .nav-section-label { display: none; }
.layout.sidebar-collapsed .module-nav a,
.layout.sidebar-collapsed .sidebar .exit { justify-content: center; padding-inline: 5px; }
.layout.sidebar-collapsed .module-nav a > span:last-child,
.layout.sidebar-collapsed .sidebar .exit > span:last-child { display: none; }
.layout.sidebar-collapsed .sidebar .itexpress-badge { padding: 7px; }

.module-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  margin-bottom: 18px;
  padding: 12px 16px;
  background: var(--pv-surface);
  border: 1px solid var(--pv-border);
  border-radius: var(--pv-radius);
  box-shadow: var(--pv-shadow);
}
.module-topbar-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.module-topbar-brand img { width: 74px; height: 42px; object-fit: contain; }
.module-topbar-brand > div { display: grid; gap: 2px; }
.module-topbar-brand strong { color: var(--pv-text); font-size: 15px; }
.module-topbar-brand span { color: var(--pv-muted); font-size: 12px; font-weight: 600; }
.module-topbar-status, .module-topbar-actions { display: flex; align-items: center; gap: 9px; }
.topbar-clock-card {
  display: grid;
  min-width: 205px;
  padding: 7px 12px;
  text-align: right;
  background: var(--pv-surface-soft);
  border: 1px solid var(--pv-border);
  border-radius: 7px;
}
.topbar-clock-card span { color: var(--pv-muted); font-size: 10px; font-weight: 700; text-transform: capitalize; }
.topbar-clock-card strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.module-topbar-actions a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 12px;
  color: var(--pv-text);
  font-weight: 700;
  text-decoration: none;
  background: #f1f5f9;
  border: 1px solid var(--pv-border);
  border-radius: 7px;
}

.panel, .card, .metric-card, .dashboard-card, .table-panel, .form-card,
.hero-panel, .section-card, .summary-card, .workflow-card, .premium-card,
[class*="-panel"], [class*="-card"] {
  border-radius: var(--pv-radius);
}
.panel, .card, .table-panel, .form-card, .section-card, .summary-card, .workflow-card, .premium-card {
  border-color: var(--pv-border);
  box-shadow: var(--pv-shadow);
}
.hero-panel, .page-hero, .dashboard-hero, .module-hero {
  border-radius: var(--pv-radius);
  box-shadow: var(--pv-shadow);
}
.page-title, h1, h2, h3 { letter-spacing: 0; }
h1 { font-size: clamp(28px, 3vw, 38px); line-height: 1.08; }
h2 { font-size: 21px; line-height: 1.2; }
h3 { font-size: 16px; line-height: 1.25; }
.eyebrow, .section-kicker { letter-spacing: .07em; }

button, .btn, .button, a.btn, input[type="submit"] {
  min-height: 40px;
  border-radius: 7px;
  letter-spacing: 0;
}
input, select, textarea {
  width: 100%;
  min-height: 40px;
  color: var(--pv-text);
  background: #fff;
  border: 1px solid var(--pv-border-strong);
  border-radius: 7px;
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(37,99,235,.12);
  border-color: #6b9df8;
}
textarea { min-height: 88px; resize: vertical; }
label { color: #26364d; font-weight: 700; }

.table-wrap, .responsive-table, .table-scroll { width: 100%; overflow-x: auto; border-radius: var(--pv-radius); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th {
  padding: 11px 12px;
  color: #465770;
  background: #edf2f8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  text-align: left;
  text-transform: uppercase;
}
td { padding: 11px 12px; border-bottom: 1px solid #e6edf5; vertical-align: middle; }
tbody tr:hover { background: #f8fbff; }

.metric-card, .summary-card, .dashboard-card {
  min-height: 112px;
  background: var(--pv-surface);
  border: 1px solid var(--pv-border);
}
.metric-card { border-top: 3px solid var(--pv-blue); }
.metric-card.success, .metric-card.green { border-top-color: var(--pv-green); }
.metric-card.warning, .metric-card.orange { border-top-color: var(--pv-orange); }
.metric-card.danger, .metric-card.red { border-top-color: var(--pv-red); }
.status, .badge, .pill, [class*="status-"] { border-radius: 999px; }

.mobile-menu-toggle, .sidebar-backdrop { display: none; }
.mobile-menu-toggle {
  position: fixed;
  z-index: 70;
  top: 13px;
  left: 14px;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: var(--pv-navy);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 7px;
  box-shadow: 0 6px 18px rgba(15,23,42,.18);
}
.mobile-menu-toggle span { display: block; width: 20px; height: 2px; margin: 4px 0; background: #fff; border-radius: 2px; transition: transform .18s ease, opacity .18s ease; }

@media (max-width: 1100px) {
  :root { --pv-sidebar: 244px; }
  .content { padding: 18px; }
  .module-topbar-actions span:not(.nav-ico) { display: none; }
  .module-topbar-actions a { width: 40px; padding: 5px; justify-content: center; }
}

@media (max-width: 900px) {
  body.mobile-nav-open { overflow: hidden; }
  .layout, .layout.sidebar-collapsed { display: block; min-height: 100vh; }
  .content { width: 100%; padding: 72px 14px 28px; }
  .sidebar, .layout.sidebar-collapsed .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 65;
    width: min(84vw, 300px);
    height: 100dvh;
    padding: 18px 14px;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 16px 0 36px rgba(2,8,23,.25);
  }
  .layout.mobile-nav-open .sidebar { transform: translateX(0); }
  .mobile-menu-toggle, .sidebar-backdrop { display: block; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 60; visibility: hidden; opacity: 0; background: rgba(2,8,23,.52); transition: opacity .2s ease, visibility .2s ease; }
  .layout.mobile-nav-open .sidebar-backdrop { visibility: visible; opacity: 1; }
  .layout.mobile-nav-open .mobile-menu-toggle { left: min(calc(84vw - 52px), 248px); background: #fff; }
  .layout.mobile-nav-open .mobile-menu-toggle span { background: var(--pv-navy); }
  .layout.mobile-nav-open .mobile-menu-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .layout.mobile-nav-open .mobile-menu-toggle span:nth-child(2) { opacity: 0; }
  .layout.mobile-nav-open .mobile-menu-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .sidebar-toggle { display: none !important; }
  .layout.sidebar-collapsed .premium-user-box, .layout.sidebar-collapsed .nav-section-label { display: grid; }
  .layout.sidebar-collapsed .nav-section-label { display: block; }
  .layout.sidebar-collapsed .module-nav a, .layout.sidebar-collapsed .sidebar .exit { justify-content: flex-start; padding: 7px 10px; }
  .layout.sidebar-collapsed .module-nav a > span:last-child, .layout.sidebar-collapsed .sidebar .exit > span:last-child { display: inline; }
  .layout.sidebar-collapsed .sidebar-head {
  position: relative;
  flex: 0 0 auto;
}
.sidebar-logo-card { min-height: 78px; padding: 12px; }
  .layout.sidebar-collapsed .sidebar-logo-card { display: grid; }
  .layout.sidebar-collapsed .side-logo { max-width: 136px; height: 48px; }
  .module-topbar { position: relative; min-height: 58px; margin: -58px 0 16px 48px; padding: 8px 10px; }
  .module-topbar-brand img { display: none; }
  .module-topbar-brand strong { font-size: 14px; }
  .module-topbar-brand span { font-size: 11px; }
  .topbar-clock-card { min-width: 116px; padding: 5px 8px; }
  .topbar-clock-card span { display: none; }
  .topbar-clock-card strong { font-size: 16px; }
  .module-topbar-actions { display: none; }
  .dashboard-grid, .metrics-grid, .summary-grid, .stats-grid, .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .hero-panel, .page-hero, .dashboard-hero, .module-hero { padding: 22px !important; }
}

@media (max-width: 600px) {
  body { font-size: 13px; }
  .content { padding-inline: 10px; }
  .module-topbar { margin-right: 0; }
  h1 { font-size: 27px; }
  h2 { font-size: 19px; }
  .dashboard-grid, .metrics-grid, .summary-grid, .stats-grid, .form-grid { grid-template-columns: 1fr !important; }
  .metric-card, .summary-card, .dashboard-card { min-height: 96px; }
  .actions, .form-actions, .toolbar, .filters, .filter-row { flex-wrap: wrap; }
  .actions > *, .form-actions > *, .toolbar > *, .filters > *, .filter-row > * { max-width: 100%; }
  .hero-panel, .page-hero, .dashboard-hero, .module-hero { padding: 18px !important; }
  th, td { padding: 9px 10px; }
}

@media print {
  .sidebar, .mobile-menu-toggle, .sidebar-backdrop, .module-topbar, .no-print { display: none !important; }
  .layout, .layout.sidebar-collapsed { display: block; }
  .content { padding: 0; }
}
/* Central install controls. Ponto Mobile keeps its existing PWA flow. */
.central-v2-actions { display: flex; align-items: center; gap: 10px; }
.central-v2-install { border: 1px solid #bfdbfe; border-radius: 10px; background: #eff6ff; color: #1d4ed8; padding: 9px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.central-v2-install:hover { background: #dbeafe; }
.central-pwa-dialog[hidden] { display: none; }
.central-pwa-dialog { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: rgba(15, 23, 42, .45); }
.central-pwa-dialog-card { width: min(420px, 100%); border: 1px solid #dbe5f1; border-radius: 16px; background: #fff; padding: 22px; box-shadow: 0 20px 60px rgba(15, 23, 42, .25); }
.central-pwa-dialog-card strong { display: block; color: #0f172a; font-size: 18px; }
.central-pwa-dialog-card p { margin: 10px 0 18px; color: #475569; line-height: 1.5; }
.central-pwa-dialog-card button { border: 0; border-radius: 9px; background: #0f172a; color: #fff; padding: 10px 14px; font: inherit; font-weight: 700; cursor: pointer; }
@media (max-width: 680px) { .central-v2-actions { gap: 6px; } .central-v2-install { padding: 8px 9px; font-size: 12px; } }