/* ================================================================
   WIN-TEL GEOMATICS PRO v31 — estilos-wintel.css
   Stylesheet reconstruido por auditoría modular v31
   ================================================================ */

/* ── VARIABLES CSS ─────────────────────────────────────────────── */
:root {
  --primary: #10b981;
  --primary-dk: #059669;
  --secondary: #34d399;
  --cyan: #06b6d4;
  --warning: #f59e0b;
  --danger: #f43f5e;
  --success: #10b981;
  --purple: #a855f7;
  --pink: #ec4899;
  --bg-main: #080f0e;
  --bg-panel: #0d1a18;
  --bg-card: #112420;
  --bg-glass: rgba(17,36,32,0.8);
  --bg-input: #071210;
  --border: rgba(16,185,129,.15);
  --text-1: #ecfdf5;
  --text-2: #6ee7b7;
  --text-3: #34d399;
  --text-dim: #065f46;
}

/* ── RESET & BASE ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-main); overflow: hidden; color: var(--text-1); }
input, select, button, textarea { font-family: inherit; }
a { color: inherit; }
.hidden { display: none !important; }

/* ── LAYOUT ─────────────────────────────────────────────────────── */
.app { display: flex; height: 100vh; }
.map-wrap { flex: 1; position: relative; }
#map { height: 100%; width: 100%; }

/* ── SIDEBAR ────────────────────────────────────────────────────── */
.sidebar {
  width: 56px;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  z-index: 3000;
  overflow-y: auto;
  overflow-x: hidden;
}
.logo {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  transition: background var(--transition);
}
.logo:hover { background: var(--bg-card); }
.nav { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 8px 0; }
.nav-group { display: flex; flex-direction: column; gap: 2px; padding: 4px 0;
  border-bottom: 1px solid var(--border); }
.nav-group:last-child { border-bottom: none; }
.nav-item {
  width: 40px; height: 40px; margin: 0 auto;
  background: transparent; border: none; border-radius: 8px;
  color: var(--text-2); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  position: relative;
}
.nav-item:hover { background: var(--bg-card); color: var(--text-1); box-shadow: 0 0 0 1px var(--border); }
.nav-item.active { background: rgba(16,211,147,0.15); color: var(--primary); }
.nav-item[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; left: 56px; top: 50%; transform: translateY(-50%);
  background: #0f1623; color: #fff; font-size: 11px; white-space: nowrap;
  padding: 4px 10px; border-radius: 6px; z-index: 9999; pointer-events: none;
  border: 1px solid var(--border);
}

/* ── PANELS ─────────────────────────────────────────────────────── */
.panel {
  position: fixed; top: 0; left: 56px; width: 300px; height: 100%;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  z-index: 2500; display: none;
  flex-direction: column;
  box-shadow: var(--shadow);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}
