/* ================================================================
   Perfil Profesional - Italmed
   Login + Dashboard para tecnólogos médicos
   ================================================================ */

/* -- Reset & Shell ------------------------------------------------ */
#italmed-perfil-pro {
    margin: 0 calc(50% - 50vw);
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    color: #1e293b;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
#italmed-perfil-pro *,
#italmed-perfil-pro *::before,
#italmed-perfil-pro *::after { box-sizing: border-box; }
#italmed-perfil-pro h1,
#italmed-perfil-pro h2,
#italmed-perfil-pro h3 {
    margin: 0; padding: 0;
    font-family: 'Sora', sans-serif;
    color: #0c2340;
    line-height: 1.2;
}
#italmed-perfil-pro p { margin: 0; }

/* ================================================================
   LOGIN
   ================================================================ */
.ipp-login-wrapper {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #0c2340 0%, #0AA2D1 50%, #0d9488 100%);
}

.ipp-login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    overflow: hidden;
}

.ipp-login-header {
    padding: 2rem 2rem 1.2rem;
    text-align: center;
}
.ipp-login-logo {
    width: 56px;
    height: auto;
    margin-bottom: .8rem;
}
.ipp-login-header h1 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: .3rem;
}
.ipp-login-header p {
    font-size: .85rem;
    color: #64748b;
}

