/* =========================================================
   RentTrack Pro — Identidad visual · Fase 1
   Alcance: sistema global compartido, header, navegación,
   botones, formularios, tarjetas, estados y pantalla Hoy.
   No contiene cambios funcionales.
   ========================================================= */

:root {
  /* Marca */
  --rt-turquoise: #12bfa6;
  --rt-turquoise-hover: #0eaf98;
  --rt-turquoise-deep: #078d7e;
  --rt-turquoise-light: #54e2cb;
  --rt-turquoise-mist: #e7faf6;

  /* Texto */
  --rt-ink: #071a26;
  --rt-ink-secondary: #163040;
  --rt-slate: #405967;
  --rt-muted: #6f828b;

  /* Superficies */
  --rt-background: #f5f8f8;
  --rt-surface: #ffffff;
  --rt-surface-soft: #f9fbfb;
  --rt-border: #dfe8e7;

  /* Estados */
  --rt-pending: #e99b24;
  --rt-pending-soft: #fff5e4;
  --rt-alert: #d94a4a;
  --rt-alert-soft: #fdecec;

  /* Tipografía */
  --rt-font: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;

  /* Espaciado */
  --rt-space-1: 4px;
  --rt-space-2: 8px;
  --rt-space-3: 12px;
  --rt-space-4: 16px;
  --rt-space-5: 20px;
  --rt-space-6: 24px;
  --rt-space-8: 32px;
  --rt-space-10: 40px;
  --rt-space-12: 48px;
  --rt-space-16: 64px;

  /* Radios */
  --rt-radius-sm: 8px;
  --rt-radius-md: 12px;
  --rt-radius-lg: 16px;
  --rt-radius-xl: 20px;
  --rt-radius-2xl: 28px;
  --rt-radius-pill: 999px;

  /* Sombras */
  --rt-shadow-card:
    0 1px 2px rgba(7, 26, 38, 0.03),
    0 8px 24px rgba(7, 26, 38, 0.06);
  --rt-shadow-panel:
    0 2px 4px rgba(7, 26, 38, 0.04),
    0 18px 48px rgba(7, 26, 38, 0.1);

  /* Movimiento */
  --rt-motion-fast: 160ms;
  --rt-motion-base: 220ms;
  --rt-motion-slow: 320ms;
  --rt-motion-ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Compatibilidad con el sistema existente */
  --bg: var(--rt-background);
  --bg-deep: var(--rt-background);
  --surface: var(--rt-surface);
  --surface-solid: var(--rt-surface);
  --surface-soft: var(--rt-surface-soft);
  --text: var(--rt-ink);
  --text-soft: var(--rt-ink-secondary);
  --muted: var(--rt-muted);
  --muted-2: #9aabad;
  --border: var(--rt-border);
  --border-strong: #cdd9d8;
  --primary: var(--rt-turquoise);
  --primary-2: var(--rt-turquoise-deep);
  --primary-soft: var(--rt-turquoise-mist);
  --accent: var(--rt-turquoise);
  --accent-soft: var(--rt-turquoise-mist);
  --success: var(--rt-turquoise-deep);
  --success-bg: var(--rt-turquoise-mist);
  --warning: var(--rt-pending);
  --warning-bg: var(--rt-pending-soft);
  --danger: var(--rt-alert);
  --danger-bg: var(--rt-alert-soft);
  --radius-xl: var(--rt-radius-2xl);
  --radius-lg: var(--rt-radius-xl);
  --radius-md: var(--rt-radius-lg);
  --radius-sm: var(--rt-radius-md);
  --shadow-soft: var(--rt-shadow-panel);
  --shadow-card: var(--rt-shadow-card);
  --shadow-button: 0 8px 18px rgba(7, 141, 126, 0.14);
  --ease-out: var(--rt-motion-ease);
  --rt-page-max: 820px;
  --rt-nav-width: min(calc(100vw - 20px), 780px);
  --rt-nav-height: 72px;
}

/* =========================================================
   BASE GLOBAL
   ========================================================= */

html {
  background: var(--rt-background);
  color-scheme: light;
}

