/* ==========================================================================
   SAFETY INDICATOR DASHBOARD - MAIN STYLESHEET
   Version: 3.0 Final
   Author: AF - Department QHSEF
   PT. Citra Lampia Mandiri
   ========================================================================== */

/* ==========================================================================
   1. RESET & BASE
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ==========================================================================
   2. TYPOGRAPHY & HEADER
   ========================================================================== */
h1 {
    color: white;
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.h1-with-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: white;
    text-align: center;
    margin-bottom: 10px;
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    flex-wrap: wrap;
}

.h1-logo {
    height: 45px;
    width: auto;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
}

.subtitle {
    color: rgba(255,255,255,0.9);
    text-align: center;
    margin-bottom: 30px;
    font-style: italic;
}

/* ==========================================================================
   3. TAB NAVIGATION - GLASSMORPHISM PRO (MOBILE FRIENDLY)
   ========================================================================== */
.tab-navigation {
    display: flex;
    gap: 6px;
    margin-bottom: 30px;
    justify-content: flex-start;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(16px);
    border-radius: 50px;
    padding: 8px 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
}

/* Custom scrollbar untuk tab navigation */
.tab-navigation::-webkit-scrollbar {
    height: 4px;
}

.tab-navigation::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.tab-navigation::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 10px;
}

.tab-btn {
    padding: 8px 18px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    border-radius: 40px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Style untuk icon image */
.tab-icon-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.tab-icon {
    font-size: 1em;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateY(-1px);
}

.tab-btn:hover .tab-icon-img {
    transform: scale(1.1) rotate(3deg);
}

.tab-btn:hover .tab-icon {
    transform: scale(1.1) rotate(3deg);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.tab-btn.active .tab-icon-img {
    transform: scale(1.05);
    animation: iconPop 0.3s ease;
}

.tab-btn.active .tab-icon {
    transform: scale(1.05);
    animation: iconPop 0.3s ease;
}

@keyframes iconPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1.05); }
}

/* ==========================================================================
   4. CARDS
   ========================================================================== */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 25px;
    margin-bottom: 30px;
    backdrop-filter: blur(5px);
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
    display: inline-block;
}

/* YTD Card */
.ytd-card {
    background: linear-gradient(135deg, rgba(102,126,234,0.95) 0%, rgba(118,75,162,0.95) 100%);
    backdrop-filter: blur(10px);
    color: white;
}

.ytd-card h3 {
    color: white;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255,255,255,0.3);
    padding-bottom: 10px;
}

.ytd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.ytd-item {
    background: rgba(255, 255, 255, 0.12);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.ytd-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.ytd-item label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    opacity: 0.9;
}

.ytd-value {
    display: block;
    font-size: 20px;
    font-weight: bold;
}

/* Info Card */
.info-card {
    background: rgba(245, 247, 250, 0.95);
    backdrop-filter: blur(5px);
    border-left: 5px solid #667eea;
}

.info-card h3 {
    color: #333;
    margin-bottom: 15px;
}

/* ==========================================================================
   5. FORM STYLES
   ========================================================================== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

.form-group input {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[type="number"] {
    text-align: right;
}

.form-select {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background-color: white;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.required {
    color: #dc3545;
}

.note {
    font-size: 12px;
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

/* ==========================================================================
   6. PREVIEW SECTION
   ========================================================================== */
.preview-section {
    background: rgba(248, 249, 250, 0.9);
    backdrop-filter: blur(5px);
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
}

