.admin-container {
    padding: 0.15rem;
    margin: -1.1rem;
    height: calc(100% + 2.2rem);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: white;
    overflow-x: hidden;
}

.admin-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 0.25rem;
    margin-bottom: 0;
}

.admin-header h2 {
    font-size: 1.1rem;
    color: var(--gray-900);
    margin: 0;
}

.admin-tabs {
    display: flex;
    gap: 0.2rem;
    background: var(--gray-100);
    padding: 0.15rem;
    border-radius: 6px;
    width: 100%;
}

.admin-tab-btn {
    flex: 1;
    padding: 0.25rem 0.2rem;
    font-size: 0.7rem;
    gap: 0.25rem;
    border-radius: 4px;
}

.admin-content {
    flex: 1;
    overflow-y: auto;
    padding-top: 0.25rem;
}

.dashboard-section {
    margin-bottom: 0.5rem;
}

.dashboard-section h3 {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.admin-table th,
.admin-table td {
    padding: 0.3rem 0.25rem;
    font-size: 0.75rem;
}

.kpi-label {
    font-size: 0.65rem;
}

.kpi-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-100);
    scrollbar-width: thin;
}

.admin-table {
    width: 100%;
    min-width: 350px;
    /* Forzar scroll si es menor */
    border-collapse: collapse;
}

.admin-table th {
    padding: 0.4rem 0.3rem;
    font-size: 0.7rem;
    white-space: nowrap;
    background: var(--gray-50);
    text-transform: uppercase;
    color: var(--gray-500);
}

.admin-table td {
    padding: 0.35rem 0.3rem;
    font-size: 0.75rem;
    vertical-align: middle;
}

/* Ocultar columnas menos importantes en el sidebar */
.col-id,
.col-slug {
    display: none;
}

.progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 4px;
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-free {
    background: #e2e8f0;
    color: #475569;
}

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

.badge-enterprise {
    background: #1e293b;
    color: white;
}

.chart-mock {
    background: var(--gray-50);
    padding: 2rem;
    border-radius: var(--radius-xl);
    border: 1px dashed var(--gray-300);
    height: 250px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    height: 100%;
    width: 100%;
}

.chart-bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.chart-bar {
    width: 100%;
    background: linear-gradient(to top, var(--color-primary-dark), var(--color-primary));
    border-radius: 4px 4px 0 0;
    min-height: 4px;
}

.chart-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-500);
}

/* Dashboard Layout Helpers */
.dashboard-grid {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.dashboard-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.dashboard-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.kpi-card {
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    text-align: center;
    background: white;
}

.kpi-card-primary {
    border-color: var(--color-primary-soft);
    background: var(--color-primary-soft);
}

.kpi-card-full {
    grid-column: span 2;
    text-align: left;
    background: #fcfcfc;
}

.kpi-label-mini {
    color: var(--gray-500);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}

.kpi-card-full .kpi-label-mini {
    justify-content: flex-start;
}

.section-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.section-header-compact h3 {
    margin: 0;
    font-size: 0.85rem;
}

.progress-bar-mini {
    height: 6px;
    background: var(--gray-100);
    border-radius: 3px;
    overflow: hidden;
}

.chart-mock-compact {
    padding: 1rem;
    height: 180px;
}

.chart-bars-compact {
    gap: 0.4rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--gray-50);
}

/* ========== Rediseño de Modales Admin ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    transition: var(--transition);
}

.modal-form {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
}

.form-group input,
.form-group select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.85rem;
    transition: var(--transition);
    background: var(--gray-50);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    background: white;
    box-shadow: 0 0 0 4px var(--color-primary-soft);
}

.form-group small {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.modal-footer {
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}