@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Quicksand:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #e27a69;      /* Dusty Coral */
    --primary-hover: #ce6857;
    --primary-light: #fef0ed;      /* Soft pastel coral */
    --secondary-color: #6b8a7a;    /* Calm Sage Green */
    --secondary-hover: #577464;
    --secondary-light: #eff3f0;
    
    --accent-color: #e2a569;       /* Warm Apricot */
    --accent-light: #fef6ee;
    
    --bg-warm: #faf6f2;            /* Calming Warm Cream */
    --text-dark: #3a3530;          /* Soft Charcoal Brown */
    --text-muted: #8c827a;
    
    --sidebar-bg: #2f3e35;         /* Deep Forest Olive */
    --sidebar-hover: #3d5045;
    --sidebar-active: #4a6153;
    
    --border-color: #eee5dd;
    --card-bg: #ffffff;
    
    --border-radius-sm: 10px;
    --border-radius-md: 20px;
    --border-radius-lg: 30px;
}

body {
    font-family: 'Quicksand', sans-serif;
    background-color: var(--bg-warm);
    color: var(--text-dark);
    min-height: 100vh;
    font-size: 1.08rem; /* Larger font size */
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    font-weight: 700;
}

.wrapper {
    min-height: 100vh;
}

/* Sidebar styling */
.sidebar {
    width: 280px; /* Slightly wider sidebar for text space */
    height: 100vh;
    min-height: 100vh;
    background-color: var(--sidebar-bg) !important;
    color: #e3eae5;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.05);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand-container {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-icon {
    color: var(--primary-color) !important;
}

.text-muted-custom {
    color: #8da496 !important;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1.5rem; /* Larger padding for sidebar links */
    color: #b8c9c0;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    border-radius: 0 50px 50px 0;
    margin-right: 1.25rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar .nav-link i {
    font-size: 1.35rem; /* Larger icons */
}

.sidebar .nav-link:hover {
    background-color: var(--sidebar-hover);
    color: #ffffff;
    padding-left: 1.75rem;
}

.sidebar .nav-link.active {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(226, 122, 105, 0.35);
}

.sidebar .nav-link-logout {
    color: #f7a399 !important;
}

.sidebar .nav-link-logout:hover {
    background-color: rgba(247, 163, 153, 0.1) !important;
}

/* Main Content Area */
.main-content {
    margin-left: 280px;
    width: calc(100% - 280px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 4rem;
    transition: all 0.3s ease;
}

.main-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background-color: var(--bg-warm) !important;
    margin-top: 0;
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
    border-bottom: 1px solid var(--border-color);
}

/* Cards customization */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: 0 6px 24px rgba(74, 61, 53, 0.04) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.75rem;
}

.card-header {
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 1.5rem 1.75rem;
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    font-size: 1.15rem;
}

/* Welcome Banner card */
.welcome-banner {
    background: linear-gradient(135deg, #fef4ec 0%, #fdf0ed 100%);
    border: 1px solid #f6ded5;
    border-radius: var(--border-radius-md);
}

/* Quick Access Cards */
.quick-access-card {
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.quick-access-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(74, 61, 53, 0.08) !important;
}

.quick-access-card:active {
    transform: translateY(1px);
}

/* Soft stat cards */
.stat-card {
    border: none;
    border-radius: var(--border-radius-md);
}

.stat-card-lansia {
    background-color: #f0f7f4;
    border: 1px solid #d3ebd8;
}
.stat-card-lansia .stat-value {
    color: var(--secondary-color);
}

.stat-card-latih {
    background-color: #fef0ed;
    border: 1px solid #f9ded8;
}
.stat-card-latih .stat-value {
    color: var(--primary-color);
}

.stat-card-rekam {
    background-color: #fef6ee;
    border: 1px solid #f8e5d3;
}
.stat-card-rekam .stat-value {
    color: var(--accent-color);
}

.stat-card-klaster {
    background-color: #f5f0fa;
    border: 1px solid #e7def3;
}
.stat-card-klaster .stat-value {
    color: #925cd2;
}

.stat-card .stat-value {
    font-size: 2.5rem; /* Larger size */
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

/* Buttons style - Large and Interactive */
.btn {
    border-radius: 50px;
    padding: 0.75rem 2rem; /* Larger padding */
    font-weight: 700;
    font-size: 1.05rem; /* Larger font size */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(1px) scale(0.97); /* Depress animation */
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(226, 122, 105, 0.2);
}
.btn-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    box-shadow: 0 6px 18px rgba(226, 122, 105, 0.35);
}

.btn-success {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(107, 138, 122, 0.2);
}
.btn-success:hover {
    background-color: var(--secondary-hover) !important;
    border-color: var(--secondary-hover) !important;
    box-shadow: 0 6px 18px rgba(107, 138, 122, 0.35);
}

/* Forms input style */
.form-control, .form-select {
    border-radius: 12px; /* Smoother curves */
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem; /* Larger fields */
    font-size: 1.05rem;
    background-color: #fafaf8;
    color: var(--text-dark);
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(226, 122, 105, 0.15);
    background-color: #ffffff;
}

/* Login Page redesign */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top left, #fef5ee 0%, #faf6f2 50%, #eff5f1 100%);
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 440px; /* Slightly wider */
    border: none;
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 40px rgba(74, 61, 53, 0.06) !important;
    overflow: hidden;
}

