:root {
    --primary-blue: #1e40af;
    --secondary-blue: #3b82f6;
    --light-blue: #dbeafe;
    --dark-blue: #1e3a8a;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    
    /* Losetime Color Theme */
    --losetime-primary: #dc2626;
    --losetime-secondary: #ef4444;
    --losetime-light: #fee2e2;
    --losetime-dark: #b91c1c;
    --losetime-bg-light: #fff5f5;
    --losetime-bg-medium: #fee2e2;
    
    /* IPQC Color Theme */
    --ipqc-primary: #d97706;
    --ipqc-secondary: #f59e0b;
    --ipqc-light: #fef3c7;
    --ipqc-dark: #92400e;
    --ipqc-bg-light: #fffbeb;
    --ipqc-bg-medium: #fef3c7;
    
    --gray-100: #f8fafc;
    --gray-200: #e2e8f0;
    --gray-600: #475569;
    --gray-800: #1e293b;
}

/* RESET & BASE STYLES */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--gray-800);
    min-height: 100vh;
    line-height: 1.5;
    font-size: 0.9rem;
}

.container { 
    max-width: 2000px; 
    padding: 0 15px; 
    margin: 0 auto;
}

/* NAVIGATION */
.navbar {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.3);
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-box {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.logo-box i {
    color: white;
    font-size: 1.1rem;
}

.btn-login {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-login:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-1px);
    text-decoration: none;
}

/* Date & Time in Navigation */
.navbar .compact-text {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    backdrop-filter: blur(10px);
    color: white;
}

/* FILTER SECTION */
.filter-section {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.05);
    border: 1px solid var(--gray-200);
}

.form-control, .form-select {
    background: white;
    border: 1px solid var(--gray-200);
    color: var(--gray-800);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.3s;
    height: 38px;
    width: 100%;
}

.form-control:focus, .form-select:focus {
    background: white;
    border-color: var(--secondary-blue);
    color: var(--gray-800);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
    outline: none;
}

.form-label {
    color: var(--gray-800);
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.85rem;
    display: block;
}

.btn-search {
    background: linear-gradient(135deg, var(--secondary-blue), var(--primary-blue));
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s;
    height: 38px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.btn-search:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Period Info Badges */
.badge {
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

.badge.bg-info {
    background: rgba(14, 165, 233, 0.1);
    color: #0284c7;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.badge.bg-primary {
    background: rgba(59, 130, 246, 0.1);
    color: var(--secondary-blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge.bg-warning {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning);
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.badge.bg-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.badge.bg-success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

/* DASHBOARD LAYOUT - 4 BAGIAN */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 15px;
    margin-bottom: 15px;
    min-height: 500px;
}

.dashboard-section {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.08);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 320px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--light-blue);
    flex-shrink: 0;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-blue);
    display: flex;
    align-items: center;
    gap: 8px;
}

.compact-text-xs {
    font-size: 0.75rem;
    color: var(--gray-600);
}

.section-content {
    flex: 1;
    overflow: auto;
    min-height: 250px;
}

/* ============================== */
/* STYLING KHUSUS UNTUK LOSETIME SECTION */
/* ============================== */
.losetime-section {
    background: linear-gradient(135deg, var(--losetime-bg-light), var(--losetime-bg-medium)) !important;
    border-top: 3px solid var(--losetime-primary);
    border-left: 3px solid var(--losetime-primary);
}

.losetime-section .section-header {
    border-bottom: 2px solid var(--losetime-light);
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.3), rgba(254, 202, 202, 0.2));
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 8px 8px 0 0;
}

.losetime-section .section-title {
    color: var(--losetime-dark);
}

/* ============================== */
/* STYLING KHUSUS UNTUK IPQC SECTION */
/* ============================== */
.ipqc-section {
    background: linear-gradient(135deg, var(--ipqc-bg-light), var(--ipqc-bg-medium)) !important;
    border-top: 3px solid var(--ipqc-primary);
    border-left: 3px solid var(--ipqc-primary);
}

.ipqc-section .section-header {
    border-bottom: 2px solid var(--ipqc-light);
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.3), rgba(253, 230, 138, 0.2));
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 8px 8px 0 0;
}

.ipqc-section .section-title {
    color: var(--ipqc-dark);
}

/* STATS CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 15px 0;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(30, 64, 175, 0.05);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-blue));
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.1);
}

.stat-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--secondary-blue), var(--primary-blue));
    color: white;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 6px 0;
    color: var(--dark-blue);
}

.stat-label {
    color: var(--gray-600);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-sublabel {
    color: var(--gray-600);
    font-size: 0.75rem;
    margin-top: 2px;
}

/* Background untuk komponen di dalam Losetime */
.losetime-section .stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(254, 226, 226, 0.3));
    border: 1px solid var(--losetime-light);
}

.losetime-section .stat-card::before {
    background: linear-gradient(90deg, var(--losetime-primary), var(--losetime-secondary));
}

