* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem;
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: white;
    font-size: 3rem;
    margin-bottom: 3rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
}

.card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .card {
        padding: 1.25rem;
        border-radius: 12px;
    }
}

.card h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

@media (max-width: 768px) {
    .card h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
}

.form-group {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .form-group {
        flex-direction: column;
        align-items: stretch;
    }

    .form-group .btn {
        width: 100%;
        margin-top: 0.5rem;
    }
}

.input-wrapper {
    flex: 1;
    min-width: 200px;
}

@media (max-width: 768px) {
    .input-wrapper {
        min-width: 100%;
    }
}

.input-wrapper label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-update {
    background: #f59e0b;
    color: white;
    padding: 0.5rem 1.5rem;
}

.btn-update:hover {
    background: #d97706;
}

.btn-delete {
    background: #ef4444;
    color: white;
    padding: 0.5rem 1.5rem;
}

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

.btn-cancel {
    background: #6b7280;
    color: white;
}

.btn-cancel:hover {
    background: #4b5563;
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s;
}

.product-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.product-info {
    display: grid;
    grid-template-columns: 50px 180px 150px 80px 200px 150px 150px;
    gap: 1rem;
    align-items: center;
    flex: 1;
}

@media (max-width: 1200px) {
    .product-info {
        grid-template-columns: 40px 150px 120px 70px 180px 130px 130px;
        gap: 0.75rem;
    }

    .table-header {
        grid-template-columns: 40px 150px 120px 70px 180px 130px 130px;
        gap: 0.75rem;
    }
}

@media (max-width: 968px) {
    .product-item {
        flex-direction: column;
        align-items: stretch;
    }

    .product-info {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .product-info > span {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem;
        background: white;
        border-radius: 6px;
    }

    .product-info > span::before {
        content: attr(data-label);
        font-weight: 600;
        color: #4b5563;
        margin-right: 1rem;
    }

    .product-index::before { content: 'Index: '; }
    .product-name::before { content: 'Name: '; }
    .product-price::before { content: 'Price: '; }
    .product-quantity::before { content: 'Quantity: '; }
    .product-id::before { content: 'ID: '; }
    .product-date.created::before { content: 'Created: '; }
    .product-date.updated::before { content: 'Updated: '; }

    .product-actions {
        width: 100%;
    }

    .product-actions .btn {
        flex: 1;
    }
}

.product-index {
    font-size: 1rem;
    font-weight: 700;
    color: #667eea;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    word-break: break-word;
}

.product-price {
    font-size: 1.1rem;
    color: #10b981;
    font-weight: 600;
}

.product-quantity {
    font-size: 1rem;
    color: #6b7280;
}

.product-id {
    font-size: 0.75rem;
    color: #9ca3af;
    font-family: monospace;
    word-break: break-all;
}

.product-date {
    font-size: 0.85rem;
    color: #6b7280;
}

.product-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.modal-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s;
}

@media (max-width: 768px) {
    .modal {
        padding: 1.5rem;
        width: 95%;
        max-width: none;
    }
}

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

.modal h3 {
    margin-bottom: 1.5rem;
    color: #1f2937;
    font-size: 1.5rem;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-buttons .btn {
    flex: 1;
}

.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 2000;
    animation: slideInRight 0.3s;
    max-width: 90%;
}

@media (max-width: 768px) {
    .notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: calc(100% - 2rem);
        font-size: 0.9rem;
    }
}

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

.notification.success {
    background: #10b981;
}

.notification.error {
    background: #ef4444;
}

.notification.warning {
    background: #f59e0b;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #9ca3af;
}

.empty-state svg {
    width: 100px;
    height: 100px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.table-header {
    display: grid;
    grid-template-columns: 50px 180px 150px 80px 200px 150px 150px;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #f3f4f6;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #4b5563;
    font-size: 0.9rem;
}

@media (max-width: 968px) {
    .table-header {
        display: none;
    }
}

