/* MAVEX visual layer: presentation only. Do not place business logic here. */
:root {
  --mvx-ink: #12352f;
  --mvx-ink-2: #1f4d43;
  --mvx-copper: #b97028;
  --mvx-copper-soft: #f4e5d2;
  --mvx-paper: #fffdf8;
  --mvx-surface: rgba(255, 253, 248, .94);
  --mvx-surface-2: #f6f3eb;
  --mvx-line: #e2d8c7;
  --mvx-muted: #65746e;
  --mvx-shadow: 0 18px 48px rgba(18, 53, 47, .10);
  --mvx-bg-base: #f5f0e7;
  --mvx-bg-image-1: none;
  --mvx-bg-image-2: none;
  --mvx-bg-texture-opacity: .035;
  --mvx-sidebar-bg: linear-gradient(180deg, rgba(255,253,248,.98), rgba(247,243,235,.96));
  --primary: #12352f;
  --primary-2: #1f4d43;
  --bg: #f5f0e7;
  --surface: #fffdf8;
  --surface-2: #f6f3eb;
  --text: #12352f;
  --muted: #65746e;
  --line: #e2d8c7;
}

body {
  background:
    linear-gradient(90deg, rgba(18,53,47,var(--mvx-bg-texture-opacity)) 1px, transparent 1px),
    linear-gradient(180deg, rgba(18,53,47,calc(var(--mvx-bg-texture-opacity) * .72)) 1px, transparent 1px),
    var(--mvx-bg-image-1),
    var(--mvx-bg-image-2),
    radial-gradient(circle at 12% 12%, rgba(185,112,40,.12), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(31,77,67,.10), transparent 32%),
    linear-gradient(180deg, #fffdf8 0%, var(--mvx-bg-base) 100%) !important;
  background-size:
    32px 32px,
    32px 32px,
    cover,
    cover,
    auto,
    auto,
    auto !important;
  background-attachment:
    fixed,
    fixed,
    fixed,
    fixed,
    fixed,
    fixed,
    fixed !important;
}

#topbar {
  background: rgba(255, 253, 248, .90) !important;
  color: var(--mvx-ink) !important;
  border-bottom: 1px solid rgba(185,112,40,.20) !important;
  box-shadow: 0 10px 30px rgba(18,53,47,.08) !important;
  backdrop-filter: blur(18px);
}

.tb-logo-mark,
.logo-mark {
  background: #fff !important;
  border: 1px solid rgba(185,112,40,.35) !important;
  box-shadow: 0 12px 26px rgba(18,53,47,.10) !important;
}

#sidebar .logo-mark {
  width: 82px !important;
  height: 82px !important;
  min-width: 82px !important;
}

.tb-logo-mark svg { display: none; }
.tb-logo-mark::before,
.logo-mark::before,
.brand-mark::before {
  content: "";
  width: 24px;
  height: 24px;
  display: block;
  background: url("../img/mavex-icon-new.png") center / contain no-repeat;
}

#sidebar .logo-mark::before {
  width: 60px !important;
  height: 60px !important;
}

.logo-mark img { display: none !important; }

.mavex-editor-shell .sidebar-logo > img {
  display: none !important;
}

.tb-brand,
.logo-text,
.brand-title {
  color: var(--mvx-ink) !important;
  letter-spacing: .02em;
}

.tb-nav-item {
  color: rgba(18,53,47,.72) !important;
  border-radius: 999px;
}

.tb-nav-item.active,
.tb-nav-item:hover {
  color: var(--mvx-ink) !important;
  background: rgba(31,77,67,.10) !important;
}

.tb-badge,
.status-pill {
  color: var(--mvx-ink) !important;
  background: rgba(31,77,67,.08) !important;
  border: 1px solid rgba(31,77,67,.18) !important;
}

#sidebar {
  background: var(--mvx-sidebar-bg) !important;
  border-right: 1px solid rgba(185,112,40,.18) !important;
  box-shadow: 18px 0 45px rgba(18,53,47,.06) !important;
}

.nav-section {
  color: rgba(185,112,40,.90) !important;
  letter-spacing: .14em !important;
}

.nav-item {
  color: rgba(18,53,47,.72) !important;
  border-radius: 14px !important;
}

.nav-item.active,
.nav-item:hover {
  color: var(--mvx-ink) !important;
  background: rgba(31,77,67,.10) !important;
  border-color: rgba(31,77,67,.18) !important;
}

.card,
.modal,
.panel,
.hero,
.actions,
.detail-card,
.mve-detail {
  background: var(--mvx-surface) !important;
  border: 1px solid rgba(185,112,40,.18) !important;
  box-shadow: var(--mvx-shadow) !important;
}

.card-header,
.panel-head,
.detail-head {
  background: linear-gradient(180deg, rgba(255,253,248,.98), rgba(246,243,235,.92)) !important;
  border-bottom: 1px solid rgba(185,112,40,.18) !important;
}

.card-header h2,
.panel-head h2,
.detail-title {
  color: var(--mvx-ink) !important;
}

.form-label,
.stat-label,
.summary-label,
th {
  color: rgba(18,53,47,.68) !important;
}

