/* ===================================================
   RESET & BASE STYLES
   =================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ===================================================
   HEADER
   =================================================== */
header {
    background: linear-gradient(135deg, #1a2980 0%, #26d0ce 100%);
    color: white;
    padding: 25px 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

header p {
    opacity: 0.9;
    font-size: 14px;
}

/* ===================================================
   BUTTONS - GLOBAL (Enhanced)
   =================================================== */
.btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    text-align: center;
    min-width: 140px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: scale(0.97);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    min-width: auto;
}

.btn-refresh {
    background: linear-gradient(135deg, #1a2980 0%, #26d0ce 100%);
    color: white;
}

.btn-refresh:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 41, 128, 0.3);
}

.btn-export {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-clear {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.btn-clear:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.btn-logout {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.btn-add {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 10px 20px;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.btn-add-location {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

.btn-add-location:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #4c84ff 0%, #2c5ccf 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 132, 255, 0.3);
}

.btn-submit {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* ===================================================
   UPLOAD SECTION
   =================================================== */
.upload-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.upload-section h2 {
    margin-bottom: 10px;
    color: #333;
}

.btn-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ===================================================
   MESSAGES
   =================================================== */
.message {
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
}

.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.info {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* ===================================================
   UPDATE INFO
   =================================================== */
.update-info {
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #10ac84;
}

.update-info h3 {
    margin-bottom: 10px;
    color: #10ac84;
}

.update-info p {
    margin: 5px 0;
    font-size: 13px;
}

/* ===================================================
   STATS CONTAINER
   =================================================== */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaeaea;
}

.stat-section h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
    border-bottom: 2px solid #4c84ff;
    padding-bottom: 8px;
}

.stat-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    flex: 1 1 calc(50% - 12px);
    min-width: 140px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
    border-left: 4px solid #4c84ff;
}

.stat-card h3 {
    margin-bottom: 8px;
    color: #495057;
    font-size: 12px;
    font-weight: 600;
}

.stat-card .value {
    font-size: 18px;
    font-weight: bold;
    color: #4c84ff;
}

/* ===================================================
   WILAYAH STATS
   =================================================== */
.wilayah-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
}

.wilayah-stat-card {
    flex: 1 1 calc(33.333% - 12px);
    min-width: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wilayah-stat-card h4 {
    margin-bottom: 6px;
    font-size: 12px;
    opacity: 0.9;
    font-weight: 600;
}

.wilayah-stat-card .value {
    font-size: 16px;
    font-weight: bold;
}

/* ===================================================
   VISUALIZATION SECTION & TABS
   =================================================== */
.visualization-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    color: #495057;
}

.tab:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.tab.active {
    background: #4c84ff;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===================================================
   TABLE CONTROLS & FILTERS
   =================================================== */
.table-controls {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.filter-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: 600;
    font-size: 13px;
    color: #495057;
}

.filter-select,
.search-box,
.date-filter {
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
}

.filter-select:focus,
.search-box:focus,
.date-filter:focus {
    outline: none;
    border-color: #4c84ff;
    box-shadow: 0 0 0 3px rgba(76, 132, 255, 0.1);
}

.date-filter-group {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.date-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
    flex-wrap: wrap;
}

.filter-buttons .btn {
    min-width: 120px;
    padding: 8px 16px;
    font-size: 13px;
}

/* ===================================================
   SUMMARY SECTION
   =================================================== */
.summary-section {
    background: #e8f5e8;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    border-left: 4px solid #28a745;
}

.summary-section h4 {
    margin-bottom: 10px;
    color: #155724;
    font-size: 14px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.summary-item {
    background: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #dee2e6;
}

.summary-label {
    font-size: 11px;
    color: #6c757d;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.summary-value {
    font-size: 18px;
    font-weight: bold;
    color: #28a745;
}

.summary-original {
    font-size: 10px;
    color: #6c757d;
}

/* ===================================================
   TABLE STYLES
   =================================================== */
.table-container {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin: 15px 0;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    table-layout: auto;
    min-width: 1000px;
}

table, th, td {
    border: 1px solid #dee2e6;
}

th, td {
    padding: 8px 6px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}

th:nth-child(1), td:nth-child(1) { min-width: 130px; }
th:nth-child(2), td:nth-child(2) { min-width: 100px; }
th:nth-child(3), td:nth-child(3) { min-width: 80px; }
th:nth-child(4), td:nth-child(4) { min-width: 60px; }
th:nth-child(5), td:nth-child(5) { min-width: 180px; }
th:nth-child(6), td:nth-child(6) { min-width: 70px; }
th:nth-child(7), td:nth-child(7) { min-width: 85px; }
th:nth-child(8), td:nth-child(8) { min-width: 100px; }
th:nth-child(9), td:nth-child(9) { min-width: 100px; }
th:nth-child(10), td:nth-child(10) { min-width: 140px; }

th {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    position: sticky;
    top: 0;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    z-index: 10;
    font-size: 13px;
}

th:hover {
    background: linear-gradient(135deg, #5a0db5 0%, #1c68e8 100%);
}

th.sort-asc::after {
    content: " ↑";
    font-weight: bold;
}

th.sort-desc::after {
    content: " ↓";
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #e3f2fd;
    transition: all 0.2s ease;
}

.btn-download {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 75px;
    margin: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-download:hover {
    background: linear-gradient(135deg, #218838 0%, #166b2c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.btn-download:active {
    transform: translateY(0px);
}

.btn-download:disabled {
    background: linear-gradient(135deg, #adb5bd 0%, #6c757d 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

.btn-download-small {
    padding: 5px 10px;
    font-size: 11px;
    min-width: 70px;
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-download-small:hover {
    background: linear-gradient(135deg, #218838 0%, #166b2c 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(40, 167, 69, 0.25);
}

.btn-download-small:active {
    transform: translateY(0px);
}

.btn-download-small:disabled,
.btn-download-small.disabled {
    background: linear-gradient(135deg, #adb5bd 0%, #6c757d 100%);
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

.btn-detail-sanksi {
    background: linear-gradient(135deg, #4c84ff 0%, #2c5ccf 100%);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-detail-sanksi:hover {
    background: linear-gradient(135deg, #3b6fe8 0%, #234bb3 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(76, 132, 255, 0.3);
}

.btn-detail-sanksi:active {
    transform: translateY(0px);
}

#sanksi-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

#sanksi-table td:nth-child(1) {
    text-align: center;
    width: 50px;
}

#sanksi-table td:nth-child(5) {
    white-space: nowrap;
    text-align: center;
}

#riwayat-sanksi-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

#riwayat-sanksi-table th,
#riwayat-sanksi-table td {
    padding: 10px 8px;
    font-size: 12px;
}

#riwayat-sanksi-table td:nth-child(1) {
    text-align: center;
    width: 40px;
}

#riwayat-sanksi-table td:nth-child(5) {
    max-width: 200px;
    word-break: break-word;
}

.table-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding: 8px;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 13px;
    flex-wrap: wrap;
    gap: 8px;
}

td:nth-child(5) {
    max-width: 180px;
}

td:nth-child(6),
td:nth-child(7),
td:nth-child(8),
td:nth-child(9) {
    text-align: right;
}

td:last-child {
    white-space: nowrap;
    text-align: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .status-badge {
        padding: 3px 8px;
        font-size: 10px;
        gap: 4px;
    }
}

.status-sanksi-lisan {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.status-sanksi-tertulis-sp-1,
.status-sanksi-tertulis-sp-2,
.status-sanksi-tertulis-sp-3 {
    background: #ffe5d0;
    border-color: #ffd7b5;
    color: #d35400;
}

.status-pemberhentian-sementara {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.status-pemberhentian-tetap {
    background: #f5c6cb;
    border-color: #e6b3b9;
    color: #721c24;
}

/* ===================================================
   CHARTS - DIPERBAIKI DENGAN DESAIN DARI V7 (PIE CHART LEBIH MENARIK)
   =================================================== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

@media (max-width: 1100px) {
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

.chart-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.chart-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.chart-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a2980;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid #4c84ff;
    display: inline-block;
    align-self: flex-start;
}

.chart-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    height: auto;
    margin: 20px 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container canvas {
    max-width: 100%;
    height: auto !important;
    width: 100% !important;
    display: block;
}

/* Ukuran khusus untuk chart */
#aktaChart {
    height: 380px !important;
    width: 100% !important;
}

#wilayahChart {
    height: 380px !important;
    width: 100% !important;
}

.chart-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 15px;
}

.chart-stat-item {
    text-align: center;
    flex: 1;
    min-width: 100px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
}

.chart-stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #4c84ff;
}

.chart-stat-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    margin-top: 5px;
    font-weight: 600;
}

/* Responsive untuk berbagai ukuran layar */
@media (max-width: 1200px) {
    .charts-grid {
        gap: 25px;
    }
    #aktaChart, #wilayahChart {
        height: 360px !important;
    }
}

@media (max-width: 992px) {
    .charts-grid {
        gap: 20px;
    }
    #aktaChart, #wilayahChart {
        height: 340px !important;
    }
}

@media (max-width: 768px) {
    .chart-card {
        padding: 20px;
    }
    #aktaChart, #wilayahChart {
        height: 320px !important;
    }
    .chart-stat-value {
        font-size: 22px;
    }
    .chart-stat-label {
        font-size: 11px;
    }
    .chart-title {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .chart-card {
        padding: 15px;
    }
    #aktaChart, #wilayahChart {
        height: 280px !important;
    }
    .chart-stats {
        gap: 10px;
    }
    .chart-stat-item {
        min-width: 80px;
        padding: 8px;
    }
    .chart-stat-value {
        font-size: 18px;
    }
    .chart-stat-label {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    #aktaChart, #wilayahChart {
        height: 250px !important;
    }
}

/* ===================================================
   MAP STYLES - ENHANCED & FIXED FOR RESPONSIVE
   =================================================== */
.map-container {
    background: #e8eaef;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaeaea;
    position: relative;
    width: 100%;
    min-height: 100%;
    height: 100%;
}

#map {
    height: 100%;
    width: 100%;
    border-radius: 12px;
    z-index: 1;
    background: #e8eaef;
    position: relative;
}

/* Force Leaflet container to have proper dimensions */
.leaflet-container {
    height: 100%;
    width: 100%;
    background: #e8eaef;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-map-pane {
    position: absolute;
    left: 0;
    top: 0;
}

.leaflet-tile-pane {
    filter: none !important;
}

.leaflet-container {
    background: #e8eaef;
}

.leaflet-tile {
    filter: brightness(1) contrast(1) saturate(1) !important;
}

.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 12px;
}

.map-loading-spinner {
    text-align: center;
}

.map-loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #4c84ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

.map-loading-spinner p {
    color: #4c84ff;
    font-size: 13px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.map-sidebar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaeaea;
    margin-top: 0;
}

.map-sidebar h3 {
    color: #4c84ff;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.map-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
}

.map-filter-section {
    margin-bottom: 20px;
}

.map-filter-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    color: #495057;
}

