body {
    background: #f7f7fb;
    margin: 0;
}

.container-narrow {
    max-width: 980px;
}

/* LANDING BACKGROUND */

/* Fondo por defecto (desktop) */
body.dashboard-body {
    background: url('/public/icons/banner.png') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
}

/* OVERLAY */
.hero-overlay {
    min-height: 90dvh;
    background: rgba(0, 0, 0, 0.60);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

/* COLOR PRINCIPAL */
:root {
    --bs-primary: #ffcf40;
}

.navbar,
.bg-primary {
    background-color: #ffcf40 !important;
}

/* BOTÓN PREMIUM */
.btn-premium {
    background: transparent;
    color: #c6a74a;
    border: 2px solid #c6a74a;
    padding: 12px 12px;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    animation: pulseGlow 2.5s infinite alternate;
}

.text-secondary {
font-size: 13px;
color: #ffbf00;
}

/* 
.btn-premium:hover {
    background: #c6a74a;
    color: #000;
    box-shadow: 0 0 20px rgba(198, 167, 74, 0.7);
}

*/

@keyframes pulseGlow {
    from {
        box-shadow: 0 4px 15px rgba(198, 167, 74, 0.4);
    }
    to {
        box-shadow: 0 8px 30px rgba(198, 167, 74, 0.8);
    }
}

/* MOBILE OPTIMIZACIÓN */
@media (max-width: 728px) {

   body.dashboard-body {
        background: url('/public/icons/banner-mobile.png') no-repeat center center;
        background-size: cover;
        background-attachment: scroll;
    }

    .hero-overlay {
        min-height: 90dvh;
        padding: 40px 20px;
    }

    .hero-overlay h1 {
        font-size: 1.3rem;
        line-height: 1.4;
    }
}

/* MODAL GLASS PREMIUM */
.modal-content {
    background: rgba(20, 20, 20, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 207, 64, 0.25);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    color: #fff;
}

/* Tabs */
.nav-tabs .nav-link {
    color: #c6a74a;
    border: none;
    font-size: 10px;
}

.nav-tabs .nav-link.active {
    background: transparent;
    border-bottom: 2px solid #c6a74a;
    color: #fff;
}

/* Inputs */
.form-control {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 12px;
}

.form-control::placeholder {
    color: rgba(255,255,255,0.5);
}

.form-control:focus {
    background: rgba(255,255,255,0.12);
    border-color: #c6a74a;
    box-shadow: 0 0 10px rgba(198,167,74,0.5);
    color: #fff;
}

/* Login button */
.btn-primary {
    background: #c6a74a;
    border: none;
    font-weight: 600;
}

.btn-primary:hover {
    background: #e5c46b;
    color: #000;
}

/* DASHBOARD BACKGROUND */
.dashboard-body {
    background: radial-gradient(circle at 20% 30%, #1a1a1a, #0d0d0d);
    min-height: 100dvh;
    color: #fff;
}

/* TITULO */
.dashboard-title {
    font-weight: 700;
    color: #c6a74a;
    margin-bottom: 30px;
}

/* BOTONES */
.btn-gold {
    background: #c6a74a;
    border: none;
    color: #000;
    font-weight: 600;
    border-radius: 12px;
}

.btn-gold:hover {
    background: #e5c46b;
}

/* PUSH BUTTON */
.btn-outline-light {
    border-radius: 12px;
}

/* LAYOUT */
.dashboard-layout {
    display: flex;
    min-height: 100dvh;
}

/* SIDEBAR */
.dashboard-sidebar {
    width: 230px;
    background: #0d0d0d;
    padding: 30px 20px;
    border-right: 1px solid rgba(255,207,64,0.15);
}

.sidebar-logo h5 {
    color: #c6a74a;
    font-weight: 700;
    margin-bottom: 40px;
}

.sidebar-nav a {
    display: block;
    color: #aaa;
    padding: 10px 0;
    text-decoration: none;
    transition: 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: #fff;
}

/* MAIN */
.dashboard-main {
    flex: 1;
    padding: 40px;
}

/* HEADER */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-header h2 {
    color: #c6a74a;
}

.dashboard-user {
    color: #aaa;
}

/* METRIC CARDS */
.metric-card {
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,207,64,0.15);
}

.metric-card h6 {
    color: #aaa;
}

.metric-card h3 {
    color: #fff;
    margin-top: 10px;
}

/* GLASS CARDS */
.dashboard-card {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,207,64,0.15);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    transition: 0.3s ease;
}

/* ANIMACIÓN ENTRADA */
.fade-in {
    opacity: 0;
    transform: translateY(15px);
    animation: fadeUp 0.6s ease forwards;
}

.fade-in-delay {
    animation-delay: 0.2s;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.push-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: red;
    margin-right: 6px;
}

