/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    padding: 20px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    padding: 30px;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.client-info {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    font-size: 14px;
    opacity: 0.95;
}

.client-info span {
    font-weight: bold;
}

/* Order Table */
.order-table {
    width: 100%;
    border-collapse: collapse;
}

.order-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.order-table th {
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: #666;
    border-bottom: 2px solid #dee2e6;
}

.order-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.product-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.product-desc {
    font-size: 12px;
    color: #666;
    margin-top: 3px;
}

.price {
    font-weight: 500;
    text-align: right;
    white-space: nowrap;
}

.quantity-input {
    width: 80px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

.quantity-input:focus {
    outline: none;
    border-color: #8B4513;
}

.line-total {
    text-align: right;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.category-row {
    background: #fafafa;
    font-weight: 600;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
}

.category-row td {
    padding: 8px 10px;
}

/* Total Section */
.total-section {
    background: #f8f9fa;
    padding: 20px 30px;
    border-top: 2px solid #dee2e6;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.total-label {
    font-size: 14px;
    color: #666;
}

.total-value {
    font-size: 14px;
    font-weight: 500;
}

.grand-total {
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
    margin-top: 10px;
}

.grand-total .total-label {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.grand-total .total-value {
    font-size: 24px;
    font-weight: 700;
    color: #8B4513;
}

/* Actions */
.actions {
    padding: 30px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

button {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #8B4513;
    color: white;
}

.btn-primary:hover {
    background: #A0522D;
}

.btn-secondary {
    background: white;
    color: #666;
    border: 2px solid #ddd;
}

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

/* Notes Section */
.notes-section {
    padding: 0 30px 20px;
}

.notes-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.notes-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

.notes-input:focus {
    outline: none;
    border-color: #8B4513;
}

/* Minimum Notice */
.minimum-notice {
    background: #fff9c4;
    padding: 10px 15px;
    border-left: 3px solid #f9a825;
    margin: 20px 30px;
    font-size: 13px;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }
    
    body {
        padding: 0;
    }
    
    /* Convert table to vertical card layout on mobile */
    .order-table thead {
        display: none;
    }
    
    .order-table tbody {
        display: block;
    }
    
    .order-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 15px;
        background: white;
    }
    
    .order-table td {
        display: block;
        padding: 8px 0;
        border: none;
        text-align: left !important;
    }
    
    .order-table td:before {
        content: attr(data-label);
        font-weight: 600;
        display: inline-block;
        width: 120px;
        color: #666;
        font-size: 12px;
    }
    
    .category-row {
        background: #f8f9fa;
        margin-bottom: 10px;
        text-align: center;
        padding: 10px !important;
    }
    
    .category-row td:before {
        content: none;
    }
    
    .product-name {
        font-size: 16px;
        margin-bottom: 5px;
    }
    
    .product-desc {
        display: block;
        font-size: 12px;
        color: #666;
        margin-bottom: 10px;
    }
    
    .quantity-input {
        width: 100%;
        max-width: 150px;
        padding: 10px;
        font-size: 16px;
    }
    
    .price,
    .line-total {
        text-align: left !important;
        font-size: 14px;
    }
    
    .client-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 22px;
    }
    
    .minimum-notice {
        margin: 15px;
        font-size: 12px;
    }
    
    .notes-section {
        padding: 0 15px 20px;
    }
    
    .total-section {
        padding: 15px;
    }
    
    .actions {
        flex-direction: column;
        padding: 15px;
    }
    
    button {
        width: 100%;
        padding: 15px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 18px;
    }
    
    .order-table td:before {
        display: block;
        margin-bottom: 5px;
    }
    
    .grand-total .total-label {
        font-size: 16px;
    }
    
    .grand-total .total-value {
        font-size: 20px;
    }
}