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

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

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

header {
    background: linear-gradient(135deg, #1a5276, #2980b9);
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.tabs {
    display: flex;
    background: #fff;
    border-bottom: 2px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: #fff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #f8f9fa;
    color: #2980b9;
}

.tab-btn.active {
    color: #2980b9;
    border-bottom: 3px solid #2980b9;
    background: #fff;
}

.tab-content {
    display: none;
    background: #fff;
    padding: 25px;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease;
}

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

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

.section-header {
    background: #f8f9fa;
    padding: 12px 20px;
    border-left: 4px solid #2980b9;
    margin: 20px 0 15px 0;
    border-radius: 0 5px 5px 0;
}

.section-header h2 {
    color: #1a5276;
    font-size: 1.3rem;
    font-weight: 600;
}

.section-header h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 500;
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(41,128,185,0.1);
}

#itemsContainer {
    margin: 15px 0;
}

.item-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
}

.item-select { flex: 3; min-width: 250px; }
.item-qty { flex: 1; min-width: 100px; }
.item-remark { flex: 2; min-width: 150px; }

.btn-remove {
    padding: 10px 15px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
    height: 42px;
}

.btn-remove:hover {
    background: #c0392b;
}

.btn-add {
    padding: 12px 25px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s;
    margin: 10px 0;
}

.btn-add:hover {
    background: #219a52;
}

.approver-section {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    border: 1px solid #ffc107;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

.btn-submit {
    padding: 12px 40px;
    background: #2980b9;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-submit:hover {
    background: #1a6da0;
}

.btn-reset {
    padding: 12px 40px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-reset:hover {
    background: #7f8c8d;
}

.table-container {
    overflow-x: auto;
    margin-top: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th, td {
    padding: 12px 15px;
    text-align: center;
    border: 1px solid #e0e0e0;
    font-size: 0.95rem;
}

th {
    background: #2c3e50;
    color: white;
    font-weight: 500;
    position: sticky;
    top: 0;
}

tr:nth-child(even) {
    background: #f8f9fa;
}

tr:hover {
    background: #e8f4fc;
}

.status-pending {
    color: #e67e22;
    font-weight: 600;
    padding: 5px 10px;
    background: #fef9e7;
    border-radius: 15px;
    display: inline-block;
}

.status-approved {
    color: #27ae60;
    font-weight: 600;
    padding: 5px 10px;
    background: #eafaf1;
    border-radius: 15px;
    display: inline-block;
}

.status-completed {
    color: #2980b9;
    font-weight: 600;
    padding: 5px 10px;
    background: #ebf5fb;
    border-radius: 15px;
    display: inline-block;
}

.btn-approve {
    padding: 6px 12px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin: 2px;
    transition: background 0.3s;
}

.btn-approve:hover {
    background: #219a52;
}

.btn-complete {
    padding: 6px 12px;
    background: #2980b9;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin: 2px;
    transition: background 0.3s;
}

.btn-complete:hover {
    background: #1a6da0;
}

.btn-delete {
    padding: 6px 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin: 2px;
    transition: background 0.3s;
}

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

.admin-section {
    background: #e8f8f5;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #1abc9c;
    margin-top: 15px;
}

.filter-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.filter-section .form-row {
    align-items: flex-end;
    justify-content: center;
}

.filter-section .form-group {
    min-width: 150px;
    flex: 0 0 auto;
}

#reportTable th {
    background: #1a5276;
}

#reportTable tfoot td {
    background: #2c3e50;
    color: white;
    font-weight: 600;
}

/* Inventory table specific */
#inventoryTable td:nth-child(3),
#inventoryTable td:nth-child(4),
#inventoryTable td:nth-child(5) {
    font-weight: 500;
}

#inventoryTable td:nth-child(3) { color: #27ae60; }
#inventoryTable td:nth-child(4) { color: #e74c3c; }
#inventoryTable td:nth-child(5) { color: #2980b9; }

.btn-receive {
    padding: 6px 12px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.btn-receive:hover {
    background: #219a52;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .item-row {
        flex-direction: column;
    }
    
    .item-select,
    .item-qty,
    .item-remark {
        min-width: 100%;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        border-bottom: none;
        border-right: 3px solid transparent;
    }
    
    .tab-btn.active {
        border-bottom: none;
        border-right: 3px solid #2980b9;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    th, td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
}

/* Print styles */
@media print {
    .tabs,
    .form-actions,
    .btn-remove,
    .btn-add,
    .btn-approve,
    .btn-complete,
    .btn-delete,
    .btn-receive,
    .filter-section,
    .admin-section {
        display: none !important;
    }
    
    .tab-content {
        display: block !important;
        box-shadow: none;
        padding: 0;
    }
    
    header {
        background: #2c3e50;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    th {
        background: #2c3e50 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}
