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

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


.container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 20px;
    margin-right: 650px; 
}


.nav-tabs {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.nav-tabs ul {
    list-style: none;
    display: flex;
}

.nav-tabs li {
    flex: 1;
}

.nav-tabs a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    border-right: 1px solid #eee;
}

.nav-tabs li:last-child a {
    border-right: none;
}

.nav-tabs a:hover {
    background-color: #f8f9fa;
    color: #333;
}

.nav-tabs a.active {
    background-color: #007bff;
    color: white;
}


.form-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 30px;
    max-width: 600px;
}

.form-container h2 {
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.form-group input.error,
.form-group select.error {
    border-color: #dc3545;
}

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}


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

.section-title {
    margin-bottom: 20px;
    color: #495057;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 8px;
}


.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #0056b3;
}

.btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #6c757d;
    margin-left: 10px;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
}


.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 650px;
    height: 100vh;
    background: white;
    border-left: 1px solid #eee;
    padding: 20px;
    overflow-y: auto;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
}

.sidebar h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

.entries-list {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.entry-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.entry-item:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.entry-item.selected {
    background: #e7f3ff;
    border-color: #007bff;
}

.entry-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.entry-details {
    font-size: 14px;
    color: #333;
}

.entry-details strong {
    color: #007bff;
}


.alert {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: none;
}

.alert.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert.show {
    display: block;
}


.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto; 
}

.modal-content {
    background-color: white;
    margin: 20px auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    max-height: calc(100vh - 40px); 
    overflow-y: auto; 
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}


@media (max-width: 1400px) {
    .main-content {
        margin-right: 500px; 
    }
    
    .sidebar {
        width: 500px;
    }
}

