/* General Styles */
body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
}

/* ======= Introducir: center page layout ======= */
.introducir-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 18px 16px 32px 16px;
}
.introducir-container {
    width: 100%;
    max-width: 900px;
    padding: 0 16px;
}
.introducir-container h1 {
    text-align: center;
    color: #0f172a;
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 18px 0;
    letter-spacing: -0.025em;
}

/* ======= Admin Users: Form Card & Layout ======= */
.form-card {
    width: 100%;
    max-width: 820px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 24px 45px -32px rgba(15, 23, 42, 0.35), 0 12px 32px -20px rgba(148, 163, 184, 0.45);
    padding: 20px;
    margin: 16px auto 8px auto;
}

.form-card h2,
.form-card h3 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #0f172a;
    font-size: 18px;
    font-weight: 600;
}

.form-card .field label {
    font-weight: 600;
    font-size: 14px;
    color: #334155;
}

.form-card .field input,
.form-card .field select,
.form-card .field textarea {
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.form-card .field input:focus,
.form-card .field select:focus,
.form-card .field textarea:focus {
    outline: none;
    border-color: #23AAC5;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(35, 170, 197, 0.1);
}

.form-card .field textarea {
    min-height: 70px;
    resize: vertical;
    width: 100%;
}

/* Panel de departamentos en formulario de usuario */
.user-depts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
}

.dept-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.dept-checkbox:hover {
    border-color: #23AAC5;
    background: #f0f9ff;
}

.dept-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.dept-checkbox input[type="checkbox"]:checked + span {
    color: #23AAC5;
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 16px;
}

#form-admin-user {
    max-width: 100%;
    width: auto;
}

@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
}

.form-grid .field { display: flex; flex-direction: column; gap: 6px; }
.helper-text { color: #64748b; font-size: 12px; }
.field-error { color: #b91c1c; font-size: 12px; margin-top: 4px; }

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

.btn-primary {
    background: linear-gradient(135deg, #23AAC5 0%, #158ca3 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(35, 170, 197, 0.25);
    width: auto; /* override global button width */
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(35, 170, 197, 0.35); }

.page-header {
    width: 100%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hidden { display: none !important; }

/* Password field group for admin users form */
.password-group {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
}

/* Utilities to avoid inline styles (CSP-friendly) */
.field-full { grid-column: 1 / -1; }
.inline { display: inline !important; }

/* Alerts (CSP-friendly, no inline style attrs) */
.alert-error {
    color: #b91c1c;
    background: #fee2e2;
    border: 1px solid #fecaca;
    padding: 8px 10px;
    border-radius: 8px;
    width: 100%;
    max-width: 820px;
    margin: 10px auto;
}
.alert-notice {
    color: #065f46;
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    padding: 10px 12px;
    border-radius: 8px;
    width: 100%;
    max-width: 820px;
    margin: 10px auto;
}

/* ======= Admin Users: role select polished ======= */
#form-admin-user select#role {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 40px;
    padding: 8px 40px 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font-size: 14px;
    line-height: 1.2;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    /* Custom arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2362748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px 18px;
}

#form-admin-user select#role:hover {
    border-color: #cbd5e1;
}

#form-admin-user select#role:focus {
    outline: none;
    border-color: #23AAC5;
    box-shadow: 0 0 0 3px rgba(35, 170, 197, 0.25);
}

#form-admin-user select#role:disabled {
    background-color: #f8fafc;
    color: #94a3b8;
    border-color: #e5e7eb;
    cursor: not-allowed;
}

h1 {
    color: #333;
    margin-bottom: 20px;
}

/* Page container to center content while keeping sticky header flush to top */
.page {
    width: 100%;
    max-width: 1900px;
    margin: 0 auto;
}

/* ======= Auth (Login) Page ======= */
.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.login-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 80px;
    background: linear-gradient(135deg, #23AAC5 0%, #1995ad 100%);
    color: #ffffff;
}

.login-brand {
    margin-bottom: 40px;
}

.login-brand-logo {
    width: 300px;
    height: auto;
    filter: brightness(0) invert(1);
}

.login-welcome h1 {
    font-size: 42px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.login-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 48px 0;
    line-height: 1.5;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.feature-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.feature-item svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.95);
    margin-top: 2px;
}

.feature-item h3 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 6px 0;
}

.feature-item p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    line-height: 1.5;
}

.login-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
    padding: 40px;
}

