/* IPControl Client Portal Styles — diseño "flat moderno" (navy + cielo)
   Tokens de diseño: cambiar aquí re-tematiza todo el portal. */

:root {
    --cp-primary: #0284c7;        /* sky-600 — CTA */
    --cp-primary-dark: #075985;   /* sky-800 */
    --cp-accent: #0ea5e9;         /* sky-500 */
    --cp-ink: #0f172a;
    --cp-muted: #64748b;
    --cp-surface: #f4f7fb;        /* fondo de página */
    --cp-card: #ffffff;
    --cp-border: #e3e9f2;
    --cp-navy: #0b1a2e;           /* barra superior */
    --cp-navy-2: #12294a;
    --cp-radius: 16px;
    --cp-radius-sm: 10px;
    --cp-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --cp-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Consolas, monospace;
    --cp-card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
    --cp-card-shadow-hover: 0 4px 10px rgba(2, 62, 138, 0.08), 0 16px 36px rgba(2, 62, 138, 0.12);
    --bs-font-monospace: var(--cp-mono);
}

body {
    background-color: var(--cp-surface);
    color: var(--cp-ink);
    font-family: var(--cp-font);
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
}

code, .font-monospace { font-family: var(--cp-mono); }

/* Títulos de página (h3 de cada vista) */
h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}
h3 .bi, h3 .ph-duotone {
    color: var(--cp-primary);
    margin-right: 0.15rem;
}

/* ---------- Navbar ---------- */

.navbar,
.client-navbar {
    background: linear-gradient(120deg, var(--cp-navy) 0%, var(--cp-navy-2) 100%) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 8px 24px rgba(4, 18, 38, 0.35);
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.client-navbar .navbar-brand {
    font-weight: 800;
    letter-spacing: -0.01em;
}
.client-navbar .navbar-brand .bi,
.client-navbar .navbar-brand .ph-duotone {
    color: var(--cp-accent);
    margin-right: 0.2rem;
}

.lang-switch {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
}
.lang-switch a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    padding: 0 2px;
}
.lang-switch a.active { color: #fff; text-decoration: underline; }
.lang-switch a:hover { color: #fff; }

/* Aviso flotante al copiar CIDR */
.copy-toast {
    position: fixed;
    z-index: 3000;
    background: var(--cp-ink);
    color: #fff;
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.35);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.copy-toast.show { opacity: 1; transform: translateY(0); }

.copyable { cursor: pointer; }
.copyable:hover { text-decoration: underline; text-decoration-style: dotted; }

.brand-badge {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    background: linear-gradient(120deg, rgba(14, 165, 233, 0.35), rgba(14, 165, 233, 0.15));
    border: 1px solid rgba(125, 211, 252, 0.35);
    color: #bae6fd;
    padding: 0.22rem 0.55rem;
    border-radius: 20px;
    vertical-align: middle;
}

.client-navbar .nav-link {
    border-radius: 10px;
    margin: 0 2px;
    padding: 0.45rem 0.85rem;
    font-weight: 600;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.72);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.client-navbar .nav-link.active {
    background-color: rgba(14, 165, 233, 0.22);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.25) inset;
}

.client-navbar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.09);
    color: #fff;
}

/* ---------- Botones ---------- */

.btn {
    border-radius: var(--cp-radius-sm);
    font-weight: 600;
    transition: background-color 0.15s ease, border-color 0.15s ease,
                color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn-primary {
    --bs-btn-bg: var(--cp-primary);
    --bs-btn-border-color: var(--cp-primary);
    --bs-btn-hover-bg: var(--cp-primary-dark);
    --bs-btn-hover-border-color: var(--cp-primary-dark);
    --bs-btn-active-bg: var(--cp-primary-dark);
    --bs-btn-active-border-color: var(--cp-primary-dark);
    background-color: var(--cp-primary);
    border-color: var(--cp-primary);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.28);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--cp-primary-dark);
    border-color: var(--cp-primary-dark);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
}

.btn-outline-primary {
    --bs-btn-color: var(--cp-primary);
    --bs-btn-border-color: #bfdcf0;
    color: var(--cp-primary);
    border-color: #bfdcf0;
}
.btn-outline-primary:hover {
    background-color: var(--cp-primary);
    border-color: var(--cp-primary);
    color: #fff;
}

