body, h1, h2, h3, h4, h5, h6, .btn, .form-control, table, th, td {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif !important;
}

body {
    font-size: 14.5px !important;
    letter-spacing: 0.2px;
}

body {
    font-family: 'Inter', sans-serif !important;
    background-color: #f4f6f9 !important; /* Modern softer background */
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Inter', sans-serif !important;
    font-weight: 600;
}

/* ========================================================
   CARDS / BOXES
   ======================================================== */
.box {
    border-radius: 12px;
    border-top: none !important; /* Remove legacy AdminLTE top border */
    box-shadow: 0 4px 20px rgba(0,0,0,0.04) !important;
    margin-bottom: 25px;
    border: 1px solid #edf2f7;
}
.box-header {
    border-bottom: 1px solid #edf2f7 !important;
    padding: 18px 20px;
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
}
.box-header.with-border {
    border-bottom: 1px solid #edf2f7;
}
.box-title {
    font-weight: 600;
    font-size: 1.15rem;
    color: #2c3e50;
}

/* ========================================================
   BUTTONS
   ======================================================== */
.btn {
    border-radius: 8px !important;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.2s ease-in-out;
    border: none;
    padding: 8px 16px;
}
.btn-primary, .btn-info, .btn-success, .btn-warning, .btn-danger {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}
/* Specifically target action buttons in tables to make them cute */
.btn-sm, .btn-group-sm>.btn {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px !important;
}

/* ========================================================
   INPUTS / FORMS
   ======================================================== */
.form-control {
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    padding: 10px 15px;
    height: auto !important;
    box-shadow: none !important;
    transition: all 0.2s;
    font-size: 14px;
}
.form-control.input-sm {
    padding: 5px 10px !important;
    font-size: 13px;
}
select.form-control {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}
.form-control:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}
label {
    font-weight: 500;
    color: #475569;
    margin-bottom: 8px;
}

/* ========================================================
   HEADER / NAVBAR
   ======================================================== */
.skin-blue .main-header .navbar,
.skin-blue .main-header .logo {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%) !important;
    color: white !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: none;
}
.skin-blue .main-header .logo:hover {
    background: #1e3a8a !important;
}
.skin-blue .main-header .navbar .sidebar-toggle:hover {
    background-color: rgba(255,255,255,0.15) !important;
}
.skin-blue .main-header li.user-header {
    background: #1e3a8a !important;
}

/* ========================================================
   SIDEBAR (Clean White SaaS Look)
   ======================================================== */
.skin-blue .main-sidebar {
    background-color: #ffffff !important;
    box-shadow: 2px 0 15px rgba(0,0,0,0.03);
    border-right: 1px solid #eff2f5;
}
.skin-blue .sidebar-menu>li.header {
    background: #ffffff !important;
    color: #94a3b8 !important;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 15px 15px 10px 20px;
}
.skin-blue .sidebar-menu>li>a {
    color: #475569 !important;
    font-weight: 500;
    border-radius: 8px;
    margin: 4px 15px;
    transition: all 0.2s;
}
.skin-blue .sidebar-menu>li:hover>a,
.skin-blue .sidebar-menu>li.active>a {
    background-color: #eff6ff !important;
    color: #1e3a8a !important;
    border-left-color: transparent !important;
}
.skin-blue .sidebar-menu>li:hover>a i,
.skin-blue .sidebar-menu>li.active>a i {
    color: #3b82f6 !important;
}
.skin-blue .sidebar-menu>li>.treeview-menu {
    background-color: #ffffff !important;
    margin: 0 15px;
    border-radius: 8px;
}
.skin-blue .treeview-menu>li>a {
    color: #64748b !important;
    padding-left: 20px;
}
.skin-blue .treeview-menu>li>a:hover {
    color: #3b82f6 !important;
}

/* Sidebar User Panel */
.user-panel>.info>p {
    color: #1e293b !important;
    font-weight: 600;
    margin-bottom: 2px;
}
.user-panel>.info>a {
    color: #64748b !important;
    font-size: 12px;
}

