: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 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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 - Logo dengan background premium
   ============================================= */

.navbar {
    background: linear-gradient(135deg, #0066cc 0%, #004c99 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: nowrap;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* Logo Wrapper with premium background for navbar */
.navbar-logo-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.navbar-brand:hover .navbar-logo-wrapper {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.navbar-brand img {
    height: 36px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
    display: block;
}

.navbar-brand:hover img {
    transform: scale(1.02);
}

.navbar-brand span {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.navbar-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
    flex-direction: row !important;
    flex-wrap: nowrap;
}

.nav-item {
    position: relative;
    margin: 0;
    flex-shrink: 0;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-link i {
    font-size: 1rem;
}

.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);
}

/* =============================================
   LOGIN PAGE - Logo dengan background premium
   ============================================= */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0066cc 0%, #004c99 100%);
    position: relative;
}

/* Decorative background pattern */
.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, #004c99 0%, #003366 100%);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Decorative pattern inside header */
.login-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 40%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Logo Container - Premium Glassmorphism Effect */
.login-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

/* Logo wrapper with glassmorphism effect */
.login-logo-wrapper {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 15px 25px;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: logoFloat 3s ease-in-out infinite;
}

.login-logo-wrapper:hover {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    animation: none;
}

.login-logo {
    height: 70px;
    width: auto;
    display: block;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.login-logo-wrapper:hover .login-logo {
    transform: scale(1.02);
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0.5rem 0 0.25rem;
    letter-spacing: -0.5px;
}

.login-header p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 0;
}

.login-body {
    padding: 2rem;
}

/* Animation for logo */
@keyframes logoFloat {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

/* 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;
}

/* =============================================
   TABLE ACTION BUTTONS FIX - Alignment
   ============================================= */

/* Perbaikan untuk button sm */
.btn-sm {
    margin: 2px;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

/* Style untuk icon dalam button */
.btn-sm i {
    font-size: 0.75rem;
    margin-right: 0;
    display: inline-block;
    vertical-align: middle;
}

/* Jika button hanya berisi icon (tanpa teks) */
.btn-sm i:only-child {
    margin: 0;
}

/* Perbaikan alignment untuk seluruh cell tabel */
table td, 
table th {
    vertical-align: middle !important;
    text-align: left;
}

/* Khusus untuk kolom aksi */
td:has(.btn-sm),
td.actions-cell,
table td:last-child {
    vertical-align: middle !important;
    text-align: center !important;
}

/* Perbaikan tinggi baris tabel agar konsisten */
table tbody tr {
    height: 52px;
}

table tbody td {
    line-height: 1.4;
    padding: 12px 8px;
}

/* Grup tombol aksi */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

/* Tombol dalam satu cell */
td .btn-sm + .btn-sm {
    margin-left: 4px;
}

/* Hover effect untuk tombol */
.btn-sm:hover {
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Class khusus untuk kolom aksi */
.actions-column {
    text-align: center !important;
    vertical-align: middle !important;
    width: 120px;
    min-width: 100px;
}

/* Perbaikan untuk berbagai tipe button di kolom aksi */
td .btn-danger.btn-sm,
td .btn-primary.btn-sm,
td .btn-info.btn-sm,
td .btn-success.btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Memastikan icon font awesome sejajar */
.fa, 
.fas, 
.far, 
.fal, 
.fab {
    vertical-align: middle;
}

/* Tombol icon-only */
.btn-icon.btn-sm {
    padding: 0.375rem 0.5rem;
}

.btn-icon.btn-sm i {
    margin: 0;
}

/* 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);
}

/* Custom Badges */
.badge-draft {
    background-color: #9b59b6 !important;
    color: white !important;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-block;
    font-weight: 600;
}

.badge-resampling {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
    color: white !important;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-block;
    font-weight: 600;
}

.badge-resampling i {
    margin-right: 4px;
}

.badge-normal {
    background-color: #6c757d !important;
    color: white !important;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-block;
}

/* 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;
    border-color: #e6b800 !important;
    color: #000 !important;
    font-weight: bold;
}

/* 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;
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

@media (max-width: 992px) {
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    .navbar-brand span {
        font-size: 1rem;
    }
    
    .navbar-brand img {
        height: 32px;
    }
    
    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 0.75rem 1rem;
        gap: 10px;
    }
    
    .navbar-brand {
        margin-bottom: 0;
        width: 100%;
        justify-content: center;
    }
    
    .navbar-brand img {
        height: 30px;
    }
    
    .navbar-nav {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .login-logo {
        height: 55px;
    }
    
    .login-logo-wrapper {
        padding: 12px 20px;
    }
    
    /* Perbaikan responsive untuk tabel */
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .btn-sm i {
        font-size: 0.7rem;
    }
    
    table tbody tr {
        height: auto;
    }
    
    .action-buttons {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}

@media (max-width: 576px) {
    .navbar-nav {
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }
    
    .navbar-brand img {
        height: 28px;
    }
    
    .navbar-brand span {
        font-size: 0.9rem;
    }
    
    .navbar-logo-wrapper {
        padding: 6px 10px;
    }
    
    .login-logo {
        height: 50px;
    }
    
    .login-logo-wrapper {
        padding: 10px 18px;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
}

/* =============================================
   PRINT STYLES
   ============================================= */

@media print {
    body * {
        visibility: hidden;
    }

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

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

    .action-buttons,
    .navbar,
    .footer-note,
    .header {
        display: none !important;
    }
}

/* Style untuk icon jenis pemeriksaan */
td:first-child .ms-1 {
    display: inline-block;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

/* Tooltip hover effect */
td:first-child .ms-1:hover {
    transform: scale(1.05);
    cursor: help;
}

/* Style untuk icon jenis pemeriksaan di daftar laporan */
.exam-icons {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    vertical-align: middle;
}

.exam-icons i {
    transition: transform 0.2s ease;
}

.exam-icons i:hover {
    transform: scale(1.1);
}

td:first-child .ms-1.text-muted i {
    color: #6c757d;
    opacity: 0.6;
}