/*
 * VKPro Consulta NF-e — linguagem visual 2026.
 * Camada exclusivamente visual: preserva rotas, dados e comportamentos do app.
 */
@font-face {
  font-family: "Inter VKPro";
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy: #213743;
  --navy-deep: #172d38;
  --navy-soft: #315363;
  --blue: #058194;
  --blue-dark: #046c7c;
  --cyan: #0698ae;
  --bg: #f3f8fa;
  --card: #ffffff;
  --text: #213743;
  --muted: #536c7b;
  --border: #cbdce4;
  --border-soft: #dde8ed;
  --success: #17795b;
  --success-bg: #e7f6f0;
  --warning: #9a630d;
  --warning-bg: #fff5df;
  --danger: #b84038;
  --danger-bg: #fff0ee;
  --shadow: 0 2px 7px rgba(33, 55, 67, .055);
  --shadow-lg: 0 20px 55px rgba(22, 54, 67, .18);
  --radius: 10px;
  --vk-sidebar: #edf8fb;
  --vk-surface-alt: #f7fbfc;
  --vk-accent-soft: #dff2f4;
  --vk-shell-gap: 7px;
  --vk-sidebar-width: 242px;
}

html {
  font-family: "Inter VKPro", Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--vk-sidebar);
}

body {
  background: var(--vk-sidebar);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* Estrutura principal */
.sidebar {
  top: 0;
  bottom: 0;
  width: var(--vk-sidebar-width);
  background: var(--vk-sidebar);
  border: 0;
  box-shadow: none;
}

.sidebar-brand {
  min-height: 78px;
  padding: 17px 17px 12px;
}

.sidebar-brand > a {
  gap: 11px;
}

.sidebar-brand small {
  color: var(--blue-dark);
  font-size: 8px;
  letter-spacing: .18em;
}

.sidebar-brand strong {
  color: var(--navy);
  font-size: 14px;
  letter-spacing: -.02em;
}

.vk-mark {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-radius: 11px;
  background: var(--blue);
  box-shadow: 0 6px 16px rgba(5, 129, 148, .17);
  font-size: 13px;
}

.sidebar .nav-label {
  padding: 18px 22px 7px;
  color: #748d99;
  font-size: 8px;
  letter-spacing: .16em;
}

.sidebar nav {
  padding: 0 10px;
}

.sidebar nav a,
.sidebar .nav-disabled {
  min-height: 41px;
  margin: 4px 0;
  padding: 10px 12px;
  gap: 11px;
  border-radius: 7px;
  color: #4d6876;
  font-size: 12px;
  font-weight: 650;
}

.sidebar nav a:hover {
  background: rgba(255, 255, 255, .72);
  color: var(--navy);
}

.sidebar nav a.active {
  background: var(--vk-accent-soft);
  color: var(--blue-dark);
}

.sidebar nav a.active::before {
  left: -10px;
  width: 3px;
  height: 23px;
  border-radius: 0 4px 4px 0;
  background: var(--blue);
}

.sidebar .nav-icon,
.sidebar a.active .nav-icon {
  color: currentColor;
}

.nav-icon,
.nav-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-status {
  margin: auto 11px 12px;
  padding: 12px;
  border-color: #cee6eb;
  border-radius: 9px;
  background: rgba(255, 255, 255, .66);
}

.sidebar-status b {
  color: var(--navy);
  font-size: 10px;
}

.sidebar-status small {
  color: var(--muted);
  font-size: 8px;
}

.status-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.sidebar-account {
  margin: 0 17px 10px;
  padding-top: 13px;
  border-color: #d5e8ed;
}

.sidebar-footer {
  padding: 0 18px 17px;
  color: #78909b;
}

.topbar {
  top: var(--vk-shell-gap);
  right: var(--vk-shell-gap);
  left: var(--vk-sidebar-width);
  height: 64px;
  padding: 0 21px;
  border: 1px solid var(--border);
  border-bottom-color: var(--border-soft);
  border-radius: 13px 13px 0 0;
  background: rgba(237, 248, 251, .96);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.product-context small {
  color: var(--blue-dark);
  font-size: 8px;
}

.product-context strong {
  margin-top: 1px;
  color: var(--navy);
  font-size: 15px;
}

.top-actions {
  gap: 10px;
}

.company-switcher label {
  gap: 2px;
}

.company-switcher label > span {
  font-size: 7px;
}

.company-switcher select {
  width: min(310px, 27vw);
  height: 36px;
  padding: 6px 32px 6px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .9);
  font-size: 10px;
}

.company-switcher select:focus,
.filters input:focus,
.filters select:focus,
.panel form input:focus,
.panel form select:focus,
.dashboard-filters input:focus,
.dashboard-filters select:focus,
.login-card input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(5, 129, 148, .11);
}

