* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-box h1 {
    color: #8B4513;
    margin-bottom: 10px;
}

.login-box h2 {
    color: #666;
    margin-bottom: 30px;
}

.login-box input {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

/* Header */
.header {
    background: #8B4513;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header h1 {
    font-size: 1.8rem;
    margin: 0;
}

.header-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    font-weight: bold;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #bd2130;
}

.btn-edit {
    background: #ffc107;
    color: #212529;
    padding: 5px 10px;
}

.btn-edit:hover {
    background: #e0a800;
}

.btn-delete {
    background: #dc3545;
    color: white;
    padding: 5px 10px;
}

.btn-delete:hover {
    background: #bd2130;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 5px 10px;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-save {
    background: #28a745;
    color: white;
    padding: 5px 10px;
}

.btn-cancel {
    background: #6c757d;
    color: white;
    padding: 5px 10px;
}

/* Alerts */
.alert {
    padding: 15px;
    margin: 20px;
    border-radius: 5px;
    font-weight: bold;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card h3 {
    color: #8B4513;
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

/* Add Product Form */
.add-product {
    background: #f8f9fa;
    padding: 30px;
    border-bottom: 1px solid #dee2e6;
}

.add-product h2 {
    margin-bottom: 20px;
    color: #333;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 2fr 2fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.form-add select,
.form-add input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

/* Products List */
.products-list {
    padding: 20px;
}

.category {
    margin-bottom: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.category-title {
    background: #8B4513;
    color: white;
    padding: 15px 20px;
    font-size: 1.3rem;
    border-radius: 8px 8px 0 0;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-count {
    font-size: 0.9rem;
    opacity: 0.8;
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.product-item:last-child {
    border-bottom: none;
}

.product-item:hover {
    background: #f8f9fa;
}

.product-info {
    flex: 1;
}

.product-info h3 {
    color: #333;
    margin-bottom: 5px;
}

.description {
    color: #666;
    font-style: italic;
    font-size: 0.9rem;
}

.date {
    color: #999;
    font-size: 0.8rem;
}

.product-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.form-inline {
    display: flex;
    align-items: center;
    gap: 5px;
}

.price-input {
    width: 100px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
}

.price-display {
    font-weight: bold;
    font-size: 1.1rem;
    color: #8B4513;
    min-width: 80px;
    text-align: center;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #8B4513;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.modal-content textarea {
    resize: vertical;
    height: 80px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* PDF Styles */
.pdf-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #8B4513;
    padding-bottom: 20px;
}

.pdf-header h1 {
    font-size: 36px;
    margin-bottom: 10px;
    color: #8B4513;
}

.pdf-header h2 {
    font-size: 24px;
    font-style: italic;
    color: #666;
}

.pdf-category {
    margin-bottom: 25px;
    page-break-inside: avoid;
}

.pdf-category h3 {
    background: #8B4513;
    color: white;
    padding: 12px;
    text-align: center;
    margin-bottom: 15px;
    font-size: 18px;
    border-radius: 5px;
}

.pdf-product {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 5px;
    border-bottom: 1px solid #eee;
}

.pdf-product:last-child {
    border-bottom: none;
}

.pdf-product-info {
    flex: 1;
    margin-right: 20px;
}

.pdf-price {
    font-weight: bold;
    font-size: 16px;
    color: #8B4513;
    min-width: 80px;
    text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .product-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .product-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
}

/* Print styles */
@media print {
    body { margin: 0; }
    .pdf-category { page-break-inside: avoid; }
}