:root {
  --bg: #f3f5f8;
  --bg-elev: #ffffff;
  --ink: #2a2c2e;
  --muted: #6b7280;
  --line: #e6e9ee;
  --brand: #d10a35;
  --brand-soft: #fde8ee;
  --brand-2: #3b82f6;
  --accent-blue: #3b82f6;
  --accent-green: #4fb9ae;
  --accent-yellow: #f59e0b;
  --accent-gray: #727477;
  --ok: #4fb9ae;
  --danger: #d10a35;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(42, 44, 46, 0.06);
  --shadow-sm: 0 1px 2px rgba(42, 44, 46, 0.04);
  --tap: 48px;
  --sidebar-w: 272px;
  --header-h: 64px;
  --font: "Montserrat", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --fw-light: 300;
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-bold: 500;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  font-weight: var(--fw-normal);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

strong,
b {
  font-weight: var(--fw-medium);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--fw-medium);
}

.g-kpi span:not(.g-kpi-ico),
.g-act-table th,
.g-tag,
.share-badge,
.qr-list-stat span,
.dtp-time-label,
.dtp-dow,
.field > span,
.g-form label > span:first-child {
  font-weight: var(--fw-normal);
}

.dtp-time-item,
.dtp-day,
.dtp-cal-title {
  font-weight: var(--fw-normal);
}

body.no-scroll {
  overflow: hidden;
}

a {
  color: var(--brand);
  text-decoration: none;
}

button {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.inline {
  display: inline;
}

/* ===== App shell: sidebar + header + workspace ===== */
.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  z-index: 40;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(var(--sidebar-w), 88vw);
  background: #fff;
  border-right: 1px solid var(--line);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.app-shell.sidebar-open .sidebar {
  transform: translateX(0);
}

.app-shell.sidebar-open .sidebar-backdrop {
  display: block;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--line);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  min-width: 0;
}

.sidebar-brand-text {
  min-width: 0;
}

.sidebar-logo strong {
  display: block;
  color: var(--brand);
  font-size: 0.78rem;
  line-height: 1.2;
  font-weight: var(--fw-medium);
}

.sidebar-logo small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  line-height: 1.25;
  margin-top: 2px;
}

.sidebar-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  background:
    linear-gradient(145deg, var(--accent-blue) 0%, var(--brand) 55%, var(--accent-yellow) 140%);
}

.sidebar-mark-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.sidebar-logout {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(209, 10, 53, 0.22);
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  font-weight: var(--fw-medium);
  cursor: pointer;
}

.sidebar-logout:hover {
  background: #fad7e0;
}

.sidebar-close {
  appearance: none;
  border: 0;
  background: var(--bg);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 1.4rem;
  color: var(--muted);
  cursor: pointer;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.sidebar-avatar,
.header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e8edf2;
  color: #6b7280;
  display: grid;
  place-items: center;
  font-weight: var(--fw-medium);
  flex-shrink: 0;
  overflow: hidden;
}

.header-avatar.has-photo,
.profile-avatar.has-photo,
.user-avatar-letter.has-photo {
  padding: 0;
  background: #e8eef5;
}

.header-avatar img,
.profile-avatar img,
.user-avatar-letter img,
.user-foto-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sidebar-user-meta {
  display: grid;
  min-width: 0;
}

.sidebar-user-meta strong,
.header-user-text strong {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-meta span,
.header-user-text span {
  color: var(--muted);
  font-size: 0.78rem;
}

.sidebar-nav {
  padding: 14px 12px;
  overflow-y: auto;
  flex: 1;
  display: grid;
  gap: 3px;
  align-content: start;
}

.nav-link,
.nav-group-btn {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: var(--fw-normal);
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
}

.nav-link:hover,
.nav-group-btn:hover {
  background: #f4f6f9;
}

.nav-link.is-active,
.nav-group-btn.is-active {
  background: var(--brand);
  color: #fff;
  font-weight: var(--fw-medium);
}

.nav-ico {
  display: grid;
  place-items: center;
  color: inherit;
  opacity: 0.9;
}

.nav-chevron {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
  opacity: 0.55;
}

.nav-group.is-open .nav-chevron {
  transform: rotate(-135deg);
}

.nav-submenu {
  display: none;
  padding: 2px 0 8px 18px;
  gap: 2px;
}

.nav-group.is-open .nav-submenu {
  display: grid;
}

.nav-divider {
  height: 1px;
  margin: 10px 12px;
  background: var(--line);
  opacity: 0.9;
}

.nav-sublink {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px 0 28px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: var(--fw-normal);
  font-size: 0.88rem;
  position: relative;
}

.nav-sublink::before {
  content: "";
  position: absolute;
  left: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b7c2cf;
}

.nav-sublink:hover {
  background: #f4f7fb;
  color: var(--ink);
}

.nav-sublink.is-active {
  background: var(--brand-soft);
  color: var(--brand);
}

.nav-sublink.is-active::before {
  background: var(--brand);
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.header-search {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  transition: width 0.2s ease;
}

.header-search input {
  border: 0;
  outline: none;
  width: 0;
  padding: 0;
  font: inherit;
  font-size: 0.88rem;
  background: transparent;
  color: var(--ink);
  opacity: 0;
  min-width: 0;
  pointer-events: none;
}

.header-search.is-open {
  width: min(240px, 52vw);
}

.header-search.is-open input {
  width: 100%;
  padding: 0 12px 0 2px;
  opacity: 1;
  pointer-events: auto;
}

.header-ico-btn {
  appearance: none;
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}

.header-search .header-ico-btn {
  border: 0;
  width: 40px;
  height: 40px;
}

.header-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.62rem;
  font-weight: var(--fw-bold);
  font-style: normal;
  display: grid;
  place-items: center;
  line-height: 1;
}

.header-pop {
  position: relative;
}

.header-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(340px, 86vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 90;
  padding: 8px;
  display: grid;
}

.header-panel[hidden] {
  display: none !important;
}

.header-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 8px;
}

.header-panel-head strong {
  font-size: 0.88rem;
}

.header-panel-head a,
.header-panel-link {
  appearance: none;
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  font-size: 0.78rem;
  font-weight: var(--fw-medium);
  cursor: pointer;
  text-decoration: none;
}

.header-panel-empty {
  margin: 0;
  padding: 16px 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.header-panel-item {
  display: grid;
  gap: 2px;
  padding: 10px 10px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}

.header-panel-item:hover {
  background: #f6f7f9;
}

.header-panel-item strong {
  font-size: 0.85rem;
}

.header-panel-item span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: var(--fw-normal);
}

.header-panel-item.is-unread {
  background: var(--brand-soft);
}

.header-menu-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-content: center;
  gap: 5px;
  cursor: pointer;
  flex-shrink: 0;
}

.header-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
}

.header-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-user {
  display: none;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.header-user-text {
  display: grid;
  min-width: 0;
}

.workspace {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px 16px 96px;
  flex: 1;
}

/* Formularios: contenido legible centrado */
.workspace:has(.page-gestion-form) {
  max-width: none;
}

@media (min-width: 900px) {
  .workspace {
    padding-left: 24px;
    padding-right: 28px;
  }
}

.auth-main {
  width: 100%;
  margin: 0;
  padding: 0;
}

.auth-body {
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(209, 10, 53, 0.1) 0%, transparent 55%),
    radial-gradient(820px 480px at 100% 0%, rgba(139, 109, 97, 0.16) 0%, transparent 50%),
    radial-gradient(700px 400px at 80% 110%, rgba(59, 130, 246, 0.08) 0%, transparent 46%),
    #f4f5f7;
  background-image:
    radial-gradient(900px 520px at 8% -8%, rgba(209, 10, 53, 0.1) 0%, transparent 55%),
    radial-gradient(820px 480px at 100% 0%, rgba(139, 109, 97, 0.16) 0%, transparent 50%),
    radial-gradient(circle, rgba(42, 44, 46, 0.07) 1px, transparent 1.2px),
    linear-gradient(#f4f5f7, #f4f5f7);
  background-size: auto, auto, 22px 22px, auto;
}

.page-title {
  margin: 0 0 4px;
  font-size: 1.55rem;
  line-height: 1.2;
  font-weight: var(--fw-medium);
  letter-spacing: -0.02em;
}

.page-sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: var(--fw-normal);
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.back-link {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (min-width: 992px) {
  .app-shell {
    grid-template-columns: var(--sidebar-w) 1fr;
  }

  .sidebar {
    position: sticky;
    transform: none;
    height: 100dvh;
  }

  .sidebar-backdrop,
  .sidebar-close,
  .header-menu-btn {
    display: none !important;
  }

  .app-shell.sidebar-open .sidebar-backdrop {
    display: none;
  }

  .header-user {
    display: flex;
  }

  .workspace {
    padding: 28px 36px 48px;
  }

  .header-title {
    font-size: 1.25rem;
  }
}


.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 22px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: var(--fw-normal);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.btn-sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: var(--fw-normal);
}

.btn-block {
  width: auto;
  min-width: 220px;
}

.g-form-actions .btn-primary,
.form-card > .btn-primary,
.form-card .g-form-actions .btn-primary {
  min-width: 220px;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(209, 10, 53, 0.18);
  font-weight: var(--fw-medium);
}

.btn-primary:hover {
  filter: brightness(0.96);
}

.btn-secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: #cfd4dc;
  background: #fafbfc;
}

.area-card-marketing .btn-secondary {
  border-color: rgba(79, 185, 174, 0.45);
  color: #1f7a72;
  background: rgba(79, 185, 174, 0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-danger {
  background: #fff5f4;
  color: var(--danger);
  border-color: #f3c4bf;
}

.menu-grid {
  display: grid;
  gap: 12px;
}

.menu-tile {
  display: grid;
  gap: 4px;
  padding: 20px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  border-left: 4px solid var(--brand);
}

.menu-label {
  font-size: 1.2rem;
  font-weight: var(--fw-medium);
}

.menu-desc {
  color: var(--muted);
  font-size: 0.92rem;
}

.area-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .area-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.area-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.area-card-imagen,
.area-card-marketing {
  border-top: 0;
}

.user-menu {
  position: relative;
}

.user-menu-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  cursor: pointer;
  min-height: 44px;
}

.user-menu-caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  margin-right: 4px;
}

.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 80;
  display: grid;
  gap: 2px;
}

.user-menu-dropdown[hidden] {
  display: none !important;
}

.user-menu-item {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: var(--fw-medium);
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.user-menu-item:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.user-menu-danger {
  color: var(--brand);
}

.user-menu-form {
  margin: 0;
}

.area-card-head {
  display: grid;
  gap: 6px;
}

.area-badge {
  display: inline-flex;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.area-badge-red {
  background: var(--brand-soft);
  color: var(--brand);
}

.area-badge-teal {
  background: rgba(79, 185, 174, 0.16);
  color: #1f7a72;
}

.area-title {
  margin: 0;
  font-size: 1.45rem;
  color: var(--ink);
}

.area-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.stat-chip {
  border-radius: 14px;
  padding: 14px 12px;
  display: grid;
  gap: 2px;
}

.stat-chip em {
  font-style: normal;
  font-size: 1.8rem;
  font-weight: var(--fw-bold);
  line-height: 1.1;
}

.stat-chip span {
  font-size: 0.85rem;
  font-weight: var(--fw-medium);
  color: var(--muted);
}

.stat-chip-blue {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4f9c;
}

.stat-chip-green {
  background: rgba(79, 185, 174, 0.16);
  color: #1f7a72;
}

.stat-chip-yellow {
  background: rgba(245, 158, 11, 0.16);
  color: #9a6208;
}

.stat-bars {
  display: grid;
  gap: 10px;
}

.stat-bar {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: var(--fw-medium);
}

.stat-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #eceeef;
  overflow: hidden;
}

.stat-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  min-width: 8px;
}

.fill-blue {
  background: var(--accent-blue);
}

.fill-green {
  background: var(--accent-green);
}

.fill-yellow {
  background: var(--accent-yellow);
}

.auth-screen {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  gap: 0;
  padding: 5vh 28px 6vh;
  max-width: 1180px;
  margin: 0 auto;
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  min-width: 0;
}

.auth-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
}

.auth-brand strong {
  display: block;
  font-size: 1.05rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  color: var(--brand);
  line-height: 1.1;
}

.auth-brand small {
  display: block;
  margin-top: 3px;
  color: #6b5b54;
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.01em;
}

.auth-top-mark {
  margin: 0;
  color: #6b5b54;
  font-size: 0.78rem;
  font-weight: var(--fw-medium);
  text-align: right;
  max-width: 220px;
  line-height: 1.3;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 40px 56px;
  align-items: center;
  align-self: center;
  padding: 5vh 0 2vh;
}

.auth-col {
  display: grid;
  gap: 16px;
}

.auth-card {
  width: 100%;
  background: #fff;
  border: 1px solid rgba(230, 233, 238, 0.9);
  border-radius: 28px;
  padding: 32px 30px 28px;
  box-shadow: 0 18px 50px rgba(42, 44, 46, 0.08);
}

.auth-kicker {
  margin: 0;
  color: var(--brand);
  font-weight: var(--fw-medium);
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.auth-title {
  margin: 8px 0 0;
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #2a2c2e;
  font-weight: var(--fw-medium);
}

.auth-sub {
  margin: 10px 0 22px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  font-weight: var(--fw-normal);
}

.auth-form {
  display: grid;
  gap: 18px;
}

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

.auth-field span {
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-field input {
  width: 100%;
  border: 0;
  border-bottom: 1.5px solid #d8dde4;
  border-radius: 0;
  padding: 8px 2px 10px;
  font: inherit;
  font-size: 16px;
  background: transparent;
  color: var(--ink);
}

.auth-field input:focus {
  outline: none;
  border-bottom-color: var(--brand);
  box-shadow: none;
}

.auth-submit {
  margin-top: 8px;
  width: 100%;
  min-height: 44px;
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.auth-tips {
  background: #fff;
  border: 1px solid rgba(230, 233, 238, 0.9);
  border-radius: 22px;
  padding: 18px 20px 16px;
  box-shadow: 0 10px 28px rgba(42, 44, 46, 0.05);
}

.auth-tips-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: #8b6d61;
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-tip {
  display: none;
}

.auth-tip.is-active {
  display: block;
}

.auth-tip strong {
  display: block;
  font-size: 0.95rem;
  color: var(--ink);
}

.auth-tip p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  font-weight: var(--fw-normal);
}

.auth-tips-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.auth-dots {
  display: flex;
  gap: 6px;
}

.auth-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d5d8de;
  display: block;
}

.auth-dots i.is-on {
  background: var(--brand);
}

.auth-tip-btn {
  appearance: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.auth-hero {
  padding: 12px 8px 0 12px;
}

.auth-hero-visual {
  position: relative;
  min-height: 340px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
}

.auth-hero-mark {
  width: min(340px, 100%);
  aspect-ratio: 1;
  border-radius: 36px;
  background: #fff;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 28px 24px 22px;
  box-shadow:
    0 0 0 8px rgba(209, 10, 53, 0.06),
    0 24px 50px rgba(42, 44, 46, 0.1);
}

.auth-hero-mark img {
  width: 72%;
  max-height: 190px;
  height: auto;
  object-fit: contain;
}

.auth-hero-mark p {
  margin: 0;
  text-align: center;
}

.auth-hero-mark strong {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.auth-hero-mark em {
  display: block;
  margin-top: 4px;
  font-style: italic;
  font-size: 0.82rem;
  color: #6b5b54;
  font-weight: var(--fw-normal);
}

.auth-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: var(--fw-medium);
  box-shadow: 0 10px 24px rgba(42, 44, 46, 0.12);
  z-index: 1;
}

.auth-chip-light {
  top: 18px;
  left: 8%;
  background: #fff;
  color: #5b4a44;
}

.auth-chip-white {
  top: 28%;
  right: 2%;
  background: #fff;
  color: var(--brand);
}

.auth-chip-brand {
  bottom: 22%;
  left: 0;
  background: var(--brand);
  color: #fff;
}

.auth-chip-dark {
  bottom: 10px;
  right: 10%;
  background: #2a2c2e;
  color: #fff;
}

.auth-hero h2 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  color: #2a2c2e;
}

.auth-hero > p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 42ch;
  font-weight: var(--fw-normal);
}