.input,
.select,
select,
input[type="text"],
input[type="email"],
input[type="date"],
textarea {
  background: #fff !important;
  border-color: rgba(18,53,47,.18) !important;
  color: var(--mvx-ink) !important;
}

.input:focus,
.select:focus,
select:focus,
input:focus,
textarea:focus {
  border-color: rgba(185,112,40,.70) !important;
  box-shadow: 0 0 0 4px rgba(185,112,40,.14) !important;
}

.btn-primary,
.btn-success {
  background: linear-gradient(135deg, #12352f, #1f4d43) !important;
  color: #fffdf8 !important;
  border-color: transparent !important;
  box-shadow: 0 14px 32px rgba(18,53,47,.22) !important;
}

.btn-primary:hover,
.btn-success:hover {
  box-shadow: 0 18px 40px rgba(18,53,47,.28) !important;
}

.btn-ghost,
.btn-secondary {
  color: var(--mvx-ink) !important;
  background: rgba(255,253,248,.82) !important;
  border-color: rgba(18,53,47,.16) !important;
}

.btn-ghost:hover,
.btn-secondary:hover {
  background: rgba(31,77,67,.08) !important;
  border-color: rgba(31,77,67,.24) !important;
}

.stat-card {
  background: linear-gradient(180deg, #fffdf8, #f7f2e8) !important;
  border: 1px solid rgba(185,112,40,.18) !important;
  box-shadow: 0 14px 30px rgba(18,53,47,.08) !important;
}

.stat-value,
.summary-value {
  color: var(--mvx-ink) !important;
}

#stats-row {
  position: relative;
}

#stats-row::before {
  content: "Flujo operativo de manifestaciones";
  grid-column: 1 / -1;
  color: var(--mvx-copper);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin: 0 0 -4px 4px;
}

.tbl-toolbar {
  background: rgba(255,253,248,.84) !important;
  border-color: rgba(185,112,40,.18) !important;
}

.table-wrap,
.tbl {
  border-color: rgba(185,112,40,.16) !important;
}

.tbl th {
  background: rgba(246,243,235,.92) !important;
  color: rgba(18,53,47,.72) !important;
}

.tbl td {
  border-color: rgba(185,112,40,.12) !important;
}

.tbl tbody tr:hover {
  background: rgba(31,77,67,.045) !important;
}

.tbl .mve-day-group td {
  background: linear-gradient(90deg, rgba(31,77,67,.10), rgba(185,112,40,.06)) !important;
  border-top: 1px solid rgba(185,112,40,.24) !important;
  border-bottom: 1px solid rgba(185,112,40,.18) !important;
  color: var(--mvx-ink, #12352f) !important;
  cursor: pointer;
  font-size: .72rem !important;
  font-weight: 900 !important;
  letter-spacing: .08em !important;
  padding: 11px 16px !important;
  text-transform: uppercase !important;
}

.tbl .mve-day-group:hover td {
  background: linear-gradient(90deg, rgba(31,77,67,.10), rgba(185,112,40,.06)) !important;
}

.mve-day-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--mvx-copper, #b97028);
  box-shadow: 0 0 0 4px rgba(185,112,40,.13);
  vertical-align: 1px;
}

.mve-day-actions {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.mve-day-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(18,53,47,.78);
  cursor: pointer;
  font-size: .66rem;
  letter-spacing: .04em;
  text-transform: none;
}

.mve-day-check input {
  width: 14px;
  height: 14px;
  accent-color: var(--mvx-ink, #12352f);
}

.mve-day-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(18,53,47,.70);
  font-size: .66rem;
  letter-spacing: .04em;
}

