/* =========================================================
   1. ESTILOS GENERALES DE LA APP
   ========================================================= */

/* Página de panel (index.php) */
body.app-page {
    background-color: #0b1220;
    /* Dark, pero no súper negro */
    color: #e5e7eb;
    min-height: 100vh;
}

/* Página de login */
body.login-page {
    min-height: 100vh;
    background: radial-gradient(circle at top left, #4f46e5 0, #111827 55%, #020617 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e5e7eb;
}

.app-title {
    color: #f1f5f9 !important;
    font-weight: 700;
}


/* Tipografía y títulos generales */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: #f9fafb;
    /* Títulos bien claros */
    font-weight: 600;
}

/* Utilidad de texto pequeño (solo tamaño por defecto) */
.small-text {
    font-size: 0.8rem;
}

/* Texto pequeño en el panel (fondos oscuros: cards, etc.) */
.app-page .card .small-text {
    color: #9ca3af;
    /* Gris claro, buena lectura en oscuro */
}

/* Texto pequeño dentro de tablas (lista de QRs).
   Suele ir sobre fondos más claros (celdas, áreas blancas). */
.app-page .card .table .small-text {
    color: #4b5563;
    /* Gris oscuro para buen contraste en fondos claros */
}


/* =========================================================
   2. NAVBAR / CABECERA
   ========================================================= */

.navbar-main {
    background-color: #020617;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.navbar-brand span:first-child {
    font-weight: 700;
}

