/* === estilos base (idÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ©nticos al monolÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ­tico) === */
:root {
  color-scheme: light;
  /* TipografÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ­a base */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, Arial, "Noto Sans", sans-serif;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --leading-tight: 1.25;
  --leading-normal: 1.5;

  /* Tokens visuales */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, .22);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, .28);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .32);
  --transition-base: 160ms ease;

  /* Colores (tema claro por defecto) */
  --bg: #f8fafc;               /* slate-50 */
  --surface: #ffffff;          /* cards/menus */
  --text: #0f172a;             /* slate-900 */
  --muted: #64748b;            /* slate-500 */
  --border: rgba(2, 6, 23, .10);
  --primary: #2563eb;          /* blue-600 */
  --primary-contrast: #ffffff;
  --surface-muted: color-mix(in srgb, var(--surface) 90%, rgba(15, 23, 42, .05));
  --surface-elevated: color-mix(in srgb, var(--surface) 85%, rgba(15, 23, 42, .15));
  --border-strong: color-mix(in srgb, var(--border) 50%, rgba(15, 23, 42, .35));
  
  /* Admin / Extra Variables */
  --surface-base: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border-dim: rgba(2, 6, 23, .10);
}

/* Modo oscuro (por data-theme) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0b;
  --surface: #111827;          /* gray-900 */
  --text: #f9fafb;             /* gray-50 */
  --muted: #9ca3af;            /* gray-400 */
  --border: rgba(255, 255, 255, .12);
  --primary: #3b82f6;          /* blue-500 */
  --primary-contrast: #0b1020;
  --surface-muted: color-mix(in srgb, var(--surface) 88%, #050505);
  --surface-elevated: color-mix(in srgb, var(--surface) 93%, #1f2933);
  --border-strong: color-mix(in srgb, var(--border) 45%, rgba(59, 130, 246, .4));
  
  /* Admin / Extra Variables */
  --surface-base: #0b1020;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --border-dim: rgba(255, 255, 255, .12);
}
html, body {
  height:100%; margin:0; overflow-x:hidden;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbars translúcidos */
*, *::before, *::after {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--primary, #3b82f6) 45%, rgba(148,163,184,.28)) transparent;
}
*::-webkit-scrollbar {
  width:8px;
  height:8px;
}
*::-webkit-scrollbar-track {
  background:transparent;
}
*::-webkit-scrollbar-thumb {
  background:linear-gradient(180deg,
    color-mix(in srgb, var(--primary, #3b82f6) 68%, rgba(255,255,255,.08)),
    color-mix(in srgb, var(--primary, #3b82f6) 35%, rgba(148,163,184,.32)));
  border-radius:999px;
  border:2px solid transparent;
  background-clip:padding-box;
  box-shadow:0 6px 14px rgba(15,23,42,.25);
}
*::-webkit-scrollbar-thumb:hover {
  background:linear-gradient(180deg,
    color-mix(in srgb, var(--primary, #3b82f6) 82%, rgba(255,255,255,.16)),
    color-mix(in srgb, var(--primary, #3b82f6) 48%, rgba(148,163,184,.38)));
}
*::-webkit-scrollbar-thumb:active {
  background:linear-gradient(180deg,
    color-mix(in srgb, var(--primary, #3b82f6) 90%, rgba(255,255,255,.18)),
    color-mix(in srgb, var(--primary, #3b82f6) 55%, rgba(148,163,184,.45)));
}

#map { height: 100dvh; width: 100vw; }
.leaflet-container { background: #b9d8e6; }
.leaflet-top{ top:1px; } .leaflet-right{ right:1px; } .leaflet-bottom{ bottom:1px; }

.leaflet-bar,
.leaflet-bar a {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}
.leaflet-bar a:hover,
.leaflet-bar a:focus {
  background: var(--surface-elevated);
  color: var(--primary);
  border-color: var(--border-strong);
}


/* Reusable chips for weather */
.chipwx{ display:inline-flex; align-items:center; gap:6px; border-radius:999px; padding:3px 8px; font-weight:700; font-size:12px; box-shadow:0 2px 8px rgba(0,0,0,.25); }
.chipwx--temp{ color:#111; border:1px solid rgba(0,0,0,.18); }
.chipwx--wind{ background:rgba(20,30,60,.85); color:#e5f3ff; border:1px solid rgba(255,255,255,.12); }
.chipwx--temp-popup{ background:#facc15; color:#111; border:1px solid rgba(0,0,0,.2); border-radius:12px; padding:2px 8px; font-weight:700; font-size:12px; }
.chipwx--sun{ background:rgba(0,0,0,.45); color:#fff; border:1px solid rgba(255,255,255,.12); border-radius:12px; padding:4px; font-weight:600; font-size:12px; line-height:1.4; display:flex; flex-direction:column; align-items:flex-start; gap:0; height:auto; }
.chipwx__arrow{ display:inline-block; margin-right:4px; }
.sunline{ display:flex; align-items:center; gap:4px; }
.sunline--mt{ margin-top:4px; }

/* Toasts */
.toasts{ position:fixed; bottom:12px; left:12px; z-index:3000; display:flex; flex-direction:column; gap:8px; }
.toast{ background:var(--surface); color:var(--text); border:1px solid var(--border); border-radius:12px; padding:8px 12px; box-shadow:var(--shadow-sm); transition:opacity .3s ease, transform .3s ease; }
.toast--out{ opacity:0; transform:translateY(6px); }

/* Media wrappers */
.media-wrap{ position:relative; }
.media-wrap--full .media-embed{ width:100%; height:auto; aspect-ratio:16/9; border:0; border-radius:18px; background:#000; display:block; }
.media-wrap--thumb .media-embed{ width:160px; height:90px; object-fit:cover; border-radius:8px; background:#000; display:block; border:0; }
.media-wrap--video .media-embed{ object-fit:contain; }
.media-play-indicator{ position:absolute; inset:0; border:0; cursor:pointer; display:flex; align-items:center; justify-content:center; border-radius:inherit; background:radial-gradient(rgba(0,0,0,.45), rgba(0,0,0,.15)); }
/* Encabezados mÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¡s claros */
h1, h2, h3 {
  line-height: var(--leading-tight);
  margin: 0 0 .5rem;
  font-weight: 700;
}
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

/* Formularios */
label { font-size: var(--text-sm); font-weight: 500; color: var(--text); }
.form-row { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.form-row.inline { flex-direction: row; gap: 12px; align-items: center; }
.modal-card form {
  width: 100%;
  box-sizing: border-box;
}
.modal-card form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 0 8px;
  box-sizing: border-box;
}
.modal-card form label input {
  width: 100%;
  box-sizing: border-box;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
select,
textarea,
.input {
  appearance: none;
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .55rem .75rem;
  font-size: var(--text-sm);
  font-family: inherit;
  transition: border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
}
select {
  padding-right: 2.2rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 50%, calc(100% - .65rem) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
textarea { min-height: 120px; resize: vertical; }

input::placeholder,
textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.input:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--primary) 70%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
  background: var(--surface-elevated);
}
input:disabled,
select:disabled,
textarea:disabled,
.input:disabled { opacity: .55; cursor: not-allowed; }

.field-hint { font-size: var(--text-xs); color: var(--muted); margin-top: 4px; }
.form-error { font-size: var(--text-xs); color: #f87171; margin-top: 4px; }

/* Tarjetas y contenedores */
.card {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}
.card.compact { padding: .75rem; border-radius: var(--radius-md); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
  font-weight: 600;
  font-size: var(--text-md);
}
.card-title { font-size: var(--text-md); }
.card-subtitle { font-size: var(--text-xs); color: var(--muted); }
.card-actions { display: flex; gap: .5rem; margin-left: auto; }
#map { height: 100dvh; width: 100vw; }
.leaflet-container { background: #b9d8e6; }
.leaflet-top{ top:1px; } .leaflet-right{ right:1px; } .leaflet-bottom{ bottom:1px; }

/* Perfil */
.leaflet-control.userctl { position: relative; }
.userctl .btn-usr{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:42px;
  height:42px;
  border-radius:999px;
  border:1px solid var(--border);
  background:color-mix(in srgb, var(--surface-elevated) 92%, transparent);
  color:#0f172a;
  text-decoration:none;
  box-shadow:var(--shadow-sm);
  transition:background var(--transition-base), transform var(--transition-base);
}

/* --- Responsivo avanzado para modales y popups --- */
:root{ --vh: 1vh; }
.modal-backdrop{ padding: clamp(8px,4vw,20px); }
.modal-card{
  box-sizing: border-box;
  width: min(96vw, 560px);
  max-width: 560px;
  max-height: min(calc(var(--vh)*92), 92vh);
  overflow: auto;
}
@media (max-width: 480px){
  .modal-card{ padding: 16px; border-radius: 10px; }
}
.leaflet-popup-content{
  max-width: min(96vw, 380px);
  max-height: min(calc(var(--vh)*80), 80vh);
  overflow: auto;
}
.leaflet-popup{ margin:0; }
.userctl .btn-usr::before{
  content:'';
  width:18px;
  height:18px;
  border-radius:999px;
  border:1.5px solid rgba(15,23,42,.2);
  background:linear-gradient(135deg,#ffffff,#e8ecf7);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%23000000' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12Zm0 2.4c-3.18 0-9.6 1.62-9.6 4.8V22h19.2v-2.76c0-3.18-6.42-4.8-9.6-4.8Z'/%3E%3C/svg%3E") center/70% no-repeat;
}
.userctl .btn-usr:hover{
  background:color-mix(in srgb, var(--surface-elevated) 86%, transparent);
  transform:translateY(-1px);
}
.userctl--logged .btn-usr{
  border-color:color-mix(in srgb, #22c55e 25%, var(--border));
  background:color-mix(in srgb, var(--surface-elevated) 92%, transparent);
}
.userctl--logged .btn-usr::before{
  border-color:rgba(34,197,94,.4);
  background:linear-gradient(135deg,#bbf7d0,#22c55e);
}
.userctl .dropdown {
  position:absolute; right:0; top:36px;
  background:var(--surface); color:var(--text);
  border:1px solid var(--border); border-radius:12px;
  box-shadow:0 12px 28px rgba(0,0,0,.28);
  padding:10px; min-width:200px; max-width:220px; z-index:1500; display:none;
  text-align:left;
}
.userctl .dropdown.dropdown--guest{
  min-width:150px;
  max-width:190px;
  padding:8px 10px;
  gap:4px;
}
.userctl .dropdown.dropdown--guest .head{ padding-bottom:6px; margin-bottom:6px; gap:8px; }
.userctl .dropdown.dropdown--auth{
  min-width:220px;
  max-width:260px;
  padding:10px 12px;
}
.userctl .dropdown .head{
  display:flex; align-items:center; gap:10px; padding-bottom:8px;
  border-bottom:1px solid var(--border); margin-bottom:8px;
}
.userctl .dropdown .avatar{
  width:30px; height:30px; border-radius:999px; display:grid; place-items:center;
  background:color-mix(in srgb, var(--primary) 12%, transparent); font-size:18px;
}
.userctl--logged .dropdown .avatar{
  background:linear-gradient(135deg,#d1fae5,#22c55e);
  color:#065f46;
}
.userctl .dropdown .uname{ font-weight:700; font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.userctl .dropdown .umail{ font-size:12px; opacity:.7; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.leaflet-control.userctl .dropdown a{
  width: 100% !important; height:auto !important; line-height: normal !important;
  background: transparent !important; border:0 !important; box-shadow:none !important;
  display:flex; align-items:center; gap:8px; justify-content:flex-start;
  padding:6px 6px; margin:0; color:inherit; text-decoration:none;
  border-radius:10px; font-size:14px;
  text-align:left;
}
.leaflet-control.userctl .dropdown a span{ display:inline-flex; gap:6px; align-items:center; }
.leaflet-control.userctl .dropdown a .menu-icon{
  width:22px;
  height:22px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  line-height:1;
}
.leaflet-control.userctl .dropdown a .menu-icon--fav{ color:#facc15; }
.leaflet-control.userctl .dropdown a:hover{
  background: color-mix(in srgb, var(--primary) 22%, transparent);
}
.userctl .dropdown .divider{
  height:1px; background:var(--border); margin:8px 0;
}

/* MenÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂº contextual */
.ctxmenu{
  position:fixed;
  left:0;
  top:0;
  display:none;
  z-index:2800;
  color:#f8fafc;
}
.ctxmenu[hidden]{ display:none; }
.ctxmenu__panel{
  min-width:260px;
  backdrop-filter:blur(18px) saturate(160%);
  -webkit-backdrop-filter:blur(18px) saturate(160%);
  background:rgba(15,23,42,.92);
  border-radius:18px;
  border:1px solid rgba(148,163,184,.28);
  box-shadow:0 24px 60px rgba(15,23,42,.55);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.ctxmenu__header{
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:18px 18px 14px;
  border-bottom:1px solid rgba(148,163,184,.18);
}
.ctxmenu__icon{
  width:42px;
  height:42px;
  border-radius:14px;
  display:grid;
  place-items:center;
  font-size:20px;
  font-weight:700;
  background:color-mix(in srgb, var(--primary, #3b82f6) 72%, rgba(255,255,255,.12));
  color:var(--primary-contrast, #0b1020);
  box-shadow:0 18px 40px color-mix(in srgb, var(--primary, #3b82f6) 35%, transparent);
}
.ctxmenu__titles{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.ctxmenu__eyebrow{
  margin:0;
  font-size:12px;
  letter-spacing:.22em;
  text-transform:uppercase;
  color:rgba(226,232,240,.66);
}
.ctxmenu__title{
  margin:0;
  font-size:16px;
  font-weight:600;
  color:#e2e8f0;
}
.ctxmenu__body{
  display:flex;
  flex-direction:column;
  padding:12px 18px 18px;
  gap:8px;
}
.ctxmenu__btn{
  appearance:none;
  border:0;
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-radius:14px;
  font-size:14px;
  font-weight:600;
  background:rgba(99,102,241,.16);
  color:#e2e8f0;
  cursor:pointer;
  transition:all 140ms ease;
  text-align:left;
}
.ctxmenu__btn:hover{
  background:color-mix(in srgb, var(--primary, #3b82f6) 26%, rgba(255,255,255,.12));
  color:#fff;
  transform:translateY(-1px);
}
.ctxmenu__btn:active{
  transform:translateY(0);
}
.ctxmenu__btn-icon{
  display:inline-flex;
  font-size:18px;
  line-height:1;
}


/* Toasts */
#toasts{ position: fixed; bottom: 12px; left: 12px; z-index: 3000; display:flex; flex-direction:column; gap: 8px; }
.toast{ background: #111; color:#fff; border-radius:12px; padding:10px 12px; box-shadow:0 6px 18px rgba(0,0,0,.35); font-size:14px; display:flex; align-items:center; gap:8px; }
.toast.success{ background:#166534; } .toast.info{ background:#1f2937; } .toast.error{ background:#7f1d1d; }

/* Modales */
.modal-backdrop[hidden]{ display:none; }
.modal-backdrop{ position:fixed; inset:0; z-index:2500; display:grid; place-items:center; background:rgba(0,0,0,.55); padding:16px; }
.modal-backdrop.ztop{ z-index:2600; }
.modal-card{ position:relative; background:var(--surface-elevated); color:var(--text); max-width:560px; width:100%; border-radius:12px; box-shadow:var(--shadow-lg); padding:18px; max-height:86vh; overflow-y:auto; overflow-x:hidden; width:min(92vw, 540px); border:1px solid var(--border); }
.modal-card input,
.modal-card select,
.modal-card textarea,
.modal-card .input,
.leaflet-popup-content input,
.leaflet-popup-content select,
.leaflet-popup-content textarea,
.leaflet-popup-content .input{
  border-radius:12px;
}
.modal-card button,
.leaflet-popup-content button{
  border-radius:12px;
}
.modal-card h2{ margin:0 0 8px; font-size:18px; }
.modal-card label{ display:block; margin-top:8px; font-size:14px; }
.modal-card input, .modal-card textarea, .modal-card select{ margin-top:6px; }
.modal-actions{ display:flex; gap:8px; justify-content:flex-end; margin-top:12px; }
.modal-card__close{
  position:absolute;
  top:10px;
  right:10px;
  width:28px;
  height:28px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--muted);
  display:grid;
  place-items:center;
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  transition:background var(--transition-base),color var(--transition-base),border-color var(--transition-base),transform var(--transition-base);
}
.modal-card__close:hover{
  background:color-mix(in srgb,var(--surface) 92%, var(--primary));
  color:var(--primary-contrast);
  border-color:var(--border-strong);
  transform:translateY(-1px);
}
.modal-card__close:focus-visible{ outline:2px solid var(--primary); outline-offset:2px; }
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card){
  position:relative;
  padding:28px 30px 26px;
  display:flex;
  flex-direction:column;
  gap:18px;
  background:rgba(15,23,42,.92);
  border:1px solid rgba(148,163,184,.26);
  border-radius:18px;
  box-shadow:0 28px 68px rgba(15,23,42,.55);
  backdrop-filter:blur(18px) saturate(140%);
  -webkit-backdrop-filter:blur(18px) saturate(140%);
  max-width:420px;
  width:min(92vw, 420px);
  animation:authModalFade 260ms ease forwards;
}
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card)::before{
  content:'';
  position:absolute;
  inset:0;
  border-radius:inherit;
  background:radial-gradient(circle at top right, rgba(99,102,241,.22), transparent 55%);
  pointer-events:none;
}
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) .modal-card__header{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:12px;
}
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) .modal-card__title{
  margin:0;
  font-size:22px;
  font-weight:700;
  letter-spacing:.02em;
  color:#f8fafc;
  line-height:1.3;
  font-family:"Poppins","Inter",system-ui;
}
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) .modal-card__subtitle{
  margin:0;
  font-size:15px;
  line-height:1.6;
  color:rgba(226,232,240,.78);
}
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) label{
  font-size:13px;
  font-weight:600;
  color:rgba(226,232,240,.78);
  letter-spacing:.01em;
  padding:0;
}
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) input,
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) select,
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) textarea{
  margin-top:6px;
  width:100%;
  border-radius:12px;
  border:1px solid rgba(148,163,184,.28);
  background:rgba(15,23,42,.65);
  color:#f8fafc;
  font-size:15px;
  line-height:1.5;
  padding:10px 14px;
  box-shadow:0 10px 26px rgba(15,23,42,.4);
  transition:border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
  appearance:none;
  box-sizing:border-box;
}
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) input::placeholder,
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) textarea::placeholder{
  color:rgba(148,163,184,.6);
}
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) input:focus,
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) textarea:focus,
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) select:focus{
  border-color:rgba(129,140,248,.6);
  box-shadow:0 16px 34px rgba(99,102,241,.38);
  outline:none;
  background:rgba(30,41,59,.85);
}
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) .modal-card__actions{
  display:flex;
  gap:12px;
  justify-content:flex-end;
  margin-top:16px;
  flex-wrap:wrap;
}
:is(.modal-card--auth-layer, #login-modal .modal-card) .modal-card__actions{
  /* Fuerza disposición en columna en login (desktop y móvil) */
  flex-wrap:nowrap;
  flex-direction:column;
  align-items:stretch;
}
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) .modal-card__actions .btn{
  min-width:140px;
  flex:0 0 auto;
}

/* Login: link + botones en líneas separadas */
#login-modal .modal-card .modal-card__link{ display:block; }
#login-modal .modal-card .modal-card__actions .btn{ width:100%; min-width:0; }
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) .btn{
  border-radius:12px;
  border:1px solid transparent;
  padding:10px 14px;
  min-height:44px;
  justify-content:center;
  font-size:14px;
  font-weight:600;
  transition:background 180ms ease, box-shadow 180ms ease, transform 160ms ease, border-color 180ms ease;
}
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) .btn:not(.tertiary){
  background:linear-gradient(135deg,#6366f1,#8b5cf6);
  border:1px solid rgba(129,140,248,.6);
  color:#f8fafc;
  box-shadow:0 18px 38px rgba(99,102,241,.45);
}
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) .btn:not(.tertiary):hover{
  transform:translateY(-2px);
  box-shadow:0 24px 44px rgba(99,102,241,.52);
}
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) .btn:not(.tertiary):active{
  transform:translateY(0);
  box-shadow:0 12px 24px rgba(99,102,241,.4);
}
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) .btn:not(.tertiary):focus-visible{
  outline:2px solid rgba(129,140,248,.8);
  outline-offset:2px;
}
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) .btn.tertiary{
  background:rgba(15,23,42,.6);
  border:1px solid rgba(148,163,184,.35);
  color:rgba(226,232,240,.85);
  box-shadow:0 12px 26px rgba(15,23,42,.45);
}
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) .btn.tertiary:hover{
  background:rgba(30,41,59,.78);
  border-color:rgba(148,163,184,.5);
  transform:translateY(-1px);
}
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) .btn.tertiary:active{
  transform:translateY(0);
}
:is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) .btn.tertiary:focus-visible{
  outline:2px solid rgba(148,163,184,.6);
  outline-offset:2px;
}
@media (max-width: 520px){
  :is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card){
    padding:24px 20px 22px;
  }
  :is(.modal-card--auth-layer, #login-modal .modal-card, #reg-modal .modal-card, #mycams-modal .modal-card, #need-auth-modal .modal-card) .modal-card__actions{
    flex-direction:column;
    align-items:stretch;
  }
}

/* Activación y confirmaciones */
.activation-card{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:18px;
  padding:28px 26px 24px;
  width:min(480px, 92vw);
  background:color-mix(in srgb, var(--surface-elevated, #111827) 90%, rgba(15,23,42,.9));
  border-radius:18px;
  border:1px solid color-mix(in srgb, var(--primary, #3b82f6) 24%, rgba(148,163,184,.3));
  box-shadow:0 28px 68px rgba(15,23,42,.55);
  backdrop-filter:blur(18px) saturate(140%);
  -webkit-backdrop-filter:blur(18px) saturate(140%);
}
.activation-card__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}
.activation-card__body{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.activation-card__titles{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.activation-card__icon{
  flex-shrink:0;
  margin-left:auto;
  width:48px;
  height:48px;
  border-radius:16px;
  display:grid;
  place-items:center;
  font-size:24px;
  font-weight:700;
  color:var(--primary-contrast, #0b1020);
  background:color-mix(in srgb, var(--primary, #3b82f6) 82%, rgba(255,255,255,.12));
  box-shadow:0 20px 48px color-mix(in srgb, var(--primary, #3b82f6) 45%, transparent);
  pointer-events:none;
}
.activation-card__eyebrow{
  margin:0;
  font-size:13px;
  letter-spacing:.22em;
  text-transform:uppercase;
  font-weight:600;
  color:rgba(226,232,240,.72);
}
.activation-card__email{
  margin:0;
  font-size:15px;
  font-weight:600;
  padding:12px 14px;
  border-radius:12px;
  background:color-mix(in srgb, var(--primary, #3b82f6) 14%, rgba(15,23,42,.65));
  border:1px solid color-mix(in srgb, var(--primary, #3b82f6) 34%, transparent);
  box-shadow:inset 0 0 0 1px rgba(15,23,42,.35);
  word-break:break-word;
}
.activation-card__hint{
  margin:0;
  font-size:13px;
  line-height:1.55;
  color:rgba(226,232,240,.82);
}
.activation-card__actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
}
.activation-card__primary{
  background:var(--primary, #3b82f6);
  color:var(--primary-contrast, #0b1020);
  font-weight:600;
  box-shadow:0 0 0 3px color-mix(in srgb, var(--primary, #3b82f6) 18%, transparent);
}
.activation-card__primary:hover{
  background:color-mix(in srgb, var(--primary, #3b82f6) 92%, rgba(255,255,255,.08));
  transform:translateY(-1px);
}
.activation-card__primary:active{ transform:translateY(0); }
.activation-card__primary:focus-visible{
  outline:2px solid color-mix(in srgb, var(--primary, #3b82f6) 60%, transparent);
  outline-offset:2px;
}
.activation-card__secondary{
  font-weight:600;
  background:rgba(15,23,42,.6);
  border:1px solid rgba(148,163,184,.35);
  color:rgba(226,232,240,.88);
}
.activation-card__secondary:hover{
  background:rgba(30,41,59,.8);
  transform:translateY(-1px);
}
.activation-card__secondary:active{ transform:translateY(0); }
.activation-card__secondary:focus-visible{
  outline:2px solid rgba(148,163,184,.55);
  outline-offset:2px;
}
.activation-card__feedback{
  margin:0;
  font-size:12px;
  opacity:.82;
  text-align:right;
  min-height:18px;
}
@media (max-width:540px){
  .activation-card{
    padding:24px 20px 20px;
  }
  .activation-card__header{
    align-items:flex-start;
  }
  .activation-card__actions{
    flex-direction:column;
    align-items:stretch;
  }
}

#mycams-modal .modal-card__body{
  display:flex;
  flex-direction:column;
  gap:16px;
}
#mycams-modal .modal-card__list{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-top:4px;
  max-height:60vh;
  overflow:auto;
  padding-right:6px;
}
@keyframes authModalFade{
  from{
    opacity:0;
    transform:translateY(14px) scale(.97);
  }
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

/* === Botones consistentes === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 40px;
  padding: .6rem .95rem;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-contrast);
  border: 1px solid transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--transition-base), background var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}
.btn:hover {
  background: color-mix(in srgb, var(--primary) 92%, rgba(255,255,255,.08));
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn:active { transform: translateY(0); }
.btn:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--primary) 60%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 28%, transparent);
}
.btn:disabled {
  opacity: .45;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}
.btn.secondary {
  background: color-mix(in srgb, #334155 92%, #0f172a 8%);
  color: #f8fafc;
  border-color: color-mix(in srgb, #475569 55%, transparent);
}
.btn.secondary:hover { background: color-mix(in srgb, #3b475c 96%, #0f172a 4%); }
.btn.danger {
  background: #b91c1c;
  border-color: rgba(248, 113, 113, .45);
  color: #fff;
}
.btn.danger:hover { background: #dc2626; }
.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-outline:hover {
  background: color-mix(in srgb, var(--text) 10%, transparent);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text);
}
.btn-ghost:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.btn-sm { min-height: 32px; padding: .4rem .7rem; font-size: var(--text-xs); }
.btn-block { width: 100%; }

/* Popups mÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¡s limpios */
.leaflet-popup-content-wrapper{
  border-radius:12px; border:1px solid var(--border);
  box-shadow:0 10px 24px rgba(0,0,0,.25); padding:0; background:var(--surface); color:var(--text);
}
.leaflet-popup-content{ margin:8px 10px; }
.leaflet-popup-tip{ box-shadow:0 10px 24px rgba(0,0,0,.25); }
.cam-popup .leaflet-popup-content-wrapper{
  border:1px solid rgba(15,23,42,.65);
  box-shadow:0 16px 40px rgba(3,6,20,.55);
  background:rgba(7,11,25,.96);
  border-radius:12px;
  color:#f8fafc;
}
.cam-popup .leaflet-popup-tip{
  display:none;
}
.cam-popup .leaflet-popup-content{
  margin:0;
  padding:0;
}

@media (max-width: 768px) {
  .cam-popup .leaflet-popup-content-wrapper {
    width: calc(100vw - 12px) !important;
    max-width: none !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
  }
  .cam-popup .leaflet-popup-content {
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  .cam-popup__media {
    padding: 4px 0 !important;
    box-sizing: border-box !important;
  }
  .cam-popup__media .videos {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
  }
  .cam-popup__media .videos video,
  .cam-popup__media .media-wrap .media-embed {
    border-radius: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    object-fit: cover !important;
  }
  .media-wrap--full {
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 16/9 !important;
  }
  .wmcam {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: #0c1018 !important;
  }
  .wmcam > div:nth-child(1) {
    padding: 8px 8px 4px 8px !important;
  }
  .wmcam > div:nth-child(3) {
    padding: 4px 8px 8px 8px !important;
  }
  .wmcam-media {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

.cam-marker{
  transition:transform .2s ease, filter .2s ease;
}
.cam-marker{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  justify-content:center;
}
.cam-marker .cam-icon{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  justify-content:center;
  width:1em;
  height:1em;
  color:#e2e8f0;
  line-height:1;
  transform:translateY(-1px);
  transition:color .2s ease, transform .2s ease;
}
.cam-marker .cam-icon::before{
  content:'';
  position:absolute;
  left:50%;
  top:50%;
  width:calc(1em + 12px);
  height:calc(1em + 12px);
  border-radius:50%;
  transform:translate(-50%,-50%) scale(.65);
  background:transparent;
  box-shadow:none;
  opacity:0;
  z-index:-1;
  transition:all .2s ease;
}
.cam-marker.is-open .cam-icon,
.cam-marker--active .cam-icon{
  color:#f8fafc;
  transform:translateY(-1px);
}
.cam-marker.is-open .cam-icon::before,
.cam-marker--active .cam-icon::before{
  width:calc(1em + 18px);
  height:calc(1em + 18px);
  background:#0f172a;
  box-shadow:0 0 18px rgba(15,23,42,0.6);
  opacity:1;
  transform:translate(-50%,-50%) scale(1);
}
.cam-marker--favorite .cam-icon{
  color:#facc15;
  text-shadow:0 0 12px rgba(250,204,21,.45);
}
.cam-marker--favorite .cam-icon::before{
  width:calc(1em + 18px);
  height:calc(1em + 18px);
}
.cam-marker--favorite.is-open .cam-icon::before,
.cam-marker--favorite.cam-marker--active .cam-icon::before{
  background:rgba(15,23,42,.92);
  box-shadow:0 0 20px rgba(250,204,21,.55);
}

/* Reportar */
.media-wrap{
  position:relative;
  background:#000;
  border-radius:10px;
  overflow:hidden;
  display:block;
  cursor:inherit;
}
.media-drag-layer{
  position:absolute;
  inset:0;
  z-index:3;
  pointer-events:none;
}
.media-wrap.is-playing .media-drag-layer{
  pointer-events:auto;
}
.media-wrap.is-playing .media-drag-layer,
.media-wrap.is-playing .media-embed{
  cursor:grab;
}
.cam-popup-card.is-dragging .media-wrap.is-playing .media-drag-layer,
.cam-popup-card.is-dragging .media-wrap.is-playing .media-embed{
  cursor:grabbing;
}
.media-wrap--full{
  width:320px;
  max-width:100%;
  aspect-ratio:16/9;
}
.media-wrap--full.is-expanded{
  width:calc(100% - 30px) !important;
  max-width:352px;
  margin:12px 15px;
}
.media-wrap--thumb{
  width:160px;
  aspect-ratio:16/9;
}
.media-embed{
  width:100%;
  height:100%;
  display:block;
  border:0;
  border-radius:inherit;
  background:#000;
  cursor:auto;
}
.media-wrap video.media-embed,
.media-wrap img.media-embed{
  object-fit:cover;
}
.media-wrap iframe.media-embed{
  background:#000;
}
.cam-popup__media{
  display:flex;
  justify-content:center;
  padding:16px 0 6px;
}
.cam-popup__media .videos{
  width:calc(100% - 30px);
  margin:12px 15px;
  border-radius:18px;
  overflow:hidden;
  background:rgba(15,23,42,.85);
  padding:6px;
  box-shadow:0 12px 40px rgba(0,0,0,.45);
  display:flex;
  justify-content:center;
}
.cam-popup__media .videos video,
.cam-popup__media .media-wrap .media-embed{
  width:100%;
  display:block;
  border-radius:12px;
}
.cam-popup .media-wrap::after{
  content:'';
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:40%;
  pointer-events:none;
  background:linear-gradient(180deg, rgba(15,23,42,0) 0%, rgba(15,23,42,0.55) 100%);
}
.btn-report{
  position:absolute; top:6px; left:6px; padding:4px 8px; font-size:12px; border-radius:12px;
  background:#facc15; color:#111; border:0; cursor:pointer; opacity:.98; box-shadow:0 2px 8px rgba(0,0,0,.35);
}

/* BÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂºsqueda + filtros */
.searchbar{ position:absolute; left:8px; top:8px; z-index:1400; display:none; gap:8px; align-items:center; padding:8px 10px; border-radius:22px; background:color-mix(in srgb, var(--surface-elevated) 96%, transparent); border:1px solid var(--border); box-shadow:var(--shadow-sm); color:var(--text);}
.searchbar.is-open{ display:flex; }
.searchbar input{ width:260px; height:36px; border-radius:18px; background:var(--surface); border:1px solid var(--border); color:var(--text); padding:0 10px; font-size:14px; -webkit-appearance:none; appearance:none; }
.searchbar .btn{ height:36px; padding:0 12px; border-radius:14px; font-weight:600; }

/* BotÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ³n de lupa (mÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ³vil) */
.search-toggle{
  position:absolute; left:8px; top:8px; z-index:3200;
  width:42px; height:42px; border-radius:999px;
  border:1px solid var(--border);
  background:color-mix(in srgb, var(--surface-elevated) 92%, transparent);
  color:var(--text); box-shadow:var(--shadow-sm);
  display:grid; place-items:center; cursor:pointer;
}
.search-toggle:hover{ filter:brightness(1.05); }
.search-toggle svg{ width:18px; height:18px; }
.search-toggle.hidden{ display:none !important; }

/* Comportamiento en mÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ³viles: ocultar barra por defecto y mostrar al abrir */
@media (max-width: 768px){
}

/* Chips */
.chip{ display:inline-flex; align-items:center; gap:6px; border:1px solid var(--border); border-radius:999px; padding:4px 8px; font-size:12px; background:var(--surface-muted); color:var(--text); }
.chip--small{ padding:2px 6px; font-size:11px; }
.chip--small{ padding:2px 6px; font-size:11px; }

/* Notificaciones */
.notif-item{ border:1px solid #333; border-radius:10px; padding:10px; display:grid; gap:6px; }
.notif-actions{ display:flex; gap:8px; }

/* Scroll "Mis cámaras" y Favoritos */
#mycams-list, #favorites-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px;
}

@media (orientation: landscape) {
  #mycams-list, #favorites-list {
    grid-template-columns: repeat(3, 1fr);
  }
  /* Ampliar el modal en PC para que quepan las 3 columnas */
  #mycams-modal .modal-card,
  #favorites-modal .modal-card {
    max-width: 1100px;
    width: 90%;
  }
}

.mycam-item {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-radius: 12px;
  background: var(--surface-elevated, #1e293b);
  border: 1px solid var(--border-dim, rgba(255,255,255,0.1));
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.mycam-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.mycam-item__thumb {
  position: relative;
  width: 100%;
  border-radius: 0;
  overflow: hidden;
  background: #000;
}

.mycam-item__media {
  width: 100%;
  height: 100%;
}

.mycam-item__thumb .media-wrap--full {
  width: 100%;
  aspect-ratio: 16/9;
}

.mycam-item__thumb iframe,
.mycam-item__thumb video,
.mycam-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
}

.mycam-item__overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.mycam-item__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.mycam-item__icon:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.mycam-item__icon--delete:hover {
  background: rgba(220, 38, 38, 0.8);
  border-color: rgba(220, 38, 38, 0.5);
}

.mycam-item__details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
}

.mycam-item__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #f1f5f9);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Z-index panes */
.leaflet-labels-pane { z-index: 650; }
.leaflet-weather-pane { z-index: 625; }


/* ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ MODALES compactos (evita popups demasiado anchos) ÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ */
.modal .card {
  max-width: 560px;           /* tamaÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ±o general */
  width: fit-content;
}

#geo-modal .modal-card{
  /* Ajustar a contenido: tarjeta compacta para geolocalizaciÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ³n */
  width: fit-content !important;
  max-width: calc(100vw - 32px);
  min-width: auto;
  padding: 14px 16px;
}

/* Form login/registro compacto (quita scrollbar horizontal) */
#auth-modal .card,
#login-modal .card {
  max-width: 520px !important;
  width: fit-content !important;
}

/* Chips meteo */
.wxchip {
  display:inline-flex; align-items:center; gap:6px;
  border-radius:999px; padding:3px 8px; font-weight:700; font-size:12px; line-height:1;
  border:1px solid rgba(0,0,0,.18); box-shadow:0 2px 8px rgba(0,0,0,.25);
}
.wx-wind { background:rgba(20,30,60,.85); color:#e5f3ff; border-color:rgba(255,255,255,.12); }

/* Perfil bonito */
.leaflet-control.userctl .dropdown.card {
  display:none; background:#fff; color:#111; padding:10px; border-radius:14px;
  box-shadow:0 24px 50px rgba(0,0,0,.25); border:1px solid rgba(0,0,0,.08); min-width:220px;
}
.leaflet-control.userctl .dropdown .head { display:flex; gap:10px; align-items:center; }
.leaflet-control.userctl .dropdown .avatar { width:28px; height:28px; display:grid; place-items:center; border-radius:999px; background:#eef2ff; }
.leaflet-control.userctl .dropdown .item { display:block; padding:6px 8px; border-radius:8px; cursor:pointer; }
.leaflet-control.userctl .dropdown .item:hover { background:#f3f4f6; }
.leaflet-control.userctl .dropdown .sep { border:none; border-top:1px solid #eee; margin:8px 0; }


/* === Close button as rounded "bolita" inside camera popup === */
.cam-popup .leaflet-popup-close-button{
  position:absolute;
  top:8px; right:8px;
  width:28px; height:28px;
  border-radius:9999px;
  background:rgba(15,23,42,.88); /* slate-900-ish */
  color:#fff;
  border:1px solid rgba(255,255,255,.18);
  box-shadow:0 2px 10px rgba(0,0,0,.35);
  display:grid;
  place-items:center;
  text-decoration:none;
  line-height:28px;
  font-size:16px;
}
.cam-popup .leaflet-popup-close-button:hover{
  background:rgba(30,41,59,.95);
}


/* Cierre en overlay dentro del media (bolita roja) */
.btn-popup-close{
  position:absolute;
  top:6px; right:6px;
  width:28px; height:28px;
  border-radius:12px;
  background:#dc2626; /* rojo */
  color:#fff;
  border:0;
  cursor:pointer;
  display:grid;
  place-items:center;
  font-size:16px;
  line-height:28px;
  box-shadow:0 2px 10px rgba(0,0,0,.35);
  opacity:.96;
}
.btn-popup-close:hover{ background:#ef4444; }

/* Oculta el botÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ³n de cierre por defecto de Leaflet dentro del popup de cÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¡mara */
.cam-popup .leaflet-popup-close-button{ display:none !important; }


/* LÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ¡piz de ediciÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ³n (solo dueÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ±o) en esquina superior izquierda del vÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ­deo */
.btn-edit-overlay{
  position:absolute;
  top:6px; left:6px;
  width:28px; height:28px;
  border-radius:12px;
  background:#475569; /* slate-600 */
  color:#fff;
  border:0;
  cursor:pointer;
  display:grid;
  place-items:center;
  font-size:16px;
  line-height:28px;
  box-shadow:0 2px 10px rgba(0,0,0,.35);
  opacity:.96;
}
.btn-edit-overlay:hover{ background:#64748b; }


/* Reporter info row in notifications */
.notif-reporter{margin-top:6px;font-size:.9rem;opacity:.9}
.notif-reporter .chip{display:inline-block;background:#444;color:#fff;border-radius:6px;padding:2px 6px;margin-right:6px;font-size:.75rem}


/* --- Tabs (notificaciones) --- */
.tabs { display:flex; gap:6px; border-bottom:1px solid rgba(0,0,0,.1); padding-bottom:6px; }
.tabs .tab {
  appearance:none; border:none; background:transparent; padding:6px 10px; border-radius:12px;
  font-weight:600; cursor:pointer; opacity:.8;
}
.tabs .tab:hover { opacity:1; }
.tabs .tab.active {
  background: rgba(0,0,0,.06); color: inherit; opacity:1;
}

/* --- Pills de estado --- */
.pill { display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; font-weight:700; }
.pill.pending { background: #f59e0b20; color:#b45309; border:1px solid #f59e0b66; }
.pill.approved { background: #10b98120; color:#065f46; border:1px solid #10b98166; }
.pill.rejected { background: #ef444420; color:#991b1b; border:1px solid #ef444466; }

/* Ajustes tarjetas notificaciÃÂÃÂÃÂÃÂÃÂÃÂÃÂÃÂ³n */
.notif-item { border:1px solid var(--border); border-radius:var(--radius-md); padding:12px; background:var(--surface-elevated); box-shadow:var(--shadow-sm); }
.notif-actions { display:flex; gap:6px; margin-top:6px; }


/* === Contador de notificaciones === */
.userctl { position: relative; }
.userctl .btn-usr { position: relative; }
.userctl .btn-usr .notif-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1;
  background: #ef4444; color: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.2);
}
.userctl .dropdown a .notif-pill {
  display: inline-block; margin-left: 6px; padding: 0 6px; height: 18px;
  border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 18px;
  background: #ef444420; color:#b91c1c; border:1px solid #ef444466;
}


/* ensure notification badges/pills truly hide when [hidden] or empty */
.userctl .btn-usr .notif-badge[hidden],
.userctl .dropdown a .notif-pill[hidden] { display: none !important; }
.userctl .btn-usr .notif-badge:empty { display: none !important; }
.userctl .dropdown a .notif-pill:empty { display: none !important; }


/* --- Drag handle (top-center de media) --- */
.btn-drag-overlay{
  position:absolute;
  top:8px;
  left:50%;
  transform: translateX(-50%);
  width:30px; height:30px;
  border-radius:12px;
  background:rgba(30,41,59,.92); /* slate-800 */
  color:#fff;
  border:0;
  display:none !important;
  place-items:center;
  cursor:grab;
  user-select:none;
  pointer-events:auto;
  box-shadow:0 2px 10px rgba(0,0,0,.35);
  z-index:10; /* above report/close */
}
.btn-drag-overlay:hover{ background:rgba(51,65,85,.95); }
.btn-drag-overlay:active{ cursor:grabbing; }

.cam-popup-card{
  width:352px;
  max-width:88vw;
  display:flex;
  flex-direction:column;
  gap:12px;
  border-radius:inherit;
  padding:18px;
  background:rgba(3,6,20,.92);
  color:inherit;
  cursor:grab;
}
.cam-popup-card.is-dragging{
  cursor:grabbing;
}
.cam-popup__media{
  position:relative;
}
.cam-popup__actions{
  position:absolute;
  top:16px;
  left:15px;
  right:auto;
  transform:none;
  width:calc(100% - 30px);
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
  pointer-events:auto;
  flex-wrap:wrap;
  row-gap:6px;
}

.cam-popup__actions .btn-report,
.cam-popup__actions .btn-drag-overlay,
.cam-popup__actions .btn-popup-close{
    position:static;
    top:auto;
    right:auto;
    left:auto;
    transform:none;
    width:28px;
    height:28px;
    border-radius:12px;
  box-shadow:none;
  border:1px solid rgba(148,163,184,0.35);
  pointer-events:auto;
  background:rgba(30,41,59,0.9);
  color:#e2e8f0;
  display:grid;
  place-items:center;
  opacity:1;
  padding:0;
  pointer-events:auto;
}
.cam-popup__actions .btn-report{ position:absolute !important; top:0; left:0; transform:none; margin:0; }
.cam-popup__actions .btn-report:hover{
  background:rgba(250,204,21,0.3);
}
.cam-popup__actions .btn-drag-overlay{
  cursor:grab;
}
.cam-popup__actions .btn-drag-overlay:hover{
  background:rgba(51,65,85,0.9);
}
.cam-popup__actions .btn-drag-overlay.is-grabbing{
  cursor:grabbing;
}
.cam-popup__actions .btn-popup-close{
  background:#dc2626;
  color:#fff;
  border-color:rgba(248,113,113,0.6);
  cursor:pointer;
}
.cam-popup__actions .btn-popup-close:hover{
  background:#ef4444;
}
.cam-popup__actions .btn-popup-close.is-grabbing{
  cursor:grabbing;
}
/* Forzar la X de cierre al margen superior derecho del media/popup */
.cam-popup__actions .btn-popup-close{
  position:absolute !important;
  top:0; right:0;
  transform:none;
  z-index:12;
}
.cam-popup__title{
  width:calc(100% - 30px);
  margin:8px 15px 0 15px;
  font-weight:700;
  font-size:16px;
  line-height:1.25;
  color:#f8fafc;
}
.cam-popup__meta{
  width:calc(100% - 30px);
  margin:12px 15px 0 15px;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  background:rgba(7,11,25,.9);
  border-radius:14px;
  padding:8px 10px;
  box-shadow:0 8px 22px rgba(0,0,0,.35);
} 
.wx-inline-temp{
  width:calc(100% - 30px);
  margin:6px 15px 0 15px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:#f8fafc;
  font-weight:600;
  font-size:14px;
}
.wx-inline-temp__icon{
  width:28px;
  height:28px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:rgba(248,113,113,.15);
  color:#f87171;
  border:1px solid rgba(248,113,113,.4);
  box-shadow:0 4px 14px rgba(0,0,0,.3);
}
.wx-inline-temp__value{
  letter-spacing:.02em;
}
.cam-popup .wx-mini{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:flex-start; width:100%; }
.cam-popup .wx-mini::-webkit-scrollbar{
  display:none;
}

.leaflet-popup.cam-popup-animated{
  transition: transform 220ms cubic-bezier(.24,.8,.32,1);
  will-change: transform;
}
.leaflet-popup.cam-popup-animated.dragging{
  transition: none !important;
}

.leaflet-popup.cam-popup .cam-popup-drag-surface{
  cursor: grab;
  touch-action: none;
}
.leaflet-popup.cam-popup.dragging .cam-popup-drag-surface{
  cursor: grabbing;
}

.media-play-indicator{
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  width:46px;
  height:46px;
  border-radius:9999px;
  background:rgba(15,23,42,0.55);
  display:grid;
  place-items:center;
  pointer-events:auto;
  transition:opacity .2s ease;
  opacity:1;
  cursor:pointer;
  z-index:6;
}
.media-play-indicator::before{
  content:''; 
  width:0; 
  height:0; 
  border-top:10px solid transparent; 
  border-bottom:10px solid transparent; 
  border-left:16px solid #fff; 
  margin-left:4px;
}
.media-wrap.is-playing .media-play-indicator{
  opacity:0;
  pointer-events:none;
}
.media-wrap--iframe .media-play-indicator,
.media-wrap--image .media-play-indicator{
  display:none;
}

/* === Leaflet: controles en tema oscuro === */
.leaflet-control-zoom a {
  background: var(--surface);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.leaflet-control-zoom a:hover { background: color-mix(in srgb, var(--surface) 88%, var(--text)); }
.leaflet-control-zoom a:last-child { border-bottom: 0; }
.leaflet-control-zoom, .leaflet-control-layers {
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
  border-radius: 10px;
  overflow: hidden;
}

/* Asegurar que el control de perfil pueda mostrar su dropdown fuera del contenedor */
.leaflet-control.userctl { overflow: visible !important; }
.leaflet-control.locate-control {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
}
.locate-control .locate-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  text-decoration: none;
}
.locate-control .locate-btn:hover {
  background: color-mix(in srgb, var(--surface) 85%, var(--text));
}

/* Panel de capas */
.leaflet-control-layers-expanded {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.leaflet-control-layers-list label {
  color: var(--text);
}
.leaflet-control-layers-separator { border-top: 1px solid var(--border); }
.leaflet-control-layers input { accent-color: var(--primary); }


/* Control de capas en moviles */
@media (max-width: 768px){
  .layers-mobile{
    display:flex;
    flex-direction:row-reverse;
    align-items:flex-end;
    gap:10px;
    border:0 !important;
    box-shadow:none !important;
    background:transparent;
    padding:0;
  }
  .layers-mobile__toggle{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;
    width:42px;
    height:42px;
    border-radius:999px;
    border:1px solid var(--border);
    background:color-mix(in srgb, var(--surface-elevated) 92%, transparent);
    color:var(--text);
    cursor:pointer;
    transition:background var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
    box-shadow:var(--shadow-sm);
  }
  .layers-mobile__toggle span{
    display:block;
    width:18px;
    height:2px;
    border-radius:4px;
    background:currentColor;
  }
  .layers-mobile__toggle:hover{
    background:color-mix(in srgb, var(--surface-elevated) 88%, transparent);
  }
  .layers-mobile__toggle[hidden]{ display:none !important; }
  .layers-mobile__toggle[aria-expanded="true"]{
    background:color-mix(in srgb, var(--primary) 18%, var(--surface-elevated));
    color:var(--primary);
  }
  .layers-mobile .leaflet-control-layers{
    margin:0;
  }
  .layers-mobile .leaflet-control-layers[hidden]{ display:none !important; }
}
.theme-toggle {
  position: fixed; right: 14px; bottom: 14px; z-index: 3100;
  width: 38px; height: 38px; border-radius: 9999px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  display: grid; place-items: center; cursor: pointer;
}
.theme-toggle:hover { filter: brightness(1.05); }
.theme-toggle svg { width: 18px; height: 18px; }

/* Estilos para el botón de favorito en el popup */
.fav-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: rgba(255,255,255,0.7);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.fav-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}
.fav-svg {
  fill: none; /* Default to outline */
  transition: all 0.2s ease;
}
.fav-btn.is-favorite {
  color: #facc15; /* Gold matching map star */
}
.fav-btn.is-favorite .fav-svg {
  fill: currentColor;
  stroke: none; /* Remove outline when filled */
}

/* =========================================
   Admin Panel Styles (Dark & Gold Theme)
   ========================================= */

.admin-shell {
  display: flex;
  min-height: 100vh;
  background: #000000;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
}

.admin-sidebar {
  width: 260px;
  background: #0a0a0a;
  border-right: 1px solid #333;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.admin-brand {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid #333;
}

.admin-brand__icon {
  font-size: 1.5rem;
}

.admin-brand__text {
  font-weight: 700;
  font-size: 1.2rem;
  color: #D4AF37; /* Dark Gold */
  text-transform: uppercase;
  letter-spacing: 1px;
}

.admin-nav {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
}

.admin-nav__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  color: #a0a0a0;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
  border: 1px solid transparent;
}

.admin-nav__item:hover {
  background: #1a1a1a;
  color: #ffffff;
  border-color: #333;
}

.admin-nav__item.active {
  background: #1a1a1a;
  color: #D4AF37;
  border-color: #D4AF37;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
}

.admin-nav__spacer {
  flex: 1;
}

.admin-nav__item--exit {
  margin-top: auto;
  color: #ef4444;
}

.admin-nav__item--exit:hover {
  background: #2a0000;
  color: #ff6b6b;
  border-color: #ef4444;
}

/* Content Area */
.admin-content {
  flex: 1;
  margin-left: 260px;
  padding: 2rem;
  max-width: 1600px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid #333;
  padding-bottom: 1rem;
}

.admin-header h1, .admin-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  color: #D4AF37; /* Dark Gold */
  text-transform: uppercase;
  letter-spacing: 1px;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  background: #1a1a1a;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid #D4AF37;
  color: #D4AF37;
}

/* Dashboard Grid */
.admin-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #0a0a0a;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #333;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: #D4AF37;
}

.stat-card__title {
  font-size: 0.9rem;
  color: #a0a0a0;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card__value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffffff;
}

.stat-card--alert .stat-card__value {
  color: #ef4444;
}

.admin-card {
  background: #0a0a0a;
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid #333;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  color: #fff;
  max-width: 600px;
}

.admin-card h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: #D4AF37;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-card label {
  color: #ffffff;
}

/* Tables */
.admin-table-container {
  background: #0a0a0a;
  border-radius: 8px;
  border: 1px solid #333;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background: #151515;
  padding: 1rem;
  font-weight: 700;
  color: #D4AF37;
  border-bottom: 1px solid #333;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid #222;
  color: #e0e0e0;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: #1a1a1a;
}

/* Toolbar */
.admin-toolbar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.admin-toolbar h3 {
  margin: 0;
  color: #D4AF37;
  margin-right: auto;
}

.admin-search-input {
  flex: 1;
  min-width: 200px;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  border: 1px solid #333;
  background: #0a0a0a;
  color: #fff;
}

.admin-search-input:focus {
  border-color: #D4AF37;
  outline: none;
}

.admin-select {
  padding: 0.6rem 2rem 0.6rem 1rem;
  border-radius: 4px;
  border: 1px solid #333;
  background: #0a0a0a;
  color: #fff;
}

/* Badges & Status */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-active { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.4); }
.status-inactive { background: #94a3b8; }
.status-warning { background: #f59e0b; }
.status-deleted { background: #ef4444; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #222;
  color: #fff;
  border: 1px solid #444;
}

.badge--admin { background: #1e3a8a; color: #bfdbfe; border-color: #1e40af; }
.badge--user { background: #333; color: #9ca3af; }

/* Buttons */
.btn {
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: #333;
  color: #fff;
}

.btn:hover {
  background: #444;
}

.btn--primary {
  background: #D4AF37;
  color: #000;
}

.btn--primary:hover {
  background: #b5952f;
  transform: translateY(-1px);
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 4px;
  transition: background 0.2s;
  font-size: 1.1rem;
  color: #a0a0a0;
}

.btn-icon:hover {
  background: #333;
  color: #fff;
}

.btn-icon--danger:hover {
  background: #450a0a;
  color: #ef4444;
}

.admin-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-top: 1px solid #333;
  background: #0a0a0a;
  color: #a0a0a0;
}

.admin-pagination button {
  background: #222;
  border: 1px solid #333;
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
}

.admin-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-pagination button:not(:disabled):hover {
  border-color: #D4AF37;
  color: #D4AF37;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: #0a0a0a;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  overflow: hidden;
  border: 1px solid #D4AF37;
  animation: modalSlide 0.3s ease;
  color: #fff;
}

@keyframes modalSlide {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #111;
}

.modal-header h3 { margin: 0; color: #D4AF37; }

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
}

.modal-close:hover { color: #fff; }

.modal-body {
  padding: 1.5rem;
  max-height: 80vh;
  overflow-y: auto;
}

.input {
  background: #1a1a1a;
  border: 1px solid #333;
  color: #fff;
  padding: 0.6rem;
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
}

.input:focus {
  border-color: #D4AF37;
  outline: none;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .admin-sidebar.open {
    transform: translateX(0);
  }
  
  .admin-content {
    margin-left: 0;
    padding: 1rem;
  }
}
/* === Map Markers & Icons (Refactored from inline styles) === */

/* My Location Marker */
.myloc-icon {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 6px rgba(37,99,235,.25);
}

/* Camera Marker Active State */
.cam-marker span {
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  border: 0;
  transition: background .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cam-marker--active span {
  background: var(--surface, #0c1018);
  box-shadow: 0 8px 18px rgba(0,0,0,.55);
  border: 2px solid rgba(255,255,255,.18);
  outline: 3px solid rgba(17,24,39,.35);
  outline-offset: 4px;
}

/* Weather Icons Base */
.wx-icon-base {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 700;
  font-size: 12px;
}

.wx-temp-inner {
  color: #111;
  border: 1px solid rgba(0,0,0,.18);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.wx-wind-inner {
  background: rgba(20,30,60,.85);
  color: #e5f3ff;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.wx-wind-arrow {
  display: inline-block;
}

/* Geo Spinner */
@keyframes geoSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.geo-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid #cbd5e1;
  border-top-color: #2563eb;
  animation: geoSpin .9s linear infinite;
  display: inline-block;
  margin-right: 8px;
}


/* Support Modal */
.support-card {
  max-width: 500px;
  width: 100%;
}
.support-card__header {
  text-align: center;
  margin-bottom: 24px;
}
.support-card__icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}
.support-card__eyebrow {
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 12px;
  margin-bottom: 8px;
}
.support-card__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.support-card__actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}


/* === Compact My Cameras Modal (3x3 Grid) === */
#mycams-modal .modal-card,
#favorites-modal .modal-card {
  padding: 8px 12px;
  max-width: 1000px; /* Increased width for larger cameras */
  width: 98vw;
  max-height: 98vh;
}

#mycams-modal .modal-card__header,
#favorites-modal .modal-card__header {
  gap: 6px;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: none; /* Removed border */
}

#mycams-modal .modal-card__title,
#favorites-modal .modal-card__title {
  font-size: 18px;
}

#mycams-modal .mycams-card__icon,
#favorites-modal .favorites-card__icon {
  font-size: 20px !important;
}

#mycams-modal .modal-card__close,
#favorites-modal .modal-card__close {
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
}

#mycams-modal .mycams-card__body,
#favorites-modal .favorites-card__body {
  gap: 0;
  padding: 0;
  flex: 1;
  overflow: hidden;
}

#mycams-list,
#favorites-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  padding: 0;
  max-height: none;
  overflow-y: auto;
  height: 100%;
}

/* Force 3 columns on mobile too if landscape, or just responsive grid */
@media (max-width: 600px) {
  #mycams-list,
  #favorites-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

#mycams-list .mycam-item,
#favorites-list .mycam-item {
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

#mycams-list .mycam-item__thumb,
#favorites-list .mycam-item__thumb {
  flex: 1;
  min-height: 0;
}

#mycams-list .mycam-item__thumb .media-wrap--full,
#favorites-list .mycam-item__thumb .media-wrap--full {
  height: 100%;
  aspect-ratio: auto;
}

#mycams-list .mycam-item__thumb img,
#mycams-list .mycam-item__thumb video,
#mycams-list .mycam-item__thumb iframe,
#favorites-list .mycam-item__thumb img,
#favorites-list .mycam-item__thumb video,
#favorites-list .mycam-item__thumb iframe {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

#mycams-list .mycam-item__details,
#favorites-list .mycam-item__details {
  padding: 4px 6px;
  background: var(--surface-elevated);
}

#mycams-list .mycam-item__title,
#favorites-list .mycam-item__title {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Footer Compact */
.mycams-card__footer,
#favorites-pagination {
  margin-top: 4px;
  padding-top: 4px;
  border-top: none; /* Removed border */
  display: flex;
  justify-content: flex-end;
}

#mycams-pagination,
#favorites-pagination {
  display: flex;
  gap: 8px;
  align-items: center;
}

#mycams-pagination .btn,
#favorites-pagination .btn {
  min-height: 28px;
  padding: 2px 10px;
  font-size: 12px;
  border-radius: 6px;
}

#mycams-pagination span,
#favorites-pagination span {
  font-size: 12px;
  font-weight: 600;
}