.btn-outline-secondary {
    --bs-btn-border-color: var(--cp-border);
    border-color: var(--cp-border);
    color: #475569;
}
.btn-outline-secondary:hover {
    background: #eef4fa;
    border-color: #cfdbe9;
    color: var(--cp-ink);
}

.btn:focus-visible {
    outline: 2px solid var(--cp-accent);
    outline-offset: 2px;
}

/* ---------- Formularios ---------- */

.form-control, .form-select {
    border-radius: var(--cp-radius-sm);
    border-color: var(--cp-border);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--cp-accent);
    box-shadow: 0 0 0 0.2rem rgba(14, 165, 233, 0.15);
}
.input-group-text {
    border-radius: var(--cp-radius-sm);
    border-color: var(--cp-border);
    background: #f8fafc;
    color: var(--cp-muted);
}

/* ---------- Cards ---------- */

code {
    font-size: 0.95em;
    color: var(--cp-primary-dark);
}

.card {
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius);
    box-shadow: var(--cp-card-shadow);
    background: var(--cp-card);
}

.card-header {
    font-weight: 700;
    background: #fff;
    border-bottom: 1px solid #eef2f7;
    border-radius: var(--cp-radius) var(--cp-radius) 0 0 !important;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}
.card-header .bi, .card-header .ph-duotone { color: var(--cp-primary); }

.badge { border-radius: 20px; font-weight: 600; }

/* Tarjetas de estadísticas del panel */
.stat-card {
    border-radius: var(--cp-radius);
    padding: 1.25rem 1.4rem;
    background: var(--cp-card);
    border: 1px solid var(--cp-border);
    box-shadow: var(--cp-card-shadow);
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--cp-card-shadow-hover);
}
.stat-card::after {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cp-accent), transparent 70%);
    opacity: 0.55;
}

