:root {
  --bg-body: #0B1220;
  --bg-surface: #111A2B;
  --bg-surface-2: #162235;
  --bg-sidebar: #0E1728;

  --text-primary: #F3F7FC;
  --text-secondary: #B7C4D6;
  --text-muted: #8393A8;

  --border-light: rgba(255,255,255,0.08);
  --border-card: rgba(255,255,255,0.07);

  --accent: #6E93B7;
  --accent-strong: #87A9CA;
  --accent-soft: rgba(110,147,183,0.14);

  --accent-gold: #C9A47D;
  --green: #58B09C;
  --red: #D46A72;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.22), 0 1px 2px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.28);

  --radius-card: 20px;
  --radius-elem: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(80,110,145,0.10), transparent 22%),
    linear-gradient(180deg, #0A1220 0%, #0C1524 100%);
  color: var(--text-primary);
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
}

/* LAYOUT PRINCIPAL */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 280px;
  background: linear-gradient(180deg, #0C1627 0%, #0E182B 100%);
  border-right: 1px solid var(--border-light);
  padding: 28px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.sidebar-logo-mark {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #243B5A, #34557E);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 26px;
  color: white;
  border: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo-mark span {
  color: #E8D8C8;
}

/* Símbolo NOV desenhado integralmente em CSS. */
.sidebar-logo-mark,
.topbar-brand-mark {
  position: relative;
  overflow: hidden;
  color: transparent !important;
  background-color: #355a78 !important;
  background-image: none !important;
  text-indent: -9999px;
  text-shadow: none !important;
}

.sidebar-logo-mark::before,
.topbar-brand-mark::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  clip-path: polygon(
    18% 22%,
    31% 22%,
    82% 78%,
    69% 78%,
    31% 37%,
    31% 78%,
    18% 78%
  );
}

.sidebar-logo-mark::after,
.topbar-brand-mark::after {
  content: '';
  position: absolute;
  top: 22%;
  right: 18%;
  width: 15%;
  height: 17%;
  background: #fff;
}

.sidebar-brand {
  font-weight: 700;
  font-size: 20px;
  color: var(--text-primary);
}

.sidebar small {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar nav a {
  padding: 12px 16px;
  border-radius: var(--radius-elem);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.sidebar nav a.active,
.sidebar nav a:hover {
  background: rgba(255,255,255,0.05);
  color: #FFFFFF;
  border-color: rgba(255,255,255,0.06);
}

/* MAIN */
.app-main {
  flex: 1;
  padding: 28px 32px;
  min-width: 0;
}

/* TOPBAR */
.topbar.app-like {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
  background: linear-gradient(180deg, rgba(19,30,48,0.98), rgba(17,26,43,0.98));
  border: 1px solid var(--border-card);
  border-radius: 24px;
  padding: 16px 24px;
  box-shadow: var(--shadow-sm);
}

/* O topo deve acompanhar toda a largura útil da área principal. */
.app-main > .topbar.app-like {
  width: auto;
  max-width: none;
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-chip {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 24px;
  color: #F5F8FC;
  border: 1px solid rgba(255,255,255,0.06);
}

.brand-chip span {
  color: var(--accent-gold);
}

.crumb {
  background: rgba(255,255,255,0.05);
  color: var(--accent-gold);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 40px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: inline-block;
}

.topbar h1 {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.topbar small {
  color: var(--text-secondary);
  font-size: 14px;
}

.topbar-user-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 60px;
  padding: 8px 16px 8px 12px;
}

.avatar {
  width: 44px;
  height: 44px;
  background: #1E2C40;
  border-radius: 50%;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23B5C3D4"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
  background-size: 55%;
  background-position: center 55%;
  background-repeat: no-repeat;
}

.topbar-user-card strong {
  font-size: 14px;
  display: block;
}

.topbar-user-card span,
.topbar-user-card small {
  font-size: 12px;
  color: var(--text-muted);
}

/* GRID E CARDS */
.grid {
  display: grid;
  gap: 20px;
}

.cards-4 {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 28px;
}

.cards-3 {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 28px;
}

.cards-2,
.two-columns {
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 28px;
}

.card {
  background: linear-gradient(180deg, #121D2F 0%, #10192A 100%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255,255,255,0.10);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.big-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 8px 0 4px;
  line-height: 1.2;
}

.danger-text {
  color: #FF9DA6;
}

.success-text {
  color: #8BE0C9;
}

.warning-text {
  color: #F0C18D;
}

.muted {
  color: var(--text-muted);
  font-size: 13px;
}

/* KPI */
.kpi {
  position: relative;
}

.kpi .hint {
  display: block;
  color: var(--text-muted);
  margin-top: 6px;
  font-size: 12px;
}

.kpi-link {
  display: block;
  transition: all 0.15s ease;
}

.kpi-link:hover {
  transform: translateY(-2px);
}

/* BOTÕES */
.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #456A93, #5A81AA);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 40px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  gap: 8px;
}

.button:hover,
button:hover {
  background: linear-gradient(135deg, #5078A3, #6A92BC);
  transform: translateY(-1px);
}

.button.light {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  box-shadow: none;
}

.button.light:hover {
  background: rgba(255,255,255,0.06);
  transform: none;
}

.button.success {
  background: #3C8D7A;
}

.button.warning {
  background: #B68B5C;
}

.button.danger {
  background: #C4555E;
}

.button.small {
  padding: 6px 14px;
  font-size: 12px;
}

.button.full {
  width: 100%;
}

/* BADGES */
.badge {
  padding: 4px 10px;
  border-radius: 40px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge.success {
  background: rgba(88,176,156,0.14);
  color: #8BE0C9;
}

.badge.danger {
  background: rgba(212,106,114,0.14);
  color: #FFB2B8;
}

.badge.warning {
  background: rgba(201,164,125,0.14);
  color: #F0C18D;
}

.badge.info {
  background: rgba(110,147,183,0.14);
  color: #AFC7DE;
}

.badge.gray {
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
}

/* TABELAS */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
}

.table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

/* FORMULÁRIOS */
.form-card input,
.form-card select,
.form-card textarea,
.inline-form input,
.inline-form select,
.inline-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-elem);
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.15s;
}

.form-card input::placeholder,
.form-card textarea::placeholder {
  color: var(--text-muted);
}

.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus,
.inline-form input:focus,
.inline-form select:focus,
.inline-form textarea:focus {
  outline: none;
  border-color: rgba(135,169,202,0.55);
  box-shadow: 0 0 0 3px rgba(110,147,183,0.14);
}

.form-card label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: block;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

.inline-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 12px 0;
}

.checkbox-item {
  background: rgba(255,255,255,0.03);
  padding: 12px;
  border-radius: var(--radius-elem);
  border: 1px solid var(--border-light);
}

/* SELECTS */
select {
  -webkit-appearance: auto;
  -moz-appearance: auto;
  appearance: auto;
  background-color: rgba(255,255,255,0.03);
  cursor: pointer;
}

select option {
  background: #ffffff;
  color: #1E2A3E;
}

/* LOGIN ESCURO HARMONIZADO */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(80,110,145,0.18), transparent 24%),
    linear-gradient(180deg, #0A1220 0%, #0B1423 100%);
}

.login-shell {
  width: min(1100px, 94vw);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.login-hero,
.login-card {
  border-radius: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-md);
  padding: 40px;
}

.login-hero {
  background: linear-gradient(135deg, #121E30 0%, #162338 100%);
}

.login-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #456A93, #5A81AA);
  border-radius: 18px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
}

.login-hero h1 {
  font-size: 32px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.login-hero p {
  color: var(--text-secondary);
}

.login-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-elem);
  margin: 8px 0 16px;
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
}