.losetime-section .stat-icon {
    background: linear-gradient(135deg, var(--losetime-primary), var(--losetime-secondary));
}

/* Background untuk komponen di dalam IPQC */
.ipqc-section .stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(254, 243, 199, 0.3));
    border: 1px solid var(--ipqc-light);
}

.ipqc-section .stat-card::before {
    background: linear-gradient(90deg, var(--ipqc-primary), var(--ipqc-secondary));
}

.ipqc-section .stat-icon {
    background: linear-gradient(135deg, var(--ipqc-primary), var(--ipqc-secondary));
}

/* CARDS */
.card {
    background: white;
    border-radius: 12px;
    border: none;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.08);
    border: 1px solid var(--gray-200);
    height: 100%;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.12);
}

.card-header {
    background: linear-gradient(135deg, var(--light-blue), #eff6ff);
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--dark-blue);
}

.card-body {
    padding: 15px;
}

/* Losetime section cards */
.losetime-section .card-header {
    background: linear-gradient(135deg, var(--losetime-primary), var(--losetime-secondary)) !important;
    color: white !important;
}

/* IPQC section cards */
.ipqc-section .card-header {
    background: linear-gradient(135deg, var(--ipqc-primary), var(--ipqc-secondary)) !important;
    color: white !important;
}

/* CHARTS */
.chart-wrapper {
    padding: 10px;
    height: 250px;
    position: relative;
}

/* HOURLY TABLE - PROFESIONAL STYLE */
.hourly-table-container {
    max-height: 400px;
    overflow: auto;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.hourly-table-compact {
    width: 100%;
    font-size: 0.72rem;
    border-collapse: collapse;
    background: white;
    min-width: 700px;
}

.hourly-table-compact thead {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    position: sticky;
    top: 0;
    z-index: 10;
}

.hourly-table-compact th {
    padding: 8px 4px;
    font-weight: 700;
    color: white;
    text-align: center;
    border: 1px solid var(--gray-300);
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
}

.hourly-table-compact td {
    padding: 6px 4px;
    text-align: center;
    border: 1px solid var(--gray-200);
    white-space: nowrap;
    background: white;
    transition: all 0.2s ease;
}

.hourly-table-compact tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.8);
}

.hourly-table-compact tbody tr:hover {
    background: #e0f2fe;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hourly-table-compact .hour-header {
    background: var(--secondary-blue);
    color: white;
    font-weight: 700;
    text-align: center;
    position: sticky;
    left: 0;
    z-index: 5;
}

.hourly-table-compact .line-header {
    background: var(--primary-blue);
    color: white;
    font-weight: 700;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 8;
}

.hourly-table-compact .total-row {
    background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
    font-weight: 700;
    border-top: 2px solid var(--primary-blue);
}

.hourly-table-compact .hour-total {
    background: var(--dark-blue);
    color: white;
    font-weight: 700;
    position: sticky;
    left: 0;
    z-index: 3;
}

.hourly-table-compact .achievement-row td {
    padding: 8px 4px;
    font-weight: 600;
}

/* PROFESSIONAL COLOR SCHEME FOR TABLES */
.bg-success-light {
    background-color: rgba(5, 150, 105, 0.08) !important;
}

.bg-danger-light {
    background-color: rgba(220, 38, 38, 0.08) !important;
}

.bg-warning-light {
    background-color: rgba(217, 119, 6, 0.08) !important;
}

.bg-primary-light {
    background-color: rgba(59, 130, 246, 0.08) !important;
}

.bg-primary-medium {
    background-color: rgba(59, 130, 246, 0.15) !important;
}

.bg-composition-light {
    background-color: rgba(139, 92, 246, 0.08) !important;
}

/* Warna khusus untuk Losetime */
.bg-losetime-light {
    background-color: rgba(220, 38, 38, 0.08) !important;
}

.bg-losetime-medium {
    background-color: rgba(220, 38, 38, 0.15) !important;
}

/* Warna khusus untuk IPQC */
.bg-ipqc-light {
    background-color: rgba(217, 119, 6, 0.08) !important;
}

.bg-ipqc-medium {
    background-color: rgba(217, 119, 6, 0.15) !important;
}

/* Professional text colors */
.text-success { 
    color: #059669 !important; 
    font-weight: 600; 
}
.text-danger { 
    color: #dc2626 !important; 
    font-weight: 600; 
}
.text-warning { 
    color: #d97706 !important; 
    font-weight: 600; 
}
.text-primary { 
    color: #3b82f6 !important; 
    font-weight: 600; 
}
.text-composition { 
    color: #4c1d95 !important; 
    font-weight: 600; 
}

/* Text color khusus */
.text-losetime { 
    color: var(--losetime-primary) !important; 
    font-weight: 600; 
}
.text-ipqc { 
    color: var(--ipqc-primary) !important; 
    font-weight: 600; 
}