.push-dot.active {
    background: #28a745;
}

.dashboard-card {
    transition: 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}


#incomeExpenseChart {
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.4));
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

.dashboard-sidebar .sidebar-logo {
    position: relative;
    padding-bottom: 18px;
}

.dashboard-sidebar .sidebar-logo::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;

    background: linear-gradient(
        to right,
        rgba(255, 193, 7, 0.15),
        rgba(255, 193, 7, 0.7),
        rgba(255, 193, 7, 0.15)
    );
}

.dashboard-sidebar .sidebar-nav a:last-child {
    position: relative;
    padding-bottom: 18px;
}

.dashboard-sidebar .sidebar-nav a:last-child::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;

    background: linear-gradient(
        to right,
        rgba(255, 193, 7, 0.15),
        rgba(255, 193, 7, 0.7),
        rgba(255, 193, 7, 0.15)
    );
}

.dashboard-sidebar .sidebar-nav a {
    position: relative;
    display: block;
}

.dashboard-sidebar .sidebar-logo::after,
.dashboard-sidebar .sidebar-nav a:last-child::after {
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.3);
}

.card-dark {
    background: linear-gradient(
        145deg,
        rgba(30, 30, 30, 0.95),
        rgba(18, 18, 18, 0.95)
    );
    border: 1px solid rgba(255, 193, 7, 0.1);
    border-radius: 12px;
    font-size: 10px;
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(255, 193, 7, 0.05);
}

.card-dark .table {
    background-color: transparent;
}

.card-dark thead {
    background-color: rgba(255, 255, 255, 0.03);
}

.card-dark tfoot {
    background-color: rgba(255, 255, 255, 0.03);
}

.dashboard-sidebar .sidebar-nav a {
    display: block;
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 193, 7, 0.3); /* línea dorada suave */
}

.dashboard-sidebar .sidebar-nav a:last-child {
    border-bottom: none; /* evita línea extra al final */
}

.dashboard-sidebar .sidebar-nav a:hover {
    background-color: rgba(255, 193, 7, 0.1);
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    color: #ffffff !important;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background-color: #1e1e1e;
    color: #ffffff;
    font-size: 10px;
    border: 1px solid #ffc107;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #ffffff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #ffc107 !important;
    color: #000 !important;
    border: none;
    font-size: 10px;
}

/* Estado base */
.dashboard-sidebar .sidebar-nav a {
    position: relative;
    display: block;
    padding: 12px 20px 12px 24px;
    color: #bfbfbf;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* Hover */
.dashboard-sidebar .sidebar-nav a:hover {
    background: rgba(255, 193, 7, 0.08);
    color: #ffffff;
}

/* ACTIVO */
.dashboard-sidebar .sidebar-nav a.active {
    background: rgba(255, 193, 7, 0.15);
    color: #ffffff;
    font-weight: 500;
}

/* Barra vertical dorada */
.dashboard-sidebar .sidebar-nav a.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #ffc107;
    border-radius: 0 4px 4px 0;
}

table.dataTable tbody tr {
    transition: all 0.25s ease;
}

table.dataTable tbody tr:hover {
    background-color: rgba(255, 193, 7, 0.08) !important;
    transform: scale(1.01);
    cursor: pointer;
    font-size: 10px;
}

table.dataTable tbody tr:hover {
    box-shadow: inset 4px 0 0 #ffc107;
}

.health-container {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 12px;
  color: #ffffff;
}

.health-light {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: .8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: .8; }
}

.health-card {
  background: linear-gradient(135deg, #111 0%, #1a1a1a 100%);
  padding: 16px 20px;
  border-radius: 14px;
  margin-bottom: 15px;
  border: 1px solid #2a2a2a;
}

.health-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-size: 13px;
}

.health-light {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.health-bar-container {
  margin-top: 10px;
  height: 8px;
  background: #2a2a2a;
  border-radius: 10px;
  overflow: hidden;
}

.health-bar {
  height: 100%;
  width: 0%;
  border-radius: 10px;
  transition: width 1.5s ease-out;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: .8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: .8; }
}

.health-bar-container {
  display: flex;
  margin-top: 10px;
  height: 10px;
  background: #2a2a2a;
  border-radius: 10px;
  overflow: hidden;
}

.health-bar-used {
  height: 100%;
  width: 0%;
  transition: width 1.5s ease-out;
}

.health-bar-remaining {
  height: 100%;
  width: 0%;
  background: #3a3a3a;
  transition: width 1.5s ease-out;
}

.health-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #888;
  margin-top: 6px;
}

/* Línea recomendada 70% */
.health-bar-container {
  position: relative;
}

.health-threshold {
  position: absolute;
  left: 70%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #555;
  opacity: 0.6;
}