@media (max-width: 1200px) {
    .main-content {
        margin-right: 400px; 
    }
    
    .sidebar {
        width: 400px;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .main-content {
        margin-right: 0;
        margin-bottom: 0;
    }
    
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-left: none;
        border-top: 1px solid #eee;
    }
    
    .nav-tabs ul {
        flex-direction: column;
    }
    
    .nav-tabs a {
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    .page-indicator {
        padding: 6px 12px;
        font-size: 12px;
    }
}


.page-b7 {
    border-left: 8px solid #007bff !important; 
    background: linear-gradient(90deg, rgba(0,123,255,0.1) 0%, rgba(0,123,255,0.05) 50%, transparent 100%);
}

.page-b11a {
    border-left: 8px solid #28a745 !important; 
    background: linear-gradient(90deg, rgba(40,167,69,0.1) 0%, rgba(40,167,69,0.05) 50%, transparent 100%);
}

.page-lab {
    border-left: 8px solid #6f42c1 !important; 
    background: linear-gradient(90deg, rgba(111,66,193,0.1) 0%, rgba(111,66,193,0.05) 50%, transparent 100%);
}


.status-pending {
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.status-passed {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.status-failed {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.status-badge {
    float: right;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-pending .status-badge {
    background-color: #ffc107;
    color: #212529;
}

.status-passed .status-badge {
    background-color: #28a745;
    color: white;
}

.status-failed .status-badge {
    background-color: #dc3545;
    color: white;
}


.lab-section {
    margin-bottom: 30px;
}

.lab-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.pending-entries {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    padding: 10px;
}

.pending-entry {
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.pending-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.pending-entry.selected {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.lab-testing-form {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.testing-entry-info {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.testing-entry-info h4 {
    margin: 0 0 10px 0;
    color: #007bff;
}


.status-pending {
    color: #856404;
    font-weight: bold;
}

.status-passed {
    color: #155724;
    font-weight: bold;
}

.status-failed {
    color: #721c24;
    font-weight: bold;
}


.entry-item {
    position: relative;
}

.entry-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background-color: #e1e5e9;
}

.entry-item.page-b7::before {
    background-color: #007bff;
}

.entry-item.page-b11a::before {
    background-color: #28a745;
}

.entry-item.page-lab::before {
    background-color: #6f42c1;
}


.page-indicator {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 2px solid transparent;
}

.page-indicator-b7 {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-color: #0056b3;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.page-indicator-b11a {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
    border-color: #1e7e34;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.page-indicator-lab {
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
    color: white;
    border-color: #5a32a3;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}


.entry-item:hover .page-indicator-b7 {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: scale(1.05);
    transition: all 0.2s ease;
}

.entry-item:hover .page-indicator-b11a {
    background: linear-gradient(135deg, #1e7e34, #155724);
    transform: scale(1.05);
    transition: all 0.2s ease;
}

.entry-item:hover .page-indicator-lab {
    background: linear-gradient(135deg, #5a32a3, #4c2a85);
    transform: scale(1.05);
    transition: all 0.2s ease;
}


.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}


.station-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.station-title {
    margin: 0;
    font-size: 28px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 15px;
}

.back-btn {
    text-decoration: none;
    font-size: 14px;
}

.back-btn:hover {
    text-decoration: none;
}


.page-description {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 25px;
    color: #495057;
    font-size: 14px;
    line-height: 1.5;
}

.sidebar-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.sidebar-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #666;
    margin: 0;
}

.sidebar-controls input[type="checkbox"] {
    margin: 0;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}


.nav-tabs a {
    position: relative;
}

.nav-tabs a.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: #007bff;
    border-radius: 2px 2px 0 0;
}


.status-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.status-indicator.connecting {
    background: #ffc107;
    color: #212529;
}

.status-indicator.error {
    background: #dc3545;
}


.lab-testing-form {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.pending-entry.selected {
    border-color: #007bff !important;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1) !important;
    transform: scale(1.02);
}


.entries-list.loading {
    opacity: 0.6;
    pointer-events: none;
}

.pending-entries.loading {
    opacity: 0.6;
    pointer-events: none;
}


.settings-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.settings-btn:hover {
    background: #545b62;
    transform: scale(1.1);
}

.admin-btn {
    position: fixed;
    top: 20px;
    left: 80px;
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.admin-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}


.settings-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.settings-section h4 {
    margin: 0 0 15px 0;
    color: #007bff;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.setting-item label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.setting-item input {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
}

.setting-item input[type="number"] {
    width: 80px;
}

.setting-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}


.admin-content {
    max-height: 400px;
    overflow-y: auto;
}

.admin-entry-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #dee2e6;
}

.admin-entry-item.page-b7 {
    border-left-color: #007bff;
}

.admin-entry-item.page-b11a {
    border-left-color: #28a745;
}

.admin-entry-item.page-lab {
    border-left-color: #6f42c1;
}

.admin-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.admin-entry-details {
    font-size: 13px;
    color: #555;
}

.admin-entry-details p {
    margin: 3px 0;
}

.password-input {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.password-input input {
    flex: 1;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    font-size: 16px;
}

.password-input input:focus {
    border-color: #007bff;
    outline: none;
}


.btn-small {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 3px;
}

.settings-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.settings-info {
    font-size: 12px;
    color: #666;
    font-style: italic;
}


.modal-content {
    max-width: 600px;
}

.entry-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.detail-section {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    border-left: 4px solid #dee2e6;
}

.detail-section.basic-info {
    border-left-color: #007bff;
}

.detail-section.lab-results {
    border-left-color: #28a745;
}

.detail-section.comments {
    border-left-color: #fd7e14;
    grid-column: 1 / -1; 
}

.detail-section h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.detail-section p {
    margin: 5px 0;
    font-size: 14px;
}

.detail-section .detail-label {
    font-weight: 600;
    color: #555;
    margin-right: 8px;
}

.detail-section .detail-value {
    color: #333;
}

.particle-size-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 10px 0;
}

.particle-size-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px;
    text-align: center;
}

.particle-size-item .size-label {
    font-size: 12px;
    color: #666;
    font-weight: bold;
}

.particle-size-item .size-value {
    font-size: 16px;
    color: #333;
    font-weight: bold;
}

.comments-text {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
    font-style: italic;
    color: #555;
    line-height: 1.5;
    max-height: 100px;
    overflow-y: auto;
}

.no-comments {
    color: #999;
    font-style: italic;
}


body.modal-open {
    overflow: hidden; 
}

.modal-content {
    
    -webkit-overflow-scrolling: touch;
}


.modal.show {
    display: flex !important;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
}

.modal.show .modal-content {
    margin: 0;
    width: 100%;
    max-width: 800px;
}