.navbar-brand .badge-brand {
    background: linear-gradient(135deg, #4f46e5, #22c55e);
    font-weight: 700;
}


/* =========================================================
   3. CARDS GENERALES (TARJETAS)
   ========================================================= */

.card {
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background-color: #020617;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
}

/* Texto claro dentro de cards en páginas con fondo oscuro */
.app-page .card,
.app-page .card p,
.app-page .card h4,
.app-page .card h5,
.app-page .card h6 {
    color: #e5e7eb;
}


.card-header {
    border-bottom-color: rgba(148, 163, 184, 0.3);
    background: linear-gradient(135deg, #111827, #020617);
    color: #f9fafb;
}

.card-header h5 {
    margin-bottom: 0;
}

/* Miniatura de foto de mascota en el dashboard */
.pet-thumb {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.4);
}


/* =========================================================
   4. FORMULARIOS EN EL PANEL
   ========================================================= */

/* Inputs y selects en el panel */
.app-page .form-control,
.app-page .form-select {
    background-color: #020617;
    border-color: #1f2937;
    color: #e5e7eb;
}

.app-page .form-control:focus,
.app-page .form-select:focus {
    background-color: #020617;
    border-color: #4f46e5;
    color: #e5e7eb;
    box-shadow: 0 0 0 0.15rem rgba(79, 70, 229, 0.35);
}

/* Labels de formularios del panel */
.app-page .form-label {
    color: #ffffff;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Placeholders dentro del panel (index.php) */
.app-page ::placeholder {
    color: #d1d5db !important;
    /* Gris claro y visible */
    opacity: 1;
    /* Que no lo atenúe el navegador */
}

/* Buscador pequeño en cabecera de tabla */
.app-page .search-input-sm {
    max-width: 260px;
}


/* =========================================================
   5. TABLAS (LISTA DE QRs)
   ========================================================= */

.table {
    color: #e5e7eb;
    border-color: rgba(55, 65, 81, 0.8);
}

.table thead {
    background-color: #020617;
    color: #f9fafb;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(15, 23, 42, 0.95);
}

.table-striped tbody tr:nth-of-type(even) {
    background-color: rgba(17, 24, 39, 0.85);
}

.table-hover tbody tr:hover {
    background-color: rgba(55, 65, 81, 0.75);
}

/* Enlaces dentro de la tabla (fondos claros) */
.app-page table a.link-light {
    color: #1f2937 !important;
    /* gris oscuro visible */
}

.app-page table a.link-light:hover {
    color: #4f46e5 !important;
    /* violeta en hover */
}

/* =========================================================
   6. BOTONES
   ========================================================= */

/* Botón primario (crear/guardar) */
.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #22c55e);
    border: none;
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4338ca, #16a34a);
}

/* Botones outline claros (incluye Cerrar sesión) */
.btn-outline-light {
    border-color: rgba(148, 163, 184, 0.6);
    color: #e5e7eb;
}

.btn-outline-light:hover {
    background-color: #111827;
    border-color: #e5e7eb;
    color: #ffffff;
    /* Forzamos blanco para que no se pierda en el hover */
}

/* Botón Editar dentro de la tabla del panel */
.app-page .btn-edit {
    color: #ffffff !important;
    border: 1px solid #4f46e5 !important;
    background: rgba(79, 70, 229, 0.25) !important;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.app-page .btn-edit:hover {
    background: #4f46e5 !important;
    /* violeta sólido */
    border-color: #4f46e5 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.45);
}

.app-page .btn-edit i {
    font-size: 0.9rem;
    vertical-align: -1px;
}

/* Enlaces claros dentro del panel (ej. "Descargar PNG", "Abrir en nueva pestaña") */
.app-page a.link-light {
    color: #e5e7eb;
}

.app-page a.link-light:hover {
    color: #a5b4fc;
    /* violeta suave en hover */
}

/* Botón Historial: buen contraste en fondos claros */
.btn-history {
    border-radius: 999px;
    border: 1px solid #6366f1;
    color: #4f46e5;
    background: transparent;
    font-size: 0.75rem;
    padding: 0.15rem 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.btn-history i {
    font-size: 0.85rem;
}

.btn-history:hover {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
    text-decoration: none;
}

/* =========================================================
   7. BADGES / ETIQUETAS
   ========================================================= */

.badge-hits {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.badge-slug {
    background-color: #374151;
}

.badge-30d {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    /* celeste */
}


/* =========================================================
   8. PREVIEW DE QR
   ========================================================= */

.qr-preview-box {
    border-radius: 12px;
    border: 1px dashed rgba(148, 163, 184, 0.6);
    background-color: #020617;
}


/* =========================================================
   9. ESTILOS ESPECÍFICOS PARA LOGIN
   ========================================================= */

/* Tarjeta de login */
.card-login {
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.4);
    backdrop-filter: blur(12px);
    background: rgba(15, 23, 42, 0.94);
}

/* Logo redondo */
.logo-circle {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: linear-gradient(135deg, #4f46e5, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
    color: white;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.75);
}

/* Subtítulo de marca en login */
.brand-sub {
    font-size: 0.9rem;
    color: #9ca3af;
}

/* Campos del login (bien visibles) */
.login-page .form-control {
    background-color: #ffffff;
    /* fondo blanco bien visible */
    border-color: #4f46e5;
    /* borde violeta */
    color: #0f172a;
    /* texto oscuro */
}

.login-page .form-control:focus {
    background-color: #ffffff;
    border-color: #22c55e;
    /* borde verde al foco */
    color: #0f172a;
    box-shadow: 0 0 0 0.15rem rgba(79, 70, 229, 0.35);
}

/* Labels del login */
.login-page .form-label {
    color: #e5e7eb;
    /* etiquetas claras sobre fondo oscuro */
    font-weight: 500;
}

/* Textos pequeños del login (pie de tarjeta) */
.login-footer-text {
    font-size: 0.8rem;
    color: #9ca3af;
}

.navbar-main {
    background: #1e293b;
}

/* Dropdown usuario */
.dropdown-menu {
    font-size: 0.9rem;
}

.dropdown-item i {
    color: #64748b;
}

.dropdown-item:hover i {
    color: #ffffff;
}

/* Avatar */
.navbar .rounded-circle {
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.badge.bg-purple {
    background-color: #4f46e5;
}

/* Botón Dashboard: celestito/teal para diferenciarlo */
.btn-dashboard {
    border-radius: 999px;
    border: 1px solid #0ea5e9;
    color: #0369a1;
    background: #e0f2fe;
    font-size: 0.75rem;
    padding: 0.15rem 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.btn-dashboard i {
    font-size: 0.85rem;
}

.btn-dashboard:hover {
    background: #0ea5e9;
    color: #ffffff;
    border-color: #0284c7;
}

/* Métricas dashboard */
.metric-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #e5e7eb;
    /* antes #9ca3af */
}

.metric-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: #f9fafb;
    /* más claro */
    margin-top: 0.3rem;
}

.metric-sub {
    font-size: 0.8rem;
    color: #cbd5f5;
    /* un gris muy clarito azulado */
    margin-top: 0.2rem;
}

/* Área de login (ajustá si tu contenedor tiene otro nombre) */
.login-wrapper .app-title,
.app-title {
    color: #f9fafb;
}

.login-wrapper .app-subtitle,
.app-subtitle {
    color: #e5e7eb;
}

.app-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.9);
}

/* Área de Perfil */
.text-light-muted {
    color: rgba(255, 255, 255, 0.75) !important;
}