/* ==========================================================================
   Estilos del área de OFICINA (panel interno AMP2008). Tema oscuro sobrio,
   coherente con la marca de la landing. Independiente de landing.css.
   ========================================================================== */
:root{
  --of-bg:#070611; --of-panel:#0f0d1d; --of-border:rgba(124,138,255,0.18);
  --of-blue:#3aacff; --of-blue-soft:#6cc4ff; --of-violet:#c15be0; --of-violet-soft:#d9a8ec;
  --of-text:#e9e7f5; --of-soft:#a9a4d0; --of-dim:#6f6a95;
}
*{box-sizing:border-box;}
body{margin:0; font-family:'Segoe UI',system-ui,-apple-system,sans-serif;
  background:var(--of-bg); color:var(--of-text); -webkit-font-smoothing:antialiased;}

a{color:var(--of-blue-soft); text-decoration:none;}
a:hover{text-decoration:underline;}

/* Barra superior */
.of-top{display:flex; align-items:center; justify-content:space-between;
  padding:12px 20px; border-bottom:0.5px solid var(--of-border); background:var(--of-panel);}
.of-brand{display:flex; align-items:center; gap:6px;}
.of-dot{width:12px;height:12px;border-radius:50%;}
.of-dot.b{background:var(--of-blue); box-shadow:0 0 10px var(--of-blue);}
.of-dot.v{background:var(--of-violet); margin-left:-4px; box-shadow:0 0 10px var(--of-violet);}
.of-brandtext{font-size:16px; margin-left:6px; letter-spacing:.5px;}
.of-brandtext b{color:var(--of-violet-soft);}
.of-sub{font-size:11px; color:var(--of-dim); margin-left:8px; letter-spacing:1px; text-transform:uppercase;}
.of-user{display:flex; align-items:center; gap:14px;}
.of-username{font-size:13px; color:var(--of-soft);}
.of-username em{color:var(--of-violet-soft); font-style:normal;}
.of-logout{margin:0;}

/* Navegación */
.of-nav{display:flex; gap:6px; flex-wrap:wrap; padding:10px 16px;
  border-bottom:0.5px solid var(--of-border); background:rgba(124,138,255,0.02);}
.of-nav a{display:inline-flex; align-items:center; gap:7px; color:var(--of-soft);
  padding:8px 14px; border-radius:10px; font-size:14px;}