.ipp-login-body {
    padding: 0 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ipp-login-footer {
    padding: 1rem 2rem 1.5rem;
    text-align: center;
    border-top: 1.5px solid #f1f5f9;
}
.ipp-login-footer p {
    font-size: .78rem;
    color: #94a3b8;
}

.ipp-login-error {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1rem;
    border-radius: 10px;
    background: #fef2f2;
    border: 1.5px solid #fecaca;
    color: #dc2626;
    font-size: .82rem;
    font-weight: 600;
}

/* -- Fields ------------------------------------------------------- */
.ipp-field {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.ipp-field span {
    font-size: .74rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .04em;
    display: flex;
    align-items: center;
    gap: .3rem;
}
.ipp-field span i { color: #0AA2D1; font-size: .72rem; }

.ipp-input {
    width: 100%;
    padding: .75rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: .9rem;
    font-family: inherit;
    color: #1e293b;
    background: #f8fafc;
    outline: none;
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.ipp-input:focus {
    border-color: #0AA2D1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(10,162,209,.12);
}
.ipp-input::placeholder { color: #94a3b8; }

/* -- Buttons ------------------------------------------------------ */
.ipp-btn {
    border: none;
    border-radius: 10px;
    padding: .7rem 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    font-size: .85rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: filter .15s, transform .15s, box-shadow .15s;
    text-decoration: none;
}
.ipp-btn:hover { transform: translateY(-1px); }
.ipp-btn:active { transform: translateY(0); }

.ipp-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #0c2340 0%, #0AA2D1 100%);
    box-shadow: 0 4px 14px rgba(10,162,209,.25);
}
.ipp-btn-primary:hover {
    filter: brightness(1.06);
    box-shadow: 0 6px 20px rgba(10,162,209,.3);
}

.ipp-btn-ghost-light {
    color: rgba(255,255,255,.9);
    background: rgba(255,255,255,.15);
    border: 1.5px solid rgba(255,255,255,.25);
}
.ipp-btn-ghost-light:hover {
    background: rgba(255,255,255,.25);
}

.ipp-btn-full { width: 100%; }

/* ================================================================
   DASHBOARD
   ================================================================ */

/* -- Hero --------------------------------------------------------- */
.ipp-hero {
    background: linear-gradient(135deg, #0c2340 0%, #0AA2D1 100%);
    padding: 2.5rem 1.5rem 2rem;
    color: #fff;
}
.ipp-hero-content {
    max-width: 920px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.ipp-hero-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    border: 2px solid rgba(255,255,255,.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.ipp-hero-info { flex: 1; }
.ipp-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 50px;
    padding: .2rem .7rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: .4rem;
}
.ipp-hero h1 {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 800;
    color: #fff !important;
    margin-bottom: .15rem;
}
.ipp-hero p {
    font-size: .88rem;
    opacity: .8;
}
#ippLogout {
    margin-left: auto;
    flex-shrink: 0;
}

/* -- Body --------------------------------------------------------- */
.ipp-body {
    max-width: 920px;
    margin: 0 auto;
    padding: 1.8rem 1.5rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* -- Card --------------------------------------------------------- */
.ipp-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
    border: 1.5px solid #f1f5f9;
    overflow: hidden;
}
.ipp-card-header {
    background: linear-gradient(135deg, #0c2340, #0AA2D1);
    padding: 1rem 1.4rem;
    display: flex;
    align-items: center;
    gap: .65rem;
}
.ipp-card-header i { color: #fff; font-size: 1.1rem; flex-shrink: 0; }
.ipp-card-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #fff !important;
}
.ipp-card-header--tools {
    background: linear-gradient(135deg, #581c87, #7c3aed);
}
.ipp-card-header--activity {
    background: linear-gradient(135deg, #065f46, #0d9488);
}
.ipp-card-body {
    padding: 1.4rem;
}

/* -- Profile Grid ------------------------------------------------- */
.ipp-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.ipp-profile-item {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.ipp-profile-label {
    font-size: .7rem;
    font-weight: 700;
    color: #0AA2D1;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.ipp-profile-value {
    font-size: .92rem;
    font-weight: 600;
    color: #1e293b;
}

/* -- Tools Grid --------------------------------------------------- */
.ipp-tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.ipp-tool-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1.1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    background: #fafbfc;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, box-shadow .15s, transform .15s;
    position: relative;
}
.ipp-tool-card:hover {
    border-color: #bae6fd;
    box-shadow: 0 4px 16px rgba(10,162,209,.12);
    transform: translateY(-2px);
}
.ipp-tool-card--soon {
    opacity: .6;
    pointer-events: none;
}
.ipp-tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.ipp-tool-icon--blue { background: #e0f2fe; color: #0369a1; }
.ipp-tool-icon--purple { background: #f3e8ff; color: #7c3aed; }
.ipp-tool-icon--teal { background: #ccfbf1; color: #0d9488; }
.ipp-tool-icon--gray { background: #f1f5f9; color: #94a3b8; }

.ipp-tool-info { flex: 1; min-width: 0; }
.ipp-tool-info h3 {
    font-size: .88rem;
    font-weight: 700;
    margin-bottom: .2rem;
}
.ipp-tool-info p {
    font-size: .78rem;
    color: #64748b;
    line-height: 1.45;
}
.ipp-tool-arrow {
    color: #cbd5e1;
    font-size: .8rem;
    flex-shrink: 0;
    transition: color .15s;
}
.ipp-tool-card:hover .ipp-tool-arrow { color: #0AA2D1; }

.ipp-tool-badge {
    position: absolute;
    top: .6rem;
    right: .6rem;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 20px;
    padding: .15rem .55rem;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* -- Activity Summary --------------------------------------------- */
.ipp-activity-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: center;
}
.ipp-activity-stat {
    padding: 1rem;
    border-radius: 12px;
    background: #f0fdfa;
    border: 1.5px solid #ccfbf1;
}
.ipp-activity-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: #0d9488;
    font-family: 'Sora', sans-serif;
}
.ipp-activity-label {
    font-size: .72rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ================================================================
   HEADER BUTTON (btn-pro-access) — small icon in nav
   ================================================================ */
.btn-pro-access {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(220, 38, 38, .1) !important;
    color: #dc2626 !important;
    border: 1.5px solid rgba(220, 38, 38, .25) !important;
    font-size: .85rem !important;
    transition: background .2s, transform .2s !important;
    text-decoration: none !important;
    margin-right: .3rem;
}
.btn-pro-access:hover {
    background: rgba(220, 38, 38, .18) !important;
    transform: scale(1.08);
}

/* Mobile version in menu */
.btn-pro-mobile {
    color: #dc2626 !important;
    border-color: rgba(220, 38, 38, .3) !important;
}

/* ================================================================
   PROFILE FORM
   ================================================================ */

/* ── Hero actions row ─── */
.ipp-hero-actions {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-left: auto;
}
.ipp-quick-btn {
    width: 38px; height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    color: #fff;
    font-size: .95rem;
    text-decoration: none;
    border: 1.5px solid rgba(255,255,255,.25);
    transition: background .2s, transform .2s;
}
.ipp-quick-btn:hover {
    background: rgba(255,255,255,.28);
    transform: scale(1.1);
}

.ipp-profile-form .ipp-field { margin-bottom: .85rem; }
.ipp-profile-form .ipp-field label {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #475569;
    margin-bottom: .3rem;
}
.ipp-profile-form .ipp-field input {
    width: 100%;
    padding: .55rem .75rem;
    font-size: .88rem;
    font-family: 'Manrope', system-ui, sans-serif;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #1e293b;
    transition: border-color .2s, box-shadow .2s;
}
.ipp-profile-form .ipp-field input:focus {
    outline: none;
    border-color: #0AA2D1;
    box-shadow: 0 0 0 3px rgba(10,162,209,.12);
}
.ipp-profile-form .ipp-field input[readonly] {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: default;
}

/* ── Toggle row ─── */
.ipp-toggle-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin: 1rem 0;
    padding: .75rem 1rem;
    background: #f0f9ff;
    border-radius: 12px;
    border: 1px solid #bae6fd;
}
.ipp-toggle {
    position: relative;
    width: 44px; height: 24px;
    flex-shrink: 0;
}
.ipp-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.ipp-toggle-slider {
    position: absolute; inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    cursor: pointer;
    transition: background .25s;
}
.ipp-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .25s;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.ipp-toggle input:checked + .ipp-toggle-slider { background: #0AA2D1; }
.ipp-toggle input:checked + .ipp-toggle-slider::before { transform: translateX(20px); }
.ipp-toggle-info {
    font-size: .82rem;
    color: #334155;
    line-height: 1.35;
}
.ipp-toggle-info strong { display: block; font-size: .85rem; color: #0c2340; }

/* ── Form actions ─── */
.ipp-form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.1rem;
}
.ipp-form-actions button {
    padding: .55rem 1.3rem;
    font-size: .82rem;
    font-weight: 700;
    font-family: 'Sora', sans-serif;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #0AA2D1, #0d9488);
    color: #fff;
    cursor: pointer;
    transition: opacity .2s, transform .2s;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}
.ipp-form-actions button:hover { opacity: .88; transform: translateY(-1px); }
.ipp-form-actions button:disabled { opacity: .55; cursor: wait; }
.ipp-form-msg {
    display: none;
    font-size: .78rem;
    font-weight: 600;
    padding: .3rem .7rem;
    border-radius: 8px;
}
.ipp-form-msg--ok { background: #dcfce7; color: #166534; }
.ipp-form-msg--err { background: #fee2e2; color: #991b1b; }

/* ================================================================
   ADMIN – CREATE USER SECTION
   ================================================================ */
.ipp-admin-form .ipp-field { margin-bottom: .85rem; }
.ipp-admin-form .ipp-field label {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #475569;
    margin-bottom: .3rem;
}
.ipp-admin-form .ipp-field input {
    width: 100%;
    padding: .55rem .75rem;
    font-size: .88rem;
    font-family: 'Manrope', system-ui, sans-serif;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #1e293b;
    transition: border-color .2s, box-shadow .2s;
}
.ipp-admin-form .ipp-field input:focus {
    outline: none;
    border-color: #0AA2D1;
    box-shadow: 0 0 0 3px rgba(10,162,209,.12);
}
.ipp-admin-form .ipp-form-actions button {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* ================================================================
   ADMIN — USERS TABLE
   ================================================================ */
.ipp-users-table-wrap { overflow-x: auto; }
.ipp-users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
}
.ipp-users-table th {
    text-align: left;
    padding: .5rem .6rem;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.ipp-users-table td {
    padding: .55rem .6rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}
.ipp-users-table tbody tr:hover { background: #f8fafc; }
.ipp-badge-admin {
    display: inline-block;
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    background: #fee2e2;
    color: #991b1b;
    padding: .1rem .4rem;
    border-radius: 6px;
    letter-spacing: .03em;
    vertical-align: middle;
    margin-left: .3rem;
}
.ipp-users-actions {
    display: flex;
    gap: .35rem;
    white-space: nowrap;
}
.ipp-tbl-btn {
    width: 30px; height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    font-size: .75rem;
    cursor: pointer;
    transition: all .2s;
}
.ipp-tbl-btn:hover { background: #f1f5f9; }
.ipp-tbl-btn--edit:hover { color: #0AA2D1; border-color: #0AA2D1; }
.ipp-tbl-btn--del:hover { color: #dc2626; border-color: #dc2626; }

/* ================================================================
   EDIT MODAL
   ================================================================ */
.ipp-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.ipp-edit-modal[hidden] { display: none; }
.ipp-edit-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(3px);
}
.ipp-edit-modal-content {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    overflow: hidden;
}
.ipp-edit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.2rem;
    background: linear-gradient(135deg, #0c2340, #0AA2D1);
    color: #fff;
}
.ipp-edit-modal-header h3 {
    font-size: .95rem;
    font-family: 'Sora', sans-serif;
    color: #fff;
    display: flex;
    align-items: center;
    gap: .45rem;
}
.ipp-edit-modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    font-size: 1.1rem;
    cursor: pointer;
    padding: .2rem;
    transition: color .2s;
}
.ipp-edit-modal-close:hover { color: #fff; }
.ipp-edit-modal-content .ipp-admin-form {
    padding: 1.2rem;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 680px) {
    .ipp-hero-content {
        flex-direction: column;
        text-align: center;
    }
    #ippLogout { margin-left: 0; }
    .ipp-hero-actions { margin-left: 0; justify-content: center; }
    .ipp-profile-grid { grid-template-columns: 1fr; }
    .ipp-tools-grid { grid-template-columns: 1fr; }
    .ipp-activity-summary { grid-template-columns: 1fr; }
    .ipp-body { padding: 1.2rem 1rem 3rem; }
    .ipp-login-body { padding: 0 1.2rem 1.2rem; }
    .ipp-login-header { padding: 1.5rem 1.2rem 1rem; }
    .ipp-toggle-row { flex-direction: column; text-align: center; }
    .ipp-form-actions { flex-direction: column; }
}

@media (max-width: 480px) {
    .ipp-hero h1 { font-size: 1.2rem; }
    .ipp-card-header { padding: .85rem 1rem; }
    .ipp-card-header h2 { font-size: .9rem; }
}