.login-card h2 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.login-card-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 28px 0;
}

.login-container .auth-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
    width: 100% !important;
}

.login-container .auth-form .form-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.login-container .auth-form label { 
    color: #0f172a !important; 
    font-weight: 600 !important; 
    font-size: 14px !important;
    margin: 0 !important;
}

.login-container .auth-form input[type="email"],
.login-container .auth-form input[type="password"] {
    width: 100% !important;
    height: 48px !important;
    padding: 12px 16px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    transition: all 0.2s ease !important;
    background: #f8fafc !important;
    box-sizing: border-box !important;
}

.login-container .auth-form input[type="email"]:focus,
.login-container .auth-form input[type="password"]:focus {
    outline: none !important;
    border-color: #23AAC5 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(35, 170, 197, 0.1) !important;
}

.login-container .auth-form input::placeholder {
    color: #94a3b8 !important;
}

.login-container .auth-remember {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-size: 14px !important;
    color: #334155 !important;
    cursor: pointer !important;
    user-select: none !important;
    font-weight: normal !important;
}

.login-container .auth-remember input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    cursor: pointer !important;
}

.login-container .btn-login {
    width: 100% !important;
    height: 52px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin-top: 8px !important;
    display: block !important;
    box-sizing: border-box !important;
}

.login-container button[type="submit"] {
    width: 100% !important;
    max-width: 100% !important;
}

/* Responsive para login */
@media (max-width: 1024px) {
    .login-container {
        grid-template-columns: 1fr;
    }
    
    .login-left {
        padding: 40px;
        min-height: auto;
    }
    
    .login-brand-logo {
        width: 240px;
    }
    
    .login-welcome h1 {
        font-size: 32px;
    }
    
    .login-subtitle {
        font-size: 16px;
        margin-bottom: 32px;
    }
    
    .login-features {
        display: none;
    }
}

@media (max-width: 640px) {
    .login-left {
        padding: 32px 24px;
    }
    
    .login-right {
        padding: 24px;
    }
    
    .login-card {
        padding: 32px 24px;
    }
    
    .login-brand-logo {
        width: 200px;
    }
    
    .login-welcome h1 {
        font-size: 26px;
    }
}

/* ======= Page Hero: Modern title + search section ======= */
.page-hero {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.page-hero__content {
    text-align: center;
}

.page-hero__title {
    font-size: 36px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.page-hero__subtitle {
    font-size: 16px;
    color: #64748b;
    margin: 0;
    font-weight: 400;
}

/* Search Box */
.search-box {
    width: 100%;
    max-width: 560px;
}

.search-box__input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.search-box__input-wrapper:hover {
    border-color: #cbd5e1;
}

.search-box__input-wrapper:focus-within {
    border-color: #23AAC5;
    box-shadow: 0 4px 20px rgba(35, 170, 197, 0.15), 0 0 0 4px rgba(35, 170, 197, 0.08);
}

.search-box__icon {
    position: absolute;
    left: 16px;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s ease;
}

.search-box__input-wrapper:focus-within .search-box__icon {
    color: #23AAC5;
}

.search-box input#search {
    width: 100%;
    height: 52px;
    padding: 14px 48px 14px 48px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-family: 'Montserrat', sans-serif;
    color: #1e293b;
    background: transparent;
}

.search-box input#search:focus {
    outline: none;
}

.search-box input#search::placeholder {
    color: #94a3b8;
}

.search-box__clear {
    position: absolute;
    right: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: none;
    border-radius: 10px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-box__clear:hover {
    background: #e2e8f0;
    color: #334155;
}

/* Responsive */
@media (max-width: 640px) {
    .page-hero {
        padding: 28px 16px 24px 16px;
        gap: 20px;
    }
    
    .page-hero__title {
        font-size: 28px;
    }
    
    .page-hero__subtitle {
        font-size: 14px;
    }
    
    .search-box input#search {
        height: 48px;
        font-size: 14px;
    }
}

