[x-cloak] { display: none !important; }

/* Layout estilo ssOtica: sidebar + area de trabalho */
.app-shell { display: flex; min-height: 100vh; background: #eef1f6; }
.app-sidebar {
  width: 15.5rem; flex-shrink: 0; background: linear-gradient(180deg, #1e3a5f 0%, #152a45 100%);
  color: #e2e8f0; display: flex; flex-direction: column; padding: 0;
}
.sidebar-brand {
  padding: 1.1rem 1rem; font-weight: 800; font-size: 1rem; letter-spacing: .02em;
  border-bottom: 1px solid rgba(255,255,255,.08); color: #fff;
}
.sidebar-brand small { display: block; font-weight: 500; font-size: .68rem; color: #94a3b8; margin-top: .2rem; }
.app-sidebar nav { flex: 1; padding: .65rem .5rem; overflow-y: auto; }
.app-sidebar nav button {
  display: flex; align-items: center; width: 100%; text-align: left;
  font-size: .84rem; font-weight: 600; color: #cbd5e1; border-radius: .5rem;
  padding: .55rem .75rem; margin-bottom: .15rem;
}
.app-sidebar nav button:hover { background: rgba(255,255,255,.08); color: #fff; }
.app-sidebar nav button.active { background: #2563eb; color: #fff; }
.sidebar-section {
  font-size: .65rem; text-transform: uppercase; letter-spacing: .08em;
  color: #64748b; padding: .75rem .75rem .35rem; margin-top: .35rem;
}
.app-sidebar nav button.danger-zone { color: #fca5a5; }
.app-sidebar nav button.danger-zone.active { background: #991b1b; color: #fff; }
.sidebar-version {
  flex-shrink: 0;
  padding: .75rem 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .62rem;
  color: #64748b;
  letter-spacing: .03em;
  line-height: 1.35;
  word-break: break-all;
}
.sidebar-version-login {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .68rem;
  color: #64748b;
}
.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.app-topbar {
  background: #fff; border-bottom: 1px solid #e2e8f0; padding: .65rem 1.25rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
}
.app-topbar-title { font-weight: 700; font-size: 1.05rem; color: #1e293b; }
.app-topbar-meta { font-size: .75rem; color: #64748b; }
.app-workspace { flex: 1; padding: 1.25rem; overflow-x: auto; }
.page-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: .5rem;
  padding: 1.25rem 1.5rem; margin-bottom: 1rem; box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.page-title { font-size: 1.15rem; font-weight: 700; color: #1e293b; margin: 0; }

.bonus-grid-scroll { position: relative; }
.bonus-grid-table { border-collapse: separate; border-spacing: 0; }
.bonus-grid-thead { position: sticky; top: 0; z-index: 10; }
.bonus-grid-thead th {
  position: sticky; top: 0;
  background: #fff;
  box-shadow: 0 1px 0 #e2e8f0;
}
.bonus-grid-thead th.sticky.left-0 { z-index: 20; }
.page-desc { font-size: .85rem; color: #64748b; margin-top: .35rem; }
.page-section-title {
  font-size: .95rem; font-weight: 700; color: #334155;
  padding-bottom: .5rem; margin-bottom: 1rem; border-bottom: 1px solid #e2e8f0;
}
.rules-subnav { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.rules-subnav button {
  font-size: .78rem; font-weight: 600; border-radius: .4rem; padding: .4rem .7rem;
  background: #fff; border: 1px solid #cbd5e1; color: #475569;
}
.rules-subnav button.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.criteria-grid { display: grid; gap: .75rem; }
@media (min-width: 768px) { .criteria-grid { grid-template-columns: repeat(2, 1fr); } }
.criteria-item {
  border: 1px solid #e2e8f0; border-radius: .5rem; padding: .85rem 1rem; background: #f8fafc;
}
.criteria-item strong { display: block; color: #1e293b; font-size: .88rem; margin-bottom: .25rem; }
.criteria-item p { font-size: .8rem; color: #64748b; margin: 0; }
.env-banner {
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: .4rem .75rem;
}
.env-banner-local { background: #dbeafe; color: #1e40af; }
.env-banner-homolog { background: #fef3c7; color: #92400e; }

.perm-matrix th { font-size: .75rem; }
.perm-yes { color: #0d9488; }
.perm-no { color: #cbd5e1; }
.perm-profile-card {
  border-radius: .75rem; padding: .85rem 1rem; border: 1px solid #e2e8f0;
  background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.06);
}
.perm-profile-superadmin { border-color: #a78bfa; background: linear-gradient(135deg, #f5f3ff, #fff); }
.perm-profile-admin { border-color: #38bdf8; background: linear-gradient(135deg, #f0f9ff, #fff); }
.perm-profile-manager { border-color: #fbbf24; background: linear-gradient(135deg, #fffbeb, #fff); }
.perm-profile-viewer { border-color: #94a3b8; background: linear-gradient(135deg, #f8fafc, #fff); }
.card { background: white; border: 1px solid #e2e8f0; border-radius: 1rem; padding: 1rem; box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05); }
.input { width: 100%; border: 1px solid #cbd5e1; border-radius: .75rem; padding: .6rem .75rem; font-size: .9rem; }
.input:focus { outline: none; border-color: #14b8a6; box-shadow: 0 0 0 3px rgba(20, 184, 166, .15); }
.input-error { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, .12); }
.label { font-size: .8rem; color: #475569; display: block; margin-bottom: .25rem; }
.btn-primary { background: #0d9488; color: white; border-radius: .75rem; padding: .55rem .85rem; display: inline-flex; align-items: center; font-size: .85rem; font-weight: 600; }
.btn-primary:hover { background: #0f766e; }
.btn-secondary { background: #e2e8f0; color: #1e293b; border-radius: .75rem; padding: .55rem .85rem; display: inline-flex; align-items: center; font-size: .85rem; font-weight: 600; }
.tab-active { background: #0d9488 !important; color: white !important; }
.nav-main { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.nav-op.tab-active { background: #0d9488 !important; color: #fff !important; }
.nav-config.tab-active { background: #475569 !important; color: #fff !important; }
.config-layout { display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 768px) {
  .config-layout { flex-direction: row; align-items: flex-start; }
}
.config-sidebar {
  display: flex; flex-direction: row; flex-wrap: wrap; gap: .35rem;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: .9rem; padding: .5rem;
}
@media (min-width: 768px) {
  .config-sidebar { flex-direction: column; min-width: 13rem; flex-shrink: 0; }
}
.config-sidebar button {
  text-align: left; font-size: .82rem; font-weight: 600; color: #475569;
  border-radius: .65rem; padding: .45rem .65rem; width: 100%;
}
.config-sidebar button:hover { background: #e2e8f0; }
.config-sidebar button.active { background: #334155; color: #fff; }
.config-sidebar button.danger-zone { color: #b91c1c; }
.motor-subnav { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.motor-subnav button {
  font-size: .8rem; font-weight: 600; border-radius: 999px; padding: .35rem .75rem;
  background: #e2e8f0; color: #334155;
}
.motor-subnav button.active { background: #0d9488; color: #fff; }
.period-banner {
  border-radius: .9rem; border: 1px solid #fcd34d; background: #fffbeb;
  color: #92400e; padding: .65rem .85rem; font-size: .84rem;
}
.dashboard-mode { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.dashboard-mode button {
  font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .3rem .65rem;
  background: #f1f5f9; color: #475569;
}
.dashboard-mode button.active { background: #ccfbf1; color: #0f766e; }
.highlight-tabs { display: flex; gap: .35rem; margin-bottom: .75rem; }
.highlight-tabs button {
  font-size: .78rem; font-weight: 600; border-radius: .55rem; padding: .35rem .7rem;
  background: #f1f5f9; color: #475569;
}
.highlight-tabs button.active { background: #0d9488; color: #fff; }
.empty-period {
  border: 1px dashed #cbd5e1; border-radius: .9rem; padding: 1.25rem; text-align: center;
  color: #64748b; font-size: .88rem;
}
.modal { position: fixed; inset: 0; background: rgba(2, 6, 23, .5); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 50; }
.modal-box { width: 100%; max-width: 28rem; background: white; border-radius: 1rem; padding: 1rem; box-shadow: 0 20px 50px rgba(15, 23, 42, .25); }
.badge { font-size: .72rem; border-radius: 999px; padding: .15rem .5rem; font-weight: 700; }
.badge-ok { background: #dcfce7; color: #166534; }
.badge-off { background: #fee2e2; color: #991b1b; }
.badge-warn { background: #fef3c7; color: #b45309; }
.help-box { position: sticky; top: .75rem; z-index: 20; background: #f0fdfa; border: 1px solid #99f6e4; color: #0f766e; border-radius: .9rem; padding: .75rem .9rem; font-size: .82rem; }
.help-tip { display: inline-flex; align-items: center; justify-content: center; width: 1rem; height: 1rem; margin-left: .35rem; border-radius: 999px; background: #ccfbf1; color: #0f766e; font-size: .72rem; font-weight: 700; cursor: help; }
.toast-wrap { position: fixed; right: 1rem; bottom: 1rem; z-index: 60; display: flex; flex-direction: column; gap: .5rem; }
.toast { color: #fff; border-radius: .75rem; padding: .55rem .75rem; font-size: .82rem; box-shadow: 0 12px 28px rgba(15, 23, 42, .2); }
.toast-ok { background: #059669; }
.toast-err { background: #dc2626; }

.print-only { display: none; }

/* Rodapé (padrão ERP Clínica NDXN) */
.app-footer, .login-footer {
  border-top: 1px solid #e2e8f0;
  background: #fff;
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-shrink: 0;
  font-size: .75rem;
  color: #94a3b8;
}
.app-version-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .7rem;
  background: #f1f5f9;
  color: #64748b;
  padding: .2rem .5rem;
  border-radius: .35rem;
}

/* Login split (estilo ssOtica) */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
@media (min-width: 900px) {
  .login-page { flex-direction: row; }
}
.login-promo {
  position: relative;
  flex: 1 1 58%;
  min-height: 14rem;
  background: #0f172a;
  overflow: hidden;
}
@media (min-width: 900px) {
  .login-promo { min-height: 100vh; }
}
.login-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .8s ease-in-out;
  pointer-events: none;
}
.login-slide-active { opacity: 1; z-index: 1; }
.login-slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.login-slide-bg-0 {
  background-color: #1a1208;
  background-image: url('./images/login/slide-gestao.png');
}
.login-slide-bg-1 {
  background-color: #0f172a;
  background-image: url('./images/login/slide-ndxn.png');
}
.login-slide-dots {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: .45rem;
}
.login-slide-dot {
  width: .5rem;
  height: .5rem;
  border-radius: 999px;
  background: rgba(255,255,255,.35);
}
.login-slide-dot.active { background: #fff; width: 1.25rem; }
.login-panel {
  flex: 1 1 42%;
  display: flex;
  flex-direction: column;
  background: #fff;
  min-height: 100vh;
}
.login-panel-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 2.5rem;
  max-width: 28rem;
  margin: 0 auto;
  width: 100%;
}
.login-brand { text-align: center; margin-bottom: 2rem; }
.login-brand-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto .85rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #0d9488, #2563eb);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 99, 235, .25);
}
.login-brand-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.login-brand-by {
  display: block;
  font-size: .95rem;
  font-weight: 600;
  color: #64748b;
  margin-top: .15rem;
}
.login-brand-tagline {
  font-size: .85rem;
  color: #94a3b8;
  margin-top: .35rem;
}
.login-form { display: flex; flex-direction: column; gap: 1rem; }
.login-submit {
  width: 100%;
  margin-top: .25rem;
  padding: .85rem 1rem;
  border-radius: .5rem;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: background .15s;
}
.login-submit:hover:not(:disabled) { background: #1d4ed8; }
.login-submit:disabled { opacity: .6; cursor: not-allowed; }

@media print {
  body { background: #fff !important; }
  .no-print { display: none !important; }
  .print-only { display: block !important; }
  .print-commissions-detail { display: none !important; }
  body.print-mode-summary .print-block-summary { display: block !important; }
  body.print-mode-summary .print-commissions-detail { display: none !important; }
  body.print-mode-employee .print-block-summary { display: none !important; }
  body.print-mode-employee .print-commissions-detail { display: block !important; }
  body.print-mode-employee {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    padding: 0.75rem !important;
  }
  .commissions-table { font-size: 10pt; }
  .commissions-table th,
  .commissions-table td { padding: 0.35rem 0.25rem !important; }
  .card { box-shadow: none !important; border: 1px solid #e2e8f0 !important; }

  .print-sheet-pair {
    display: flex;
    flex-direction: row;
    width: 100%;
    min-height: calc(100vh - 16mm);
    page-break-after: always;
    break-after: page;
    align-items: stretch;
  }
  .print-sheet-pair:last-child {
    page-break-after: auto;
    break-after: auto;
  }
  .print-holerite-panel {
    width: 50%;
    box-sizing: border-box;
    padding: 6mm 5mm;
    border-right: 1px dashed #94a3b8;
    font-size: 8.5pt;
    line-height: 1.35;
    overflow: hidden;
  }
  .print-holerite-panel:last-child {
    border-right: none;
  }
  .print-holerite-brand {
    font-size: 7pt;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #0f766e;
    font-weight: 700;
    margin: 0 0 2mm;
  }
  .print-holerite-period {
    font-size: 8pt;
    color: #64748b;
    margin: 0 0 3mm;
  }
  .print-holerite-name {
    font-size: 11pt;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2mm;
    border-bottom: 2px solid #0d9488;
    padding-bottom: 2mm;
  }
  .print-holerite-meta {
    font-size: 8pt;
    color: #475569;
    margin: 0 0 1.5mm;
  }
  .print-holerite-group {
    margin-top: 3mm;
  }
  .print-holerite-group-title {
    font-size: 7pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #334155;
    margin: 0 0 1.5mm;
  }
  .print-holerite-lines {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .print-holerite-lines li {
    border-bottom: 1px solid #e2e8f0;
    padding: 1mm 0;
    font-size: 8pt;
  }
  .print-holerite-total {
    margin-top: 4mm;
    padding-top: 2mm;
    border-top: 2px solid #0f172a;
    font-size: 10pt;
    font-weight: 700;
    color: #0f766e;
  }
}

.print-commissions-detail {
  display: none;
}