.map-filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 0;
}

.map-filter-select:focus {
    outline: none;
    border-color: #4c84ff;
    box-shadow: 0 0 0 3px rgba(76, 132, 255, 0.1);
}

.map-search-group {
    margin-top: 10px;
    margin-bottom: 15px;
}

.map-search-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #495057;
    font-size: 13px;
}

.map-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.map-search-input:focus {
    outline: none;
    border-color: #4c84ff;
    box-shadow: 0 0 0 3px rgba(76, 132, 255, 0.1);
}

.btn-map {
    background: linear-gradient(135deg, #4c84ff 0%, #2c5ccf 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 10px;
}

.btn-map:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 132, 255, 0.3);
}

.btn-map-refresh {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.btn-map-refresh:hover {
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-map-add {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #333;
}

.btn-map-add:hover {
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
}

.map-info-badge {
    background: #e8f0fe;
    padding: 10px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 12px;
    color: #4c84ff;
    text-align: center;
}

.map-locations-list {
    max-height: 350px;
    overflow-y: auto;
}

.map-location-item {
    background: white;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 3px solid #4c84ff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.map-location-item:hover {
    background: #e8f0fe;
    transform: translateX(5px);
}

.map-location-name {
    font-weight: bold;
    color: #4c84ff;
    margin-bottom: 5px;
}

.map-location-kab {
    font-size: 12px;
    color: #5f6368;
}

.custom-popup {
    min-width: 220px;
}

.custom-popup strong {
    color: #4c84ff;
}

.custom-popup a {
    color: #4c84ff;
    text-decoration: none;
}

.custom-popup a:hover {
    text-decoration: underline;
}

.total-locations-counter {
    background: linear-gradient(135deg, #4c84ff 0%, #2c5ccf 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.total-locations-counter .counter-label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.total-locations-counter .counter-number {
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
}

.total-locations-counter .counter-sub {
    font-size: 11px;
    opacity: 0.8;
    margin-top: 5px;
}

/* ===================================================
   MODAL STYLES
   =================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 700px;
    width: 90%;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 18px 24px;
    background: linear-gradient(135deg, #1a2980 0%, #26d0ce 100%);
    color: white;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    line-height: 20px;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 16px 16px;
    text-align: right;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ===================================================
   FORM STYLES
   =================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group label .required {
    color: #dc3545;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="file"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4c84ff;
    box-shadow: 0 0 0 3px rgba(76, 132, 255, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #666;
    font-size: 12px;
}

/* ===================================================
   AUTOCOMPLETE STYLES
   =================================================== */
.autocomplete {
    position: relative;
    display: inline-block;
    width: 100%;
}

.autocomplete-items {
    position: absolute;
    border: 1px solid #d4d4d4;
    border-bottom: none;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 10px 10px;
}

.autocomplete-items div {
    padding: 10px 14px;
    cursor: pointer;
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

.autocomplete-items div:hover {
    background-color: #e8f0fe;
}

.autocomplete-active {
    background-color: #4c84ff !important;
    color: white;
}

.wilayah-loading {
    display: none;
    color: #4c84ff;
    font-size: 12px;
    margin-top: 5px;
}

.wilayah-loading:before {
    content: "⏳";
    margin-right: 5px;
}

.autocomplete-lokasi {
    position: relative;
    width: 100%;
}

.autocomplete-lokasi .autocomplete-items {
    position: absolute;
    border: 1px solid #d4d4d4;
    border-bottom: none;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 10px 10px;
}

.autocomplete-lokasi .autocomplete-items div {
    padding: 10px 14px;
    cursor: pointer;
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

.autocomplete-lokasi .autocomplete-items div:hover {
    background-color: #e8f0fe;
}

/* ===================================================
   LOADING SPINNER
   =================================================== */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4c84ff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #4c84ff;
}

/* ===================================================
   RESPONSIVE DESIGN - ENHANCED
   =================================================== */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    .stats-container {
        grid-template-columns: 1fr;
    }
    .filter-section {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    .map-grid {
        grid-template-columns: 1fr;
    }
    .map-container {
        min-height: 100%;
    }
    #map {
        height: 100%;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 22px;
    }
    .btn-container {
        flex-direction: column;
        gap: 10px;
    }
    .btn {
        width: 100%;
        min-width: unset;
    }
    .filter-section {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .date-filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-buttons {
        flex-direction: column;
    }
    .filter-buttons .btn {
        width: 100%;
    }
    .table-info {
        flex-direction: column;
        text-align: center;
    }
    .map-container {
        min-height: 100%;
    }
    #map {
        height: 100%;
    }
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    .modal-body {
        padding: 16px;
        max-height: 55vh;
    }
    .modal-footer {
        flex-direction: column;
    }
    .modal-footer .btn {
        width: 100%;
    }
    .stat-cards {
        flex-direction: column;
    }
    .stat-card {
        flex: 1 1 100%;
    }
    .wilayah-stats {
        flex-direction: column;
    }
    .wilayah-stat-card {
        flex: 1 1 100%;
    }
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

@media (max-width: 100%) {
    .map-container {
        min-height: 100%;
    }
    #map {
        height: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    header {
        padding: 15px;
    }
    header h1 {
        font-size: 18px;
    }
    .tab {
        padding: 8px 16px;
        font-size: 12px;
    }
    .map-container {
        min-height: 100%;
    }
    #map {
        height: 100%;
    }
    th, td {
        padding: 6px 4px;
        font-size: 10px;
    }
    .stat-card .value {
        font-size: 16px;
    }
    .summary-value {
        font-size: 14px;
    }
    .btn-download-small {
        padding: 4px 8px;
        font-size: 10px;
        min-width: 60px;
    }
    .btn-detail-sanksi {
        padding: 4px 8px;
        font-size: 10px;
    }
    table {
        min-width: 750px;
    }
    #sanksi-table {
        min-width: 600px;
    }
}

/* ===================================================
   UTILITIES & MISC
   =================================================== */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 10px;
}

.mb-2 {
    margin-bottom: 10px;
}

.hidden {
    display: none;
}

.popup-open-map-btn {
    display: inline-block;
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    text-align: center;
    transition: all 0.2s ease;
}

.popup-open-map-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #166b2c 100%);
    transform: translateY(-1px);
}