/* Panel de Administración - GRUPO GDF SAC */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #29CFF1;
    --primary-dark: #1ea8c4;
    --secondary-color: #FF6B35;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --border-color: #dee2e6;
    --text-color: #333;
    --text-muted: #6c757d;
    --sidebar-width: 260px;
    --header-height: 70px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: var(--text-color);
    line-height: 1.6;
}

/* Login Container */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    color: var(--dark-color);
    margin-bottom: 30px;
    text-align: center;
    font-size: 1.8em;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(41, 207, 241, 0.1);
}

.form-group input[type="color"] {
    height: 50px;
    cursor: pointer;
}

.form-group input[type="number"] {
    width: 100%;
}

.error-message {
    background: #fee;
    color: var(--danger-color);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--danger-color);
}

.success-message {
    background: #d4edda;
    color: var(--success-color);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--success-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(41, 207, 241, 0.3);
}

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

.btn-secondary:hover {
    background: #e55a2b;
}

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

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

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

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

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9em;
}

/* Admin Container */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark-color);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 1.5em;
    margin-bottom: 5px;
    color: var(--primary-color);
    font-weight: 700;
}

.sidebar-header p {
    font-size: 0.85em;
    color: rgba(255,255,255,0.7);
    margin-bottom: 15px;
}

.logout-btn {
    color: white;
    text-decoration: none;
    font-size: 0.9em;
    padding: 8px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    display: inline-block;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.2);
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item span {
    font-size: 1.3em;
    margin-right: 12px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--primary-color);
}

.nav-item.active {
    background: rgba(41, 207, 241, 0.2);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

/* Main Content */
.admin-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 30px;
    max-width: calc(100vw - var(--sidebar-width));
}

.content-header {
    background: white;
    padding: 25px 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.content-header h1 {
    font-size: 2em;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.content-header p {
    color: var(--text-muted);
    font-size: 1em;
    margin: 0;
}

.content-header > div:first-child {
    flex: 1;
}

.content-section {
    display: none;
}

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

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.stat-card h3 {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card p {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--primary-color);
}

/* Cards */
.card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.card h3 {
    color: var(--dark-color);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-color);
    font-size: 1.3em;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-color);
}

.card-header h2 {
    font-size: 1.5em;
    color: var(--dark-color);
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    color: var(--dark-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-color);
    font-size: 1.2em;
    font-weight: 600;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--light-color);
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    color: var(--dark-color);
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 1px;
}

tbody tr:hover {
    background: #f8f9fa;
}

/* Items List */
.items-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.item-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.item-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.item-card-body {
    padding: 20px;
}

.item-card-title {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.item-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* 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: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-color);
}

.modal-header h2 {
    color: var(--dark-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--danger-color);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .admin-content {
        margin-left: 0;
        max-width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .items-list {
        grid-template-columns: 1fr;
    }
}

/* Brand Item */
.brand-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.brand-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 5px;
}

.brand-item-info {
    flex: 1;
}

.brand-item-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.brand-item-actions {
    display: flex;
    gap: 10px;
}

/* Project Item */
.project-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.project-item-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.project-item-info {
    flex: 1;
}

.project-item-title {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 10px;
}

.project-item-description {
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Category Item */
.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.category-item-info {
    flex: 1;
}

.category-item-name {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.category-item-slug {
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Message Styles */
.success-message,
.error-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
    z-index: 1000;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

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