.preview-section h4 {
    color: #667eea;
    margin-bottom: 15px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.preview-item {
    background: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.preview-item label {
    display: block;
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
    font-size: 12px;
}

.preview-item span {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
}

/* Preview Total */
.preview-total {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
}

.preview-total span {
    font-size: 36px;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.preview-detail {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.preview-detail span {
    font-size: 14px;
}

.preview-detail strong {
    color: #667eea;
    font-size: 18px;
    margin-left: 8px;
}

/* ==========================================================================
   7. BUTTONS
   ========================================================================== */
.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-edit, .btn-delete {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    margin: 0 2px;
    transition: all 0.3s;
}

.btn-edit {
    background-color: #ffc107;
    color: #333;
}

.btn-edit:hover {
    background-color: #e0a800;
    transform: scale(1.05);
}

.btn-delete {
    background-color: #dc3545;
    color: white;
}

.btn-delete:hover {
    background-color: #c82333;
    transform: scale(1.05);
}

/* ==========================================================================
   8. ALERTS
   ========================================================================== */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease-out;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   9. TABLES
   ========================================================================== */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.data-table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

.auto-col {
    background-color: rgba(102, 126, 234, 0.1);
}

.auto-value {
    font-family: monospace;
    font-weight: bold;
    color: #667eea;
}

.table-note {
    margin-top: 10px;
    font-size: 11px;
    color: #666;
    font-style: italic;
}

/* ==========================================================================
   10. FORMULAS & INFO
   ========================================================================== */
.formula-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.formula-item {
    background: white;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-family: monospace;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.formula-item strong {
    color: #667eea;
    display: block;
    margin-bottom: 5px;
}

.note-formula {
    margin-top: 15px;
    font-size: 12px;
    color: #666;
    font-style: italic;
    padding: 8px;
    background: #fff3cd;
    border-radius: 5px;
}

/* ==========================================================================
   11. KATEGORI KECELAKAAN
   ========================================================================== */
.kategori-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.kategori-item {
    padding: 15px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.kategori-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.kategori-item.matix {
    border-left: 5px solid #dc3545;
    background: linear-gradient(135deg, #fff 0%, #fff5f5 100%);
}

.kategori-item.berat {
    border-left: 5px solid #ff9f2e;
    background: linear-gradient(135deg, #fff 0%, #fff8f0 100%);
}

.kategori-item.ringan {
    border-left: 5px solid #ffcd56;
    background: linear-gradient(135deg, #fff 0%, #fffef5 100%);
}

.kategori-item strong {
    font-size: 16px;
    display: block;
    margin-bottom: 8px;
}

.kategori-item p {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* ==========================================================================
   12. KATEGORI KEJADIAN BERBAHAYA
   ========================================================================== */
.kategori-grid-kejadian {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.kategori-kejadian {
    padding: 12px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.kategori-kejadian:hover {
    transform: translateY(-3px);
}

.kategori-kejadian.longsor { border-top: 4px solid #dc3545; background: linear-gradient(135deg, #fff 0%, #fff5f5 100%); }
.kategori-kejadian.interaksi { border-top: 4px solid #36a2eb; background: linear-gradient(135deg, #fff 0%, #f0f8ff 100%); }
.kategori-kejadian.terjatuh { border-top: 4px solid #4bc0c0; background: linear-gradient(135deg, #fff 0%, #f0fffa 100%); }
.kategori-kejadian.tergelincir { border-top: 4px solid #ffcd56; background: linear-gradient(135deg, #fff 0%, #fffef0 100%); }
.kategori-kejadian.terbalik { border-top: 4px solid #9966ff; background: linear-gradient(135deg, #fff 0%, #f5f0ff 100%); }
.kategori-kejadian.terperosok { border-top: 4px solid #ff9f40; background: linear-gradient(135deg, #fff 0%, #fff8f0 100%); }

.kategori-kejadian strong {
    font-size: 14px;
    display: block;
    margin-bottom: 5px;
}

.kategori-kejadian p {
    font-size: 11px;
    color: #666;
    margin: 0;
}

/* ==========================================================================
   13. PENGALAMAN KATEGORI
   ========================================================================== */
.pengalaman-kategori-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.pengalaman-kategori {
    padding: 12px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.pengalaman-kategori:hover {
    transform: translateX(5px);
}

.pengalaman-kategori strong {
    font-size: 14px;
    display: block;
    margin-bottom: 8px;
}

.pengalaman-kategori p {
    font-size: 11px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* ==========================================================================
   14. INVESTIGASI PENYEBAB
   ========================================================================== */
.sub-section {
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 15px;
}

.sub-section-title {
    font-size: 16px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: inline-block;
}

.kondisi-title {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.tindakan-title {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #333;
}

/* ==========================================================================
   15. FORM GRIDS
   ========================================================================== */
.investigasi-form-grid,
.pengalaman-form-grid,
.perusahaan-form-grid,
.lokasi-form-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(248, 249, 250, 0.5);
    border-radius: 10px;
}

.investigasi-form-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.pengalaman-form-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.perusahaan-form-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    max-height: 400px;
    overflow-y: auto;
}

.lokasi-form-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    max-height: 400px;
    overflow-y: auto;
}

.investigasi-form-grid .form-group,
.pengalaman-form-grid .form-group,
.perusahaan-form-grid .form-group,
.lokasi-form-grid .form-group {
    background: white;
    padding: 10px;
    border-radius: 8px;
    margin: 0;
}

.investigasi-form-grid .form-group label,
.pengalaman-form-grid .form-group label,
.perusahaan-form-grid .form-group label,
.lokasi-form-grid .form-group label {
    font-size: 12px;
    margin-bottom: 5px;
}

/* Scrollbar untuk grids */
.perusahaan-form-grid::-webkit-scrollbar,
.lokasi-form-grid::-webkit-scrollbar {
    width: 8px;
}

.perusahaan-form-grid::-webkit-scrollbar-track,
.lokasi-form-grid::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 10px;
}

.perusahaan-form-grid::-webkit-scrollbar-thumb,
.lokasi-form-grid::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

/* ==========================================================================
   16. TOP PERUSAHAAN
   ========================================================================== */
.top-perusahaan {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.top-item {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.top-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.top-rank {
    width: 50px;
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.top-name {
    flex: 1;
    min-width: 200px;
    font-weight: 600;
    color: #333;
}

.top-count {
    width: 120px;
    text-align: right;
    font-weight: bold;
    color: #667eea;
}

.top-bar {
    flex: 2;
    min-width: 150px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.top-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* ==========================================================================
   17. HEATMAP TABLE
   ========================================================================== */
.heatmap-container {
    overflow-x: auto;
    margin-top: 15px;
}

.heatmap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.heatmap-table th,
.heatmap-table td {
    padding: 8px 6px;
    text-align: center;
    border: 1px solid #ddd;
}

.heatmap-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: sticky;
    top: 0;
}

.heatmap-total-row {
    background: #f0f0f0;
    font-weight: bold;
}

.heatmap-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* ==========================================================================
   18. FOOTER
   ========================================================================== */
.main-footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    margin-top: 50px;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 40px 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-section h4 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.footer-icon {
    font-size: 32px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-logo h4 {
    margin-bottom: 0;
    color: #667eea;
}

.footer-logo h4::after {
    display: none;
}

.footer-desc {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.8;
}

.footer-links,
.footer-contact,
.footer-hours {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li,
.footer-contact li,
.footer-hours li {
    margin-bottom: 10px;
    font-size: 13px;
}

.footer-links a {
    color: #e0e0e0;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: #667eea;
    transform: translateX(5px);
}

.contact-icon {
    display: inline-block;
    width: 24px;
    font-size: 14px;
}

.footer-hours li {
    opacity: 0.8;
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.copyright p {
    font-size: 13px;
    opacity: 0.7;
}

.developer {
    text-align: center;
}

.developer p {
    font-size: 13px;
    margin: 2px 0;
}

.developer-name {
    color: #667eea;
    font-size: 14px;
    letter-spacing: 1px;
}

.department {
    opacity: 0.7;
    font-size: 11px;
}

.footer-version p {
    font-size: 11px;
    opacity: 0.5;
}

/* ==========================================================================
   19. RESPONSIVE (MASTER) - LAPTOP, TABLET, MOBILE
   ========================================================================== */
/* Laptop (1024px - 1366px) */
@media (min-width: 1025px) and (max-width: 1366px) {
    .container {
        max-width: 1200px;
    }
    
    .card {
        padding: 20px;
    }
    
    .ytd-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

/* Tablet (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    body {
        padding: 15px;
    }
    
    .card {
        padding: 20px;
    }
    
    .ytd-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    
    .tab-navigation {
        gap: 5px;
        padding: 8px 10px;
    }
    
    .tab-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .tab-btn span:last-child {
        font-size: 12px;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 0;
    }
    
    .card {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .card h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    h1, .h1-with-logo {
        font-size: 1.5em;
        gap: 8px;
    }
    
    .h1-logo {
        height: 35px;
    }
    
    .tab-navigation {
        gap: 5px;
        padding: 6px 10px;
        border-radius: 40px;
        margin-bottom: 20px;
    }
    
    .tab-btn {
        padding: 7px 14px;
        font-size: 12px;
        gap: 5px;
    }
    
    .tab-icon {
        font-size: 0.95em;
    }
    
    .tab-icon-img {
        width: 16px;
        height: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .preview-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-detail {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .preview-total span {
        font-size: 28px;
    }
    
    .ytd-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .ytd-value {
        font-size: 18px;
    }
    
    .formula-grid {
        grid-template-columns: 1fr;
    }
    
    .kategori-grid,
    .kategori-grid-kejadian,
    .pengalaman-kategori-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .investigasi-form-grid,
    .pengalaman-form-grid,
    .perusahaan-form-grid,
    .lokasi-form-grid {
        grid-template-columns: 1fr;
        max-height: 250px;
        padding: 10px;
    }
    
    .data-table {
        font-size: 10px;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 4px;
    }
    
    .heatmap-table {
        font-size: 9px;
    }
    
    .heatmap-table th,
    .heatmap-table td {
        padding: 4px 2px;
    }
    
    .top-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .top-rank {
        width: auto;
        font-size: 20px;
    }
    
    .top-name {
        min-width: auto;
        font-size: 13px;
    }
    
    .top-count {
        width: auto;
        text-align: left;
        font-size: 12px;
    }
    
    .top-bar {
        width: 100%;
    }
    
    .sub-section {
        padding: 10px;
    }
    
    .sub-section-title {
        font-size: 14px;
        padding: 5px 12px;
    }
    
    .btn {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .btn-edit, .btn-delete {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 30px 20px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .footer-section h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
}

/* Mobile Small (max-width: 480px) */
@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    
    .card {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .card h2 {
        font-size: 1.1em;
        margin-bottom: 12px;
    }
    
    h1, .h1-with-logo {
        font-size: 1.2em;
        flex-direction: column;
        gap: 5px;
    }
    
    .h1-logo {
        height: 30px;
    }
    
    .subtitle {
        font-size: 11px;
        margin-bottom: 20px;
    }
    
    .tab-navigation {
        gap: 4px;
        padding: 5px 8px;
        border-radius: 30px;
        margin-bottom: 15px;
    }
    
    .tab-btn {
        padding: 5px 10px;
        font-size: 10px;
        gap: 4px;
    }
    
    /* Sembunyikan teks pada layar sangat kecil, tampilkan icon saja */
    .tab-btn span:last-child {
        display: none;
    }
    
    .tab-btn {
        padding: 6px 10px;
    }
    
    .tab-icon {
        font-size: 1.1em;
        margin: 0;
    }
    
    .tab-icon-img {
        width: 18px;
        height: 18px;
    }
    
    .ytd-item {
        padding: 8px;
    }
    
    .ytd-value {
        font-size: 16px;
    }
    
    .ytd-item label {
        font-size: 9px;
    }
    
    .preview-total span {
        font-size: 24px;
    }
    
    .preview-detail strong {
        font-size: 16px;
    }
    
    .form-group label {
        font-size: 12px;
    }
    
    .form-group input, .form-select {
        padding: 8px;
        font-size: 12px;
    }
    
    .data-table {
        font-size: 9px;
    }
    
    .data-table th,
    .data-table td {
        padding: 4px 2px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .sub-section-title {
        font-size: 12px;
    }
    
    .developer p {
        font-size: 10px;
    }
    
    .footer-version p {
        font-size: 9px;
    }
}

/* Touch device optimization */
@media (hover: none) and (pointer: coarse) {
    .tab-btn {
        padding: 8px 16px;
    }
    
    .tab-btn:active {
        transform: scale(0.96);
        background: rgba(255, 255, 255, 0.2);
    }
    
    .btn:active {
        transform: scale(0.96);
    }
}

/* ==========================================================================
   20. PRINT STYLES
   ========================================================================== */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .tab-navigation,
    .form-buttons,
    .btn-edit,
    .btn-delete,
    .alert,
    .main-footer {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
        background: white;
    }
    
    .data-table {
        font-size: 10px;
    }
    
    .data-table thead {
        background: #667eea;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .ytd-card {
        background: #667eea;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ==========================================================================
   21. UTILITIES
   ========================================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-5 { margin-top: 5px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

.mb-5 { margin-bottom: 5px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.hidden { display: none; }
.visible { display: block; }

.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

/* ==========================================================================
   END OF STYLESHEET
   ========================================================================== */