:root {
  --bg: #f5f5f7 !important;
  --panel: rgba(255, 255, 255, .82) !important;
  --panel2: #fff !important;
  --gold: #007aff !important;
  --gold2: #0056cc !important;
  --line: rgba(0, 0, 0, .09) !important;
  --txt: #1d1d1f !important;
  --muted: #6e6e73 !important;
  --green: #34c759 !important;
  --red: #ff3b30 !important;
  --blue: #007aff !important;
  --cyan: #5ac8fa !important;
  --shadow: 0 12px 36px rgba(0, 0, 0, .08) !important;
  --radius: 22px !important;
}

* { scrollbar-width: thin; scrollbar-color: #c7c7cc transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI", sans-serif !important;
  color: var(--txt) !important;
  background: #f5f5f7 !important;
  letter-spacing: -.01em;
}
body::before {
  background:
    radial-gradient(circle at 8% 0%, rgba(0,122,255,.11), transparent 25%),
    radial-gradient(circle at 92% 8%, rgba(175,82,222,.09), transparent 23%),
    linear-gradient(180deg, #fbfbfd, #f5f5f7) !important;
}
body::after { display: none !important; }

.app { grid-template-columns: 252px minmax(0, 1fr) !important; }
.sidebar {
  width: auto !important;
  padding: 22px 14px !important;
  border-right: 1px solid rgba(0,0,0,.08) !important;
  background: rgba(250,250,252,.78) !important;
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  box-shadow: none !important;
}
.logo {
  color: #1d1d1f !important;
  font-size: 31px !important;
  letter-spacing: -.055em !important;
  padding: 4px 12px 14px;
  margin-bottom: 10px !important;
}
.logo small { color: #86868b !important; letter-spacing: .16em !important; }
.nav { display: grid; gap: 4px; }
.nav a, .quick a, .quick button {
  min-height: 44px;
  color: #3a3a3c !important;
  border-radius: 12px !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.nav a:hover, .quick a:hover, .quick button:hover { background: rgba(0,122,255,.08) !important; color: #007aff !important; }
.nav a.active { background: #007aff !important; color: #fff !important; box-shadow: 0 8px 18px rgba(0,122,255,.22); }
.quick { background: rgba(255,255,255,.64) !important; border-color: rgba(0,0,0,.07) !important; box-shadow: 0 6px 20px rgba(0,0,0,.04); }
.quick h4 { color: #86868b !important; letter-spacing: .05em; }

.main { max-width: 1680px; width: 100%; margin: 0 auto; padding: 30px 32px 100px !important; }
.header { text-align: left !important; margin-bottom: 24px !important; }
.header h1 { color: #1d1d1f !important; font-size: clamp(32px,4vw,48px) !important; letter-spacing: -.045em !important; }
.header h1 span { color: #007aff !important; }
.header p { color: #86868b !important; letter-spacing: .025em !important; text-transform: none !important; font-weight: 550 !important; }
.admin { color: #3a3a3c !important; border: 0 !important; background: rgba(255,255,255,.88) !important; box-shadow: 0 5px 18px rgba(0,0,0,.07); }
.admin a { color: #007aff !important; }

.panel, .stat, .alert, .levelCard, .normalCard, .ref, .rankCard, .expiry, .note, .price, .metric {
  color: #1d1d1f !important;
  border-color: rgba(0,0,0,.075) !important;
  background: rgba(255,255,255,.84) !important;
  box-shadow: 0 8px 28px rgba(0,0,0,.055) !important;
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
}
.panel { transition: box-shadow .2s ease, transform .2s ease; }
.client:hover, .levelCard:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(0,0,0,.09) !important; }
.client::before, .levelCard::after, .levelCard::before { opacity: .4; }
.alerts { gap: 12px !important; }
.alert b, .gold, .price b { color: #007aff !important; }
.stat b, .levelName, .client h3, .normalNombre, .rankCard strong, .sheetHead h2 { color: #1d1d1f !important; }
.stat span, .muted, .miniProgress small, .header p, .note { color: #6e6e73 !important; }
.ico { filter: none !important; }
.donutIn { background: #fff !important; border-color: rgba(0,0,0,.08) !important; }
.progress, .miniBar { background: #e5e5ea !important; border: 0 !important; }
.bar, .miniBar span { background: linear-gradient(90deg,#007aff,#5ac8fa) !important; }
.miniTable th { color: #6e6e73 !important; }
.miniTable td, .miniTable th { border-bottom-color: rgba(0,0,0,.07) !important; }

input, select, textarea {
  min-height: 46px;
  color: #1d1d1f !important;
  background: rgba(255,255,255,.94) !important;
  border: 1px solid rgba(0,0,0,.13) !important;
  border-radius: 12px !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.03);
}
input::placeholder, textarea::placeholder { color: #98989d; }
input:focus, select:focus, textarea:focus { border-color: #007aff !important; box-shadow: 0 0 0 4px rgba(0,122,255,.14) !important; }
label { color: #3a3a3c !important; font-weight: 650 !important; }

.btn, button {
  border-radius: 12px !important;
  font-weight: 650 !important;
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease !important;
}
.btn { color: #fff !important; background: #007aff !important; box-shadow: 0 5px 14px rgba(0,122,255,.18); }
.btn:hover, button:hover { transform: translateY(-1px) !important; filter: brightness(.97) !important; }
.btn.dark { color: #1d1d1f !important; background: #e9e9ed !important; border-color: transparent !important; box-shadow: none; }
.btn.green { background: #34c759 !important; }
.btn.red { background: #ff3b30 !important; }
.status.act { background: rgba(52,199,89,.13) !important; color: #248a3d !important; }
.status.in { background: rgba(255,59,48,.12) !important; color: #d70015 !important; }
.badge { color: #0066cc !important; background: rgba(0,122,255,.09) !important; border-color: rgba(0,122,255,.18) !important; }
.notice { color: #176b2c !important; background: rgba(52,199,89,.11) !important; border-color: rgba(52,199,89,.22) !important; }

.modal { background: rgba(0,0,0,.32) !important; backdrop-filter: blur(18px) saturate(140%) !important; }
.sheet { border: 0 !important; background: #f5f5f7 !important; box-shadow: 0 30px 90px rgba(0,0,0,.25) !important; }
.sheetHead { background: rgba(255,255,255,.88) !important; backdrop-filter: blur(24px); }
.tabs a { color: #007aff !important; background: rgba(0,122,255,.08) !important; border-color: transparent !important; }

.mobileNav {
  background: rgba(249,249,251,.88) !important;
  border-top-color: rgba(0,0,0,.1) !important;
  backdrop-filter: saturate(180%) blur(24px) !important;
  padding-bottom: env(safe-area-inset-bottom);
}
.mobileNav a { color: #007aff !important; font-weight: 650 !important; }

.loginPage { background: #f5f5f7 !important; }
.loginPage::before { display: block !important; }
.loginPage .login {
  width: min(420px,100%) !important;
  color: #1d1d1f !important;
  border: 1px solid rgba(0,0,0,.07) !important;
  background: rgba(255,255,255,.84) !important;
  backdrop-filter: blur(26px) saturate(160%);
  box-shadow: 0 25px 70px rgba(0,0,0,.13) !important;
}
.loginPage .brand { color: #1d1d1f !important; letter-spacing: -.055em !important; }
.loginPage .sub, .loginPage .hint { color: #6e6e73 !important; }
.loginPage .lock { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 18px; font-size: 30px !important; background: linear-gradient(145deg,#eef6ff,#fff); box-shadow: 0 10px 26px rgba(0,122,255,.13); }
.loginPage button { background: #007aff !important; color: #fff !important; }
.loginPage label { text-align: left; margin-bottom: 8px; }

@media (max-width: 1200px) {
  .right { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr !important; }
  .main { padding: 22px 16px 96px !important; }
  .right { grid-template-columns: 1fr !important; }
}
@media (max-width: 760px) {
  .main { padding: 16px 12px 92px !important; }
  .header h1 { font-size: 30px !important; }
  .panel { border-radius: 18px !important; }
  .modal { padding: 0 !important; }
  .sheet { border-radius: 0 !important; }
  .clientMainActions .btn:hover, .inactivoActions .btn:hover { transform: none !important; }
}

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

/* =========================================================
   MDPRIME APPLE BLACK — REDISEÑO V3
   ========================================================= */
:root {
  --bg: #000 !important;
  --panel: #111113 !important;
  --panel2: #18181b !important;
  --gold: #0a84ff !important;
  --gold2: #0066cc !important;
  --line: rgba(255,255,255,.09) !important;
  --txt: #f5f5f7 !important;
  --muted: #98989d !important;
  --shadow: 0 20px 60px rgba(0,0,0,.42) !important;
  --radius: 24px !important;
}

html, body { background: #000 !important; color: #f5f5f7 !important; }
body::before {
  background:
    radial-gradient(circle at 76% -10%, rgba(10,132,255,.20), transparent 31%),
    radial-gradient(circle at 18% 18%, rgba(94,92,230,.11), transparent 25%),
    linear-gradient(145deg,#000 0%,#050507 50%,#08090c 100%) !important;
}

.app {
  grid-template-columns: 280px minmax(0,1fr) !important;
  gap: 0 !important;
}
.sidebar {
  margin: 18px 0 18px 18px !important;
  height: calc(100vh - 36px) !important;
  padding: 22px 14px !important;
  border: 1px solid rgba(255,255,255,.09) !important;
  border-radius: 28px !important;
  background: rgba(18,18,20,.82) !important;
  box-shadow: 0 24px 80px rgba(0,0,0,.55) !important;
  backdrop-filter: blur(30px) saturate(150%) !important;
}
.logo {
  color: #fff !important;
  font-size: 32px !important;
  padding: 10px 14px 19px !important;
  margin: 0 0 8px !important;
}
.logo::before {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 9px;
  border-radius: 50%;
  background: #0a84ff;
  box-shadow: 0 0 20px rgba(10,132,255,.85);
  vertical-align: 5px;
}
.logo small { color: #8e8e93 !important; margin-left: 30px !important; }
.nav a, .quick a, .quick button {
  min-height: 48px !important;
  color: #aeaeb2 !important;
  padding: 12px 14px !important;
  border-radius: 14px !important;
  font-size: 14px !important;
}
.nav a.active {
  color: #fff !important;
  background: linear-gradient(135deg,#0a84ff,#0066cc) !important;
  box-shadow: 0 10px 28px rgba(10,132,255,.30) !important;
}
.nav a:hover, .quick a:hover, .quick button:hover {
  color: #fff !important;
  background: rgba(255,255,255,.075) !important;
}
.quick {
  margin-top: 24px !important;
  padding: 12px !important;
  border: 1px solid rgba(255,255,255,.07) !important;
  background: rgba(255,255,255,.025) !important;
  box-shadow: none !important;
}
.quick h4 { color: #636366 !important; }

.main {
  max-width: none !important;
  padding: 34px 34px 110px !important;
}
.header {
  min-height: 112px;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  padding: 0 8px !important;
  margin-bottom: 20px !important;
}
.header h1 {
  color: #f5f5f7 !important;
  font-size: clamp(36px,4vw,58px) !important;
  font-weight: 750 !important;
  letter-spacing: -.055em !important;
  line-height: .98 !important;
}
.header h1 span {
  color: transparent !important;
  background: linear-gradient(90deg,#0a84ff,#64d2ff);
  -webkit-background-clip: text;
  background-clip: text;
}
.header p {
  color: #8e8e93 !important;
  font-size: 15px !important;
  letter-spacing: 0 !important;
  margin-top: 13px !important;
}
.admin {
  top: 16px !important;
  color: #d1d1d6 !important;
  background: rgba(28,28,30,.82) !important;
  border: 1px solid rgba(255,255,255,.09) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,.30) !important;
}

.panel, .stat, .alert, .levelCard, .normalCard, .ref, .rankCard, .expiry, .note, .price, .metric {
  color: #f5f5f7 !important;
  border: 1px solid rgba(255,255,255,.085) !important;
  background: linear-gradient(145deg,rgba(26,26,29,.94),rgba(14,14,16,.96)) !important;
  box-shadow: 0 18px 46px rgba(0,0,0,.26) !important;
}
.panel { border-radius: 24px !important; }
.center { padding: 20px !important; }
.dashboard { gap: 18px !important; }
.right { gap: 18px !important; }
.alerts { gap: 10px !important; margin-bottom: 16px !important; }
.alert {
  min-height: 78px;
  padding: 15px !important;
  color: #aeaeb2 !important;
  font-size: 13px !important;
  border-radius: 18px !important;
}
.alert b { color: #fff !important; font-size: 26px !important; margin-top: 6px; }
.stats { gap: 12px !important; }
.stat {
  min-height: 122px !important;
  border-radius: 20px !important;
  background: linear-gradient(145deg,#1c1c1e,#121214) !important;
}
.stat b { color: #fff !important; font-size: 38px !important; letter-spacing: -.04em; }
.stat span { color: #8e8e93 !important; }
.ico { font-size: 38px !important; opacity: .9; }
.mid, .bottomGrid { gap: 16px !important; margin-top: 16px !important; }
.level, .donutBox, .box, .infoCard { padding: 24px !important; }
.levelName { color: #fff !important; letter-spacing: -.04em; }
.progress, .miniBar { background: #2c2c2e !important; }
.bar, .miniBar span { background: linear-gradient(90deg,#0a84ff,#64d2ff) !important; }
.donutIn { background: #111113 !important; color: #fff !important; }
.miniTable th { color: #8e8e93 !important; }
.miniTable td { color: #e5e5ea !important; }

.clientesSearchPanel,
[id^="mdGlobal"],
.globalSearchPanel {
  color: #f5f5f7 !important;
}
.clientesSearchPanel {
  padding: 22px !important;
  border: 1px solid rgba(10,132,255,.24) !important;
  background: linear-gradient(145deg,rgba(22,25,31,.98),rgba(10,10,12,.98)) !important;
  box-shadow: 0 22px 60px rgba(0,0,0,.36), inset 0 1px rgba(255,255,255,.05) !important;
}
.clientesSearchPanel h2 { color: #fff !important; letter-spacing: -.025em; }

input, select, textarea {
  min-height: 48px !important;
  color: #f5f5f7 !important;
  background: #1c1c1e !important;
  border: 1px solid rgba(255,255,255,.11) !important;
  box-shadow: none !important;
}
input::placeholder, textarea::placeholder { color: #6e6e73 !important; }
input:focus, select:focus, textarea:focus {
  border-color: #0a84ff !important;
  box-shadow: 0 0 0 4px rgba(10,132,255,.18) !important;
}
label { color: #aeaeb2 !important; }

.btn { background: linear-gradient(135deg,#0a84ff,#0066cc) !important; color: #fff !important; }
.btn.dark { background: #2c2c2e !important; color: #f5f5f7 !important; border-color: rgba(255,255,255,.08) !important; }
.btn.green { background: #30d158 !important; color: #06170b !important; }
.btn.red { background: #ff453a !important; color: #fff !important; }
.badge { color: #64d2ff !important; background: rgba(10,132,255,.12) !important; border-color: rgba(10,132,255,.25) !important; }
.notice { color: #8ef0a4 !important; background: rgba(48,209,88,.11) !important; }
.note { color: #aeaeb2 !important; background: rgba(255,255,255,.035) !important; }
.client::before { background: radial-gradient(circle,rgba(10,132,255,.18),transparent 68%) !important; }
.client h3, .normalNombre, .rankCard strong, .sheetHead h2, .box h3, .level h3 { color: #fff !important; }
.price b, .gold, .expiry b { color: #64d2ff !important; }

.modal { background: rgba(0,0,0,.72) !important; }
.sheet { background: #09090b !important; border: 1px solid rgba(255,255,255,.10) !important; }
.sheetHead { background: rgba(18,18,20,.90) !important; border-bottom: 1px solid rgba(255,255,255,.08) !important; }
.tabs a { color: #64d2ff !important; background: rgba(10,132,255,.12) !important; }
.ref { background: #161618 !important; }

.mobileNav {
  background: rgba(12,12,14,.90) !important;
  border-top: 1px solid rgba(255,255,255,.10) !important;
}
.mobileNav a { color: #64d2ff !important; }

.loginPage { background: #000 !important; }
.loginPage .login {
  color: #fff !important;
  background: linear-gradient(145deg,rgba(28,28,30,.96),rgba(12,12,14,.98)) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: 0 30px 100px rgba(0,0,0,.70) !important;
}
.loginPage .brand { color: #fff !important; }
.loginPage .sub, .loginPage .hint { color: #8e8e93 !important; }
.loginPage .lock { color: #fff; background: linear-gradient(145deg,#1c1c1e,#101012) !important; box-shadow: 0 12px 32px rgba(10,132,255,.18) !important; }

@media (max-width: 980px) {
  .sidebar { margin: 0 !important; height: auto !important; border-radius: 0 !important; }
  .main { padding: 22px 16px 100px !important; }
  .header { min-height: 96px; }
}

@media (max-width: 760px) {
  .header h1 { font-size: 34px !important; }
  .alerts { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  .stat { min-height: 102px !important; }
  .center, .level, .donutBox, .box, .infoCard { padding: 16px !important; }
}

/* Aplicación por vistas */
[hidden] { display: none !important; }
.appleAppReady .main > .appViewActive {
  animation: appViewIn .28s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes appViewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.navIcon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
}
.navIcon svg, .mobileMenuButton svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.header {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 24px;
}
.pageHeading { min-width: 0; }
.pageEyebrow {
  display: block;
  margin-bottom: 7px;
  color: #0a84ff;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .15em;
}
.pageHeading h1 {
  margin: 0;
  color: #f5f5f7;
  font-size: clamp(36px,4vw,58px);
  line-height: 1;
  letter-spacing: -.055em;
}
.pageHeading p { margin: 10px 0 0 !important; }
.headerActions { display: flex; align-items: center; gap: 10px; }
.livePill, .logoutButton {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 999px;
  color: #d1d1d6;
  background: rgba(28,28,30,.8);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.livePill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 12px rgba(48,209,88,.75);
}
.logoutButton { color: #ff6961; }
.logoutButton:hover { background: rgba(255,69,58,.12); }
.mobileMenuButton {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 13px !important;
  color: #fff;
  background: #1c1c1e;
}
.tableScroller { width: 100%; overflow-x: auto; border-radius: 16px; }
.sectionTitle { letter-spacing: -.025em; }
.isWorking { filter: saturate(.75); }
body[data-current-view="clientes"] .clients {
  display: grid !important;
  grid-template-columns: repeat(3,minmax(0,1fr)) !important;
  gap: 16px !important;
}
body[data-current-view="clientes"] .clientesSearchPanel { margin-top: 0 !important; }
body[data-current-view="nuevo"] #addCliente {
  max-width: 1080px;
  margin: 0 auto !important;
  grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  padding: 28px !important;
}
body[data-current-view="nuevo"] #addCliente .btn { min-height: 52px; }
body[data-current-view="sigma"] #configSigma,
body[data-current-view="niveles"] #niveles,
body[data-current-view="duplicados"] #duplicados,
body[data-current-view="referidos"] #buscadorReferidosRapido,
body[data-current-view="inactivos"] #inactivos,
body[data-current-view="normales"] #clientesNormales {
  margin-top: 0 !important;
  padding: 26px !important;
}

@media (max-width: 1280px) {
  body[data-current-view="clientes"] .clients { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
}
@media (max-width: 980px) {
  .mobileMenuButton { display: grid; flex: 0 0 44px; }
  .sidebar {
    display: block !important;
    position: fixed !important;
    z-index: 100;
    top: 12px;
    bottom: 12px;
    left: 12px;
    width: min(310px,calc(100vw - 48px)) !important;
    height: auto !important;
    margin: 0 !important;
    transform: translateX(calc(-100% - 24px));
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
  }
  body.menuOpen::after {
    content: "" !important;
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(0,0,0,.68);
    backdrop-filter: blur(8px);
  }
  body.menuOpen .sidebar { transform: translateX(0); }
  .header { min-height: 90px; gap: 14px; }
  .pageHeading h1 { font-size: 34px; }
  .livePill { display: none; }
  .mobileNav { display: none !important; }
}
@media (max-width: 700px) {
  body[data-current-view="clientes"] .clients { grid-template-columns: 1fr !important; }
  body[data-current-view="nuevo"] #addCliente { grid-template-columns: 1fr !important; padding: 18px !important; }
  .logoutButton { padding: 0 12px; }
  .pageHeading p { display: none; }
}

/* Fichas de clientes: Apple Black, compactas y progresivas */
.modal [hidden] { display: none !important; }
.modal { padding: 18px !important; background: rgba(0,0,0,.76) !important; backdrop-filter: blur(24px) saturate(115%) !important; }
.modal .sheet { width: min(1120px,100%); max-width: 1120px !important; }
.modal .sheetHead {
  position: sticky !important;
  top: 0;
  display: grid !important;
  grid-template-columns: minmax(220px,1fr) auto auto;
  gap: 14px !important;
  padding: 16px 18px !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 22px !important;
  background: rgba(18,18,20,.94) !important;
  box-shadow: 0 18px 55px rgba(0,0,0,.42) !important;
  backdrop-filter: blur(28px) !important;
}
.modal .sheetHead h2 { margin: 0 !important; font-size: 22px !important; letter-spacing: -.025em; }
.modal .sheetHead .muted { margin-top: 3px; color: #737378 !important; font-size: 12px; }
.modal .minimalLevel { margin-left: 6px; color: #8e8e93 !important; font-size: 12px; font-weight: 600; }
.modal .sheetHead > .btn { width: 38px !important; min-width: 38px; min-height: 38px !important; padding: 0 !important; border-radius: 50% !important; font-size: 14px; }
.modalUtilityBar { display: flex; gap: 5px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.05); }
.modalUtilityBar button {
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px !important;
  color: #a1a1a6;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.modalUtilityBar button:hover, .modalUtilityBar button.active { color: #fff; background: rgba(255,255,255,.10) !important; }
.modal .modalBody { display: grid !important; grid-template-columns: 1fr !important; gap: 12px !important; margin-top: 12px !important; }
.modal .modalBody > aside, .modal .modalBody > section {
  padding: 16px !important;
  border: 1px solid rgba(255,255,255,.085) !important;
  border-radius: 22px !important;
  background: #111113 !important;
  box-shadow: none !important;
}
.modal .modalBody > aside { display: grid; grid-template-columns: auto minmax(220px,1fr) auto; align-items: center; gap: 16px 22px; }
.modal .modalBody > aside > h3:first-child { display: none; }
.modal .modalBody > aside .metrics { display: flex !important; gap: 4px !important; margin: 0 !important; }
.modal .modalBody > aside .metric { min-width: 76px; padding: 8px 10px !important; border: 0 !important; background: transparent !important; }
.modal .modalBody > aside .metric b { font-size: 22px !important; }
.modal .modalBody > aside .metric span { color: #737378; font-size: 10px; }
.modal .modalBody > aside .miniProgress { min-width: 200px; margin: 0 !important; }
.modal .modalBody > aside .miniBar { height: 5px !important; border: 0 !important; background: #29292d !important; }
.modal .modalBody > aside .miniBar span { background: #0a84ff !important; }
.modal .modalBody > aside .prices { display: flex !important; gap: 5px !important; margin: 0 !important; }
.modal .modalBody > aside .price { min-width: 76px; padding: 8px !important; border: 0 !important; background: rgba(255,255,255,.045) !important; }
.modal .modalBody > aside .price span { color: #737378; font-size: 10px; }
.modal .modalBody > aside .price b { color: #f5f5f7 !important; font-size: 14px !important; }
.modalCollapsible:not([hidden]) { grid-column: 1 / -1; }
.modal .copyBox, .modal .modalPanelAdd, .modal .modalPanelProfile {
  padding: 14px !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 16px !important;
  background: rgba(255,255,255,.025) !important;
  box-shadow: none !important;
}
.modal .modalPanelAdd + .modalPanelAdd { margin-top: -8px; }
.modal .copyButtons { grid-template-columns: repeat(4,minmax(0,1fr)) !important; }
.modal .copyButtons .btn { min-height: 38px !important; padding: 8px !important; font-size: 11px !important; }
.modal .modalBody > section > h3:first-child { margin: 0 0 10px !important; color: #8e8e93 !important; font-size: 11px !important; letter-spacing: .08em; text-transform: uppercase; }
.modalRefSearch { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.modalRefSearch input { min-height: 42px !important; padding: 9px 13px !important; border-radius: 12px !important; background: #1c1c1e !important; }
.modalRefSearch span { flex: 0 0 auto; color: #737378; font-size: 11px; }
.modal .refList { gap: 7px !important; }
.modal .ref {
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.075) !important;
  border-radius: 15px !important;
  background: #18181b !important;
  box-shadow: none !important;
}
.modal .refTop { min-height: 66px; align-items: center; padding: 11px 12px 11px 15px; }
.modal .refTop b { display: block; color: #f5f5f7; font-size: 15px; letter-spacing: -.01em; }
.modal .refTop .muted { margin-top: 3px; color: #737378 !important; font-size: 11px; }
.modal .status { margin-left: auto; padding: 5px 8px !important; font-size: 10px !important; }
.modal .refManage {
  min-height: 32px;
  margin-left: 5px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px !important;
  color: #0a84ff;
  background: rgba(10,132,255,.12);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.modal .refManage:hover, .modal .refManage.active { color: #fff; background: #0a84ff !important; }
.modal .refDetails { padding: 0 12px 12px; border-top: 1px solid rgba(255,255,255,.07); }
.modal .refDetails > .note { min-height: 0 !important; margin: 10px 0 0 !important; padding: 9px 10px !important; color: #a1a1a6 !important; background: rgba(255,255,255,.035) !important; font-size: 11px; }
.modal .refActions { display: flex !important; gap: 6px !important; margin-top: 8px !important; }
.modal .refActions > * { flex: 0 1 auto; }
.modal .refActions .btn { min-height: 34px !important; padding: 7px 10px !important; border-radius: 9px !important; font-size: 11px !important; }
.modal .refDetails > div:not(.note):not(.refActions):not(.editBox) { margin-top: 8px; }
.modal .editBox { padding-top: 10px !important; }
.modal .editBox form { grid-template-columns: repeat(2,minmax(0,1fr)); }
.modal .editBox form .btn { grid-column: 1 / -1; }

@media (max-width: 820px) {
  .modal { padding: 0 !important; }
  .modal .sheetHead { grid-template-columns: 1fr auto; border-radius: 0 !important; }
  .modalUtilityBar { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; }
  .modalUtilityBar button { flex: 1 0 auto; }
  .modal .modalBody { margin: 8px !important; }
  .modal .modalBody > aside { grid-template-columns: 1fr !important; gap: 12px; }
  .modal .modalBody > aside .metrics, .modal .modalBody > aside .prices { justify-content: space-between; }
  .modal .modalBody > aside .metric, .modal .modalBody > aside .price { flex: 1; min-width: 0; }
  .modal .copyButtons { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  .modal .refTop { flex-wrap: wrap; }
  .modal .refTop > div:first-child { width: calc(100% - 120px); }
  .modal .editBox form { grid-template-columns: 1fr; }
  .modal .editBox form .btn { grid-column: auto; }
}

/* Herramientas avanzadas de colecciones */
.collectionTools {
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(240px,1fr) auto auto auto auto;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 11px;
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 20px;
  background: rgba(20,20,22,.86);
  box-shadow: 0 16px 40px rgba(0,0,0,.22);
  backdrop-filter: blur(24px) saturate(140%);
}
.collectionSearch {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  background: #101012;
}
.collectionSearch:focus-within { border-color: #0a84ff; box-shadow: 0 0 0 4px rgba(10,132,255,.14); }
.collectionSearch svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: #636366;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.collectionSearch input {
  min-height: 44px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.collectionMeta { min-width: 76px; display: grid; line-height: 1.05; }
.collectionMeta b { color: #fff; font-size: 18px; }
.collectionMeta span { color: #636366; font-size: 10px; text-transform: uppercase; }
.collectionTools.hasFilter .collectionMeta b { color: #64d2ff; }
.segmented { display: flex; padding: 3px; border-radius: 11px; background: #0d0d0f; }
.segmented button, .compactToggle, .copyVisible {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px !important;
  color: #8e8e93;
  background: transparent;
  font-size: 12px;
}
.segmented button.active { color: #fff; background: #2c2c2e !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.compactToggle, .copyVisible { color: #d1d1d6; background: #2c2c2e !important; }
.copyVisible { color: #64d2ff; }
.clients.listLayout, .normalesGrid.listLayout, .inactivosGrid.listLayout {
  grid-template-columns: 1fr !important;
}
.clients.listLayout .client, .normalesGrid.listLayout .normalCard, .inactivosGrid.listLayout .inactivoCard {
  min-height: 0 !important;
}
.compactMode .client,
.compactMode .normalCard,
.compactMode .inactivoCard,
.compactMode .ref { padding: 11px !important; border-radius: 15px !important; }
.compactMode .client h3,
.compactMode .normalNombre,
.compactMode .inactivoNombre { font-size: 17px !important; }
.compactMode .prices,
.compactMode .metrics,
.compactMode .note { margin-top: 7px !important; margin-bottom: 7px !important; }
.compactMode .clientMainActions .btn,
.compactMode .inactivoActions .btn { min-height: 44px !important; height: 44px !important; }
@media (max-width: 900px) {
  .collectionTools { grid-template-columns: 1fr auto auto; }
  .collectionSearch { grid-column: 1 / -1; }
  .collectionMeta { grid-column: 1; }
}
@media (max-width: 560px) {
  .collectionTools { grid-template-columns: 1fr 1fr; }
  .collectionMeta { grid-column: 1; }
  .segmented { justify-self: end; }
  .compactToggle, .copyVisible { width: 100%; }
}

/* Dashboard minimalista */
#dashboard {
  display: block !important;
}
#dashboard > .center {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
.minimalSummary {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.minimalSummary article {
  min-width: 0;
  min-height: 142px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  background: linear-gradient(145deg,#18181b,#111113);
  box-shadow: 0 14px 36px rgba(0,0,0,.20);
}
.minimalSummary article span {
  color: #8e8e93;
  font-size: 13px;
  font-weight: 550;
}
.minimalSummary article strong {
  color: #f5f5f7;
  font-size: clamp(34px,3vw,48px);
  line-height: 1;
  letter-spacing: -.055em;
}
.minimalSummary article small {
  overflow: hidden;
  color: #636366;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.minimalSummary article.attention {
  border-color: rgba(255,159,10,.20);
  background: linear-gradient(145deg,rgba(255,159,10,.10),#111113 70%);
}
.minimalSummary article.attention strong { color: #ff9f0a; }
#dashboard .mid {
  grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr) !important;
  gap: 16px !important;
  margin: 0 !important;
}
#dashboard .level,
#dashboard .donutBox {
  min-height: 310px;
  padding: 25px !important;
  border-radius: 24px !important;
}
#dashboard .levelInner { margin-top: 34px; }
#dashboard .levelName { font-size: 42px !important; font-weight: 680 !important; }
#dashboard .donut { width: 168px !important; height: 168px !important; }
#dashboard .donutIn { width: 106px !important; height: 106px !important; }
#dashboard .bottomGrid {
  grid-template-columns: minmax(0,1.2fr) minmax(260px,.8fr) minmax(280px,.8fr) !important;
  align-items: start;
  gap: 16px !important;
  margin-top: 16px !important;
}
#dashboard .bottomGrid > .box,
#dashboard .compactExpiry {
  min-height: 310px;
  padding: 22px !important;
}
#dashboard .compactExpiry {
  overflow: hidden;
  border-radius: 24px !important;
}
#dashboard .compactExpiry .expiryList {
  max-height: 235px;
  overflow-y: auto;
  padding-right: 4px;
}
#dashboard .compactExpiry .expiry {
  padding: 10px 12px !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(255,255,255,.07) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
#dashboard .compactExpiry .expiry:last-child { border-bottom: 0 !important; }
#dashboard .miniTable th,
#dashboard .miniTable td { padding: 11px 9px !important; }
#dashboard .rankCard {
  padding: 11px 12px !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(255,255,255,.07) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
#dashboard .rankCard:last-child { border-bottom: 0 !important; }
#dashboard h3 {
  color: #8e8e93 !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
}
@media (max-width: 1280px) {
  .minimalSummary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #dashboard .bottomGrid { grid-template-columns: 1fr 1fr !important; }
  #dashboard .compactExpiry { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .minimalSummary { grid-template-columns: 1fr 1fr; gap: 9px; }
  .minimalSummary article { min-height: 120px; padding: 15px; border-radius: 18px; }
  .minimalSummary article strong { font-size: 34px; }
  .minimalSummary article small { display: none; }
  #dashboard .mid, #dashboard .bottomGrid { grid-template-columns: 1fr !important; }
  #dashboard .level, #dashboard .donutBox, #dashboard .bottomGrid > .box, #dashboard .compactExpiry { min-height: 0; }
  #dashboard .compactExpiry { grid-column: auto; }
}

/* Centro de comandos y utilidades Pro */
.navCount {
  margin-left: auto;
  min-width: 28px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: #8e8e93;
  background: rgba(255,255,255,.07);
  font-size: 11px;
  font-weight: 700;
}
.nav a.active .navCount { color: #fff; background: rgba(255,255,255,.2); }
.commandButton {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 13px;
  border: 1px solid rgba(255,255,255,.09) !important;
  border-radius: 999px !important;
  color: #d1d1d6;
  background: rgba(28,28,30,.82) !important;
}
.commandButton svg, .commandInputWrap svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
kbd {
  padding: 4px 7px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 7px;
  color: #8e8e93;
  background: rgba(255,255,255,.06);
  font: 600 10px/1 -apple-system,BlinkMacSystemFont,sans-serif;
}
.commandOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  padding: min(14vh,130px) 18px 30px;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(18px) saturate(120%);
}
.commandOverlay.open { display: block; animation: commandFade .18s ease both; }
.commandCenter {
  width: min(660px,100%);
  max-height: min(660px,75vh);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 24px;
  background: rgba(24,24,27,.96);
  box-shadow: 0 40px 120px rgba(0,0,0,.72);
}
.commandInputWrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #8e8e93;
}
.commandInputWrap input {
  flex: 1;
  min-height: 42px !important;
  padding: 0 !important;
  border: 0 !important;
  color: #fff !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 18px;
}
.commandList {
  max-height: calc(min(660px,75vh) - 120px);
  padding: 9px;
  overflow-y: auto;
}
.commandList button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px;
  border: 0;
  border-radius: 14px !important;
  color: #f5f5f7;
  background: transparent;
  text-align: left;
}
.commandList button:hover, .commandList button:focus { background: rgba(10,132,255,.16) !important; outline: none; }
.commandList button > span:last-child { display: grid; gap: 3px; }
.commandList small { color: #8e8e93; font-size: 12px; font-weight: 450; }
.commandFoot { padding: 11px 16px; border-top: 1px solid rgba(255,255,255,.07); color: #636366; font-size: 11px; }
.notice { display: flex; align-items: center; gap: 12px; }
.noticeClose {
  margin-left: auto;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: 12px;
}
.backToTop {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 50% !important;
  color: #fff;
  background: rgba(28,28,30,.88);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: .2s ease !important;
  backdrop-filter: blur(18px);
}
.backToTop.visible { opacity: 1; pointer-events: auto; transform: none; }
@keyframes commandFade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 700px) {
  .commandButton span, .commandButton kbd { display: none; }
  .commandButton { width: 42px; justify-content: center; padding: 0; }
  .commandOverlay { padding: 12px; }
  .commandCenter { max-height: calc(100vh - 24px); }
  .commandList { max-height: calc(100vh - 140px); }
  .backToTop { right: 14px; bottom: 14px; }
}

/* Fichas Pro v4: tabla minimalista y editor lateral */
.modal .modalBody { grid-template-columns: 1fr !important; }
.modal .modalBody > aside { display: grid !important; grid-template-columns: auto minmax(220px,1fr) auto !important; }
.modal .modalBody > section { overflow: hidden; }
.modalRefSearch { display: grid !important; grid-template-columns: minmax(180px,1fr) 190px auto; }
.modalRefSearch select {
  min-height: 42px !important;
  padding: 8px 34px 8px 12px !important;
  border-radius: 12px !important;
  color: #c7c7cc !important;
  background-color: #1c1c1e !important;
  font-size: 12px !important;
}
.refTableHead {
  display: grid;
  grid-template-columns: minmax(180px,1.3fr) minmax(100px,.7fr) minmax(120px,.8fr) 85px 42px;
  gap: 10px;
  align-items: center;
  padding: 8px 14px;
  color: #636366;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.modal .refList { display: block !important; overflow: hidden; border: 1px solid rgba(255,255,255,.08); border-radius: 16px; }
.modal .ref {
  border: 0 !important;
  border-bottom: 1px solid rgba(255,255,255,.065) !important;
  border-radius: 0 !important;
  background: #151517 !important;
  transition: background .16s ease !important;
}
.modal .ref:last-child { border-bottom: 0 !important; }
.modal .ref:hover { background: #1c1c1f !important; }
.modal .refTop {
  display: grid !important;
  grid-template-columns: minmax(180px,1.3fr) minmax(100px,.7fr) minmax(120px,.8fr) 85px 42px;
  gap: 10px !important;
  min-height: 58px !important;
  padding: 8px 12px 8px 14px !important;
}
.modal .refIdentity { min-width: 0; }
.modal .refIdentity b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal .refDate { color: #a1a1a6; font-size: 12px; font-variant-numeric: tabular-nums; }
.modal .refExpiry { width: max-content; max-width: 100%; padding: 5px 7px; border-radius: 7px; }
.modal .refExpiry.soon { color: #ffd60a; background: rgba(255,214,10,.10); }
.modal .refExpiry.urgent { color: #ff9f0a; background: rgba(255,159,10,.12); }
.modal .refExpiry.expired { color: #ff453a; background: rgba(255,69,58,.12); }
.modal .status { justify-self: start; margin: 0 !important; }
.modal .refManage {
  width: 34px;
  min-width: 34px;
  min-height: 32px;
  margin: 0 !important;
  padding: 0 !important;
  color: #8e8e93;
  background: transparent !important;
  letter-spacing: 1px;
}
.modal .refManage:hover, .modal .refManage.active { color: #fff; background: rgba(255,255,255,.10) !important; }
.recordDrawerBackdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  border: 0;
  background: rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.recordDrawerBackdrop.open { opacity: 1; pointer-events: auto; }
.recordDrawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 31;
  width: min(460px,94vw);
  padding: 0;
  overflow-y: auto;
  border-left: 1px solid rgba(255,255,255,.11);
  background: rgba(20,20,22,.98);
  box-shadow: -30px 0 80px rgba(0,0,0,.48);
  transform: translateX(105%);
  transition: transform .26s cubic-bezier(.22,.8,.3,1);
  backdrop-filter: blur(30px);
}
.recordDrawer.open { transform: translateX(0); }
.recordDrawer > header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(20,20,22,.92);
  backdrop-filter: blur(24px);
}
.recordDrawer header small { color: #0a84ff; font-size: 10px; font-weight: 750; letter-spacing: .09em; }
.recordDrawer header h3 { margin: 5px 0 3px !important; color: #f5f5f7 !important; font-size: 24px !important; letter-spacing: -.035em; text-transform: none !important; }
.recordDrawer header p { margin: 0; color: #737378; font-size: 11px; }
.recordDrawerClose {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50% !important;
  color: #d1d1d6;
  background: rgba(255,255,255,.08);
  font-size: 22px;
  cursor: pointer;
}
.recordDrawerBody { padding: 18px; }
.recordDrawer .refDetails { display: block !important; padding: 0 !important; border: 0 !important; }
.recordDrawer .refDetails > .note { margin: 0 0 14px !important; padding: 12px !important; border-radius: 12px; }
.recordDrawer .refActions { display: grid !important; grid-template-columns: repeat(3,1fr); margin: 0 0 16px !important; }
.recordDrawer .refActions > *, .recordDrawer .refActions .btn { width: 100%; }
.recordDrawer .refDetails > div:not(.note):not(.refActions):not(.editBox) {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 7px;
  margin: 0 0 16px !important;
  padding: 14px 0;
  border-top: 1px solid rgba(255,255,255,.07);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.recordDrawer .editBox { display: none !important; margin-top: 8px !important; }
.recordDrawer .editBox.drawerEditOpen { display: block !important; }
.recordDrawer .editBox form { display: grid !important; grid-template-columns: 1fr !important; gap: 9px !important; }
.recordDrawer input, .recordDrawer select, .recordDrawer textarea { background: #1c1c1e !important; }
.recordDrawer .btn { border-radius: 11px !important; box-shadow: none !important; }

@media (max-width: 820px) {
  .modal .modalBody > aside { grid-template-columns: 1fr !important; }
  .modalRefSearch { grid-template-columns: 1fr 1fr !important; }
  .modalRefSearch span { display: none; }
  .refTableHead { display: none; }
  .modal .refList { border-radius: 14px; }
  .modal .refTop { grid-template-columns: minmax(0,1fr) auto 34px !important; gap: 8px !important; }
  .modal .refIdentity { grid-column: 1; }
  .modal .refStart { display: none; }
  .modal .refExpiry { grid-column: 1; grid-row: 2; padding-left: 0; background: transparent !important; }
  .modal .status { grid-column: 2; grid-row: 1 / 3; }
  .modal .refManage { grid-column: 3; grid-row: 1 / 3; }
  .recordDrawer { width: 100vw; }
}

/* Colecciones Pro v5: todos los registros como filas limpias */
.clients, .normalesGrid, .inactivosGrid, .duplicadosGrid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 7px !important;
}
.minimalCollectionCard {
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(255,255,255,.075) !important;
  border-radius: 16px !important;
  background: #151517 !important;
  box-shadow: none !important;
}
.minimalCollectionCard::before, .minimalCollectionCard::after { display: none !important; }
.collectionRow {
  display: grid;
  grid-template-columns: 42px minmax(180px,1fr) minmax(105px,.28fr) 76px 36px;
  gap: 11px;
  align-items: center;
  min-height: 68px;
  padding: 9px 11px 9px 14px;
  transition: background .16s ease;
}
.collectionRow:hover { background: rgba(255,255,255,.025); }
.collectionAvatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #64d2ff;
  background: linear-gradient(145deg,rgba(10,132,255,.22),rgba(94,92,230,.13));
  font-size: 15px;
  font-weight: 750;
}
.collectionIdentity { min-width: 0; display: grid; gap: 3px; }
.collectionIdentity strong { overflow: hidden; color: #f5f5f7; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.collectionIdentity small { overflow: hidden; color: #737378; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.collectionState {
  justify-self: start;
  max-width: 150px;
  overflow: hidden;
  padding: 5px 8px;
  border-radius: 999px;
  color: #a1a1a6;
  background: rgba(255,255,255,.055);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collectionPrimary, .collectionMore {
  min-height: 34px;
  border: 0;
  border-radius: 9px !important;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.collectionPrimary { padding: 0 12px; color: #fff; background: #0a84ff; }
.collectionPrimary:hover { background: #2493ff !important; }
.collectionMore { width: 34px; padding: 0; color: #8e8e93; background: transparent; letter-spacing: 1px; }
.collectionMore:hover, .collectionMore.active { color: #fff; background: rgba(255,255,255,.09) !important; }
.collectionCardDetails {
  padding: 16px !important;
  border-top: 1px solid rgba(255,255,255,.07);
  background: #111113;
}
.collectionCardDetails > .badge, .collectionCardDetails > h3 { display: none !important; }
.collectionCardDetails > .muted { display: inline-block; margin: 0 18px 10px 0; font-size: 11px !important; }
.collectionCardDetails .metrics { max-width: 430px; margin: 3px 0 12px !important; }
.collectionCardDetails .miniProgress { max-width: 560px; }
.collectionCardDetails .prices { max-width: 430px; }
.collectionCardDetails .note { max-width: 720px; min-height: 0 !important; }
.collectionCardDetails .clientMainActions,
.collectionCardDetails .normalActions,
.collectionCardDetails .inactivoActions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 7px !important;
}
.collectionCardDetails .clientMainActions > *,
.collectionCardDetails .normalActions > *,
.collectionCardDetails .inactivoActions > * { flex: 0 1 auto; }
.collectionCardDetails .btn { min-height: 36px !important; padding: 8px 11px !important; border-radius: 10px !important; font-size: 11px !important; box-shadow: none !important; }
.minimalCollectionCard.rowExpanded { border-color: rgba(10,132,255,.28) !important; }
.minimalCollectionCard.rowExpanded .collectionRow { background: rgba(10,132,255,.045); }
.clientesSearchPanel { display: none !important; }
.normalesPanel, .inactivosPanel, .duplicadosPanel {
  padding: 14px !important;
  border-color: rgba(255,255,255,.075) !important;
  background: #111113 !important;
  box-shadow: none !important;
}
.normalesHead h2, .inactivosHead h2, .duplicadosHead h2 { font-size: 17px !important; letter-spacing: -.02em; }
.normalesBadge, .inactivosBadge, .duplicadosBadge { border: 0 !important; color: #8e8e93 !important; background: rgba(255,255,255,.05) !important; font-size: 11px !important; }

@media (max-width: 720px) {
  .collectionRow { grid-template-columns: 38px minmax(0,1fr) auto 34px; gap: 8px; min-height: 64px; padding-left: 10px; }
  .collectionAvatar { width: 34px; height: 34px; border-radius: 10px; }
  .collectionState { display: none; }
  .collectionPrimary { padding: 0 10px; }
  .collectionCardDetails { padding: 12px !important; }
  .collectionCardDetails .metrics, .collectionCardDetails .prices { max-width: none; }
  .collectionCardDetails .clientMainActions > *, .collectionCardDetails .normalActions > *, .collectionCardDetails .inactivoActions > * { flex: 1 1 46%; }
}

/* Fichas Pro v6: espacio completo de trabajo */
body:has(.modal.open) { overflow: hidden !important; }
body > .modal {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  padding: 14px !important;
  overflow: hidden !important;
}
body > .modal.open { display: flex !important; align-items: stretch; justify-content: center; }
body > .modal > .sheet {
  width: min(1480px,calc(100vw - 28px)) !important;
  max-width: 1480px !important;
  height: calc(100dvh - 28px) !important;
  max-height: none !important;
  display: grid !important;
  grid-template-rows: auto minmax(0,1fr);
  margin: 0 auto !important;
  overflow: hidden !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 24px !important;
  background: #0c0c0e !important;
  box-shadow: 0 40px 120px rgba(0,0,0,.72) !important;
}
body > .modal .sheetHead { position: relative !important; top: auto !important; flex: 0 0 auto; border-radius: 23px 23px 0 0 !important; }
body > .modal .modalBody {
  min-height: 0 !important;
  margin: 0 !important;
  padding: 12px !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}
body > .modal .modalBody > section { min-height: 100%; }
body > .modal .refList { max-height: none !important; overflow: visible !important; }

@media (max-width: 820px) {
  body > .modal { padding: 0 !important; }
  body > .modal > .sheet { width: 100vw !important; height: 100dvh !important; border: 0 !important; border-radius: 0 !important; }
  body > .modal .sheetHead { border-radius: 0 !important; }
  body > .modal .modalBody { padding: 8px !important; }
}

/* Fichas Pro v7: listado completo siempre accesible */
body > .modal .modalBody {
  grid-template-rows: auto minmax(0,1fr) !important;
  overflow: hidden !important;
}
body > .modal .modalBody > section {
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column;
  overflow: hidden !important;
}
body > .modal .modalBody > section > h3:first-child,
body > .modal .modalRefSearch,
body > .modal .refTableHead,
body > .modal .refListFoot { flex: 0 0 auto; }
body > .modal .refList {
  flex: 1 1 auto;
  min-height: 150px !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: scroll !important;
  scrollbar-width: auto;
  scrollbar-color: #48484a #1c1c1e;
  overscroll-behavior: contain;
}
body > .modal .refList::-webkit-scrollbar { width: 12px; }
body > .modal .refList::-webkit-scrollbar-track { background: #1c1c1e; }
body > .modal .refList::-webkit-scrollbar-thumb { border: 3px solid #1c1c1e; border-radius: 999px; background: #48484a; }
body > .modal .refList::-webkit-scrollbar-thumb:hover { background: #636366; }
.refListFoot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 4px 0;
  color: #636366;
  font-size: 10px;
}
.refListFoot span:first-child { color: #8e8e93; font-weight: 650; }

@media (max-width: 820px) {
  body > .modal .modalBody { grid-template-rows: auto minmax(0,1fr) !important; }
  .refListFoot span:last-child { display: none; }
}

/* Editor lateral Pro v8: compacto, jerárquico y sin espacio muerto */
.recordDrawer {
  top: 50% !important;
  right: 0 !important;
  bottom: auto !important;
  width: min(440px,calc(100vw - 24px)) !important;
  height: auto !important;
  max-height: calc(100dvh - 36px) !important;
  border: 1px solid rgba(255,255,255,.11) !important;
  border-right: 0 !important;
  border-radius: 24px 0 0 24px !important;
  background: #161618 !important;
  transform: translate(105%,-50%) !important;
}
.recordDrawer.open { transform: translate(0,-50%) !important; }
.recordDrawer > header { padding: 22px 22px 18px !important; border-radius: 24px 0 0 0; }
.recordDrawer header h3 { font-size: 26px !important; }
.recordDrawer header p { margin-top: 5px !important; }
.recordDrawerBody { padding: 16px 20px 22px !important; }
.recordDrawer .refDetails > .note {
  position: relative;
  margin-bottom: 20px !important;
  padding: 13px 14px 13px 38px !important;
  border: 1px solid rgba(255,255,255,.07) !important;
  color: #a1a1a6 !important;
  background: #1c1c1e !important;
}
.recordDrawer .refDetails > .note::before { content: '◦'; position: absolute; left: 16px; color: #0a84ff; font-size: 22px; line-height: 15px; }
.drawerSectionTitle { display: flex !important; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 18px 0 9px !important; padding: 0 !important; border: 0 !important; }
.drawerSectionTitle:first-of-type { margin-top: 0 !important; }
.drawerSectionTitle span { color: #f5f5f7; font-size: 12px; font-weight: 700; }
.drawerSectionTitle small { color: #636366; font-size: 9px; }
.recordDrawer .refActions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 7px !important;
  margin: 0 !important;
}
.recordDrawer .refActions > :last-child { grid-column: 1 / -1; }
.recordDrawer .refActions .btn {
  min-height: 42px !important;
  border: 0 !important;
  color: #f5f5f7 !important;
  background: #2c2c2e !important;
  font-size: 11px !important;
}
.recordDrawer .refActions form:nth-of-type(1) .btn { color: #64d2ff !important; background: rgba(10,132,255,.13) !important; }
.recordDrawer .refActions form:last-child .btn { color: #ff6961 !important; background: rgba(255,69,58,.11) !important; }
.recordDrawer .refRenewals {
  display: grid !important;
  grid-template-columns: repeat(3,1fr) !important;
  gap: 7px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
.recordDrawer .refRenewals .btn {
  min-height: 52px !important;
  border: 1px solid rgba(48,209,88,.20) !important;
  color: #30d158 !important;
  background: rgba(48,209,88,.08) !important;
  font-size: 12px !important;
}
.recordDrawer .refRenewals .btn:hover { color: #08140b !important; background: #30d158 !important; }
.recordDrawer .editBox.drawerEditOpen {
  margin-top: 18px !important;
  padding: 16px !important;
  border: 1px solid rgba(10,132,255,.18) !important;
  border-radius: 16px;
  background: rgba(10,132,255,.045);
}

@media (max-width: 600px) {
  .recordDrawer {
    top: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    transform: translateX(105%) !important;
  }
  .recordDrawer.open { transform: translateX(0) !important; }
  .recordDrawer > header { border-radius: 0; }
}

/* Navegación de colecciones v9: una sección, una barra, una lista */
.collectionTools {
  grid-template-columns: minmax(220px,1fr) auto auto !important;
  max-width: none !important;
  margin: 14px 0 10px !important;
  padding: 9px !important;
  border-radius: 15px !important;
  background: #151517 !important;
  box-shadow: none !important;
}
.collectionTools[hidden] { display: none !important; }
.collectionTools .copyVisible { min-height: 38px !important; padding: 0 13px !important; }
body .clients.listLayout,
body .normalesGrid.listLayout,
body .inactivosGrid.listLayout,
body .duplicadosGrid.listLayout {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) !important;
  width: 100% !important;
  gap: 7px !important;
}
body .clients.listLayout .minimalCollectionCard,
body .normalesGrid.listLayout .minimalCollectionCard,
body .inactivosGrid.listLayout .minimalCollectionCard,
body .duplicadosGrid.listLayout .minimalCollectionCard {
  width: 100% !important;
  max-width: none !important;
}
body .clients.listLayout .collectionRow,
body .normalesGrid.listLayout .collectionRow,
body .inactivosGrid.listLayout .collectionRow,
body .duplicadosGrid.listLayout .collectionRow {
  grid-template-columns: 42px minmax(220px,1fr) minmax(110px,180px) 82px 36px !important;
}

@media (max-width: 720px) {
  .collectionTools { grid-template-columns: minmax(0,1fr) auto !important; }
  .collectionTools .collectionMeta { display: none; }
  body .clients.listLayout .collectionRow,
  body .normalesGrid.listLayout .collectionRow,
  body .inactivosGrid.listLayout .collectionRow,
  body .duplicadosGrid.listLayout .collectionRow { grid-template-columns: 38px minmax(0,1fr) auto 34px !important; }
}

/* Inicio v10: tres buscadores independientes */
.homeSearchPanel {
  margin: 0 0 16px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 26px;
  background: linear-gradient(145deg,#151517,#0f0f11);
  box-shadow: 0 20px 50px rgba(0,0,0,.22);
}
.homeSearchHead { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.homeSearchHead > div > span { color: #0a84ff; font-size: 10px; font-weight: 750; letter-spacing: .11em; }
.homeSearchHead h2 { margin: 4px 0 3px; color: #f5f5f7; font-size: 24px; letter-spacing: -.035em; }
.homeSearchHead p { margin: 0; color: #737378; font-size: 12px; }
.homeSearchGrid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.homeSearchCard {
  position: relative;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 19px;
  background: #1a1a1d;
  transition: border-color .18s ease, transform .18s ease;
}
.homeSearchCard:focus-within { border-color: rgba(10,132,255,.38); transform: translateY(-1px); }
.homeSearchCard.violet:focus-within { border-color: rgba(191,90,242,.38); }
.homeSearchCard.green:focus-within { border-color: rgba(48,209,88,.38); }
.homeSearchCard header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.homeSearchIcon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: #64d2ff; background: rgba(10,132,255,.13); }
.homeSearchCard.violet .homeSearchIcon { color: #da8fff; background: rgba(191,90,242,.13); }
.homeSearchCard.green .homeSearchIcon { color: #5ee578; background: rgba(48,209,88,.12); }
.homeSearchIcon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.homeSearchCard header h3 { margin: 0 !important; color: #f5f5f7 !important; font-size: 14px !important; letter-spacing: -.01em !important; text-transform: none !important; }
.homeSearchCard header small { color: #636366; font-size: 10px; }
.homeSearchInput { position: relative; display: flex; align-items: center; }
.homeSearchInput > svg { position: absolute; left: 12px; width: 16px; height: 16px; fill: none; stroke: #636366; stroke-width: 1.8; pointer-events: none; }
.homeSearchInput input { min-height: 44px !important; padding: 10px 36px !important; border: 1px solid rgba(255,255,255,.07) !important; border-radius: 12px !important; color: #f5f5f7 !important; background: #111113 !important; font-size: 12px !important; box-shadow: none !important; }
.homeSearchInput input:focus { border-color: #0a84ff !important; box-shadow: 0 0 0 3px rgba(10,132,255,.11) !important; }
.homeSearchCard.violet input:focus { border-color: #bf5af2 !important; box-shadow: 0 0 0 3px rgba(191,90,242,.11) !important; }
.homeSearchCard.green input:focus { border-color: #30d158 !important; box-shadow: 0 0 0 3px rgba(48,209,88,.10) !important; }
.homeSearchInput button { display: none; position: absolute; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 50% !important; color: #a1a1a6; background: rgba(255,255,255,.08); cursor: pointer; }
.homeSearchInput button.visible { display: block; }
.homeSearchResults { display: none; max-height: 285px; margin-top: 8px; overflow-y: auto; border-radius: 12px; background: #111113; }
.homeSearchCard.hasResults .homeSearchResults { display: block; }
.homeSearchResults > p { margin: 0; padding: 13px; color: #636366; font-size: 11px; text-align: center; }
.homeSearchResult { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 11px; border: 0; border-bottom: 1px solid rgba(255,255,255,.06); color: #f5f5f7; background: transparent; text-align: left; cursor: pointer; }
.homeSearchResult:last-child { border-bottom: 0; }
.homeSearchResult:hover, .homeSearchResult:focus { background: rgba(10,132,255,.10) !important; outline: none; }
.homeSearchResult > span { min-width: 0; display: grid; gap: 3px; }
.homeSearchResult strong, .homeSearchResult small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.homeSearchResult strong { font-size: 12px; }
.homeSearchResult small { color: #737378; font-size: 9px; }
.homeSearchResult > b { color: #636366; font-size: 20px; font-weight: 400; }

@media (max-width: 1080px) { .homeSearchGrid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .homeSearchPanel { padding: 14px; border-radius: 20px; }
  .homeSearchHead kbd { display: none; }
  .homeSearchHead h2 { font-size: 20px; }
}

/* Navegación v11: ninguna colección puede atravesar a otra pantalla */
[data-app-view][hidden],
.collectionTools[data-app-view][hidden],
.clients[data-app-view][hidden],
.mdPagination[data-app-view][hidden] {
  display: none !important;
}
