/* ============================================
   PANEL DE ADMINISTRACIÓN - FLUXION SERVICES
   ============================================ */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #0f172a;
    --dark-secondary: #1e293b;
    --sidebar-width: 260px;
    --topbar-height: 70px;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background: var(--bg-light);
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.admin-body {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark-bg);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-sizing: border-box;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--dark-secondary);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-header .logo i {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--dark-secondary);
    color: white;
    border-left-color: var(--primary-color);
}

.nav-item.active {
    background: var(--dark-secondary);
    color: white;
    border-left-color: var(--primary-color);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

/* Submenú para SMTP */
.nav-item-with-submenu {
    position: relative;
}

.nav-item-with-submenu > .nav-item {
    justify-content: space-between;
}

.submenu-toggle {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.nav-item-with-submenu.active > .nav-item .submenu-toggle {
    transform: rotate(180deg);
}

.nav-submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

.nav-item-with-submenu.active > .nav-submenu {
    max-height: 500px;
}

.nav-subitem {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem 0.75rem 3.5rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
}

.nav-subitem:hover {
    background: var(--dark-secondary);
    color: white;
    border-left-color: var(--primary-light);
}

.nav-subitem.active {
    background: var(--dark-secondary);
    color: white;
    border-left-color: var(--primary-light);
}

.nav-subitem i {
    width: 16px;
    text-align: center;
    font-size: 0.875rem;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100vw - var(--sidebar-width));
    overflow-x: hidden;
}

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.user-info:hover {
    background: var(--bg-light);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.3s ease;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown-item:hover {
    background: var(--bg-light);
}

.dropdown-item i {
    width: 20px;
    color: var(--text-secondary);
}

/* ============================================
   CONTENT AREA
   ============================================ */
.content-area {
    padding: 2rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard {
    width: 100%;
    max-width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat-link {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.stat-link:hover {
    color: var(--primary-color);
}

.dashboard-section {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.section-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header h2 i {
    color: var(--primary-color);
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.data-table th,
.data-table td {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.data-table thead {
    background: var(--bg-light);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background: var(--bg-light);
}

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

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.badge-secondary {
    background: var(--text-secondary);
    color: white;
}

/* ============================================
   CHECKBOXES
   ============================================ */
.checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0;
}

.checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.checkbox span {
    user-select: none;
    color: var(--text-primary);
}

/* ============================================
   FORMS
   ============================================ */
.form-container {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    max-width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    animation: slideInDown 0.3s ease;
    box-shadow: var(--shadow-md);
}

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

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.card-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 968px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100vw;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .form-container {
        padding: 1.5rem;
    }
    
    .topbar {
        padding: 0 1rem;
    }
    
    .data-table {
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.modal-content {
    background-color: var(--bg-white);
    margin: auto;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: min(600px, 90vw);
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    animation: slideDown 0.3s ease;
    position: relative;
    box-sizing: border-box;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-header .close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.modal-header .close:hover,
.modal-header .close:focus {
    transform: rotate(90deg);
    background: rgba(255, 255, 255, 0.3);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
    border-radius: 0 0 16px 16px;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: 95vw;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem 1.5rem;
    }
    
    .page-header h2 {
        font-size: 1.5rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   ESTILOS PARA PROYECTOS Y CREDENCIALES
   ============================================ */

.project-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-item label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.info-item span {
    color: var(--text-primary);
    font-size: 1rem;
}

.info-item-full {
    margin-top: 1rem;
}

.info-item-full label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.5rem;
}

.info-item-full p {
    color: var(--text-primary);
    line-height: 1.6;
}

/* ========== Credenciales: sección y cabecera ========== */
.credentials-card .credentials-section-header,
.assignments-card .credentials-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(236, 72, 153, 0.04) 100%);
}

.credentials-section-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.credentials-section-header h3 i {
    color: var(--primary-color);
}

.btn-add-credential {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-add-credential:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.credentials-body {
    padding: 1.25rem 1.5rem;
}

.credentials-empty {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--text-secondary);
}

.credentials-empty i {
    font-size: 2.5rem;
    color: var(--border-color);
    margin-bottom: 0.75rem;
    display: block;
}

.credentials-empty p {
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

/* ========== Carrusel de credenciales ========== */
.credentials-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 0 -0.5rem;
}

.credentials-carousel-no-nav .credentials-carousel {
    max-width: 100%;
}

.credentials-carousel {
    flex: 1;
    overflow: hidden;
    min-height: 1px;
}

.credentials-track {
    display: flex;
    gap: 1rem;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.credential-card {
    flex: 0 0 calc((100% - 2rem) / 3);
    min-width: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.credential-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
}

.credential-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.credential-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.credential-card-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.credential-card-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
    font-size: 0.8125rem;
}

.btn-icon:hover {
    transform: scale(1.08);
}

.btn-icon-edit {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-color);
}

.btn-icon-edit:hover {
    background: rgba(99, 102, 241, 0.22);
    color: var(--primary-dark);
}

.btn-icon-delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.btn-icon-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

.credential-card-body {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.credential-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.credential-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}

.credential-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    word-break: break-all;
}

.credential-link {
    color: var(--primary-color);
    text-decoration: none;
}

.credential-link:hover {
    text-decoration: underline;
}

.credential-notes {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.credential-row-password .password-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.credential-row-password .password-input {
    flex: 1;
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    background: var(--bg-light);
    color: var(--text-primary);
    outline: none;
}

.credential-row-password .btn-toggle-password {
    position: absolute;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.credential-row-password .btn-toggle-password:hover {
    background: var(--border-color);
    color: var(--primary-color);
}

/* Botones de navegación del carrusel */
.credentials-nav {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.credentials-nav:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.credentials-nav:disabled,
.credentials-nav[aria-disabled="true"] {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.credentials-nav:disabled:hover,
.credentials-nav[aria-disabled="true"]:hover {
    background: var(--bg-white);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.credentials-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.credentials-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.credentials-dot:hover {
    background: var(--text-light);
}

.credentials-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

/* Campo de contraseña (compartido con formularios) */
.password-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.password-input {
    flex: 1;
    padding: 0.625rem 2.5rem 0.625rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: var(--bg-light);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease;
}

.password-input:focus {
    border-color: var(--primary-color);
}

.btn-toggle-password {
    position: absolute;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 1;
}

.btn-toggle-password:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.btn-toggle-password:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn-toggle-password i {
    font-size: 1rem;
}

/* Radio group para asignaciones */
.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.radio input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio span {
    color: var(--text-primary);
    font-size: 0.9375rem;
}

/* Categorías */
.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.category-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.categories-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* Asignaciones: mismo estilo de sección que credenciales */
.assignments-section-header h3 i {
    color: var(--primary-color);
}

.assignment-card .credential-card-icon.assignment-card-icon {
    background: linear-gradient(135deg, var(--success-color), #34d399);
}

.assignment-info {
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.assignment-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ============================================
   TABS
   ============================================ */
.tabs-container {
    width: 100%;
    margin-top: 1rem;
}

.tabs-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    background: var(--bg-white);
    border-radius: 8px 8px 0 0;
    padding: 0.5rem 0.5rem 0 0.5rem;
}

.tab-button {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: -2px;
    position: relative;
    white-space: nowrap;
}

.tab-button:hover {
    color: var(--primary-color);
    background: var(--bg-light);
    border-radius: 8px 8px 0 0;
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: transparent;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
}

.tab-button i {
    font-size: 0.875rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
    padding-top: 1rem;
}

/* Mostrar el tab que tiene la clase active desde PHP */
.tab-content.active {
    display: block !important;
}

/* Asegurar que el contenido se muestre si tiene active desde el servidor */
.tabs-container .tab-content.active {
    display: block !important;
    visibility: visible !important;
}

/* Estilos para card-body si no existe */
.card-body {
    padding: 1.5rem;
}

/* Responsive: credenciales carrusel */
@media (max-width: 1024px) {
    .credential-card {
        flex: 0 0 calc((100% - 1rem) / 2);
    }
}

@media (max-width: 640px) {
    .credentials-carousel-wrapper {
        margin: 0;
    }
    
    .credentials-nav {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
    
    .credential-card {
        flex: 0 0 100%;
    }
    
    .credentials-section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-add-credential {
        justify-content: center;
    }
}

/* Responsive para proyectos */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .categories-checkboxes {
        grid-template-columns: 1fr;
    }
}