.panel.active { display: flex; transform: translateX(0); }
.panel-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card); flex-shrink: 0;
}
.panel-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.panel-close {
  background: none; border: none; color: var(--text-3); cursor: pointer;
  width: 28px; height: 28px; border-radius: 6px; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.panel-close:hover { background: var(--danger); color: #fff; }
.panel-body { flex: 1; overflow-y: auto; padding: 14px; }

/* ── TOAST ──────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--bg-card); color: var(--text-1); padding: 12px 20px;
  border-radius: 10px; border: 1px solid var(--border); z-index: 99000;
  display: flex; align-items: center; gap: 10px; font-size: 13px;
  box-shadow: var(--shadow); transition: transform 0.3s ease, opacity 0.3s ease;
  min-width: 200px; max-width: 400px;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--success); }
.toast.success i { color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.error i { color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast.warning i { color: var(--warning); }
.toast.info { border-color: var(--cyan); }
.toast.info i { color: var(--cyan); }
#toast-msg { flex: 1; }

/* ── LOADING ────────────────────────────────────────────────────── */
.loading {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10,15,28,.85); display: none; align-items: center;
  justify-content: center; z-index: 10000; flex-direction: column; gap: 16px;
}
.loading.show { display: flex; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── QUICK TOOLS BAR ────────────────────────────────────────────── */
.quick-tools {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 4px; flex-wrap: wrap; justify-content: center;
  background: var(--bg-card); border: 1px solid rgba(148,163,184,.30);
  border-radius: 14px; padding: 6px; z-index: 2000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  max-width: calc(100vw - 80px); box-shadow: var(--shadow);
}
.quick-btn {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-1); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.quick-btn:hover { background: var(--bg-glass); color: var(--text-1); transform: translateY(-2px); }

/* ── COORDINATES DISPLAY ────────────────────────────────────────── */
.coords-disp {
  position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%);
  background: var(--bg-panel); color: var(--text-2);
  font-size: 11px; font-family: monospace; padding: 4px 12px;
  border-radius: 20px; border: 1px solid var(--border); z-index: 1500;
  pointer-events: none;
}

/* ── UNDO/REDO ──────────────────────────────────────────────────── */
.undo-redo {
  position: fixed; top: 12px; right: 16px; display: flex; gap: 4px; z-index: 2000;
}
.undo-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-panel); color: var(--text-2); cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.undo-btn:not(:disabled):hover { background: var(--primary); color: #fff; }
.undo-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── FORMS ──────────────────────────────────────────────────────── */
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 11px; color: var(--text-2);
  font-weight: 600; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-1); padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 12px; transition: border-color var(--transition); outline: none;
}
.form-input:focus { border-color: var(--primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.range { width: 100%; accent-color: var(--primary); cursor: pointer; }
.range-grp { display: flex; gap: 8px; align-items: center; }
.range-val { width: 60px; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-1); padding: 6px 8px; border-radius: var(--radius-sm);
  font-size: 12px; text-align: center; outline: none; }
.section-lbl { font-size: 10px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 1px; margin: 12px 0 6px; }

/* ── BUTTONS ────────────────────────────────────────────────────── */
.btn {
  width: 100%; padding: 10px; border: none; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-dk));
  color: #fff; font-size: 12px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  text-transform: uppercase; letter-spacing: 0.5px; transition: all var(--transition);
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-2 { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-1); }
.btn-2:hover { background: var(--bg-glass); border-color: var(--primary); }
.btn-danger { background: linear-gradient(135deg, var(--danger), #b91c1c); }
.btn-warning { background: linear-gradient(135deg, var(--warning), #d97706); }
.btn-cyan { background: linear-gradient(135deg, var(--cyan), #0891b2); }
.btn-accent { background: linear-gradient(135deg, var(--secondary), #7c3aed); }
.btn-purple { background: linear-gradient(135deg, var(--purple), #7e22ce); }

/* ── TOOL BUTTONS ───────────────────────────────────────────────── */
.toolbar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 12px; }
.tool-btn {
  aspect-ratio: 1; background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-2); border-radius: 8px; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); position: relative;
}
.tool-btn:hover { background: rgba(16,211,147,0.15); color: var(--primary);
  border-color: var(--primary); }

/* ── TABS ───────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; margin-bottom: 12px; overflow-x: auto; flex-wrap: nowrap; }
.tab {
  padding: 6px 10px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-2); font-size: 10px; cursor: pointer;
  white-space: nowrap; font-weight: 600; transition: all var(--transition); flex-shrink: 0;
}
.tab.active { background: rgba(16,211,147,0.2); color: var(--primary); border-color: var(--primary); }
.tab:hover { background: var(--bg-glass); color: var(--text-1); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── TOGGLE SWITCH ──────────────────────────────────────────────── */
.toggle-row { display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border); }
.toggle-lbl { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-2); }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-input); border-radius: 20px; transition: var(--transition);
  border: 1px solid var(--border); }
.slider:before { content:''; position: absolute; height: 14px; width: 14px; left: 2px; bottom: 2px;
  background: var(--text-3); border-radius: 50%; transition: var(--transition); }
input:checked + .slider { background: rgba(16,211,147,0.3); border-color: var(--primary); }
input:checked + .slider:before { transform: translateX(16px); background: var(--primary); }

/* ── STATS WIDGET ───────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px; text-align: center; }
.stat-val { font-size: 20px; font-weight: 800; color: var(--primary); font-family: monospace; }
.stat-lbl { font-size: 9px; color: var(--text-3); text-transform: uppercase; margin-top: 2px; }

/* ── DATA TABLE ─────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th { background: var(--bg-card); padding: 8px 10px; text-align: left;
  font-size: 10px; color: var(--text-2); text-transform: uppercase;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1; }
.data-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text-1); }
.data-table tr:hover td { background: var(--bg-card); }

/* ── EXPORT GRID ────────────────────────────────────────────────── */
.export-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

/* ── FLOAT PANEL (dynamic) ──────────────────────────────────────── */
.float-panel {
  position: fixed; background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 12px; z-index: 2800; box-shadow: var(--shadow);
  max-height: 85vh; overflow-y: auto;
}

/* ── DEMO OVERLAY ───────────────────────────────────────────────── */
.demo-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(10,15,28,0.85); z-index: 9000;
  display: none; align-items: center; justify-content: center;
}
.demo-overlay.active { display: flex; }
.demo-card { background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; max-width: 480px; width: 90%; box-shadow: var(--shadow); }
.demo-card h2 { font-size: 18px; margin-bottom: 8px; }
.demo-card p { font-size: 12px; color: var(--text-2); margin-bottom: 20px; }
.demo-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.demo-option {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; transition: all var(--transition);
  font-size: 12px; font-weight: 600;
}
.demo-option small { font-size: 10px; color: var(--text-3); font-weight: 400; }
.demo-option:hover { border-color: var(--primary); background: rgba(16,211,147,0.1); }
.demo-option i { font-size: 24px; }

/* ── WIZARD OVERLAY ─────────────────────────────────────────────── */
.wizard-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(10,15,28,0.9); z-index: 50000;
  display: none; align-items: center; justify-content: center;
}
.wizard-overlay.active { display: flex; }
.wizard-card { background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 20px; padding: 36px; max-width: 440px; width: 90%;
  text-align: center; box-shadow: var(--shadow); }
.wizard-icon { font-size: 40px; margin-bottom: 16px; color: var(--primary); }
.wizard-card h2 { font-size: 22px; margin-bottom: 10px; }
.wizard-card p { font-size: 13px; color: var(--text-2); margin-bottom: 20px; line-height: 1.6; }
.wizard-question { font-size: 14px; font-weight: 700; margin-bottom: 16px; }
.wizard-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.wizard-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; transition: all var(--transition); font-size: 12px;
}
.wizard-opt:hover { border-color: var(--primary); }
.wizard-opt strong { font-size: 13px; }
.wizard-opt span { font-size: 10px; color: var(--text-3); }
.wizard-skip { background: none; border: none; color: var(--text-3);
  font-size: 12px; cursor: pointer; text-decoration: underline; }

