/* INSECOM Link · estilos de la web (administración, ingreso y consola de despacho). */
@font-face { font-family: Figtree; src: url('/fonts/figtree.woff2') format('woff2'); font-weight: 300 900; font-display: swap; }

:root {
    --noche: #0A1220; --noche-2: #101B2E; --noche-3: #18263D; --noche-4: #22324D;
    --coral: #FF4D3A; --coral-2: #E8243A; --coral-soft: #FFE8E4;
    --turq: #22D3B6; --turq-2: #12B5A4; --turq-soft: #DDF8F2;
    --amarillo: #E9B827; --amarillo-soft: #FCF3D6;
    --nube: #F4F6FA; --blanco: #fff; --tinta: #0F172A; --gris: #5B6577; --gris-2: #8A94A6; --linea: #E3E8EF;
    --radio: 16px; --sombra: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
    font-family: Figtree, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--tinta); -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--nube); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--coral) 60%, transparent); outline-offset: 2px; }

/* ── Marca ── */
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 34px; height: 36px; }
.brand span { display: grid; line-height: 1; }
.brand small { font-size: 10px; font-weight: 700; letter-spacing: .32em; color: var(--gris-2); }
.brand b { font-size: 24px; font-weight: 850; letter-spacing: -.02em; color: var(--blanco); }

/* ── Barra superior ── */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; height: 68px; padding: 0 28px; background: linear-gradient(90deg, var(--noche), var(--noche-2)); color: #fff; }
.topnav { display: flex; gap: 6px; margin-right: auto; }
.topnav a { padding: 9px 14px; border-radius: 999px; color: #B8C3D6; font-weight: 600; font-size: 15px; text-decoration: none; transition: background .15s, color .15s; }
.topnav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.topnav a[aria-current='page'] { color: #fff; background: rgba(255, 255, 255, .1); }
.me { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #B8C3D6; }
.me .av { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--noche-4); color: #fff; font-weight: 700; font-size: 13px; }
.me button { background: none; border: 1px solid rgba(255, 255, 255, .16); color: #fff; border-radius: 999px; padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 13px; }
.me button:hover { background: rgba(255, 255, 255, .08); }

/* ── Página ── */
.page { max-width: 1240px; margin: 0 auto; padding: 36px 28px 80px; }
.page-head { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h1 { margin: 0; font-size: clamp(28px, 3vw, 38px); font-weight: 800; letter-spacing: -.025em; }
.page-head p { margin: 6px 0 0; color: var(--gris); font-size: 16px; }
.page-head .spacer { flex: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--coral-2); margin-bottom: 8px; }
.crumbs { font-size: 14px; color: var(--gris); margin-bottom: 10px; }
.crumbs a { text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--coral-2); }

/* ── Botones ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 12px; border: 0; background: linear-gradient(135deg, var(--coral), var(--coral-2)); color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; box-shadow: 0 6px 16px rgba(232, 36, 58, .25); transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(232, 36, 58, .3); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: var(--blanco); color: var(--tinta); border: 1px solid var(--linea); box-shadow: none; }
.btn.ghost:hover { border-color: #C9D2DE; background: #FAFBFD; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.danger { background: var(--blanco); color: var(--coral-2); border: 1px solid #F6C9C3; box-shadow: none; }
.btn.turq { background: linear-gradient(135deg, var(--turq), var(--turq-2)); color: #05302A; box-shadow: 0 6px 16px rgba(18, 181, 164, .25); }

/* ── Avisos ── */
.flash { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: 14px; margin-bottom: 22px; font-weight: 600; }
.flash.ok { background: var(--turq-soft); color: #075E52; }
.flash.err { background: var(--coral-soft); color: #9B1322; }
.flash ul { margin: 0; padding-left: 18px; }
.credentials { padding: 18px 20px; border-radius: 16px; background: var(--noche); color: #fff; margin-bottom: 22px; display: grid; gap: 6px; }
.credentials b { color: var(--amarillo); }
.credentials code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 16px; background: rgba(255, 255, 255, .08); padding: 3px 8px; border-radius: 6px; }
.credentials small { color: #9FB0C8; }

/* ── Tarjetas y secciones ── */
.card { background: var(--blanco); border: 1px solid var(--linea); border-radius: 20px; box-shadow: var(--sombra); }
.section { padding: 24px; margin-bottom: 22px; }
.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.section-head .count { min-width: 26px; height: 26px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--nube); color: var(--gris); font-size: 13px; font-weight: 700; }
.section-head .spacer { flex: 1; }
.empty { color: var(--gris); padding: 26px; text-align: center; border: 1.5px dashed var(--linea); border-radius: 14px; }

/* ── Empresas ── */
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.company { position: relative; display: grid; gap: 18px; padding: 22px; text-decoration: none; transition: transform .15s, box-shadow .15s; overflow: hidden; }
.company::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--coral), var(--amarillo)); }
.company:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(15, 23, 42, .06), 0 18px 36px rgba(15, 23, 42, .1); }
.company.off { opacity: .6; }
.company.off::before { background: var(--gris-2); }
.company-top { display: flex; gap: 14px; align-items: center; }
.logo-tile { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--noche); color: #fff; font-weight: 800; font-size: 17px; flex: none; }
.company h3 { margin: 0; font-size: 18px; font-weight: 800; }
.company p { margin: 2px 0 0; color: var(--gris); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--nube); border-radius: 12px; padding: 10px 12px; }
.stat b { display: block; font-size: 22px; font-weight: 800; }
.stat span { font-size: 12px; color: var(--gris); font-weight: 600; }
.live-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: #0B7A6A; }
.live-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--turq); box-shadow: 0 0 0 4px rgba(34, 211, 182, .2); }
.live-dot.off { color: var(--gris); }
.live-dot.off::before { background: #C3CBD8; box-shadow: none; }

/* ── Formularios ── */
.form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 16px; }
label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: #334155; }
label.field small { font-weight: 500; color: var(--gris); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], select, textarea {
    width: 100%; min-height: 44px; padding: 10px 14px; border: 1.5px solid var(--linea); border-radius: 12px; background: var(--blanco); font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 4px rgba(255, 77, 58, .14); }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--coral-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--linea); font-size: 14px; font-weight: 600; cursor: pointer; background: var(--blanco); transition: all .12s; }