/* Legacy search form (keep for backwards compatibility) */
.search-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 8px auto 18px auto;
    width: 100%;
    max-width: 840px;
}
.search-form label { font-weight: 600; color: #0f172a; }
.search-form input#search {
    flex: 1 1 520px;
    min-width: 240px;
    height: 40px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.search-form .clear-search-btn {
    height: 40px;
}

/* Remove collapsed top margins inside page to avoid gap below sticky header */
.page > :first-child {
    margin-top: 0;
}

/* ======= Modern Form Styles (introducir.php, edit-password.php) ======= */
.introducir-page form {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 24px 45px -32px rgba(15, 23, 42, 0.35), 0 12px 32px -20px rgba(148, 163, 184, 0.45);
    padding: 24px 22px 24px 22px;
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.introducir-page form::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.introducir-page label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 6px !important;
    letter-spacing: -0.01em;
}

.introducir-page input[type="text"],
.introducir-page input[type="password"],
.introducir-page input[type="email"],
.introducir-page textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: #1e293b;
    background: #ffffff;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.introducir-page input[type="text"]:focus,
.introducir-page input[type="password"]:focus,
.introducir-page input[type="email"]:focus,
.introducir-page textarea:focus {
    outline: none;
    border-color: #23AAC5;
    box-shadow: 0 0 0 3px rgba(35, 170, 197, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
    background: #ffffff;
}

.introducir-page input[type="text"]::placeholder,
.introducir-page input[type="password"]::placeholder,
.introducir-page input[type="email"]::placeholder,
.introducir-page textarea::placeholder {
    color: #94a3b8;
}

textarea {
    min-height: 70px;
    resize: vertical;
    line-height: 1.5;
}

/* Prevent checkboxes from inheriting global width */
input[type="checkbox"] {
    width: auto;
    padding: 0;
    border: none;
}

/* Primary submit button */
.introducir-page form button[type="submit"] {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #23AAC5 0%, #158ca3 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 3px 10px rgba(35, 170, 197, 0.28);
    transition: all 0.2s ease;
    margin-top: 4px;
}

.introducir-page form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(35, 170, 197, 0.4);
    background: linear-gradient(135deg, #1c90ab 0%, #107a8f 100%);
}

.introducir-page form button[type="submit"]:active {
    transform: translateY(0);
}

/* Secondary buttons (toggle, paste, etc.) */
.introducir-page .password-buttons {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.introducir-page .password-buttons button {
    width: auto;
    padding: 10px 16px;
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.2);
    transition: all 0.2s ease;
}

.password-buttons button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(100, 116, 139, 0.3);
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

/* Form field spacing */
.introducir-page form > label,
.introducir-page form > input,
.introducir-page form > textarea,
.introducir-page form > .password-buttons,
.introducir-page form > section {
    margin-bottom: 14px;
}

.introducir-page form > button[type="submit"] {
    margin-top: 20px;
    margin-bottom: 0;
}

/* Table Styles */
.table-container {
    width: 100%;
    margin: 24px 0 48px;
    padding: 0 12px;
    display: flex;
    justify-content: center;
}

.table-card {
    width: 100%;
    max-width: 1200px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 24px 45px -32px rgba(15, 23, 42, 0.35), 0 12px 32px -20px rgba(148, 163, 184, 0.45);
    overflow: hidden;
    position: relative;
}

.table-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.table-card__inner {
    width: 100%;
    overflow-x: auto;
}

.table-card__inner::-webkit-scrollbar {
    height: 10px;
}

.table-card__inner::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.6);
    border-radius: 999px;
}

.table-card__inner::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #23aac5 0%, #158ca3 100%);
    border-radius: 999px;
}

.table-card__inner::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1c90ab 0%, #107a8f 100%);
}

.tabla-passwords {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 860px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    transition: background 0.2s ease;
}

.tabla-passwords thead th {
    color: #0f172a;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.45);
    border-right: 1px solid rgba(148, 163, 184, 0.25);
    white-space: nowrap;
    text-align: left;
}

.tabla-passwords thead th:last-child {
    border-right: none;
}

.tabla-passwords th,
.tabla-passwords td {
    text-align: left;
}

