/**
 * Mini Market POS - Stiluri Admin
 */

/* Layout principal admin */
.admin-interface {
    display: flex;
    min-height: 100vh;
    background: #f5f6fa;
}

/* Navigație admin */
.admin-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.nav-brand {
    font-size: 1.3rem;
    font-weight: 600;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-user span {
    opacity: 0.9;
}

/* Container admin */
.admin-container {
    display: flex;
    width: 100%;
    padding-top: 60px;
}

/* Sidebar admin */
.admin-sidebar {
    width: 240px;
    background: white;
    min-height: calc(100vh - 60px);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    overflow-y: auto;
}

.sidebar-menu {
    list-style: none;
    padding: 15px 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 2px 10px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-color);
    border-radius: 8px;
    transition: all 0.2s;
    text-decoration: none;
}

.sidebar-menu a:hover {
    background: #f0f2f5;
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sidebar-menu a.back-link {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Conținut admin */
.admin-content {
    flex: 1;
    margin-left: 240px;
    padding: 25px;
    min-height: calc(100vh - 60px);
}

/* Secțiuni admin */
.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.admin-section h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.5rem;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

/* Dashboard cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

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

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.card h3 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.card-icon {
    float: right;
    font-size: 2.5rem;
    opacity: 0.2;
}

/* Formulare admin */
.admin-form {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    max-width: 600px;
}

/* Tabele admin */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.admin-table th,
.admin-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tbody tr {
    transition: background 0.2s;
}

.admin-table tbody tr:hover {
    background: #f8f9fa;
}

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

/* Acțiuni tabel */
.table-actions {
    display: flex;
    gap: 8px;
}

.btn-action-table {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-edit {
    background: #e3f2fd;
    color: #1976d2;
}

.btn-edit:hover {
    background: #bbdefb;
}

.btn-delete {
    background: #ffebee;
    color: #c62828;
}

.btn-delete:hover {
    background: #ffcdd2;
}

/* Categorii admin list */
.categories-admin-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.category-admin-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.2s;
}

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

.category-admin-icon {
    font-size: 2.5rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: white;
}

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

.category-admin-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.category-admin-count {
    font-size: 0.85rem;
    color: #7f8c8d;
}

/* Filtre rapoarte */
.report-filters {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.report-filters .form-group {
    margin-bottom: 0;
    min-width: 150px;
}

.report-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Rezultate raport */
.report-results {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.report-results table {
    margin-top: 15px;
}

/* Statistici gestiune */
.gestiune-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.stat-card h4 {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.stat-card p {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card p.text-success {
    color: var(--success-color);
}

.stat-card p.text-warning {
    color: var(--warning-color);
}

/* Date filter */
.date-filter {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.date-filter .form-group {
    margin-bottom: 0;
}

/* Responsive admin */
@media (max-width: 992px) {
    .admin-sidebar {
        width: 200px;
    }
    
    .admin-content {
        margin-left: 200px;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        display: none;
    }
    
    .admin-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Checkbox și radio personalizate */
input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-right: 8px;
}

.form-group label:has(input[type="checkbox"]),
.form-group label:has(input[type="radio"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Color picker */
input[type="color"] {
    width: 60px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
}

/* Textarea resize */
textarea {
    resize: vertical;
    min-height: 100px;
}

/* Loading spinner */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
    min-width: 280px;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--danger-color);
}

.toast-warning {
    border-left: 4px solid var(--warning-color);
}

/* Grid helper pentru tabel */
.grid-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Badge pentru stoc */
.stock-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.stock-badge.in-stock {
    background: #d4edda;
    color: #155724;
}

.stock-badge.low-stock {
    background: #fff3cd;
    color: #856404;
}

.stock-badge.out-of-stock {
    background: #f8d7da;
    color: #721c24;
}
