/* main.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}
.header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 20px;
    text-align: center;
}
.tabs {
    display: flex;
    background: #ecf0f1;
    border-bottom: 1px solid #dcdfe6;
}
.tab {
    padding: 15px 20px;
    cursor: pointer;
    text-align: center;
    flex: 1;
    transition: background 0.3s;
}
.tab:hover {
    background: #d5dbdb;
}
.tab.active {
    background: #3498db;
    color: white;
}
.tab-content {
    display: none;
    padding: 20px;
}
.tab-content.active {
    display: block;
}
.card {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.form-group {
    margin-bottom: 15px;
}
label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #34495e;
}
.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}
.btn-primary {
    background: #3498db;
    color: white;
}
.btn-primary:hover {
    background: #2980b9;
}
.btn-success {
    background: #2ecc71;
    color: white;
}
.btn-success:hover {
    background: #27ae60;
}
.btn-danger {
    background: #e74c3c;
    color: white;
}
.btn-danger:hover {
    background: #c0392b;
}
.btn-secondary {
    background: #95a5a6;
    color: white;
}
.btn-secondary:hover {
    background: #7f8c8d;
}
.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.table th, .table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}
.table th {
    background: #ecf0f1;
    font-weight: bold;
}
.compact-table th, .compact-table td {
    padding: 8px;
}
.status-badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}
.status-pending {
    background: #f39c12;
    color: white;
}
.status-completed {
    background: #2ecc71;
    color: white;
}
.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.hidden {
    display: none;
}
.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    padding: 15px 20px;
    background: #3498db;
    color: white;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    margin: 0;
    color: white;
}
.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}
.modal-body {
    padding: 20px;
}
.qc-results-list {
    list-style-type: none;
    padding-left: 0;
}
.qc-results-list li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}
.alert {
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}
.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.hidden {
    display: none !important;
}
.container-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}
.container-item {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    background: #f8f9fa;
    transition: background 0.2s;
}
.container-item:hover {
    background: #e9ecef;
}
.container-item.selected {
    background: #3498db;
    color: white;
    border-color: #3498db;
}
.summary-balances-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.summary-balances-column h5 {
    margin-bottom: 10px;
    color: #2c3e50;
}
.summary-balances-column ul {
    list-style: none;
    padding-left: 0;
}
.summary-balances-column li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}
.batch-distribution {
    margin-top: 10px;
}
.batch-item {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    background: #f9f9f9;
}
.batch-item input {
    width: 100px;
    margin-left: 10px;
    padding: 5px;
}
.hardness-input {
    width: 80px;
    padding: 5px;
    margin: 2px 5px 2px 0;
}