body {
  background: var(--rt-background) !important;
  color: var(--rt-ink);
  font-family: var(--rt-font);
  font-feature-settings: "tnum" 1, "ss01" 1, "cv05" 1;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before,
.app-shell::before {
  display: none !important;
}

::selection {
  background: rgba(18, 191, 166, 0.2);
  color: var(--rt-ink);
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-feature-settings: "tnum" 1, "ss01" 1, "cv05" 1;
}

strong,
b,
.metric-value,
.today-main-metric strong,
.today-sales-metric strong,
.closure-summary-grid strong,
.objective-value-line strong,
.sale-modal-preview strong,
.editor-preview-card strong {
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3,
h4,
p {
  text-wrap: pretty;
}

:focus-visible {
  outline: 3px solid rgba(18, 191, 166, 0.28);
  outline-offset: 3px;
}

.app-shell {
  max-width: var(--rt-page-max);
  padding-left: clamp(14px, 3vw, 24px);
  padding-right: clamp(14px, 3vw, 24px);
  padding-bottom: calc(var(--rt-nav-height) + var(--rt-nav-bottom) + 30px);
}

#view-root {
  padding-top: var(--rt-space-5);
}

.screen {
  gap: var(--rt-space-6);
  animation: rt-screen-in var(--rt-motion-slow) var(--rt-motion-ease);
}

@keyframes rt-screen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Se elimina la celebración decorativa, sin tocar la acción funcional. */
.confetti {
  display: none !important;
}

body.has-success-burst .app-shell,
.success-card,
.success-ring,
.success-check {
  animation: none !important;
}

/* =========================================================
   HEADER DE MARCA
   ========================================================= */

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  align-items: center;
  padding:
    max(14px, env(safe-area-inset-top))
    2px
    14px;
  background: rgba(245, 248, 248, 0.94) !important;
  border-bottom: 1px solid rgba(223, 232, 231, 0.86);
  box-shadow: none;
  backdrop-filter: blur(16px) saturate(1.08);
}

.brand-row {
  gap: 10px;
  margin-bottom: 2px;
}

.brand-dot {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid rgba(18, 191, 166, 0.24);
  border-radius: 10px;
  background: var(--rt-turquoise-mist) !important;
  box-shadow: none !important;
  overflow: hidden;
}

.brand-dot::before,
.brand-dot::after {
  content: "";
  position: absolute;
  display: block;
}

.brand-dot::before {
  left: 7px;
  top: 14px;
  width: 14px;
  height: 2px;
  border-radius: var(--rt-radius-pill);
  background: var(--rt-turquoise-deep);
  transform: rotate(-42deg);
  transform-origin: center;
}

.brand-dot::after {
  right: 6px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--rt-turquoise-deep);
  border-right: 2px solid var(--rt-turquoise-deep);
  border-radius: 1px 4px 1px 1px;
}

.eyebrow {
  color: var(--rt-ink) !important;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-transform: none;
}

.app-header h1 {
  margin: 2px 0 0 40px;
  color: var(--rt-slate);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.status-pill,
.header-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid rgba(18, 191, 166, 0.2);
  border-radius: var(--rt-radius-pill);
  background: var(--rt-turquoise-mist) !important;
  color: var(--rt-turquoise-deep) !important;
  box-shadow: none !important;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

/* =========================================================
   TARJETAS Y SUPERFICIES COMPARTIDAS
   ========================================================= */

.card,
.metric-card,
.empty-state {
  background: var(--rt-surface) !important;
  border: 1px solid var(--rt-border) !important;
  box-shadow: var(--rt-shadow-card) !important;
  backdrop-filter: none !important;
}

.card {
  padding: var(--rt-space-5);
  border-radius: var(--rt-radius-xl) !important;
  transition:
    border-color var(--rt-motion-base) var(--rt-motion-ease),
    box-shadow var(--rt-motion-base) var(--rt-motion-ease),
    transform var(--rt-motion-fast) var(--rt-motion-ease);
}

.card:hover {
  transform: none;
  border-color: var(--rt-border) !important;
  box-shadow: var(--rt-shadow-card) !important;
}

.card h2,
.card h3 {
  color: var(--rt-ink);
  font-weight: 700;
  letter-spacing: -0.035em;
}

.card p {
  color: var(--rt-muted);
}

.list-item,
.metric-card {
  border-radius: var(--rt-radius-lg) !important;
  background: var(--rt-surface-soft) !important;
  box-shadow: none !important;
}

.empty-state {
  border-radius: var(--rt-radius-xl) !important;
}

.loader-orb {
  width: 36px;
  height: 36px;
  border: 3px solid var(--rt-border);
  border-top-color: var(--rt-turquoise);
  background: transparent !important;
  box-shadow: none !important;
}

.loader-orb::after {
  display: none;
}

/* =========================================================
   BOTONES COMPARTIDOS
   ========================================================= */

.primary-btn,
.secondary-btn,
.danger-btn,
.success-btn {
  min-height: 48px;
  padding: 12px 16px;
  border-radius: var(--rt-radius-md) !important;
  font-weight: 650 !important;
  letter-spacing: -0.01em;
  box-shadow: none !important;
  transition:
    background-color var(--rt-motion-fast) var(--rt-motion-ease),
    border-color var(--rt-motion-fast) var(--rt-motion-ease),
    color var(--rt-motion-fast) var(--rt-motion-ease),
    transform var(--rt-motion-fast) var(--rt-motion-ease),
    opacity var(--rt-motion-fast) var(--rt-motion-ease);
}

.primary-btn {
  border: 1px solid var(--rt-turquoise) !important;
  background: var(--rt-turquoise) !important;
  color: var(--rt-ink) !important;
}

.primary-btn:hover {
  border-color: var(--rt-turquoise-hover) !important;
  background: var(--rt-turquoise-hover) !important;
}

.secondary-btn {
  border: 1px solid var(--rt-border) !important;
  background: var(--rt-surface) !important;
  color: var(--rt-ink-secondary) !important;
}

.secondary-btn:hover {
  border-color: #bfd0ce !important;
  background: var(--rt-surface-soft) !important;
}

.success-btn {
  border: 1px solid rgba(18, 191, 166, 0.26) !important;
  background: var(--rt-turquoise-mist) !important;
  color: var(--rt-turquoise-deep) !important;
}

.danger-btn {
  border: 1px solid rgba(217, 74, 74, 0.2) !important;
  background: var(--rt-alert-soft) !important;
  color: var(--rt-alert) !important;
}

.primary-btn:hover,
.secondary-btn:hover,
.danger-btn:hover,
.success-btn:hover {
  transform: none;
}

.primary-btn:active,
.secondary-btn:active,
.danger-btn:active,
.success-btn:active {
  transform: scale(0.985);
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.5;
}

/* =========================================================
   FORMULARIOS COMPARTIDOS
   ========================================================= */

.form-grid {
  gap: var(--rt-space-4);
}

.form-field {
  gap: 7px;
}

.form-field label {
  color: var(--rt-slate) !important;
  font-size: 0.8rem;
  font-weight: 600 !important;
  letter-spacing: -0.005em;
}

.form-field input,
.form-field select,
.form-field textarea,
.component-amount-input {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  border: 1px solid var(--rt-border) !important;
  border-radius: var(--rt-radius-md) !important;
  outline: none;
  background: var(--rt-surface) !important;
  color: var(--rt-ink) !important;
  box-shadow: none !important;
  font-size: 0.95rem;
  transition:
    border-color var(--rt-motion-fast) var(--rt-motion-ease),
    box-shadow var(--rt-motion-fast) var(--rt-motion-ease),
    background-color var(--rt-motion-fast) var(--rt-motion-ease);
}

.form-field textarea {
  min-height: 96px;
  line-height: 1.45;
}

.form-field input::placeholder,
.form-field textarea::placeholder,
.component-amount-input::placeholder {
  color: #9aabad;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.component-amount-input:focus {
  border-color: var(--rt-turquoise) !important;
  background: var(--rt-surface) !important;
  box-shadow: 0 0 0 4px rgba(18, 191, 166, 0.12) !important;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--rt-turquoise-deep);
}

