/* ==============================
   Creado por: Oscar More Maza
   ============================== */
/* Estilos anteriores se mantienen igual */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #f50018;
    --secondary-color: #E0F7FA;
    --accent-color: #80DEEA;
    --text-dark: #333333;
    --text-light: #666666;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* Media Queries para contenedores */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

.gradient-bg {
    background: linear-gradient(135deg, #E0F7FA 0%, #f50018 100%);
}

.card-shadow {
    box-shadow: var(--shadow);
}

.input-focus:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 205, 210, 0.3);
}

/* Placeholder sin mayúsculas aunque el input tenga text-transform uppercase */
#register-name::placeholder {
    text-transform: none;
}

.blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.5;
    }
}

/* Notificación responsive */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: 20px;
    background-color: #ff001e;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    transform: translateX(150%);
    transition: transform 0.3s ease;
    max-width: 400px;
    margin: 0 auto;
}

.notification.show {
    transform: translateX(0);
}

.notification i {
    margin-right: 8px;
    font-size: 1.1rem;
}

@media (min-width: 768px) {
    .notification {
        left: auto;
        max-width: 350px;
        padding: 12px 20px;
    }
}

.child-card {
    transition: all 0.3s ease;
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.child-card.active {
    border-left: 4px solid #ff0019;
    background-color: #FFF9FA;
}

.child-timer {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.1rem;
}

@media (max-width: 576px) {
    .child-timer {
        font-size: 1rem;
    }
}

/* BOTONES DE ACCIÓN MÁS PEQUEÑOS PERO NO ESTRECHOS */
.btn-action {
    position: absolute;
    top: 6px;
    right: 6px;
    cursor: pointer;
    background: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
    border: 1px solid transparent;
}

.btn-edit {
    right: 38px;
    color: #00BFFF;
    border-color: #00BFFF;
}

.btn-delete {
    color: #ff001e;
    border-color: #fa001d;
}

.child-card:hover .btn-action {
    opacity: 1;
    transform: scale(1.05);
}

.btn-edit:hover {
    background: #00BFFF;
    color: white;
}

.btn-delete:hover {
    background: #f3031f;
    color: white;
}

.btn-remove-error {
    right: 70px;
    color: #f59e0b;
    border-color: #f59e0b;
}

.btn-remove-error:hover {
    background: #f59e0b;
    color: white;
}

.btn-whatsapp {
    right: 102px;
    color: #25D366; /* WhatsApp Green */
    border-color: #25D366;
}

.btn-whatsapp:hover {
    background: #25D366;
    color: white;
}

.btn-time-extra {
    right: 70px;
    color: #4CAF50;
    border-color: #4CAF50;
}

.btn-time-extra:hover {
    background: #4CAF50;
    color: white;
}

/* Mostrar botones de acción en móviles */
@media (max-width: 768px) {
    .btn-action {
        opacity: 1;
        transform: scale(0.95);
        width: 26px;
        height: 26px;
    }

    .child-card:hover .btn-action {
        transform: scale(1);
    }
}

.badge {
    display: inline-block;
    padding: 0.2em 0.35em;
    font-size: 70%;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.2rem;
}

.badge-active {
    background-color: #22C55E;
    /* Verde - Activo */
    color: white;
}

.badge-inactive {
    background-color: #EF4444;
    /* Rojo - Inactivo */
    color: white;
}

.badge-paused {
    background-color: #3B82F6;
    /* Azul - Pausa */
    color: white;
}

.badge-timeout {
    background-color: #F97316;
    /* Naranja - Tiempo Finalizado */
    color: white;
}

.badge-free {
    background-color: #4CAF50;
    color: white;
}

.badge-time {
    background-color: #FF9800;
    color: white;
}

.badge-sum {
    background-color: #FF9800;
    color: white;
}

.badge-gratis {
    background-color: #9C27B0;
    color: white;
}

.badge-hermano {
    background-color: #9C27B0;
    color: white;
}

.badge-hermanos {
    background-color: #2196F3;
    color: white;
}

.badge-temporal {
    background-color: #FF5722;
    color: white;
}

.badge-extra {
    background-color: #a855f7;
    color: white;
}

.header-gradient {
    background: linear-gradient(to right, #E0F7FA, #FFFFFF);
}

.logo-container {
    background: linear-gradient(135deg, #E0F7FA 0%, #FFCDD2 100%);
}

/* BOTONES DE TIEMPO MÁS COMPACTOS */
.time-shortcut,
.time-extra-shortcut,
.time-add-shortcut {
    transition: all 0.2s;
    cursor: pointer;
    padding: 6px 10px;
    margin: 3px;
    border-radius: 6px;
    text-align: center;
    flex: 0 1 auto;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
    background: white;
}

.time-shortcut:hover,
.time-extra-shortcut:hover,
.time-add-shortcut:hover {
    transform: scale(1.03);
    background-color: #E0F7FA;
}

.time-shortcut.active {
    background-color: #80DEEA;
    color: white;
    border-color: #80DEEA;
}

.time-extra-shortcut.active,
.time-add-shortcut.active {
    background-color: #80DEEA;
    color: white;
    border-color: #80DEEA;
}


/* Contenedor flexible para atajos de tiempo */
.time-shortcuts-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin: 8px 0;
}

/* BOTONES DE CONTROL MÁS COMPACTOS */
.control-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    min-width: 80px;
    margin: 0 4px 8px 4px;
    background: white;
    border: 1px solid #e2e8f0;
}

.control-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-100%);
    transition: transform 0.3s;
}