.auth-foot {
  display: none;
  margin: 0;
  text-align: center;
  color: #6b5b54;
  font-size: 0.75rem;
  font-weight: var(--fw-medium);
  line-height: 1.35;
}

@media (max-width: 900px) {
  .auth-screen {
    padding: 36px 20px max(20px, env(safe-area-inset-bottom));
    align-content: stretch;
    grid-template-rows: auto 1fr auto;
  }

  .auth-top {
    justify-content: center;
  }

  .auth-brand {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    text-decoration: none;
  }

  .auth-brand img {
    width: 88px;
    height: 88px;
  }

  .auth-brand strong {
    font-size: 2rem;
    letter-spacing: 0.06em;
  }

  .auth-brand small {
    margin-top: 4px;
    font-size: 0.88rem;
    max-width: 16em;
    line-height: 1.35;
  }

  .auth-top-mark,
  .auth-hero,
  .auth-tips {
    display: none;
  }

  .auth-grid {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    width: 100%;
    align-self: center;
  }

  .auth-card {
    margin: 0 auto;
    max-width: 420px;
  }

  .auth-form {
    gap: 20px;
  }

  .auth-foot {
    display: block;
    padding: 18px 8px 10px;
  }
}

@media (max-width: 640px) {
  .auth-screen {
    padding: 32px 18px max(16px, env(safe-area-inset-bottom));
  }

  .auth-card {
    padding: 24px 18px 22px;
    border-radius: 22px;
  }

  .auth-title {
    font-size: 1.65rem;
  }
}

.stack {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
}

.field span {
  color: var(--muted);
  font-weight: var(--fw-medium);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  /* iOS Safari hace zoom si el texto del input es < 16px */
  font-size: 16px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(209, 10, 53, 0.45);
  outline: none;
  box-shadow: 0 0 0 3px rgba(209, 10, 53, 0.1);
}

.field select {
  height: var(--tap);
  min-height: var(--tap);
  padding-top: 0;
  padding-bottom: 0;
  padding-right: 40px;
  line-height: calc(var(--tap) - 2px);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23727477' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  cursor: pointer;
}