.mve-day-toggle::before {
  content: "+";
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(185,112,40,.28);
  border-radius: 999px;
  background: rgba(255,253,248,.70);
  color: var(--mvx-copper, #b97028);
  font-weight: 900;
}

.mve-day-group[data-collapsed="0"] .mve-day-toggle::before {
  content: "-";
}

.badge {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  border-radius: 999px !important;
  font-weight: 850 !important;
}

.badge::before {
  content: "•";
  font-size: .9em;
  line-height: 1;
}

.badge-green,
.badge-ok {
  color: #176047 !important;
  background: #e7f4ee !important;
  border: 1px solid #b9dfcf !important;
}

.badge-blue {
  color: #1f4d43 !important;
  background: #e8f1ee !important;
  border: 1px solid #bfd8d0 !important;
}

.badge-yellow,
.badge-pending {
  color: #8a520c !important;
  background: #fff3dd !important;
  border: 1px solid #efd09d !important;
}

.badge-gray {
  color: #637069 !important;
  background: #f1eee7 !important;
  border: 1px solid #ded4c3 !important;
}

.badge-error,
.badge-red {
  color: #8f2f22 !important;
  background: #fff0eb !important;
  border: 1px solid #f2c3b8 !important;
}

.notice {
  background: rgba(31,77,67,.08) !important;
  border-color: rgba(31,77,67,.18) !important;
  color: var(--mvx-ink) !important;
}

.eyebrow {
  color: var(--mvx-copper) !important;
}

h1,
.hero h1 {
  color: var(--mvx-ink) !important;
}

.lead,
.brand-sub,
.muted {
  color: var(--mvx-muted) !important;
}

.brand-mark {
  color: transparent !important;
  background: #fffdf8 !important;
  border: 1px solid rgba(185,112,40,.34) !important;
}

.btn-link,
a.btn-link {
  color: var(--mvx-ink) !important;
}

@media (max-width: 760px) {
  #main { padding-bottom: 86px; }
  .summary-grid { grid-template-columns: 1fr 1fr !important; }
  .cove-item { grid-template-columns: 1fr !important; }
}

/* Reusable MAVEX UI system */
.mavex-shell {
  background: var(--mvx-paper);
  color: var(--mvx-ink);
}

.mavex-card,
.mavex-stat-card,
.mavex-toolbar,
.mavex-modal,
.mavex-form,
.mavex-table-card,
.mavex-expediente {
  background: var(--mvx-surface);
  border: 1px solid rgba(185,112,40,.18);
  border-radius: 22px;
  box-shadow: var(--mvx-shadow);
}

.mavex-kicker {
  display: inline-flex;
  color: var(--mvx-copper);
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.mavex-flow-card {
  background:
    linear-gradient(135deg, rgba(255,253,248,.98), rgba(246,243,235,.92)),
    radial-gradient(circle at 90% 20%, rgba(185,112,40,.13), transparent 28%);
  border: 1px solid rgba(185,112,40,.20);
  border-radius: 24px;
  box-shadow: var(--mvx-shadow);
  padding: clamp(18px, 2vw, 24px);
  margin-bottom: 16px;
}

.mavex-flow-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.mavex-flow-head h1 {
  margin: 4px 0 4px;
  color: var(--mvx-ink);
  font-size: clamp(1.35rem, 2.6vw, 2.15rem);
  line-height: 1;
  letter-spacing: -.045em;
}

.mavex-flow-head p {
  margin: 0;
  color: var(--mvx-muted);
  max-width: 620px;
  font-weight: 650;
}

.mavex-flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.mavex-flow::before {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  top: 20px;
  height: 2px;
  background: linear-gradient(90deg, var(--mvx-ink), rgba(185,112,40,.65), rgba(18,53,47,.18));
  z-index: 0;
}

.mavex-flow-step {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 96px;
  padding: 11px 12px;
  border: 1px solid rgba(18,53,47,.14);
  border-radius: 16px;
  background: rgba(255,253,248,.92);
}

.mavex-flow-step span {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #f3eadc;
  color: var(--mvx-copper);
  border: 1px solid rgba(185,112,40,.35);
  font-weight: 950;
  font-size: .82rem;
}

.mavex-flow-step strong {
  color: var(--mvx-ink);
  font-size: .88rem;
  line-height: 1.15;
}

.mavex-flow-step small {
  color: var(--mvx-muted);
  font-size: .72rem;
  font-weight: 650;
}

.mavex-flow-step.is-active {
  border-color: rgba(31,77,67,.36);
  box-shadow: 0 14px 28px rgba(18,53,47,.10);
}

.mavex-flow-step.is-active span {
  background: var(--mvx-ink);
  color: #fffdf8;
  border-color: var(--mvx-ink);
}

#stats-row {
  grid-template-columns: repeat(4, minmax(180px, 1fr)) !important;
  gap: 14px !important;
}

.stat-card {
  min-height: 118px;
  display: grid;
  align-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -42px;
  width: 98px;
  height: 98px;
  border-radius: 999px;
  background: rgba(185,112,40,.10);
}

.stat-label {
  position: relative;
  z-index: 1;
  letter-spacing: .11em !important;
  font-size: .68rem !important;
}

.stat-value {
  position: relative;
  z-index: 1;
  font-size: clamp(1.65rem, 3vw, 2.4rem) !important;
  line-height: .95;
  letter-spacing: -.055em;
}

.stat-sub {
  position: relative;
  z-index: 1;
  color: var(--mvx-muted) !important;
  font-weight: 650;
}

.tbl-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(185,112,40,.16);
  border-radius: 18px 18px 0 0;
  padding: 12px 14px;
}

.tbl {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  overflow: hidden;
}

.tbl th:first-child { border-top-left-radius: 0; }
.tbl th:last-child { border-top-right-radius: 0; }

.tbl-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.mve-list-toolbar {
  overflow-x: visible;
  overflow-y: hidden;
  flex-wrap: wrap !important;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
  padding-bottom: 12px !important;
  gap: 8px !important;
  -webkit-overflow-scrolling: touch;
}

.mve-list-toolbar > * {
  flex: 0 0 auto;
}

.mve-list-toolbar .ch-spacer {
  flex: 1 1 24px;
  min-width: 24px;
}

.mve-list-toolbar .btn {
  white-space: nowrap;
  min-height: 32px;
}

.mve-auto-refresh-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(18, 53, 47, .14);
  border-radius: 999px;
  background: rgba(255, 253, 248, .84);
  color: var(--mvx-muted);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.mve-auto-refresh-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #2fa56f;
  box-shadow: 0 0 0 4px rgba(47, 165, 111, .12);
}

.mve-auto-refresh-status.is-error {
  border-color: rgba(180, 83, 9, .28);
  background: #fff7ed;
  color: #9a3412;
}