/* Column widths: 1=Línea, 2=Nombre, 3=Descripción, 4=Usuario, 5=Contraseña, 6=Enlace, 7=Info, 8=Acciones */
.tabla-passwords th:nth-child(1), .tabla-passwords td:nth-child(1) { width: 9%; }
.tabla-passwords th:nth-child(2), .tabla-passwords td:nth-child(2) { width: 11%; }
.tabla-passwords th:nth-child(3), .tabla-passwords td:nth-child(3) { width: 12%; }
.tabla-passwords th:nth-child(4), .tabla-passwords td:nth-child(4) { width: 13%; }
.tabla-passwords th:nth-child(5), .tabla-passwords td:nth-child(5) { width: 18%; }
.tabla-passwords th:nth-child(6), .tabla-passwords td:nth-child(6) { width: 23%; }
.tabla-passwords th:nth-child(7), .tabla-passwords td:nth-child(7) { width: 8%; }
.tabla-passwords th:nth-child(8), .tabla-passwords td:nth-child(8) { width: 6%; white-space: nowrap; }

.tabla-passwords tbody tr {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    transition: background 0.2s ease;
}

.tabla-passwords tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.95);
}

.tabla-passwords tbody tr:hover {
    background: #f1fbfd;
}

.tabla-passwords tbody tr:last-child td {
    border-bottom: none;
}

.tabla-passwords td {
    padding: 16px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
    vertical-align: middle;
    border-right: 1px solid rgba(226, 232, 240, 0.65);
    word-break: break-word;
}

.tabla-passwords td:last-child {
    border-right: none;
}

.tabla-passwords a {
    color: #0f8cad;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.tabla-passwords a:hover {
    color: #0b7285;
    text-decoration: underline;
    text-decoration-color: rgba(11, 114, 133, 0.6);
}

@media (max-width: 1100px) {
    .table-container {
        padding: 0;
    }

    .table-card {
        border-radius: 16px;
    }

    .tabla-passwords {
        min-width: 720px;
    }
}

@media (max-width: 768px) {
    .table-card {
        border-radius: 12px;
        box-shadow: 0 20px 36px -28px rgba(15, 23, 42, 0.45);
    }

    .tabla-passwords thead th,
    .tabla-passwords td {
        padding: 14px 16px;
    }
}

/* ===== Password column: text + toggle + copy button ===== */
.password-cell {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 4px;
    width: 100%;
}

/* Ensure inner elements in password cell have no borders/backgrounds */
.password-cell * {
    border: 0 !important;
    background: transparent !important;
}

.password-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    overflow-wrap: anywhere; /* allow wrapping within long tokens */
}

.toggle-password-btn,
.copy-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
    color: #23AAC5;
    cursor: pointer;
    border-radius: 6px;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}