.stat-card .stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.stat-card .stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat-card .stat-label {
    color: var(--cp-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.icon-sky { background: #e0f2fe; color: #0369a1; }
.icon-green { background: #dcfce7; color: #15803d; }
.icon-amber { background: #fef3c7; color: #b45309; }
.icon-violet { background: #ede9fe; color: #6d28d9; }

/* ---------- Marketplace ---------- */

/* Hero superior con buscador y filtros (.market-hero) y su variante
   compacta para cabeceras de página (.page-hero) */
.market-hero,
.page-hero {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 1.5rem 1.6rem 1.35rem;
    color: #fff;
    background:
        radial-gradient(560px 260px at 88% -30%, rgba(14, 165, 233, 0.45), transparent 65%),
        radial-gradient(420px 220px at -5% 130%, rgba(2, 132, 199, 0.35), transparent 60%),
        linear-gradient(120deg, var(--cp-navy) 0%, var(--cp-navy-2) 100%);
    box-shadow: 0 16px 40px rgba(4, 18, 38, 0.28);
}
.market-hero::before,
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 197, 233, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 197, 233, 0.06) 1px, transparent 1px);
    background-size: 38px 38px;
    pointer-events: none;
}
.market-hero > *,
.page-hero > * { position: relative; }

/* Variante compacta */
.page-hero {
    padding: 1.15rem 1.4rem;
    border-radius: 18px;
}

.market-hero-title,
.page-hero-title {
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.market-hero-title .bi,
.market-hero-title .ph-duotone,
.page-hero-title .bi,
.page-hero-title .ph-duotone { color: var(--cp-accent); }

.market-hero-sub,
.page-hero-sub {
    color: rgba(226, 240, 252, 0.75);
    font-size: 0.9rem;
    max-width: 720px;
}

.market-hero-stats {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.market-hero-stat {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(148, 197, 233, 0.22);
    border-radius: 12px;
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    color: rgba(226, 240, 252, 0.8);
    white-space: nowrap;
}
.market-hero-stat .market-hero-num {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    margin-right: 0.15rem;
    font-variant-numeric: tabular-nums;
}

.market-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.1rem;
}

.market-search {
    position: relative;
    flex: 0 1 300px;
    min-width: 210px;
}
.market-search .bi,
.market-search .ph-duotone {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(226, 240, 252, 0.55);
    pointer-events: none;
}
.market-search input {
    width: 100%;
    border: 1px solid rgba(148, 197, 233, 0.28);
    border-radius: var(--cp-radius-sm);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.5rem 0.9rem 0.5rem 2.3rem;
    font-size: 0.9rem;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.market-search input::placeholder { color: rgba(226, 240, 252, 0.5); }
.market-search input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.16);
    border-color: var(--cp-accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
}

.market-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.market-chip {
    border: 1px solid rgba(148, 197, 233, 0.28);
    background: rgba(255, 255, 255, 0.07);
    color: rgba(226, 240, 252, 0.8);
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--cp-mono);
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.market-chip:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.market-chip.active {
    background: var(--cp-accent);
    border-color: var(--cp-accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}
.market-chip:focus-visible {
    outline: 2px solid var(--cp-accent);
    outline-offset: 2px;
}

.market-refresh {
    border-radius: var(--cp-radius-sm);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.92);
}

.market-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.market-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--cp-card-shadow-hover);
    border-color: #bfdcf0;
}

/* Entrada escalonada de las tarjetas del marketplace */
@media (prefers-reduced-motion: no-preference) {
    #marketGrid > * {
        animation: mk-in 0.45s cubic-bezier(0.22, 0.9, 0.34, 1) backwards;
    }
    #marketGrid > *:nth-child(1)  { animation-delay: 0.03s; }
    #marketGrid > *:nth-child(2)  { animation-delay: 0.08s; }
    #marketGrid > *:nth-child(3)  { animation-delay: 0.13s; }
    #marketGrid > *:nth-child(4)  { animation-delay: 0.18s; }
    #marketGrid > *:nth-child(5)  { animation-delay: 0.23s; }
    #marketGrid > *:nth-child(6)  { animation-delay: 0.28s; }
    #marketGrid > *:nth-child(7)  { animation-delay: 0.33s; }
    #marketGrid > *:nth-child(8)  { animation-delay: 0.38s; }
    #marketGrid > *:nth-child(n+9) { animation-delay: 0.42s; }
}
@keyframes mk-in {
    from { opacity: 0; transform: translateY(14px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

/* Resaltado de tarjetas recién creadas tras una división */
@keyframes market-pulse {
    0% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.55); }
    100% { box-shadow: 0 0 0 14px rgba(14, 165, 233, 0); }
}

.market-card-new {
    border: 2px solid var(--cp-accent) !important;
    animation: market-pulse 1.2s ease-out 2;
}

.market-cidr {
    font-family: var(--cp-mono);
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--cp-primary-dark);
    letter-spacing: -0.01em;
}

/* Chip de nº de IPs en la tarjeta */
.mk-ips {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.28rem 0.6rem;
    border-radius: 20px;
    background: #eef4fa;
    border: 1px solid var(--cp-border);
    color: #475569;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Bloque de precio */
.mk-price {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.mk-price-value {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--cp-ink);
    font-variant-numeric: tabular-nums;
}
.mk-price-unit {
    color: var(--cp-muted);
    font-size: 0.85rem;
    font-weight: 500;
}
.mk-price-per {
    font-size: 0.8rem;
    color: var(--cp-muted);
}
.mk-split {
    font-size: 0.8rem;
    color: var(--cp-muted);
}
.mk-split .bi, .mk-split .ph-duotone { color: var(--cp-primary); }

.mk-divider {
    border: 0;
    border-top: 1px dashed var(--cp-border);
    margin: 0.75rem 0;
}

.term-option {
    cursor: pointer;
    border: 2px solid #e2e8f0;
    border-radius: var(--cp-radius-sm);
    padding: 0.6rem 0.75rem;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.term-option:hover {
    border-color: var(--cp-accent);
}

.term-option.selected {
    border-color: var(--cp-primary);
    background: #f0f9ff;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.term-option .term-discount {
    font-size: 0.75rem;
}

/* Selección de sub-rango al alquilar por partes: lista de CIDRs resultantes */
.subrange-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    padding: 2px;
}

.subrange-opt {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.4rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.1s ease, background 0.1s ease;
}

.subrange-opt code {
    font-size: 0.82rem;
    color: #334155;
}

.subrange-opt:hover { border-color: var(--cp-accent); }

.subrange-opt.selected {
    border-color: var(--cp-primary-dark);
    background: #f0f9ff;
}

.subrange-opt.selected code { color: var(--cp-primary-dark); font-weight: 700; }

/* ---------- Badges BGP ---------- */

.bgp-badge {
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    padding: 0.3rem 0.65rem;
    white-space: nowrap;
}

.bgp-announced { background: #dcfce7; color: #15803d; }
.bgp-not-announced { background: #f1f5f9; color: #64748b; }
.bgp-error { background: #fef3c7; color: #b45309; }

/* ---------- Tablas y botones ---------- */

.btn-group-sm .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

.table td {
    vertical-align: middle;
}

.table > :not(caption) > * > * {
    border-bottom-color: #eef2f7;
}
.table-hover > tbody > tr:hover > * {
    background-color: #f0f7fd;
}

/* Cabeceras de tabla modernas (sustituyen al viejo thead.table-dark) */
.table thead th {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--cp-muted);
    background: #f8fafc;
    border-bottom: 2px solid #e8eef6;
    white-space: nowrap;
}

/* Filas alternas más suaves que el gris Bootstrap */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: #f8fbfe;
}

/* Paginación */
.pagination .page-link {
    border: 1px solid var(--cp-border);
    color: var(--cp-primary-dark);
    font-weight: 600;
    margin: 0 2px;
    border-radius: 8px;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.pagination .page-link:hover { background: #eef6fc; }
.pagination .page-item.active .page-link {
    background: var(--cp-primary);
    border-color: var(--cp-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

/* Switches (renovación automática) */
.form-check-input { border-color: #cbd5e1; }
.form-check-input:checked {
    background-color: var(--cp-primary);
    border-color: var(--cp-primary);
}
.form-check-input:focus {
    border-color: var(--cp-accent);
    box-shadow: 0 0 0 0.2rem rgba(14, 165, 233, 0.15);
}

.modal-xl {
    max-width: 1000px;
}

.modal-content {
    border: none;
    border-radius: var(--cp-radius);
    box-shadow: 0 24px 70px rgba(4, 18, 38, 0.35);
}
.modal-header { border-bottom-color: #eef2f7; }
.modal-footer { border-top-color: #eef2f7; }

/* ---------- Resultados AJAX (usados por client-app.js) ---------- */

.result-success {
    padding: 1rem;
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    border-radius: var(--cp-radius-sm);
    color: #065f46;
}

.result-error {
    padding: 1rem;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: var(--cp-radius-sm);
    color: #991b1b;
}

/* Range search input */
.range-search-input {
    max-width: 200px;
}

/* Clickable CIDR link */
.cidr-link {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.cidr-link:hover {
    color: var(--cp-primary);
    text-decoration-style: solid;
}

/* RIPE object viewer table */
.ripe-object-table {
    font-size: 0.85rem;
}

.ripe-object-table td {
    padding: 0.3rem 0.5rem;
    word-break: break-all;
}

.ripe-attr-name {
    font-weight: 600;
    white-space: nowrap;
    width: 150px;
    background-color: #f8f9fa;
    color: #495057;
}

/* Autocomplete dropdown */
.autocomplete-dropdown {
    display: none;
    position: absolute;
    z-index: 1050;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.autocomplete-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background-color: #e9ecef;
}

/* ---------- Consola de rango ---------- */

.range-card {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.range-card .card-body {
    padding: 0.8rem 0.95rem;
}

.dash-range-row { cursor: pointer; }
.dash-range-row:hover { background: #f0f9ff; }

/* Fila del Panel: CIDR + chips compactos + copiar, todo en una línea */
.dash-cidr-cell, .dash-copy-cell {
    width: 1%;
    white-space: nowrap;
}
.dash-intel-cell { overflow: hidden; }
.range-intel-compact {
    flex-wrap: nowrap;
    overflow: hidden;
    min-height: auto;
}
.range-intel-compact .rc-chip {
    flex-shrink: 0;
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
}

.range-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--cp-card-shadow-hover);
    border-color: #bfdcf0;
}

.range-console .modal-content {
    border: none;
    border-radius: var(--cp-radius);
}

.range-console .modal-body {
    min-height: 55vh;
    padding: 0.5rem 1.1rem 1.1rem;
}

.rc-header {
    align-items: flex-start;
    border-bottom: 1px solid #e5effa;
    background:
        radial-gradient(420px 140px at 92% -40%, rgba(14, 165, 233, 0.14), transparent 65%),
        linear-gradient(180deg, #f2f9ff 0%, #ffffff 100%);
    border-radius: var(--cp-radius) var(--cp-radius) 0 0;
    padding: 1rem 1.1rem 0.85rem;
}

.rc-cidr {
    font-family: var(--cp-mono);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--cp-primary-dark);
}

.btn-ghost {
    border: none;
    color: var(--cp-muted);
}
.btn-ghost:hover { color: var(--cp-primary-dark); background: #eef6fc; }

.rc-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    background: #f1f5f9;
    color: #475569;
    white-space: nowrap;
}
.rc-chip-green { background: #dcfce7; color: #15803d; }
.rc-chip-blue { background: #e0f2fe; color: #0369a1; }
.rc-chip-red { background: #fee2e2; color: #b91c1c; }
.rc-chip-violet { background: #ede9fe; color: #6d28d9; }

/* Un color por tipo de objeto RIPE, consistente en tarjetas y consola */
.rc-chip-inetnum { background: #e0f2fe; color: #0369a1; }   /* azul cielo */
.rc-chip-route { background: #fef3c7; color: #b45309; }     /* ámbar */
.rc-chip-roa { background: #ede9fe; color: #6d28d9; }       /* violeta */

/* Chip de país con mini-mapa emergente al pasar el ratón */
.rc-geo-chip { cursor: help; }

.geo-popover {
    position: fixed;
    z-index: 2100;
    width: 320px;
    height: 220px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.3);
    border: 1px solid #e2e8f0;
    background: #fff;
    display: none;
}

.rc-flag {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    vertical-align: -2px;
}

/* Campo bloqueado (prefijo/netname que el cliente no puede editar) */
.rc-locked {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    font-family: var(--cp-mono);
    font-weight: 600;
    color: #475569;
}

/* Chips de estado RIPE en tarjetas de Mis Rangos */
.range-flags {
    min-height: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.rc-flag-chip { cursor: pointer; }
.rc-flag-chip:hover { filter: brightness(0.93); }

.rc-chip-muted {
    background: #f8fafc;
    color: #94a3b8;
    border: 1px dashed #cbd5e1;
}

/* Tooltip whois (hover sobre el netname) */
.rc-whois-tip {
    --bs-tooltip-max-width: 460px;
    --bs-tooltip-bg: #0f172a;
}
.rc-whois-tip .tooltip-inner {
    text-align: left;
    white-space: pre;
    font-family: var(--cp-mono);
    font-size: 0.72rem;
    max-width: 460px;
    overflow-x: hidden;
}

/* Línea de intel en tarjetas (rangos y marketplace) */
.range-intel {
    min-height: 22px;
    font-size: 0.82rem;
    color: var(--cp-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.rc-tabs {
    background: #fff;
    padding: 0.75rem 0 0.5rem;
    z-index: 5;
    gap: 4px;
}
.rc-tabs .nav-link {
    color: var(--cp-muted);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--cp-radius-sm);
    padding: 0.4rem 0.85rem;
    border: 1px solid transparent;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.rc-tabs .nav-link:hover { background: #f1f5f9; color: var(--cp-ink); }
.rc-tabs .nav-link.active {
    background: #e0f2fe;
    color: var(--cp-primary-dark);
    border-color: #bae6fd;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.12);
}
.rc-tabs .nav-link.active .bi,
.rc-tabs .nav-link.active .ph-duotone { color: var(--cp-primary); }

.rc-tab-plus {
    opacity: 0.55;
    font-weight: 400;
    margin: 0 1px;
}

.rc-asn {
    font-family: var(--cp-mono);
    font-weight: 700;
    font-size: 1rem;
    color: var(--cp-primary-dark);
}

.rc-section {
    background: #fff;
    border: 1px solid #e8eef6;
    border-radius: 14px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.rc-section-title {
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cp-muted);
    margin-bottom: 0.75rem;
}

.rc-danger-zone { border-color: #fecaca; background: #fffafa; }

.rc-attrs { font-size: 0.85rem; }
.rc-attr {
    display: flex;
    border-bottom: 1px solid #f4f6f9;
    padding: 0.3rem 0;
}
.rc-attr:last-child { border-bottom: none; }
.rc-attr-name {
    width: 130px;
    min-width: 130px;
    font-weight: 600;
    color: #64748b;
}
.rc-attr-value { word-break: break-all; font-family: var(--cp-mono); }

.rc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid #f4f6f9;
}
.rc-item:last-child { border-bottom: none; }

.rc-empty {
    text-align: center;
    color: var(--cp-muted);
    padding: 1.5rem 1rem;
}
.rc-empty i { font-size: 2.2rem; opacity: 0.4; }
.rc-empty p { margin: 0.5rem 0 0; }

.rc-hint {
    font-size: 0.85rem;
    color: #0369a1;
    background: #f0f9ff;
    border-radius: var(--cp-radius-sm);
    padding: 0.6rem 0.85rem;
    margin-bottom: 1rem;
}

.rc-status-card {
    background: #fff;
    border: 1px solid #e8eef6;
    border-radius: 14px;
    padding: 1rem;
    height: 100%;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.rc-status-card:hover { box-shadow: var(--cp-card-shadow-hover); border-color: #bfdcf0; }

.rc-status-card { padding: 0.8rem 0.9rem; }

.rc-status-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
/* Icono con el color de su tipo de objeto (apagado si no existe) */
.rc-status-icon.i-inetnum { background: #e0f2fe; color: #0369a1; }
.rc-status-icon.i-geo { background: #dcfce7; color: #15803d; }
.rc-status-icon.i-route { background: #fef3c7; color: #b45309; }
.rc-status-icon.i-roa { background: #ede9fe; color: #6d28d9; }
.rc-status-icon.pending { background: #f1f5f9; color: #94a3b8; }

.rc-state-dot {
    width: 10px; height: 10px; border-radius: 50%;
}
.rc-state-dot.ok { background: #22c55e; }
.rc-state-dot.pending { background: #ef4444; }

/* Mapa de selección de ubicación (Leaflet) */
.rc-map {
    height: 280px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    z-index: 1;
}

.rc-skeleton { padding: 0.5rem 0; }
.rc-skel-line {
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%);
    background-size: 200% 100%;
    animation: rc-shimmer 1.2s infinite;
    margin-bottom: 0.6rem;
}
.rc-skel-line:nth-child(2) { width: 85%; }
.rc-skel-line:nth-child(3) { width: 60%; }

@keyframes rc-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- Login ---------- */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(900px 480px at 12% -10%, rgba(14, 165, 233, 0.35), transparent 60%),
        radial-gradient(720px 420px at 95% 110%, rgba(2, 132, 199, 0.3), transparent 60%),
        linear-gradient(135deg, #081120 0%, #0b1a2e 55%, #0f2c4d 100%);
}

/* Rejilla sutil de fondo */
.login-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 197, 233, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 197, 233, 0.055) 1px, transparent 1px);
    background-size: 42px 42px;
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 430px;
    border: 1px solid rgba(148, 197, 233, 0.18);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 30px 80px rgba(2, 12, 27, 0.55);
    position: relative;
}

.login-logo {
    width: 68px;
    height: 68px;
    margin: 0 auto;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    background: linear-gradient(135deg, var(--cp-accent), var(--cp-primary-dark));
    box-shadow: 0 10px 26px rgba(2, 132, 199, 0.45);
}

.login-brand {
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--cp-ink);
}

.login-sub {
    color: var(--cp-muted);
    font-weight: 500;
}