.mve-auto-refresh-status.is-error::before {
  background: #d97706;
  box-shadow: 0 0 0 4px rgba(217, 119, 6, .14);
}

.mve-edoc-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 64px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(18, 53, 47, .14);
  background: rgba(255, 253, 248, .82);
  color: var(--mvx-muted);
  font-size: .68rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.mve-edoc-light > span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, .12);
}

.mve-edoc-light.ok {
  color: #146c43;
  border-color: rgba(20, 108, 67, .24);
  background: rgba(220, 252, 231, .75);
}

.mve-edoc-light.ok > span {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .14);
}

.mve-edoc-light.pending {
  color: #9a5a08;
  border-color: rgba(217, 119, 6, .28);
  background: rgba(255, 247, 237, .82);
}

.mve-edoc-light.pending > span {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .15);
}

.mve-edoc-light.error {
  color: #991b1b;
  border-color: rgba(239, 68, 68, .34);
  background: rgba(254, 242, 242, .9);
}

.mve-edoc-light.error > span {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, .15);
}

.mve-edoc-light.empty {
  color: #991b1b;
  border-color: rgba(239, 68, 68, .24);
  background: rgba(254, 242, 242, .78);
}

.mve-copy-acuse {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 3px 4px;
  border-radius: 8px;
  color: var(--c-text-hi);
  cursor: copy;
  font-size: .68rem;
  line-height: 1.25;
  word-break: break-all;
  text-align: left;
}

.mve-copy-acuse:hover {
  background: rgba(31, 77, 67, .08);
  color: var(--mvx-ink);
}

.mve-list-toolbar::-webkit-scrollbar {
  height: 8px;
}

.mve-list-toolbar::-webkit-scrollbar-track {
  background: rgba(18, 53, 47, .06);
  border-radius: 999px;
}

.mve-list-toolbar::-webkit-scrollbar-thumb {
  background: rgba(18, 53, 47, .28);
  border-radius: 999px;
}

.mve-scope-toggle {
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(18, 53, 47, .14);
  border-radius: 14px;
  background: rgba(255, 253, 248, .78);
  color: var(--mvx-ink);
  cursor: pointer;
  user-select: none;
}

.mve-scope-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--mvx-ink);
}

.mve-scope-toggle span {
  display: grid;
  gap: 2px;
}

.mve-scope-toggle strong {
  font-size: .82rem;
  line-height: 1.1;
}

.mve-scope-toggle small {
  color: var(--mvx-muted);
  font-size: .72rem;
  line-height: 1.25;
}

.modal-overlay {
  background: rgba(18,53,47,.38) !important;
  backdrop-filter: blur(10px);
}

.modal-header {
  background: linear-gradient(135deg, var(--mvx-ink), var(--mvx-ink-2)) !important;
  color: #fffdf8 !important;
  border-bottom: 0 !important;
}

.modal-header .modal-title,
.modal-header h3,
.modal-header svg {
  color: #fffdf8 !important;
  stroke: currentColor !important;
}

.modal-body {
  background: linear-gradient(180deg, #fffdf8, #f7f2e8) !important;
}

.modal-footer {
  background: #f4efe5 !important;
  border-top: 1px solid rgba(185,112,40,.18) !important;
}

.seccion {
  border-radius: 20px !important;
  border-color: rgba(185,112,40,.18) !important;
  background: rgba(255,253,248,.94) !important;
  box-shadow: var(--mvx-shadow) !important;
}

.seccion-header {
  background: linear-gradient(180deg, #fffdf8, #f4efe5) !important;
  border-left-color: var(--mvx-copper) !important;
  border-bottom-color: rgba(185,112,40,.18) !important;
}

.seccion-header:hover {
  background: rgba(31,77,67,.08) !important;
}

.seccion-header h2 {
  color: var(--mvx-ink) !important;
  font-weight: 800 !important;
}

#action-bar {
  background: rgba(255,253,248,.94) !important;
  border-bottom: 1px solid rgba(185,112,40,.22) !important;
  box-shadow: 0 10px 28px rgba(18,53,47,.10) !important;
  backdrop-filter: blur(16px);
}

#action-bar .ab-title {
  color: var(--mvx-ink) !important;
}

.tabs-sticky-bar {
  background: rgba(255,253,248,.94) !important;
  border-color: rgba(185,112,40,.18) !important;
  box-shadow: 0 16px 34px rgba(18,53,47,.10) !important;
}

.tab-btn.active {
  background: rgba(31,77,67,.10) !important;
  color: var(--mvx-ink) !important;
  border-color: rgba(31,77,67,.22) !important;
  box-shadow: inset 0 -2px 0 var(--mvx-copper) !important;
}

.total-item {
  background: #fffdf8 !important;
  border-color: rgba(185,112,40,.18) !important;
  border-radius: 16px !important;
}

.total-item .ti-value {
  color: var(--mvx-ink) !important;
  letter-spacing: -.03em;
}

@media (max-width: 1100px) {
  .mavex-flow { grid-template-columns: repeat(3, 1fr); }
  .mavex-flow::before { display: none; }
  #stats-row { grid-template-columns: repeat(2, minmax(160px, 1fr)) !important; }
}

