/* Admin Panel Styles */
/* Nota: Las variables CSS están definidas en styles.css */

body {
    background: #F5F5F5;
}

/* Logo en navbar del admin - ya está en styles.css global */

/* Navegación del Admin */
#adminPanel .navbar {
    margin-bottom: 0;
}

#adminPanel .nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

#adminPanel .nav-links {
    flex: 1;
    justify-content: center;
}

#adminPanel #logoutBtn {
    margin-left: auto;
    white-space: nowrap;
}

/* Login Section */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.login-container::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.login-box {
    background: var(--white);
    border-radius: 12px;
    padding: 3.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-width: 420px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 1;
    border: 1px solid #E0E0E0;
}

.login-box h1 {
    color: #1a1a1a;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.login-box input {
    width: 100%;
    padding: 1.1rem;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--white);
}

.login-box input:focus {
    outline: none;
    border-color: #1976D2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.login-box button {
    width: 100%;
    padding: 1.1rem;
    background: #1976D2;
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login-box button:hover {
    background: #1565C0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Admin Dashboard */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.dashboard-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #212121;
    margin-bottom: 2rem;
    text-align: left;
}

.admin-header {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid #E0E0E0;
}

.admin-header h1 {
    color: #1a1a1a;
    margin-bottom: 1rem;
}

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

.stat-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    text-align: center;
    border: 1px solid #E0E0E0;
    transition: box-shadow 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    border-radius: 8px;
    background: #F5F5F5;
    color: var(--text-primary);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* Tabs */
.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-button {
    padding: 0.85rem 1.75rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-icon {
    font-size: 1.2rem;
}

.tab-button.active {
    background: #E3F2FD;
    color: #1976D2;
}

.tab-button:hover {
    background: #F5F5F5;
    color: var(--text-primary);
}

.tab-button.active:hover {
    background: #E3F2FD;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Cards */
.admin-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border: 1px solid #E0E0E0;
    transition: box-shadow 0.2s ease;
}

.admin-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.admin-card h2 {
    color: #1a1a1a;
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: #1976D2;
    color: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: none;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    background: #1565C0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: var(--white);
    color: var(--text-primary);
    border: 1px solid #E0E0E0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-secondary:hover {
    background: #F5F5F5;
    border-color: #BDBDBD;
}

.btn-danger {
    background: #F44336;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-danger:hover {
    background: #D32F2F;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-success {
    background: #4CAF50;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-success:hover {
    background: #388E3C;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--white);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1976D2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #BDBDBD;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(128, 222, 234, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.table th {
    background: #F5F5F5;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tr {
    transition: background-color 0.15s ease;
}

.table tr:hover {
    background: #FAFAFA;
}

.table tr:last-child td {
    border-bottom: none;
}

/* Filters */
.filter-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-group select {
    padding: 0.75rem 1rem;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--white);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.filter-group select:hover {
    border-color: #BDBDBD;
}

.filter-group select:focus {
    outline: none;
    border-color: #1976D2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

/* Stock Grid */
.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stock-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #E0E0E0;
    transition: box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stock-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.stock-item h3 {
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.stock-item .stock-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stock-item .stock-actions {
    display: flex;
    gap: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    padding: 0;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-content form {
    padding: 2rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid #E0E0E0;
    background: #FAFAFA;
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close:hover {
    color: #212121;
    background: #F5F5F5;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-container {
        padding: 1rem;
    }

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

    .admin-tabs {
        flex-wrap: wrap;
    }

    .stock-grid {
        grid-template-columns: 1fr;
    }

    .table {
        font-size: 0.9rem;
    }

    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
}