/* ========================================================
   TABLES / DATATABLES
   ======================================================== */
.table {
    margin-bottom: 0 !important;
}
table.dataTable {
    border-collapse: collapse !important;
}
table.dataTable thead th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0 !important;
    padding: 15px 12px;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}
table.dataTable tbody td {
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 12px;
    vertical-align: middle;
    color: #334155;
}
table.table-bordered {
    border: 1px solid #f1f5f9;
}
table.table-bordered>thead>tr>th, 
table.table-bordered>tbody>tr>td {
    border: none;
    border-bottom: 1px solid #f1f5f9;
}

/* ========================================================
   MISC
   ======================================================== */
.content-wrapper {
    background-color: #f4f6f9;
}
.info-box {
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04) !important;
    border: 1px solid #edf2f7;
    transition: transform 0.2s;
}
.info-box:hover {
    transform: translateY(-3px);
}
.info-box-icon {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* ========================================================
   TABLE ROW SHADING (Responsive Colors)
   ======================================================== */
/* Green Tint for Finished */
table.dataTable tbody tr.row-selesai > td,
table.dataTable tbody tr.row-selesai + tr.child > td {
    background-color: rgba(34, 197, 94, 0.08) !important;
}
/* Orange/Yellow Tint for In Progress */
table.dataTable tbody tr.row-proses > td,
table.dataTable tbody tr.row-proses + tr.child > td {
    background-color: rgba(245, 158, 11, 0.08) !important;
}
/* Red Tint for Non-Response/Anomaly */
table.dataTable tbody tr.row-nr > td,
table.dataTable tbody tr.row-nr + tr.child > td {
    background-color: rgba(239, 68, 68, 0.08) !important;
}

/* ========================================================
   ACTION BUTTONS WRAPPER
   ======================================================== */
table.dataTable td .btn, 
span.dtr-data .btn {
    margin-bottom: 5px !important;
    margin-right: 5px !important;
    display: inline-block;
}
/* Ensure the span containing the buttons in mobile view uses flex wrap for neatness */
table.dataTable>tbody>tr.child ul.dtr-details>li>span.dtr-data {
    display: inline-flex !important;
    flex-wrap: wrap;
    gap: 5px;
}

/* ========================================================
   RESPONSIVE TYPOGRAPHY & MOBILE FRIENDLY TWEAKS
   ======================================================== */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #334155;
    line-height: 1.5;
}

/* Base font sizes */
html {
    font-size: 16px; /* Base root for rem */
}

/* Form Inputs: Force 16px to prevent iOS auto-zoom bug on mobile */
.form-control, select.form-control, input.form-control, textarea.form-control {
    font-size: 16px !important;
}

/* Headings adjustment */
.box-title {
    font-size: 1.15rem;
}

/* Mobile specific tweaks */
@media (max-width: 768px) {
    html {
        font-size: 14.5px; /* Shrinks all rem-based typography slightly on mobile */
    }
    
    /* Make table content highly legible but compact on narrow screens */
    table.dataTable tbody td {
        font-size: 0.95rem; 
        padding: 10px 8px; /* Slightly less padding */
    }
    
    table.dataTable thead th {
        font-size: 0.85rem;
        padding: 12px 8px;
    }
    
    /* Buttons in mobile should be easy to tap (min height for fat fingers) */
    .btn {
        padding: 10px 15px; /* Larger tap target */
        font-size: 0.95rem;
    }
    .btn-sm, .btn-group-sm>.btn {
        padding: 8px 12px !important; 
        font-size: 0.85rem !important;
    }
    
    /* Dropdown text wrapping gracefully */
    .select2-container .select2-selection--single,
    select.form-control {
        white-space: normal;
        height: auto !important;
    }
}


/* ========================================================
   INVINCIBLE NEXT-GEN DASHBOARD OVERHAUL
   ======================================================== */

