html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
/* Contenedor Principal centrado */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 20px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Tarjeta Moderna con diseño limpio y sombra suave */
.auth-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* Encabezado */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    margin-bottom: 12px;
}

.auth-header h2 {
    color: #1e293b;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

/* Formulario y Filas */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row-custom {
    display: flex;
    gap: 16px;
}

    .form-row-custom .form-group-custom {
        flex: 1;
    }

/* En pantallas pequeñas, las contraseñas bajan a una sola columna */
@media (max-width: 480px) {
    .form-row-custom {
        flex-direction: column;
        gap: 20px;
    }
}

/* Inputs y Etiquetas */
.form-group-custom {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .form-group-custom label {
        color: #475569;
        font-size: 13px;
        font-weight: 600;
    }

.form-control-custom,
.form-select-custom {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    color: #334155;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    outline: none;
    box-sizing: border-box;
}

    /* Efectos de Focus */
    .form-control-custom:focus,
    .form-select-custom:focus {
        background-color: #ffffff;
        border-color: #6c5ce7;
        box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
    }

/* Botón Moderno usando tu gradiente */
.btn-modern-submit {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    margin-top: 10px;
}

    .btn-modern-submit:hover {
        box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
    }

    .btn-modern-submit:active {
        transform: scale(0.98);
    }

/* Manejo de Errores */
.text-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 2px;
}

.text-danger-summary ul {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 12px 32px;
    color: #b91c1c;
    font-size: 13px;
    list-style-type: square;
}

/* Contenedor del Panel Master */
.admin-dashboard-container {
    padding: 30px 15px;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.admin-table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 24px;
}

/* Encabezado Tabla */
.table-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

    .table-header-custom h2 {
        color: #0f172a;
        font-size: 22px;
        font-weight: 700;
        margin: 0 0 4px 0;
    }

.table-subtitle {
    color: #64748b;
    font-size: 13.5px;
    margin: 0;
}

/* Botón Nuevo Usuario con tu gradiente corporativo */
.btn-create-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: opacity 0.2s;
}

    .btn-create-user:hover {
        color: #ffffff;
        opacity: 0.9;
    }

/* Estructura de la Tabla */
.responsive-table-wrapper {
    overflow-x: auto;
}

.modern-admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

    .modern-admin-table th {
        background-color: #f8fafc;
        color: #475569;
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        padding: 14px 16px;
        border-bottom: 2px solid #e2e8f0;
    }

    .modern-admin-table td {
        padding: 16px;
        border-bottom: 1px solid #f1f5f9;
        color: #334155;
        font-size: 14px;
        vertical-align: middle;
    }

/* Celdas de Perfil Complejas */
.user-info-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-placeholder {
    width: 36px;
    height: 36px;
    background-color: #eedffc;
    color: #6c5ce7;
    font-weight: 700;
    font-size: 13px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-metadata {
    display: flex;
    flex-direction: column;
}

.user-email-text {
    font-weight: 600;
    color: #1e293b;
}

.user-username-sub {
    color: #94a3b8;
    font-size: 12px;
}

.user-id-badge {
    background-color: #f1f5f9;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
}

/* Badges de Roles */
.roles-badge-container {
    display: flex;
    gap: 6px;
}

.badge-role {
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 600;
}

.badge-master {
    background-color: #f3e8ff;
    color: #6c5ce7;
    border: 1px solid #d8b4fe;
}

.badge-staff {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.badge-none {
    background-color: #f1f5f9;
    color: #64748b;
}

/* Botón Acciones */
.btn-action-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    color: #475569;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

    .btn-action-edit:hover {
        background-color: #f8fafc;
        color: #6c5ce7;
        border-color: #6c5ce7;
    }

.text-center {
    text-align: center;
}

.edit-user-container {
    padding: 30px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.edit-header {
    margin-bottom: 35px;
}

.email-highlight {
    color: #6c5ce7;
    font-weight: 800;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 15px;
    transition: color 0.2s;
}

    .btn-back:hover {
        color: #6c5ce7;
    }

/* GRID RESPONSIVO */
.management-grid {
    display: flex;
    flex-wrap: wrap; /* Permite que bajen en mobile */
    gap: 25px;
}

.manage-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 30px;
    flex: 1; /* Esto hace que ocupen el mismo ancho */
    min-width: 300px; /* Ancho mínimo para que no se vean muy flacas */
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s;
}

    .manage-card:hover {
        transform: translateY(-5px);
    }

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 20px;
}

.icon-purple {
    background: #f3e8ff;
    color: #6c5ce7;
}

.icon-blue {
    background: #e0f2fe;
    color: #0369a1;
}

.icon-red {
    background: #fee2e2;
    color: #dc2626;
}

.manage-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #1e293b;
}

.manage-card p {
    font-size: 13.5px;
    color: #64748b;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Botones de las cards */
.btn-save-role, .btn-save-pass, .btn-delete-user {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-save-role {
    background: #6c5ce7;
    color: white;
}

.btn-save-pass {
    background: #0ea5e9;
    color: white;
}

.card-danger {
    border-color: #fca5a5;
}

.btn-delete-user {
    background: #ef4444;
    color: white;
}

    .btn-save-role:hover, .btn-save-pass:hover, .btn-delete-user:hover {
        opacity: 0.9;
    }

/* MEDIA QUERY PARA MOBILE */
@media (max-width: 992px) {
    .management-grid {
        flex-direction: column; /* Se apilan verticalmente */
    }

    .manage-card {
        width: 100%;
    }
}