@media (max-width: 680px) {
  .mavex-flow-head { flex-direction: column; }
  .mavex-flow { grid-template-columns: 1fr; }
  #stats-row { grid-template-columns: 1fr !important; }
  .tbl-toolbar { flex-direction: column; align-items: stretch; }
}

/* ──────────────────────────────────────────────────────────────
   MAVEX UI system hardening layer
   Presentation only: no IDs, endpoints, tokens or JS hooks changed.
   ────────────────────────────────────────────────────────────── */
:root {
  --mvx-sidebar-w: 274px;
  --mvx-radius-xl: 24px;
}

html {
  color-scheme: light;
  scroll-padding-bottom: var(--news-ticker-safe, 88px);
}

body {
  color: var(--mvx-ink) !important;
}

#app-shell {
  background:
    linear-gradient(90deg, rgba(18,53,47,.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(18,53,47,.025) 1px, transparent 1px);
  background-size: 42px 42px;
}

#main {
  padding: 26px 28px calc(120px + var(--news-ticker-safe, 0px)) !important;
  min-width: 0;
}

#topbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 220 !important;
  min-height: 78px;
}

#topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(185,112,40,.45), transparent);
}

.tb-logo { min-width: 198px; }

.tb-brand::after {
  content: "Manifestación de Valor Express";
  display: block;
  color: var(--mvx-muted);
  font-size: .58rem;
  letter-spacing: .03em;
  font-weight: 800;
  margin-top: 1px;
}

#sidebar {
  width: var(--mvx-sidebar-w) !important;
  min-width: var(--mvx-sidebar-w) !important;
  position: sticky !important;
  top: 0 !important;
  height: 100vh !important;
}

.sidebar-logo {
  min-height: 82px;
  padding: 14px 12px !important;
  border-bottom: 1px solid rgba(185,112,40,.18);
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  overflow: hidden !important;
}

.logo-text {
  display: block !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  max-width: 132px !important;
  height: 55px !important;
  font-size: 34px !important;
  line-height: .88 !important;
  letter-spacing: .01em !important;
}

.logo-text span {
  display: block !important;
  color: var(--mvx-muted) !important;
  height: 30px !important;
  font-size: .9rem !important;
  line-height: 1.02 !important;
  margin-top: 3px;
  letter-spacing: .02em !important;
  text-transform: none !important;
  white-space: normal !important;
}

.mavex-editor-shell .sidebar-logo strong {
  display: block !important;
  color: var(--mvx-ink) !important;
  height: 30px !important;
  font-size: 34px !important;
  line-height: .88 !important;
  letter-spacing: .01em !important;
}

.mavex-editor-shell .sidebar-logo span {
  display: block !important;
  max-width: 132px !important;
  color: var(--mvx-muted) !important;
  height: 30px !important;
  font-size: .9rem !important;
  line-height: 1.02 !important;
  margin-top: 3px !important;
}

.nav-item {
  min-height: 46px;
  font-weight: 800 !important;
  letter-spacing: -.01em;
}

.nav-item.active {
  box-shadow: inset 4px 0 0 var(--mvx-copper);
}

.nav-icon {
  color: currentColor !important;
  opacity: .92;
}

.card,
.modal,
.panel,
.hero,
.actions,
.detail-card,
.mve-detail,
.firma-card,
.detail,
.review-layout {
  border-radius: var(--mvx-radius-xl) !important;
}

.card-header,
.panel-head,
.detail-head {
  min-height: 60px;
  border-radius: var(--mvx-radius-xl) var(--mvx-radius-xl) 0 0 !important;
}

.input,
.select,
select,
input[type="text"],
input[type="email"],
input[type="date"],
input[type="password"],
input[type="number"],
textarea {
  border-radius: 13px !important;
}

.btn-primary,
.btn-success,
.btn-ghost,
.btn-secondary,
.btn {
  border-radius: 13px !important;
  font-weight: 850 !important;
}

.table-wrap,
.tbl,
table {
  background: rgba(255,253,248,.82) !important;
}

.mve-table-scroll {
  overflow-x: auto !important;
  overflow-y: visible !important;
  max-height: none !important;
  overscroll-behavior: auto;
  scrollbar-gutter: auto;
  border-radius: 0 0 18px 18px;
}

.mve-table-scroll #tbl-manval {
  min-width: 1180px;
}

.mve-table-scroll #tbl-manval thead th {
  position: sticky;
  top: 0;
  z-index: 5;
}

.tbl th,
table th {
  background: rgba(246,243,235,.92) !important;
  color: rgba(18,53,47,.72) !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
  font-size: .68rem !important;
}

.modal-overlay {
  z-index: 1000 !important;
  padding: 18px !important;
  box-sizing: border-box;
}

.modal-header {
  position: relative;
  padding: 18px 22px !important;
}

.modal-header::before {
  content: "";
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 12px;
  background: rgba(255,253,248,.94) url("../img/mavex-icon-new.png") center / 24px 24px no-repeat;
  border: 1px solid rgba(255,253,248,.35);
  box-shadow: 0 12px 28px rgba(0,0,0,.16);
}

.modal-body {
  padding: 22px !important;
}