.check-row,
.calendar-exception-check {
  color: var(--rt-slate);
  font-weight: 550 !important;
}

/* =========================================================
   CHIPS Y ESTADOS COMPARTIDOS
   ========================================================= */

.sync-chip {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(18, 191, 166, 0.18);
  border-radius: var(--rt-radius-pill);
  background: var(--rt-turquoise-mist) !important;
  color: var(--rt-turquoise-deep) !important;
  font-size: 0.7rem;
  font-weight: 650 !important;
}

.sync-chip i,
.personal-search-empty i {
  width: 7px;
  height: 7px;
  background: var(--rt-turquoise) !important;
  box-shadow: 0 0 0 3px rgba(18, 191, 166, 0.12);
}

.history-status,
.today-sale-status,
.calendar-sale-payment,
.calendar-day-status-pill,
.calendar-day-closed-pill {
  border-radius: var(--rt-radius-pill) !important;
  font-weight: 600 !important;
}

.history-status.is-paid,
.today-sale-status.status-paid,
.calendar-sale-payment.payment-paid,
.calendar-day-closed-pill {
  background: var(--rt-turquoise-mist) !important;
  color: var(--rt-turquoise-deep) !important;
}

.history-status.is-pending,
.today-sale-status.status-pending,
.calendar-sale-payment.payment-pending {
  background: var(--rt-pending-soft) !important;
  color: #a7640d !important;
}

.history-status.is-cancelled,
.editor-cancelled-warning {
  background: var(--rt-alert-soft) !important;
  color: var(--rt-alert) !important;
}

/* =========================================================
   NAVEGACIÓN INFERIOR
   ========================================================= */

.bottom-nav {
  min-height: var(--rt-nav-height) !important;
  gap: 3px !important;
  padding:
    7px
    max(7px, env(safe-area-inset-right))
    calc(7px + env(safe-area-inset-bottom))
    max(7px, env(safe-area-inset-left)) !important;
  border: 1px solid rgba(223, 232, 231, 0.92) !important;
  border-radius: var(--rt-radius-xl) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: var(--rt-shadow-panel) !important;
  backdrop-filter: blur(18px) saturate(1.08);
}

