/* 
 * Main Stylesheet - Aplikasi Manajemen Masjid Al Amanah GKN Mamuju
 * Modern Islamic Emerald & Gold Palette
 */

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

:root {
    --primary: #044e3e;
    --primary-light: #065f46;
    --primary-dark: #022c22;
    --primary-rgb: 4, 78, 62;

    --accent: #d97706;
    --accent-hover: #b45309;
    --accent-light: #fef3c7;

    --bg: #f8fafc;
    --bg-card: #ffffff;
    --sidebar-bg: #03362b;

    --text-dark: #0f172a;
    --text-muted: #475569;
    --text-light: #94a3b8;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .font-outfit {
    font-family: 'Outfit', sans-serif;
}

/* --- Layout Wrapper --- */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

/* --- Sidebar Styling --- */
#sidebar {
    min-width: 260px;
    max-width: 260px;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    transition: var(--transition);
    z-index: 100;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.08);
}

#sidebar.active {
    margin-left: -260px;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-header i {
    font-size: 1.8rem;
    color: var(--accent);
}

.sidebar-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.sidebar-header h3 span {
    color: var(--accent);
}

.sidebar-header p {
    font-size: 0.7rem;
    color: #94a3b8;
    margin: 0;
}

/* Sidebar Menu */
ul.components {
    padding: 1rem 0;
    margin: 0;
    list-style: none;
    flex-grow: 1;
}

ul.components li {
    margin-bottom: 0.2rem;
}

ul.components li a {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: #cbd5e1;
    text-decoration: none;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

ul.components li a i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    color: var(--accent);
    transition: var(--transition);
}

ul.components li a:hover,
ul.components li.active > a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-left-color: var(--accent);
}

ul.components li.active > a i {
    transform: scale(1.1);
}

.sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: center;
}

/* --- Content Wrapper --- */
#content {
    width: 100%;
    min-height: 100vh;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

/* Navbar Top Header */
.top-navbar {
    padding: 0.85rem 1.75rem;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.toggle-btn {
    background: var(--bg);
    border: 1px solid #cbd5e1;
    color: var(--primary);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.toggle-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.top-navbar .user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg);
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.user-info h5 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
}

.user-info p {
    margin: 0;
    font-size: 0.7rem;
    color: var(--accent-hover);
    font-weight: 600;
    text-transform: uppercase;
}

/* --- Main Page Container --- */
.main-container {
    padding: 1.75rem;
    flex-grow: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
}

.page-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* --- Metric Stat Cards (Dashboard) --- */
.stat-card {
    background: #ffffff;
    border-radius: var(--border-radius);
    padding: 1.35rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(var(--primary-rgb), 0.15);
}

.stat-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.stat-icon.emerald {
    background: rgba(4, 78, 62, 0.1);
    color: var(--primary);
}

.stat-icon.amber {
    background: rgba(217, 119, 6, 0.1);
    color: var(--accent);
}

.stat-icon.blue {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.stat-icon.purple {
    background: rgba(147, 51, 234, 0.1);
    color: #9333ea;
}

.stat-content h6 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.stat-content h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0;
}

/* --- Cards & Panels --- */
.custom-card {
    background: #ffffff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.04);
    margin-bottom: 1.75rem;
    overflow: hidden;
}

.custom-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
}

.custom-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-card-title i {
    color: var(--accent);
}

.custom-card-body {
    padding: 1.5rem;
}

/* --- Buttons --- */
.btn-emerald {
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 0.55rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-emerald:hover {
    background-color: var(--primary-light);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(4, 78, 62, 0.25);
}

.btn-amber {
    background-color: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 0.55rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-amber:hover {
    background-color: var(--accent-hover);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

/* --- Data Table Customization --- */
.table-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-custom th {
    background: #f8fafc;
    color: var(--text-dark);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.9rem 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.table-custom td {
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table-custom tbody tr:hover {
    background-color: rgba(4, 78, 62, 0.02);
}

/* --- Badges --- */
.badge-custom {
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-emerald {
    background: rgba(4, 78, 62, 0.1);
    color: var(--primary);
}

.badge-amber {
    background: var(--accent-light);
    color: var(--accent-hover);
}

.badge-blue {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.badge-red {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

/* --- Login Page --- */
.login-body {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.login-body::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(var(--accent) 0.5px, transparent 0.5px);
    background-size: 30px 30px;
    opacity: 0.1;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    position: relative;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo i {
    font-size: 3.2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-logo h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
}

.login-logo h2 span {
    color: var(--accent);
}

.login-logo p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* Form Controls & Inputs */
.form-control-custom,
.form-control {
    border-radius: 12px !important;
    padding: 0.65rem 1rem !important;
    border: 1.5px solid #cbd5e1 !important;
    font-size: 0.95rem !important;
    color: #0f172a !important;
    background-color: #ffffff !important;
    transition: var(--transition) !important;
    height: 46px !important;
    min-height: 46px !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
}

textarea.form-control-custom,
textarea.form-control {
    height: auto !important;
    min-height: 90px !important;
}

.form-control-custom:focus,
.form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(4, 78, 62, 0.15) !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
}

/* Explicit Select Dropdown Styling Fix */
select.form-control,
select.form-control-custom,
.form-group select,
.modal-body select {
    display: block !important;
    width: 100% !important;
}

select.form-control,
select.form-control-custom,
.form-group select,
.modal-body select,
.swal2-select {
    height: 46px !important;
    min-height: 46px !important;
    padding: 0.5rem 2.5rem 0.5rem 1rem !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    color: #0f172a !important;
    background-color: #ffffff !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23044e3e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 16px 16px !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    border-radius: 12px !important;
    border: 1.5px solid #cbd5e1 !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Ensure SweetAlert respects hidden display state when not explicitly active */
.swal2-container .swal2-select[style*="display: none"],
.swal2-container .swal2-input[style*="display: none"],
.swal2-container .swal2-file[style*="display: none"],
.swal2-container .swal2-textarea[style*="display: none"] {
    display: none !important;
}


select.form-control:focus,
select.form-control-custom:focus,
.swal2-select:focus {
    border-color: var(--primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(4, 78, 62, 0.15) !important;
}

/* Dropdown Option Items Fix */
select option,
select.form-control option,
select.form-control-custom option,
.swal2-select option {
    padding: 10px 14px !important;
    font-size: 0.95rem !important;
    color: #0f172a !important;
    background-color: #ffffff !important;
    line-height: 1.6 !important;
}

/* Small select inputs (like in filters) */
select.form-control-sm {
    height: 38px !important;
    min-height: 38px !important;
    padding: 0.35rem 2.2rem 0.35rem 0.75rem !important;
    font-size: 0.875rem !important;
    border-radius: 8px !important;
    background-position: right 0.65rem center !important;
}


/* --- Responsive Adjustments --- */
@media (max-width: 991px) {
    #sidebar {
        margin-left: -260px;
    }
    #sidebar.active {
        margin-left: 0;
    }
}

/* Print Friendly Styles */
@media print {
    #sidebar, .top-navbar, .btn, .no-print {
        display: none !important;
    }
    #content {
        margin: 0 !important;
        padding: 0 !important;
    }
    .main-container {
        padding: 0 !important;
    }
}