.login-card button {
  width: 100%;
  margin-top: 8px;
}

/* UTILIDADES */
.media-card {
  display: flex;
  gap: 16px;
  align-items: center;
}

.logo-box {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.meta-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meta-line {
  display: flex;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.app-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border-card);
}

.calendar-box {
  background: var(--bg-surface);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--border-card);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.cal-day,
.cal-head {
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 8px;
  text-align: center;
}

.cal-head {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
}

.cal-day .day-number {
  font-weight: 600;
  margin-bottom: 4px;
}

.cal-event {
  background: rgba(110,147,183,0.14);
  color: #BFD4E8;
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 11px;
  margin-top: 4px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot.success {
  background: var(--green);
}

.status-dot.warning {
  background: var(--accent-gold);
}

.status-dot.danger {
  background: var(--red);
}

.ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ticket-msg {
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  padding: 14px;
  border: 1px solid var(--border-light);
}

.ticket-msg.staff {
  background: rgba(110,147,183,0.10);
}

.empty-state,
.list-empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  border-radius: 16px;
  border: 1px dashed var(--border-light);
}

/* RESPONSIVO */
@media (max-width: 1100px) {
  .cards-4,
  .cards-3,
  .cards-2,
  .two-columns {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar {
    width: 260px;
  }
}

@media (max-width: 860px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 16px;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }

  .sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .sidebar nav a {
    padding: 8px 14px;
  }

  .app-main {
    padding: 20px;
  }

  .cards-4,
  .cards-3,
  .cards-2,
  .two-columns {
    grid-template-columns: 1fr;
  }

  .topbar.app-like {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-user-card {
    justify-content: center;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}





























.topbar-with-theme{
  position: relative;
}

.topbar-right-area{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:10px;
}

.theme-switcher{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 8px;
  border-radius:999px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
  backdrop-filter:blur(8px);
}

.theme-btn{
  width:14px;
  height:14px;
  border-radius:50%;
  border:none;
  padding:0;
  min-width:14px;
  min-height:14px;
  line-height:14px;
  font-size:0;
  cursor:pointer;
  transition:transform .18s ease, opacity .18s ease, box-shadow .18s ease;
  opacity:.55;
  box-shadow:0 0 0 1px rgba(255,255,255,.18);
}

.theme-btn[data-theme="escuro"]{
  background:linear-gradient(135deg,#0b1220,#243b5a);
}

.theme-btn[data-theme="claro"]{
  background:linear-gradient(135deg,#f8fbff,#dbe7f5);
  box-shadow:0 0 0 1px rgba(24,36,51,.18);
}

.theme-btn:hover{
  transform:scale(1.08);
  opacity:.85;
}

.theme-btn.active{
  opacity:1;
  transform:scale(1.12);
  box-shadow:0 0 0 2px rgba(110,147,183,.35);
}

.theme-btn:focus{
  outline:none;
}

@media (max-width: 860px){
  .topbar-right-area{
    width:100%;
    align-items:flex-start;
  }
}





















/* ===== BLOQUEIO VISUAL DE MÓDULOS CONTRATÁVEIS ===== */

.modulo-bloqueado {
    position: relative !important;
    overflow: hidden !important;
    opacity: 1 !important;
    filter: grayscale(1) saturate(.35) !important;
    border: 1px solid rgba(15,23,42,.18) !important;
    cursor: pointer !important;
}

.modulo-bloqueado::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(1.5px);
    z-index: 2;
    pointer-events: none;
}

.modulo-bloqueado::before {
    content: 'Módulo bloqueado';
    position: absolute;
    left: 18px;
    bottom: 16px;
    z-index: 4;
    background: rgba(15, 23, 42, .92);
    color: #fff;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .2px;
    box-shadow: 0 10px 24px rgba(15,23,42,.28);
    pointer-events: none;
}

.modulo-bloqueado .modulo-lock {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 12px 28px rgba(15,23,42,.35);
    border: 2px solid rgba(255,255,255,.75);
    font-size: 17px;
    pointer-events: none;
}

.modulo-bloqueado:hover {
    transform: none !important;
    box-shadow: var(--shadow-sm) !important;
}

.modulo-bloqueado-menu {
    opacity: .55;
    filter: grayscale(1);
    position: relative;
}

.modulo-bloqueado-menu::after {
    content: 'bloqueado';
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(15,23,42,.12);
    color: inherit;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.modulo-bloqueado-menu i {
    margin-right: 8px;
}

/* ===== CAMADAS GLOBAIS DE MODAIS =====
 * Header e sidebar usam camadas acima de 10000. Os overlays ficam sempre
 * acima deles, inclusive nas páginas antigas que ainda usam nomes próprios.
 */
.modal,
.modal-overlay,
.env-modal-overlay,
.cert-modal-overlay,
.rg-modal-overlay,
.assdet-modal,
.ma-modal,
.catalog-modal,
.modal-baixa,
.finrel-modal-backdrop,
.nc-modal-backdrop,
.nfe-op-modal,
.nfe-transp-modal,
.nfe-modal,
.nfse-modal,
.no-modal,
.comunicado-overlay,
#novWelcomeOverlay,
#novBirthdayOverlay {
    z-index: 110000 !important;
}

.modal-backdrop {
    z-index: 109990 !important;
}

/* ===== MARCA NOV NO LOGIN =====
 * O login não usa body.nov-ui-2026 nem as classes do header/sidebar.
 * Esta regra aplica o mesmo símbolo ao bloco .login-brand-mark.
 */
body.login-body .login-brand-mark {
    position: relative !important;
    overflow: hidden !important;
    border-color: rgba(255, 255, 255, .38) !important;
    color: transparent !important;
    background-color: #355a78 !important;
    background-image: none !important;
    box-shadow: none !important;
    text-indent: -9999px !important;
    text-shadow: none !important;
}

body.login-body .login-brand-mark::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #fff;
    clip-path: polygon(
        18% 22%,
        31% 22%,
        82% 78%,
        69% 78%,
        31% 37%,
        31% 78%,
        18% 78%
    );
}

body.login-body .login-brand-mark::after {
    content: '';
    position: absolute;
    top: 22%;
    right: 18%;
    width: 15%;
    height: 17%;
    background: #fff;
}
