/* ============================
   MBG GIS - Custom Stylesheet
   ============================ */

:root {
    --sidebar-width: 250px;
    --primary: #198754;
    --primary-dark: #146c43;
    --bg-light: #f4f6f9;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg-light);
    margin: 0;
    overflow-x: hidden;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #198754 0%, #0f5132 100%);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s;
    z-index: 1030;
}

.sidebar.collapsed {
    margin-left: -250px;
}

.sidebar-header {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header i {
    font-size: 28px;
}

.sidebar-header h5 {
    font-weight: 700;
    margin: 0;
}

.sidebar-header small {
    opacity: 0.85;
    font-size: 11px;
}

.sidebar-menu {
    padding: 10px 0;
    margin: 0;
}

.sidebar-menu li.menu-title {
    padding: 12px 20px 6px;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.55);
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-menu li a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-left-color: #ffc107;
}

.sidebar-menu li.active a {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-left-color: #ffc107;
    font-weight: 600;
}

.sidebar-menu li a i {
    width: 20px;
    font-size: 16px;
}

/* === CONTENT === */
.content-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-wrapper.expanded {
    margin-left: 0;
}

.topbar {
    padding: 8px 20px;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.main-content {
    padding: 24px;
    flex: 1;
}

.footer-bar {
    border-top: 1px solid #e9ecef;
    background: #fff;
}

/* === CARDS === */
.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.stat-card .card-body {
    padding: 20px;
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
}

.stat-card .stat-value {
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 13px;
    margin: 0;
}

.bg-grad-green { background: linear-gradient(135deg, #198754, #20c997); }
.bg-grad-blue  { background: linear-gradient(135deg, #0d6efd, #6610f2); }
.bg-grad-orange { background: linear-gradient(135deg, #fd7e14, #ffc107); }
.bg-grad-red   { background: linear-gradient(135deg, #dc3545, #d63384); }
.bg-grad-cyan  { background: linear-gradient(135deg, #0dcaf0, #0d6efd); }
.bg-grad-purple { background: linear-gradient(135deg, #6f42c1, #d63384); }

.page-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.page-card .card-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 16px 20px;
    border-radius: 12px 12px 0 0 !important;
}

.page-card .card-header h5 {
    margin: 0;
    font-weight: 600;
}

/* === TABLE === */
.table-mbg {
    margin: 0;
}

.table-mbg thead th {
    background: #198754;
    color: #fff;
    font-weight: 600;
    border: none;
    white-space: nowrap;
}

.table-mbg tbody tr:hover {
    background: #f8f9fa;
}

.btn-action {
    padding: 4px 10px;
    font-size: 12px;
}

/* === MAP === */
#map, #map-mini {
    width: 100%;
    border-radius: 10px;
}

#map { height: 600px; }
#map-mini { height: 380px; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .sidebar { margin-left: -250px; }
    .sidebar.show { margin-left: 0; }
    .content-wrapper { margin-left: 0; }
}

/* Print: untuk laporan */
@media print {
    .sidebar, .topbar, .footer-bar, .no-print { display: none !important; }
    .content-wrapper { margin-left: 0 !important; }
    .main-content { padding: 0 !important; }
    body { background: #fff !important; }
}
