/* --- VARIABLES Y RESET --- */
:root {
    --primary: #1e293b;   /* Azul oscuro Sidebar */
    --accent: #3b82f6;    /* Azul brillante Botones */
    --bg: #f1f5f9;        /* Fondo gris claro */
    --white: #ffffff;
    --text-dark: #1e293b;
    --text-light: #64748b;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', sans-serif; }

body {
    background-color: var(--bg);
    display: flex;
    min-height: 100vh;
}

/* --- LAYOUT: SIDEBAR Y CONTENIDO --- */
.sidebar {
    width: 250px;
    background-color: var(--primary);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: fixed;
    height: 100%;
}

.main-content {
    margin-left: 250px; /* Mismo ancho que sidebar */
    flex: 1;
    padding: 30px;
    width: calc(100% - 250px);
}

/* --- SIDEBAR --- */
.user-profile {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.avatar-circle {
    width: 60px; height: 60px; background: rgba(255,255,255,0.1);
    border-radius: 50%; margin: 0 auto 10px; display: flex;
    align-items: center; justify-content: center; font-size: 24px;
}
.menu-item {
    padding: 12px 15px; color: #cbd5e1; text-decoration: none;
    display: flex; align-items: center; gap: 10px; border-radius: 8px;
    margin-bottom: 5px; transition: 0.3s;
}
.menu-item:hover, .menu-item.active {
    background-color: var(--accent); color: white;
}
.logout-btn {
    margin-top: auto; background: rgba(255,255,255,0.05);
}

/* --- TARJETAS DE ESTADÍSTICAS (DASHBOARD) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px; margin-bottom: 30px;
}
.card {
    background: var(--white); padding: 25px; border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border-left: 4px solid var(--accent);
}
.card-title { color: var(--text-light); font-size: 0.9rem; text-transform: uppercase; }
.card-value { font-size: 2rem; font-weight: bold; color: var(--text-dark); margin: 10px 0; }

/* --- FORMULARIO DE CREAR --- */
.create-section {
    background: var(--white); padding: 30px; border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); margin-bottom: 30px;
    display: flex; gap: 10px; flex-wrap: wrap;
}
input[type="url"] {
    flex: 1; padding: 12px; border: 1px solid #e2e8f0;
    border-radius: 6px; outline: none;
}
button.btn-primary {
    background: var(--accent); color: white; border: none;
    padding: 12px 25px; border-radius: 6px; cursor: pointer; font-weight: bold;
}
button.btn-primary:hover { filter: brightness(90%); }

/* --- RESULTADO Y TABLA --- */
.success-box {
    margin-top: 20px; background: #dcfce7; color: #166534;
    padding: 15px; border-radius: 8px; width: 100%;
    display: flex; align-items: center; justify-content: space-between;
}
.copy-btn {
    background: white; border: 1px solid #bbf7d0; padding: 5px 10px;
    border-radius: 4px; cursor: pointer; font-size: 12px;
}

table { width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
th { background: #f8fafc; text-align: left; padding: 15px; color: var(--text-light); }
td { padding: 15px; border-bottom: 1px solid #f1f5f9; color: var(--text-dark); }

/* --- ESTILOS LOGIN (Página Login) --- */
.login-body {
    background: #f1f5f9; display: flex; align-items: center; justify-content: center; height: 100vh;
}
.login-card {
    background: white; padding: 40px; width: 100%; max-width: 400px;
    border-radius: 15px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    text-align: center;
}
.login-input {
    width: 100%; padding: 12px; margin: 10px 0; border: 1px solid #e2e8f0; border-radius: 6px;
}



/* --- BOTONES DE ACCIÓN (Tabla) --- */
.action-buttons {
    display: flex;
    gap: 5px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none; /* Importante para links que parecen botones */
}

.btn-delete {
    background-color: #fee2e2;
    color: #ef4444;
}
.btn-delete:hover {
    background-color: #ef4444;
    color: white;
}

.btn-qr {
    background-color: #f3e8ff;
    color: #9333ea;
}
.btn-qr:hover {
    background-color: #9333ea;
    color: white;
}

/* Ajuste para los íconos SVG dentro de los botones */
.btn-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}


/* --- ESTILOS DEL MODAL (POPUP) --- */
.modal {
    display: none; /* Oculto por defecto */
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.6); /* Fondo oscuro semitransparente */
    backdrop-filter: blur(4px); /* Efecto borroso de fondo */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 25px;
    border: 1px solid #888;
    width: 100%;
    max-width: 350px; /* Ancho máximo del modal */
    border-radius: 12px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {transform: scale(0.8); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

.close-modal {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}
.close-modal:hover { color: #000; }

/* Botón de descarga dentro del modal */
.btn-download {
    background-color: #9333ea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    margin-top: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}
.btn-download:hover { background-color: #7e22ce; }