/* Professional lose time styling */
.lose-time-indicator {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: var(--losetime-primary);
    font-weight: 600;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.7rem;
    margin-top: 2px;
    display: inline-block;
}

/* Hourly Performance Indicator */
.hourly-performance {
    font-size: 0.65rem;
    margin-top: 2px;
}

.hourly-performance .performance-badge {
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: 600;
}

.hourly-performance .excellent {
    background: rgba(5, 150, 105, 0.15);
    color: var(--success);
}

.hourly-performance .good {
    background: rgba(217, 119, 6, 0.15);
    color: var(--warning);
}

.hourly-performance .poor {
    background: rgba(220, 38, 38, 0.15);
    color: var(--danger);
}

/* TABLE STYLING */
.table-responsive {
    position: relative;
    overflow: auto;
}

.table {
    width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa;
}

.table tbody + tbody {
    border-top: 2px solid #dee2e6;
}

.table-bordered {
    border: 1px solid #dee2e6;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #dee2e6;
}

.table-bordered thead th,
.table-bordered thead td {
    border-bottom-width: 2px;
}

.table-sm th,
.table-sm td {
    padding: 0.3rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.075);
}

.table-dark {
    color: #fff;
    background-color: #343a40;
}

.table-dark th,
.table-dark td,
.table-dark thead th {
    border-color: #454d55;
}

.table-dark.table-bordered {
    border: 0;
}

.table-dark.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.05);
}

.table-dark.table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.075);
}

/* Buttons in tables */
.table-responsive .btn {
    margin: 2px;
    white-space: nowrap;
    min-width: 80px;
}

.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    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;
    text-decoration: none;
    cursor: pointer;
}

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

.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    color: #fff;
    background-color: #0069d9;
    border-color: #0062cc;
}

.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

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

.btn-success {
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    color: #fff;
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-info {
    color: #fff;
    background-color: #17a2b8;
    border-color: #17a2b8;
}

.btn-info:hover {
    color: #fff;
    background-color: #138496;
    border-color: #117a8b;
}

.btn-warning {
    color: #212529;
    background-color: #ffc107;
    border-color: #ffc107;
}

.btn-warning:hover {
    color: #212529;
    background-color: #e0a800;
    border-color: #d39e00;
}

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

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

.btn-light {
    color: #212529;
    background-color: #f8f9fa;
    border-color: #f8f9fa;
}

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

.btn-dark {
    color: #fff;
    background-color: #343a40;
    border-color: #343a40;
}

.btn-dark:hover {
    color: #fff;
    background-color: #23272b;
    border-color: #1d2124;
}

/* PROGRESS BAR */
.progress {
    display: flex;
    height: 0.75rem;
    overflow: hidden;
    font-size: 0.75rem;
    background-color: #e9ecef;
    border-radius: 0.25rem;
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    background-color: #007bff;
    transition: width 0.6s ease;
}

.progress-bar-striped {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
}

.progress-bar-animated {
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    from { background-position: 1rem 0; }
    to { background-position: 0 0; }
}

/* EMPTY STATE */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--gray-600);
    text-align: center;
    padding: 20px;
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 0.8rem;
    opacity: 0.5;
}

.empty-state h5 {
    margin-bottom: 0.5rem;
    color: var(--gray-600);
    font-size: 1rem;
}

.empty-state p {
    margin-bottom: 0;
    opacity: 0.7;
    font-size: 0.85rem;
}

/* LINE PERFORMANCE TABLE */
.line-performance-table {
    font-size: 0.8rem;
    width: 100%;
}

.line-performance-table th {
    padding: 8px 6px;
    font-weight: 700;
    text-align: center;
}

.line-performance-table td {
    padding: 6px 4px;
    vertical-align: middle;
    text-align: center;
}

/* DOCUMENT CARDS */
.document-card {
    margin-bottom: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: white;
    break-inside: avoid;
    page-break-inside: avoid;
}

.document-card:hover {
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.document-container {
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 8px;
}

.document-container::-webkit-scrollbar {
    width: 4px;
}

.document-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}

.document-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 8px;
}

.document-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* CATEGORY TABLE FOR LOSETIME */
.category-table-sm {
    font-size: 0.7rem;
    width: 100%;
    border-collapse: collapse;
}

.category-table-sm th {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 6px 4px;
    font-weight: 700;
    text-align: center;
    border: 1px solid #dee2e6;
}

.category-table-sm td {
    padding: 5px 4px;
    border: 1px solid #dee2e6;
    vertical-align: middle;
    cursor: pointer;
}

