/* ============================================
   NODOCITY MARKETPLACE - CSS
   Dark premium, mobile-first
   ============================================ */

:root {
  --nd-bg1:      #0A0E1A;
  --nd-bg2:      #111827;
  --nd-bg3:      #1a2235;
  --nd-gold1:    #C9A84C;
  --nd-gold2:    #F0C040;
  --nd-green:    #22c55e;
  --nd-red:      #ef4444;
  --nd-cyan:     #06b6d4;
  --nd-text1:    #F1F5F9;
  --nd-text2:    #94A3B8;
  --nd-border:   #1e2d45;
  --nd-radius:   10px;
  --nd-shadow:   0 4px 24px rgba(0,0,0,0.5);
  --nd-glow:     0 0 12px rgba(240,192,64,0.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { background: var(--nd-bg1); color: var(--nd-text1); font-family: 'Inter', 'Segoe UI', sans-serif; min-height: 100vh; }

/* ---- TICKER ---- */
.ndm-ticker-wrap {
  position: sticky; top: 0; z-index: 900;
  background: var(--nd-bg2);
  border-bottom: 1px solid var(--nd-gold1);
  overflow: hidden; height: 38px;
  display: flex; align-items: center;
}
.ndm-ticker-track {
  display: flex; gap: 40px; white-space: nowrap;
  animation: ndmTick 40s linear infinite;
  padding-left: 100%;
}
.ndm-ticker-track:hover { animation-play-state: paused; }
.ndm-ticker-item { font-size: .8rem; color: var(--nd-text2); cursor: pointer; transition: color .2s; display: flex; align-items: center; gap: 6px; }
.ndm-ticker-item:hover { color: var(--nd-gold2); }
.ndm-ticker-item .ndm-up { color: var(--nd-green); }
.ndm-ticker-item .ndm-down { color: var(--nd-red); }
.ndm-ticker-sep { color: var(--nd-border); }
.ndm-ticker-loading { font-size: .8rem; color: var(--nd-text2); padding: 0 20px; }
@keyframes ndmTick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- WRAPPER ---- */
.ndm-wrap { max-width: 1300px; margin: 0 auto; padding: 16px; }

/* ---- HERO ---- */
.ndm-hero { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; margin-bottom: 24px; padding: 28px; background: linear-gradient(135deg, var(--nd-bg2) 0%, var(--nd-bg3) 100%); border-radius: var(--nd-radius); border: 1px solid var(--nd-border); }
.ndm-hero-left h1 { font-size: 2rem; font-weight: 700; color: var(--nd-gold2); display: flex; align-items: center; gap: 10px; }
.ndm-hero-left p { color: var(--nd-text2); margin-top: 6px; font-size: .95rem; }
.ndm-hero-stats { display: flex; gap: 24px; flex-wrap: wrap; }
.ndm-stat-box { text-align: center; padding: 12px 20px; background: var(--nd-bg1); border-radius: 8px; border: 1px solid var(--nd-border); min-width: 120px; }
.ndm-stat-val { display: block; font-size: 1.3rem; font-weight: 700; color: var(--nd-gold2); }
.ndm-stat-lbl { font-size: .75rem; color: var(--nd-text2); margin-top: 4px; }

/* ---- LIVE DOT ---- */
.ndm-dot-live { display: inline-block; width: 8px; height: 8px; background: var(--nd-green); border-radius: 50%; animation: ndmPulse 1.5s ease-in-out infinite; }
@keyframes ndmPulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.3)} }

