body {
    font-family: Arial, sans-serif;
    padding: 10px;
    max-width: 100%;
    overflow-x: hidden;
    background-color: #f5f5f5;
}

.section,
.card-form,
table,
.modal-content {
    margin-bottom: 15px;
    padding: 10px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-form {
    padding: 16px;
    max-width: 100%;
    margin: 12px auto;
    font-size: 14px;
}

.judul h2 {
    margin: 5px 0;
    padding: 5px;
    line-height: 1.2;
    text-align: center;
    color: #2c3e50;
}

label {
    font-size: 14px;
}

.tab {
    overflow: hidden;
    border: 1px solid #ccc;
    background-color: #f1f1f1;
    border-radius: 5px 5px 0 0;
}

.tab button {
    background-color: inherit;
    float: left;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 16px;
    transition: 0.3s;
    color: black;
    font-weight: bold;
}

.tab button:hover {
    background-color: #ddd;
}

.tab button.active {
    background-color: #2980b9;
    color: white;
}

.tabcontent {
    display: none;
    padding: 10px;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 5px 5px;
    background-color: white;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 14px;
    background-color: white;
}

th,
td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    white-space: nowrap;
}

th {
    background-color: #3498db;
    color: white;
}

.form-group input,
.optional-fields input {
    width: 100%;
    margin: 5px 0;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 13px;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    margin: 5px 0;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
}

button,
.small-btn {
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 5px;
    font-size: 14px;
    background-color: #27ae60;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e74c3c;
    padding: 4px 8px;
}

.small-btn {
    padding: 5px 8px;
    font-size: 12px;
}

button:hover {
    background-color: #219653;
}

.delete-btn,
.close-btn {
    background-color: #e74c3c;
}

.delete-btn:hover,
.close-btn:hover {
    background-color: #c0392b;
}

.edit-btn {
    background-color: #3498db;
}

.edit-btn:hover {
    background-color: #2980b9;
}

.export-btn {
    background-color: #f39c12;
}

.export-btn:hover {
    background-color: #e67e22;
}

.imp-btn {
    background-color: #ac2eb1;
}

.imp-btn:hover {
    background-color: #800ead;
}

.sync-btn {
    background-color: #1708ec;
}

.sync-btn:hover {
    background-color: #250c96;
}

.reset-btn {
    background-color: #95a5a6;
}

.reset-btn:hover {
    background-color: #7f8c8d;
}

.info-box {
    background-color: #e8f4fc;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    border-left: 4px solid #3498db;
}

.timestamp {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.flex-row-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.flex-row-mobile label {
    min-width: 90px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    margin: 50px auto;
    max-width: 95%;
    width: 600px;
    max-height: 80vh;
    overflow: auto;
    position: relative;
}

.dynamic-row {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
    align-items: center;
}

.dynamic-row input {
    flex: 1;
}

.summary-table {
    width: 100%;
    margin-bottom: 15px;
}

.summary-table th {
    background-color: #2c3e50;
}

.highlight {
    font-weight: bold;
    color: #e74c3c;
}

.pagination {
    display: flex;
    justify-content: center;
    margin: 10px 0;
    flex-wrap: wrap;
}

.pagination button {
    margin: 0 2px;
    padding: 5px 10px;
}

.search-container {
    display: flex;
    margin-bottom: 10px;
    gap: 10px;
    flex-wrap: wrap;
}

.search-container input {
    flex: 1;
    min-width: 200px;
}

.form-title {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 18px;
    font-size: 16px;
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group {
    margin-bottom: 5px;
}

.form-group label,
.optional-fields label {
    display: block;
    margin-bottom: 2px;
    color: #555;
    font-weight: 500;
    font-size: 13px;
}

.optional-fields {
    margin-top: 12px;
    grid-column: span 2;
}

.form-group input:focus,
.optional-fields input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    outline: none;
}

.responsive-table {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    max-height: 320px;
    transition: max-height 0.3s;
}

.responsive-table.expanded {
    max-height: none;
}

.table-toggle-btn {
    margin: 4px 0 10px 0;
    padding: 5px 15px;
    font-size: 13px;
    border-radius: 4px;
    border: none;
    background: #3498db;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.table-toggle-btn:hover {
    background: #217dbb;
}

/* Dark mode */
#darkModeToggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-mode #darkModeToggle {
    background-color: #e0e0e0;
    color: #333;
}

body.dark-mode {
    background-color: #121212 !important;
    color: #e0e0e0 !important;
}

body.dark-mode .section,
body.dark-mode .card-form,
body.dark-mode table,
body.dark-mode .modal-content {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
}

body.dark-mode th {
    background-color: #2c3e50 !important;
    color: #e0e0e0 !important;
}

body.dark-mode td {
    border-color: #444 !important;
}

body.dark-mode input[type="text"],
body.dark-mode input[type="number"],
body.dark-mode select,
body.dark-mode .form-group input,
body.dark-mode .optional-fields input {
    background-color: #333 !important;
    color: #e0e0e0 !important;
    border-color: #555 !important;
}