.category-table-sm td:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.category-table-sm tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Kategori color scheme untuk chart */
.category-color-1 { background-color: rgba(217, 119, 6, 0.8) !important; }
.category-color-2 { background-color: rgba(220, 38, 38, 0.8) !important; }
.category-color-3 { background-color: rgba(59, 130, 246, 0.8) !important; }
.category-color-4 { background-color: rgba(5, 150, 105, 0.8) !important; }
.category-color-5 { background-color: rgba(139, 92, 246, 0.8) !important; }
.category-color-6 { background-color: rgba(236, 72, 153, 0.8) !important; }
.category-color-7 { background-color: rgba(245, 158, 11, 0.8) !important; }
.category-color-8 { background-color: rgba(14, 165, 233, 0.8) !important; }
.category-color-9 { background-color: rgba(20, 184, 166, 0.8) !important; }
.category-color-10 { background-color: rgba(244, 63, 94, 0.8) !important; }

/* ============================================== */
/* PERBAIKAN KHUSUS UNTUK MODAL IPQC - REDESIGN */
/* ============================================== */

.ipqc-modal-detail .modal-dialog {
    max-width: 1200px !important;
    margin: 1rem auto !important;
    height: calc(100vh - 2rem);
}

.ipqc-modal-detail .modal-content {
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.ipqc-modal-detail .modal-header {
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.ipqc-modal-detail .modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ipqc-modal-detail .modal-body {
    padding: 0 !important;
    overflow: hidden !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}
/* Perbaikan khusus untuk tabel IPQC */
.ipqc-section .table th {
    font-size: 0.7rem;
    padding: 0.4rem 0.3rem;
    white-space: nowrap;
}

.ipqc-section .table td {
    font-size: 0.75rem;
    padding: 0.3rem 0.2rem;
    vertical-align: middle;
}

/* Compact buttons di tabel */
.ipqc-section .btn-sm {
    padding: 0.15rem 0.3rem;
    font-size: 0.7rem;
    min-width: 60px;
}

/* Responsive adjustments untuk mobile */
@media (max-width: 768px) {
    .ipqc-section .stat-card .stat-value {
        font-size: 1.2rem;
    }
    
    .ipqc-section .stat-card .stat-label {
        font-size: 0.7rem;
    }
    
    .ipqc-section .table {
        font-size: 0.65rem;
    }
    
    .ipqc-section .btn-sm {
        padding: 0.1rem 0.2rem;
        font-size: 0.6rem;
        min-width: 50px;
    }
    
    .ipqc-section .badge {
        font-size: 0.6rem;
        padding: 0.1rem 0.3rem;
    }
}

/* Animasi untuk smooth scrolling */
.ipqc-section .table-responsive::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.ipqc-section .table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ipqc-section .table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

/* Hover effect untuk rows */
.ipqc-section .table tbody tr:hover {
    background-color: rgba(217, 119, 6, 0.05);
    cursor: pointer;
}

/* Badge styling khusus untuk IPQC */
.ipqc-section .badge.bg-primary {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #2563eb !important;
}

.ipqc-section .badge.bg-warning {
    background: rgba(217, 119, 6, 0.2) !important;
    color: #92400e !important;
}

.ipqc-section .badge.bg-success {
    background: rgba(5, 150, 105, 0.2) !important;
    color: #059669 !important;
}

.ipqc-section .badge.bg-danger {
    background: rgba(220, 38, 38, 0.2) !important;
    color: #dc2626 !important;
}

/* Container utama untuk konten modal */
#ipqcModalBody {
    height: 100%;
    overflow-y: auto;
    padding: 0.5rem !important;
}

/* Kontainer utama dengan padding minimal */
#ipqcModalBody .container-fluid {
    padding: 0.5rem !important;
}

/* Header card yang lebih kompak */
.ipqc-modal-detail .card-header {
    padding: 0.6rem 1rem !important;
    font-size: 0.85rem !important;
    font-weight: 600;
    min-height: auto;
}

/* Body card yang lebih kompak */
.ipqc-modal-detail .card-body {
    padding: 0.75rem !important;
}

/* Foto utama - diperkecil */
.ipqc-modal-detail .main-finding-photo {
    max-height: 300px !important;
    width: auto !important;
    margin: 0 auto;
    object-fit: contain;
}

/* Thumbnail foto - diperkecil */
.ipqc-modal-detail .finding-thumbnail {
    height: 80px !important;
    width: 100% !important;
    object-fit: cover;
}

/* Grid untuk foto tambahan - lebih rapat */
.ipqc-modal-detail .row.g-2 {
    margin: 0 -0.25rem !important;
}

.ipqc-modal-detail .row.g-2 > div {
    padding: 0 0.25rem !important;
}