/* Sidebar Overhaul */
.skin-blue .main-sidebar {
    background-color: #1e293b !important;
    border-right: none;
}
.skin-blue .sidebar-menu>li.header {
    background: #0f172a !important;
    color: #94a3b8 !important;
}
.skin-blue .sidebar-menu>li>a {
    color: #cbd5e1 !important;
}
.skin-blue .sidebar-menu>li:hover>a,
.skin-blue .sidebar-menu>li.active>a {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(59,130,246,0.3);
}
.skin-blue .sidebar-menu>li:hover>a i,
.skin-blue .sidebar-menu>li.active>a i {
    color: #ffffff !important;
}
.skin-blue .treeview-menu {
    background-color: #0f172a !important;
}
.skin-blue .treeview-menu>li>a {
    color: #94a3b8 !important;
}
.skin-blue .treeview-menu>li>a:hover {
    color: #ffffff !important;
}

/* Active Survey Panel in Sidebar */
.active-survey-panel {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    border-radius: 10px;
    margin: 15px;
    padding: 15px;
    color: white !important;
    box-shadow: 0 4px 15px rgba(37,99,235,0.4);
    border: 1px solid rgba(255,255,255,0.1);
}
.active-survey-panel h5 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 5px;
}
.active-survey-panel p {
    font-size: 12px;
    opacity: 0.9;
}
.active-survey-panel .btn {
    background: rgba(255,255,255,0.2) !important;
    border: none;
    color: white;
    font-weight: 600;
}
.active-survey-panel .btn:hover {
    background: rgba(255,255,255,0.3) !important;
}

/* Box & Cards */
.box {
    border-radius: 12px;
    border-top: none !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04) !important;
    background: #ffffff;
    margin-bottom: 25px;
}
.box-header {
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 15px 20px;
}
.box-title {
    font-weight: 700 !important;
    color: #1e293b !important;
    font-size: 1.1rem !important;
}

/* Small Boxes (Stat Cards) */
.small-box {
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}
.small-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
}
.small-box > .inner {
    padding: 20px;
}
.small-box h3 {
    font-size: 32px !important;
    font-weight: 700 !important;
    margin-bottom: 5px !important;
}
.small-box p {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
}
.small-box .icon {
    top: 5px;
    right: 15px;
    font-size: 70px;
    opacity: 0.15;
    transition: all 0.3s;
}
.small-box:hover .icon {
    font-size: 80px;
    opacity: 0.25;
}

/* Gradient Colors for Small Boxes */
.bg-aqua { background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important; }
.bg-yellow { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important; }
.bg-red { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important; }
.bg-maroon { background: linear-gradient(135deg, #db2777 0%, #be185d 100%) !important; }
.bg-green { background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; }

/* Custom Side Panel (Replacing the Brown Box) */
.modern-stats-panel {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    height: 400px; 
    color: white; 
    padding: 30px; 
    display: flex; 
    flex-direction: column; 
    justify-content: center;
    box-shadow: -10px 0 20px rgba(0,0,0,0.05);
}
.stat-item-modern {
    margin-bottom: 35px;
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: background 0.3s;
}
.stat-item-modern:hover {
    background: rgba(255,255,255,0.1);
}
.stat-item-modern:last-child {
    margin-bottom: 0;
}
.stat-item-modern h3 {
    margin: 0; 
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}
.stat-item-modern span {
    font-size: 11px; 
    font-weight: 700; 
    letter-spacing: 1.5px;
    color: #94a3b8;
    text-transform: uppercase;
}

/* Nav Tabs */
.nav-tabs {
    border-bottom: none;
    margin-bottom: 15px;
    gap: 10px;
    display: flex;
    flex-wrap: wrap;
}
.nav-tabs>li {
    margin-bottom: 5px;
}
.nav-tabs>li>a {
    border: none !important;
    background: #f1f5f9;
    color: #475569;
    border-radius: 20px !important;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}
.nav-tabs>li.active>a, .nav-tabs>li>a:hover {
    background: #3b82f6 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(59,130,246,0.3);
}