.toggle-password-btn:hover,
.copy-btn:hover { color: #158ca3; background: transparent !important; }
.toggle-password-btn:active,
.copy-btn:active { background: transparent !important; }
.toggle-password-btn:focus,
.copy-btn:focus { outline: none; box-shadow: 0 0 0 2px rgba(35,170,197,0.35); }
.toggle-password-btn svg,
.copy-btn svg { pointer-events: none; }

/* Feedback states */
.copy-btn.copied { color: #16a34a; }
.copy-btn.copy-error { color: #dc2626; }

/* Toggle password button states */
.toggle-password-btn.showing { color: #64748b; }

/* Search form styling */
.search-form {
    max-width: 1100px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-form label {
    font-weight: 500;
    color: #475569;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-form input {
    flex: 1;
    min-width: 300px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-form input:focus {
    outline: none;
    border-color: #23AAC5;
    box-shadow: 0 0 0 3px rgba(35, 170, 197, 0.1);
}

/* Modern clear search button */
.clear-search-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    width: 110px;
    justify-content: center;
}

.clear-search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(100, 116, 139, 0.3);
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

/* ======= Site Header (Senior UX Design) ======= */
.site-header {
    position: sticky;
    top: 0;
    width: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-bottom: 1px solid #e2e8f0;
    backdrop-filter: blur(8px);
    z-index: 1000;
    transition: all 0.3s ease;
}

.site-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
}

.site-header__brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.2s ease;
}
.brand-link:hover {
    transform: translateY(-1px);
}

.brand-logo {
    height: 42px;
    width: 162px;
    object-fit: contain;
    border-radius: 8px;
}

.brand-title {
    font-weight: 700;
    color: #1e293b;
    font-size: 18px;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #23AAC5 0%, #158ca3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-header__nav {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.8);
    padding: 4px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-link {
    text-decoration: none;
    color: #475569;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-link:hover {
    background: #23AAC5;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(35, 170, 197, 0.3);
}
.nav-link.active {
    background: #23AAC5;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(35, 170, 197, 0.25);
}

.site-header__user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #23AAC5 0%, #158ca3 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(35, 170, 197, 0.2);
}

.user-label {
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px;
    background: rgba(100, 116, 139, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(100, 116, 139, 0.2);
    white-space: nowrap;
}

.logout-form {
    margin: 0;
    background: transparent;
    padding: 0;
    border: 0;
    box-shadow: none;
    display: contents; /* render only the button without extra box */
}

.logout-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
}
.logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .site-header__inner {
        padding: 12px 16px;
        gap: 16px;
        min-height: 64px;
    }
    
    .brand-title {
        display: none;
    }
    
    .brand-logo {
        height: 36px;
        width: 36px;
    }
    
    .site-header__nav {
        gap: 2px;
        padding: 2px;
    }
    
    .nav-link {
        padding: 8px 10px;
        font-size: 12px;
        gap: 4px;
    }
    
    .nav-link svg {
        width: 14px;
        height: 14px;
    }
    
    .user-label {
        display: none;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .logout-btn {
        padding: 8px 10px;
        font-size: 11px;
        gap: 4px;
    }
    
    .logout-btn svg {
        width: 12px;
        height: 12px;
    }
}

.tabla-usuarios {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 720px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    transition: background 0.2s ease;
}
.tabla-usuarios thead th {
    color: #0f172a;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.45);
    border-right: 1px solid rgba(148, 163, 184, 0.25);
    white-space: nowrap;
    text-align: left;
}
.tabla-usuarios thead th:last-child { border-right: none; }
.tabla-usuarios th, .tabla-usuarios td { text-align: left; }

/* Column widths: 1=ID, 2=Email, 3=Rol, 4=Creado, 5=Último, 6=Acciones */
.tabla-usuarios th:nth-child(1), .tabla-usuarios td:nth-child(1) { width: 8%; }
.tabla-usuarios th:nth-child(2), .tabla-usuarios td:nth-child(2) { width: 34%; }
.tabla-usuarios th:nth-child(3), .tabla-usuarios td:nth-child(3) { width: 12%; }
.tabla-usuarios th:nth-child(4), .tabla-usuarios td:nth-child(4) { width: 18%; }
.tabla-usuarios th:nth-child(5), .tabla-usuarios td:nth-child(5) { width: 18%; }
.tabla-usuarios th:nth-child(6), .tabla-usuarios td:nth-child(6) { width: 10%; white-space: nowrap; }

.tabla-usuarios tbody tr {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    transition: background 0.2s ease;
}
.tabla-usuarios tbody tr:nth-child(even) { background: rgba(248, 250, 252, 0.95); }
.tabla-usuarios tbody tr:hover { background: #f1fbfd; }
.tabla-usuarios tbody tr:last-child td { border-bottom: none; }
.tabla-usuarios td {
    padding: 16px 20px;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
    vertical-align: middle;
    border-right: 1px solid rgba(226, 232, 240, 0.65);
    word-break: break-word;
}
.tabla-usuarios td:last-child { border-right: none; }
.tabla-usuarios a { color: #0f8cad; font-weight: 600; text-decoration: none; transition: color 0.2s ease, text-decoration-color 0.2s ease; }
.tabla-usuarios a:hover { color: #0b7285; text-decoration: underline; text-decoration-color: rgba(11, 114, 133, 0.6); }

/* ======= Auth (Login) Page ======= */
.button-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 20px;
    align-items: center;
    justify-content: flex-start;
    white-space: nowrap;
}

.auth-page h1 {
    text-align: center;
    margin: 8px 0 12px 0;
}

.auth-page .error {
    text-align: center;
}

.auth-page form {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
}

.auth-page form button[type="submit"] {
    width: 100%;
}

@media (max-width: 480px) {
    .auth-page { padding: 32px 12px; }
    .auth-page form { max-width: 360px; }
}

/* ======= Assignees (Share) Panel ======= */
.assignees-panel {
    margin-top: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.modify-btn, .delete-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
    color: #23AAC5; /* base brand color */
    cursor: pointer;
    border-radius: 6px;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none !important;
    transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.modify-btn:hover, .delete-btn:hover {
    color: #158ca3;
    background-color: rgba(35,170,197,0.12) !important; /* subtle tile */
    box-shadow: inset 0 0 0 1px rgba(35,170,197,0.18);
}
.modify-btn:focus, .delete-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(35,170,197,0.35);
}
.modify-btn svg, .delete-btn svg { pointer-events: none; }

.assignees-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.assignees-header > label {
    font-weight: 600;
    font-size: 15px;
    color: #0f172a;
    letter-spacing: -0.01em;
}
.assignees-actions {
    display: flex;
    gap: 8px;
}

.assignees-actions .btn-secondary {
    width: auto; /* override global button width */
}

.assignees-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    max-height: 240px;
    overflow: auto;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

@media (min-width: 520px) {
    .assignees-list { grid-template-columns: 1fr 1fr; }
}

.assignee-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    cursor: pointer;
}

.assignee-item:hover {
    border-color: #23AAC5;
    box-shadow: 0 2px 8px rgba(35, 170, 197, 0.12);
    transform: translateY(-1px);
}

.assignee-email {
    color: #1e293b;
    font-weight: 500;
    font-size: 12px;
}

.assignee-role {
    margin-left: auto;
    font-size: 11px;
    color: #475569;
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid rgba(100, 116, 139, 0.2);
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.assignees-hint {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-top: 12px;
    line-height: 1.5;
}

/* Secondary button style matching theme */
.btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.2);
    width: auto; /* ensure not full width */
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(100, 116, 139, 0.3);
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

/* ======= Admin Sections (Users & Departments) ======= */
.admin-section {
    margin: 40px 0;
    padding: 0 20px;
}

.admin-section:first-of-type {
    margin-top: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.section-header h2 {
    font-size: 22px;
    color: #0f172a;
    font-weight: 700;
    margin: 0;
}

.tabla-departamentos {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.tabla-departamentos thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.tabla-departamentos thead th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #e2e8f0;
}

.tabla-departamentos tbody tr {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    transition: background 0.2s ease;
}

.tabla-departamentos tbody tr:hover {
    background: rgba(248, 250, 252, 1);
}

.tabla-departamentos td {
    padding: 14px 18px;
    font-size: 14px;
    color: #1f2937;
}

/* Badges de departamentos en tabla de usuarios */
.user-departments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dept-badge {
    display: inline-block;
    background: linear-gradient(135deg, #23AAC5 0%, #1995ad 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.text-muted {
    color: #94a3b8;
    font-style: italic;
}

/* ======= Modal Styles ======= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none;
    opacity: 0;
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Ajustar assignees-panel dentro del modal */
.modal-body .assignees-panel {
    margin: 0;
    border: none;
    box-shadow: none;
    padding: 0;
}

.modal-body .assignees-list {
    max-height: 320px;
}

/* ======= Mi Cuenta Page ======= */
.account-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px 60px 24px;
}

.account-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    padding: 32px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.account-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #23AAC5 0%, #158ca3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(35, 170, 197, 0.3);
}

.account-avatar__initial {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
}

.account-header__info {
    flex: 1;
}

.account-header__name {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
    letter-spacing: -0.02em;
}

.account-header__email {
    font-size: 15px;
    color: #64748b;
    margin: 0 0 12px 0;
}

.account-header__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge--role {
    background: linear-gradient(135deg, #23AAC5 0%, #158ca3 100%);
    color: #ffffff;
}

.badge--dept {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .account-grid {
        grid-template-columns: 1fr;
    }
    
    .account-header {
        flex-direction: column;
        text-align: center;
    }
    
    .account-header__badges {
        justify-content: center;
    }
}

.account-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.account-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.account-card__header svg {
    color: #23AAC5;
}

.account-card__header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.account-form {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.account-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 480px) {
    .account-form .form-row {
        grid-template-columns: 1fr;
    }
}

.account-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.account-form label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.account-form input[type="text"],
.account-form input[type="email"],
.account-form input[type="password"] {
    width: 100%;
    height: 44px;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    color: #1e293b;
    background: #ffffff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.account-form input:focus {
    outline: none;
    border-color: #23AAC5;
    box-shadow: 0 0 0 4px rgba(35, 170, 197, 0.1);
}

.account-form input:disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.account-form input::placeholder {
    color: #94a3b8;
}

.form-hint {
    font-size: 12px;
    color: #94a3b8;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #64748b;
}

.account-form .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.account-form .btn-password {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.25);
}

.account-form .btn-password:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    box-shadow: 0 4px 14px rgba(100, 116, 139, 0.35);
}

.dept-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    min-height: 44px;
    align-items: center;
}

.dept-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}

.dept-none {
    color: #94a3b8;
    font-size: 13px;
    font-style: italic;
}

.account-footer {
    padding: 20px 24px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.account-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
}

.account-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
}