/* Operator cards - lebih kompak */
.ipqc-modal-detail .operator-detail-card {
    padding: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

.ipqc-modal-detail .operator-detail-card h6 {
    font-size: 0.8rem !important;
    margin-bottom: 0.5rem !important;
    padding-bottom: 0.25rem !important;
}

/* Progress bars - lebih kecil */
.ipqc-modal-detail .progress {
    height: 4px !important;
    margin: 0.25rem 0 !important;
}

/* Badges - lebih kecil */
.ipqc-modal-detail .badge {
    padding: 0.2rem 0.5rem !important;
    font-size: 0.7rem !important;
}

/* Text yang lebih kecil untuk detail */
.ipqc-modal-detail .small, 
.ipqc-modal-detail .text-muted {
    font-size: 0.75rem !important;
}

/* Margin dan padding yang lebih ketat */
.ipqc-modal-detail .mb-3 {
    margin-bottom: 0.75rem !important;
}
.ipqc-modal-detail .mb-4 {
    margin-bottom: 1rem !important;
}
.ipqc-modal-detail .mt-3 {
    margin-top: 0.75rem !important;
}
.ipqc-modal-detail .mt-4 {
    margin-top: 1rem !important;
}

/* Row dan col yang lebih rapat */
.ipqc-modal-detail .row {
    margin: 0 -0.25rem !important;
}
.ipqc-modal-detail .col, 
.ipqc-modal-detail .col-md-6, 
.ipqc-modal-detail .col-lg-5, 
.ipqc-modal-detail .col-lg-7 {
    padding: 0 0.25rem !important;
}

/* Card shadows lebih ringan */
.ipqc-modal-detail .card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    margin-bottom: 0.75rem !important;
}

/* Tabel dalam modal - lebih kompak */
.ipqc-modal-detail .table {
    margin-bottom: 0.5rem !important;
    font-size: 0.75rem !important;
}
.ipqc-modal-detail .table th,
.ipqc-modal-detail .table td {
    padding: 0.3rem 0.5rem !important;
}

/* Scrollbar customization untuk modal */
.ipqc-modal-detail .modal-body::-webkit-scrollbar {
    width: 6px;
}
.ipqc-modal-detail .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}
.ipqc-modal-detail .modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}
.ipqc-modal-detail .modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Header dengan gradient yang konsisten */
.ipqc-modal-detail .card.border-success .card-header {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
}
.ipqc-modal-detail .card.border-warning .card-header {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: white !important;
}
.ipqc-modal-detail .card.border-danger .card-header {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
}
.ipqc-modal-detail .card.border-primary .card-header {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    color: white !important;
}

/* Footer modal yang lebih kompak */
.ipqc-modal-detail .modal-footer {
    padding: 0.5rem 1rem !important;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    flex-shrink: 0;
}

/* Button di footer yang lebih kecil */
.ipqc-modal-detail .modal-footer .btn {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
}

/* GENERAL MODAL STYLES */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: linear-gradient(135deg, var(--light-blue), #eff6ff);
    border-bottom: 1px solid var(--gray-200);
    border-radius: 12px 12px 0 0;
    padding: 12px 16px;
    flex-shrink: 0;
}

.modal-title {
    color: var(--dark-blue);
    font-weight: 700;
    font-size: 1.1rem;
}

.modal-body {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(85vh - 120px);
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
}

/* Modal khusus untuk Losetime */
.losetime-modal .modal-header,
.category-detail-modal .modal-header {
    background: linear-gradient(135deg, var(--losetime-primary), var(--losetime-secondary));
    color: white;
}

.losetime-modal .modal-title,
.category-detail-modal .modal-title {
    color: white;
}

/* Modal khusus untuk IPQC */
.ipqc-modal .modal-header {
    background: linear-gradient(135deg, var(--ipqc-primary), var(--ipqc-secondary));
    color: white;
}

.ipqc-modal .modal-title {
    color: white;
}

/* Button close styling */
.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em 0.25em;
    color: #000;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg+xml") center/1em auto no-repeat;
    border: 0;
    border-radius: 0.25rem;
    opacity: 0.5;
}

.btn-close:hover {
    color: #000;
    text-decoration: none;
    opacity: 0.75;
}

.btn-close:focus {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    opacity: 1;
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* FOTO ZOOM MODAL */
.photo-zoom-container {
    max-height: 500px;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    margin-bottom: 1rem;
}

.photo-zoom-container img {
    max-height: 480px;
    width: auto;
    margin: 0 auto;
    display: block;
}

/* Operator and Quality Detail Cards */
.operator-detail-card, .quality-detail-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #dee2e6;
}

.operator-detail-card h6, .quality-detail-card h6 {
    color: #495057;
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #dee2e6;
}

