:root {
    --primary-color: #2c7be5;
    --secondary-color: #6c757d;
    --success-color: #00d97e;
    --danger-color: #e63757;
    --warning-color: #f6c343;
    --info-color: #39afd1;
    --light-color: #f8f9fa;
    --dark-color: #12263f;
    --border-color: #e3ebf6;
}

/* Base styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f7fa;
    color: var(--dark-color);
}

/* Typography */
h1, h2 {
    color: var(--primary-color);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.dashboard-container {
    overflow: hidden;
    position: relative;
}

/* Navbar */
.navbar {
    background-color: white;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.25rem;
}

.navbar-brand img {
    height: 40px;
    margin-right: 10px;
}

.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-left: 1.5rem;
}

.nav-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link i {
    margin-right: 0.5rem;
}

.user-dropdown {
    position: relative;
}

.user-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    border-radius: 0.375rem;
    padding: 0.5rem 0;
    z-index: 1000;
}

.user-dropdown:hover .user-menu {
    display: block;
}

.user-menu-item {
    padding: 0.5rem 1rem;
    display: block;
    color: var(--dark-color);
    text-decoration: none;
    transition: background-color 0.2s;
}

.user-menu-item:hover {
    background-color: var(--light-color);
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 1.5rem;
}

.stat-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

.stat-change.up {
    color: var(--success-color);
}

.stat-change.down {
    color: var(--danger-color);
}

/* Card */
.card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.125);
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #2c3e50;
}

.card-body {
    padding: 1.5rem;
}

