:root {
  --bg: #100624;
  --card: rgba(33, 18, 63, 0.82);
  --text: #f3edff;
  --muted: #c5b7e9;
  --primary: #8b5cf6;
  --accent: #4f8dff;
  --line: rgba(197, 165, 255, 0.24);
  --surface-soft: rgba(255, 255, 255, 0.06);
  --radius-sm: 16px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --shadow-soft: 0 12px 28px rgba(10, 2, 23, 0.38);
  --shadow-strong: 0 24px 54px rgba(8, 2, 17, 0.56);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, Roboto, "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(75vw 48vw at 0% -8%, rgba(145, 91, 255, 0.42), transparent 66%),
    radial-gradient(72vw 48vw at 100% 0%, rgba(98, 153, 255, 0.26), transparent 64%),
    radial-gradient(95vw 80vw at 50% 100%, rgba(107, 41, 185, 0.28), transparent 65%),
    var(--bg);
  padding: 12px;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

small,
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.form-grid,
.filter-grid {
  display: grid;
  gap: 10px;
}

input,
select,
button {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  color: var(--text);
  font: inherit;
  background: rgba(255, 255, 255, 0.07);
}

input::placeholder {
  color: rgba(230, 220, 255, 0.62);
}

input:focus,
select:focus {
  outline: 2px solid rgba(139, 92, 246, 0.35);
  border-color: rgba(139, 92, 246, 0.5);
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
}

.btn-soft {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(211, 69, 133, 0.28);
  color: #fff;
  border-color: rgba(255, 164, 205, 0.45);
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.88);
  color: #2d1455;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(12, 5, 24, 0.3);
}

.btn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #201142;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.32);
}

button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.alert {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 10px 0;
}

.alert-error {
  border: 1px solid rgba(255, 121, 171, 0.5);
  background: rgba(214, 48, 128, 0.18);
  color: #ffd6ea;
}

.alert-success {
  border: 1px solid rgba(111, 255, 190, 0.42);
  background: rgba(7, 143, 93, 0.2);
  color: #d8ffe9;
}

.alert-inline {
  font-size: 12px;
}

.alert-inline--error {
  color: #ffd6ea;
}

/* Auth */
.auth-wrap {
  min-height: calc(100vh - 24px);
  display: grid;
  place-items: center;
  padding: 12px;
}

.auth-card {
  position: relative;
  overflow: hidden;
  width: min(460px, 100%);
  padding: clamp(22px, 4vw, 30px);
  border-radius: 30px;
  display: grid;
  gap: 16px;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120px 80px at 92% 6%, rgba(158, 202, 255, 0.22), transparent 75%),
    radial-gradient(160px 100px at -8% -10%, rgba(160, 98, 255, 0.22), transparent 70%);
}

.auth-brand {
  display: grid;
  gap: 10px;
  text-align: left;
  position: relative;
  z-index: 1;
}

.auth-brand--center {
  justify-items: center;
  text-align: center;
}

.auth-logo-wrap {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
}

.auth-logo-wrap--center {
  width: 100%;
  justify-content: center;
}