.detail-info {
    font-size: 12px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.detail-label {
    font-weight: 600;
    color: #6c757d;
}

.detail-value {
    color: #212529;
    text-align: right;
}

/* Additional styles for IPQC */
.operator-card {
    border: 1px solid #e0e0e0;
    transition: transform 0.2s;
}
.operator-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.user-avatar-large {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 3px solid #4e73df;
    border-radius: 50%;
}
.finding-photo {
    cursor: pointer;
    transition: transform 0.2s;
}
.finding-photo:hover {
    transform: scale(1.05);
}

/* Foto utama yang besar */
.main-finding-photo {
    max-height: 400px !important;
    width: auto !important;
    margin: 0 auto;
    display: block;
    border: 3px solid #f59e0b;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-radius: 8px;
}

/* Thumbnail untuk foto lainnya */
.finding-thumbnail {
    transition: all 0.3s ease;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
}

.finding-thumbnail:hover {
    transform: scale(1.05);
    border-color: #f59e0b;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.3);
}

/* Card untuk foto */
.photo-card {
    transition: transform 0.2s;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.photo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Border khusus untuk sections */
.border-danger {
    border-left: 4px solid #dc2626 !important;
}

.border-warning {
    border-left: 4px solid #f59e0b !important;
}

.border-primary {
    border-left: 4px solid #3b82f6 !important;
}

.border-success {
    border-left: 4px solid #10b981 !important;
}

/* Highlight untuk informasi penting */
.info-highlight {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.05));
    border-left: 4px solid #f59e0b;
    padding: 10px 15px;
    border-radius: 0 5px 5px 0;
}

/* Animation for modal */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-content {
    animation: fadeIn 0.3s ease-out;
}

/* Hover effects for table rows */
.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
    cursor: pointer;
}

/* Fix untuk z-index modal */
.modal {
    z-index: 1060;
}

.modal-backdrop {
    z-index: 1050;
}

/* Style untuk foto gallery */
.photo-card {
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
}

.photo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.finding-thumbnail {
    transition: transform 0.3s ease;
}

.finding-thumbnail:hover {
    transform: scale(1.05);
}

/* ============================================== */
/* UTILITY CLASSES */
/* ============================================== */

.dense-padding {
    padding: 0.5rem !important;
}

.dense-margin {
    margin: 0.25rem !important;
}

.compact-text {
    font-size: 0.85rem !important;
    line-height: 1.3 !important;
}

.compact-text-sm {
    font-size: 0.8rem !important;
}

.compact-heading {
    font-size: 0.9rem !important;
    margin-bottom: 0.5rem !important;
}

/* Text alignment */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

/* Font weights */
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-normal { font-weight: 400 !important; }
.fw-light { font-weight: 300 !important; }

/* Display utilities */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }

/* Flex utilities */
.flex-column { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-baseline { align-items: baseline !important; }
.align-items-stretch { align-items: stretch !important; }
.align-self-auto { align-self: auto !important; }
.align-self-start { align-self: flex-start !important; }
.align-self-end { align-self: flex-end !important; }
.align-self-center { align-self: center !important; }
.align-self-baseline { align-self: baseline !important; }
.align-self-stretch { align-self: stretch !important; }

/* Margin and padding utilities */
.m-0 { margin: 0 !important; }
.m-1 { margin: 0.25rem !important; }
.m-2 { margin: 0.5rem !important; }
.m-3 { margin: 1rem !important; }
.m-4 { margin: 1.5rem !important; }
.m-5 { margin: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 0.25rem !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pt-3 { padding-top: 1rem !important; }
.pt-4 { padding-top: 1.5rem !important; }
.pt-5 { padding-top: 3rem !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: 0.25rem !important; }
.pb-2 { padding-bottom: 0.5rem !important; }
.pb-3 { padding-bottom: 1rem !important; }
.pb-4 { padding-bottom: 1.5rem !important; }
.pb-5 { padding-bottom: 3rem !important; }

/* ============================================== */
/* RESPONSIVE ADJUSTMENTS */
/* ============================================== */

@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 12px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, auto);
    }
    
    .dashboard-section {
        min-height: 300px;
    }
    
    .ipqc-modal-detail .modal-dialog {
        max-width: 95% !important;
    }
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .stats-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .modal-xl {
        margin: 5px;
    }
    
    .modal-body {
        padding: 12px;
    }
    
    .dashboard-section {
        padding: 12px;
    }
    
    .section-content {
        min-height: 200px;
    }
    
    .hourly-table-container {
        max-height: 350px;
    }
    
    .hourly-table-compact {
        font-size: 0.68rem;
    }
    
    .hourly-table-compact th,
    .hourly-table-compact td {
        padding: 4px 2px;
    }
    
    .navbar .d-none.d-md-inline {
        display: none !important;
    }
    
    .ipqc-modal-detail .modal-dialog {
        max-width: 100% !important;
        margin: 0 !important;
        height: 100vh;
    }
    
    .ipqc-modal-detail .modal-content {
        border-radius: 0;
    }
    
    .ipqc-modal-detail .main-finding-photo {
        max-height: 200px !important;
    }
    
    .ipqc-modal-detail .finding-thumbnail {
        height: 60px !important;
    }
    
    /* Stack columns on mobile */
    .ipqc-modal-detail .col-lg-5,
    .ipqc-modal-detail .col-lg-7 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .stats-grid { 
        grid-template-columns: 1fr; 
    }
    
    .section-content {
        min-height: 180px;
    }
    
    .chart-wrapper {
        height: 200px;
    }
    
    .filter-section .row {
        flex-direction: column;
    }
    
    .filter-section .col-md-3,
    .filter-section .col-md-4,
    .filter-section .col-md-2 {
        width: 100%;
        margin-bottom: 8px;
    }
}