/* Form styles */
.form-section {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--dark-color);
    background-color: white;
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(44, 123, 229, 0.25);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.col {
    flex: 1 0 0%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.sample-type {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.form-check {
    display: flex;
    align-items: center;
}

.form-check-input {
    margin-right: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    border-radius: 0.375rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, 
                border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
}

.btn i {
    margin-right: 0.5rem;
}

.btn-primary {
    color: white;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #1a68d1;
    border-color: #1a68d1;
}

.btn-success {
    color: white;
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    background-color: #00c571;
    border-color: #00c571;
}

.btn-danger {
    color: white;
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

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

.btn-secondary {
    color: white;
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #5a6268;
}

.btn-light {
    color: var(--dark-color);
    background-color: var(--light-color);
    border-color: var(--light-color);
}

.btn-light:hover {
    background-color: #e2e6ea;
    border-color: #e2e6ea;
}

.btn-info {
    color: white;
    background-color: var(--info-color);
    border-color: var(--info-color);
}

.btn-info:hover {
    background-color: #2fa0c6;
    border-color: #2fa0c6;
}

.btn-sm {
    margin: 2px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.25rem;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid #dee2e6;
}

thead th {
    vertical-align: bottom;
    border-bottom: 2px solid var(--border-color);
    background-color: #f9fbfd;
    font-weight: 600;
}

tbody tr:hover {
    background-color: rgba(44, 123, 229, 0.05);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0.01%;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
}

.badge-primary {
    color: white;
    background-color: var(--primary-color);
}

.badge-success {
    color: white;
    background-color: var(--success-color);
}

.badge-warning {
    color: var(--dark-color);
    background-color: var(--warning-color);
}

.badge-danger {
    color: white;
    background-color: var(--danger-color);
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f7fa;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.login-header {
    padding: 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
}

.login-logo {
    height: 60px;
    margin-bottom: 1rem;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.login-body {
    padding: 1.5rem;
}

/* Report List */
.search-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
}

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

.modal-dialog {
    max-width: 800px;
    margin: 1.75rem auto;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
    flex: 1 1 auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.close {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    opacity: 0.5;
    background: none;
    border: none;
    cursor: pointer;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--secondary-color);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

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

/* Export buttons */
.export-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.export-filter-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
        
.export-filter-label {
    font-weight: bold;
    margin-right: 5px;
    white-space: nowrap;
}
        
.export-filter-select {
    width: 150px;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
}
        
.export-buttons-container {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

#exportRegisterPdfBtn {
    background-color: #ffcc00 !important; /* kuning cerah */
    border-color: #e6b800 !important;
    color: #000 !important;
    font-weight: bold;
    box-shadow: 0 0 8px rgba(255, 204, 0, 0.7); /* efek glow */
    transition: all 0.3s ease-in-out;
}

#exportRegisterPdfBtn:hover {
    background-color: #e6b800 !important; /* lebih gelap saat hover */
    border-color: #cc9900 !important;
    color: #fff !important;
    box-shadow: 0 0 12px rgba(255, 204, 0, 1); /* glow makin terang saat hover */
    transform: scale(1.05); /* sedikit membesar */
}

/* Parameter Table Styles */
.parameter-table {
    width: 100%;
    margin-top: 1rem;
}

.parameter-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.parameter-table td {
    vertical-align: top;
    padding: 0.75rem;
}

.parameter-table strong {
    display: block;
    margin-bottom: 0.25rem;
}

.parameter-actions {
    display: flex;
    gap: 0.5rem;
}

/* User Management */
#usersTable th, #usersTable td {
    vertical-align: middle;
}

.role-superadmin {
    color: #d63384;
    font-weight: bold;
}

.role-admin {
    color: #0d6efd;
    font-weight: bold;
}

.role-operator {
    color: #6c757d;
}

/* Footer & Signature */
.footer-note {
    font-size: 0.875rem;
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f9fbfd;
    border-radius: 0.375rem;
}

.footer-note ol {
    padding-left: 1.25rem;
    margin-bottom: 0;
}

.footer-note li {
    margin-bottom: 0.5rem;
}

.signature {
    text-align: right;
    margin-top: 3rem;
}

.signature p {
    margin-bottom: 0.5rem;
}

.signature-name {
    margin-top: 3rem;
    font-weight: 600;
}

.signature-nip {
    font-size: 0.875rem;
}

/* Dashboard enhancements */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    margin-bottom: 1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.filter-section {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
}

.skeleton-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    min-height: 20px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .btn {
        width: 100%;
        margin: 2px 0;
        margin-bottom: 0.5rem;
    }

    .form-row {
        flex-direction: column;
    }

    .col {
        width: 100%;
        margin-bottom: 1rem;
    }

    .sample-type {
        flex-direction: column;
        gap: 0.5rem;
    }

    .action-buttons, .export-buttons {
        flex-direction: column;
    }

    .navbar-nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-item {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }

    #reportFormPage, #reportFormPage * {
        visibility: visible;
    }

    body {
        margin: 0;
        padding: 15mm;
        font-size: 10pt;
        line-height: 1.2;
    }

    .report-header-print {
        display: flex;
        align-items: center;
        gap: 25px;
        margin-bottom: 1rem;
    }

    .print-logo {
        height: 100px;
    }

    .print-header-text h2 {
        font-size: 18pt;
        margin: 0;
        line-height: 1.2;
    }

    .action-buttons,
    .navbar,
    .footer-note,
    .header { /* tambahkan .header dari blok kedua */
        display: none !important;
    }

    .letterhead {
        display: flex;
        align-items: center;
        margin-bottom: 3mm;
        border-bottom: 1px solid #000;
        padding-bottom: 2mm;
    }

    .report-title {
        text-align: center;
        font-weight: bold;
        font-size: 16pt;
        margin: 3mm 0;
        text-decoration: underline;
        padding-top: 2mm;
    }

    h3.sample-info-title {
        margin: 4mm 0 2mm 0;
        font-size: 13pt;
        padding-bottom: 1mm;
        border-bottom: 1px solid #ddd;
    }

    table.sample-info {
        margin: 2mm 0;
        margin-bottom: 3mm;
    }

    /* Aturan umum untuk semua th, td */
    th, td {
        padding: 2mm 3mm;
        line-height: 1.2;
        font-size: 10pt;
    }

    /* Aturan khusus untuk tabel dengan class .table */
    .table {
        width: 100%;
        border-collapse: collapse;
        font-size: 9pt;
    }

    .table th, .table td {
        border: 1px solid #000;
        padding: 3px;
        word-wrap: break-word;
    }

    .table th {
        background-color: #f2f2f2 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }

    #modalResultsBody tr {
        height: auto;
        min-height: 5mm;
    }

    .modalResultsBody td {
        padding-top: 1mm;
        padding-bottom: 1mm;
    }

    .modalResultsBody td strong {
        line-height: 1.1;
        margin-bottom: 0;
    }

    .modalResultsBody td br {
        display: none;
    }

    .avoid-break {
        page-break-inside: avoid;
    }

    .footer {
        margin-top: 10mm;
        text-align: right;
    }

    .footer p {
        margin-bottom: 2mm;
    }

    .signature {
        margin-top: 5mm;
    }

    .signature p {
        margin: 1mm 0;
    }

    .additional-notes {
        margin-top: 20mm;
        font-size: 10pt;
        line-height: 1.2;
        text-align: left;
    }

    .additional-notes ol {
        padding-left: 15px;
        margin-top: 5mm;
    }

    .additional-notes li {
        margin-bottom: 2mm;
        text-align: left;
    }
}

/* === TABLE LAPORAN RAPI === */
#allReportsTable th,
#allReportsTable td {
    vertical-align: middle;
    font-size: 13px;
}

#allReportsTable td {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Kolom tertentu */
#allReportsTable td.col-pengirim {
    max-width: 280px;
}

#allReportsTable td.col-sampel {
    max-width: 160px;
}

#allReportsTable td.col-lokasi {
    max-width: 180px;
}

/* Badge status */
.badge {
    font-size: 12px;
    padding: 5px 8px;
    border-radius: 8px;
}

/* Tombol aksi */
.action-buttons {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.action-buttons .btn {
    padding: 4px 6px;
}
#allReportsTable td:last-child {
    white-space: nowrap;
    vertical-align: middle;
}

#allReportsTable .action-buttons {
    display: flex;
    gap: 4px;
    margin-top: 0 !important;
    justify-content: center;
    align-items: center;
}