/* ---- CONTROLS ---- */
.ndm-controls { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; align-items: center; }
.ndm-search-wrap { display: flex; align-items: center; gap: 8px; background: var(--nd-bg2); border: 1px solid var(--nd-border); border-radius: 8px; padding: 8px 14px; flex: 1 1 220px; }
.ndm-search-wrap svg { color: var(--nd-text2); flex-shrink: 0; }
.ndm-search-wrap input { background: transparent; border: none; outline: none; color: var(--nd-text1); font-size: .9rem; width: 100%; }
.ndm-search-wrap input::placeholder { color: var(--nd-text2); }
.ndm-filters-wrap { display: flex; gap: 8px; flex-wrap: wrap; }
.ndm-chip { background: var(--nd-bg2); border: 1px solid var(--nd-border); color: var(--nd-text2); padding: 6px 14px; border-radius: 20px; font-size: .82rem; cursor: pointer; transition: all .2s; white-space: nowrap; }
.ndm-chip:hover, .ndm-chip.active { background: var(--nd-gold1); border-color: var(--nd-gold1); color: #000; font-weight: 600; }
.ndm-sort-wrap select { background: var(--nd-bg2); border: 1px solid var(--nd-border); color: var(--nd-text2); padding: 8px 12px; border-radius: 8px; font-size: .85rem; outline: none; cursor: pointer; }

/* ---- MAIN LAYOUT ---- */
.ndm-main { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
@media (max-width: 900px) { .ndm-main { grid-template-columns: 1fr; } }

/* ---- PROPERTY GRID ---- */
.ndm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 24px; }

/* ---- PROPERTY CARD ---- */
.ndm-card { background: var(--nd-bg2); border: 1px solid var(--nd-border); border-radius: var(--nd-radius); overflow: hidden; cursor: pointer; transition: transform .25s, box-shadow .25s, border-color .25s; position: relative; }
.ndm-card:hover { transform: translateY(-6px); box-shadow: var(--nd-shadow), var(--nd-glow); border-color: var(--nd-gold1); }
.ndm-card-img { width: 100%; height: 160px; object-fit: cover; background: var(--nd-bg3); display: block; }
.ndm-card-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.ndm-badge { font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; letter-spacing: .5px; }
.ndm-badge-hot { background: #ef4444; color: #fff; animation: ndmPulse 2s infinite; }
.ndm-badge-flash { background: #f59e0b; color: #000; }
.ndm-badge-new { background: var(--nd-green); color: #000; }
.ndm-badge-auction { background: #7c3aed; color: #fff; }
.ndm-badge-opp { background: var(--nd-cyan); color: #000; }
.ndm-card-body { padding: 14px; }
.ndm-card-title { font-size: .97rem; font-weight: 600; color: var(--nd-text1); margin-bottom: 4px; }
.ndm-card-sub { font-size: .78rem; color: var(--nd-text2); margin-bottom: 10px; }
.ndm-card-price-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.ndm-card-price { font-size: 1.4rem; font-weight: 700; color: var(--nd-gold2); }
.ndm-card-change { font-size: .85rem; font-weight: 600; padding: 2px 7px; border-radius: 5px; }
.ndm-card-change.up { background: rgba(34,197,94,.15); color: var(--nd-green); }
.ndm-card-change.down { background: rgba(239,68,68,.15); color: var(--nd-red); }
.ndm-card-change.flat { background: rgba(148,163,184,.1); color: var(--nd-text2); }
.ndm-card-meta { display: flex; justify-content: space-between; font-size: .75rem; color: var(--nd-text2); margin-bottom: 8px; }
.ndm-sparkline { width: 100%; height: 36px; margin-bottom: 8px; }
.ndm-card-footer { display: flex; justify-content: space-between; align-items: center; font-size: .74rem; color: var(--nd-text2); padding-top: 8px; border-top: 1px solid var(--nd-border); }
.ndm-card-watchers { display: flex; align-items: center; gap: 4px; }
.ndm-card-yield { color: var(--nd-gold1); font-weight: 600; }
.ndm-card-btn { display: block; text-align: center; background: var(--nd-gold1); color: #000; font-weight: 700; font-size: .82rem; padding: 8px; border-radius: 6px; margin-top: 10px; border: none; cursor: pointer; transition: background .2s; width: 100%; }
.ndm-card-btn:hover { background: var(--nd-gold2); }

/* ---- SKELETON ---- */
.ndm-skeleton { pointer-events: none; }
.ndm-sk-img { height: 160px; background: linear-gradient(90deg, var(--nd-bg3) 25%, var(--nd-border) 50%, var(--nd-bg3) 75%); background-size: 200% 100%; animation: ndmSk 1.5s infinite; border-radius: 0; }
.ndm-sk-line { height: 12px; border-radius: 4px; background: linear-gradient(90deg, var(--nd-bg3) 25%, var(--nd-border) 50%, var(--nd-bg3) 75%); background-size: 200% 100%; animation: ndmSk 1.5s infinite; margin: 10px 14px 0; }
.ndm-sk-w80 { width: 80%; }
.ndm-sk-w50 { width: 50%; }
.ndm-sk-w60 { width: 60%; }
@keyframes ndmSk { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ---- FEED ---- */
.ndm-feed-section { margin-bottom: 20px; }
.ndm-section-title { font-size: .9rem; font-weight: 700; color: var(--nd-gold2); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; letter-spacing: .5px; }
.ndm-feed { background: var(--nd-bg2); border: 1px solid var(--nd-border); border-radius: var(--nd-radius); overflow: hidden; max-height: 280px; overflow-y: auto; }
.ndm-feed-item { padding: 10px 14px; border-bottom: 1px solid var(--nd-border); font-size: .82rem; color: var(--nd-text2); display: flex; gap: 10px; align-items: flex-start; animation: ndmSlide .4s ease; }
.ndm-feed-item:last-child { border-bottom: none; }
.ndm-feed-item .ndm-feed-time { color: var(--nd-border); font-size: .72rem; white-space: nowrap; flex-shrink: 0; margin-top: 1px; }
.ndm-feed-item em { color: var(--nd-gold1); font-style: normal; }
.ndm-feed-empty { padding: 20px; text-align: center; color: var(--nd-text2); font-size: .85rem; }
@keyframes ndmSlide { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

/* ---- WIDGETS (barra lateral) ---- */
.ndm-col-side { display: flex; flex-direction: column; gap: 16px; }
.ndm-widget { background: var(--nd-bg2); border: 1px solid var(--nd-border); border-radius: var(--nd-radius); padding: 16px; }
.ndm-widget-title { font-size: .85rem; font-weight: 700; color: var(--nd-gold2); margin-bottom: 12px; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.ndm-balance-row { margin-bottom: 6px; }
.ndm-balance-val { font-size: 1.6rem; font-weight: 700; color: var(--nd-gold2); display: block; }
.ndm-balance-lbl { font-size: .75rem; color: var(--nd-text2); }
.ndm-balance-held { font-size: .78rem; color: var(--nd-text2); }
.ndm-notif-badge { background: var(--nd-red); color: #fff; font-size: .7rem; font-weight: 700; padding: 1px 6px; border-radius: 10px; }
.ndm-notif-list { max-height: 200px; overflow-y: auto; }
.ndm-notif-item { padding: 8px 0; border-bottom: 1px solid var(--nd-border); font-size: .8rem; }
.ndm-notif-item:last-child { border-bottom: none; }
.ndm-notif-item strong { display: block; color: var(--nd-text1); margin-bottom: 2px; }
.ndm-notif-item span { color: var(--nd-text2); }
.ndm-notif-item.unread strong { color: var(--nd-gold2); }

/* ---- ACTION PANEL ---- */
.ndm-action-empty { text-align: center; padding: 20px 10px; color: var(--nd-text2); font-size: .85rem; }
.ndm-action-empty svg { display: block; margin: 0 auto 10px; opacity: .5; }
.ndm-action-content { }
.ndm-action-prop-name { font-size: 1rem; font-weight: 700; color: var(--nd-text1); margin-bottom: 4px; }
.ndm-action-prop-price { font-size: 1.6rem; font-weight: 700; color: var(--nd-gold2); margin-bottom: 2px; }
.ndm-action-change { font-size: .82rem; margin-bottom: 14px; }
.ndm-tabs { display: flex; border-bottom: 1px solid var(--nd-border); margin-bottom: 14px; }
.ndm-tab { flex: 1; text-align: center; padding: 8px; font-size: .82rem; font-weight: 600; cursor: pointer; color: var(--nd-text2); border-bottom: 2px solid transparent; transition: all .2s; }
.ndm-tab.active { color: var(--nd-gold2); border-bottom-color: var(--nd-gold2); }
.ndm-tab-pane { display: none; }
.ndm-tab-pane.active { display: block; }
.ndm-field-label { font-size: .75rem; color: var(--nd-text2); margin-bottom: 4px; display: block; }
.ndm-input { width: 100%; background: var(--nd-bg1); border: 1px solid var(--nd-border); color: var(--nd-text1); padding: 9px 12px; border-radius: 7px; font-size: .9rem; outline: none; transition: border .2s; margin-bottom: 10px; }
.ndm-input:focus { border-color: var(--nd-gold1); }
.ndm-select { width: 100%; background: var(--nd-bg1); border: 1px solid var(--nd-border); color: var(--nd-text1); padding: 9px 12px; border-radius: 7px; font-size: .9rem; outline: none; margin-bottom: 10px; cursor: pointer; }
.ndm-order-type-switch { display: flex; gap: 8px; margin-bottom: 12px; }
.ndm-ots-btn { flex: 1; padding: 7px; font-size: .8rem; font-weight: 600; border-radius: 6px; cursor: pointer; border: 1px solid var(--nd-border); background: var(--nd-bg1); color: var(--nd-text2); transition: all .2s; }
.ndm-ots-btn.active { background: var(--nd-gold1); color: #000; border-color: var(--nd-gold1); }
.ndm-calc-box { background: var(--nd-bg1); border-radius: 7px; padding: 10px 12px; margin-bottom: 12px; font-size: .82rem; }
.ndm-calc-row { display: flex; justify-content: space-between; color: var(--nd-text2); margin-bottom: 4px; }
.ndm-calc-row.total { color: var(--nd-gold2); font-weight: 700; font-size: .9rem; border-top: 1px solid var(--nd-border); padding-top: 6px; margin-top: 4px; }
.ndm-btn-buy { width: 100%; background: var(--nd-gold1); color: #000; font-weight: 700; font-size: .95rem; padding: 11px; border-radius: 8px; border: none; cursor: pointer; transition: background .2s; margin-bottom: 8px; }
.ndm-btn-buy:hover { background: var(--nd-gold2); }
.ndm-btn-sell { width: 100%; background: transparent; color: var(--nd-red); font-weight: 700; font-size: .95rem; padding: 11px; border-radius: 8px; border: 1px solid var(--nd-red); cursor: pointer; transition: all .2s; margin-bottom: 8px; }
.ndm-btn-sell:hover { background: var(--nd-red); color: #fff; }
.ndm-pressure-box { font-size: .75rem; color: var(--nd-text2); background: var(--nd-bg1); border-radius: 7px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }

/* ---- BOTONES GENÉRICOS ---- */
.ndm-btn-sm { font-size: .8rem; font-weight: 600; padding: 7px 14px; border-radius: 7px; cursor: pointer; transition: all .2s; border: none; display: inline-block; text-decoration: none; }
.ndm-btn-gold { background: var(--nd-gold1); color: #000; }
.ndm-btn-gold:hover { background: var(--nd-gold2); }
.ndm-btn-outline { background: transparent; border: 1px solid var(--nd-gold1); color: var(--nd-gold1); }
.ndm-btn-outline:hover { background: var(--nd-gold1); color: #000; }

/* ---- MODAL ---- */
.ndm-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ndm-modal { background: var(--nd-bg2); border: 1px solid var(--nd-border); border-radius: 14px; width: 100%; max-width: 900px; max-height: 90vh; overflow-y: auto; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.7); animation: ndmModalIn .25s ease; }
.ndm-modal-sm { max-width: 440px; }
.ndm-modal-close { position: absolute; top: 14px; right: 16px; background: transparent; border: none; color: var(--nd-text2); font-size: 1.1rem; cursor: pointer; z-index: 1; padding: 4px; }
.ndm-modal-close:hover { color: var(--nd-text1); }
.ndm-modal-body { padding: 28px; }
@keyframes ndmModalIn { from{opacity:0;transform:scale(.96)} to{opacity:1;transform:scale(1)} }

/* ---- MODAL DETALLE PROPIEDAD ---- */
.ndm-prop-modal-header { display: flex; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.ndm-prop-modal-img { width: 100%; max-width: 360px; height: 200px; object-fit: cover; border-radius: 10px; background: var(--nd-bg3); flex-shrink: 0; }
.ndm-prop-modal-info { flex: 1; min-width: 200px; }
.ndm-prop-modal-info h2 { font-size: 1.3rem; font-weight: 700; color: var(--nd-text1); margin-bottom: 6px; }
.ndm-prop-modal-loc { font-size: .85rem; color: var(--nd-text2); margin-bottom: 14px; }
.ndm-prop-modal-price { font-size: 2rem; font-weight: 700; color: var(--nd-gold2); }
.ndm-prop-modal-change { font-size: .9rem; margin-top: 4px; }
.ndm-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media(max-width:600px){ .ndm-modal-grid{grid-template-columns:1fr} .ndm-prop-modal-header{flex-direction:column} }
.ndm-modal-section-title { font-size: .8rem; font-weight: 700; color: var(--nd-gold1); letter-spacing: .7px; text-transform: uppercase; margin-bottom: 10px; }
.ndm-chart-wrap { width: 100%; height: 180px; margin-bottom: 20px; }
.ndm-orderbook { width: 100%; font-size: .78rem; margin-bottom: 20px; }
.ndm-orderbook-header { display: grid; grid-template-columns: 1fr 1fr; color: var(--nd-text2); margin-bottom: 6px; }
.ndm-orderbook-header span:last-child { text-align: right; }
.ndm-ob-asks { margin-bottom: 6px; }
.ndm-ob-row { display: grid; grid-template-columns: 1fr 1fr; padding: 3px 0; position: relative; }
.ndm-ob-row .ndm-ob-bar { position: absolute; right: 0; top: 0; height: 100%; opacity: .12; }
.ndm-ob-ask-bar { background: var(--nd-red); }
.ndm-ob-bid-bar { background: var(--nd-green); }
.ndm-ob-price { font-weight: 600; }
.ndm-ob-ask-price { color: var(--nd-red); }
.ndm-ob-bid-price { color: var(--nd-green); }
.ndm-ob-qty { text-align: right; color: var(--nd-text2); }
.ndm-ob-spread { text-align: center; font-size: .75rem; color: var(--nd-text2); padding: 4px 0; border-top: 1px solid var(--nd-border); border-bottom: 1px solid var(--nd-border); margin-bottom: 6px; }
.ndm-trade-history { max-height: 180px; overflow-y: auto; }
.ndm-th-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; padding: 4px 0; font-size: .75rem; border-bottom: 1px solid rgba(30,45,69,.5); }
.ndm-th-row.header { color: var(--nd-text2); font-weight: 600; }
.ndm-th-row .buy { color: var(--nd-green); }
.ndm-th-row .sell { color: var(--nd-red); }
.ndm-confirm-body { padding: 28px; }
.ndm-confirm-title { font-size: 1.1rem; font-weight: 700; color: var(--nd-text1); margin-bottom: 16px; }
.ndm-confirm-row { display: flex; justify-content: space-between; font-size: .88rem; padding: 7px 0; border-bottom: 1px solid var(--nd-border); color: var(--nd-text2); }
.ndm-confirm-row strong { color: var(--nd-text1); }
.ndm-confirm-row.total strong { color: var(--nd-gold2); font-size: 1rem; }
.ndm-confirm-actions { display: flex; gap: 10px; margin-top: 18px; }
.ndm-confirm-actions button { flex: 1; padding: 11px; border-radius: 8px; font-weight: 700; cursor: pointer; border: none; font-size: .9rem; }
.ndm-confirm-cancel { background: var(--nd-bg1); color: var(--nd-text2); border: 1px solid var(--nd-border) !important; }
.ndm-confirm-ok { background: var(--nd-gold1); color: #000; }
.ndm-confirm-ok:hover { background: var(--nd-gold2); }

/* ---- TOAST ---- */
.ndm-toast-container { position: fixed; bottom: 80px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.ndm-toast { background: var(--nd-bg2); border: 1px solid var(--nd-gold1); border-radius: 10px; padding: 12px 16px; font-size: .83rem; color: var(--nd-text1); box-shadow: var(--nd-shadow); max-width: 300px; animation: ndmToastIn .3s ease; pointer-events: all; }
.ndm-toast.success { border-color: var(--nd-green); }
.ndm-toast.error { border-color: var(--nd-red); }
@keyframes ndmToastIn { from{opacity:0;transform:translateX(20px)} to{opacity:1;transform:translateX(0)} }

/* ---- TOUR ---- */
.ndm-tour-tip { position: fixed; bottom: 100px; right: 20px; width: 280px; background: var(--nd-bg2); border: 1px solid var(--nd-gold1); border-radius: 12px; padding: 16px; z-index: 9998; box-shadow: var(--nd-shadow), var(--nd-glow); animation: ndmModalIn .3s ease; }
.ndm-tour-content { font-size: .85rem; color: var(--nd-text2); margin-bottom: 14px; line-height: 1.5; }
.ndm-tour-content strong { color: var(--nd-gold2); display: block; margin-bottom: 4px; font-size: .9rem; }
.ndm-tour-footer { display: flex; justify-content: space-between; align-items: center; }
.ndm-tour-dots { display: flex; gap: 5px; justify-content: center; margin-top: 10px; }
.ndm-tour-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--nd-border); }
.ndm-tour-dot.active { background: var(--nd-gold1); }

/* ---- FAQ ---- */
.ndm-faq-section { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--nd-border); }
.ndm-faq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; margin-top: 16px; }
.ndm-faq-item { background: var(--nd-bg2); border: 1px solid var(--nd-border); border-radius: 8px; overflow: hidden; }
.ndm-faq-q { width: 100%; background: transparent; border: none; color: var(--nd-text1); padding: 14px 16px; font-size: .87rem; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; text-align: left; gap: 10px; }
.ndm-faq-q:hover { color: var(--nd-gold2); }
.ndm-faq-arrow { transition: transform .2s; flex-shrink: 0; color: var(--nd-gold1); }
.ndm-faq-item.open .ndm-faq-arrow { transform: rotate(180deg); }
.ndm-faq-a { padding: 0 16px; max-height: 0; overflow: hidden; font-size: .83rem; color: var(--nd-text2); line-height: 1.6; transition: max-height .3s ease, padding .3s ease; }
.ndm-faq-item.open .ndm-faq-a { max-height: 200px; padding: 0 16px 14px; }

/* ---- DISCLAIMER ---- */
.ndm-disclaimer { margin-top: 20px; padding: 14px 16px; background: rgba(239,68,68,.06); border: 1px solid rgba(239,68,68,.2); border-radius: 8px; font-size: .78rem; color: var(--nd-text2); line-height: 1.5; }
.ndm-disclaimer a { color: var(--nd-gold1); text-decoration: none; }

/* ---- TOOLTIPS ---- */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after { content: attr(data-tooltip); position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%); background: #0f172a; color: var(--nd-text1); font-size: .75rem; padding: 6px 10px; border-radius: 6px; white-space: nowrap; max-width: 240px; white-space: normal; text-align: center; pointer-events: none; opacity: 0; transition: opacity .2s; z-index: 100; border: 1px solid var(--nd-border); box-shadow: var(--nd-shadow); line-height: 1.4; }
[data-tooltip]:hover::after { opacity: 1; }

/* ---- NÚMERO FLASH ---- */
.ndm-flash-up { animation: ndmFlashUp .8s ease; }
.ndm-flash-down { animation: ndmFlashDn .8s ease; }
@keyframes ndmFlashUp { 0%{background:rgba(34,197,94,.3)} 100%{background:transparent} }
@keyframes ndmFlashDn { 0%{background:rgba(239,68,68,.3)} 100%{background:transparent} }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--nd-bg1); }
::-webkit-scrollbar-thumb { background: var(--nd-border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--nd-gold1); }

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  .ndm-hero-left h1 { font-size: 1.4rem; }
  .ndm-hero-stats { gap: 10px; }
  .ndm-stat-box { min-width: 90px; padding: 10px 12px; }
  .ndm-stat-val { font-size: 1rem; }
  .ndm-modal-body { padding: 16px; }
  .ndm-confirm-body { padding: 16px; }
}

/* ---- DETAIL PAGE ---- */
.ndm-prop-detail-header { display:flex; gap:24px; margin-bottom:24px; flex-wrap:wrap; background:var(--nd-bg2); border:1px solid var(--nd-border); border-radius:var(--nd-radius); overflow:hidden; }
.ndm-prop-detail-img { width:100%; max-width:400px; height:240px; object-fit:cover; flex-shrink:0; }
.ndm-prop-detail-info { flex:1; min-width:220px; padding:20px 20px 20px 0; display:flex; flex-direction:column; justify-content:center; }
.ndm-prop-detail-title { font-size:1.6rem; font-weight:700; color:var(--nd-text1); margin-bottom:6px; }
.ndm-prop-detail-loc { font-size:.85rem; color:var(--nd-text2); margin-bottom:16px; }
.ndm-prop-detail-metrics { display:flex; flex-wrap:wrap; gap:12px; }
.ndm-metric-box { background:var(--nd-bg1); border:1px solid var(--nd-border); border-radius:8px; padding:10px 16px; text-align:center; min-width:90px; }
.ndm-metric-val { display:block; font-size:1.1rem; font-weight:700; color:var(--nd-text1); }
.ndm-metric-lbl { font-size:.72rem; color:var(--nd-text2); margin-top:2px; }
.ndm-prop-detail-grid { display:grid; grid-template-columns:1fr 340px; gap:20px; }
@media(max-width:900px){ .ndm-prop-detail-grid{grid-template-columns:1fr} .ndm-prop-detail-header{flex-direction:column} .ndm-prop-detail-img{max-width:100%} .ndm-prop-detail-info{padding:16px} }
.ndm-action-sticky { position:sticky; top:80px; }
.ndm-signal-box { background:var(--nd-bg1); border:1px solid var(--nd-border); border-radius:8px; padding:12px; text-align:center; }
.ndm-signal-val { display:block; font-size:1.2rem; font-weight:700; color:var(--nd-gold2); }
.ndm-signal-lbl { font-size:.72rem; color:var(--nd-text2); margin-top:3px; }
.ndm-tf-pills { display:flex; gap:6px; margin-left:auto; }
.ndm-tf { background:var(--nd-bg1); border:1px solid var(--nd-border); color:var(--nd-text2); padding:3px 10px; border-radius:5px; font-size:.75rem; cursor:pointer; transition:all .2s; }
.ndm-tf.active { background:var(--nd-gold1); border-color:var(--nd-gold1); color:#000; font-weight:700; }

/* ---- FASE 2+3 ---- */
.ndm-auctions-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:16px; }
.ndm-auction-card { background:var(--nd-bg2); border:1px solid var(--nd-border); border-radius:var(--nd-radius); overflow:hidden; transition:all .25s; }
.ndm-auction-card:hover { transform:translateY(-4px); box-shadow:var(--nd-shadow),var(--nd-glow); border-color:var(--nd-gold1); }
.ndm-auction-card.urgent { border-color:#ef4444; }
.ndm-countdown { font-size:.9rem; font-weight:700; color:var(--nd-gold2); font-variant-numeric:tabular-nums; }
.ndm-countdown.urgent { color:#ef4444; animation:ndmPulse 1s infinite; }
.ndm-sentiment-widget { }
.ndm-sentiment-label { font-size:1rem; font-weight:700; margin-bottom:8px; }
.ndm-sentiment-bar { height:8px; background:var(--nd-bg1); border-radius:4px; overflow:hidden; margin-bottom:8px; }
.ndm-sentiment-fill { height:100%; border-radius:4px; transition:width .5s ease; }
.ndm-sentiment-meta { display:flex; justify-content:space-between; font-size:.75rem; color:var(--nd-text2); }
.ndm-rank-item { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--nd-border); cursor:pointer; transition:background .2s; }
.ndm-rank-item:hover { background:rgba(201,168,76,.05); }
.ndm-rank-item:last-child { border-bottom:none; }
.ndm-rank-pos { width:20px; text-align:center; font-size:.85rem; font-weight:700; color:var(--nd-gold1); flex-shrink:0; }
.ndm-rank-name { flex:1; font-size:.82rem; color:var(--nd-text1); }
.ndm-rank-metric { font-size:.82rem; font-weight:700; color:var(--nd-gold2); white-space:nowrap; }
.ndm-react-btn { background:transparent; border:none; cursor:pointer; font-size:.8rem; color:var(--nd-text2); padding:2px 4px; border-radius:4px; transition:all .2s; }
.ndm-react-btn:hover,.ndm-react-btn.active { background:rgba(201,168,76,.1); color:var(--nd-text1); }
.ndm-wl-btn { background:transparent; border:1px solid var(--nd-border); color:var(--nd-text2); padding:6px 12px; border-radius:20px; cursor:pointer; font-size:.8rem; transition:all .2s; display:flex; align-items:center; gap:5px; }
.ndm-wl-btn:hover,.ndm-wl-btn.watching { border-color:var(--nd-gold1); color:var(--nd-gold1); }
.ndm-wl-icon { font-style:normal; }
/* Mi Mercado Modal */
#ndmMyMarketOverlay { position:fixed; inset:0; background:rgba(0,0,0,.75); z-index:9500; display:flex; align-items:flex-start; justify-content:center; padding:20px; overflow-y:auto; }
.ndm-mymarket-modal { background:var(--nd-bg2); border:1px solid var(--nd-border); border-radius:14px; width:100%; max-width:700px; padding:24px; position:relative; margin:auto; box-shadow:0 20px 60px rgba(0,0,0,.7); animation:ndmModalIn .25s ease; }
.ndm-mm-header { display:flex; gap:16px; align-items:flex-start; margin-bottom:20px; padding-bottom:16px; border-bottom:1px solid var(--nd-border); flex-wrap:wrap; }
.ndm-mm-avatar { width:48px; height:48px; background:linear-gradient(135deg,var(--nd-gold1),var(--nd-gold2)); border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:1.1rem; font-weight:700; color:#000; flex-shrink:0; }
.ndm-badge-pill { font-size:1.2rem; cursor:default; }
.ndm-portfolio-row { display:flex; justify-content:space-between; align-items:center; padding:10px 0; border-bottom:1px solid var(--nd-border); }
.ndm-portfolio-row:last-child { border-bottom:none; }
.ndm-order-row { display:flex; align-items:center; padding:8px 0; border-bottom:1px solid var(--nd-border); font-size:.82rem; }
.ndm-order-row:last-child { border-bottom:none; }
.ndm-buy-lbl { color:var(--nd-green); font-weight:700; font-size:.75rem; }
.ndm-sell-lbl { color:var(--nd-red); font-weight:700; font-size:.75rem; }
.ndm-mm-pane { }

/* ---- UI UPGRADE: Tabla de subastas ---- */
.ndm-auc-table { width:100%; border-collapse:collapse; font-size:.85rem; }
.ndm-auc-th { padding:10px 12px; text-align:left; font-size:.75rem; font-weight:700; color:var(--nd-text2); letter-spacing:.5px; text-transform:uppercase; border-bottom:2px solid var(--nd-border); white-space:nowrap; }
.ndm-auc-td { padding:12px; border-bottom:1px solid var(--nd-border); vertical-align:middle; }
.ndm-auc-row:hover td { background:rgba(201,168,76,.04); }
.ndm-auc-row:last-child td { border-bottom:none; }
@media(max-width:600px){ .ndm-auc-th:nth-child(3),.ndm-auc-td:nth-child(3){display:none} }

/* ---- Tooltips educativos ---- */
.ndm-edu-tooltip { position:absolute; background:linear-gradient(135deg,#0f172a,#1e2d45); color:var(--nd-text1); font-size:.78rem; padding:10px 14px; border-radius:9px; max-width:280px; text-align:left; z-index:99999; pointer-events:none; border:1px solid var(--nd-gold1); box-shadow:0 6px 20px rgba(0,0,0,.6),0 0 12px rgba(201,168,76,.15); display:none; line-height:1.5; }
.ndm-help-icon { font-style:normal; cursor:help; font-size:.8rem; opacity:.8; }

/* ---- Toggle switch ---- */
.ndm-toggle { position:relative; display:inline-block; width:44px; height:24px; cursor:pointer; }
.ndm-toggle input { opacity:0; width:0; height:0; }
.ndm-toggle-slider { position:absolute; inset:0; background:var(--nd-border); border-radius:12px; transition:.3s; }
.ndm-toggle-slider::before { content:''; position:absolute; height:18px; width:18px; left:3px; bottom:3px; background:#fff; border-radius:50%; transition:.3s; }
.ndm-toggle input:checked + .ndm-toggle-slider { background:var(--nd-gold1); }
.ndm-toggle input:checked + .ndm-toggle-slider::before { transform:translateX(20px); }

/* ---- Alert manager overlay ---- */
#ndmAlertManagerOverlay { position:fixed; inset:0; background:rgba(0,0,0,.75); z-index:9500; display:flex; align-items:flex-start; justify-content:center; padding:20px; overflow-y:auto; }
.ndm-alert-manager-modal { background:var(--nd-bg2); border:1px solid var(--nd-border); border-radius:14px; width:100%; max-width:750px; padding:24px; position:relative; margin:auto; box-shadow:0 20px 60px rgba(0,0,0,.7); animation:ndmModalIn .25s ease; }
.ndm-alert-row td { font-size:.82rem; }

/* ---- AI Investment overlay ---- */
#ndmAIOverlay { position:fixed; inset:0; background:rgba(0,0,0,.8); z-index:9500; display:flex; align-items:flex-start; justify-content:center; padding:20px; overflow-y:auto; }
.ndm-ai-modal { background:var(--nd-bg2); border:1px solid var(--nd-gold1); border-radius:14px; width:100%; max-width:780px; padding:24px; position:relative; margin:auto; box-shadow:0 20px 60px rgba(0,0,0,.8),0 0 40px rgba(201,168,76,.1); animation:ndmModalIn .3s ease; }
.ndm-ai-card { background:var(--nd-bg1); border:1px solid var(--nd-border); border-radius:10px; padding:16px; margin-bottom:14px; transition:box-shadow .2s; }
.ndm-ai-card:hover { box-shadow:0 4px 20px rgba(0,0,0,.4); }
.ndm-ai-step { font-size:.8rem; color:var(--nd-text2); padding:4px 0; animation:ndmSlide .3s ease; }
.ndm-ai-step::before { content:'✓ '; color:var(--nd-gold1); }
.ndm-ai-pulse { font-size:2.5rem; animation:ndmPulse 1s infinite; display:inline-block; }
.ndm-ai-pane { }

/* ---- SWITCH MODO SIMPLE/AVANZADO MEJORADO ---- */
#ndViewModeSwitchWrap {
    transition: border-color .3s;
    cursor: default;
}
#ndViewModeSwitchWrap:hover {
    border-color: var(--nd-gold1);
}
body.nd-mode-simple #ndViewModeSwitchWrap {
    border-color: rgba(34,197,94,.4);
}
body.nd-mode-advanced #ndViewModeSwitchWrap {
    border-color: rgba(6,182,212,.4);
}
/* Indicador visual de modo activo en el header */
.ndm-mode-indicator {
    font-size:.7rem;
    padding:2px 8px;
    border-radius:10px;
    font-weight:700;
    letter-spacing:.3px;
}
body.nd-mode-simple .ndm-mode-indicator {
    background:rgba(34,197,94,.15);
    color:#22c55e;
}
body.nd-mode-advanced .ndm-mode-indicator {
    background:rgba(6,182,212,.15);
    color:var(--nd-cyan);
}
/* Highlight en modo avanzado para elementos que solo aparecen ahí */
body.nd-mode-advanced .nd-advanced-only {
    display:block;
    animation:ndmSlide .3s ease;
}

/* ---- FIX INPUTS VISIBLES EN MODALES ---- */
.ndm-input,
input[type="number"].ndm-input,
input[type="text"].ndm-input,
#bidAmount, #autobidMax,
#buyLimitPrice, #buyQty,
#sellLimitPrice, #sellQty,
#alertVal1, #alertVal2,
#div-capital, #div-yield, #div-maxper,
#rob-name, #rob-capital, #rob-yield, #rob-maxper,
#dca-name, #dca-amount, #dca-yield {
    background: #1e2d45 !important;
    border: 1.5px solid #C9A84C !important;
    color: #F1F5F9 !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    font-size: .92rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    outline: none !important;
}
.ndm-input:focus,
#bidAmount:focus, #autobidMax:focus,
#buyLimitPrice:focus, #buyQty:focus,
#sellLimitPrice:focus, #sellQty:focus {
    border-color: #F0C040 !important;
    box-shadow: 0 0 0 3px rgba(240,192,64,.2) !important;
}
.ndm-input::placeholder,
#bidAmount::placeholder, #autobidMax::placeholder {
    color: #94A3B8 !important;
    opacity: 1 !important;
}
.ndm-select,
select.ndm-select,
#buyExpire, #sellExpire,
#div-risk, #rob-mode, #rob-risk,
#dca-freq, #dca-strategy, #dca-risk {
    background: #1e2d45 !important;
    border: 1.5px solid #C9A84C !important;
    color: #F1F5F9 !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    font-size: .88rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    outline: none !important;
    cursor: pointer !important;
}
/* Inputs dentro de NdModal (robot, IA, alertas) */
#ndm-universal-overlay input[type="number"],
#ndm-universal-overlay input[type="text"],
#ndm-universal-overlay select {
    background: #1e2d45 !important;
    border: 1.5px solid #C9A84C !important;
    color: #F1F5F9 !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    font-size: .88rem !important;
    outline: none !important;
}
#ndm-universal-overlay input:focus,
#ndm-universal-overlay select:focus {
    border-color: #F0C040 !important;
    box-shadow: 0 0 0 3px rgba(240,192,64,.15) !important;
}
#ndm-universal-overlay input::placeholder {
    color: #64748b !important;
}

/* ---- ICONO ⓘ INLINE EN TEXTO ---- */
[data-tip] { position: relative; }
[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #0a0e1a;
    color: #F1F5F9;
    font-size: .76rem;
    font-weight: 400;
    padding: 10px 14px;
    border-radius: 9px;
    width: max-content;
    max-width: 280px;
    text-align: left;
    z-index: 99999;
    border: 1px solid #C9A84C;
    box-shadow: 0 6px 20px rgba(0,0,0,.7);
    line-height: 1.5;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
    white-space: normal;
}
[data-tip]:hover::after { opacity: 1; }
[data-tip-right]::after { left: 0; transform: none; }
[data-tip-left]::after { left: auto; right: 0; transform: none; }

/* ---- BARRA DE ACCIONES - Responsive ---- */
#nd-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
#nd-action-bar button {
    font-size: .78rem;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    transition: all .2s;
    white-space: nowrap;
}
/* Ajuste en tablet */
@media (max-width: 768px) {
    #nd-action-bar button {
        font-size: .72rem;
        padding: 6px 10px;
    }
}
/* Móvil: grid de 2 columnas */
@media (max-width: 480px) {
    #nd-action-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    #nd-action-bar button {
        font-size: .75rem;
        padding: 8px 10px;
        justify-content: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ============================================
   RESPONSIVE MÓVIL - CORRECCIONES COMPLETAS
   ============================================ */

/* ---- BARRA DE ACCIONES - MÓVIL ---- */
#nd-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    width: 100%;
    box-sizing: border-box;
}
#nd-action-bar button {
    font-size: .75rem;
    padding: 7px 11px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    transition: all .2s;
    white-space: nowrap;
    flex-shrink: 0;
}
@media (max-width: 640px) {
    #nd-action-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    #nd-action-bar button {
        font-size: .72rem;
        padding: 8px 6px;
        justify-content: center;
        text-align: center;
        white-space: normal;
        line-height: 1.2;
    }
}