/* ============================================== */
/* ANIMATIONS */
/* ============================================== */

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

.dashboard-section {
    animation: slideIn 0.4s ease-out;
}

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

.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

/* ============================================== */
/* CUSTOM SCROLLBAR */
/* ============================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

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

@media print {
    .navbar,
    .filter-section,
    .modal-footer,
    .btn {
        display: none !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    .dashboard-section,
    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
        page-break-inside: avoid;
    }
    
    .modal-content {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
    
    .modal-header,
    .modal-footer {
        display: none !important;
    }
    
    .modal-body {
        overflow: visible !important;
        max-height: none !important;
    }
}

/* ============================================== */
/* CUSTOM TOOLTIP */
/* ============================================== */

.chart-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    display: none;
    max-width: 300px;
}

.tooltip-category {
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 4px;
}

.tooltip-value {
    margin: 2px 0;
    font-size: 11px;
}

/* ============================================== */
/* LOADING STATES */
/* ============================================== */

.modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    flex-direction: column;
}

.modal-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #f97316;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

/* ============================================== */
/* ERROR STATES */
/* ============================================== */

.modal-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    flex-direction: column;
    color: #dc2626;
}

.modal-error i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

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

/* ============================================== */
/* FINAL UTILITIES */
/* ============================================== */

.sticky-top {
    position: sticky;
    top: 0;
    z-index: 1020;
}

.position-relative {
    position: relative !important;
}

.position-absolute {
    position: absolute !important;
}

.position-fixed {
    position: fixed !important;
}

.w-100 {
    width: 100% !important;
}

.h-100 {
    height: 100% !important;
}

.mw-100 {
    max-width: 100% !important;
}

.mh-100 {
    max-height: 100% !important;
}

.vh-100 {
    height: 100vh !important;
}

.min-vh-100 {
    min-height: 100vh !important;
}

.object-fit-cover {
    object-fit: cover !important;
}

.object-fit-contain {
    object-fit: contain !important;
}

.overflow-hidden {
    overflow: hidden !important;
}

.overflow-auto {
    overflow: auto !important;
}

.rounded {
    border-radius: 0.25rem !important;
}

