@import url('variables.css');

:root {
    --sidebar-width: 260px;
    --header-height: 60px;
    --primary: var(--color-principal);
    /* Green Match */
    --dark-bg: #1a1a1a;
    --light-bg: #f5f7fa;
    --text-main: #1a1a1a;
    --text-light: #666;
    --border: #e1e4e8;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.admin-body {
    font-family: var(--font-body);
    background-color: var(--light-bg);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
}

.admin-logo {
    height: 32px;
    margin-right: 10px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item i {
    width: 24px;
    margin-right: 10px;
}

.nav-item:hover {
    background-color: #f0f2f5;
    color: var(--primary);
}

.nav-item.active {
    background-color: #eef2ff;
    color: var(--primary);
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
}

.logout-btn {
    width: 100%;
    padding: 10px;
    border: 1px solid #ff4d4f;
    background: none;
    color: #ff4d4f;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.logout-btn:hover {
    background: #fff1f0;
}

/* Main Content */
.admin-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    overflow-y: auto;
}

.admin-mobile-header {
    display: none;
}

/* Vistas */
.admin-view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.admin-view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-right: 20px;
    opacity: 0.8;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 5px;
}

/* Tablas */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-top: 20px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    font-weight: 600;
    color: var(--text-light);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-published {
    background: #e6f7ff;
    color: #1890ff;
}

.status-draft {
    background: #fff7e6;
    color: #fa8c16;
}

.action-btn {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-light);
    margin: 0 5px;
    font-size: 1.1rem;
    transition: 0.2s;
}

.action-btn:hover {
    color: var(--primary);
}

.action-btn.delete:hover {
    color: #ff4d4f;
}

/* Editor Form */
.editor-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
    max-width: 800px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #405ce0;
}

.btn-secondary {
    background: #eee;
    color: #333;
    margin-right: 10px;
}

.btn-secondary:hover {
    background: #ddd;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .admin-content {
        margin-left: 0;
    }

    .admin-mobile-header {
        display: flex;
        align-items: center;
        background: white;
        padding: 15px;
        margin: -30px -30px 30px -30px;
        border-bottom: 1px solid var(--border);
    }

    #sidebar-toggle {
        background: none;
        border: none;
        font-size: 1.5rem;
        margin-right: 15px;
    }
}