.bottom-nav .bottom-nav-item,
.bottom-nav button {
  position: relative;
  min-height: 56px;
  grid-template-rows: 23px auto !important;
  gap: 4px !important;
  border: 0;
  border-radius: var(--rt-radius-md) !important;
  background: transparent !important;
  color: var(--rt-muted) !important;
  font-weight: 600 !important;
  transition:
    background-color var(--rt-motion-fast) var(--rt-motion-ease),
    color var(--rt-motion-fast) var(--rt-motion-ease),
    transform var(--rt-motion-fast) var(--rt-motion-ease);
}

.bottom-nav .bottom-nav-item:hover,
.bottom-nav button:hover {
  color: var(--rt-ink-secondary) !important;
}

.bottom-nav .bottom-nav-item.is-active,
.bottom-nav button.is-active {
  background: var(--rt-turquoise-mist) !important;
  color: var(--rt-turquoise-deep) !important;
  box-shadow: none !important;
}

.bottom-nav .bottom-nav-item.is-active::after,
.bottom-nav button.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 4px;
  width: 18px;
  height: 2px;
  border-radius: var(--rt-radius-pill);
  background: var(--rt-turquoise);
  transform: translateX(-50%);
}

.bottom-nav .bottom-nav-item:active,
.bottom-nav button:active {
  transform: scale(0.97);
}

.bottom-nav button small {
  display: block !important;
  color: inherit !important;
  font-size: clamp(0.56rem, 2.25vw, 0.69rem) !important;
  font-weight: 600 !important;
  letter-spacing: -0.015em;
  text-overflow: clip !important;
}

.bottom-nav .nav-icon,
.bottom-nav button > .nav-icon {
  width: 22px !important;
  height: 22px !important;
  display: block !important;
  place-items: initial !important;
  background-color: currentColor;
  font-size: 0 !important;
  line-height: 0 !important;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 21px 21px;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: 21px 21px;
}

.bottom-nav [data-route="dashboard"] .nav-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 11.2 12 4l8 7.2V20H7a3 3 0 0 1-3-3v-5.8Z' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M9.5 20v-5h5v5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 11.2 12 4l8 7.2V20H7a3 3 0 0 1-3-3v-5.8Z' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M9.5 20v-5h5v5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.bottom-nav [data-route="history"] .nav-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 6h14M5 12h14M5 18h9' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3Ccircle cx='18' cy='18' r='2' fill='none' stroke='black' stroke-width='1.8'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 6h14M5 12h14M5 18h9' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3Ccircle cx='18' cy='18' r='2' fill='none' stroke='black' stroke-width='1.8'/%3E%3C/svg%3E");
}

.bottom-nav [data-route="calendar"] .nav-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='5.5' width='16' height='14.5' rx='3' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M8 3.5v4M16 3.5v4M4 10h16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='5.5' width='16' height='14.5' rx='3' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M8 3.5v4M16 3.5v4M4 10h16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

.bottom-nav [data-route="charts"] .nav-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 19V9M12 19V5M19 19v-7' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3Cpath d='M3.5 19.5h17' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 19V9M12 19V5M19 19v-7' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3Cpath d='M3.5 19.5h17' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

.bottom-nav [data-route="settings"] .nav-icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='3' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.9l.1.1-2.8 2.8-.1-.1a1.7 1.7 0 0 0-1.9-.3 1.7 1.7 0 0 0-1 1.6v.2h-4V21a1.7 1.7 0 0 0-1-1.6 1.7 1.7 0 0 0-1.9.3l-.1.1L4.2 17l.1-.1a1.7 1.7 0 0 0 .3-1.9A1.7 1.7 0 0 0 3 14H2.8v-4H3a1.7 1.7 0 0 0 1.6-1 1.7 1.7 0 0 0-.3-1.9L4.2 7 7 4.2l.1.1A1.7 1.7 0 0 0 9 4.6 1.7 1.7 0 0 0 10 3v-.2h4V3a1.7 1.7 0 0 0 1 1.6 1.7 1.7 0 0 0 1.9-.3l.1-.1L19.8 7l-.1.1a1.7 1.7 0 0 0-.3 1.9 1.7 1.7 0 0 0 1.6 1h.2v4H21a1.7 1.7 0 0 0-1.6 1Z' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='3' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.9l.1.1-2.8 2.8-.1-.1a1.7 1.7 0 0 0-1.9-.3 1.7 1.7 0 0 0-1 1.6v.2h-4V21a1.7 1.7 0 0 0-1-1.6 1.7 1.7 0 0 0-1.9.3l-.1.1L4.2 17l.1-.1a1.7 1.7 0 0 0 .3-1.9A1.7 1.7 0 0 0 3 14H2.8v-4H3a1.7 1.7 0 0 0 1.6-1 1.7 1.7 0 0 0-.3-1.9L4.2 7 7 4.2l.1.1A1.7 1.7 0 0 0 9 4.6 1.7 1.7 0 0 0 10 3v-.2h4V3a1.7 1.7 0 0 0 1 1.6 1.7 1.7 0 0 0 1.9-.3l.1-.1L19.8 7l-.1.1a1.7 1.7 0 0 0-.3 1.9 1.7 1.7 0 0 0 1.6 1h.2v4H21a1.7 1.7 0 0 0-1.6 1Z' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* =========================================================
   PANTALLA HOY
   ========================================================= */

