/* ==========================================================================
   GOINTO.LINK - THEME PRINCIPAL (THEPORNAPP AESTHETICS)
   ========================================================================== */

:root {
    --tpa-orange: #ff5722;
    --tpa-orange-hover: #ff7043;
    --tpa-orange-dark: #e64a19;
    --tpa-orange-subtle: rgba(255, 87, 34, 0.12);
    --tpa-orange-border: rgba(255, 87, 34, 0.25);
    
    --tpa-bg-black: #050505;
    --tpa-bg-card: rgba(18, 18, 18, 0.92);
    --tpa-bg-item: rgba(10, 10, 10, 0.75);
    --tpa-border: #1f1f1f;
    --tpa-border-card: rgba(255, 87, 34, 0.25);
    
    --tpa-text-main: #ffffff;
    --tpa-text-muted: #a3a3a3;
    --tpa-text-dim: #737373;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--tpa-bg-black) !important;
    color: var(--tpa-text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
}

/* ==========================================================================
   NAVBAR & HEADER
   ========================================================================== */
.topbar-nav {
    width: 100%;
    background-color: #0a0a0a;
    border-bottom: 1px solid var(--tpa-orange-border);
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-wrapper {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #ffffff;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -0.02em;
}

.topbar-logo {
    width: 30px !important;
    height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    object-fit: contain;
    display: inline-block;
}

.topbar-list {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.topbar-item {
    margin: 0;
    padding: 0;
    list-style: none;
}

.topbar-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--tpa-text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.topbar-link:hover {
    color: #ffffff;
    background-color: #171717;
}

.topbar-btn-login {
    background: linear-gradient(135deg, var(--tpa-orange) 0%, var(--tpa-orange-dark) 100%);
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(255, 87, 34, 0.35);
}

.topbar-btn-login:hover {
    background: linear-gradient(135deg, var(--tpa-orange-hover) 0%, #f4511e 100%);
    box-shadow: 0 6px 18px rgba(255, 87, 34, 0.5);
}

.topbar-btn-logout {
    color: #f87171;
}

.topbar-btn-logout:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.12);
}

/* ==========================================================================
   FONDOS AMBIENTALES & CONTENEDORES
   ========================================================================== */
.tpa-ambient-bg {
    min-height: calc(100vh - 64px);
    background: radial-gradient(circle at 50% 20%, #1f0d04 0%, var(--tpa-bg-black) 75%);
    position: relative;
    overflow: hidden;
}

.tpa-ambient-bg::before {
    content: '';
    position: absolute;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(255, 87, 34, 0.18) 0%, transparent 65%);
    top: 15%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
}

.tpa-page-container {
    position: relative;
    z-index: 1;
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px 24px 60px 24px;
    box-sizing: border-box;
}

.tpa-page-header {
    margin-bottom: 24px;
}

.tpa-page-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 4px 0;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.tpa-page-title span {
    color: var(--tpa-orange);
}

.tpa-page-subtitle {
    color: var(--tpa-text-muted);
    font-size: 13px;
    margin: 0;
}

/* ==========================================================================
   TARJETAS & COMPONENTES DASHBOARD
   ========================================================================== */
.dash-card {
    background: var(--tpa-bg-card);
    border: 1px solid var(--tpa-border-card);
    border-radius: 18px;
    padding: 22px 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease;
}

.dash-card:hover {
    border-color: rgba(255, 87, 34, 0.45);
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: #f5f5f5;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: var(--tpa-orange);
    border-radius: 2px;
}

.chart-box-donut {
    position: relative;
    height: 200px;
    margin-bottom: 16px;
}

.chart-box-wide {
    position: relative;
    height: 270px;
    width: 100%;
}

.chart-box-custom {
    position: relative;
    height: 220px;
    width: 100%;
    margin-bottom: 16px;
}

.stat-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: var(--tpa-bg-item);
    border: 1px solid var(--tpa-border);
    font-size: 13px;
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #d4d4d4;
}

.stat-badge {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.stat-value {
    font-weight: 700;
    color: #ffffff;
}

.scroll-box {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.scroll-box::-webkit-scrollbar,
.column-list::-webkit-scrollbar {
    width: 5px;
}

.scroll-box::-webkit-scrollbar-thumb,
.column-list::-webkit-scrollbar-thumb {
    background: #262626;
    border-radius: 4px;
}

.table-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    background-color: var(--tpa-bg-item);
    border: 1px solid var(--tpa-border);
    border-radius: 8px;
    font-size: 13px;
}

.badge-pill {
    color: var(--tpa-orange-hover);
    font-weight: 700;
    background: var(--tpa-orange-subtle);
    border: 1px solid rgba(255, 87, 34, 0.3);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
}

/* Grids layout */
.dashboard-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.row-charts {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
    align-items: stretch;
}

.row-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 1024px) {
    .row-charts, .row-lists {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   TABLA TOP ENLACES
   ========================================================================== */
.top-links-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.top-links-table th {
    color: var(--tpa-text-muted);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    padding: 6px 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.top-links-table td {
    background-color: var(--tpa-bg-item);
    border-top: 1px solid var(--tpa-border);
    border-bottom: 1px solid var(--tpa-border);
    padding: 12px;
    font-size: 13px;
}

.top-links-table td:first-child {
    border-left: 1px solid var(--tpa-border);
    border-radius: 10px 0 0 10px;
}

.top-links-table td:last-child {
    border-right: 1px solid var(--tpa-border);
    border-radius: 0 10px 10px 0;
}

.post-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--tpa-orange-subtle);
    border: 1px solid rgba(255, 87, 34, 0.28);
    color: #ff8a65;
    font-size: 11px;
    font-weight: 600;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.link-url-text {
    color: #ffffff;
    text-decoration: none;
    word-break: break-all;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-url-text:hover {
    color: var(--tpa-orange-hover);
}

/* ==========================================================================
   BOTONES & ACCIONES GENERALES
   ========================================================================== */
.btn-tpa-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, var(--tpa-orange) 0%, var(--tpa-orange-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(255, 87, 34, 0.4);
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-tpa-primary:hover {
    background: linear-gradient(135deg, var(--tpa-orange-hover) 0%, #f4511e 100%);
    box-shadow: 0 6px 24px rgba(255, 87, 34, 0.6);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-tpa-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 20px;
    background-color: #121212;
    border: 1px solid rgba(255, 87, 34, 0.4);
    color: #ff8a65;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-tpa-secondary:hover {
    background-color: #1a1a1a;
    border-color: var(--tpa-orange);
    color: #ffffff;
}

/* ==========================================================================
   GUEST HERO LANDING & TARJETA CENTRADA
   ========================================================================== */
.tpa-center-wrap {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: radial-gradient(circle at 50% 35%, #1f0d04 0%, var(--tpa-bg-black) 70%);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.tpa-center-wrap::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 87, 34, 0.22) 0%, transparent 65%);
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(80px);
    pointer-events: none;
}

.tpa-modal-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
    background: var(--tpa-bg-card);
    border: 1px solid rgba(255, 87, 34, 0.35);
    border-radius: 24px;
    padding: 36px 30px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(255, 87, 34, 0.15);
    backdrop-filter: blur(12px);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.tpa-modal-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 87, 34, 0.65);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.95), 0 0 50px rgba(255, 87, 34, 0.3);
}

.tpa-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 9999px;
    background: var(--tpa-orange-subtle);
    border: 1px solid rgba(255, 87, 34, 0.35);
    color: #ff8a65;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 22px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.tpa-dot {
    width: 7px;
    height: 7px;
    background-color: var(--tpa-orange);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--tpa-orange);
    animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.tpa-img-box {
    position: relative;
    display: inline-block;
    margin-bottom: 22px;
    border-radius: 18px;
    padding: 4px;
    background: linear-gradient(135deg, rgba(255, 87, 34, 0.7) 0%, rgba(255, 112, 67, 0.1) 100%);
}

.tpa-img-box img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
    display: block;
    transition: transform 0.3s ease;
}

.tpa-modal-card:hover .tpa-img-box img {
    transform: scale(1.02);
}

.tpa-title {
    color: #ffffff;
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
}

.tpa-desc {
    color: var(--tpa-text-muted);
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 26px 0;
}

/* ==========================================================================
   FORMULARIOS (LOGIN & SHORTENED)
   ========================================================================== */
.tpa-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
    margin-bottom: 16px;
}

.tpa-form-label {
    color: #d4d4d4;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.tpa-form-input {
    width: 100% !important;
    padding: 13px 14px;
    background-color: #0a0a0a !important;
    border: 1px solid #262626 !important;
    border-radius: 10px;
    color: #ffffff !important;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tpa-form-input:focus {
    border-color: var(--tpa-orange) !important;
    box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.25) !important;
}