.field select:focus {
  border-color: rgba(209, 10, 53, 0.45);
  outline: none;
  box-shadow: 0 0 0 3px rgba(209, 10, 53, 0.12);
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field input[type="color"] {
  padding: 6px;
  min-height: 48px;
}

.field input[type="file"] {
  padding: 12px;
  background: #f7f9fc;
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.alert-error {
  background: #fff5f4;
  color: var(--danger);
  border: 1px solid #f3c4bf;
}

.alert-ok {
  background: #f0fdf6;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.empty-state {
  padding: 36px 18px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 16px;
  font-weight: var(--fw-normal);
}

.list-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.list-card {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.list-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  background: #f0f3f7;
}

.list-thumb-circle {
  border-radius: 50%;
}

.list-thumb-placeholder {
  border-radius: 50%;
  background: #e4eaf1;
}

.list-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.list-body span {
  color: var(--muted);
  font-size: 0.85rem;
}

.badge {
  display: inline-block;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: var(--fw-medium);
}

.badge-ok {
  background: #e8f7ef;
  color: var(--ok);
}

.badge-off {
  background: #f1f3f6;
  color: var(--muted);
}

.form-card,
.fieldset {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.fieldset {
  border: 1px solid var(--line);
}

.fieldset legend {
  padding: 0 6px;
  font-weight: var(--fw-medium);
  color: var(--brand);
}

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

.hint {
  color: var(--muted);
  margin: 0;
}

.preview-bg {
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  max-height: 220px;
  width: auto;
  object-fit: contain;
}

.danger-zone {
  margin-top: 24px;
}

.template-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 700px) {
  .template-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .template-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
}

.template-option {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  display: grid;
  gap: 3px;
  padding-bottom: 8px;
  text-align: center;
}

.template-option img {
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 180px;
  object-fit: cover;
  object-position: center top;
  background: #f0f3f7;
}

.template-option span {
  font-weight: var(--fw-medium);
  font-size: 0.85rem;
  padding: 0 6px;
  line-height: 1.2;
}

.template-option small,
.template-meta,
.template-author {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.2;
  padding: 0 6px;
}

.template-author {
  font-weight: var(--fw-normal);
  opacity: 0.9;
}

.meta-author {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: var(--fw-normal);
}

.page-editor {
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

.page-view {
  max-width: 560px;
  overflow-x: hidden;
  overflow-x: clip;
}

.page-view .preview-panel {
  margin-bottom: 0;
}

.page-view .sticky-actions {
  margin-top: 12px;
}

.view-actions {
  display: grid;
  gap: 10px;
}

.view-actions-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.view-action-form {
  margin: 0;
  min-width: 0;
}

.view-action-form .btn-action {
  width: 100%;
}

.btn-action {
  flex-direction: column;
  gap: 4px;
  min-height: 48px;
  padding: 6px;
  font-size: 0.75rem;
  font-weight: var(--fw-medium);
  line-height: 1.15;
}

.btn-action svg {
  flex-shrink: 0;
}

.btn-action.is-busy {
  font-size: 0.75rem;
}

.btn-action.is-busy .busy-spinner {
  width: 16px;
  height: 16px;
}

.editor-layout {
  display: grid;
  gap: 18px;
  min-width: 0;
  max-width: 100%;
}

.editor-layout > * {
  min-width: 0;
  max-width: 100%;
}

.section-label {
  margin: 0 0 8px;
  font-weight: var(--fw-medium);
  color: var(--brand);
}

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.section-label-row .section-label {
  margin: 0;
}

.preview-panel {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.preview-scroll {
  position: relative;
  overflow: hidden;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: 8px;
  background: #f7f8fa;
  -webkit-overflow-scrolling: touch;
}

/* Absolute: el tamaño real del lienzo no ensancha la página; solo escala visual. */
.card-canvas {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  background: #fff;
  transform-origin: top left;
  flex-shrink: 0;
}

.card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none !important;
  max-height: none !important;
  object-fit: fill;
  object-position: center top;
  pointer-events: none;
  /* Evita que el max-width global de img aplaste el fondo */
}

.photo-circle {
  position: absolute;
  border-radius: 50%;
  border-style: solid;
  overflow: hidden;
  background: transparent;
  z-index: 2;
  cursor: grab;
  touch-action: none;
}

.photo-circle.is-dragging {
  cursor: grabbing;
}

.photo-circle img {
  display: block;
  max-width: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.photo-tools .hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.color-swatches {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.color-swatch {
  appearance: none;
  border: 2px solid transparent;
  border-radius: 12px;
  min-height: 44px;
  background: var(--swatch);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.color-swatch.is-active {
  border-color: var(--brand);
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px var(--brand);
}

.color-picker-extra {
  width: 100%;
  min-height: 48px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.text-area {
  position: absolute;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

/* En el editor dejamos ver si el texto se sale de la caja */
.page-editor .text-area {
  overflow: visible;
  outline: 1px dashed rgba(37, 99, 168, 0.35);
  outline-offset: -1px;
  background: rgba(37, 99, 168, 0.04);
}

.page-editor .text-area[data-zone="1"] {
  outline-color: rgba(15, 118, 110, 0.45);
  background: rgba(15, 118, 110, 0.05);
}

/* Sin marcos de edición al generar PNG */
.card-canvas.is-exporting .text-area {
  outline: none !important;
  background: transparent !important;
  overflow: hidden;
}

.card-canvas.is-exporting .text-area > p.is-canvas-selected,
.card-canvas.is-exporting .photo-circle.is-canvas-selected {
  box-shadow: none !important;
}

.card-canvas.is-exporting .photo-circle.is-empty-slot {
  background: transparent !important;
}

.text-area > p {
  pointer-events: auto;
  cursor: pointer;
  border-radius: 4px;
  transition: box-shadow 0.15s ease;
}

.text-area > p.is-canvas-selected {
  box-shadow: 0 0 0 2px rgba(26, 58, 92, 0.55);
}

.photo-circle.is-canvas-selected {
  box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.45);
}

.photo-circle.is-empty-slot {
  background: rgba(26, 58, 92, 0.08);
  cursor: pointer;
}

.edit-popover {
  position: fixed;
  z-index: 80;
  min-width: 200px;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(28, 36, 48, 0.18);
  backdrop-filter: blur(8px);
}

.edit-popover-close {
  position: absolute;
  top: 4px;
  right: 6px;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.edit-popover-icons,
.edit-popover-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.edit-popover-icons {
  padding-right: 24px;
}

.edit-popover-zoom {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.edit-popover-zoom input[type='range'] {
  width: 100%;
  accent-color: var(--brand);
}

.edit-popover {
  transition: none;
}

.source-sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(16, 24, 40, 0.45);
  display: grid;
  align-items: end;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.source-sheet[hidden] {
  display: none !important;
}

.source-sheet .btn-block {
  width: 100%;
}

.source-sheet-card {
  background: #fff;
  border-radius: 18px;
  padding: 18px 16px;
  display: grid;
  gap: 10px;
  box-shadow: 0 12px 32px rgba(28, 36, 48, 0.22);
}

.source-sheet-title {
  margin: 0 0 4px;
  font-weight: var(--fw-medium);
  text-align: center;
  color: var(--ink);
}

.edit-popover-row + .edit-popover-row {
  margin-top: 8px;
}

.edit-popover-sep {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 2px;
}

.edit-icon-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 8px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: var(--fw-medium);
  line-height: 1.1;
}

.edit-icon-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.edit-icon-btn.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.edit-icon-btn.is-danger {
  color: var(--danger);
  border-color: #f3c4bf;
}

.edit-popover-swatches .color-swatch {
  width: 36px;
  min-height: 36px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.edit-pop-value {
  font-style: normal;
  font-weight: var(--fw-medium);
  min-width: 1.6em;
  text-align: center;
  font-size: 0.9rem;
}

.edit-pop-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.edit-pop-step button {
  appearance: none;
  border: 0;
  background: var(--brand-soft);
  color: var(--brand);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-weight: var(--fw-medium);
  cursor: pointer;
}

.edit-pop-step em {
  font-style: normal;
  font-weight: var(--fw-medium);
  color: var(--ink);
  min-width: 1.4em;
  text-align: center;
}

.edit-pop-color {
  width: 44px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.para-card.is-focused {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-soft);
}

.paragraphs-list {
  display: grid;
  gap: 12px;
}

.para-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.para-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.para-card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.para-card-actions .btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.edit-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  margin-top: 16px;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 78%, transparent);
  display: grid;
  gap: 8px;
  z-index: 10;
}

.page-editor .controls-panel {
  padding-bottom: 8px;
}

.page-editor .controls-panel .sticky-actions {
  margin-top: 20px;
}

.app-busy-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 200;
  background: transparent;
  overflow: hidden;
  pointer-events: none;
}

.app-busy-bar[hidden] {
  display: none !important;
}

.app-busy-bar-fill {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
  animation: busy-slide 1s ease-in-out infinite;
}

@keyframes busy-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.btn.is-busy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0.85;
  pointer-events: none;
}

.busy-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: busy-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.btn-secondary.is-busy .busy-spinner,
.btn-ghost.is-busy .busy-spinner {
  border-color: rgba(26, 58, 92, 0.25);
  border-top-color: var(--brand);
}

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

.list-card .list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.list-card .list-actions form {
  margin: 0;
  display: contents;
}

.meta-plantilla {
  color: var(--brand);
  font-weight: var(--fw-medium);
}

/* Zonas editables en plantillas */
.zone-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.zone-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.zone-toolbar .btn.is-pressed,
.btn.is-pressed {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.zone-toolbar .btn {
  min-height: 42px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.zone-box.is-hidden {
  display: none !important;
}

.canvas-size-card {
  border-color: rgba(26, 58, 92, 0.28);
  box-shadow: 0 0 0 1px rgba(26, 58, 92, 0.06);
}

.zone-legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}

.dot-photo {
  background: rgba(201, 148, 58, 0.85);
}

.dot-text {
  background: rgba(37, 99, 168, 0.85);
}

.dot-title {
  background: rgba(15, 118, 110, 0.85);
}

.zone-canvas {
  background: #eceff3;
}

.zone-box {
  position: absolute;
  z-index: 4;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.zone-box.is-dragging {
  cursor: grabbing;
}

.zone-box.is-selected {
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px rgba(26, 58, 92, 0.55);
  z-index: 5;
}

.zone-popover {
  min-width: 168px;
}

.zone-popover-title {
  margin: 0 28px 10px 0;
  font-weight: var(--fw-medium);
  font-size: 0.95rem;
  color: var(--ink);
}

.zone-photo {
  border-radius: 50%;
  border: 2px dashed rgba(180, 120, 30, 0.95);
  background: rgba(201, 148, 58, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  overflow: visible;
}

.zone-photo .zone-handle {
  background: #b4781e;
}

.zone-text {
  border: 2px dashed rgba(37, 99, 168, 0.95);
  background: rgba(37, 99, 168, 0.18);
  border-radius: 8px;
}

.zone-text2 {
  border-color: rgba(15, 118, 110, 0.95);
  background: rgba(15, 118, 110, 0.16);
}

.zone-label {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 11px;
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(26, 58, 92, 0.75);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.zone-photo .zone-label {
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.zone-handle {
  position: absolute;
  right: -14px;
  bottom: -14px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #2563a8;
  border: 3px solid #fff;
  cursor: nwse-resize;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  touch-action: none;
  z-index: 6;
}

.zone-handle::after {
  content: '';
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 12px;
  height: 12px;
  border-right: 3px solid #fff;
  border-bottom: 3px solid #fff;
}

.step-input {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  min-height: 48px;
}

.step-input input[type='number'] {
  border: 0 !important;
  border-radius: 0 !important;
  min-height: 48px;
  flex: 1;
  min-width: 0;
  text-align: center;
  font-weight: var(--fw-medium);
  font-size: 16px;
  /* Oculta spinners nativos; usamos nuestras flechas */
  -moz-appearance: textfield;
}

.step-input input[type='number']::-webkit-outer-spin-button,
.step-input input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.step-arrows {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 44px;
  border-left: 1px solid var(--line);
}

.step-arrow {
  appearance: none;
  border: 0;
  background: var(--brand-soft);
  color: var(--brand);
  flex: 1;
  min-height: 24px;
  padding: 0;
  font-size: 0.65rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.step-arrow + .step-arrow {
  border-top: 1px solid var(--line);
}

.step-arrow:active {
  background: #d5e2f0;
}

@media (min-width: 900px) {
  .zone-handle {
    width: 28px;
    height: 28px;
    right: -10px;
    bottom: -10px;
  }

  .zone-handle::after {
    right: 7px;
    bottom: 7px;
    width: 8px;
    height: 8px;
  }
}

.user-card {
  grid-template-columns: 64px 1fr;
}

.list-actions {
  grid-column: 2;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.user-avatar-letter {
  display: grid;
  place-items: center;
  font-weight: var(--fw-medium);
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 50%;
}

.profile-card {
  max-width: 640px;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e8edf2;
  color: #6b7280;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: var(--fw-medium);
  overflow: hidden;
  flex-shrink: 0;
}

.profile-me {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 18px;
}

.profile-me .profile-avatar,
.profile-avatar.is-xl {
  width: 168px;
  height: 168px;
  font-size: 3.2rem;
  border: 3px solid var(--line);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.profile-me-name {
  margin: 6px 0 0;
  font-size: 1.35rem;
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.profile-me-meta {
  margin: 0;
}

.profile-foto-btn {
  cursor: pointer;
}

.profile-foto-btn input[type="file"] {
  display: none;
}

.user-foto-field {
  margin-bottom: 4px;
}

.user-foto-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.user-foto-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e8edf2;
  color: #6b7280;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: var(--fw-medium);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--line);
}

.user-foto-controls {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.user-foto-controls input[type="file"] {
  max-width: 100%;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0;
}

.profile-grid dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: var(--fw-medium);
}

.profile-grid dd {
  margin: 2px 0 0;
  font-weight: var(--fw-medium);
}

@media (max-width: 600px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 700px) {
  .user-card {
    grid-template-columns: 64px 1fr auto;
  }

  .list-actions {
    grid-column: auto;
  }
}

@media (min-width: 900px) {
  .editor-layout {
    grid-template-columns: minmax(280px, 420px) 1fr;
    align-items: start;
  }

  .page-editor .controls-panel {
    max-height: calc(100vh - var(--header-h) - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
  }

  .preview-panel {
    position: sticky;
    top: calc(var(--header-h) + 16px);
  }

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

/* Gestión DGCS */
.page-gestion {
  max-width: none;
  width: 100%;
}

.page-gestion-form {
  max-width: none;
  width: 100%;
}

.page-gestion-form .g-panel,
.page-gestion-form .g-form {
  max-width: 100%;
}

.page-gestion .g-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
  letter-spacing: -0.02em;
}

.page-gestion .g-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: var(--fw-normal);
}

.page-gestion .g-head {
  align-items: flex-start;
  margin-bottom: 22px;
}

.page-gestion .btn-block {
  width: auto;
}

.g-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.g-kpi {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 16px 16px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.g-kpi strong {
  font-size: 1.7rem;
  line-height: 1.1;
  font-weight: var(--fw-medium);
  letter-spacing: -0.03em;
  color: var(--ink);
}

.g-kpi span:not(.g-kpi-ico) {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.g-kpi-blue,
.g-kpi-amber,
.g-kpi-teal,
.g-kpi-muted {
  background: #fff;
  border-color: var(--line);
}

.g-kpi-ico {
  position: static;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  opacity: 1;
  margin-bottom: 8px;
}

.g-kpi-blue .g-kpi-ico { background: #eef5ff; color: #2563eb; }
.g-kpi-amber .g-kpi-ico { background: #fff7ec; color: #d97706; }
.g-kpi-teal .g-kpi-ico { background: #eaf8f5; color: #0f766e; }
.g-kpi-muted .g-kpi-ico { background: #f3f4f6; color: #4b5563; }

.g-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.g-nav-card {
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.g-nav-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 6px;
}

.g-nav-card:hover {
  border-color: rgba(209, 10, 53, 0.28);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.g-nav-card strong {
  font-size: 0.95rem;
  font-weight: var(--fw-medium);
}

.g-nav-card span {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
  font-weight: var(--fw-normal);
}

.g-nav-card.is-soon {
  opacity: 0.55;
  border-style: dashed;
  pointer-events: none;
}

.g-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.g-panel-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
}

.g-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.g-panel-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: var(--fw-normal);
  line-height: 1.35;
}

.g-bars {
  display: grid;
  gap: 8px;
}

.g-bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 180px) 1fr 28px;
  gap: 10px;
  align-items: center;
}

.g-bar-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: var(--fw-medium);
}

.g-bar-track {
  height: 8px;
  border-radius: 999px;
  background: #eef0f3;
  overflow: hidden;
}

.g-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.g-bars-teal .g-bar-track i {
  background: linear-gradient(90deg, #0f766e, #2dd4bf);
}

.g-bar-n {
  text-align: right;
  font-size: 0.82rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
}

.g-delivery-list,
.g-sol-list,
.g-svc-list,
.g-file-list {
  display: grid;
  gap: 10px;
}

.g-delivery-card,
.g-sol-card {
  display: grid;
  grid-template-columns: minmax(110px, 140px) 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.g-sol-card {
  grid-template-columns: 1fr minmax(120px, 150px);
  background: #fff;
}

.g-sol-card-static {
  cursor: default;
}

.g-delivery-card:hover,
a.g-sol-card:hover {
  border-color: rgba(209, 10, 53, 0.3);
  background: #fff;
}

.g-delivery-date,
.g-sol-date {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff4f6;
  border: 1px solid #f3cfd6;
  text-align: center;
  min-width: 0;
}

.g-sol-date {
  background: #fff7ec;
  border-color: #f0dfc2;
}

.g-sol-date.is-empty,
.g-delivery-date.is-empty {
  background: #f4f5f7;
  border-color: var(--line);
}

.g-delivery-date em,
.g-sol-date strong {
  font-style: normal;
  font-size: 0.92rem;
  font-weight: var(--fw-medium);
  color: var(--brand);
  line-height: 1.2;
}

.g-sol-date strong {
  color: #9a5b00;
}

.g-sol-date.is-empty strong {
  color: var(--muted);
  font-weight: var(--fw-medium);
  font-size: 0.85rem;
}

.g-delivery-date span,
.g-sol-date-label {
  font-size: 0.7rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.g-delivery-body,
.g-sol-main {
  min-width: 0;
}

.g-delivery-body strong,
.g-folio {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: var(--fw-medium);
  color: var(--brand);
}

.g-delivery-body p,
.g-sol-title {
  margin: 2px 0 0;
  font-size: 1rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.g-delivery-body small,
.g-sol-meta {
  display: block;
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}

.g-sol-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 2px;
}

.g-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  background: #eef0f3;
  color: #445;
}

.g-status-abierta { background: #fff7ec; color: #9a5b00; }
.g-status-en_proceso { background: #eaf8f5; color: #0f766e; }
.g-status-entregado { background: #eef5ff; color: #1d4ed8; }
.g-status-cerrada { background: #eef0f3; color: #667; }

.g-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  width: 100%;
}

.g-filters .field {
  margin: 0;
  min-width: 0;
  width: 100%;
}

.g-filters .g-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-bottom: 2px;
}

.g-form {
  display: grid;
  gap: 12px;
}

.g-form-2,
.g-assign-grid,
.g-svc-edit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.g-form-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.g-span-2 {
  grid-column: 1 / -1;
}

.g-form-actions,
.g-svc-actions,
.g-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#nuevo {
  scroll-margin-top: calc(var(--header-h) + 12px);
}

.g-area-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.g-chip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfc;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: var(--fw-medium);
  line-height: 1.3;
  box-sizing: border-box;
}

.g-chip span {
  color: var(--ink);
  white-space: normal;
  overflow-wrap: anywhere;
  flex: 1;
  min-width: 0;
}

.g-chip:has(input:checked) {
  border-color: rgba(209, 10, 53, 0.45);
  background: #fff4f6;
}

.g-chip input,
.field .g-chip input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  padding: 0;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  accent-color: var(--brand);
}

.g-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.g-info-wide {
  grid-column: 1 / -1;
}

.g-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.75rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.g-desc {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
}

.g-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.g-tag {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef5ff;
  color: #1d4f91;
  font-size: 0.78rem;
  font-weight: var(--fw-medium);
}

.g-details summary {
  cursor: pointer;
  font-weight: var(--fw-medium);
  color: var(--ink);
}

.g-svc-card,
.g-file-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfc;
  display: grid;
  gap: 12px;
}

.g-svc-head,
.g-file-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.g-svc-head {
  align-items: center;
}

.g-assign {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.badge-warn {
  background: #fff4e5;
  color: #9a5b00;
}

.area-card-gestion {
  border-color: rgba(209, 10, 53, 0.2);
}

.menu-tile.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  border-style: dashed;
}

@media (max-width: 700px) {
  .g-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .g-delivery-card,
  .g-sol-card,
  .g-svc-head,
  .g-file-card {
    grid-template-columns: 1fr;
  }

  .g-form-2,
  .g-form-3,
  .g-assign-grid,
  .g-svc-edit,
  .g-info-grid {
    grid-template-columns: 1fr;
  }

  .g-bar-row {
    grid-template-columns: 1fr 28px;
  }

  .g-bar-label {
    grid-column: 1 / -1;
  }
}


/* Lightbox de imágenes */
body.img-lightbox-open {
  overflow: hidden;
}

.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px);
  background:
    radial-gradient(ellipse 80% 60% at 20% 15%, rgba(209, 10, 53, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 90%, rgba(30, 40, 70, 0.22), transparent 50%),
    linear-gradient(160deg, rgba(18, 20, 28, 0.38), rgba(10, 12, 18, 0.42));
  backdrop-filter: blur(12px) saturate(1.05);
  -webkit-backdrop-filter: blur(12px) saturate(1.05);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.img-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.img-lightbox[hidden] {
  display: none;
}

.img-lightbox.is-open[hidden] {
  display: flex;
}

.img-lightbox-figure {
  margin: 0;
  max-width: min(96vw, 1080px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: img-lightbox-in 0.28s ease;
}

@keyframes img-lightbox-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.img-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 40px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  background: rgba(255, 255, 255, 0.04);
}

.img-lightbox-caption {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.9rem;
  text-align: center;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  max-width: 40ch;
}

.img-lightbox-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.img-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.04);
}

/* Actividades */
.g-filters-dates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.g-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-bottom: 2px;
}

.g-act-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.g-act-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.g-act-table th,
.g-act-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.g-act-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #fafbfc;
  font-weight: var(--fw-medium);
}

.g-act-table tbody tr:last-child td {
  border-bottom: 0;
}

.g-act-table tbody tr:hover td {
  background: #fcf7f8;
}

.g-act-name {
  display: block;
  font-size: 0.95rem;
  color: var(--ink);
}

.g-act-date {
  white-space: nowrap;
  font-weight: var(--fw-medium);
  color: var(--brand);
}

@media (max-width: 700px) {
  .g-filters-dates {
    grid-template-columns: 1fr;
  }
}

/* Date / time picker */
.dtp {
  position: relative;
}

.dtp-trigger {
  width: 100%;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dtp-trigger:hover,
.dtp-trigger:focus-visible {
  border-color: rgba(209, 10, 53, 0.45);
  outline: none;
  box-shadow: 0 0 0 3px rgba(209, 10, 53, 0.12);
}

.dtp-trigger.has-value {
  border-color: rgba(209, 10, 53, 0.28);
}

.dtp-ico {
  color: var(--brand);
  display: inline-flex;
  flex-shrink: 0;
}

.dtp-value {
  flex: 1;
  min-width: 0;
}

.dtp-value.is-empty {
  color: var(--muted);
  font-weight: var(--fw-normal);
}

.dtp-pop {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  left: 0;
  min-width: min(100%, 300px);
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(20, 24, 40, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.dtp-pop.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.dtp-pop.dtp-pop-fixed {
  position: fixed;
  top: 0;
  left: 0;
  margin: 0;
  z-index: 90;
}

.dtp-pop-cal {
  width: 300px;
}

.dtp-pop-time {
  width: 220px;
}

.dtp-pop-datetime {
  width: min(420px, calc(100vw - 24px));
  padding: 0;
  overflow: hidden;
}

.dtp-datetime-main {
  display: grid;
  grid-template-columns: 1fr auto;
}

.dtp-datetime-cal {
  padding: 14px;
  min-width: 0;
}

.dtp-pop-datetime .dtp-time-cols {
  padding: 14px 12px;
  border-left: 1px solid var(--line);
  align-self: stretch;
}

.dtp-pop-datetime .dtp-pop-actions {
  margin-top: 0;
}

.dtp-floating-layer {
  position: fixed;
  inset: 0;
  z-index: 260;
  pointer-events: none;
}

.dtp-floating-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: default;
  pointer-events: auto;
}

.dtp-pop-floating {
  position: fixed;
  top: 0;
  left: 0;
  margin: 0;
  pointer-events: auto;
  z-index: 261;
}

.dtp-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.dtp-cal-title {
  font-size: 0.95rem;
  color: var(--ink);
}

.dtp-nav {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: #f4f5f7;
  color: var(--ink);
  font-size: 1.25rem;
  cursor: pointer;
}

.dtp-nav:hover {
  background: #fff4f6;
  color: var(--brand);
}

.dtp-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.dtp-dow {
  text-align: center;
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  color: var(--muted);
  padding: 4px 0 6px;
}

.dtp-day {
  aspect-ratio: 1;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: var(--fw-medium);
  cursor: pointer;
}

.dtp-day:hover:not(.is-muted):not(:disabled) {
  background: #fff4f6;
  color: var(--brand);
}

.dtp-day.is-muted {
  visibility: hidden;
  pointer-events: none;
}

.dtp-day.is-today {
  box-shadow: inset 0 0 0 1.5px rgba(209, 10, 53, 0.35);
}

.dtp-day.is-selected {
  background: var(--brand);
  color: #fff;
  box-shadow: none;
}

.dtp-pop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.dtp-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: var(--fw-medium);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}

.dtp-link:hover {
  color: var(--brand);
  background: #fff4f6;
}

.dtp-link-primary {
  color: var(--brand);
}

.dtp-time-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dtp-time-label {
  display: block;
  text-align: center;
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dtp-time-hours,
.dtp-time-mins {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  background: #fafbfc;
  scroll-behavior: smooth;
}

.dtp-time-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}

.dtp-time-item:hover {
  background: #fff4f6;
  color: var(--brand);
}

.dtp-time-item.is-selected {
  background: var(--brand);
  color: #fff;
}

.g-sol-time {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.85rem;
  font-weight: var(--fw-medium);
  opacity: 0.9;
}

@media (max-width: 520px) {
  .dtp-pop-cal,
  .dtp-pop-time {
    width: min(92vw, 300px);
  }

  .dtp-datetime-main {
    grid-template-columns: 1fr;
  }

  .dtp-pop-datetime .dtp-time-cols {
    border-left: 0;
    border-top: 1px solid var(--line);
    justify-content: center;
  }

  .dtp-pop-datetime {
    width: min(92vw, 420px);
  }
}

/* Tabs detalle solicitud */
.g-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px;
  border-radius: 14px;
  background: #f3f4f6;
  border: 1px solid var(--line);
}

.g-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: var(--fw-medium);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.g-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

.g-tab.is-active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 3px rgba(20, 24, 40, 0.08);
}

.g-tab-count {
  font-style: normal;
  font-size: 0.75rem;
  font-weight: var(--fw-medium);
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffe8ec;
  color: var(--brand);
}

.g-tab-panel {
  display: none;
}

.g-tab-panel.is-active {
  display: block;
}

@media (max-width: 640px) {
  .g-tabs {
    flex-direction: column;
  }

  .g-tab {
    width: 100%;
    justify-content: space-between;
  }
}

.g-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-weight: var(--fw-medium);
  color: var(--ink);
}

.g-check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--brand);
}

.g-temporalidad-range {
  margin-top: 12px;
}

.g-form-2[hidden],
.g-temporalidad-range[hidden],
.g-date-range[hidden] {
  display: none !important;
}

.g-title-ico {
  display: inline-flex;
  vertical-align: -3px;
  margin-right: 6px;
  color: var(--brand);
}

.g-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: var(--fw-medium);
}

.g-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.g-leg {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.g-leg-recibidas { background: #f59e0b; }
.g-leg-proceso { background: #0d9488; }
.g-leg-terminadas { background: #2563eb; }
.g-leg-notas { background: var(--brand); }

.g-bar-row-stack {
  grid-template-columns: minmax(110px, 180px) 1fr;
  align-items: start;
  gap: 10px 12px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f1f3;
}

.g-bar-row-stack:last-child {
  border-bottom: 0;
}

.g-bar-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.g-bar-track-stack {
  display: flex;
  height: 10px;
  overflow: hidden;
}

.g-bar-track-stack .g-seg {
  display: block;
  height: 100%;
  min-width: 0;
}

.g-bar-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.g-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  color: var(--muted);
  white-space: nowrap;
}

.g-count em {
  font-style: normal;
  font-weight: var(--fw-bold);
  font-size: 0.82rem;
  min-width: 1.1em;
  text-align: right;
}

.g-count-recibidas em { color: #b45309; }
.g-count-proceso em { color: #0f766e; }
.g-count-terminadas em { color: #1d4ed8; }

.g-seg-recibidas { background: linear-gradient(90deg, #d97706, #f59e0b); }
.g-seg-proceso { background: linear-gradient(90deg, #0f766e, #14b8a6); }
.g-seg-terminadas { background: linear-gradient(90deg, #1d4ed8, #3b82f6); }

@media (max-width: 640px) {
  .g-bar-row-stack {
    grid-template-columns: 1fr;
  }
}

.btn-ico {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.g-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
}

.g-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.01em;
}

.g-pill-amber { background: #fff7ec; color: #b45309; }
.g-pill-teal { background: #eaf8f5; color: #0f766e; }
.g-pill-blue { background: #eef5ff; color: #1d4ed8; }

.g-kpi-row {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

/* Calendario mensual (Inicio) */
.g-cal-panel {
  overflow: hidden;
}

.g-cal-head {
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 10px;
}

.g-cal-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.g-cal-month {
  min-width: 140px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
}

.g-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: var(--fw-medium);
}

.g-cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f4f6f8;
}

.g-cal-dows {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.g-cal-dows span {
  text-align: center;
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 0 2px;
}

.g-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.g-cal-month-pane {
  min-width: 0;
  background: #eef1f5;
  border-radius: 16px;
  padding: 10px;
}

.g-cal-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-height: 72px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.g-cal-day.is-muted {
  background: transparent;
  border-color: transparent;
  min-height: 0;
  pointer-events: none;
}

.g-cal-day.is-weekend:not(.is-selected):not(.is-today):not(.has-events) {
  background: #f7f8fb;
}

.g-cal-day:hover:not(.is-muted) {
  background: #fff;
  border-color: #d9dee6;
  box-shadow: 0 4px 10px rgba(42, 44, 46, 0.05);
}

.g-cal-day.is-today:not(.is-selected) {
  background: #fff8f9;
  border-color: #f3c5cf;
}

.g-cal-day.is-selected {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(209, 10, 53, 0.12);
}

.g-cal-day.has-events {
  box-shadow: 0 1px 2px rgba(42, 44, 46, 0.04);
}

.g-cal-num {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
  line-height: 1;
}

.g-cal-day.is-today .g-cal-num {
  color: var(--brand);
}

.g-cal-day.is-selected .g-cal-num {
  background: var(--brand);
  color: #fff;
}

.g-cal-events {
  display: none;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.g-cal-chip {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: var(--fw-medium);
  line-height: 1.3;
}

.g-cal-chip.tone-recibida,
.g-cal-detail-item.tone-recibida {
  background: #fff7ec;
  color: #b45309;
}

.g-cal-chip.tone-proceso,
.g-cal-detail-item.tone-proceso {
  background: #eaf8f5;
  color: #0f766e;
}

.g-cal-chip.tone-terminada,
.g-cal-detail-item.tone-terminada {
  background: #eef5ff;
  color: #1d4ed8;
}

.g-cal-chip.tone-nota,
.g-cal-detail-item.tone-nota {
  background: var(--brand-soft);
  color: #9f1239;
}

.g-cal-more {
  font-size: 0.65rem;
  font-weight: var(--fw-medium);
  color: var(--muted);
}

.g-cal-dot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: auto;
}

.g-cal-dot-row i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.g-cal-dot-row i.tone-recibida { background: #f59e0b; }
.g-cal-dot-row i.tone-proceso { background: #0d9488; }
.g-cal-dot-row i.tone-terminada { background: #2563eb; }
.g-cal-dot-row i.tone-nota { background: var(--brand); }

.g-cal-detail {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.g-cal-detail-title {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
}

.g-cal-detail-list {
  display: grid;
  gap: 8px;
}

.g-cal-detail-item {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid var(--line);
  background: #fff;
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.g-cal-detail-item strong {
  font-size: 0.88rem;
  color: var(--ink);
}

.g-cal-detail-item span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: var(--fw-medium);
}

.g-cal-detail-item:hover {
  border-color: rgba(209, 10, 53, 0.25);
}

@media (min-width: 900px) {
  .g-cal-day {
    min-height: 108px;
  }

  .g-cal-events {
    display: flex;
  }

  .g-cal-dot-row {
    display: none;
  }
}

@media (max-width: 640px) {
  .g-cal-day {
    min-height: 52px;
    padding: 6px;
  }

  .g-cal-month {
    min-width: 110px;
    font-size: 0.88rem;
  }
}

/* Dashboard Inicio: aprovecha todo el ancho del workspace */
.page-dashboard {
  max-width: none !important;
  width: 100%;
}

.page-dashboard .g-kpi-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.page-dashboard .g-nav-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.page-dashboard .g-nav-card {
  min-height: 0;
  align-content: start;
}

.page-dashboard .g-nav-shortcut {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 96px;
  padding: 18px 20px;
  border-color: transparent;
}

.page-dashboard .g-nav-shortcut .g-nav-ico {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #fff;
  flex-shrink: 0;
}

.page-dashboard .g-nav-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.page-dashboard .g-nav-copy strong {
  font-size: 1.02rem;
  color: inherit;
}

.page-dashboard .g-nav-copy span {
  color: inherit;
  opacity: 0.72;
}

.page-dashboard .g-nav-arrow {
  color: currentColor;
  opacity: 0.45;
  flex-shrink: 0;
}

.page-dashboard .g-nav-sol {
  background: linear-gradient(145deg, #fff7f8 0%, #ffe4ea 100%);
  border-color: #f4c9d2;
  color: #9f1239;
}

.page-dashboard .g-nav-sol .g-nav-ico {
  background: var(--brand);
}

.page-dashboard .g-nav-act {
  background: linear-gradient(145deg, #f5f9ff 0%, #dbeafe 100%);
  border-color: #bfdbfe;
  color: #1e40af;
}

.page-dashboard .g-nav-act .g-nav-ico {
  background: #2563eb;
}

.page-dashboard .g-nav-cat {
  background: linear-gradient(145deg, #f3fbfa 0%, #d5f3ef 100%);
  border-color: #b5e4de;
  color: #115e59;
}

.page-dashboard .g-nav-cat .g-nav-ico {
  background: #0f766e;
}

.page-dashboard .g-nav-shortcut:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.page-dashboard .g-nav-sol:hover { border-color: #e8a3b0; }
.page-dashboard .g-nav-act:hover { border-color: #93c5fd; }
.page-dashboard .g-nav-cat:hover { border-color: #99d5ce; }

.page-dashboard .g-panel {
  margin-bottom: 0;
  height: 100%;
}

.page-dashboard .g-panel-fill {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.g-dash-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
  align-items: stretch;
}

.g-dash-schedule {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
}

.g-area-stats {
  display: grid;
  gap: 10px;
}

.g-area-stat {
  display: grid;
  gap: 10px;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.g-area-stat:hover {
  background: #fff;
  border-color: rgba(209, 10, 53, 0.28);
  box-shadow: var(--shadow-sm);
}

.g-area-stat-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.g-area-stat-top strong {
  font-size: 0.92rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
}

.g-area-stat-top em {
  font-style: normal;
  font-size: 1.2rem;
  font-weight: var(--fw-medium);
  letter-spacing: -0.03em;
  color: var(--ink);
}

.g-area-stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.g-area-stat .g-bar-track-stack {
  height: 6px;
  border-radius: 999px;
  background: #eef0f3;
}

.g-cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.page-dashboard .g-cal-detail,
.page-area .g-cal-detail {
  margin-top: 0;
  padding: 14px;
  border: 0;
  border-radius: 16px;
  background: #f4f6f8;
  max-height: 520px;
  overflow: auto;
}

.page-dashboard .g-proximas-panel .g-delivery-list,
.page-area .g-proximas-panel .g-delivery-list {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  max-height: none;
  overflow: visible;
}

.page-dashboard .g-bar-row-stack {
  grid-template-columns: minmax(88px, 132px) 1fr;
}

.page-dashboard .g-delivery-card,
.page-area .g-delivery-card {
  grid-template-columns: minmax(96px, 120px) 1fr;
}

@media (max-width: 1200px) {
  .page-dashboard .g-nav-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .page-dashboard .g-kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .g-dash-charts {
    grid-template-columns: 1fr;
  }

  .page-dashboard .g-nav-grid {
    grid-template-columns: 1fr;
  }

  .page-dashboard .g-cal-detail,
  .page-area .g-cal-detail {
    max-height: none;
  }

  .g-cal-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-dashboard .g-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Listados y áreas a todo el ancho */
.page-area .g-area-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 16px;
}

.page-area .g-area-nav {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.page-area .g-nav-card {
  min-height: 120px;
}

.g-filters-bar {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.g-filters-dates {
  grid-template-columns: minmax(160px, 1.2fr) repeat(2, minmax(140px, 1fr)) auto auto auto;
}

.g-filters-direccion {
  grid-template-columns: minmax(150px, 1fr) minmax(160px, 1.2fr) repeat(2, minmax(140px, 1fr)) auto auto auto;
}

.g-sol-list {
  width: 100%;
}

.g-sol-card {
  width: 100%;
}

.g-act-table-wrap {
  width: 100%;
}

.page-gestion-detail {
  max-width: none;
  width: 100%;
}

@media (max-width: 900px) {
  .page-area .g-area-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .g-filters-dates {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .page-area .g-area-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .g-filters-dates {
    grid-template-columns: 1fr;
  }
}

/* Formulario multi-actividades (más ancho que el form genérico) */
.page-actividades-form {
  max-width: none !important;
  width: 100%;
}

.page-actividades-form .g-panel {
  margin-bottom: 0;
}

.g-act-form-shell {
  display: grid;
  gap: 14px;
  width: 100%;
}

.g-act-list {
  display: grid;
  gap: 12px;
}

.g-act-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.g-act-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.g-act-block-head strong {
  font-size: 0.95rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
}

.g-act-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  align-items: start;
}

.g-act-fields .g-span-2 {
  grid-column: 1 / -1;
}

.g-act-fields .field {
  margin: 0;
}

.g-act-add-row {
  display: flex;
  justify-content: flex-start;
}

.g-act-form-shell > .g-form-actions {
  margin-top: 4px;
}

@media (max-width: 700px) {
  .page-actividades-form {
    max-width: none !important;
  }

  .g-act-fields {
    grid-template-columns: 1fr;
  }
}

/* Gantt en resumen de área */
.g-gantt-panel {
  overflow: hidden;
}

.g-gantt-head-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 12px;
}

.g-gantt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.g-gantt-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.g-gantt-filter {
  margin: 0;
  min-width: 140px;
}

.g-gantt-quick {
  min-width: 0;
}

.g-gantt-filter > span {
  display: block;
  font-size: 0.78rem;
  font-weight: var(--fw-medium);
  color: var(--muted);
  margin-bottom: 4px;
}

.g-gantt-filter-actions {
  display: flex;
  gap: 6px;
  padding-bottom: 1px;
  align-items: center;
}

.g-gantt-capture-stage {
  width: max-content !important;
  max-width: none !important;
  min-width: 900px;
}

.g-gantt-capture-stage .g-gantt-scroll {
  overflow: visible !important;
  max-height: none !important;
  width: max-content !important;
  max-width: none !important;
  background: #ffffff !important;
}

.g-gantt-capture-stage .g-gantt-filters {
  box-shadow: none !important;
}

.g-gantt-capture-stage .g-gantt-label-col,
.g-gantt-capture-stage .g-gantt-head {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  box-shadow: none !important;
  background: #ffffff !important;
  color: #1e2024 !important;
}

.g-gantt-capture-stage .g-gantt-label-col strong {
  color: #1e2024 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.g-gantt-capture-stage .g-gantt-label-col small {
  color: #5b6168 !important;
}

.g-gantt-capture-stage .g-gantt-track {
  position: relative !important;
}

.g-gantt-scroll {
  overflow: auto;
  max-height: min(62vh, 560px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfc;
}

.g-gantt-table {
  display: flex;
  flex-direction: column;
  min-width: 100%;
}

.g-gantt-row {
  display: flex;
  align-items: stretch;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
}

.g-gantt-row:last-child {
  border-bottom: 0;
}

.g-gantt-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
}

.g-gantt-label-col {
  position: sticky;
  left: 0;
  z-index: 2;
  width: var(--gantt-label, 280px);
  min-width: var(--gantt-label, 280px);
  max-width: var(--gantt-label, 280px);
  padding: 10px 12px;
  background: #fff;
  border: 0;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  box-shadow: 2px 0 6px rgba(16, 24, 40, 0.04);
  font: inherit;
  text-align: left;
  color: inherit;
}

.g-gantt-head .g-gantt-label-col {
  z-index: 4;
  font-size: 0.78rem;
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.g-gantt-label-col strong {
  font-size: 0.86rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.g-gantt-label-col small {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  overflow-wrap: anywhere;
}

.g-gantt-track {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  min-height: 100%;
}

.g-gantt-day {
  flex: 0 0 var(--gantt-day, 36px);
  width: var(--gantt-day, 36px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 0.68rem;
  border-right: 1px solid #eef1f4;
  color: var(--muted);
}

.g-gantt-day strong {
  font-size: 0.78rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
}

.g-gantt-day.is-weekend,
.g-gantt-cell.is-weekend {
  background: rgba(15, 23, 42, 0.03);
}

.g-gantt-day.is-today,
.g-gantt-cell.is-today {
  background: rgba(185, 28, 28, 0.08);
}

.g-gantt-day.is-today strong {
  color: #b91c1c;
}

.g-gantt-cell {
  flex: 0 0 var(--gantt-day, 36px);
  width: var(--gantt-day, 36px);
  border-right: 1px solid #eef1f4;
  display: block;
}

.g-gantt-row > .g-gantt-label-col {
  cursor: pointer;
}

.g-gantt-row > .g-gantt-label-col:hover {
  background: #f8fafc;
}

.g-gantt-bar-link {
  position: absolute;
  inset: 0;
  pointer-events: none;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.g-gantt-bar-link .g-gantt-bar {
  pointer-events: auto;
}

.g-gantt-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 26px;
  border-radius: 7px;
  padding: 0 8px;
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  color: #fff;
  line-height: 26px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
  z-index: 1;
  cursor: pointer;
}

.g-gantt-bar.tone-recibida {
  background: #d97706;
}

.g-gantt-bar.tone-proceso {
  background: #0d9488;
}

.g-gantt-bar.tone-terminada {
  background: #2563eb;
}

/* Modal resumen de actividad (calendario / gantt) */
.g-summary-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.g-summary-modal[hidden] {
  display: none !important;
}

.g-summary-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 20, 19, 0.45);
}

.g-summary-card {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 24px 22px 18px;
  box-shadow: 0 24px 60px rgba(42, 44, 46, 0.22);
}

.g-summary-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  background: #f3f4f6;
  border-radius: 999px;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.g-summary-kicker {
  margin: 0;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.g-summary-title {
  margin: 8px 0 16px;
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  padding-right: 28px;
}

.g-summary-dl {
  margin: 0 0 18px;
  display: grid;
  gap: 10px;
}

.g-summary-dl div {
  display: grid;
  gap: 2px;
}

.g-summary-dl dt {
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.g-summary-dl dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
}

.g-summary-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.g-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.g-search-plain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.g-search-plain span {
  color: var(--muted);
  margin-left: 8px;
}

.g-inbox-list {
  display: grid;
  gap: 6px;
}

.g-inbox-row {
  display: grid;
  gap: 2px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.g-inbox-row.is-unread {
  background: var(--brand-soft);
  border-color: #f3cfd6;
}

.g-inbox-row span,
.g-inbox-row em {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: normal;
}

@media (max-width: 700px) {
  .g-gantt-filters {
    width: 100%;
  }

  .g-gantt-filter {
    flex: 1 1 120px;
  }

  .g-gantt-label-col,
  .g-gantt-table {
    --gantt-label: 200px;
  }
}

/* Escáner QR */
.g-sol-card.qr-list-card {
  text-decoration: none;
  color: inherit;
  grid-template-columns: 72px minmax(0, 1fr) auto auto;
  align-items: center;
}

.qr-list-link {
  display: contents;
  color: inherit;
  text-decoration: none;
}

.qr-list-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.g-sol-card.qr-list-card:hover {
  border-color: #d8dee6;
  box-shadow: var(--shadow-md, 0 4px 14px rgba(15, 23, 42, 0.08));
}

.qr-list-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: #f4f6f8;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.qr-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-list-stats {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-shrink: 0;
}

.qr-list-stat {
  min-width: 96px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f4f6f8;
  border: 1px solid var(--line);
  text-align: center;
}

.qr-list-stat--scans {
  background: var(--brand-soft);
  border-color: #f3cfd6;
}

.qr-list-stat strong {
  display: block;
  font-size: 1.18rem;
  font-weight: var(--fw-medium);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
  white-space: nowrap;
}

.qr-list-stat:not(.qr-list-stat--scans) strong {
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.qr-list-stat--scans strong {
  color: var(--brand);
}

.qr-list-stat span {
  display: block;
  margin-top: 3px;
  font-size: 0.66rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.qr-list-stat.is-empty strong {
  color: var(--muted);
  font-weight: var(--fw-medium);
}

.qr-slug-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.qr-slug-row em {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 0.82rem;
  font-weight: var(--fw-medium);
  color: var(--muted);
}

.qr-slug-row input {
  min-width: 0;
}

.qr-form [data-qr-pane][hidden] {
  display: none !important;
}

.qr-form [data-qr-pane="pagina"]:not([hidden]) {
  display: grid;
  gap: 12px;
}

.qr-tipos {
  border: 0;
  margin: 0;
  padding: 12px 14px 14px;
  border-radius: 14px;
  background: #f4f6f8;
}

.qr-tipos legend {
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0;
  margin-bottom: 10px;
}

.qr-tipo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.qr-tipo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-weight: var(--fw-medium);
}

.qr-tipo:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.qr-tipo input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.qr-tipo-ico {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.qr-tipo-ico svg {
  width: 16px;
  height: 16px;
  display: block;
}

.qr-current-img {
  display: block;
  margin-top: 10px;
  max-width: 220px;
  max-height: 160px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.qr-detail {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
}

.qr-preview-panel {
  text-align: center;
}

.qr-preview {
  width: min(280px, 100%);
  height: auto;
  background: #fff;
  border-radius: 16px;
}

.qr-dl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.qr-short-url {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f4f6f8;
  font-weight: var(--fw-medium);
  word-break: break-all;
}

.qr-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

.qr-stat {
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.qr-stat strong {
  display: block;
  font-size: 1.35rem;
  font-weight: var(--fw-medium);
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.qr-stat span {
  font-size: 0.75rem;
  font-weight: var(--fw-medium);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qr-payload {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.qr-landing {
  min-height: 70dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 24px;
}

.qr-landing-card {
  width: min(520px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.qr-landing-card img {
  margin-bottom: 10px;
}

.qr-landing-card .qr-payload {
  margin-top: 16px;
  text-align: left;
  color: var(--ink);
}

.qr-landing-card .qr-payload-empty {
  color: var(--muted);
  text-align: center;
}

.qr-analytics {
  margin: 0 0 22px;
}

.qr-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.qr-chart {
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  min-width: 0;
}

.qr-chart-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: var(--fw-medium);
}

.qr-chart-sub {
  margin: 2px 0 14px;
  font-size: 0.75rem;
  font-weight: var(--fw-medium);
  color: var(--muted);
}

.qr-cols {
  display: flex;
  align-items: stretch;
  gap: 4px;
  height: 160px;
}

.qr-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.qr-col i {
  display: block;
  width: 100%;
  max-width: 18px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--brand) 0%, #f43f5e 100%);
  min-height: 0;
}

.qr-col-val {
  font-size: 0.62rem;
  font-weight: var(--fw-medium);
  color: var(--muted);
  line-height: 1;
  min-height: 0.7rem;
}

.qr-col em {
  font-style: normal;
  font-size: 0.62rem;
  font-weight: var(--fw-medium);
  color: var(--muted);
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
}

.qr-col em.is-quiet {
  min-height: 0.7rem;
}

.qr-cols-hours .qr-col i {
  max-width: 8px;
  background: linear-gradient(180deg, #3b82f6 0%, #93c5fd 100%);
}

.qr-ranks {
  display: grid;
  gap: 10px;
}

.qr-rank-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.qr-rank-top strong {
  font-size: 0.85rem;
  font-weight: var(--fw-medium);
  min-width: 0;
}

.qr-rank-top em {
  font-style: normal;
  font-size: 0.8rem;
  font-weight: var(--fw-medium);
  color: var(--muted);
}

.qr-rank-track {
  height: 8px;
  border-radius: 999px;
  background: #e8edf2;
  overflow: hidden;
  margin-top: 4px;
}

.qr-rank-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #f43f5e);
}

.qr-donut-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.qr-donut {
  width: 112px;
  height: 112px;
  flex: 0 0 auto;
  border-radius: 50%;
  mask: radial-gradient(circle, transparent 46%, #000 47%);
  -webkit-mask: radial-gradient(circle, transparent 46%, #000 47%);
}

.qr-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.qr-legend li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
  font-weight: var(--fw-medium);
}

.qr-legend i {
  width: 10px;
  height: 10px;
  border-radius: 99px;
}

.qr-legend em {
  font-style: normal;
  font-weight: var(--fw-medium);
  color: var(--muted);
}

@media (max-width: 900px) {
  .qr-charts {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 800px) {
  .qr-detail,
  .qr-tipo-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .g-sol-card.qr-list-card {
    grid-template-columns: 56px minmax(0, 1fr) auto;
  }

  .qr-list-actions {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
  }

  .qr-list-stats {
    grid-column: 1 / -1;
  }

  .qr-list-stat {
    flex: 1;
    min-width: 0;
  }

  .qr-charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .qr-tipo-grid {
    grid-template-columns: 1fr 1fr;
  }
}


/* Multimedia */
.mm-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.mm-folder-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mm-folder-card:hover {
  border-color: rgba(209, 10, 53, 0.35);
}

.mm-folder-main {
  display: grid;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.mm-folder-actions {
  display: flex;
  gap: 6px;
}

.mm-folder-ico {
  color: var(--brand);
}

.mm-folder-card strong {
  font-size: 1rem;
  font-weight: var(--fw-medium);
}

.mm-folder-meta {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: var(--fw-medium);
}

.mm-folder-path {
  font-size: 0.72rem;
  color: var(--muted);
  word-break: break-all;
}

.mm-upload-panel {
  margin-bottom: 16px;
}

.mm-upload-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.mm-upload-row {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f4f6f8;
  border: 1px solid var(--line);
}

.mm-upload-row.is-done {
  border-color: #b7e4c7;
  background: #f1faf4;
}

.mm-upload-row.is-error {
  border-color: #f3cfd6;
  background: #fff4f6;
}

.mm-upload-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.mm-upload-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-upload-top span {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: var(--fw-medium);
  font-size: 0.78rem;
}

.mm-upload-track {
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.mm-upload-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #f43f5e);
  transition: width 0.15s ease;
}

.mm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
}

.mm-view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 12px;
  background: #f4f6f8;
  border: 1px solid var(--line);
}

.mm-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: var(--fw-medium);
  color: var(--muted);
}

.mm-sort select {
  min-width: 160px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: var(--fw-medium);
}

.mm-ico-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.mm-ico-btn:hover {
  border-color: rgba(209, 10, 53, 0.35);
  background: var(--brand-soft);
  color: var(--brand);
}

.mm-ico-btn.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.mm-ico-btn.is-copied {
  border-color: #16a34a;
  background: #ecfdf3;
  color: #15803d;
}

.mm-ico-btn.mm-ico-danger:hover {
  border-color: #f3cfd6;
  background: #fff4f6;
  color: var(--brand);
}

.mm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.mm-page-hint {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--muted, #667085);
}

.mm-load-more {
  display: flex;
  justify-content: center;
  margin: 4px 0 22px;
}

.mm-load-more[hidden] {
  display: none;
}

.mm-load-more .btn[disabled] {
  opacity: 0.7;
  cursor: wait;
}

.mm-grid[data-view="list"] {
  grid-template-columns: 1fr;
  gap: 8px;
}

.mm-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.mm-grid[data-view="list"] .mm-card {
  display: grid;
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  align-items: stretch;
}

.mm-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #f4f6f8;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.mm-grid[data-view="list"] .mm-card-media {
  order: 0;
  aspect-ratio: auto;
  width: 100%;
  min-height: 140px;
  height: 100%;
  max-height: none;
  border-left: 0;
  border-right: 1px solid var(--line);
  background: #f0f3f6;
  padding: 10px;
  box-sizing: border-box;
}

.mm-grid[data-view="list"] .mm-card-body {
  order: 1;
  padding: 14px 16px;
  align-content: center;
}

.mm-card-media img,
.mm-card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mm-grid[data-view="list"] .mm-card-media img,
.mm-grid[data-view="list"] .mm-card-media video {
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  object-position: center;
  padding: 0;
  display: block;
  margin: 0 auto;
}

.mm-grid[data-view="list"] .mm-doc-preview {
  min-height: 120px;
}

.mm-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(42, 44, 46, 0.75);
  color: #fff;
  font-size: 0.68rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mm-grid[data-view="list"] .mm-badge {
  display: none;
}

.mm-card-body {
  padding: 12px;
  display: grid;
  gap: 6px;
  align-content: center;
}

.mm-card-title {
  font-size: 0.88rem;
  font-weight: var(--fw-medium);
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.mm-card-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.mm-card-path {
  display: none;
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  word-break: break-all;
}

.mm-grid[data-view="list"] .mm-card-path {
  display: block;
}

.mm-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.mm-dialog {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(520px, calc(100vw - 24px));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

.mm-dialog::backdrop {
  background: rgba(30, 32, 36, 0.45);
}

.mm-dialog-body {
  padding: 18px 18px 16px;
  display: grid;
  gap: 12px;
}

.mm-dialog-editor {
  width: min(820px, calc(100vw - 24px));
}

.mm-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mm-editor-stage {
  position: relative;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 240px;
}

.mm-editor-stage canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.mm-crop {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  cursor: move;
  touch-action: none;
}

.mm-dropzone {
  display: grid;
  gap: 4px;
  place-items: center;
  text-align: center;
  margin: 0 0 16px;
  padding: 22px 16px;
  border: 2px dashed #c9 rec4d0;
  border-radius: 16px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.mm-dropzone strong {
  font-size: 0.95rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
}

.mm-dropzone span {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: var(--fw-medium);
  max-width: 42rem;
  line-height: 1.35;
}

.mm-dropzone:hover,
.mm-dropzone.is-dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.mm-dropzone.is-dragover strong {
  color: var(--brand);
}

.mm-doc-preview {
  display: grid;
  gap: 6px;
  place-items: center;
  color: #5b6168;
}

.mm-doc-preview em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  color: var(--brand);
}

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

.mm-folder-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.mm-folder-main {
  display: grid;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.mm-folder-actions {
  display: flex;
  gap: 6px;
}

.mm-folder-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mm-folder-title-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.mm-folder-title-actions [data-mm-paste] {
  position: relative;
}

.mm-folder-title-actions [data-mm-paste].has-clip {
  border-color: rgba(209, 10, 53, 0.35);
  color: var(--brand);
}

.mm-paste-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.65rem;
  font-weight: var(--fw-medium);
  line-height: 16px;
  text-align: center;
}

.mm-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mm-bulk-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 3px 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.mm-bulk-count {
  font-size: 0.75rem;
  font-weight: var(--fw-medium);
  color: var(--muted);
  margin-right: 2px;
}

.mm-card {
  position: relative;
}

.mm-card.is-selected {
  border-color: rgba(209, 10, 53, 0.45);
  box-shadow: 0 0 0 2px rgba(209, 10, 53, 0.12);
}

.mm-check {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  cursor: pointer;
}

.mm-check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.mm-check-box {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  background: rgba(42, 44, 46, 0.45);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.mm-check input:checked + .mm-check-box {
  background: var(--brand);
  border-color: #fff;
}

.mm-check input:checked + .mm-check-box::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.mm-grid[data-view="list"] .mm-check {
  top: 10px;
  left: auto;
  right: 12px;
}

.mm-lightbox {
  border: 0;
  padding: 0;
  width: min(1100px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  background: transparent;
  color: #fff;
}

.mm-lightbox::backdrop {
  background: rgba(20, 22, 26, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.mm-lightbox-stage {
  display: grid;
  place-items: center;
  min-height: 50vh;
  padding: 48px 56px 24px;
}

.mm-lightbox-stage img,
.mm-lightbox-stage video {
  max-width: min(100%, 960px);
  max-height: 78vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  background: #111;
}

.mm-lightbox-caption {
  margin: 0;
  padding: 0 24px 20px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: var(--fw-medium);
  color: rgba(255, 255, 255, 0.9);
}

.mm-lightbox-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.mm-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.mm-lightbox-nav.is-prev { left: 8px; }
.mm-lightbox-nav.is-next { right: 8px; }

.mm-lightbox-close:hover,
.mm-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

@media (max-width: 700px) {
  .mm-lightbox-stage {
    padding: 52px 12px 16px;
  }
  .mm-lightbox-nav.is-prev { left: 2px; }
  .mm-lightbox-nav.is-next { right: 2px; }

  .mm-grid[data-view="list"] .mm-card {
    grid-template-columns: 1fr;
  }

  .mm-grid[data-view="list"] .mm-card-media {
    order: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    min-height: 160px;
  }

  .mm-grid[data-view="list"] .mm-card-media img,
  .mm-grid[data-view="list"] .mm-card-media video {
    max-height: 220px;
  }

  .mm-grid[data-view="list"] .mm-card-body {
    order: 1;
  }
}

.mm-access-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  background: #eef2f6;
  color: #475467;
}

.mm-access-badge.is-pin {
  background: #fff4f6;
  color: var(--brand);
}

.mm-access-modes {
  border: 0;
  padding: 0;
  margin: 0 0 14px;
  display: grid;
  gap: 8px;
}

.mm-access-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.mm-access-option input {
  margin-top: 3px;
}

.mm-public-folder {
  max-width: 1100px;
  margin: 0 auto;
}

.mm-public-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.mm-public-pin-card {
  max-width: 420px;
  margin: 24px auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.mm-public-pin-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.mm-public-grid {
  margin-bottom: 24px;
}

.mm-public-card .mm-public-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tonos-section {
  margin-bottom: 16px;
}

.tonos-section-title {
  margin: 0 0 4px;
}

.tonos-section-sub {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: var(--muted, #667085);
}

.page-tonos .tonos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.page-tonos .tonos-grid-official {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.page-tonos .tonos-grid-official .tonos-card {
  width: min(100%, 220px);
  max-width: 220px;
}

.tonos-card {
  border-radius: 14px;
  overflow: hidden;
  background: transparent;
}

.tonos-swatch {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 120px;
  display: flex;
  align-items: flex-end;
  padding: 10px 12px;
  border-radius: 14px 14px 0 0;
}

.tonos-swatch-name {
  font-size: 0.82rem;
  font-weight: var(--fw-medium);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  background: rgba(0, 0, 0, 0.22);
  padding: 4px 8px;
  border-radius: 8px;
}

.tonos-swatch.is-light .tonos-swatch-name {
  color: #2d2e2f;
  text-shadow: none;
  background: rgba(255, 255, 255, 0.72);
}

.tonos-meta {
  display: grid;
  gap: 0;
}

.tonos-copy {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: background 0.12s ease;
}

.tonos-copy:first-child {
  padding-top: 8px;
}

.tonos-copy:hover {
  background: #f8fafc;
}

.tonos-copy.is-copied {
  background: #f1faf4;
}

.tonos-copy-label {
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #667085);
}

.tonos-copy-value {
  font-size: 0.84rem;
  font-weight: var(--fw-medium);
  color: #1f2937;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
}

/* —— Notas / post-its —— */
.notas-fab-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.notas-fab-root > * {
  pointer-events: auto;
}

.notas-fab-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.notas-fab-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #fde68a;
  color: #78350f;
  box-shadow: 0 10px 28px rgba(120, 53, 15, 0.28);
  cursor: pointer;
  flex-shrink: 0;
}

.notas-fab-new:hover {
  background: #fcd34d;
}

.notas-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 0;
  border-radius: 999px;
  background: #fde68a;
  color: #78350f;
  font: inherit;
  font-weight: var(--fw-medium);
  font-size: 0.9rem;
  box-shadow: 0 10px 28px rgba(120, 53, 15, 0.28);
  cursor: pointer;
  position: relative;
}

.notas-fab:hover {
  background: #fcd34d;
}

.notas-fab-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #d10a35;
  color: #fff;
  font-size: 0.68rem;
  font-weight: var(--fw-medium);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
}

.notas-reminders {
  width: min(260px, calc(100vw - 36px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  max-height: 220px;
  overflow-y: auto;
}

.notas-reminders-head {
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: #fafafa;
}

.notas-reminder {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  background: #fff7ed;
}

.notas-reminder:last-child {
  border-bottom: 0;
}

.notas-reminder strong {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 2px;
}

.notas-reminder span {
  display: block;
  font-size: 0.78rem;
  color: #57534e;
}

.notas-reminder.color-amarillo { background: #fef9c3; }
.notas-reminder.color-rosa { background: #fce7f3; }
.notas-reminder.color-azul { background: #dbeafe; }
.notas-reminder.color-verde { background: #dcfce7; }
.notas-reminder.color-naranja { background: #ffedd5; }
.notas-reminder.color-lila { background: #ede9fe; }

.notas-stack {
  width: min(280px, calc(100vw - 36px));
  transition: width 0.28s ease;
}

.notas-stack:has(.notas-stack-pile.is-expanded[data-expand="horizontal"]) {
  width: min(calc(200px + (var(--count, 1) - 1) * 212px), calc(100vw - 36px));
}

.notas-stack:has(.notas-stack-actions) {
  width: max-content;
  max-width: calc(100vw - 36px);
  min-width: min(280px, calc(100vw - 36px));
}

.notas-stack-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  justify-content: flex-end;
  margin-left: auto;
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
}

.notas-stack-actions .btn {
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.notas-stack-pile {
  position: relative;
  min-height: 140px;
  width: 220px;
  margin-left: auto;
  transition: min-height 0.28s ease, width 0.28s ease;
}

.notas-stack-card {
  position: absolute;
  top: 0;
  right: 0;
  left: auto;
  width: 200px;
  min-height: 120px;
  padding: 14px;
  border: 0;
  border-radius: 4px 12px 12px 12px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
  transform: translate(calc(var(--i, 0) * -10px), calc(var(--i, 0) * 10px));
  transition: transform 0.28s ease, box-shadow 0.28s ease, filter 0.15s ease;
}

.notas-stack-pile.is-expanded[data-expand="horizontal"] {
  width: min(calc(200px + (var(--count, 1) - 1) * 212px), calc(100vw - 36px));
  min-height: 140px;
}

.notas-stack-pile.is-expanded[data-expand="horizontal"] .notas-stack-card {
  transform: translate(calc(var(--i, 0) * -212px), 0);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.notas-stack-pile.is-expanded[data-expand="vertical"] .notas-stack-card {
  transform: translate(0, calc(var(--i, 0) * 132px));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.notas-stack-pile.is-expanded[data-expand="vertical"][data-count="2"] { min-height: 252px; }
.notas-stack-pile.is-expanded[data-expand="vertical"][data-count="3"] { min-height: 384px; }
.notas-stack-pile.is-expanded[data-expand="vertical"][data-count="4"] { min-height: 516px; }
.notas-stack-pile.is-expanded[data-expand="vertical"][data-count="5"] { min-height: 648px; }
.notas-stack-pile.is-expanded[data-expand="vertical"][data-count="6"] { min-height: 780px; }
.notas-stack-pile.is-expanded[data-expand="vertical"][data-count="7"] { min-height: 912px; }
.notas-stack-pile.is-expanded[data-expand="vertical"][data-count="8"] { min-height: 1044px; }

.notas-stack-pile.is-expanded .notas-stack-card:hover {
  filter: brightness(0.98);
  z-index: 20 !important;
}

.notas-stack-card strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.notas-stack-card span {
  display: block;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #44403c;
}

.notas-stack-empty {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 16px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.notas-stack-empty-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 8px;
  border-radius: 14px;
  background: #fef3c7;
  color: #a16207;
}

.notas-stack-empty p {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--muted);
}

.notas-stack-empty-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.notas-btn-ico {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.notas-btn-ico svg {
  flex-shrink: 0;
}

.notas-card-when,
.notas-reminder-when {
  display: block;
  margin-top: 6px;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: var(--fw-medium);
  color: #57534e;
  opacity: 0.9;
}

.notas-editor-bar-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.notas-cal-btn,
.notas-save-btn,
.notas-pin-btn,
.notas-editor-x {
  border: 0;
  background: transparent;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notas-cal-btn:hover,
.notas-save-btn:hover,
.notas-pin-btn:hover,
.notas-editor-x:hover {
  background: rgba(0, 0, 0, 0.06);
}

.notas-pin-btn.is-pinned {
  background: rgba(0, 0, 0, 0.08);
}

.notas-editor-x {
  font-size: 1.1rem;
  color: #57534e;
}

.notas-agenda-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 2px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  font-size: 0.78rem;
  font-weight: var(--fw-medium);
  color: #44403c;
}

.notas-agenda-chip svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.notas-agenda-chip-x {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: #78716c;
  padding: 0 2px;
}

.notas-stack-more {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
}

.notas-editor {
  width: min(320px, calc(100vw - 36px));
  padding: 12px;
  border-radius: 4px 14px 14px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.notas-editor.color-amarillo,
.notas-stack-card.color-amarillo,
.notas-page-card.color-amarillo,
.notas-page-card.color-amarillo .notas-page-card-head,
.notas-page-card.color-amarillo .notas-page-card-body { background: #fef3c7; }
.notas-editor.color-rosa,
.notas-stack-card.color-rosa,
.notas-page-card.color-rosa,
.notas-page-card.color-rosa .notas-page-card-head,
.notas-page-card.color-rosa .notas-page-card-body { background: #fce7f3; }
.notas-editor.color-azul,
.notas-stack-card.color-azul,
.notas-page-card.color-azul,
.notas-page-card.color-azul .notas-page-card-head,
.notas-page-card.color-azul .notas-page-card-body { background: #dbeafe; }
.notas-editor.color-verde,
.notas-stack-card.color-verde,
.notas-page-card.color-verde,
.notas-page-card.color-verde .notas-page-card-head,
.notas-page-card.color-verde .notas-page-card-body { background: #dcfce7; }
.notas-editor.color-naranja,
.notas-stack-card.color-naranja,
.notas-page-card.color-naranja,
.notas-page-card.color-naranja .notas-page-card-head,
.notas-page-card.color-naranja .notas-page-card-body { background: #ffedd5; }
.notas-editor.color-lila,
.notas-stack-card.color-lila,
.notas-page-card.color-lila,
.notas-page-card.color-lila .notas-page-card-head,
.notas-page-card.color-lila .notas-page-card-body { background: #ede9fe; }

.notas-editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.notas-editor-title,
.notas-page-title {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: var(--fw-medium);
  margin-bottom: 6px;
  outline: none;
}

.notas-editor-body,
.notas-page-body {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  resize: vertical;
  outline: none;
  line-height: 1.45;
}

.notas-editor-actions,
.notas-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.notas-color-field {
  border: 0;
  padding: 0;
  margin: 0 0 12px;
}

.notas-color-field legend {
  font-size: 0.82rem;
  font-weight: var(--fw-medium);
  margin-bottom: 6px;
}

.notas-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.notas-color-swatch {
  position: relative;
  cursor: pointer;
}

.notas-color-swatch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.notas-color-swatch span {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.notas-color-swatch input:checked + span {
  outline: 2px solid #d10a35;
  outline-offset: 2px;
}

.notas-page-stack {
  position: relative;
  width: 100%;
  min-height: 132px;
  margin: 12px 0 0;
  padding: 0;
}

.notas-page-stack.has-open {
  margin-bottom: 16px;
}

.notas-page-stack .notas-page-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 220px;
  margin: 0;
  overflow: visible;
  transition: left 0.24s ease, top 0.24s ease, transform 0.24s ease, box-shadow 0.24s ease, opacity 0.2s ease;
  transform: rotate(calc(var(--tilt, 0) * 1deg));
  z-index: calc(var(--i, 0) + 1);
}

.notas-page-stack.is-fanned:not(.has-open) .notas-page-card {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.notas-page-stack.has-open .notas-page-card:not(.is-open) {
  opacity: 0.9;
}

.notas-page-stack.has-open .notas-page-card.is-open {
  z-index: calc(var(--count, 4) + 2);
  opacity: 1;
}

.notas-page-stack.has-open .notas-page-card.is-open .notas-page-card-body {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(420px, calc(100vw - 48px));
  z-index: 30;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.notas-page-card-head {
  display: block;
  width: 100%;
  min-height: 108px;
  border: 0;
  border-radius: 4px 14px 14px 14px;
  padding: 14px 16px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  color: inherit;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.notas-page-card-head strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.notas-page-card-head span {
  display: block;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #44403c;
}

.notas-page-badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #78716c;
}

.notas-page-card.is-open .notas-page-card-head {
  display: none;
}

.notas-page-card-body {
  border-radius: 4px 14px 14px 14px;
  padding: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.notas-page-card-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.notas-page-card-bar strong {
  font-size: 0.88rem;
}

.notas-page-card-close {
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: #78716c;
  padding: 2px 6px;
  border-radius: 8px;
}

.notas-page-card-close:hover {
  background: rgba(0, 0, 0, 0.06);
}

.page-notas {
  overflow-x: clip;
}

.notas-page-card {
  border-radius: 4px 14px 14px 14px;
}

.notas-page-card.is-minimized .notas-page-card-head {
  opacity: 0.82;
}

.notas-create-panel {
  margin-bottom: 16px;
}

.notas-page-agenda {
  margin: 8px 0 4px;
}

.notas-page-agenda .dtp-trigger {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 0.82rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
}

.g-act-veces {
  color: #9a3412 !important;
  margin: 4px 0 0 !important;
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .notas-page-stack.has-open .notas-page-card.is-open .notas-page-card-body {
    width: min(420px, calc(100vw - 32px));
  }

  .notas-fab-root {
    right: 12px;
    bottom: 12px;
  }

  .notas-fab span {
    display: none;
  }

  .notas-fab {
    width: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
    border-radius: 16px;
  }

  .notas-fab-new {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }
}


/* —— Compartir QR / Multimedia —— */
.share-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  background: var(--brand-soft, #fde8ee);
  color: var(--brand, #d10a35);
  white-space: nowrap;
}
.share-dialog {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(420px, calc(100vw - 24px));
  max-height: min(80vh, 560px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  z-index: 200;
}
.share-dialog:not([open]) {
  display: none;
}
.share-dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}
.share-dialog-body {
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.share-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.share-dialog-x {
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 2px 6px;
  border-radius: 8px;
}
.share-dialog-x:hover { background: #f1f5f9; color: #0f172a; }
.share-everyone {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  cursor: pointer;
  background: #fafafa;
}
.share-everyone input { margin-top: 3px; }
.share-users-wrap.is-disabled { opacity: 0.45; pointer-events: none; }
.share-users-label {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: var(--fw-medium);
  color: #475569;
}
.share-users {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  padding: 6px;
}
.share-user {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.share-user:hover { background: #f8fafc; }
.share-user span { display: flex; flex-direction: column; gap: 1px; }
.share-user em {
  font-style: normal;
  font-size: 0.75rem;
  color: #94a3b8;
}
.share-error {
  margin: 0;
  color: var(--brand, #d10a35);
  font-size: 0.84rem;
}
.btn-ico {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* —— Lista de tareas —— */
.page-tareas-list .page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.tareas-empty {
  padding: 48px 24px;
  text-align: center;
  color: #64748b;
}
.tareas-empty p { margin: 0 0 16px; }
.tareas-page-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tareas-page-item {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.tareas-page-link {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.tareas-page-link:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.tareas-page-delete {
  margin: 0;
  display: flex;
  align-items: stretch;
}
.tareas-page-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  background: #fff;
  color: #94a3b8;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.tareas-page-delete-btn:hover {
  border-color: #fecaca;
  background: #fef2f2;
  color: var(--brand, #d10a35);
}
.tareas-page-link strong {
  font-weight: var(--fw-medium, 500);
  font-size: 1rem;
}
.tareas-page-meta {
  font-size: 0.8rem;
  color: #94a3b8;
}

.tareas-editor-page {
  min-height: calc(100vh - 64px);
  background: #fff;
}
.tareas-editor-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 20px 0;
  font-size: 0.85rem;
}
.tareas-back { justify-self: start; }
.tareas-new { justify-self: end; }
.tareas-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: center;
}
.tareas-save-status {
  font-size: 0.8rem;
  color: #94a3b8;
}
.tareas-save-status.is-saving { color: #64748b; }
.tareas-save-status.is-error { color: var(--brand, #d10a35); }
.tareas-save-btn {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.tareas-save-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.tareas-back,
.tareas-new {
  color: #64748b;
  text-decoration: none;
}
.tareas-back:hover,
.tareas-new:hover { color: var(--brand, #d10a35); }

.tareas-canvas {
  max-width: 1040px;
  margin: 0 auto;
  padding: 8px 20px 120px;
}
.tareas-title {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: var(--fw-medium, 500);
  line-height: 1.25;
  color: #0f172a;
  outline: none;
  padding: 8px 0;
}
.tareas-title::placeholder {
  color: #cbd5e1;
  font-weight: var(--fw-normal, 400);
}
.tareas-rule {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 4px 0 28px;
}
.tareas-blocks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tareas-block {
  position: relative;
  scroll-margin-top: calc(var(--header-h, 64px) + 24px);
  scroll-margin-bottom: 40px;
}
.tareas-block-remove {
  position: absolute;
  top: 2px;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.tareas-block:hover .tareas-block-remove,
.tareas-block-remove:focus {
  opacity: 1;
}
.tareas-block.is-empty-skill .tareas-block-remove {
  opacity: 1;
}
.tareas-block-remove:hover {
  background: #fef2f2;
  color: var(--brand, #d10a35);
}
.tareas-block-text .tareas-block-remove {
  top: 0;
}
.tareas-block-calendar,
.tareas-block-input,
.tareas-block-url,
.tareas-block-image,
.tareas-block-video,
.tareas-block-document,
.tareas-block-checklist,
.tareas-block-radiolist {
  padding-right: 28px;
}
.tareas-text {
  min-height: 1.5em;
  outline: none;
  font-size: 1rem;
  line-height: 1.65;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
}
.tareas-text:empty::before {
  content: attr(data-placeholder);
  color: #cbd5e1;
  pointer-events: none;
}
.tareas-url-field { margin: 4px 0; }
.tareas-url-input {
  width: 100%;
  border: 0;
  border-bottom: 1px dashed #cbd5e1;
  background: transparent;
  padding: 8px 0;
  font-size: 0.95rem;
  outline: none;
}
.tareas-url-input:focus { border-bottom-color: var(--brand, #d10a35); }
.tareas-media-img {
  display: block;
  max-width: 100%;
  border-radius: 8px;
}
.tareas-media-video,
.tareas-media-iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
  background: #0f172a;
}
.tareas-media-edit {
  margin-top: 8px;
  border: 0;
  background: none;
  color: #64748b;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}
.tareas-media-edit:hover { color: var(--brand, #d10a35); }
.tareas-link-card {
  display: inline-block;
  color: var(--brand, #d10a35);
  word-break: break-all;
  font-size: 0.95rem;
}
.tareas-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tareas-list-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.tareas-list-check,
.tareas-list-radio {
  margin-top: 6px;
  flex-shrink: 0;
  accent-color: var(--brand, #d10a35);
}
.tareas-list-text {
  flex: 1;
  min-height: 1.4em;
  outline: none;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.tareas-list-text:empty::before {
  content: attr(data-placeholder);
  color: #cbd5e1;
}
.tareas-block-input {
  padding: 8px 0;
}
.tareas-input-setup-field,
.tareas-input-field {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  background: transparent;
  padding: 6px 0;
  outline: none;
  font-size: 0.95rem;
}
.tareas-input-setup-field {
  color: #64748b;
  border-bottom-style: dashed;
}
.tareas-input-setup-field::placeholder {
  color: #94a3b8;
}
.tareas-input-field {
  color: #334155;
}
.tareas-input-field::placeholder {
  color: #94a3b8;
}
.tareas-block-calendar .dtp { max-width: 360px; }
.tareas-cal-display {
  margin-top: 10px;
  padding: 10px 14px;
  font-size: 1rem;
  color: #334155;
  font-weight: var(--fw-medium, 500);
  border-left: 3px solid var(--brand, #d10a35);
  background: #fef2f2;
  border-radius: 0 8px 8px 0;
}
.tareas-block-calendar .dtp-trigger.has-value {
  border-color: #fecaca;
  background: #fff;
}
.tareas-block.is-collapsed { opacity: 0.55; }

.tareas-slash-menu {
  position: fixed;
  z-index: 200;
  max-height: min(320px, calc(100vh - 24px));
  overflow-y: auto;
  min-width: 200px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tareas-slash-menu[hidden] { display: none !important; }
.tareas-slash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #334155;
  cursor: pointer;
}
.tareas-slash-item:hover,
.tareas-slash-item[data-active="1"] {
  background: #f1f5f9;
}
.tareas-slash-ico {
  display: inline-flex;
  color: #64748b;
}

/* —— Biblioteca multimedia (lienzo) —— */
.tareas-media-picker {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tareas-media-picker[hidden] { display: none !important; }
.tareas-media-picker-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.45);
  cursor: default;
}
.tareas-media-picker-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(80vh, 640px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tareas-media-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.tareas-media-picker-head strong {
  font-weight: var(--fw-medium, 500);
  font-size: 1rem;
}
.tareas-media-picker-x {
  border: 0;
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
}
.tareas-media-picker-filters {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.tareas-media-filter {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.tareas-media-filter.is-active {
  border-color: var(--brand, #d10a35);
  color: var(--brand, #d10a35);
  background: #fef2f2;
}
.tareas-media-picker-body {
  flex: 1;
  overflow: auto;
  padding: 14px 16px;
}
.tareas-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.tareas-media-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tareas-media-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.tareas-media-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
}
.tareas-media-badge.is-shared {
  background: #dbeafe;
  color: #1d4ed8;
}
.tareas-media-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background: #f8fafc;
  border-radius: 6px;
  overflow: hidden;
}
.tareas-media-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tareas-media-thumb-video,
.tareas-media-thumb-doc {
  font-size: 1.75rem;
  color: #64748b;
}
.tareas-media-name {
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tareas-media-folder {
  font-size: 0.72rem;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tareas-media-empty,
.tareas-media-loading {
  text-align: center;
  color: #64748b;
  padding: 32px 16px;
}
.tareas-media-empty-link {
  color: var(--brand, #d10a35);
}
.tareas-media-picker-foot {
  padding: 10px 16px 14px;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}
.tareas-media-more {
  border: 0;
  background: none;
  color: var(--brand, #d10a35);
  font-size: 0.85rem;
  cursor: pointer;
}
.tareas-media-prompt {
  padding: 8px 0;
  color: #64748b;
  font-size: 0.9rem;
}
.tareas-media-prompt p { margin: 0 0 10px; }
.tareas-media-pick-btn {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
}
.tareas-media-pick-btn:hover {
  border-color: var(--brand, #d10a35);
  color: var(--brand, #d10a35);
}
.tareas-media-caption {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #64748b;
}
.tareas-doc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}
.tareas-doc-card:hover { border-color: #cbd5e1; background: #f8fafc; }
.tareas-doc-ico { font-size: 1.5rem; }
.tareas-doc-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tareas-doc-info strong {
  font-weight: var(--fw-medium, 500);
  font-size: 0.95rem;
}
.tareas-doc-info small { color: #94a3b8; font-size: 0.78rem; }
.tareas-url-type-label {
  margin: 0 0 10px;
  color: #64748b;
  font-size: 0.9rem;
}
.tareas-url-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tareas-url-type-btn {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
}
.tareas-url-type-btn:hover {
  border-color: var(--brand, #d10a35);
  color: var(--brand, #d10a35);
}
.tareas-block-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

/* —— Tableros: solicitudes y kanban de actividades —— */
.g-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  width: 100%;
  align-items: start;
}

.g-board-unit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.g-board-card {
  display: flex;
  flex-direction: column;
  min-height: 168px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: inherit;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.g-board-unit.is-expanded .g-board-card {
  border-color: rgba(209, 10, 53, 0.25);
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.08);
}

.g-board-card-main {
  display: block;
  text-decoration: none;
  color: inherit;
}

.g-board-card-main:hover .g-board-card-title {
  color: var(--brand);
}

.g-board-card-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4f5f7;
  font-size: 0.78rem;
  font-weight: var(--fw-medium);
  color: #475569;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.g-board-card-count:hover,
.g-board-unit.is-expanded .g-board-card-count {
  background: #fff4f6;
  border-color: #f3cfd6;
  color: var(--brand);
}

.g-board-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.g-board-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.g-board-add-btn:hover {
  background: #fff4f6;
  border-color: #f3cfd6;
}

.g-board-chevron {
  transition: transform 0.15s ease;
}

.g-board-unit.is-expanded .g-board-chevron {
  transform: rotate(180deg);
}

.g-board-card-date {
  font-size: 0.78rem;
  color: var(--muted);
}

.g-board-drop {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.g-board-drop[hidden] {
  display: none !important;
}

.g-board-add-form[hidden] {
  display: none !important;
}

.g-board-drop-body {
  min-width: 0;
}

.g-board-panel-loading {
  margin: 0;
  font-size: 0.82rem;
}

.g-board-act-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.g-board-act-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.g-board-act-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.g-board-act-main strong {
  font-size: 0.88rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
}

.g-board-act-main span {
  font-size: 0.78rem;
  color: var(--muted);
}

.g-board-act-main em {
  font-size: 0.78rem;
  font-style: normal;
  color: #64748b;
}

.g-board-act-status {
  flex-shrink: 0;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 0.78rem;
}

.g-board-act-empty {
  margin: 0;
  font-size: 0.82rem;
}

.g-board-quick-add {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #fff;
}

.g-board-add-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.g-board-quick-add .field span {
  font-size: 0.78rem;
}

.g-board-quick-add .field input,
.g-board-quick-add .field select {
  min-height: 36px;
  font-size: 0.85rem;
}

.g-board-quick-add button {
  justify-self: start;
}

.g-board-card-bar {
  height: 4px;
  background: var(--brand);
}

.g-board-card-bar.is-abierta { background: #f59e0b; }
.g-board-card-bar.is-en_proceso { background: #3b82f6; }
.g-board-card-bar.is-entregado { background: #06b6d4; }
.g-board-card-bar.is-cerrada { background: #64748b; }

.g-board-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  padding: 14px 16px 16px;
  min-width: 0;
}

.g-board-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.g-board-card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.g-board-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: var(--fw-medium);
  line-height: 1.35;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.g-board-card-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.g-board-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}

.page-sol-board {
  max-width: none;
  width: 100%;
}

.g-sol-board-head {
  margin-bottom: 18px;
}

.g-sol-board-details {
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.g-sol-board-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.g-sol-board-details > summary::-webkit-details-marker {
  display: none;
}

.g-sol-board-details > summary::after {
  content: '▾';
  color: var(--muted);
  transition: transform 0.15s ease;
}

.g-sol-board-details[open] > summary::after {
  transform: rotate(-180deg);
}

.g-sol-board-details-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}

.g-kanban-wrap {
  margin-top: 4px;
}

.g-kanban-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.g-kanban-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: var(--fw-medium);
}

.g-kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 8px;
}

.g-kanban-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
  min-width: 220px;
  padding: 10px;
  border-radius: 12px;
  background: #f4f5f7;
  border: 1px solid #e8eaee;
}

.g-kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 6px;
}

.g-kanban-col-head strong {
  font-size: 0.82rem;
  font-weight: var(--fw-medium);
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.g-kanban-col-count {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.75rem;
  font-weight: var(--fw-medium);
  color: var(--muted);
}

.g-kanban-col-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 48px;
}

.g-kanban-col-body.is-drag-over {
  background: rgba(209, 10, 53, 0.06);
  border-radius: 8px;
  outline: 2px dashed rgba(209, 10, 53, 0.35);
  outline-offset: 2px;
}

.g-kanban-card {
  display: block;
  padding: 12px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  cursor: grab;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.g-kanban-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
}

.g-kanban-card.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.g-kanban-card.is-open {
  border-color: rgba(209, 10, 53, 0.35);
  box-shadow: 0 4px 16px rgba(209, 10, 53, 0.1);
}

.g-kanban-card-title {
  display: block;
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
  line-height: 1.35;
}

.g-kanban-card-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.g-kanban-card-date {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #fff7ec;
  border: 1px solid #f0dfc2;
  font-size: 0.72rem;
  font-weight: var(--fw-medium);
  color: #9a5b00;
}

.g-kanban-card-edit {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.g-kanban-card-edit[hidden] {
  display: none !important;
}

.g-kanban-card-edit .field span {
  font-size: 0.78rem;
}

.g-kanban-card-edit .field input,
.g-kanban-card-edit .field select {
  font-size: 0.85rem;
  min-height: 36px;
}

.g-kanban-add {
  margin-top: 16px;
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #fafbfc;
}

.g-kanban-add-title {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: var(--fw-medium);
}

@media (max-width: 1100px) {
  .g-kanban-board {
    grid-template-columns: repeat(4, minmax(200px, 280px));
  }
}

@media (max-width: 640px) {
  .g-board-grid {
    grid-template-columns: 1fr;
  }

  .g-kanban-board {
    grid-template-columns: 1fr;
  }
}

/* Catálogo: Área > Principal > Actividad */
.page-catalogo .g-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.g-catalog-tree {
  display: grid;
  gap: 20px;
}

.g-catalog-area {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.g-catalog-area-title {
  margin: 0;
  padding: 14px 18px;
  font-size: 1.05rem;
  font-weight: var(--fw-medium);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.g-catalog-group {
  padding: 14px 18px 16px;
  border-bottom: 1px solid var(--line);
}

.g-catalog-group:last-child {
  border-bottom: 0;
}

.g-catalog-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.g-catalog-principal-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
}

.g-catalog-principal-title-muted {
  color: var(--muted);
  font-weight: var(--fw-normal);
}

.g-catalog-principal-desc {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.g-catalog-empty {
  margin: 0;
  font-size: 0.82rem;
}

.g-catalog-act-list {
  display: grid;
  gap: 8px;
  min-height: 8px;
}

.g-catalog-act {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.g-catalog-act[draggable="true"] {
  cursor: grab;
}

.g-catalog-act.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.g-catalog-act.is-drop-parent {
  border-color: rgba(209, 10, 53, 0.45);
  box-shadow: 0 0 0 2px rgba(209, 10, 53, 0.15);
  background: #fff4f6;
}

.g-catalog-act-drag {
  flex-shrink: 0;
  color: #cbd5e1;
  font-size: 0.75rem;
  line-height: 1.2;
  letter-spacing: -0.08em;
  padding-top: 2px;
  user-select: none;
}

.g-catalog-act[draggable="true"]:hover .g-catalog-act-drag {
  color: #94a3b8;
}

.g-catalog-group.is-drop-target {
  outline: 2px dashed rgba(209, 10, 53, 0.4);
  outline-offset: 2px;
  border-radius: 10px;
  background: rgba(209, 10, 53, 0.03);
}

.g-catalog-group.is-drop-target .g-catalog-act-list {
  min-height: 48px;
}

.g-catalog-act-main {
  flex: 1;
  min-width: 0;
}

.g-catalog-act-main strong {
  display: block;
  font-size: 0.92rem;
  font-weight: var(--fw-medium);
}

.g-catalog-act-main p {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.g-catalog-act-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

/* —— Solicitud: prioridad (semáforo) + dropzones + cámara —— */
.g-prioridad {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.g-prioridad-opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.g-prioridad-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.g-prioridad-light {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.g-prioridad-opt.is-baja .g-prioridad-light {
  background: #22c55e;
}
.g-prioridad-opt.is-media .g-prioridad-light {
  background: #eab308;
}
.g-prioridad-opt.is-alta .g-prioridad-light {
  background: #ef4444;
}

.g-prioridad-label {
  font-size: 0.9rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
}

.g-prioridad-opt:has(input:checked),
.g-prioridad-opt:focus-within {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

.g-prioridad-opt.is-baja:has(input:checked) {
  border-color: #16a34a;
  background: #f0fdf4;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}
.g-prioridad-opt.is-media:has(input:checked) {
  border-color: #ca8a04;
  background: #fefce8;
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.2);
}
.g-prioridad-opt.is-alta:has(input:checked) {
  border-color: #dc2626;
  background: #fef2f2;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.g-prioridad-badge,
.g-prioridad-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: var(--fw-medium);
  line-height: 1;
  vertical-align: middle;
}

.g-prioridad-badge {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: var(--ink);
}

.g-prioridad-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.g-prioridad-badge.is-baja .g-prioridad-dot,
.g-prioridad-inline.is-baja .g-prioridad-dot {
  background: #22c55e;
}
.g-prioridad-badge.is-media .g-prioridad-dot,
.g-prioridad-inline.is-media .g-prioridad-dot {
  background: #eab308;
}
.g-prioridad-badge.is-alta .g-prioridad-dot,
.g-prioridad-inline.is-alta .g-prioridad-dot {
  background: #ef4444;
}

.g-prioridad-badge.is-alta {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}
.g-prioridad-badge.is-media {
  border-color: #fde68a;
  background: #fefce8;
  color: #a16207;
}
.g-prioridad-badge.is-baja {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.g-sol-uploads .g-sol-dropzone {
  display: grid;
  gap: 6px;
  place-items: center;
  text-align: center;
  margin: 6px 0 0;
  padding: 18px 14px;
  min-height: 132px;
  border: 2px dashed #c9d4e0;
  border-radius: 14px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.g-sol-dropzone strong {
  font-size: 0.92rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
}

.g-sol-dropzone [data-drop-hint] {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: var(--fw-medium);
}

.g-sol-dropzone:hover,
.g-sol-dropzone.is-dragover,
.g-sol-dropzone:focus-visible {
  outline: none;
  border-color: var(--brand);
  background: var(--brand-soft);
}

.g-sol-dropzone.is-dragover strong {
  color: var(--brand);
}

.g-sol-drop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 4px;
}

.g-sol-file-name {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--ink);
  font-weight: var(--fw-medium);
  word-break: break-word;
  max-width: 100%;
}

[data-upload-field].has-file .g-sol-dropzone {
  border-style: solid;
  border-color: #94a3b8;
  background: #fff;
}

.g-cam-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
}

.g-cam-modal[hidden] {
  display: none !important;
}

.g-cam-dialog {
  width: min(520px, 100%);
  background: #0f172a;
  color: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.g-cam-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.06);
}

.g-cam-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.g-cam-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.g-cam-dialog video {
  display: block;
  width: 100%;
  max-height: min(60vh, 420px);
  object-fit: cover;
  background: #000;
}

.g-cam-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 720px) {
  .g-prioridad {
    flex-direction: column;
  }
  .g-prioridad-opt {
    width: 100%;
  }
}

/* —— Icono de información (leyendas) —— */
.page-title-with-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.page-title-with-info .page-title {
  margin-bottom: 0;
}

.field-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ui-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  flex-shrink: 0;
}

.ui-info-btn {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1.5px solid #94a3b8;
  border-radius: 50%;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.ui-info-ico {
  font-size: 11px;
  font-weight: 700;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  line-height: 1;
  transform: translateY(-0.5px);
}

.ui-info-btn:hover,
.ui-info-btn:focus-visible,
.ui-info-btn[aria-expanded='true'] {
  outline: none;
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.ui-info-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(280px, 70vw);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: var(--fw-medium);
  line-height: 1.4;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  text-align: left;
}

.ui-info-panel::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid #e2e8f0;
  border-top: 1px solid #e2e8f0;
  transform: translateX(-50%) rotate(45deg);
}

.ui-info-panel[hidden] {
  display: none !important;
}

.ui-info-line {
  display: block;
}

.ui-info-line + .ui-info-line {
  margin-top: 6px;
}

/* Evita que el panel se corte en columnas estrechas a la derecha */
.g-form-2 .field:last-child .ui-info-panel,
.g-form-3 .field:last-child .ui-info-panel,
.g-sol-uploads .field:last-child .ui-info-panel {
  left: auto;
  right: 0;
  transform: none;
}

.g-form-2 .field:last-child .ui-info-panel::before,
.g-form-3 .field:last-child .ui-info-panel::before,
.g-sol-uploads .field:last-child .ui-info-panel::before {
  left: auto;
  right: 8px;
  transform: rotate(45deg);
}

.page-title-with-info .ui-info-panel {
  left: 0;
  transform: none;
  max-width: min(360px, 85vw);
}

.page-title-with-info .ui-info-panel::before {
  left: 8px;
  transform: rotate(45deg);
}

.g-check-with-info {
  align-items: flex-start;
  gap: 8px;
}

.g-check-with-info .g-check-row {
  margin: 0;
}

.mm-bulk-rename-modes {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.mm-bulk-rename-mode {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Evita que .field input { width:100% } rompa el layout de los radios */
.mm-bulk-rename-mode input[type='radio'] {
  width: auto;
  min-width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 3px 0 0;
  padding: 0;
  border: 0;
  flex-shrink: 0;
  accent-color: var(--brand);
}

.mm-bulk-rename-mode .mm-bulk-rename-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.mm-bulk-rename-mode strong {
  display: block;
  font-size: 0.9rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
}

.mm-bulk-rename-mode em {
  display: block;
  font-style: normal;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.mm-bulk-rename-mode:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.mm-dialog [data-mm-bulk-rename-prefix-wrap][hidden] {
  display: none !important;
}

button.mm-ico-btn[data-mm-select-all].is-active {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.g-filter-today-field {
  min-width: 72px;
}

.g-filter-today {
  width: 100%;
  min-height: var(--tap);
  justify-content: center;
}

.g-filter-today.is-active {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.g-filter-quick-field {
  min-width: 0;
}

.g-filter-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.g-filter-quick-btn {
  min-height: var(--tap);
  padding-left: 12px;
  padding-right: 12px;
  justify-content: center;
  white-space: nowrap;
}

.g-filter-quick-btn.is-active {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.g-filter-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
}

.g-filter-search-toggle {
  flex-shrink: 0;
  min-width: var(--tap);
  min-height: var(--tap);
  justify-content: center;
  padding-left: 10px;
  padding-right: 10px;
}

.g-filter-search input[type='search'] {
  width: min(220px, 42vw);
  min-height: var(--tap);
}

.g-filter-search-field:not(.is-open) .g-filter-search input[type='search'] {
  display: none;
}

.g-filter-search-field.is-open .g-filter-search-toggle {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

body.act-capturing .g-head-actions,
body.act-capturing .back-link {
  opacity: 0.35;
  pointer-events: none;
}

@media print {
  .app-shell-nav,
  .app-header,
  .back-link,
  .g-head-actions,
  .g-filter-actions,
  .notas-fab,
  .notas-dock,
  [data-filter-search]:not(.is-open) {
    display: none !important;
  }

  .page-gestion {
    max-width: none !important;
    padding: 0 !important;
  }

  .g-act-table-wrap {
    border: 0;
    overflow: visible;
  }

  .g-act-table {
    min-width: 0;
  }
}

.g-act-print-options {
  display: grid;
  gap: 8px;
  margin: 8px 0 4px;
}

.g-act-print-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.g-act-print-opt input {
  width: auto;
  min-width: 18px;
  min-height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}

.g-act-print-opt span {
  display: grid;
  gap: 2px;
}

.g-act-print-opt strong {
  font-size: 0.9rem;
  font-weight: var(--fw-medium);
  color: var(--ink);
}

.g-act-print-opt em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--muted);
}

.g-act-print-opt:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.g-act-capture-stage {
  position: fixed;
  left: -10000px;
  top: 0;
  width: min(1100px, 100vw);
  padding: 28px 24px;
  background: #ffffff;
  z-index: 1;
  pointer-events: none;
  box-sizing: border-box;
  display: grid;
  gap: 16px;
  color: #1e2024;
  font-family: inherit;
}

.g-act-capture-stage .g-head {
  margin: 0;
  background: #ffffff;
}

.g-act-capture-stage .page-title,
.g-act-capture-stage .g-title {
  color: #1e2024;
}

.g-act-capture-stage .page-sub,
.g-act-capture-stage .g-sub,
.g-act-capture-stage .field > span,
.g-act-capture-stage .hint {
  color: #5b6168;
}

.g-act-capture-stage .g-filters,
.g-act-capture-stage .g-filters-bar {
  margin: 0 0 4px;
  padding: 16px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff !important;
  background-image: none !important;
  box-shadow: none !important;
}

.g-act-capture-stage .field,
.g-act-capture-stage .g-filter-quick,
.g-act-capture-stage .g-filter-quick-field,
.g-act-capture-stage .g-filter-search-field {
  background: transparent !important;
  background-image: none !important;
}

.g-act-capture-plain {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff !important;
  background-image: none !important;
  color: #1e2024;
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: none !important;
}

.g-act-capture-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff !important;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1e2024;
  box-shadow: none !important;
}

.g-act-capture-chip.is-active {
  border-color: #d10a35;
  color: #d10a35;
  background: #fde8ec !important;
}

.g-act-capture-stage .g-act-table-wrap {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff !important;
  box-shadow: none !important;
  overflow: hidden;
}