/* Public signature screens */
body:has(#mve-wrap),
body:has(#mves-wrap),
body:has(#firma-card) {
  background:
    radial-gradient(circle at 12% 14%, rgba(185,112,40,.13), transparent 30%),
    linear-gradient(180deg, #fffdf8, #f5f0e7) !important;
}

.topbar {
  background: rgba(255,253,248,.92) !important;
  border-bottom: 1px solid rgba(185,112,40,.22) !important;
  box-shadow: 0 12px 30px rgba(18,53,47,.08) !important;
}

.detail,
.review-layout,
.firma-card {
  border: 1px solid rgba(185,112,40,.18) !important;
  background: rgba(255,253,248,.95) !important;
  box-shadow: 0 22px 60px rgba(18,53,47,.12) !important;
}

.result-log,
.notice {
  border-radius: 16px !important;
}

/* Bottom news ticker: fixed but not covering content */
.mavex-news-ticker {
  left: var(--mvx-sidebar-w) !important;
  right: 0 !important;
  bottom: 0 !important;
  min-height: 44px !important;
  max-height: 46px !important;
  background: rgba(255,253,248,.96) !important;
  border: 0 !important;
  border-top: 1px solid rgba(185,112,40,.24) !important;
  box-shadow: 0 -10px 30px rgba(18,53,47,.10) !important;
  backdrop-filter: blur(18px);
  border-radius: 0 !important;
  z-index: 800 !important;
}

.mavex-news-ticker-label {
  background: linear-gradient(135deg, var(--mvx-ink), var(--mvx-ink-2)) !important;
  color: #fffdf8 !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  box-shadow: 0 8px 20px rgba(18,53,47,.18);
}

.mavex-news-ticker-item,
.mavex-news-ticker-item b {
  color: var(--mvx-ink) !important;
}

.mavex-news-ticker-item::after {
  background: var(--mvx-copper) !important;
}

.mavex-news-ticker-close {
  color: var(--mvx-muted) !important;
  background: rgba(18,53,47,.05) !important;
}

body.has-news-ticker .mavex-news-float-button {
  display: none !important;
}

body.has-news-ticker {
  --news-ticker-safe: 64px !important;
}

body.has-news-ticker #main,
body.has-news-ticker #editor-content,
body.has-news-ticker #editor-wrap {
  padding-bottom: calc(48px + var(--news-ticker-safe, 64px)) !important;
}

/* MVE internal editor shell */
.mavex-editor-shell {
  display: flex !important;
  min-height: 100vh;
  padding-left: var(--mvx-sidebar-w) !important;
  background:
    radial-gradient(circle at 76% 8%, rgba(185,112,40,.09), transparent 30%),
    linear-gradient(180deg, #fffdf8 0%, #f7f1e7 100%) !important;
}

.mavex-editor-shell #sidebar {
  display: flex !important;
  flex-direction: column !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  height: 100vh;
  overflow: hidden !important;
  align-self: flex-start;
  width: var(--mvx-sidebar-w) !important;
  flex: 0 0 var(--mvx-sidebar-w);
  z-index: 260;
}

.mavex-editor-shell #sidebar .nav-item {
  width: 100%;
  border: 0;
  appearance: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.mavex-editor-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.mavex-editor-shell #topbar.mavex-editor-topbar {
  display: none !important;
}

.mavex-editor-shell #topbar .tb-title span {
  display: block;
  margin-top: 3px;
  color: var(--mvx-muted);
  font-size: .78rem;
  font-weight: 700;
}

.mavex-editor-shell #editor-wrap {
  min-height: 100vh !important;
  background: transparent !important;
}

.mavex-editor-shell #action-bar {
  top: 0 !important;
  z-index: 230 !important;
  border-radius: 0 0 20px 20px !important;
  margin: 0 16px !important;
  border: 1px solid rgba(185,112,40,.20) !important;
  border-top: 0 !important;
}

body.modo-embed-firma .mavex-editor-shell {
  display: block !important;
  min-height: 100vh;
  padding-left: 0 !important;
  background: #f6f9ff !important;
}

body.modo-embed-firma .mavex-editor-shell #sidebar,
body.modo-embed-firma .mavex-editor-shell #topbar {
  display: none !important;
}

body.modo-embed-firma .mavex-editor-main {
  display: block !important;
  width: 100% !important;
}