.today-personal-layout,
.personal-order-screen.today-personal-layout {
  gap: var(--rt-space-6) !important;
  padding-bottom: var(--rt-space-6);
}

.personal-page-heading {
  align-items: center;
  padding: 0 2px;
}

.personal-page-heading > div:first-child > span {
  color: var(--rt-muted) !important;
  font-size: 0.7rem;
  font-weight: 600 !important;
  letter-spacing: 0.08em;
}

.personal-page-heading h2 {
  margin-top: 5px;
  color: var(--rt-ink);
  font-size: clamp(1.85rem, 7vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1;
}

.today-metric-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(132px, 0.72fr);
  gap: var(--rt-space-3);
}

.today-main-metric,
.today-sales-metric {
  min-height: 144px;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--rt-border) !important;
  border-radius: var(--rt-radius-xl) !important;
  background: var(--rt-surface) !important;
  box-shadow: var(--rt-shadow-card);
}

.today-main-metric {
  position: relative;
  padding-bottom: 34px;
}

.today-main-metric::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 20px;
  height: 2px;
  border-radius: var(--rt-radius-pill);
  background: var(--rt-border);
}

.today-main-metric::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: 17px;
  width: min(62%, 220px);
  height: 8px;
  border-radius: var(--rt-radius-pill);
  background:
    radial-gradient(circle at 0 50%, var(--rt-turquoise) 0 4px, transparent 4.5px),
    radial-gradient(circle at 100% 50%, var(--rt-turquoise) 0 4px, transparent 4.5px),
    linear-gradient(var(--rt-turquoise), var(--rt-turquoise)) center / calc(100% - 8px) 2px no-repeat;
}

.today-main-metric span,
.today-sales-metric span,
.closure-summary-grid span,
.day-metric span {
  color: var(--rt-muted) !important;
  font-size: 0.72rem;
  font-weight: 600 !important;
  letter-spacing: 0.035em;
  text-transform: none;
}

.today-main-metric strong {
  position: relative;
  z-index: 1;
  color: var(--rt-ink) !important;
  font-size: clamp(2.2rem, 9vw, 3.35rem);
  font-weight: 700 !important;
  letter-spacing: -0.065em;
  line-height: 0.95;
}

.today-sales-metric {
  align-content: center;
  background: var(--rt-surface-soft) !important;
  box-shadow: none;
}

.today-sales-metric strong {
  color: var(--rt-turquoise-deep);
  font-size: clamp(2rem, 8vw, 2.8rem);
  font-weight: 700 !important;
  letter-spacing: -0.055em;
  line-height: 1;
}

.personal-section-card {
  padding: var(--rt-space-6) !important;
  border-radius: var(--rt-radius-xl) !important;
}

.personal-section-heading h3 {
  color: var(--rt-ink);
  font-size: 1.15rem;
  font-weight: 700 !important;
  letter-spacing: -0.03em;
}

.personal-section-heading p {
  margin-top: 6px;
  color: var(--rt-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Registro rápido */
.register-sale-section {
  gap: var(--rt-space-5) !important;
}

.personal-concept-grid {
  gap: 10px !important;
  margin-top: 0 !important;
}

.personal-concept-card {
  position: relative;
  min-height: 90px !important;
  padding: 15px 44px 15px 15px !important;
  border: 1px solid var(--rt-border) !important;
  border-radius: var(--rt-radius-lg) !important;
  background: var(--rt-surface) !important;
  color: var(--rt-ink) !important;
  box-shadow: none;
  transition:
    border-color var(--rt-motion-fast) var(--rt-motion-ease),
    background-color var(--rt-motion-fast) var(--rt-motion-ease),
    transform var(--rt-motion-fast) var(--rt-motion-ease);
}

.personal-concept-card:hover {
  border-color: rgba(18, 191, 166, 0.48) !important;
  background: var(--rt-surface-soft) !important;
}

.personal-concept-card:active {
  transform: scale(0.985);
}

.personal-concept-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 0 var(--rt-radius-pill) var(--rt-radius-pill) 0;
  background: var(--rt-turquoise);
  opacity: 0;
  transition: opacity var(--rt-motion-fast) var(--rt-motion-ease);
}

.personal-concept-card:hover::before,
.personal-concept-card:focus-visible::before {
  opacity: 1;
}

.personal-concept-card::after {
  content: "+" !important;
  right: 14px !important;
  bottom: 50% !important;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(18, 191, 166, 0.18);
  border-radius: 50%;
  background: var(--rt-turquoise-mist);
  color: var(--rt-turquoise-deep) !important;
  font-size: 1.05rem !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  transform: translateY(50%);
}

.personal-concept-card strong {
  color: var(--rt-ink);
  font-size: 0.92rem !important;
  font-weight: 650 !important;
  letter-spacing: -0.02em;
}

.personal-concept-card span {
  width: auto !important;
  margin-top: 7px !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--rt-turquoise-deep) !important;
  font-size: 0.74rem !important;
  font-weight: 600 !important;
}