.auth-logo {
  display: block;
  width: clamp(170px, 46vw, 250px);
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.auth-logo--large {
  width: clamp(260px, 72vw, 360px);
}

.auth-subtitle {
  color: var(--muted);
  max-width: 48ch;
  line-height: 1.4;
}

.auth-subtitle--center {
  text-align: center;
}

.auth-title-sm {
  font-size: clamp(1.3rem, 4.4vw, 1.7rem);
}

.auth-form {
  gap: 14px;
  position: relative;
  z-index: 1;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.auth-label {
  font-size: 12px;
  font-weight: 700;
  color: #ddceff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-hint {
  color: rgba(222, 205, 255, 0.7);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.auth-input {
  border-radius: 12px;
  min-height: 48px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(198, 165, 255, 0.28);
}

.auth-input--with-action {
  padding-right: 50px;
}

.auth-input:focus {
  border-color: rgba(145, 184, 255, 0.6);
  outline: 2px solid rgba(105, 155, 255, 0.3);
}

.auth-password-wrap {
  position: relative;
}

.auth-password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(194, 163, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #f4edff;
  font-size: 16px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.auth-password-icon {
  display: inline-grid;
  place-items: center;
  line-height: 0;
}

.auth-password-toggle:hover {
  filter: brightness(1.08);
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
  min-height: 48px;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.auth-forgot-btn {
  justify-self: center;
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  color: #ddccff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.auth-forgot-btn:hover {
  text-decoration: underline;
}

.auth-forgot-form {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(194, 163, 255, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.auth-forgot-form[hidden] {
  display: none;
}

.auth-forgot-submit {
  min-height: 44px;
}

.auth-status {
  text-align: center;
  color: rgba(230, 220, 255, 0.85);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.auth-meta {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(201, 174, 255, 0.2);
  padding-top: 12px;
  display: grid;
  gap: 6px;
}

.auth-credit {
  color: rgba(222, 205, 255, 0.82);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.45;
}

[data-login-submit][data-loading="1"],
[data-reset-submit][data-loading="1"] {
  position: relative;
}

[data-login-submit][data-loading="1"]::after,
[data-reset-submit][data-loading="1"]::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  display: inline-block;
  margin-left: 8px;
  vertical-align: -2px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Shell */
.app-shell,
.admin-shell {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: calc(100vh - 24px);
  max-width: 440px;
  margin: 0 auto;
  border-radius: 34px;
  border: 1px solid rgba(164, 126, 255, 0.35);
  background:
    radial-gradient(120% 95% at 85% -8%, rgba(158, 98, 255, 0.24), transparent),
    linear-gradient(180deg, rgba(25, 10, 48, 0.96), rgba(14, 5, 31, 0.97));
  box-shadow: var(--shadow-strong);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.neon-card {
  border: 1px solid rgba(201, 174, 255, 0.22);
  background: linear-gradient(180deg, rgba(56, 31, 95, 0.9), rgba(30, 17, 58, 0.86));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(2px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  color: #fff;
  background: linear-gradient(120deg, rgba(78, 35, 140, 0.86), rgba(55, 98, 184, 0.72));
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
}

.topbar.is-scrolled {
  box-shadow: 0 10px 24px rgba(9, 4, 18, 0.45);
}

.brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.16);
}

.brand-stack {
  display: grid;
  gap: 2px;
}

.brand {
  font-size: 15px;
}

.brand-subtitle {
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
}

.company-switch form {
  display: grid;
  gap: 4px;
  width: 100%;
}

.company-switch label {
  color: rgba(255, 255, 255, 0.83);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.company-switch select {
  width: 100%;
  max-width: 100%;
  min-width: min(300px, 72vw);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.company-switch option {
  color: #231247;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.profile-chip {
  max-width: 47vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  border-radius: 999px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 560px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .brand-wrap,
  .company-switch {
    width: 100%;
    min-width: 0;
  }

  .company-switch select {
    min-width: 0;
  }

  .topbar-actions {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  .topbar-actions form {
    justify-self: end;
  }

  .profile-chip {
    max-width: 100%;
    min-width: 0;
  }

  .filter-inline .btn {
    width: 100%;
  }
}

.main-grid {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: 1fr;
  min-width: 0;
}

.sidebar {
  display: none;
}

.content,
.admin-content {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 16px;
  min-width: 0;
}

.content {
  padding-bottom: calc(var(--bottom-nav-h, 92px) + 12px);
}

.panel {
  border: 1px solid rgba(201, 174, 255, 0.22);
  background: linear-gradient(180deg, rgba(56, 31, 95, 0.9), rgba(30, 17, 58, 0.86));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(2px);
  border-radius: var(--radius-md);
  padding: 18px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.page-hero {
  background:
    radial-gradient(120% 120% at 95% -6%, rgba(163, 95, 255, 0.24), transparent),
    linear-gradient(180deg, rgba(59, 31, 104, 0.92), rgba(31, 16, 60, 0.92));
}

.hero-panel {
  background:
    radial-gradient(120% 120% at 95% -6%, rgba(163, 95, 255, 0.24), transparent),
    linear-gradient(180deg, rgba(59, 31, 104, 0.92), rgba(31, 16, 60, 0.92));
}

.page-hero h1 {
  font-size: clamp(1.35rem, 4.6vw, 1.85rem);
}

.page-hero p {
  color: var(--muted);
}

.module-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgba(201, 174, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #f2e9ff;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.module-back-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(214, 194, 255, 0.55);
}

.module-back-link__icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
}

.module-back-link__label {
  white-space: nowrap;
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 22px;
  background: linear-gradient(135deg, rgba(128, 73, 247, 0.95), rgba(61, 116, 235, 0.94));
  box-shadow: var(--shadow-soft);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
}

.hero-kicker {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.08em;
}

.hero-card h1 {
  font-size: clamp(1.5rem, 5vw, 2rem);
}

.hero-card p {
  color: rgba(255, 255, 255, 0.93);
  max-width: 56ch;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.hero-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.26);
}

.hero-orb {
  position: absolute;
  right: -60px;
  top: -76px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent 70%);
}

.card-grid,
.module-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.card,
.module-card,
.card-ficha {
  border-radius: var(--radius-md);
  padding: 18px;
  display: grid;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.module-card,
.card-ficha {
  min-height: 214px;
}

.module-card::after,
.card-ficha::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  right: -54px;
  top: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 72%);
}

.module-card--home {
  isolation: isolate;
  transition:
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 260ms ease,
    filter 260ms ease;
}

.module-card--home::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)),
    radial-gradient(180px 120px at 85% 12%, rgba(255, 255, 255, 0.2), transparent);
  opacity: 0;
  transition: opacity 260ms ease;
  pointer-events: none;
  z-index: 0;
}

.module-card--home > * {
  position: relative;
  z-index: 1;
}

.module-card--home:hover,
.module-card--home:focus-within {
  transform: translateY(-8px) scale(1.012);
  box-shadow: 0 24px 44px rgba(9, 4, 20, 0.45);
  filter: saturate(1.08);
}

.module-card--home:hover::before,
.module-card--home:focus-within::before {
  opacity: 1;
}

.module-card--home:hover .btn-action,
.module-card--home:focus-within .btn-action {
  transform: translateY(-2px);
}

.module-card--contabil {
  background: linear-gradient(140deg, rgba(236, 110, 58, 0.92), rgba(183, 86, 40, 0.88));
}

.module-card--fiscal {
  background: linear-gradient(140deg, rgba(78, 121, 224, 0.92), rgba(58, 85, 161, 0.88));
}

.module-card--pessoal {
  background: linear-gradient(140deg, rgba(53, 151, 182, 0.92), rgba(35, 107, 128, 0.88));
}

.module-card--societario {
  background: linear-gradient(140deg, rgba(109, 66, 183, 0.92), rgba(78, 45, 138, 0.88));
}

.module-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.module-card h3,
.card-ficha h3 {
  font-size: clamp(1.18rem, 4.3vw, 1.45rem);
}

.module-card p,
.card-ficha p {
  color: rgba(255, 255, 255, 0.9);
}

.chip {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #f3ecff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.filter-inline {
  grid-template-columns: 1fr;
  align-items: end;
  min-width: 0;
}

.filter-inline > * {
  min-width: 0;
}

.muted-text {
  color: var(--muted);
}

.admin-form-grid {
  margin-top: 8px;
}

.admin-field-row {
  display: grid;
  gap: 6px;
}

.admin-field-row label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-inline-input {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.btn-inline-lookup {
  width: fit-content;
  white-space: nowrap;
}

.cnpj-feedback {
  font-size: 12px;
  color: var(--muted);
}

.cnpj-feedback.is-success {
  color: #d8ffe9;
}

.cnpj-feedback.is-error {
  color: #ffd6ea;
}

.cnpj-preview {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.cnpj-preview p {
  font-size: 12px;
}

.admin-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.admin-actions-grid {
  display: grid;
  gap: 8px;
}

.inline-form {
  display: grid;
  gap: 6px;
}

.inline-form label {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.metric-card {
  border-radius: var(--radius-sm);
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.metric-card h3 {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-card p {
  margin-top: 8px;
  font-size: clamp(1.22rem, 4.2vw, 1.58rem);
  font-weight: 800;
}

.metric-card small {
  color: var(--muted);
}

.metric-receita {
  background: linear-gradient(180deg, rgba(78, 172, 132, 0.18), rgba(255, 255, 255, 0.05));
}

.metric-despesa {
  background: linear-gradient(180deg, rgba(223, 96, 139, 0.16), rgba(255, 255, 255, 0.05));
}

.metric-resultado {
  background: linear-gradient(180deg, rgba(115, 122, 250, 0.15), rgba(255, 255, 255, 0.05));
}

.chart-wrap {
  position: relative;
  width: 100%;
  min-height: 280px;
}

.record-list {
  display: grid;
  gap: 10px;
}

.record-card {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: linear-gradient(140deg, rgba(108, 66, 190, 0.5), rgba(43, 24, 87, 0.65));
  padding: 14px;
  display: grid;
  gap: 8px;
}

.record-list .record-card:nth-child(3n + 1) {
  background: linear-gradient(140deg, rgba(230, 116, 70, 0.6), rgba(132, 55, 36, 0.66));
}

.record-list .record-card:nth-child(3n + 2) {
  background: linear-gradient(140deg, rgba(74, 126, 225, 0.55), rgba(43, 64, 124, 0.66));
}

.record-list .record-card:nth-child(3n + 3) {
  background: linear-gradient(140deg, rgba(68, 164, 191, 0.52), rgba(37, 88, 105, 0.66));
}

.record-card--upload {
  background: linear-gradient(140deg, rgba(120, 86, 205, 0.52), rgba(56, 35, 101, 0.66));
}

.record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.record-head h3 {
  font-size: 1.05rem;
}

.record-status,
.record-period {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.14);
}

.record-card p {
  color: rgba(238, 228, 255, 0.86);
  font-size: 13px;
}

.record-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.record-muted {
  font-size: 13px;
  color: rgba(236, 227, 255, 0.78);
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 11px 8px;
  font-size: 14px;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table .actions {
  display: inline-flex;
  gap: 8px;
}

.table .actions a {
  color: #d8c6ff;
  font-weight: 700;
}

.empty-state {
  color: var(--muted);
  padding: 8px 2px;
}

.upload-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

progress {
  width: 100%;
  max-width: 240px;
}

.viewer-placeholder {
  min-height: 260px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: all 0.16s ease;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-link.is-active {
  color: #fff;
  background: rgba(139, 92, 246, 0.35);
  border-color: rgba(203, 177, 255, 0.45);
}

.nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.nav-text {
  font-size: 14px;
  font-weight: 700;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, calc(100% - 24px));
  bottom: 18px;
  z-index: 70;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border-radius: 20px;
  border: 1px solid rgba(199, 162, 255, 0.42);
  background: linear-gradient(140deg, rgba(48, 20, 93, 0.96), rgba(32, 68, 150, 0.93));
  box-shadow: 0 14px 34px rgba(7, 2, 16, 0.48);
}

.bottom-nav.bottom-nav--admin {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.bottom-nav a {
  border-radius: 12px;
  padding: 8px 4px;
  text-align: center;
  color: rgba(243, 233, 255, 0.84);
  display: grid;
  justify-items: center;
  gap: 2px;
  font-weight: 700;
  transition: all 0.16s ease;
}

.bottom-nav a.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.nav-mobile-icon {
  font-size: 10px;
  letter-spacing: 0.05em;
  font-weight: 800;
}

.nav-mobile-label {
  font-size: 10px;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9999;
  display: grid;
  gap: 8px;
}

.toast {
  min-width: 220px;
  max-width: 320px;
  border-radius: 12px;
  padding: 11px 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.35);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast-info {
  background: #5b21b6;
}

.toast-success {
  background: #047857;
}

.toast-error {
  background: #be123c;
}

.toast-hide {
  opacity: 0;
  transform: translateY(-4px);
}

/* Reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 280ms ease, transform 280ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .module-card--home,
  .module-card--home::before,
  .module-card--home .btn-action {
    transition: none;
  }

  .module-card--home:hover,
  .module-card--home:focus-within {
    transform: none;
  }
}

@media (min-width: 768px) {
  body {
    padding: 0;
  }

  .app-shell,
  .admin-shell {
    max-width: none;
    margin: 0;
    border-radius: 0;
    border: 0;
    min-height: 100vh;
  }

  .content,
  .admin-content {
    padding: 20px;
  }

  .module-grid,
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-inline {
    grid-template-columns: 120px 180px 120px;
    gap: 12px;
  }

  .admin-inline-input {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

@media (min-width: 769px) {
  .main-grid {
    grid-template-columns: 230px 1fr;
  }

  .sidebar {
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 16px 10px;
    background: linear-gradient(180deg, rgba(33, 16, 66, 0.88), rgba(20, 10, 40, 0.9));
    border-right: 1px solid rgba(192, 156, 255, 0.2);
  }

  .bottom-nav {
    display: none;
  }

  .content {
    padding-bottom: 24px;
  }

  .company-switch select {
    min-width: 280px;
  }
}

@media (min-width: 1200px) {
  .topbar {
    padding: 14px 20px;
  }

  .module-grid,
  .card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
