/*--------------------------------------------------------------------------

| Sistema: Ixtle Control
| Archivo: Usuarios y autenticacion
| Desarrollado por: Happy Discover

|--------------------------------------------------------------------------
*/

/* -- INICIO BLOQUE 1 -- LOGIN -- */
.ixtle-auth-body {
    position: relative;
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(2, 6, 23, 0.84) 0%, rgba(2, 6, 23, 0.64) 46%, rgba(2, 6, 23, 0.38) 100%),
        url("../images/ixtle-fachada.png") center / cover no-repeat;
    overflow: hidden;
}

.ixtle-auth-body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 18% 24%, rgba(37, 99, 235, 0.28), transparent 34%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0.70));
    pointer-events: none;
    z-index: 0;
}

.ixtle-login {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 480px);
    align-items: center;
    gap: 40px;
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.ixtle-login__brand img {
    width: 180px;
    height: auto;
    margin-bottom: 28px;
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.34));
}

.ixtle-login__brand h1 {
    font-size: clamp(42px, 6vw, 76px);
    line-height: 0.95;
    color: #ffffff;
    margin-bottom: 18px;
    text-shadow: 0 18px 34px rgba(0, 0, 0, 0.36);
}

.ixtle-login__brand p {
    max-width: 560px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 19px;
    line-height: 1.6;
    font-weight: 700;
    text-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
}

