/*
 * Master Rimivo — adaptação administrativa dos tokens do site institucional.
 * Este arquivo é deliberadamente aditivo: não altera contratos, endpoints ou
 * comportamentos do painel legado.
 */
:root,
:root[data-theme="light"],
:root[data-theme="dark"] {
  --blue: #3260fd;
  --blue-dark: #2749d1;
  --blue-soft: #eaf0ff;
  --orange: #b4780a;
  --green: #17a883;
  --red: #c23b4a;
  --border: #e3e5f0;
  --muted: #686f91;
  --surface: #fff;
  --surface-soft: #f6f7fc;
  --line: #eceef6;
  --text: #0b1233;
  --purple: #3260fd;
  --purple-soft: #eaf0ff;
  color: var(--text);
  background: var(--surface-soft);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html,
body,
:root[data-theme="dark"] html,
:root[data-theme="dark"] body {
  background: var(--surface-soft);
  color: var(--text);
}

.app-shell { background: var(--surface-soft); }
.sidebar,
:root[data-theme="dark"] .sidebar {
  width: 260px;
  flex-basis: 260px;
  padding: 24px 16px 18px;
  background:
    radial-gradient(circle at 15% 90%, rgba(50, 96, 253, .28), transparent 34%),
    #0b1233;
}
.brand {
  min-height: 64px;
  gap: 12px;
  margin: 0 2px 24px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: rgba(255, 255, 255, .07);
}
.brand img {
  width: 92px;
  height: auto;
  padding: 7px;
  object-fit: contain;
  border-radius: 9px;
  background: #fff;
}
.brand strong { font-size: 14px; letter-spacing: -.01em; }
.brand small { color: #aeb7dc; font-size: 10px; }
.nav { gap: 7px; }
.nav button {
  display: flex;
  align-items: center;
  min-height: 46px;
  color: #cbd1ea;
  padding: 12px 13px;
  border-radius: 10px;
  font-weight: 650;
}
.nav button::before { background: transparent; }
.nav button:hover,
.nav button:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, .08);
  box-shadow: none;
  transform: none;
}
.nav button.active {
  color: #fff;
  background: #3260fd;
  box-shadow: 0 10px 24px rgba(50, 96, 253, .25);
}
.nav button.active::before { background: #fff; }
.nav em { margin-left: auto; color: #0b1233; background: #f2b84b; }
.sidebar-footer { color: #8f99bd; line-height: 1.6; }
.sidebar-footer strong { color: #fff; }

.workspace { background: var(--surface-soft); }
.topbar {
  height: 82px;
  padding: 0 clamp(20px, 3vw, 44px);
  border-color: var(--border);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(14px);
}
.topbar-title { gap: 14px; }
.topbar-title img {
  display: none;
  width: 90px;
  height: auto;
  object-fit: contain;
}
.topbar-title small {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.topbar h1 { color: var(--text); font-size: 18px; letter-spacing: -.02em; }
.avatar { color: #2749d1; background: #eaf0ff; }
.logout,
:root[data-theme="dark"] .logout {
  color: var(--text);
  border-color: var(--border);
  border-radius: 999px;
  background: #fff;
}
.logout:hover { border-color: #aeb5d1; }
.content { max-width: 1520px; padding: clamp(24px, 4vw, 48px); }
.eyebrow { color: #3260fd; letter-spacing: .12em; }
h2 { margin-top: 9px; color: var(--text); font-size: clamp(26px, 3vw, 38px); letter-spacing: -.035em; }
h3 { color: var(--text); }
.subtitle { max-width: 760px; color: var(--muted); }

.panel,
.metric,
.license-card {
  border-color: var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 26px rgba(11, 18, 51, .045);
}
.metric { padding: 20px; }
.metric .icon { color: #3260fd; background: #eaf0ff; }
.metric strong { color: var(--text); letter-spacing: -.04em; }
.metric small,
.table a,
.serial { color: #2749d1; }
.cards { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.compact-cards { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.table th { color: #737999; border-color: var(--border); }
.table td { color: var(--text); border-color: var(--line); }
.table tbody tr:hover,
:root[data-theme="dark"] .table tbody tr:hover { background: #f8f9fd; }
.search input,
.toolbar select,
.field input,
.modal-field input,
:root[data-theme="dark"] .search input,
:root[data-theme="dark"] .toolbar select,
:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .modal-field input {
  color: var(--text);
  border-color: var(--border);
  border-radius: 10px;
  background: #fff;
}
.search input:focus,
.toolbar select:focus,
.field input:focus,
.modal-field input:focus {
  border-color: #3260fd;
  outline: 3px solid rgba(50, 96, 253, .14);
}
.btn {
  border-radius: 999px;
  background: #0b1233;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover,
.btn:focus-visible { background: #3260fd; outline: 3px solid rgba(50, 96, 253, .2); }
.btn:active { transform: translateY(1px); }
.btn.secondary,
:root[data-theme="dark"] .btn.secondary {
  color: #0b1233;
  border-color: #cbcfe3;
  background: #fff;
}
.btn.secondary:hover { color: #2749d1; border-color: #3260fd; background: #f7f9ff; }
.btn.warning { color: #fff; background: #a66e08; }
.btn.danger { background: #b92e40; }
.copy { color: #2749d1; background: #eaf0ff; }
.badge { font-weight: 750; }
.badge.paid,
.badge.valid,
.badge.active { color: #087a5e; background: #e1f9f1; }
.badge.pending,
.badge.due_soon,
.badge.overdue { color: #8a5904; background: #fff3dc; }
.badge.expired,
.badge.blocked { color: #9b2534; background: #fdecef; }
.badge.trial { color: #2749d1; background: #eaf0ff; }

.product-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}
.product-card {
  position: relative;
  min-height: 190px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(11, 18, 51, .045);
}
.product-card::after {
  content: "";
  position: absolute;
  right: -32px;
  top: -32px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: #eaf0ff;
}
.product-card > span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.product-card h3 { margin: 9px 0 18px; font-size: 19px; }
.product-card strong { display: inline-block; margin-right: 7px; color: var(--text); font-size: 34px; letter-spacing: -.05em; }
.product-card small { color: var(--muted); }
.product-card .btn { display: block; width: max-content; margin-top: 18px; }
.product-emassa { border-top: 4px solid #ff6a1a; }
.product-emassa::after { background: #fff0e7; }
.product-entrega { border-top: 4px solid #3260fd; }
.product-future { color: var(--muted); border-style: dashed; background: transparent; box-shadow: none; }
.product-future::after { display: none; }
.product-future p { max-width: 230px; font-size: 13px; line-height: 1.5; }

.emassa-tabs { gap: 8px; }
.emassa-tabs button {
  min-height: 40px;
  color: #4b5170;
  border-color: var(--border);
  background: #fff;
}
.emassa-tabs button.active { border-color: #0b1233; background: #0b1233; }
.emassa-count { background: #eef0f7; }
.emassa-panel { padding: 8px 16px 16px; }
.emassa-table { min-width: 1180px; }
.emassa-table th:first-child { width: 18%; }
.emassa-table th:nth-child(2) { width: 15%; }
.emassa-table th:nth-child(4) { width: 18%; }
.emassa-more-menu { border-color: var(--border); border-radius: 12px; box-shadow: 0 18px 44px rgba(11, 18, 51, .14); }

.login-wrap,
:root[data-theme="dark"] .login-wrap {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(50, 96, 253, .16), transparent 27%),
    radial-gradient(circle at 90% 90%, rgba(23, 168, 131, .12), transparent 26%),
    #f6f7fc;
}
.login-wrap::before {
  content: "";
  position: absolute;
  left: clamp(18px, 4.5vw, 86px);
  top: 50%;
  width: min(40vw, 620px);
  aspect-ratio: 620 / 760;
  background: url("assets/rimivo-login-mark.svg") center / contain no-repeat;
  transform: translateY(-50%);
  user-select: none;
  pointer-events: none;
}
.login-wrap::after {
  content: none;
}
.login-card {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  margin-left: min(38vw, 490px);
  padding: 42px;
  border-color: var(--border);
  border-radius: 20px;
  box-shadow: 0 28px 70px rgba(11, 18, 51, .13);
}
.login-brand { text-align: left; }
.login-brand img { width: 132px; height: auto; margin-bottom: 30px; }
.login-kicker { display: block; color: #3260fd; font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.login-brand h1 { margin: 8px 0; color: var(--text); font-size: 28px; letter-spacing: -.035em; }
.login-brand p { margin: 0; color: var(--muted); }
.login-form { margin-top: 30px; }
.login-form .btn { min-height: 45px; }
.master-modal-backdrop { background: rgba(11, 18, 51, .66); backdrop-filter: blur(3px); }
.master-modal-card { border-color: var(--border); border-radius: 18px; box-shadow: 0 30px 80px rgba(11, 18, 51, .25); }
.master-modal-card h3,
.master-modal-body,
.modal-field,
:root[data-theme="dark"] .master-modal-card h3,
:root[data-theme="dark"] .master-modal-body,
:root[data-theme="dark"] .modal-field { color: var(--text); }
.toast { border-radius: 12px; background: #0b1233; }

@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .product-overview { grid-template-columns: repeat(2, 1fr); }
  .product-future { grid-column: 1 / -1; min-height: 120px; }
}
@media (max-width: 900px) {
  .sidebar { width: 82px; flex-basis: 82px; padding-inline: 10px; }
  .brand { justify-content: center; padding: 8px 5px; }
  .brand img { width: 48px; }
  .brand div,
  .sidebar-footer { display: none; }
  .nav button { justify-content: center; font-size: 0; padding-inline: 8px; }
  .nav button::first-letter { font-size: 20px; }
  .nav button::before { display: none; }
  .topbar-title img { display: block; }
}
@media (max-width: 700px) {
  .topbar { height: 70px; padding-inline: 14px; }
  .topbar-title img { width: 70px; }
  .topbar-title small { display: none; }
  .topbar h1 { font-size: 14px; }
  .content { padding: 22px 14px; }
  .product-overview { grid-template-columns: 1fr; }
  .product-future { grid-column: auto; }
  .login-wrap::before { display: none; }
  .login-card { margin-left: 0; padding: 30px 24px; }
}
@media (max-width: 520px) {
  .sidebar { width: 66px; flex-basis: 66px; padding-inline: 7px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .master-user .avatar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; }
}