/* ── FUSION BAR ─────────────────────────────────────────────────── */
.fusion-bar { display: none; background: rgba(16,211,147,0.1);
  border: 1px solid var(--primary); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.fusion-bar.active { display: block; }
.fusion-count { font-size: 28px; font-weight: 800; color: var(--primary); }

/* ── POTREROS SYSTEM ────────────────────────────────────────────── */
.potreros-panel {
  position: fixed; top: 80px; left: 68px; width: 240px;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 12px; z-index: 2200; box-shadow: var(--shadow);
  display: none;
}
.potreros-panel.active { display: block; }
.potreros-header { display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  cursor: pointer; border-bottom: 1px solid var(--border); }
.potreros-header-icon { color: var(--primary); font-size: 16px; }
.potreros-header-info h3 { font-size: 12px; font-weight: 700; }
.potreros-header-info span { font-size: 10px; color: var(--text-3); }
.potreros-collapse-icon { margin-left: auto; font-size: 12px; color: var(--text-3);
  transition: transform var(--transition); }
.potreros-content { overflow: hidden; }
.potreros-body { max-height: 200px; overflow-y: auto; padding: 8px; }
.potreros-footer { padding: 8px; border-top: 1px solid var(--border); }
.potreros-add-btn { width: 100%; padding: 8px; background: rgba(16,211,147,0.15);
  border: 1px dashed var(--primary); color: var(--primary); border-radius: 6px;
  font-size: 11px; cursor: pointer; font-weight: 600; }
.potreros-add-btn:hover { background: rgba(16,211,147,0.25); }
.active-potrero-badge {
  position: fixed; top: 16px; left: 68px; display: none; align-items: center;
  gap: 8px; background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 12px; z-index: 2100; font-size: 11px;
  box-shadow: var(--shadow);
}
.active-potrero-badge.active { display: flex; }
.potrero-color { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.potrero-modal {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(10,15,28,0.8); z-index: 8000; display: none;
  align-items: center; justify-content: center;
}
.potrero-modal.active { display: flex; }
.potrero-modal-card { background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px; width: 320px; box-shadow: var(--shadow); }
.potrero-modal-title { display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; margin-bottom: 20px; }
.potrero-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.potrero-colors div { width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 3px solid transparent; transition: all var(--transition); }
.potrero-colors div.selected { border-color: #fff; transform: scale(1.1); }

/* ── LINE ELEVATION PROFILE ─────────────────────────────────────── */
.line-profile-panel {
  position: fixed; bottom: 0; left: 56px; right: 0;
  height: 280px; background: var(--bg-panel);
  border-top: 1px solid var(--border); z-index: 2700;
  display: none; flex-direction: column; box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
}
.line-profile-panel.active { display: flex; }
.line-profile-header { display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  border-bottom: 1px solid var(--border); background: var(--bg-card); flex-shrink: 0; }
.line-profile-title { font-size: 12px; font-weight: 700; flex: 1; }
.line-profile-stats { display: flex; gap: 10px; }
.line-profile-stat { text-align: center; }
.line-profile-stat-value { font-size: 13px; font-weight: 700; color: var(--primary); }
.line-profile-stat-label { font-size: 9px; color: var(--text-3); }
.line-profile-actions { display: flex; gap: 4px; }
.line-profile-btn { padding: 5px 10px; border: none; border-radius: 5px;
  font-size: 10px; font-weight: 600; cursor: pointer; display: flex;
  align-items: center; gap: 4px; }
.line-profile-btn-primary { background: var(--primary); color: #fff; }
.line-profile-btn-secondary { background: var(--bg-card); color: var(--text-1);
  border: 1px solid var(--border); }
.line-profile-btn-close { background: var(--danger); color: #fff; }
.line-profile-body { display: flex; flex: 1; overflow: hidden; }
.line-profile-chart-container { flex: 1; position: relative; overflow: hidden; }
.line-profile-chart { width: 100%; height: 100%; }
.line-profile-cursor { position: absolute; top: 0; width: 1px; background: rgba(139,92,246,0.6);
  pointer-events: none; display: none; height: 100%; }
.line-profile-cursor-dot { position: absolute; bottom: 0; width: 8px; height: 8px;
  border-radius: 50%; background: var(--secondary); transform: translateX(-50%); }
.line-profile-tooltip { position: absolute; top: 8px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px; font-size: 11px;
  min-width: 140px; z-index: 10; display: none; pointer-events: none; }
.line-profile-tooltip-elev { font-size: 16px; font-weight: 800; color: var(--primary); }
.line-profile-tooltip-dist, .line-profile-tooltip-grade { font-size: 10px; color: var(--text-2); }
.line-profile-info-panel { width: 160px; flex-shrink: 0; padding: 8px; overflow-y: auto;
  border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.line-profile-info-card { background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px; }
.line-profile-info-title { font-size: 10px; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; margin-bottom: 6px; }
.line-profile-info-row { display: flex; justify-content: space-between; margin-bottom: 3px; }
.line-profile-info-label { font-size: 10px; color: var(--text-3); }
.line-profile-info-value { font-size: 10px; font-weight: 600; color: var(--text-1);
  font-family: monospace; }
.line-profile-info-value.positive { color: var(--success); }
.line-profile-info-value.negative { color: var(--danger); }
.line-draw-indicator {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg,#8b5cf6,#7c3aed); color: #fff;
  padding: 8px 20px; border-radius: 20px; font-size: 12px; font-weight: 700;
  z-index: 3000; box-shadow: 0 4px 20px rgba(139,92,246,0.4); display: none;
}

/* ── BISECT MODE PANEL ──────────────────────────────────────────── */
.bisect-mode-panel {
  position: fixed; bottom: 80px; right: 16px; width: 220px;
  background: var(--bg-panel); border: 1px solid var(--secondary);
  border-radius: 10px; padding: 12px; z-index: 2600;
  font-size: 11px; box-shadow: 0 4px 20px rgba(139,92,246,0.3); display: none;
}
.bisect-mode-panel.active { display: block; }

/* ── FLOATING PANEL (generic) ───────────────────────────────────── */
.floating-panel { position: fixed; z-index: 2500; }

/* ── SCROLLBARS ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-card); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── LEAFLET OVERRIDES ──────────────────────────────────────────── */
.leaflet-control-attribution { display: none !important; }
.leaflet-popup-content-wrapper { background: var(--bg-card); color: var(--text-1);
  border: 1px solid var(--border); box-shadow: var(--shadow); }
.leaflet-popup-tip { background: var(--bg-card); }
.dist-label { background: rgba(10,15,28,0.85) !important; border: 1px solid var(--border) !important;
  color: var(--primary) !important; font-family: monospace !important; font-size: 11px !important; }

/* ── MISC ───────────────────────────────────────────────────────── */
.positive { color: var(--success) !important; }
.negative { color: var(--danger) !important; }

/* ── KEYFRAMES ──────────────────────────────────────────────────── */
@keyframes logoFloat { 0%,100%{transform:translateY(0) rotate(0)} 50%{transform:translateY(-20px) rotate(5deg)} }
@keyframes loadProgress { 0%{width:0} 100%{width:100%} }
@keyframes fadeIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .panel { width: 280px; }
  .quick-tools { bottom: 8px; padding: 4px; gap: 2px; }
  .quick-btn { width: 32px; height: 32px; font-size: 12px; }
  .line-profile-panel { height: 220px; }
  .line-profile-info-panel { display: none; }
}

/* ========================================================================
   PRV ADVANCED — Dashboard, Ruta Óptima, Simulador de Rotación
   WIN-TEL Geomatics PRO v31
   ======================================================================== */

/* ── PRV Dashboard ───────────────────────────────────────────────────────── */
.prv-dashboard {
  position: fixed;
  top: 60px;
  right: 20px;
  width: 360px;
  max-height: calc(100vh - 100px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
  z-index: 1500;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid #10b981;
}
.prv-dashboard.active {
  display: flex;
  animation: slideInDashboard 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes slideInDashboard {
  from { transform: translateX(100px) scale(0.9); opacity: 0; }
  to   { transform: translateX(0) scale(1); opacity: 1; }
}
.prv-dashboard-header {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.prv-dashboard-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.prv-dashboard-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 30px; height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}
.prv-dashboard-close:hover { background: rgba(255,255,255,0.35); }
.prv-dashboard-body { padding: 14px; overflow-y: auto; flex: 1; }

.prv-status-card {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid #a7f3d0;
}
.prv-status-card.warning {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-color: #fcd34d;
}
.prv-current-label { font-size: 10px; font-weight: 700; color: #065f46; text-transform: uppercase; margin-bottom: 4px; }
.prv-current-value { font-size: 22px; font-weight: 800; color: #047857; }

.prv-potrero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 7px;
  margin-top: 10px;
}
.prv-potrero-item {
  background: white;
  border-radius: 8px;
  padding: 7px;
  text-align: center;
  border: 2px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.prv-potrero-item:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.prv-potrero-item.active  { border-color: #10b981; background: #ecfdf5; }
.prv-potrero-item.resting { border-color: #3b82f6; background: #eff6ff; }
.prv-potrero-item.ready   { border-color: #22c55e; background: #f0fdf4; }
.prv-potrero-item.warning { border-color: #f59e0b; background: #fffbeb; }
.prv-potrero-name { font-size: 10px; font-weight: 700; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prv-potrero-days { font-size: 9px; color: #6b7280; margin-top: 2px; }
.prv-potrero-status {
  position: absolute;
  top: -4px; right: -4px;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid white;
}
.prv-potrero-status.active  { background: #10b981; }
.prv-potrero-status.resting { background: #3b82f6; }
.prv-potrero-status.ready   { background: #22c55e; animation: pulseReady 1.5s infinite; }
.prv-potrero-status.warning { background: #f59e0b; }
@keyframes pulseReady {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* ── Ruta Óptima ─────────────────────────────────────────────────────────── */
.route-marker {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  border-radius: 50%;
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

/* ── Simulation Overlay ──────────────────────────────────────────────────── */
.simulation-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.82);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.simulation-overlay.active { display: flex; }

.simulation-panel {
  background: white;
  border-radius: 20px;
  width: 92%;
  max-width: 920px;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}
.simulation-header {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.simulation-title { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.simulation-body {
  display: grid;
  grid-template-columns: 1fr 270px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.simulation-map-container { position: relative; background: #f1f5f9; overflow: hidden; }
.simulation-map { width: 100%; height: 100%; min-height: 380px; }
.simulation-controls {
  padding: 18px;
  background: #f9fafb;
  overflow-y: auto;
  border-left: 1px solid #e5e7eb;
}
.simulation-timeline {
  padding: 14px 22px;
  background: white;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.simulation-progress {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}
.simulation-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #3b82f6, #8b5cf6);
  border-radius: 4px;
  transition: width 0.25s ease;
}
.simulation-play-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
}
.sim-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sim-btn:hover { transform: scale(1.12); }
.sim-btn-play {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  width: 52px; height: 52px;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(16,185,129,0.35);
}
.sim-btn-secondary { background: #f3f4f6; color: #374151; }
.sim-btn-secondary:hover { background: #e5e7eb; }

/* ========================================================================
   COMPOSER PRO — Composición Profesional de Impresión
   ======================================================================== */
.composer-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(15, 23, 42, 0.96);
  z-index: 10000;
  display: none;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(6px);
}
.composer-overlay.active { display: flex; }

.composer-container {
  width: 96vw;
  height: 96vh;
  background: #1e293b;
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 275px 1fr 275px;
  grid-template-rows: 58px 1fr;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.composer-header {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #059669, #047857);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  color: white;
}
.composer-title { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.composer-actions { display: flex; gap: 10px; }
.composer-btn {
  padding: 9px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.composer-btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.composer-btn-primary { background: white; color: #059669; }
.composer-btn-secondary { background: rgba(255,255,255,0.18); color: white; }
.composer-btn-close {
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 17px;
  padding: 8px 14px;
}

.composer-sidebar {
  background: #0f172a;
  padding: 18px;
  overflow-y: auto;
  color: white;
}
.composer-sidebar::-webkit-scrollbar { width: 4px; }
.composer-sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }
.composer-sidebar h3 {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  margin: 18px 0 10px 0;
  letter-spacing: 0.6px;
}
.composer-sidebar h3:first-child { margin-top: 0; }
.composer-group { margin-bottom: 14px; }
.composer-input-group { margin-bottom: 10px; }
.composer-input-group label {
  display: block;
  font-size: 10px;
  color: #64748b;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.composer-select, .composer-input {
  width: 100%;
  padding: 9px 11px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 7px;
  color: white;
  font-size: 12px;
  transition: border-color 0.15s;
}
.composer-select:focus, .composer-input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16,185,129,0.2);
}
.composer-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  cursor: pointer;
  font-size: 12px;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(51,65,85,0.5);
}
.composer-checkbox:last-child { border-bottom: none; }
.composer-checkbox input { accent-color: #10b981; width: 14px; height: 14px; }
.composer-checkbox:hover { color: white; }

.composer-canvas-area {
  background: #334155;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: auto;
  position: relative;
  padding: 40px;
}
.composer-canvas-area::-webkit-scrollbar { width: 8px; height: 8px; }
.composer-canvas-area::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }

.composer-page {
  background: white;
  box-shadow: 0 12px 50px rgba(0,0,0,0.4);
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}
.composer-page-a4-h { width: 1122px; height: 793px; }
.composer-page-a4   { width: 793px;  height: 1122px; }
.composer-page-a3-h { width: 1587px; height: 1122px; }
.composer-page-a3   { width: 1122px; height: 1587px; }

.composer-zoom {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  padding: 7px 16px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.composer-zoom button {
  background: #334155;
  border: none;
  color: white;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.15s;
}
.composer-zoom button:hover { background: #475569; }
.composer-zoom span { color: #94a3b8; font-size: 12px; font-weight: 600; min-width: 38px; text-align: center; }

/* ── Layout elements ──────────────────────────────────────────────────────── */
.layout-map {
  position: absolute;
  border: 1.5px solid #0f172a;
  overflow: hidden;
  background: #f8fafc;
}
.layout-north-arrow { position: absolute; }
.layout-scale-bar {
  position: absolute;
  background: rgba(255,255,255,0.92);
  padding: 5px 9px;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  font-family: Arial, sans-serif;
}
.scale-bar-graphic {
  display: flex;
  height: 7px;
  border: 1.5px solid #0f172a;
  margin-bottom: 2px;
}
.scale-bar-segment { flex: 1; background: #0f172a; }
.scale-bar-segment:nth-child(even) { background: white; }

.layout-legend {
  position: absolute;
  background: rgba(255,255,255,0.95);
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 10px;
  font-size: 9px;
  font-family: Arial, sans-serif;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.layout-legend-title {
  font-weight: 700;
  font-size: 10px;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
}
.layout-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  font-size: 8.5px;
  color: #374151;
}
.layout-title-box {
  position: absolute;
  background: rgba(255,255,255,0.95);
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 10px;
  font-family: Arial, sans-serif;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.layout-table {
  position: absolute;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.layout-table table { width: 100%; border-collapse: collapse; font-size: 8.5px; font-family: Arial, sans-serif; }
.layout-table th, .layout-table td { padding: 3px 5px; border: 1px solid #e5e7eb; text-align: left; }
.layout-table th { background: #f1f5f9; font-weight: 700; color: #0f172a; font-size: 8px; text-transform: uppercase; }
.layout-table td { color: #374151; }

.cajetin-cell {
  border: 1px solid #0f172a;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  font-family: Arial, sans-serif;
}
.cajetin-header {
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  justify-content: center;
  color: #0f172a;
}
.cajetin-label { font-size: 7px; color: #64748b; text-transform: uppercase; font-weight: 700; margin-bottom: 1px; }
.cajetin-value { font-size: 9px; font-weight: 600; color: #0f172a; }




/* ═══════════════════════════════════════════════════════════
   WIN-TEL ADDITIONS — Classes not in  base CSS
═══════════════════════════════════════════════════════════ */

/* Potrero items in list */
.potrero-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent;
  transition: all var(--transition); margin-bottom: 4px;
}
.potrero-item:hover { background: var(--bg-card); border-color: var(--border); }
.potrero-item.active { background: rgba(16,211,147,0.1); border-color: var(--primary); }
.potrero-color { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.potrero-info { flex: 1; min-width: 0; }
.potrero-name { font-size: 12px; font-weight: 600; color: var(--text-1); 
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.potrero-meta { font-size: 10px; color: var(--text-3); margin-top: 2px; display: flex; gap: 8px; }
.potrero-actions { display: none; gap: 2px; }
.potrero-item:hover .potrero-actions,
.potrero-item.active .potrero-actions { display: flex; }
.potrero-action {
  width: 24px; height: 24px; border-radius: 4px; border: 1px solid var(--border);
  background: var(--bg-panel); color: var(--text-3); font-size: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.potrero-action:hover { background: var(--bg-card); color: var(--text-1); }
.potrero-action.delete:hover { background: var(--danger); color: white; border-color: var(--danger); }

/* Tree Counter Panel */
.tree-counter-panel {
  position: fixed; top: 70px; right: 70px; width: 280px;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); z-index: 1800; box-shadow: var(--shadow);
  display: none;
}
.tree-counter-panel.active { display: flex; flex-direction: column; }

/* Composer Pro */
.composer-pro {
  position: fixed; top: 0; right: 0; width: 360px; height: 100vh;
  background: var(--bg-panel); border-left: 1px solid var(--border);
  z-index: 2500; display: none; flex-direction: column;
}
.composer-pro.active { display: flex; }

/* Digital Twin */
.digital-twin-panel {
  position: fixed; top: 70px; left: 70px; width: 320px;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); z-index: 1800; box-shadow: var(--shadow);
  display: none;
}
.digital-twin-panel.active { display: flex; flex-direction: column; }

/* Tooltip potrero */
.potrero-tooltip {
  background: var(--bg-card) !important; color: var(--text-1) !important;
  border: 1px solid var(--primary) !important; font-size: 11px !important;
  font-weight: 600 !important; border-radius: 6px !important;
  padding: 4px 8px !important;
}

/* Nav item tooltip — positioned to right of sidebar */
.nav-item[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; left: 52px; top: 50%; transform: translateY(-50%);
  background: var(--bg-card); color: var(--text-1); font-size: 11px;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap;
  border: 1px solid var(--border); z-index: 9999;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* ── RIGHT SIDE BUTTON FIXES — ensure all quick-btns are visible ── */
.quick-btn:not([style]) {
  color: var(--text-1) !important;
}

/* Undo/Redo enhanced */
.undo-btn:not(:disabled) {
  color: var(--text-1);
}
.undo-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.undo-btn:not(:disabled):hover {
  background: rgba(16,211,147,0.15);
  color: var(--primary);
  border-color: var(--primary);
}

/* Quick-btn tooltip via title attribute — add visual indicator */
.quick-btn:hover {
  background: var(--bg-glass);
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  border-color: rgba(148,163,184,.35);
}

/* Ensure colored inline-styled quick-btns override base color on hover */
.quick-btn[style*="color"]:hover {
  filter: brightness(1.3);
  transform: translateY(-2px);
}

/* Sidebar nav active indicator — stronger green glow */
.nav-item.active {
  background: rgba(16,211,147,0.15);
  color: var(--primary);
  box-shadow: inset 3px 0 0 var(--primary);
}

/* Sidebar nav group dividers */
.nav-group {
  display: flex; flex-direction: column; gap: 2px; padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.nav-group:last-child { border-bottom: none; }