.today-register-hint {
  padding: 14px;
  border: 1px dashed #cdd9d8;
  border-radius: var(--rt-radius-lg);
  background: var(--rt-surface-soft);
  color: var(--rt-muted);
}

/* Ventas de hoy: composición por filas, sin tarjetas anidadas. */
.today-sales-disclosure {
  border: 1px solid var(--rt-border) !important;
  border-radius: var(--rt-radius-lg) !important;
  background: var(--rt-surface-soft) !important;
}

.today-sales-disclosure > summary {
  min-height: 66px;
  padding: 14px 16px;
}

.today-sales-disclosure > summary strong {
  color: var(--rt-ink);
  font-size: 0.88rem;
  font-weight: 650 !important;
}

.today-sales-disclosure > summary small {
  color: var(--rt-muted);
  font-size: 0.72rem;
  font-weight: 500 !important;
}

.today-sales-disclosure > summary i {
  color: var(--rt-muted);
  font-weight: 500 !important;
}

.today-sales-disclosure[open] > summary {
  border-bottom: 1px solid var(--rt-border) !important;
}

.today-sales-disclosure[open] > summary i {
  color: var(--rt-turquoise-deep);
}

.today-sales-disclosure-content {
  gap: 0 !important;
  padding: 4px 14px 14px !important;
}

.today-recent-sale {
  min-height: 64px;
  padding: 13px 2px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--rt-border) !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.today-recent-sale:last-of-type {
  border-bottom: 0 !important;
}

.today-recent-sale:hover {
  background: rgba(231, 250, 246, 0.48) !important;
}

.today-recent-sale-main strong {
  color: var(--rt-ink);
  font-size: 0.82rem;
  font-weight: 650 !important;
}

.today-recent-sale-main small {
  color: var(--rt-muted);
  font-size: 0.69rem;
}

.today-recent-sale-side b {
  color: var(--rt-ink-secondary) !important;
  font-size: 0.85rem;
  font-weight: 650 !important;
}

.today-sale-status {
  padding: 4px 7px;
  font-size: 0.58rem !important;
}

/* Objetivos en Hoy */
.dashboard-objectives-disclosure {
  border-radius: var(--rt-radius-xl) !important;
}

.dashboard-objectives-summary {
  min-height: 76px;
  padding: 17px 20px;
}

.dashboard-objectives-summary-copy strong {
  color: var(--rt-ink);
  font-size: 0.96rem;
  font-weight: 650 !important;
}

.dashboard-objectives-summary-copy small {
  color: var(--rt-muted);
  font-weight: 500 !important;
}

.dashboard-objectives-summary-status b {
  min-width: 50px;
  min-height: 30px;
  border: 1px solid rgba(18, 191, 166, 0.18);
  background: var(--rt-turquoise-mist) !important;
  color: var(--rt-turquoise-deep) !important;
  font-size: 0.76rem;
  font-weight: 650 !important;
}

.dashboard-objectives-disclosure[open] .dashboard-objectives-summary {
  border-bottom-color: var(--rt-border) !important;
}

.dashboard-objectives-content {
  padding: 16px 20px 20px;
}

.dashboard-objectives-disclosure .objective-progress-card {
  padding: 15px;
  border: 1px solid var(--rt-border) !important;
  border-radius: var(--rt-radius-lg) !important;
  background: var(--rt-surface-soft) !important;
  box-shadow: none !important;
}

.objective-progress-heading strong,
.objective-value-line strong,
.objective-progress-footer b {
  font-weight: 650 !important;
}

.objective-progress-heading b {
  color: var(--rt-turquoise-deep) !important;
  font-weight: 650 !important;
}

.objective-progress-track {
  height: 8px;
  background: var(--rt-border) !important;
}

.objective-progress-track span {
  background: var(--rt-turquoise) !important;
}

.objective-progress-card.is-achieved {
  border-color: rgba(18, 191, 166, 0.26) !important;
  background: var(--rt-turquoise-mist) !important;
}

/* Control de cierres */
.closures-personal-section {
  gap: var(--rt-space-5);
}

.closures-personal-section > .personal-wide-action {
  margin-top: 0;
}