.control-btn:hover::after {
    transform: translateX(0);
}

@media (min-width: 768px) {
    .control-btn {
        margin-bottom: 0;
        margin-right: 6px;
        min-width: 90px;
    }
}

/* Contenedor para botones de control */
.controls-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin: 10px 0;
}

/* Mejoras para el modal de observaciones */
.obs-modal {
    background: rgba(0, 0, 0, 0.7);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.obs-content {
    max-height: 80vh;
    overflow-y: auto;
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: var(--border-radius);
    padding: 15px;
}

.obs-item {
    border-left: 3px solid #80DEEA;
    transition: all 0.3s;
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.obs-item:hover {
    background-color: #f8f9fa;
    transform: translateX(3px);
}

/* Efecto para notificación de alarma */
.alarm-notification {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* BOTONES DE PESTAÑAS MÁS COMPACTOS */
.tab-container {
    width: 100%;
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 0;
    border-bottom: 1px solid #dee2e6;
}

.tab-button {
    padding: 10px 14px;
    border: none;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 6px 6px 0 0;
    position: relative;
    font-weight: 500;
    color: #666;
    flex: 1;
    min-width: 100px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85rem;
}

.tab-button.active {
    background-color: white;
    color: #333;
    font-weight: 600;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #ff6f91;
}

.tab-button:hover {
    background-color: #e9ecef;
}

.tab {
    display: none;
    padding: 15px;
    border-top: none;
    background: white;
    width: 100%;
}

.tab.active {
    display: block;
}

@media (max-width: 576px) {
    .tab-button {
        padding: 8px 10px;
        font-size: 0.8rem;
        min-width: 80px;
    }

    .tab {
        padding: 12px;
    }
}

/* Estilos para la sección de ganancias */
.stats-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (min-width: 992px) {
    .stats-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
}

.stats-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stats-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #2E7D32;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-label {
    font-size: 0.8rem;
    color: #666;
}

.chart-container {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    width: 100%;
}

/* Estilos para la sección de gastos */
.gasto-item {
    border-left: 3px solid #FF9800;
    transition: all 0.3s;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
}

.gasto-item:hover {
    transform: translateX(3px);
}

.gasto-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
}

.gasto-details {
    flex: 1;
    min-width: 180px;
}

.gasto-amount {
    font-weight: bold;
    color: #FF9800;
    font-size: 1.1rem;
}

.gasto-categoria {
    display: inline-block;
    padding: 0.2em 0.35em;
    font-size: 70%;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.2rem;
    background-color: #FF9800;
    color: white;
    margin-top: 4px;
}

/* Estilos para gráficos más pequeños */
.small-chart {
    height: 280px !important;
}

@media (min-width: 768px) {
    .small-chart {
        height: 350px !important;
    }
}

@media (min-width: 992px) {
    .small-chart {
        height: 400px !important;
    }
}

/* Estilos para la información del niño seleccionado */
.selected-child-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px;
    border-radius: var(--border-radius);
    color: white;
    margin-bottom: 15px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

@media (min-width: 576px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (min-width: 768px) {
    .info-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

.info-item {
    display: flex;
    flex-direction: column;
}

.selected-child-info .badge-gratis {
    background-color: #10b981;
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 0.3rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.selected-child-info .badge-time {
    background-color: #3b82f6;
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 0.3rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.selected-child-info .font-medium {
    color: #e5e7eb;
    min-width: 120px;
    display: inline-block;
    font-weight: 500;
    font-size: 0.9rem;
}

.selected-child-info .text-gray-900 {
    color: #f9fafb;
    font-weight: 500;
    font-size: 0.9rem;
}



.alarm-notification h3.text-white {
    color: white !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    font-size: 1.1rem;
}

/* BOTÓN DESACTIVAR ALARMA MÁS COMPACTO */
.btn-desactivar-alarma {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 8px;
    transition: background-color 0.3s;
    min-width: 140px;
}

.btn-desactivar-alarma:hover {
    background-color: #ff5252;
}

.btn-desactivar-alarma:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* BOTONES PRINCIPALES MÁS COMPACTOS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 8px 14px;
    font-size: 0.85rem;
    line-height: 1.3;
    border-radius: 6px;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    min-width: 100px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #d40016;
    border-color: #d40016;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #5a6268;
}

.btn-success {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #218838;
}

/* Utilidades de grid flexibles */
.grid {
    display: grid;
    gap: 0.8rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 640px) {
    .sm\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Utilidades flex */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

/* Utilidades de espaciado */
.p-2 {
    padding: 0.4rem;
}

.p-3 {
    padding: 0.6rem;
}

.p-4 {
    padding: 0.8rem;
}

.m-2 {
    margin: 0.4rem;
}

.m-3 {
    margin: 0.6rem;
}

.m-4 {
    margin: 0.8rem;
}

.mb-2 {
    margin-bottom: 0.4rem;
}

.mb-3 {
    margin-bottom: 0.6rem;
}

.mb-4 {
    margin-bottom: 0.8rem;
}

.mt-2 {
    margin-top: 0.4rem;
}

.mt-3 {
    margin-top: 0.6rem;
}

.mt-4 {
    margin-top: 0.8rem;
}

/* Utilidades de texto */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.8rem;
}

.text-base {
    font-size: 0.9rem;
}

.text-lg {
    font-size: 1rem;
}

.text-xl {
    font-size: 1.1rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

/* Mejoras para formularios en móviles */
.form-group {
    margin-bottom: 0.8rem;
    width: 100%;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.15rem rgba(245, 0, 24, 0.25);
}

/* Botones de formulario compactos */
.form-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.form-actions .btn {
    flex: 1;
    min-width: 100px;
    max-width: 150px;
}

/* Mejoras para tablas responsivas */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    font-size: 0.85rem;
}

.table th,
.table td {
    padding: 0.5rem 0.6rem;
}

/* Iconos más pequeños para mejor ajuste */
.icon-sm {
    font-size: 0.9rem;
    width: 16px;
    height: 16px;
}

/* Grupos de botones compactos */
.btn-group {
    display: inline-flex;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-group .btn {
    border-radius: 0;
    margin: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-group .btn:first-child {
    border-radius: 6px 0 0 6px;
}

.btn-group .btn:last-child {
    border-radius: 0 6px 6px 0;
    border-right: none;
}

.badge-free {
    background-color: #10b981;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
}

.badge-birthday {
    background-color: #ec4899;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
}

.badge-tiempo-agotado {
    background-color: #f97316;
    /* Naranja vibrante */
    color: white;
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* ==============================
   PANEL NOTIFICACIÓN ACCIÓN REQUERIDA
   ============================== */
.notif-accion-panel {
    position: fixed;
    top: 76px;
    right: 20px;
    z-index: 9999;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 18px 14px 14px;
    max-width: 260px;
    min-width: 220px;
    pointer-events: auto;
    animation: notif-slide-in 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.notif-accion-panel.hidden {
    display: none;
}

.notif-accion-panel.notif-saliendo {
    animation: notif-fade-out 0.3s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes notif-slide-in {
    from {
        opacity: 0;
        transform: translateX(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes notif-fade-out {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateX(20px) scale(0.97);
    }
}

.notif-accion-icon {
    font-size: 1.25rem;
    color: #f97316;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 1px;
}

.notif-accion-body {
    flex: 1;
}

.notif-accion-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: #111827;
    margin: 0 0 3px 0;
    line-height: 1.3;
    letter-spacing: 0.01em;
}

.notif-accion-text {
    font-size: 0.79rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.45;
}