.of-nav a:hover{background:rgba(124,138,255,0.08); color:#fff; text-decoration:none;}
.of-nav .of-navlink.active{background:rgba(124,138,255,0.12); color:#fff;}

/* ===== Menú con desplegables (Servicios / Cobranzas / Administración) ===== */
.of-group{position:relative;}
.of-group-btn{display:inline-flex; align-items:center; gap:7px; cursor:pointer;
  background:none; border:none; font:inherit; color:var(--of-soft);
  padding:8px 14px; border-radius:10px;}
.of-group-btn:hover{background:rgba(124,138,255,0.08); color:#fff;}
.of-group.active > .of-group-btn{background:rgba(124,138,255,0.12); color:#fff;}
.of-caret{font-size:14px; opacity:.7; transition:transform .15s ease;}

/* Panel desplegable: oscuro translúcido, borde violeta sutil, glow (como el menú de la landing). */
.of-group-menu{position:absolute; top:calc(100% + 6px); left:0; z-index:60; min-width:230px;
  display:none; flex-direction:column; gap:2px; padding:7px;
  background:rgba(15,13,29,0.97); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  border:0.5px solid rgba(124,138,255,0.3); border-radius:13px;
  box-shadow:0 12px 40px rgba(0,0,0,0.55), 0 0 22px rgba(142,77,210,0.22);}
.of-group-menu a{display:flex; align-items:center; gap:9px; color:#d7d2f0;
  padding:10px 12px; border-radius:9px; font-size:14px; white-space:nowrap;}
.of-group-menu a:hover{background:rgba(124,138,255,0.1); color:#fff;}

/* Abrir: por hover en PC, o con la clase .open (tap en celular). */
.of-group:hover > .of-group-menu,
.of-group.open > .of-group-menu{display:flex;}
.of-group:hover > .of-group-btn .of-caret,
.of-group.open > .of-group-btn .of-caret{transform:rotate(180deg);}

/* En pantallas chicas el panel ocupa el ancho y se apila prolijo. */
@media (max-width:640px){
  .of-group{width:100%;}
  .of-group-btn{width:100%; justify-content:space-between;}
  .of-group-menu{position:static; min-width:0; width:100%; box-shadow:none;
    background:rgba(124,138,255,0.04); margin-top:4px;}
  /* En celular no abrir por hover (que sea solo tap). */
  .of-group:hover > .of-group-menu{display:none;}
  .of-group.open > .of-group-menu{display:flex;}
}

/* ===== Dashboard de servicios ===== */
.dash-filtros{display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end;}
.dash-filtros .of-field{margin:0; min-width:170px;}
.dash-filtros-btns{display:flex; gap:8px; align-items:flex-end;}
.dash-cards{display:grid; grid-template-columns:repeat(2,1fr); gap:12px; margin-top:14px;}
.dash-card{background:var(--of-panel); border:0.5px solid var(--of-border); border-radius:14px;
  padding:18px; text-align:center;}
.dash-n{font-size:30px; font-weight:700;
  background:linear-gradient(120deg,var(--of-blue-soft),var(--of-violet-soft));
  -webkit-background-clip:text; background-clip:text; color:transparent;}
.dash-l{font-size:12px; color:var(--of-dim); letter-spacing:.5px; text-transform:uppercase; margin-top:4px;}
.dash-graficos{display:grid; grid-template-columns:1fr; gap:14px; margin-top:14px;}
@media (min-width:760px){
  .dash-cards{grid-template-columns:repeat(4,1fr);}
  .dash-graficos{grid-template-columns:1fr 1fr;}
  .dash-graficos > .of-card:first-child{grid-column:1 / -1;}  /* "por mes" ancho completo */
}

/* ===== Comunidad / Marketplace ===== */
/* Botón destacado en el portal del socio — estilo "Mercado Libre" (amarillo/dorado),
   el acceso estrella al mini-marketplace. Glow que late + shimmer sutil. Solo CSS. */
.comunidad-hero{position:relative; overflow:hidden;
  display:flex; align-items:center; gap:14px; margin-top:14px; padding:18px;
  border-radius:16px; text-decoration:none;
  background:linear-gradient(120deg,#ffe600,#ffd21e);
  border:1px solid #ffcc00;
  box-shadow:0 0 22px rgba(255,214,0,0.45);
  animation:ml-glow 2.8s ease-in-out infinite;}
/* Brillo diagonal que barre cada tanto */
.comunidad-hero::before{content:""; position:absolute; top:0; left:-60%; width:45%; height:100%;
  background:linear-gradient(100deg, transparent, rgba(255,255,255,0.65), transparent);
  transform:skewX(-20deg); animation:ml-shimmer 4s ease-in-out infinite; pointer-events:none;}
.comunidad-hero:hover{filter:brightness(1.04);}
.comunidad-hero-ic{position:relative; z-index:1; width:52px; height:52px; border-radius:14px; flex:0 0 auto;
  background:linear-gradient(135deg,#3483fa,#2968d8);
  display:flex; align-items:center; justify-content:center; color:#fff; font-size:26px;
  box-shadow:0 4px 12px rgba(0,0,0,0.18);}
.comunidad-hero-t{position:relative; z-index:1; font-size:17px; font-weight:700; color:#2a2300;}
.comunidad-hero-s{position:relative; z-index:1; font-size:13px; color:#2a2300; font-weight:600;}
@keyframes ml-glow{
  0%,100%{box-shadow:0 0 18px rgba(255,214,0,0.35);}
  50%    {box-shadow:0 0 32px rgba(255,214,0,0.7);}
}
@keyframes ml-shimmer{
  0%      {left:-60%;}
  55%,100%{left:130%;}
}
@media (prefers-reduced-motion: reduce){
  .comunidad-hero{animation:none;}
  .comunidad-hero::before{display:none;}
}

/* Grilla de tarjetas del marketplace */
.mkt-grid{display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:14px;}
@media (min-width:760px){ .mkt-grid{grid-template-columns:repeat(4,1fr);} }
.mkt-card{display:block; text-decoration:none; border-radius:14px; overflow:hidden;
  background:var(--of-panel); border:0.5px solid var(--of-border);}
.mkt-card:hover{border-color:rgba(124,138,255,0.5);}
.mkt-foto{aspect-ratio:1/1; background:#05040b; display:flex; align-items:center; justify-content:center; overflow:hidden;}
.mkt-foto img{width:100%; height:100%; object-fit:cover;}
.mkt-sinfoto{color:var(--of-dim); font-size:30px;}
.mkt-body{padding:10px 12px;}
.mkt-titulo{font-size:14px; font-weight:600; color:var(--of-text); line-height:1.3;}
.mkt-precio{font-size:15px; font-weight:700; color:var(--of-violet-soft); margin-top:3px;}

/* Fotos del detalle */
.mkt-fotos-det{display:flex; gap:10px; overflow-x:auto; margin-top:12px; padding-bottom:6px;}
.mkt-fotos-det img{height:220px; border-radius:12px; object-fit:cover;}

/* Contenido */
.of-main{max-width:1000px; margin:0 auto; padding:24px 20px 60px;}
.of-main-centered{display:flex; min-height:90vh; align-items:center; justify-content:center;}

h1,h2,h3{color:#f3f0ff; font-weight:600;}
.of-card{background:var(--of-panel); border:0.5px solid var(--of-border);
  border-radius:16px; padding:22px;}
.of-muted{color:var(--of-dim); font-size:13px;}

/* Descripción corta debajo del título de cada servicio (portal del socio). */
.svc-desc{color:var(--of-dim); font-size:13px; line-height:1.45;}
p.svc-desc{margin:6px 0 12px;}
.svc-list{list-style:none; margin:8px 0 16px; padding:0; display:flex; flex-direction:column; gap:7px;}
.svc-list li{font-size:13.5px; line-height:1.4;}
.svc-list li b{color:#e9e6f7;}

/* Historial del socio: contadores por grupo */
.hist-grupos{display:grid; grid-template-columns:1fr; gap:14px; margin-top:12px;}
.hist-grupo-ttl{font-size:12px; font-weight:600; letter-spacing:1px; text-transform:uppercase;
  color:var(--of-dim); margin-bottom:8px;}
.hist-cont{display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:8px 12px; border-radius:10px; margin-bottom:6px; font-size:13px;
  background:var(--of-panel-2, rgba(124,138,255,0.05)); border:0.5px solid var(--of-border);}
.hist-cont b{font-size:15px; color:var(--of-dim);}
.hist-cont.on{border-color:rgba(124,138,255,0.4);}
.hist-cont.on b{color:#cbb6ec;}
@media (min-width:760px){
  .hist-grupos{grid-template-columns:repeat(3, 1fr); align-items:start;}
}

/* Formularios */
.of-form{max-width:420px;}
.of-field{margin-bottom:14px; display:flex; flex-direction:column; gap:6px;}
.of-field label{font-size:13px; color:var(--of-soft);}
.of-input, select.of-input{width:100%; background:#05040b; color:var(--of-text);
  border:0.5px solid var(--of-border); border-radius:10px; padding:11px 12px; font-size:14px;}
.of-input:focus{outline:none; border-color:var(--of-violet);}
.of-check{display:flex; align-items:center; gap:8px;}

/* Botones */
.of-btn{display:inline-flex; align-items:center; gap:8px; cursor:pointer; border:none;
  background:linear-gradient(120deg,var(--of-blue),#8e4dd0,var(--of-violet)); color:#fff;
  font-size:14px; font-weight:600; padding:11px 18px; border-radius:11px;
  box-shadow:0 0 22px rgba(142,77,210,0.45);}
.of-btn-ghost{display:inline-flex; align-items:center; gap:7px; cursor:pointer;
  background:rgba(255,255,255,0.04); color:#d7d2f0; border:0.5px solid var(--of-border);
  font-size:13px; font-weight:600; padding:8px 14px; border-radius:10px;}
.of-btn-sm{padding:6px 12px; font-size:13px;}
.of-actions{display:flex; gap:10px; align-items:center; margin-top:18px; flex-wrap:wrap;}

/* Tablas */
.of-table{width:100%; border-collapse:collapse; margin-top:14px;}
.of-table th,.of-table td{text-align:left; padding:11px 12px; border-bottom:0.5px solid var(--of-border); font-size:14px;}
.of-table th{color:var(--of-dim); font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.5px;}
.of-badge{display:inline-block; padding:3px 9px; border-radius:20px; font-size:12px; font-weight:600;}
.of-badge.ok{background:rgba(46,230,160,0.15); color:#2ee6a0;}
.of-badge.off{background:rgba(212,40,58,0.15); color:#ff8a8a;}
.of-badge.sys{background:rgba(124,138,255,0.15); color:var(--of-blue-soft);}

/* Mensajes */
.of-alert{padding:11px 14px; border-radius:11px; font-size:14px; margin-bottom:16px;}
.of-alert.err{background:rgba(212,40,58,0.12); border:0.5px solid rgba(212,40,58,0.4); color:#ffb3b3;}
.of-alert.ok{background:rgba(46,230,160,0.12); border:0.5px solid rgba(46,230,160,0.4); color:#9af5d2;}

/* Login */
.of-login{width:100%; max-width:380px;}
.of-login .of-logohead{text-align:center; margin-bottom:22px;}
.of-login h1{font-size:22px; margin:10px 0 2px;}
.of-grid-perms{display:grid; grid-template-columns:1fr 1fr; gap:8px 18px; margin-top:8px;}
@media (max-width:600px){ .of-grid-perms{grid-template-columns:1fr;} .of-main{padding:18px 14px 50px;} }