.ixtle-login__panel {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 26px;
    padding: 34px;
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.ixtle-login__header span {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.ixtle-login__header h2 {
    margin: 18px 0 24px;
    color: #0f172a;
    font-size: 34px;
}

.ixtle-login__form {
    display: grid;
    gap: 18px;
}

.ixtle-login__form label,
.ixtle-usuarios-form-grid label {
    display: grid;
    gap: 8px;
    color: #64748b;
    font-weight: 900;
}

.ixtle-login__form input,
.ixtle-usuarios-form-grid input,
.ixtle-usuarios-form-grid select {
    width: 100%;
    min-height: 54px;
    border: 1px solid #dbe4ef;
    border-radius: 16px;
    padding: 0 16px;
    background: #ffffff;
    color: #0f172a;
    font-size: 16px;
    font-weight: 800;
    outline: none;
}

.ixtle-usuarios-form-grid .ixtle-phone,
.ixtle-password-field {
    min-height: 54px;
    border: 1px solid #dbe4ef;
    border-radius: 16px;
    background: #ffffff;
    overflow: hidden;
    transition: all 0.2s ease;
}

.ixtle-usuarios-form-grid .ixtle-phone {
    display: grid;
    grid-template-columns: 158px 66px 1fr;
    align-items: center;
}

.ixtle-usuarios-form-grid .ixtle-phone:focus-within,
.ixtle-password-field:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.ixtle-usuarios-form-grid .ixtle-phone__country {
    min-height: 54px;
    border: 0;
    border-right: 1px solid #dbe4ef;
    border-radius: 0;
    padding: 0 12px;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 900;
    outline: none;
}

.ixtle-usuarios-form-grid .ixtle-phone__dial {
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #dbe4ef;
    background: #f8fafc;
    color: #334155;
    font-weight: 900;
}

.ixtle-usuarios-form-grid .ixtle-phone__input {
    min-height: 54px;
    border: 0;
    border-radius: 0;
}

.ixtle-password-field {
    display: grid;
    grid-template-columns: 1fr 54px;
    align-items: center;
}

.ixtle-password-field input {
    min-height: 54px;
    border: 0;
    border-radius: 0;
}

.ixtle-password-field button {
    width: 54px;
    height: 54px;
    border: 0;
    border-left: 1px solid #dbe4ef;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ixtle-password-field button svg {
    width: 22px;
    height: 22px;
}

.ixtle-password-field button:hover,
.ixtle-password-field button.is-active {
    background: #dbeafe;
    color: #1d4ed8;
}

.ixtle-login__form input:focus,
.ixtle-usuarios-form-grid input:focus,
.ixtle-usuarios-form-grid select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.ixtle-usuarios-form-grid .ixtle-phone__country:focus,
.ixtle-usuarios-form-grid .ixtle-phone__input:focus,
.ixtle-password-field input:focus {
    box-shadow: none;
    border-color: transparent;
}

.ixtle-login__remember {
    display: flex !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px !important;
}

.ixtle-login__remember input {
    width: 18px;
    min-height: 18px;
}

.ixtle-login__form button,
.ixtle-usuarios-btn {
    border: none;
    border-radius: 16px;
    min-height: 50px;
    padding: 0 20px;
    font-weight: 900;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ixtle-login__form button,
.ixtle-usuarios-btn--primary {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.24);
}

.ixtle-login__form button:hover,
.ixtle-usuarios-btn--primary:hover {
    background: #1d4ed8;
    color: #ffffff;
}
/* -- FIN BLOQUE 1 -- LOGIN -- */


/* -- INICIO BLOQUE 2 -- USUARIOS -- */
.ixtle-usuarios-page {
    display: grid;
    gap: 18px;
}

.ixtle-usuarios-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ixtle-usuarios-header h1 {
    color: #0f172a;
    font-size: 34px;
    line-height: 1.1;
}

.ixtle-usuarios-header p {
    color: #64748b;
    font-weight: 700;
    margin-top: 6px;
}

.ixtle-usuarios-card,
.ixtle-usuarios-form-card {
    background: #ffffff;
    border: 1px solid #dbe4ef;
    border-radius: 22px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.ixtle-usuarios-table-wrap {
    overflow-x: auto;
}

.ixtle-usuarios-table {
    width: 100%;
    border-collapse: collapse;
}

.ixtle-usuarios-table th,
.ixtle-usuarios-table td {
    padding: 18px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.ixtle-usuarios-table th {
    background: #eef4ff;
    color: #1e3a8a;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0;
}

.ixtle-usuarios-table tr:last-child td {
    border-bottom: none;
}

.ixtle-usuarios-main {
    display: grid;
    gap: 4px;
}

.ixtle-usuarios-main strong {
    color: #0f172a;
    font-size: 16px;
}

.ixtle-usuarios-main span {
    color: #64748b;
    font-weight: 700;
}

.ixtle-usuarios-role,
.ixtle-usuarios-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.ixtle-usuarios-role--super_administrador { background: #ede9fe; color: #6d28d9; }
.ixtle-usuarios-role--administrador { background: #dbeafe; color: #1d4ed8; }
.ixtle-usuarios-role--vendedor { background: #dcfce7; color: #15803d; }
.ixtle-usuarios-role--disenador { background: #fce7f3; color: #be185d; }
.ixtle-usuarios-role--produccion { background: #fef3c7; color: #b45309; }
.ixtle-usuarios-role--contabilidad { background: #e0f2fe; color: #0369a1; }
.ixtle-usuarios-role--cliente { background: #f1f5f9; color: #334155; }

.ixtle-usuarios-status.is-active { background: #dcfce7; color: #166534; }
.ixtle-usuarios-status.is-inactive { background: #fee2e2; color: #b91c1c; }

.ixtle-usuarios-table__actions {
    text-align: right !important;
    white-space: nowrap;
}

.ixtle-usuarios-btn--light {
    background: #e2e8f0;
    color: #0f172a;
}

.ixtle-usuarios-btn--light:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.ixtle-usuarios-form-card {
    padding: 24px;
}

.ixtle-usuarios-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.ixtle-usuarios-form-grid small {
    color: #b91c1c;
    font-weight: 800;
}

.ixtle-usuarios-form-grid .is-invalid {
    border-color: #ef4444;
    background: #fff7f7;
}

.ixtle-usuarios-switch-row {
    display: flex !important;
    align-items: center;
    gap: 12px !important;
    min-height: 54px;
    padding: 0 16px;
    border: 1px solid #dbe4ef;
    border-radius: 16px;
    background: #f8fafc;
}

.ixtle-usuarios-switch-row input {
    width: 22px;
    min-height: 22px;
}

.ixtle-usuarios-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
}

.ixtle-usuarios-alert {
    border-radius: 16px;
    padding: 14px 16px;
    font-weight: 900;
}

.ixtle-usuarios-alert--success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.ixtle-usuarios-alert--danger {
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #b91c1c;
}

.ixtle-usuarios-empty {
    text-align: center !important;
    color: #64748b;
    font-weight: 800;
}
/* -- FIN BLOQUE 2 -- USUARIOS -- */


/* -- INICIO BLOQUE 3 -- RESPONSIVE -- */
@media (max-width: 860px) {
    .ixtle-auth-body {
        min-height: auto;
        overflow: auto;
        background:
            linear-gradient(180deg, rgba(2, 6, 23, 0.86) 0%, rgba(2, 6, 23, 0.62) 100%),
            url("../images/ixtle-fachada.png") center / cover no-repeat;
    }

    .ixtle-login {
        grid-template-columns: 1fr;
        padding: 28px 0;
        min-height: 100vh;
    }

    .ixtle-login__brand {
        text-align: center;
    }

    .ixtle-login__brand p {
        margin: 0 auto;
    }

    .ixtle-usuarios-header,
    .ixtle-usuarios-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .ixtle-usuarios-form-grid {
        grid-template-columns: 1fr;
    }
}
/* -- FIN BLOQUE 3 -- RESPONSIVE -- */