.tpa-form-input::placeholder {
    color: #525252;
}

.tpa-alert-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 20px;
    text-align: left;
}

/* Resultado acortador */
.result-box {
    display: none;
    background-color: #0a0a0a;
    border: 1px solid #262626;
    border-radius: 14px;
    padding: 16px;
    text-align: left;
    margin-top: 14px;
    box-sizing: border-box;
}

.result-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #ff8a65;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: block;
}

.result-body {
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-link {
    flex: 1;
    font-size: 13px;
    color: #ffffff;
    text-decoration: none;
    word-break: break-all;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background-color: #1f1f1f;
    border: 1px solid #333333;
    color: #ffffff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    border-color: var(--tpa-orange);
    color: #ff8a65;
}

.btn-copy.copied {
    background-color: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #34d399;
}

/* ==========================================================================
   VISTA VERIFICAR ENLACES & AUDITORÍA
   ========================================================================== */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--tpa-bg-card);
    border: 1px solid var(--tpa-border-card);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
}

.metric-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric-value {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.chart-panel-row {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 960px) {
    .chart-panel-row {
        grid-template-columns: 1fr;
    }
}

.search-input {
    width: 100%;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #0a0a0a;
    border: 1px solid #262626;
    border-radius: 12px;
    color: #ffffff;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.search-input:focus {
    border-color: var(--tpa-orange);
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.column-box {
    background: var(--tpa-bg-card);
    border: 1px solid var(--tpa-border-card);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.column-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--tpa-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.column-list {
    max-height: 440px;
    overflow-y: auto;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.link-row {
    background-color: var(--tpa-bg-item);
    border: 1px solid var(--tpa-border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    word-break: break-all;
}

.link-row a {
    color: #d4d4d4;
    text-decoration: none;
    transition: color 0.15s ease;
}

.link-row a:hover {
    color: var(--tpa-orange-hover);
}

.link-row-empty {
    color: var(--tpa-text-dim);
    font-size: 12px;
    text-align: center;
    padding: 20px 0;
}

/* ============================================================
   1. RESET BÁSICO Y CONTENCIÓN
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* ============================================================
   2. NAVBAR RESPONSIVE
   ============================================================ */
.topbar-container {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #111827;
  font-weight: 700;
  font-size: 1.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-item {
  text-decoration: none;
  color: #4b5563;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-item:hover {
  color: #111827;
}

/* Botón Hamburguesa */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger-bar {
  height: 3px;
  width: 100%;
  background-color: #1f2937;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Breakpoint Móvil para Navegación */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    background: #ffffff;
    padding: 1.25rem 1rem;
    border-bottom: 2px solid #e5e7eb;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
    gap: 1rem;
  }

  .nav-links.nav-open {
    display: flex;
  }

  .nav-item {
    width: 100%;
    padding: 0.5rem 0;
  }
}

/* ============================================================
   3. GRÁFICOS Y ANALÍTICA RESPONSIVE
   ============================================================ */

/* Contenedores de tarjetas/gráficos en Grid o Flex */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

/* Wrapper obligatorio para que Canvas / SVG de Chart.js o ApexCharts no rompa el viewport */
.chart-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem;
  min-width: 0; /* Previene desborde en flex/grid hijos */
}

.chart-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: 260px;
  height: 350px;
}

/* Forzar contención de cualquier canvas o svg generado */
.chart-wrapper canvas,
.chart-wrapper svg {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  display: block;
}

@media (max-width: 480px) {
  .chart-wrapper {
    height: 240px; /* Reducción de altura vertical en móviles estrechos */
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
    padding: 0 0.5rem;
  }
}
/* ============================================================
   RESPONSIVE FIX: GLOBAL, MENU & CHARTS
   ============================================================ */

/* 1. Evitar desbordamiento horizontal global */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. Menú de Navegación Responsive (menu.html) */
.topbar-container {
  width: 100%;
  position: relative;
  z-index: 1000;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger-bar {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #e5e7eb;
  border-radius: 2px;
  transition: all 0.25s ease;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    background: #18181b;
    padding: 1.25rem 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid #27272a;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  }

  .nav-links.nav-open {
    display: flex;
  }

  .nav-item {
    width: 100%;
    display: block;
  }
}

/* 3. Contenedores y Tarjetas de Gráficos (home.html) */
.dashboard-layout {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Fila de gráficas: flex/grid adaptable */
.row-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  width: 100%;
  margin-bottom: 1.5rem;
}

/* min-width: 0 es OBLIGATORIO para evitar que Chart.js ensanche el contenedor al infinito */
.dash-card {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.chart-box-donut,
.chart-box-wide {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.chart-box-donut {
  height: 260px;
}

.chart-box-wide {
  height: 300px;
}

.chart-box-donut canvas,
.chart-box-wide canvas {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Ajustes para pantallas pequeñas */
@media (max-width: 768px) {
  .row-charts {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .chart-box-donut {
    height: 220px;
  }

  .chart-box-wide {
    height: 240px;
  }
}

/* ============================================================
   TEMA OSCURO: NAVBAR Y MENU RESPONSIVE (MATCH THEME)
   ============================================================ */

/* Contenedor transparente o semi-translúcido oscuro */
.topbar-container {
  width: 100% !important;
  background: rgba(18, 18, 18, 0.85) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Marca / Logo */
.brand-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

/* Enlaces de navegación en escritorio */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-item {
  text-decoration: none;
  color: #a1a1aa !important; /* Gris claro suave */
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-item:hover {
  color: #ff5722 !important; /* Naranja GoInto */
}

.nav-item.btn-nav-action {
  background: rgba(255, 87, 34, 0.15);
  color: #ff7043 !important;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 87, 34, 0.3);
}

.nav-item.btn-nav-action:hover {
  background: #ff5722;
  color: #ffffff !important;
}

/* Botón Hamburguesa móvil */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 19px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger-bar {
  display: block;
  height: 2.5px;
  width: 100%;
  background-color: #f4f4f5 !important;
  border-radius: 2px;
  transition: all 0.25s ease;
}

/* Vista Móvil (< 768px) */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    background: #141416 !important; /* Fondo oscuro profundo */
    padding: 1.25rem 1.5rem;
    gap: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.8) !important;
  }

  .nav-links.nav-open {
    display: flex;
  }

  .nav-item {
    width: 100%;
    padding: 0.4rem 0;
    font-size: 1rem;
  }
  
  .nav-item.btn-nav-action {
    display: inline-block;
    width: auto;
    text-align: center;
    margin-top: 0.5rem;
  }
}