.closure-summary-grid {
  gap: var(--rt-space-4);
  margin-top: 0;
  padding: 15px 0;
  border-top: 1px solid var(--rt-border);
  border-bottom: 1px solid var(--rt-border);
}

.closure-summary-grid article {
  padding: 0 4px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.closure-summary-grid article + article {
  padding-left: var(--rt-space-5) !important;
  border-left: 1px solid var(--rt-border) !important;
}

.closure-summary-grid strong {
  margin-top: 7px;
  color: var(--rt-ink);
  font-size: 1.35rem;
  font-weight: 650 !important;
}

.closure-summary-grid article:last-child strong {
  color: #a7640d !important;
}

.personal-closure-list {
  gap: 0 !important;
  margin-top: 0 !important;
}

.personal-closure-item {
  position: relative;
  min-height: 82px;
  padding: 15px 0 15px 22px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--rt-border) !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.personal-closure-item:last-child {
  border-bottom: 0 !important;
}

.personal-closure-item::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 22px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--rt-pending);
  border-radius: 50%;
  background: var(--rt-surface);
  box-shadow: 0 0 0 4px var(--rt-pending-soft);
}

.personal-closure-item::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 37px;
  bottom: -1px;
  width: 1px;
  background: var(--rt-border);
}

.personal-closure-item:last-child::after {
  display: none;
}

.personal-closure-item strong,
.personal-closure-side b {
  color: var(--rt-ink);
  font-weight: 650 !important;
}

.personal-closure-item span,
.personal-closure-item small {
  color: var(--rt-muted);
  font-weight: 450 !important;
}

.personal-closure-side button {
  min-height: 36px;
  margin-top: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(18, 191, 166, 0.24) !important;
  border-radius: var(--rt-radius-pill) !important;
  background: var(--rt-turquoise-mist) !important;
  color: var(--rt-turquoise-deep) !important;
  font-weight: 600 !important;
}

.personal-empty-state,
.personal-search-empty {
  border-color: #cdd9d8 !important;
  border-radius: var(--rt-radius-lg) !important;
  background: var(--rt-surface-soft) !important;
}

.personal-empty-state strong,
.personal-search-empty strong {
  color: var(--rt-ink);
  font-weight: 650;
}

/* =========================================================
   REGISTRO RÁPIDO Y EDITOR ABIERTO DESDE HOY
   ========================================================= */

.sale-modal-backdrop,
.sale-editor-backdrop {
  background: rgba(7, 26, 38, 0.44) !important;
  backdrop-filter: blur(8px);
}

.sale-modal-card,
.sale-editor-card {
  border: 1px solid rgba(223, 232, 231, 0.95);
  border-radius: var(--rt-radius-2xl) var(--rt-radius-2xl) 20px 20px !important;
  background: var(--rt-surface) !important;
  box-shadow: var(--rt-shadow-panel) !important;
}

.sale-modal-header,
.sale-editor-header {
  margin-bottom: var(--rt-space-5);
}

.sale-modal-header span,
.sale-editor-header span {
  color: var(--rt-muted) !important;
  font-size: 0.75rem;
  font-weight: 600 !important;
  letter-spacing: 0.03em;
  text-transform: none;
}

.sale-modal-header h3,
.sale-editor-header h3 {
  color: var(--rt-ink);
  font-size: 1.5rem;
  font-weight: 700 !important;
  letter-spacing: -0.045em;
}

.modal-close-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--rt-border) !important;
  border-radius: 50% !important;
  background: var(--rt-surface-soft) !important;
  color: var(--rt-ink-secondary);
  font-weight: 400 !important;
  box-shadow: none !important;
}

.modal-close-btn:hover {
  border-color: #bfd0ce !important;
  background: var(--rt-turquoise-mist) !important;
  color: var(--rt-turquoise-deep);
}

.sale-modal-preview,
.editor-preview-card {
  position: relative;
  padding: 16px 17px 18px 20px !important;
  border: 1px solid rgba(18, 191, 166, 0.18);
  border-radius: var(--rt-radius-lg) !important;
  background: var(--rt-turquoise-mist) !important;
  overflow: hidden;
}

.sale-modal-preview::before,
.editor-preview-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--rt-turquoise);
}

.sale-modal-preview span,
.editor-preview-card span {
  color: var(--rt-slate) !important;
  font-size: 0.76rem;
  font-weight: 550 !important;
}

.sale-modal-preview strong,
.editor-preview-card strong {
  color: var(--rt-ink) !important;
  font-size: 1.75rem;
  font-weight: 700 !important;
  letter-spacing: -0.05em;
}

.sale-modal-preview small,
.editor-preview-card small {
  color: var(--rt-muted) !important;
}

.advanced-sale,
.editor-history-panel {
  border-color: var(--rt-border) !important;
}

.advanced-sale summary,
.editor-history-panel summary {
  color: var(--rt-slate) !important;
  font-weight: 600 !important;
}