body.dark-mode .tab {
    background-color: #23272f !important;
    border-color: #444 !important;
}

body.dark-mode .tab button {
    background-color: #23272f !important;
    color: #e0e0e0 !important;
}

body.dark-mode .tab button:hover {
    background-color: #555 !important;
}

body.dark-mode .tab button.active {
    background-color: #5356b9 !important;
    color: white !important;
}

body.dark-mode .tabcontent {
    background-color: #1e1e1e !important;
    border-color: #444 !important;
}

body.dark-mode .info-box {
    background-color: #23292f !important;
    border-left-color: #5356b9 !important;
    color: #ececec !important;
}

body.dark-mode .modal {
    background-color: rgba(30, 32, 40, 0.8) !important;
}

body.dark-mode button,
body.dark-mode .close-btn,
body.dark-mode .small-btn {
    color: #fff !important;
}

body.dark-mode .judul h2,
body.dark-mode .timestamp,
body.dark-mode .form-title,
body.dark-mode .form-group label {
    color: #e0e0e0 !important;
}

body.dark-mode .delete-btn,
body.dark-mode .close-btn {
    background-color: #c0392b !important;
}

body.dark-mode .delete-btn:hover,
body.dark-mode .close-btn:hover {
    background-color: #a5281a !important;
}

body.dark-mode .edit-btn {
    background-color: #2980b9 !important;
}

body.dark-mode .edit-btn:hover {
    background-color: #1a6da3 !important;
}

body.dark-mode .export-btn {
    background-color: #e67e22 !important;
}

body.dark-mode .export-btn:hover {
    background-color: #d46a10 !important;
}

body.dark-mode .imp-btn {
    background-color: #800ead !important;
}

body.dark-mode .imp-btn:hover {
    background-color: #6e0096 !important;
}

body.dark-mode .sync-btn {
    background-color: #250c96 !important;
}

body.dark-mode .sync-btn:hover {
    background-color: #1a0770 !important;
}

body.dark-mode .reset-btn {
    background-color: #7f8c8d !important;
}

body.dark-mode .reset-btn:hover {
    background-color: #6c7a7b !important;
}

/* Sort No. Pokok Pada Tabel Verfifikasi */
.sortable-header {
    cursor: pointer;
    position: relative;
    padding-right: 20px !important;
}

.sortable-header::after {
    content: "⇅";
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
}

.sortable-header.asc::after {
    content: "↑";
}

.sortable-header.desc::after {
    content: "↓";
}

.print-btn {
    background-color: #f1c40f !important;
    color: #000 !important;
}

.print-btn:hover {
    background-color: #f39c12 !important;
}

body.dark-mode .print-btn {
    background-color: #f39c12 !important;
    color: #fff !important;
}

body.dark-mode .print-btn:hover {
    background-color: #e67e22 !important;
}

/* tracking */
#tracking-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 16px;
}

#tracking-section .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-width: 2px;
}

#tracking-section .btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#tracking-section .btn:active {
    transform: scale(0.95);
}

#tracking-section .btn-success {
    background-color: #28a745;
    border-color: #1e7e34;
}

#tracking-section .btn-warning {
    background-color: #ffc107;
    border-color: #d39e00;
    color: #212529;
}

#tracking-section .btn-danger {
    background-color: #dc3545;
    border-color: #bd2130;
}

#tracking-section .btn:disabled {
    opacity: 0.65;
    transform: none !important;
    box-shadow: none !important;
}

#tracking-section i {
    font-size: 1.1rem;
}

#tracking-status {
    font-size: 0.85rem;
    padding: 8px;
    border-radius: 6px;
    margin-top: 12px;
}


#geo-map {
    position: relative;
    /* pastikan tidak ada pointer-events:none di sini! */
    pointer-events: auto !important;
    touch-action: auto !important;
    -ms-touch-action: auto !important;
}

.leaflet-container {
    pointer-events: auto !important;
    touch-action: auto !important;
}

#mapCenterMarker {
    position: absolute;
    z-index: 800;
    left: 50%;
    top: 50%;
    width: 32px;
    height: 32px;
    margin-left: -16px;
    margin-top: -16px;
    pointer-events: none;
    /* KUNCI AGAR PETA TIDAK TERHALANG! */
    font-size: 32px;
    color: #1976d2;
    user-select: none;
}

/* Versi Mobile */
@media screen and (max-width: 600px) {
    table {
        font-size: 12px;
    }

    th,
    td {
        padding: 5px;
    }

    button {
        padding: 8px 10px;
        font-size: 12px;
    }

    .flex-row-mobile {
        flex-direction: row;
    }

    .flex-row-mobile label {
        font-size: 13px;
    }

    .flex-row-mobile input {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .form-grid {
        gap: 10px;
    }

    .form-group input {
        padding: 7px 9px;
    }
}