.rounded-circle {
    border-radius: 50% !important;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

.border {
    border: 1px solid #dee2e6 !important;
}

.border-0 {
    border: 0 !important;
}

.border-top {
    border-top: 1px solid #dee2e6 !important;
}

.border-bottom {
    border-bottom: 1px solid #dee2e6 !important;
}

.border-start {
    border-left: 1px solid #dee2e6 !important;
}

.border-end {
    border-right: 1px solid #dee2e6 !important;
}

/* ============================================== */
/* CUSTOM COMPONENTS */
/* ============================================== */

.target-badge {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

.composition-badge {
    background: rgba(14, 165, 233, 0.1);
    color: #0284c7;
    border: 1px solid rgba(14, 165, 233, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

.target-summary-item {
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px dashed #e5e7eb;
}

.target-summary-label {
    font-size: 0.75rem;
    color: #6b7280;
    display: block;
    margin-bottom: 2px;
}

.target-summary-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    display: block;
}
/* Perbaikan untuk modal IPQC yang lebih kompak */
.ipqc-modal-detail .modal-body {
    padding: 0 !important;
    max-height: 85vh !important;
}

.ipqc-modal-detail .card {
    margin-bottom: 0.5rem !important;
}

.ipqc-modal-detail .card-header {
    padding: 0.4rem 0.75rem !important;
}

.ipqc-modal-detail .card-body {
    padding: 0.5rem !important;
}

.ipqc-modal-detail .badge {
    font-size: 0.7rem !important;
    padding: 0.2rem 0.4rem !important;
}

.ipqc-modal-detail h5 {
    font-size: 1.1rem !important;
}

.ipqc-modal-detail h6 {
    font-size: 0.9rem !important;
}

.ipqc-modal-detail small {
    font-size: 0.8rem !important;
}

.ipqc-modal-detail .x-small {
    font-size: 0.7rem !important;
}

.bg-purple {
    background-color: #8b5cf6 !important;
}

/* Compact table */
.ipqc-modal-detail .table-sm td {
    padding: 0.25rem !important;
}

/* Foto thumbnail lebih kecil */
.finding-thumbnail-sm {
    max-height: 60px !important;
    width: auto !important;
}

/* Scrollbar tipis */
.ipqc-modal-detail .modal-body::-webkit-scrollbar {
    width: 6px !important;
}

.ipqc-modal-detail .modal-body::-webkit-scrollbar-thumb {
    background-color: #ccc !important;
    border-radius: 3px !important;
}

/* OQC Modal Styles */
.bg-danger-light {
    background-color: rgba(220, 53, 69, 0.1) !important;
    border: 1px solid rgba(220, 53, 69, 0.2) !important;
}

.bg-warning-light {
    background-color: rgba(255, 193, 7, 0.1) !important;
    border: 1px solid rgba(255, 193, 7, 0.2) !important;
}

.bg-success-light {
    background-color: rgba(25, 135, 84, 0.1) !important;
    border: 1px solid rgba(25, 135, 84, 0.2) !important;
}

.oqc-detail-btn {
    transition: all 0.2s ease;
}

.oqc-detail-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Modal scrollable */
.modal-body-scrollable {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Card animations */
.card {
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.losetime-trend-section {
    background: linear-gradient(135deg, #f8f4e8 0%, #fff8dc 100%);
    border: 2px solid #8B4513;
    border-radius: 10px;
}

.category-table-brown {
    width: 100%;
    font-size: 12px;
}

.category-table-brown th {
    background-color: #8B4513;
    color: white;
    padding: 8px;
    font-weight: bold;
    border: 1px solid #A0522D;
}

.category-table-brown td {
    padding: 6px 8px;
    border: 1px solid #DEB887;
    cursor: pointer;
    transition: background-color 0.2s;
}

.category-table-brown tr:hover td {
    background-color: #FFF8DC !important;
}

.category-table-brown tr:nth-child(even) {
    background-color: #FAF0E6;
}

.category-table-brown tr:nth-child(odd) {
    background-color: #FFF8DC;
}

.table-responsive-brown {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #DEB887;
    border-radius: 5px;
}

/* Styling untuk progress bar khusus */
.progress-bar-brown {
    background-color: #8B4513 !important;
}

.progress-bar-brown-light {
    background-color: #D2691E !important;
}

/* Styling khusus untuk modal losetime */
.modal-body-scrollable {
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(135deg, #f9f5eb 0%, #f5f0e1 100%);
}

/* Badge khusus untuk losetime */
.badge-losetime {
    background-color: #8B4513;
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
}

/* Highlight untuk row aktif */
.table-active-brown {
    background-color: #8B4513 !important;
    color: white !important;
}

.table-active-brown td {
    color: white !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .losetime-trend-section .card {
        margin-bottom: 10px;
    }
    
    .category-table-brown {
        font-size: 10px;
    }
    
    .category-table-brown th,
    .category-table-brown td {
        padding: 4px;
    }
}
.modal-fullscreen .modal-content {
    min-height: 100vh;
    border-radius: 0;
}

/* Perbesar font untuk tabel */
.table-responsive-brown {
    font-size: 1.1rem;
}

.table-responsive-brown th {
    font-size: 1.15rem;
    font-weight: 700;
}

/* Perbesar badge */
.badge.fs-5 {
    font-size: 1.25rem !important;
    padding: 0.75rem 1.25rem !important;
}

.badge.fs-6 {
    font-size: 1.1rem !important;
    padding: 0.5rem 1rem !important;
}

/* Perbesar button */
.btn-lg {
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
}

/* Perbesar card title */
.fs-5 {
    font-size: 1.25rem !important;
}

.fs-6 {
    font-size: 1.1rem !important;
}

/* Perbesar stat numbers */
.h2 {
    font-size: 2.5rem !important;
}

.h3 {
    font-size: 2rem !important;
}

/* Perbesar table cell padding */
.py-3 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.px-3 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Perbesar progress bar */
.progress[style*="height: 10px"] {
    height: 10px !important;
}

.progress[style*="height: 9px"] {
    height: 9px !important;
}

.progress[style*="height: 8px"] {
    height: 8px !important;
}

/* FORCE FIX TOPBAR MOBILE */
@media screen and (max-width: 768px) {
    nav.navbar {
        padding: 8px 10px !important;
        overflow: visible !important;
    }

    nav.navbar .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    nav.navbar .container > .d-flex {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        width: 100% !important;
    }

    nav.navbar .container > .d-flex > .d-flex:first-child {
        width: 100% !important;
        justify-content: flex-start !important;
    }

    nav.navbar .container > .d-flex > .d-flex:last-child {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    nav.navbar .compact-text,
    nav.navbar .d-none.d-md-inline {
        display: none !important;
    }

    nav.navbar .navbar-brand {
        font-size: 14px !important;
        max-width: calc(100vw - 55px) !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    nav.navbar .logo-box {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
    }

    nav.navbar .btn-login {
        width: 100% !important;
        min-width: 0 !important;
        padding: 8px 4px !important;
        font-size: 10.5px !important;
        border-radius: 9px !important;
        justify-content: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

@media screen and (max-width: 430px) {
    nav.navbar .container > .d-flex > .d-flex:last-child {
        grid-template-columns: 1fr !important;
    }

    nav.navbar .btn-login {
        font-size: 12px !important;
        padding: 9px 10px !important;
    }
}