/* Reusable MAVEX component names for next screens */
.mavex-shell { display: flex; min-height: 100vh; background: transparent; }
.mavex-sidebar { width: var(--mvx-sidebar-w); background: var(--mvx-surface); border-right: 1px solid rgba(185,112,40,.18); }
.mavex-topbar { min-height: 78px; background: rgba(255,253,248,.92); border-bottom: 1px solid rgba(185,112,40,.18); }
.mavex-content { padding: 26px 28px; min-width: 0; }
.mavex-card { background: var(--mvx-surface); border: 1px solid rgba(185,112,40,.18); border-radius: var(--mvx-radius-xl); box-shadow: var(--mvx-shadow); }
.mavex-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mavex-filterbar { display: flex; flex-wrap: wrap; gap: 12px; padding: 12px; border: 1px solid rgba(185,112,40,.16); border-radius: 18px; background: rgba(255,253,248,.78); }
.mavex-status-pill { display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:5px 10px;font-weight:900;font-size:.72rem;border:1px solid rgba(31,77,67,.18);background:#edf5f1;color:var(--mvx-ink); }
.mavex-alert { border-radius: 16px; border: 1px solid rgba(185,112,40,.24); background: #fff7ea; color: #6d4a1d; padding: 14px 16px; }
.mavex-email-wrapper { background:#f7f2e8; padding:28px 12px; }
.mavex-email-container { max-width:680px;margin:auto;background:#fffdf8;border:1px solid #eadfce;border-radius:24px;overflow:hidden; }
.mavex-public-signature { max-width:980px;margin:24px auto;padding:0 16px; }

@media (max-width: 1100px) {
  #sidebar {
    width: 230px !important;
    min-width: 230px !important;
  }
  .mavex-news-ticker {
    left: 0 !important;
    right: 12px !important;
  }
}

@media (max-width: 680px) {
  #main { padding: 18px 12px calc(110px + var(--news-ticker-safe, 0px)) !important; }
  #topbar { min-height: 64px; }
  .tb-brand::after { display: none; }
  .mavex-news-ticker {
    min-height: 44px !important;
    bottom: 0 !important;
  }
}

/* Force the full MAVEX shell to render over legacy app.css defaults. */
#app-shell:not(.mavex-editor-shell) {
  display: grid !important;
  grid-template-columns: var(--mvx-sidebar-w) minmax(0, 1fr) !important;
  grid-template-rows: 76px minmax(0, 1fr) !important;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main" !important;
  min-height: 100vh !important;
  height: auto !important;
  overflow: visible !important;
  padding-top: 0 !important;
}

#app-shell:not(.mavex-editor-shell) > #sidebar {
  grid-area: sidebar !important;
  display: flex !important;
  flex-direction: column !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  height: 100vh !important;
  min-height: 100vh !important;
  overflow: hidden !important;
  align-self: start !important;
  z-index: 650 !important;
}

#app-shell:not(.mavex-editor-shell) > #topbar {
  grid-area: topbar !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
  position: sticky !important;
  top: 0 !important;
  left: auto !important;
  right: auto !important;
  width: auto !important;
  min-height: 76px !important;
  padding: 0 28px !important;
  z-index: 520 !important;
  background: rgba(255,253,248,.90) !important;
  backdrop-filter: blur(18px) saturate(130%) !important;
  border-bottom: 1px solid rgba(185,112,40,.18) !important;
}

#app-shell:not(.mavex-editor-shell) > #topbar .tb-logo,
#app-shell:not(.mavex-editor-shell) > #topbar .tb-nav {
  display: none !important;
}

#app-shell:not(.mavex-editor-shell) .tb-search {
  flex: 1 1 680px !important;
  max-width: 720px !important;
  min-width: 280px !important;
  margin: 0 auto !important;
  height: 46px !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 0 16px !important;
  color: rgba(18,53,47,.58) !important;
  background: rgba(255,255,255,.76) !important;
  border: 1px solid rgba(18,53,47,.16) !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 30px rgba(18,53,47,.06) !important;
}

#app-shell:not(.mavex-editor-shell) .tb-search input {
  width: 100% !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: var(--mvx-ink) !important;
  font: 800 .92rem var(--font, inherit) !important;
}

#app-shell:not(.mavex-editor-shell) .tb-search input::placeholder {
  color: rgba(86,113,105,.70) !important;
}

#app-shell:not(.mavex-editor-shell) #topbar .tb-right {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

#app-shell:not(.mavex-editor-shell) #topbar .tb-right .btn,
#app-shell:not(.mavex-editor-shell) #topbar .tb-right .btn-icon {
  color: var(--mvx-ink) !important;
  border-color: rgba(18,53,47,.14) !important;
  background: rgba(255,255,255,.70) !important;
}

#app-shell:not(.mavex-editor-shell) > #main {
  grid-area: main !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.mvx-personalize-btn {
  width: 100% !important;
  justify-content: center !important;
  margin-top: 8px !important;
  font-size: .74rem !important;
  font-weight: 900 !important;
  color: var(--mvx-ink) !important;
  background: linear-gradient(135deg, rgba(185,112,40,.12), rgba(18,53,47,.06)) !important;
  border: 1px solid rgba(185,112,40,.24) !important;
  box-shadow: 0 8px 18px rgba(18,53,47,.05) !important;
}

.mvx-personalize-btn:hover {
  background: linear-gradient(135deg, rgba(185,112,40,.18), rgba(18,53,47,.10)) !important;
}

.nav-owner-item {
  position: relative;
}

.nav-owner-money {
  background: linear-gradient(135deg, rgba(185,112,40,.18), rgba(18,53,47,.08)) !important;
  border: 1px solid rgba(185,112,40,.22) !important;
}

.nav-owner-money::after {
  content: "clave";
  margin-left: auto;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: .58rem;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #7a4312;
  background: rgba(185,112,40,.15);
  border: 1px solid rgba(185,112,40,.22);
}

.owner-control-panel {
  grid-template-columns: minmax(260px, .86fr) minmax(420px, 1.45fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 22px;
  border-radius: 28px;
  border: 1px solid rgba(185,112,40,.22);
  background:
    radial-gradient(circle at 96% 4%, rgba(185,112,40,.20), transparent 30%),
    linear-gradient(135deg, rgba(255,253,248,.96), rgba(247,242,231,.90));
  box-shadow: 0 22px 70px rgba(18,53,47,.12);
}

.owner-panel-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 210px;
  padding: 8px 10px;
}