.account-meta svg {
    color: #94a3b8;
}

/* User info link in header */
.user-info-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    background: transparent;
}

.user-info-link:hover {
    background: rgba(35, 170, 197, 0.08);
}

.user-info-link.active {
    background: rgba(35, 170, 197, 0.12);
}

.user-info-link .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #23AAC5 0%, #158ca3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
}

.user-info-link .user-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.user-info-link .user-chevron {
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.user-info-link:hover .user-chevron {
    transform: translateX(2px);
    color: #23AAC5;
}

/* ======= Admin Modals Enhancements ======= */
.modal-content--md {
    max-width: 560px;
}

.modal-content--sm {
    max-width: 440px;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.modal-form-grid .form-group--full {
    grid-column: 1 / -1;
}

.modal-form-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 560px) {
    .modal-form-grid {
        grid-template-columns: 1fr;
    }
}

.modal-body .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-body .form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.modal-body .form-group input,
.modal-body .form-group select,
.modal-body .form-group textarea {
    width: 100%;
    height: 44px;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    color: #1e293b;
    background: #ffffff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.modal-body .form-group textarea {
    height: auto;
    min-height: 80px;
    resize: vertical;
}

.modal-body .form-group input:focus,
.modal-body .form-group select:focus,
.modal-body .form-group textarea:focus {
    outline: none;
    border-color: #23AAC5;
    box-shadow: 0 0 0 4px rgba(35, 170, 197, 0.1);
}

.modal-body .form-group input::placeholder,
.modal-body .form-group textarea::placeholder {
    color: #94a3b8;
}

.optional-label {
    font-weight: 400;
    color: #94a3b8;
    font-size: 12px;
}

/* Checkbox grid for departments */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    padding: 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    max-height: 160px;
    overflow-y: auto;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-item:hover {
    border-color: #23AAC5;
    background: rgba(35, 170, 197, 0.04);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #23AAC5;
    cursor: pointer;
}

.checkbox-item .checkbox-label {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}

/* Button with icon */
.btn-primary svg,
.btn-secondary svg {
    flex-shrink: 0;
}

.section-header .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Modal footer alignment */
.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-footer .btn-primary,
.modal-footer .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ======= Success page after creating password ======= */
.success-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 60px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.success-card {
    background: linear-gradient(135deg, #ecfeff 0%, #f9fafb 100%);
    border-radius: 20px;
    border: 1px solid #bae6fd;
    padding: 24px 24px 20px 24px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px 24px;
    align-items: center;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.success-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #16a34a;
    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.18);
}

.success-card__title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.success-card__subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.success-card__content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.success-card__actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.success-details {
    margin-top: 4px;
}

.success-details__title {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 12px 0;
}

.tabla-passwords--compact thead th {
    padding-top: 10px;
    padding-bottom: 10px;
}

.tabla-passwords--compact tbody td {
    padding-top: 10px;
    padding-bottom: 10px;
}

@media (max-width: 768px) {
    .success-card {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .success-card__actions {
        justify-content: flex-start;
    }
}

/* ======= Compact search filter for lists ======= */
.list-filter {
    position: relative;
    margin-bottom: 10px;
}

.list-filter__icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    z-index: 1;
}

.list-filter__input {
    width: 100%;
    height: 36px;
    padding: 6px 12px 6px 34px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
    color: #1e293b;
    background: #ffffff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.list-filter__input:focus {
    outline: none;
    border-color: #23AAC5;
    box-shadow: 0 0 0 3px rgba(35, 170, 197, 0.1);
}

.list-filter__input::placeholder {
    color: #94a3b8;
}

.list-filter:focus-within .list-filter__icon {
    color: #23AAC5;
}

.assignee-item.filter-hidden {
    display: none !important;
}

.checkbox-item.filter-hidden {
    display: none !important;
}

.filter-no-results {
    padding: 12px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    font-style: italic;
}

/* ======= Bulk Import Styles ======= */
.introducir-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.introducir-header h1 {
    margin: 0;
}

.btn-bulk-import {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #23AAC5 0%, #1a8fa8 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(35, 170, 197, 0.25);
}

.btn-bulk-import:hover {
    background: linear-gradient(135deg, #1a9bb5 0%, #158394 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(35, 170, 197, 0.35);
}

.btn-bulk-import svg {
    flex-shrink: 0;
}

/* Modal Large variant */
.modal-content--large {
    max-width: 1100px;
    width: 95%;
}

/* Bulk Import Info Box */
.bulk-import-info {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #e0f7fa 0%, #e8f5e9 100%);
    border: 1px solid #b2ebf2;
    border-radius: 10px;
    margin-bottom: 16px;
}

.bulk-import-info svg {
    flex-shrink: 0;
    color: #00838f;
}

.bulk-import-info strong {
    display: block;
    color: #00695c;
    margin-bottom: 4px;
}

.bulk-import-info p {
    margin: 0;
    font-size: 13px;
    color: #37474f;
    line-height: 1.5;
}

/* Bulk Import Columns Instructions */
.bulk-import-columns {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.bulk-import-columns strong {
    display: block;
    font-size: 13px;
    color: #334155;
    margin-bottom: 8px;
}

.bulk-import-columns ol {
    margin: 0;
    padding-left: 20px;
    font-size: 12px;
    color: #64748b;
    columns: 2;
    column-gap: 24px;
}

.bulk-import-columns li {
    margin-bottom: 4px;
    break-inside: avoid;
}

.bulk-import-columns li strong {
    display: inline;
    color: #1e293b;
    font-size: 12px;
}

/* Bulk Table Wrapper */
.bulk-table-wrapper {
    max-height: 300px;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

/* Bulk Import Table */
.bulk-import-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.bulk-import-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.bulk-import-table th {
    background: #f1f5f9;
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.bulk-import-table td {
    padding: 4px;
    border-bottom: 1px solid #f1f5f9;
}

.bulk-import-table input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
    color: #1e293b;
    background: #fff;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.bulk-import-table input[type="text"]:focus {
    outline: none;
    border-color: #23AAC5;
    box-shadow: 0 0 0 2px rgba(35, 170, 197, 0.15);
}

.bulk-import-table input[type="text"]::placeholder {
    color: #cbd5e1;
}

.btn-remove-row {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #94a3b8;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.btn-remove-row:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* Bulk Table Actions */
.bulk-table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.bulk-row-count {
    margin-left: auto;
    font-size: 12px;
    color: #64748b;
}

/* Bulk Import Error */
.bulk-import-error {
    color: #dc2626;
    font-size: 13px;
    margin-top: 10px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    display: none;
}

.bulk-import-error:not(:empty) {
    display: block;
}

/* Bulk Access Section */
.bulk-access-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.bulk-access-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin: 0 0 14px 0;
}

.bulk-access-section .assignees-panel {
    margin-bottom: 16px;
}

/* Compact variant for bulk modal */
.assignees-panel--compact {
    padding: 12px;
}

.assignees-panel--compact .assignees-header label {
    font-size: 13px;
}

.assignees-list--compact {
    max-height: 140px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 11px;
}

/* Bulk Import Results */
.bulk-import-results {
    margin-top: 16px;
    padding: 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
}

.bulk-import-results h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #166534;
}

.bulk-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.bulk-stat {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
}

.bulk-stat--success {
    background: #dcfce7;
    color: #166534;
}

.bulk-errors {
    margin-top: 12px;
    padding: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

.bulk-errors h5 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #991b1b;
}

.bulk-errors ul {
    margin: 0;
    padding-left: 20px;
    font-size: 12px;
    color: #7f1d1d;
}

.bulk-errors li {
    margin-bottom: 4px;
}

/* Bulk Notification Toast */
.bulk-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.bulk-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.bulk-notification--success {
    background: #10b981;
    color: #fff;
}

.bulk-notification--error {
    background: #ef4444;
    color: #fff;
}

/* Button small variant */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Spinner for loading state */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .introducir-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .btn-bulk-import {
        justify-content: center;
    }
    
    .bulk-import-columns ol {
        columns: 1;
    }
    
    .modal-content--large {
        width: 98%;
        max-height: 95vh;
    }
    
    .bulk-table-wrapper {
        max-height: 200px;
    }
}