.chip-check span i { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--gris-2)); }
.chip-check input:checked + span { border-color: var(--c, var(--coral)); background: color-mix(in srgb, var(--c, var(--coral)) 12%, white); }
.chip-check input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--coral) 50%, transparent); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Paneles desplegables (nuevo / editar) */
details.drawer { border-radius: 16px; }
details.drawer > summary { list-style: none; cursor: pointer; }
details.drawer > summary::-webkit-details-marker { display: none; }
details.drawer[open] > .drawer-body { animation: drop .18s ease-out; }
.drawer-body { margin-top: 14px; padding: 20px; border-radius: 16px; background: #FAFBFD; border: 1px solid var(--linea); }
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } }

/* ── Filas (personas, canales, equipos) ── */
.rows { display: grid; gap: 10px; }
.row { border: 1px solid var(--linea); border-radius: 16px; background: var(--blanco); }
.row > summary { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 14px 16px; }
.row > summary:hover { background: #FAFBFD; border-radius: 16px; }
.row[open] > summary { border-bottom: 1px solid var(--linea); border-radius: 16px 16px 0 0; }
.row .drawer-body { margin: 0; border: 0; border-radius: 0 0 16px 16px; }
.row-main b { display: block; font-size: 16px; font-weight: 700; }
.row-main small { color: var(--gris); font-size: 13px; }
.row-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--nube); color: #334155; white-space: nowrap; }
.tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--gris-2)); }
.tag.coral { background: var(--coral-soft); color: #9B1322; }
.tag.turq { background: var(--turq-soft); color: #075E52; }
.tag.amarillo { background: var(--amarillo-soft); color: #6B5200; }
.tag.off { background: #EEF1F5; color: var(--gris-2); }
.av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; background: var(--noche-3); flex: none; }
.av.device { border-radius: 12px; background: linear-gradient(135deg, var(--noche-3), var(--noche)); }
.av.device svg { width: 22px; height: 22px; }
.swatch { width: 42px; height: 42px; border-radius: 12px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); display: grid; place-items: center; color: #fff; }
.swatch svg { width: 20px; height: 20px; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors label { position: relative; }
.colors input { position: absolute; opacity: 0; }
.colors span { display: block; width: 32px; height: 32px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.colors input:checked + span { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.split .section { margin-bottom: 0; }
.company-hero { display: flex; gap: 18px; align-items: center; padding: 26px; margin-bottom: 22px; border-radius: 22px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, rgba(255, 77, 58, .35), transparent 50%), radial-gradient(90% 120% at 0% 100%, rgba(34, 211, 182, .18), transparent 55%), linear-gradient(135deg, var(--noche-3), var(--noche)); }
.company-hero .logo-tile { width: 64px; height: 64px; font-size: 22px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .15); }
.company-hero h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.company-hero p { margin: 4px 0 0; color: #B8C3D6; }
.company-hero .spacer { flex: 1; }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stats div { padding: 10px 16px; border-radius: 14px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); }
.hero-stats b { display: block; font-size: 22px; }
.hero-stats span { font-size: 12px; color: #B8C3D6; font-weight: 600; }

/* ── Ingreso ── */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--blanco); }
.login-art { position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: radial-gradient(80% 70% at 85% 15%, rgba(255, 77, 58, .45), transparent 60%), radial-gradient(70% 60% at 10% 95%, rgba(34, 211, 182, .28), transparent 60%), linear-gradient(160deg, var(--noche-3), var(--noche) 60%); }
.login-art h1 { font-size: clamp(36px, 4.4vw, 60px); line-height: 1.02; letter-spacing: -.035em; margin: 0 0 18px; font-weight: 850; max-width: 12ch; }
.login-art h1 em { font-style: normal; color: var(--amarillo); }
.login-art p { color: #B8C3D6; font-size: 18px; max-width: 40ch; margin: 0; line-height: 1.5; }
.waves { position: absolute; right: -120px; bottom: -120px; width: 520px; height: 520px; pointer-events: none; }
.waves span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(233, 184, 39, .22); animation: ripple 4.5s ease-out infinite; }
.waves span:nth-child(2) { animation-delay: 1.5s; }
.waves span:nth-child(3) { animation-delay: 3s; }
@keyframes ripple { from { transform: scale(.2); opacity: 1; } to { transform: scale(1); opacity: 0; } }
.login-points { display: flex; gap: 22px; flex-wrap: wrap; color: #D7DFEB; font-weight: 600; font-size: 15px; }
.login-points span { display: inline-flex; align-items: center; gap: 8px; }
.login-points i { width: 8px; height: 8px; border-radius: 50%; background: var(--turq); }
.login-form { display: grid; place-items: center; padding: 48px 28px; }
.login-form form { width: min(400px, 100%); display: grid; gap: 18px; }
.login-form h2 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.login-form h2 + .lead { margin: 6px 0 4px; color: var(--gris); }
.login-form .btn { min-height: 50px; font-size: 16px; }
.login-foot { font-size: 13px; color: var(--gris); text-align: center; }

/* ── Páginas públicas (privacidad, soporte) ── */
.doc { max-width: 760px; margin: 0 auto; padding: 48px 24px 80px; line-height: 1.65; }
.doc h1 { font-size: 34px; letter-spacing: -.02em; }
.doc h2 { font-size: 20px; margin-top: 30px; }
.doc-top { background: var(--noche); padding: 18px 24px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 900px) {
    .login { grid-template-columns: 1fr; }
    .login-art { min-height: 300px; padding: 32px 24px; }
    .split { grid-template-columns: 1fr; }
    .topbar { padding: 0 16px; gap: 14px; }
    .me span.name { display: none; }
    .page { padding: 24px 16px 60px; }
    .company-hero { flex-wrap: wrap; }
    .row > summary { grid-template-columns: auto 1fr; }
    .row-tags { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 560px) {
    .topbar { gap: 8px; padding: 0 12px; }
    .brand small { display: none; }
    .brand b { font-size: 20px; }
    .brand img { width: 28px; height: 30px; }
    .topnav a { padding: 8px 10px; font-size: 14px; }
    .me .av { display: none; }
    .me button { padding: 6px 10px; }
}