.theme-toggle,
.logout {
  width: 36px;
  min-height: 36px;
  height: 36px;
  padding: 5px;
  justify-content: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, .85);
}

.theme-toggle b {
  display: none;
}

.user-chip {
  gap: 8px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--blue-dark);
}

.user-chip b {
  font-size: 11px;
}

.user-chip small {
  font-size: 9px;
}

.main {
  min-height: calc(100vh - (var(--vk-shell-gap) * 2));
  max-width: none;
  margin: var(--vk-shell-gap) var(--vk-shell-gap) var(--vk-shell-gap) var(--vk-sidebar-width);
  padding: 92px 34px 27px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--bg);
}

/* Conteúdo e componentes */
.page-head {
  margin-bottom: 19px;
}

.page-head h1 {
  margin: 3px 0 5px;
  color: var(--navy);
  font-size: clamp(24px, 2.15vw, 30px);
  letter-spacing: -.045em;
}

.page-head p {
  color: var(--muted);
  font-size: 12px;
}

.eyebrow {
  color: var(--blue-dark) !important;
  font-size: 8px !important;
}

.button {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 11px;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--blue);
  box-shadow: 0 5px 13px rgba(5, 129, 148, .17);
}

.button.primary:hover {
  background: var(--blue-dark);
  box-shadow: 0 7px 16px rgba(5, 129, 148, .21);
}

.button.secondary {
  background: var(--card);
}