/* Custom Table style */
.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: #fdfaf7;
    color: var(--text-dark);
}
.table th {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    padding: 1.1rem 0.75rem; /* Larger table header padding */
}
.table td {
    padding: 1.25rem 0.75rem; /* Larger table row padding */
}

/* Custom badge styling */
.badge {
    padding: 0.5rem 0.85rem; /* Larger badges */
    border-radius: 30px;
    font-size: 1.05rem;
    font-weight: 600;
}
.badge.bg-primary {
    background-color: var(--primary-light) !important;
    color: var(--primary-color) !important;
    border: 1px solid #f9ded8;
}
.badge.bg-success {
    background-color: var(--secondary-light) !important;
    color: var(--secondary-color) !important;
    border: 1px solid #d3ebd8;
}
.badge.bg-secondary {
    background-color: #f3ede7 !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border-color);
}

.chart-container {
    position: relative;
    height: 340px;
}

/* Floating Action Button (FAB) Bantuan */
.help-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(107, 138, 122, 0.4);
    z-index: 1000;
    border: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.help-fab:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 20px rgba(107, 138, 122, 0.5);
}
.help-fab:active {
    transform: translateY(1px) scale(0.95);
}

/* Scrollable Table Container & Sticky headers */
.table-responsive-scrollable {
    max-height: 500px;
    overflow-y: auto;
    position: relative;
}

.table-responsive-scrollable thead th {
    position: sticky;
    top: 0;
    background-color: #ffffff !important;
    z-index: 10;
    box-shadow: inset 0 -2px 0 var(--border-color);
}

/* Responsive styles */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed !important;
        top: 0;
        left: -280px; /* Sembunyikan ke kiri layar */
        width: 280px;
        height: 100vh;
        min-height: 100vh !important;
        z-index: 1050;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0 !important;
    }
    .sidebar.show {
        left: 0 !important; /* Geser masuk */
    }
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .main-header {
        position: sticky !important;
        top: 0;
        z-index: 99;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 0 !important;
    }
    /* Overlay background gelap saat menu mobile terbuka */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(2px);
        z-index: 1040;
        transition: all 0.3s ease;
    }
    .sidebar-overlay.show {
        display: block !important;
    }
}

/* Global Fixed Viewport/Fullscreen Layout for Desktop */
@media (min-width: 992px) {
    html, body {
        height: 100vh;
        overflow: hidden;
    }
    .wrapper {
        height: 100vh;
        overflow: hidden;
    }
    .main-content {
        height: 100vh;
        overflow: hidden;
        padding-bottom: 0 !important;
    }
    .main-content > .container-fluid {
        height: calc(100vh - 85px);
        overflow-y: auto;
        padding: 1.5rem !important;
    }
}

/* Global Minimum Font Size Enforcer */
small, .small, .form-text, .help-block, .text-muted small {
    font-size: 1.05rem !important;
}