.owner-eyebrow {
  color: var(--mvx-copper);
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.owner-panel-copy h1 {
  margin: 0;
  color: var(--mvx-ink);
  font-size: clamp(1.9rem, 3vw, 3.15rem);
  line-height: .98;
  letter-spacing: -.045em;
}

.owner-panel-copy p {
  margin: 14px 0 0;
  max-width: 560px;
  color: rgba(18,53,47,.72);
  font-size: .96rem;
  line-height: 1.45;
  font-weight: 750;
}

.owner-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.owner-action {
  min-height: 122px;
  text-align: left;
  border: 1px solid rgba(18,53,47,.12);
  border-radius: 20px;
  padding: 15px;
  background: rgba(255,255,255,.72);
  color: var(--mvx-ink);
  box-shadow: 0 12px 28px rgba(18,53,47,.06);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.owner-action:hover {
  transform: translateY(-2px);
  border-color: rgba(185,112,40,.38);
  background: rgba(255,253,248,.96);
  box-shadow: 0 18px 40px rgba(18,53,47,.12);
}

.owner-action-primary {
  background:
    linear-gradient(135deg, rgba(18,75,65,.96), rgba(8,52,45,.98)) !important;
  color: #fffdf8 !important;
  border-color: rgba(18,75,65,.28) !important;
}

.owner-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  border-radius: 12px;
  font-size: .74rem;
  font-weight: 950;
  color: var(--mvx-ink);
  background: rgba(229,238,232,.86);
  border: 1px solid rgba(18,53,47,.12);
}

.owner-action-primary .owner-action-icon {
  color: #fffdf8;
  background: rgba(185,112,40,.28);
  border-color: rgba(255,255,255,.20);
}

.owner-action strong,
.owner-action small {
  display: block;
}

.owner-action strong {
  font-size: .92rem;
  line-height: 1.15;
  font-weight: 950;
}

.owner-action small {
  margin-top: 6px;
  color: rgba(18,53,47,.66);
  font-size: .72rem;
  line-height: 1.34;
  font-weight: 750;
}

.owner-action-primary small {
  color: rgba(255,253,248,.78);
}

@media (max-width: 1180px) {
  .owner-control-panel {
    grid-template-columns: 1fr;
  }
  .owner-panel-copy {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .owner-action-grid {
    grid-template-columns: 1fr;
  }
  .owner-control-panel {
    padding: 16px;
    border-radius: 22px;
  }
}

@media (max-width: 980px) {
  #app-shell:not(.mavex-editor-shell) {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    grid-template-areas:
      "topbar"
      "main" !important;
  }

  #app-shell:not(.mavex-editor-shell) > #sidebar {
    display: none !important;
  }

  #app-shell:not(.mavex-editor-shell) > #topbar {
    padding: 0 12px !important;
  }

  #app-shell:not(.mavex-editor-shell) .tb-search {
    max-width: none !important;
    min-width: 0 !important;
    height: 42px !important;
  }

  .mavex-editor-shell {
    padding-left: 0 !important;
  }

  .mavex-editor-shell #sidebar {
    display: none !important;
  }
}

/* Theme customizer aligned with the new MAVEX visual layer */
#theme-panel {
  top: 18px !important;
  right: 18px !important;
  width: min(430px, calc(100vw - 28px)) !important;
  max-height: calc(100vh - 36px) !important;
  border-radius: 24px !important;
  overflow: hidden !important;
  background: rgba(255,253,248,.98) !important;
  border: 1px solid rgba(185,112,40,.24) !important;
  box-shadow: 0 28px 80px rgba(18,53,47,.22) !important;
}

#theme-panel .tp-header {
  background:
    radial-gradient(circle at 88% 8%, rgba(185,112,40,.28), transparent 34%),
    linear-gradient(135deg, var(--mvx-ink), var(--mvx-ink-2)) !important;
  color: #fffdf8 !important;
  border-bottom: 1px solid rgba(255,255,255,.12) !important;
}

#theme-panel .tp-tabs {
  background: rgba(31,77,67,.06) !important;
  border-bottom: 1px solid rgba(185,112,40,.18) !important;
}

#theme-panel .tp-tab {
  color: rgba(18,53,47,.72) !important;
}

#theme-panel .tp-tab.active {
  color: var(--mvx-ink) !important;
  background: rgba(255,253,248,.86) !important;
  box-shadow: inset 0 -2px 0 var(--mvx-copper) !important;
}

#theme-panel .theme-row {
  border: 1px solid rgba(185,112,40,.16) !important;
  border-radius: 16px !important;
  padding: 12px !important;
  background: rgba(255,253,248,.72) !important;
  margin-bottom: 10px !important;
}

#theme-panel .theme-row label {
  color: var(--mvx-ink) !important;
  font-weight: 900 !important;
}

#theme-panel input[type="color"] {
  width: 44px !important;
  height: 34px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(185,112,40,.28) !important;
  overflow: hidden !important;
}