.composite-register-box,
.editor-sale-block,
.editor-component-row {
  border: 1px solid var(--rt-border) !important;
  border-radius: var(--rt-radius-lg) !important;
  background: var(--rt-surface-soft) !important;
}

.composite-register-item {
  border: 0 !important;
  border-bottom: 1px solid var(--rt-border) !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.composite-register-item:last-child {
  border-bottom: 0 !important;
}

.dashboard-fast-sale-actions {
  gap: 10px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.98) 24%,
    #ffffff 62%
  ) !important;
}

.toast {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--rt-radius-lg) !important;
  background: rgba(7, 26, 38, 0.96) !important;
  box-shadow: var(--rt-shadow-panel) !important;
}

.toast.is-success {
  background: rgba(7, 141, 126, 0.97) !important;
}

.toast.is-error {
  background: rgba(217, 74, 74, 0.97) !important;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    border-color: #cfdcda !important;
  }
}

@media (min-width: 720px) {
  #view-root {
    padding-top: var(--rt-space-6);
  }

  .app-header {
    padding-top: 18px;
  }

  .today-personal-layout {
    gap: var(--rt-space-8) !important;
  }

  .today-metric-grid {
    grid-template-columns: minmax(0, 1.7fr) minmax(180px, 0.72fr);
  }

  .personal-concept-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .sale-modal-backdrop,
  .sale-editor-backdrop {
    align-items: center !important;
  }

  .sale-modal-card,
  .sale-editor-card {
    border-radius: var(--rt-radius-2xl) !important;
  }
}

@media (max-width: 560px) {
  :root {
    --rt-page-x: 14px;
  }

  #view-root {
    padding-top: var(--rt-space-4);
  }

  .app-header {
    padding-inline: 0 !important;
  }

  .app-header h1 {
    max-width: 220px;
  }

  .today-metric-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(104px, 0.72fr) !important;
    gap: 10px;
  }

  .today-main-metric,
  .today-sales-metric {
    min-height: 126px !important;
    padding: 17px !important;
  }

  .today-main-metric {
    padding-bottom: 31px !important;
  }

  .today-main-metric::before {
    left: 17px;
    right: 17px;
    bottom: 18px;
  }

  .today-main-metric::after {
    left: 17px;
    bottom: 15px;
  }

  .today-main-metric strong {
    font-size: clamp(1.95rem, 9.5vw, 2.8rem);
  }

  .today-sales-metric strong {
    font-size: clamp(1.8rem, 8.5vw, 2.45rem);
  }

  .personal-section-card {
    padding: 18px !important;
  }

  .personal-concept-card {
    min-height: 84px !important;
    padding: 14px 40px 14px 14px !important;
  }

  .dashboard-objectives-summary {
    padding-inline: 18px;
  }

  .dashboard-objectives-content {
    padding-inline: 18px;
  }

  .personal-closure-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .sale-modal-backdrop,
  .sale-editor-backdrop {
    padding: 0 !important;
  }

  .sale-modal-card,
  .sale-editor-card {
    border-radius: var(--rt-radius-2xl) var(--rt-radius-2xl) 0 0 !important;
  }

  .dashboard-fast-sale-actions {
    background: transparent !important;
  }
}

@media (max-width: 390px) {
  .bottom-nav {
    width: calc(100vw - 14px) !important;
    max-width: calc(100vw - 14px) !important;
    gap: 1px !important;
    padding-inline: 5px !important;
  }

  .bottom-nav .bottom-nav-item,
  .bottom-nav button {
    min-height: 54px;
    padding-inline: 0 !important;
  }

  .bottom-nav button small,
  .bottom-nav button[data-route="calendar"] small,
  .bottom-nav button[data-route="history"] small {
    display: block !important;
    font-size: 0.54rem !important;
    letter-spacing: -0.03em !important;
  }

  .personal-page-heading h2 {
    font-size: 1.8rem;
  }

  .sync-chip {
    padding-inline: 9px;
    font-size: 0.64rem;
  }

  .today-metric-grid {
    grid-template-columns: minmax(0, 1fr) 98px !important;
  }

  .today-main-metric,
  .today-sales-metric {
    min-height: 118px !important;
    padding-inline: 14px !important;
  }

  .today-main-metric strong {
    font-size: clamp(1.75rem, 9vw, 2.35rem);
  }

  .today-sales-metric strong {
    font-size: 2rem;
  }

  .personal-section-card {
    padding: 16px !important;
  }

  .personal-concept-grid {
    gap: 8px !important;
  }

  .personal-concept-card {
    min-height: 80px !important;
    padding: 12px 36px 12px 12px !important;
  }

  .personal-concept-card::after {
    right: 10px !important;
    width: 23px;
    height: 23px;
  }

  .personal-concept-card strong {
    font-size: 0.82rem !important;
  }

  .personal-closure-item {
    padding-left: 20px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