/* ---- HERO STATS - MÓVIL ---- */
.ndm-hero {
    flex-wrap: wrap;
}
.ndm-hero-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}
.ndm-stat-box {
    min-width: 80px;
    flex: 1;
}
@media (max-width: 480px) {
    .ndm-hero-left h1 { font-size: 1.2rem; }
    .ndm-hero-stats { gap: 6px; }
    .ndm-stat-box { min-width: 70px; padding: 8px 10px; }
    .ndm-stat-val { font-size: .95rem; }
}

/* ---- SWITCH MODO - MÓVIL ---- */
#nd-mode-bar {
    flex-wrap: wrap;
    width: fit-content;
    max-width: 100%;
}

/* ---- FILTROS - MÓVIL ---- */
.ndm-controls {
    flex-wrap: wrap;
}
.ndm-filters-wrap {
    overflow-x: auto;
    flex-wrap: nowrap;
    max-width: 100%;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.ndm-filters-wrap::-webkit-scrollbar { display: none; }
.ndm-search-wrap {
    min-width: 180px;
}
@media (max-width: 480px) {
    .ndm-sort-wrap { width: 100%; }
    .ndm-sort-wrap select { width: 100%; }
}

/* ---- GRID PROPIEDADES - MÓVIL ---- */
@media (max-width: 480px) {
    .ndm-grid {
        grid-template-columns: 1fr;
    }
    .ndm-main {
        grid-template-columns: 1fr;
    }
}

/* ---- MODALES - MÓVIL ---- */
.ndm-modal,
.ndm-mymarket-modal,
.ndm-alert-manager-modal,
.ndm-ai-modal,
.nd-analytics-modal,
.nd-expl-box {
    max-width: 100% !important;
    margin: 10px !important;
    padding: 16px !important;
}
.nd-analytics-grid {
    grid-template-columns: repeat(2,1fr) !important;
}
@media (max-width: 480px) {
    .nd-analytics-grid { grid-template-columns: 1fr 1fr !important; }
    .nd-ch-row { grid-template-columns: 1fr !important; }
    .nd-ch-row2 { grid-template-columns: 1fr !important; }
    .ndm-prop-detail-header { flex-direction: column; }
    .ndm-prop-detail-grid { grid-template-columns: 1fr !important; }
}

/* ---- TABLA SUBASTAS - MÓVIL ---- */
@media (max-width: 600px) {
    .ndm-auc-th:nth-child(3),
    .ndm-auc-td:nth-child(3),
    .ndm-auc-th:nth-child(5),
    .ndm-auc-td:nth-child(5) { display: none; }
}

/* ---- FAB GUÍA TOUR - MÓVIL ---- */
@media (max-width: 480px) {
    #nd-tour-fab {
        bottom: 80px;
        right: 10px;
        padding: 8px 12px;
        font-size: .75rem;
    }
}

/* ---- MESA DE OFERTAS - MÓVIL ---- */
@media (max-width: 480px) {
    .nd-expl-cols { grid-template-columns: 1fr !important; }
    .ndm-auc-th:nth-child(4),
    .ndm-auc-td:nth-child(4) { display: none; }
}

/* ---- PREVENT OVERFLOW GLOBAL ---- */
.ndm-wrap, .ndm-widget, .nd-action-bar {
    max-width: 100%;
    box-sizing: border-box;
}
* { box-sizing: border-box; }