/* Parpadeo rojo riesgo crítico */
@keyframes dangerBlink {
  0% { box-shadow: 0 0 0px #ff1744; }
  50% { box-shadow: 0 0 12px #ff1744; }
  100% { box-shadow: 0 0 0px #ff1744; }
}

.danger-alert {
  animation: dangerBlink 1.2s infinite;
}

/* ============================= */
/* ===== DASHBOARD LAYOUT ===== */
/* ============================= */

.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background: #0b0f17;
}

/* SIDEBAR DESKTOP */
.dashboard-sidebar {
    width: 260px;
    background: #111826;
    padding: 20px;
    transition: transform 0.3s ease;
}

.dashboard-sidebar a {
    display: block;
    padding: 12px 18px;
    color: #bfbfbf;
    text-decoration: none;
    transition: all 0.3s ease;
}

.dashboard-sidebar a:hover {
    background: rgba(255, 193, 7, 0.08);
    color: #ffffff;
}

.dashboard-sidebar a.active {
    background: rgba(255, 193, 7, 0.15);
    color: #ffffff;
    font-weight: 500;
}

/* CONTENIDO */
.dashboard-main {
    flex: 1;
    padding: 40px;
    background: #0b0f17;
}

/* BOTÓN HAMBURGUESA */


.menu-toggle {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 3000; /* MÁS ALTO que el sidebar */
    background: #c6a74a;
    color: #fff;
    border: none;
    padding: 10px;
    font-size: 20px;
}

/* ============================= */
/* ========= MOBILE ============ */
/* ============================= */

@media (max-width: 992px) {

    .dashboard-layout {
        display: block;
    }

    .dashboard-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 260px;
        transform: translateX(-100%);
        z-index: 2000;
        box-shadow: 0 0 25px rgba(0,0,0,0.6);
    }

    .dashboard-sidebar.active {
        transform: translateX(0);
    }

    .dashboard-main {
        padding: 80px 20px;
    }

    
}

/* ============================= */
/* ===== OVERLAY OPCIONAL ===== */
/* ============================= */

body.menu-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1500;
}

.donut-separator {
    width: 70%;
    height: 1px;
    margin: 6px auto;  /* 🔥 antes 25 */
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.25),
        transparent
    );
}

.category-panel {
  margin-top: 5px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.category-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-right {
  text-align: right;
}

.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1a1a;
  padding: 12px 15px;
  border-radius: 10px;
  font-size: 10px;
  color: #fff;
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
}

.category-item:hover {
  background: #2a2a2a;
  transform: translateX(5px);
}

.category-item.dominant {
  border-left: 4px solid #ff3b3b;
  background: #252020;
}

#chartCategory {
  width: 100% !important;
  height: 100% !important;
}

.chart-container {
  width: 280px;   /* Antes seguramente es 600+ */
  height: 280px;
  margin: auto;
  position: relative;
}

.chart-wrapper {
  height: 340px;   /* 🔥 reduce altura */
}

#tab3 h5 {
    letter-spacing: 0.5px;
}

#tab3 h6 {
    font-size: 14px;
    font-weight: 500;
}

.btn-outline-secondary {
    background: #e5c46b;
    color: #000;
    font-size: 10px;
}

.sidebar-nav a {
    font-size: 15px;
}

@media (max-width: 768px) {
    .sidebar-nav a {
        font-size: 13px;
        padding: 10px 15px;
    }
}

table.dataTable td {
    vertical-align: middle;
    font-size: 10px;
}

table.dataTable td i {
    font-size: 10px;
}

.d-block {
    font-size: 10px;
}

  #billMonthLabel{
    min-width: 120px;
    text-align: center;
    color: #ffc107;
    font-size: 10px;
  }
  
  #billsTable {
  width: 100% !important;
  table-layout: fixed;
}

#billsTable th,
#billsTable td {
  vertical-align: middle;
}

#billsTable td {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.dataTables_wrapper {
  width: 100%;
}

.dataTables_scrollBody,
.table-responsive {
  overflow-x: auto;
}

.bill-category-badge{
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 0.55rem;
  line-height: 1.1;
  display: inline-block;
  word-break: break-word;
  max-width: 100%;
}

@media (max-width: 768px) {
  .dataTables_wrapper .dataTables_length select {
    width: 50px !important;
    min-width: 50px !important;
  }

  .dataTables_wrapper .dataTables_filter input {
    width: 75px !important;
    max-width: 75px !important;
    min-width: 75px !important;
    margin-left: 0 !important;
  }

  .dataTables_wrapper .dataTables_filter label,
  .dataTables_wrapper .dataTables_length label {
    font-size: 0.5rem;
    white-space: nowrap;
  }
}