.stat,
.panel,
.table-panel,
.invoice-board,
.dashboard-filters,
.overview-sync-card,
.overview-details,
.company-card,
.document-frame-wrap {
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.stats-grid,
.overview-sync-grid {
  gap: 12px;
  margin-bottom: 15px;
}

.stat {
  min-height: 116px;
  padding: 17px;
}

.stat::after {
  display: none;
}

.stat span {
  color: var(--muted);
  font-size: 10px;
}

.stat strong {
  margin: 8px 0 5px;
  color: var(--navy);
  font-size: 24px;
}

.stat small {
  font-size: 9px;
}

.panel {
  padding: 19px;
  margin-bottom: 15px;
}

.panel h2,
.invoice-board-head h2 {
  color: var(--navy);
  font-size: 14px;
}

.notice {
  background: var(--card);
}

.notice::after {
  display: none;
}

.filters input,
.filters select,
.panel form input,
.panel form select,
.dashboard-filters input,
.dashboard-filters select,
.batch-email-dialog input[type=email] {
  height: 38px;
  border-color: var(--border);
  border-radius: 7px;
  background: var(--card);
}

.dashboard-filters {
  gap: 11px;
  margin-bottom: 14px;
  padding: 14px 15px;
}

.dashboard-filters label,
.filters label,
.panel form label {
  color: var(--muted);
  font-size: 9px;
}

.invoice-board-head {
  padding: 16px 18px;
}

th {
  padding: 11px 12px;
  background: var(--vk-surface-alt);
  color: var(--muted);
  font-size: 8px;
}

td {
  padding: 13px 12px;
  color: #405965;
}

tbody tr:hover {
  background: #f7fbfc;
}

.dashboard-table th:first-child,
.dashboard-table td:first-child {
  padding-left: 18px;
}

.dashboard-table th:last-child,
.dashboard-table td:last-child {
  padding-right: 18px;
}

.dashboard-table td {
  height: 68px;
}

.row-actions a,
.row-actions span {
  min-height: 30px;
  border-radius: 6px;
}

.row-actions .action-view {
  background: var(--blue);
  border-color: var(--blue);
}

.badge {
  padding: 4px 8px;
  font-size: 8px;
}

.alert,
.trial-notice,
.notice-inline,
.certificate,
.auto-sync-option {
  border-radius: 8px;
}

.overview-sync-card {
  padding: 14px 15px;
}

.overview-details > summary {
  min-height: 43px;
  padding: 11px 14px;
}

.company-card.selected {
  border-color: #78bfc9;
  box-shadow: 0 0 0 2px rgba(5, 129, 148, .08);
}

.company-card-mark,
.document-pill,
.badge.running {
  background: var(--vk-accent-soft);
  color: var(--blue-dark);
}

.document-frame-wrap {
  border-radius: 10px;
}

dialog {
  border-radius: 12px;
}

dialog::backdrop {
  background: rgba(23, 45, 56, .64);
}

/* Acesso: mesma linguagem, mantendo a marca VKPro. */
.guest {
  background:
    radial-gradient(circle at 14% 18%, rgba(5, 129, 148, .12), transparent 28rem),
    linear-gradient(135deg, #e6f5f7, #f8fbfc 48%, #deeff2);
}

.guest::before,
.guest::after {
  border-color: rgba(5, 129, 148, .055);
}

.login-card {
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: 0 22px 65px rgba(33, 55, 67, .16);
}

.login-card h1 {
  color: var(--navy);
}

.login-card input {
  border-color: var(--border);
  border-radius: 7px;
}

.remember-login input {
  accent-color: var(--blue);
}

/* Tema escuro correspondente, sem trocar a identidade. */
html[data-theme="dark"] {
  --navy: #e0edf2;
  --navy-deep: #0c1c24;
  --navy-soft: #244654;
  --blue: #35adbb;
  --blue-dark: #62c4cf;
  --cyan: #49c3d0;
  --bg: #10222b;
  --card: #192c37;
  --text: #e0edf2;
  --muted: #9db0ba;
  --border: #405c6c;
  --border-soft: #314b59;
  --vk-sidebar: #132630;
  --vk-surface-alt: #203540;
  --vk-accent-soft: #183f48;
  --shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] .main {
  background: var(--bg);
}

html[data-theme="dark"] body:not(.guest) {
  background: var(--vk-sidebar);
}

html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .topbar {
  background: var(--vk-sidebar);
  border-color: var(--border);
}

html[data-theme="dark"] .sidebar nav a:hover {
  background: rgba(255, 255, 255, .055);
}

html[data-theme="dark"] .sidebar nav a.active {
  background: var(--vk-accent-soft);
  color: var(--blue-dark);
}

html[data-theme="dark"] .sidebar-status {
  background: rgba(255, 255, 255, .035);
  border-color: var(--border);
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .table-panel,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .invoice-board,
html[data-theme="dark"] .dashboard-filters,
html[data-theme="dark"] .overview-sync-card,
html[data-theme="dark"] .overview-details,
html[data-theme="dark"] .company-card,
html[data-theme="dark"] dialog {
  background: var(--card);
}

html[data-theme="dark"] th {
  background: var(--vk-surface-alt);
}

html[data-theme="dark"] tbody tr:hover {
  background: #203640;
}

html[data-theme="dark"] .guest {
  background: linear-gradient(135deg, #10252d, #172f39 48%, #102229);
}

/* Responsividade do kit */
@media (max-width: 1250px) {
  .main {
    padding-right: 25px;
    padding-left: 25px;
  }

  .top-actions {
    gap: 7px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    z-index: 40;
    width: min(292px, 88vw);
    border-right: 1px solid var(--border);
  }

  .topbar {
    top: 0;
    right: 0;
    left: 0;
    height: 64px;
    padding: 0 14px;
    border-width: 0 0 1px;
    border-radius: 0;
  }

  .main {
    min-height: 100vh;
    margin: 0;
    padding-top: 87px;
    border: 0;
    border-radius: 0;
  }

  .scrim.show {
    inset: 0;
  }
}

@media (max-width: 760px) {
  .main {
    padding: 82px 17px 24px;
  }

  .page-head {
    gap: 14px;
    margin-bottom: 16px;
  }

  .page-head h1 {
    font-size: 24px;
  }

  table tr {
    border-radius: 9px;
    box-shadow: var(--shadow);
  }

  html[data-theme="dark"] table tr {
    background: var(--card);
  }
}

@media (max-width: 600px) {
  .main {
    padding-right: 13px;
    padding-left: 13px;
  }

  .product-context strong {
    font-size: 13px;
  }

  .company-switcher select {
    width: 39vw;
    max-width: 175px;
  }
}

@media (max-width: 430px) {
  .login-card {
    padding: 27px 22px;
  }
}
