/**
 * SKRU-MFP Material Design UI Theme
 * Designed for Management & Tracking Government Action Plan System
 * Songkhla Rajabhat University
 */

:root {
    --primary-main: #1e3a8a;
    --primary-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    --primary-accent: #2563eb;
    --primary-light: #eff6ff;
    --primary-focus: rgba(37, 99, 235, 0.18);
    --bg-main: #f4f6f9;
    --card-bg: #ffffff;
    --text-heading: #1e293b;
    --text-body: #334155;
    --text-muted: #64748b;
    --border-soft: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-material-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.16);
    --shadow-material-card: 0 2px 8px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.05);
    --shadow-material-hover: 0 5px 15px rgba(0,0,0,0.12), 0 3px 6px rgba(0,0,0,0.08);
    --shadow-topbar: 0 2px 10px rgba(0,0,0,0.2);
}

/* Base Body Styles */
body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    background-color: var(--bg-main) !important;
    color: var(--text-body);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ==========================================================================
   Top Material Navigation Bar
   ========================================================================== */
.mat-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    z-index: 1040;
    background: var(--primary-gradient);
    box-shadow: var(--shadow-topbar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    color: #ffffff;
}

.mat-navbar-brand-area {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.mat-sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
}

.mat-sidebar-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.04);
}

.mat-sidebar-toggle-btn:active {
    transform: scale(0.96);
}

.mat-brand-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    text-decoration: none !important;
    color: #ffffff !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0;
}

.mat-brand-logo {
    height: 44px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.mat-brand-text {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex-wrap: wrap;
}

.mat-brand-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.8px;
    line-height: 1.2;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    white-space: nowrap;
}

.mat-brand-title .brand-s,
.mat-brand-title .brand-sk {
    color: #ff4d4f !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    letter-spacing: inherit !important;
    line-height: inherit !important;
}

.mat-brand-title-img {
    height: 32px;
    width: auto;
    max-width: 220px;
    display: inline-block;
    vertical-align: middle;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), filter 0.22s ease;
}

.mat-brand-link:hover .mat-brand-title-img {
    transform: translateY(-1px) scale(1.04);
    filter: drop-shadow(0 3px 10px rgba(0, 229, 255, 0.4));
}

.mat-brand-title .brand-chart-icon {
    display: inline-block;
    vertical-align: -0.15em;
    width: 1.18em;
    height: 0.96em;
    margin: 0 0.22em;
    filter: drop-shadow(0 2px 6px rgba(56, 189, 248, 0.45));
    transition: transform 0.22s ease, filter 0.22s ease;
}

.mat-brand-link:hover .brand-chart-icon {
    transform: translateY(-1px) scale(1.08);
    filter: drop-shadow(0 3px 8px rgba(56, 189, 248, 0.7));
}

.mat-brand-divider {
    font-size: 22px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1;
    display: inline-block;
}

.mat-brand-subtitle {
    font-size: 18px;
    color: #ffffff;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.mat-navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mat-user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.12);
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mat-user-chip-name {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
}

.mat-role-badge {
    background: #fbbf24;
    color: #1e3a8a;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: none;
}

.mat-btn-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
    background: rgba(239, 68, 68, 0.85);
    border: none;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.mat-btn-logout:hover {
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}

/* ==========================================================================
   Left Material Sidebar
   ========================================================================== */
#sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    width: 280px;
    height: calc(100vh - 64px);
    z-index: 1030;
    background: #ffffff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.08);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar-wrapper {
    width: 280px !important;
    height: 100% !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    overflow-y: auto !important;
    background: #ffffff !important;
    padding-bottom: 30px;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* User Info Panel (Top of Sidebar) */
.mat-user-info-panel {
    background-color: #f8fafc !important;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.78) 0%, rgba(241, 245, 249, 0.82) 100%), url('../../images/bg_finance_chart.jpg') !important;
    background-size: cover !important;
    background-position: center right !important;
    background-repeat: no-repeat !important;
    padding: 18px 16px 16px !important;
    position: relative !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
    transition: all 0.25s ease;
}

.mat-user-info-flex {
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.25s ease;
}

.mat-user-avatar {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50%;
    background: #ffffff !important;
    border: 2px solid #2563eb !important;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    transition: all 0.25s ease;
}

.mat-user-avatar svg {
    display: block !important;
    margin: auto !important;
}

.mat-user-avatar i {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    font-size: 28px !important;
    color: #1e3a8a !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateY(-1px);
}

.mat-user-details {
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.mat-user-name {
    font-size: 17.5px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
    letter-spacing: -0.2px;
}

.mat-user-role-label {
    display: inline-block;
    background: #fef3c7 !important;
    border: 1px solid #fcd34d !important;
    color: #92400e !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    padding: 1px 8px !important;
    border-radius: 10px !important;
    margin-bottom: 4px;
}

.mat-user-dept {
    font-size: 14.5px !important;
    color: #475569 !important;
    font-weight: 500 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar Menu Navigation */
.sidebar-wrapper .menu {
    list-style: none;
    margin: 0;
    padding: 10px 0 24px !important;
}

.sidebar-wrapper .menu .sidebar-title {
    display: flex !important;
    align-items: center !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: #94a3b8 !important;
    letter-spacing: 0.8px !important;
    padding: 18px 20px 8px !important;
    margin: 0 !important;
    list-style: none !important;
    user-select: none;
}

.sidebar-wrapper .menu .sidebar-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #f1f5f9;
    margin-left: 10px;
}

.sidebar-wrapper .sidebar-divider,
.sidebar-wrapper hr {
    height: 1px !important;
    border: none !important;
    background: linear-gradient(90deg, transparent, #e2e8f0 20%, #e2e8f0 80%, transparent) !important;
    margin: 8px 18px !important;
    list-style: none !important;
    padding: 0 !important;
}

.sidebar-wrapper .menu .sidebar-item {
    list-style: none !important;
    margin: 3px 12px !important;
    position: relative;
}

.sidebar-wrapper .menu .sidebar-link {
    display: flex !important;
    align-items: center !important;
    padding: 9px 12px !important;
    color: #475569 !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    border-radius: 12px !important;
    border: 1px solid transparent !important;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: transparent !important;
    position: relative;
    user-select: none;
}

/* Interactive Icon Container */
.sidebar-wrapper .menu .sidebar-link i,
.sidebar-wrapper .menu .sidebar-link svg {
    width: 32px !important;
    height: 32px !important;
    border-radius: 9px !important;
    background: #f1f5f9 !important;
    color: #2563eb !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.08rem !important;
    margin-right: 12px !important;
    flex-shrink: 0 !important;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.sidebar-wrapper .menu .sidebar-link span {
    margin-left: 0 !important;
    line-height: 1.35 !important;
    color: inherit !important;
    font-size: 13.5px !important;
    font-weight: inherit !important;
    transition: color 0.2s ease !important;
}

/* Hover Interaction */
.sidebar-wrapper .menu .sidebar-link:hover {
    background-color: #f8fafc !important;
    color: #1e3a8a !important;
    transform: translateX(4px);
    border-color: #e2e8f0 !important;
    box-shadow: 0 3px 10px rgba(30, 58, 138, 0.05) !important;
}

.sidebar-wrapper .menu .sidebar-link:hover i,
.sidebar-wrapper .menu .sidebar-link:hover svg {
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.18);
}

.sidebar-wrapper .menu .sidebar-link:hover span {
    color: #1e3a8a !important;
    font-weight: 600 !important;
}

/* Active Menu Item Pill */
.sidebar-wrapper .menu .sidebar-item.active > .sidebar-link {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.32) !important;
    transform: none !important;
}

.sidebar-wrapper .menu .sidebar-item.active > .sidebar-link i,
.sidebar-wrapper .menu .sidebar-item.active > .sidebar-link svg {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.sidebar-wrapper .menu .sidebar-item.active > .sidebar-link span {
    color: #ffffff !important;
    font-weight: 600 !important;
}

/* Submenu Dropdown Chevron */
.sidebar-wrapper .menu .sidebar-item.has-sub > .sidebar-link::after {
    content: '' !important;
    width: 7px !important;
    height: 7px !important;
    border-right: 2px solid #94a3b8 !important;
    border-bottom: 2px solid #94a3b8 !important;
    transform: rotate(45deg) !important;
    margin-left: auto !important;
    margin-right: 4px !important;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
}

.sidebar-wrapper .menu .sidebar-item.has-sub:hover > .sidebar-link::after {
    border-color: #1d4ed8 !important;
}

.sidebar-wrapper .menu .sidebar-item.has-sub.is-open > .sidebar-link::after,
.sidebar-wrapper .menu .sidebar-item.has-sub.active > .sidebar-link::after {
    transform: rotate(-135deg) translateY(-2px) translateX(-2px) !important;
}

.sidebar-wrapper .menu .sidebar-item.has-sub.active > .sidebar-link::after {
    border-color: #ffffff !important;
}

/* Submenu Panel */
.sidebar-wrapper .menu .submenu {
    list-style: none !important;
    padding: 6px 6px 6px 14px !important;
    margin: 4px 10px 6px 20px !important;
    background: #f8fafc !important;
    border-left: 2px dashed #cbd5e1 !important;
    border-radius: 0 10px 10px 0 !important;
}

.sidebar-wrapper .menu .submenu .submenu-item {
    list-style: none !important;
    margin: 2px 0 !important;
}

.sidebar-wrapper .menu .submenu .submenu-item a {
    padding: 7px 10px !important;
    display: flex !important;
    align-items: center !important;
    color: #475569 !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    line-height: 1.35 !important;
}

.sidebar-wrapper .menu .submenu .submenu-item a::before {
    content: '' !important;
    width: 6px !important;
    height: 6px !important;
    border-radius: 50% !important;
    background: #cbd5e1 !important;
    margin-right: 10px !important;
    flex-shrink: 0 !important;
    transition: all 0.2s ease !important;
}

.sidebar-wrapper .menu .submenu .submenu-item a:hover {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    padding-left: 14px !important;
}

.sidebar-wrapper .menu .submenu .submenu-item a:hover::before {
    background: #2563eb !important;
    transform: scale(1.3) !important;
}

.sidebar-wrapper .menu .submenu .submenu-item.active a {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    font-weight: 600 !important;
}

.sidebar-wrapper .menu .submenu .submenu-item.active a::before {
    background: #2563eb !important;
    box-shadow: 0 0 6px rgba(37, 99, 235, 0.5) !important;
}

/* Sidebar Footer / Copyright */
.mat-sidebar-legal {
    padding: 14px 18px;
    border-top: 1px solid #f1f5f9;
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    line-height: 1.4;
}

/* Overlay for Mobile */
.mat-sidebar-overlay {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 1025;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mat-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Mini / Collapsed Sidebar (Icon-Only Mode)
   ========================================================================== */
@media (min-width: 992px) {
    body.sidebar-mini #sidebar {
        width: 74px !important;
    }

    body.sidebar-mini .sidebar-wrapper {
        width: 74px !important;
        overflow-x: hidden !important;
    }

    body.sidebar-mini #main {
        margin-left: 74px !important;
    }

    /* Compact User Info Panel */
    body.sidebar-mini .mat-user-info-panel {
        padding: 12px 6px !important;
        text-align: center;
    }

    body.sidebar-mini .mat-user-info-flex {
        justify-content: center !important;
        gap: 0 !important;
    }

    body.sidebar-mini .mat-user-details {
        display: none !important;
    }

    body.sidebar-mini .mat-user-avatar {
        width: 44px !important;
        height: 44px !important;
        font-size: 22px !important;
        margin: 0 auto !important;
    }

    /* Convert category titles to clean divider lines */
    body.sidebar-mini .sidebar-wrapper .menu .sidebar-title {
        height: 1px !important;
        padding: 0 !important;
        margin: 10px 14px !important;
        background: #e2e8f0 !important;
        font-size: 0 !important;
        line-height: 0 !important;
        color: transparent !important;
        overflow: hidden !important;
    }

    /* Centered Menu Links with Icons Only */
    body.sidebar-mini .sidebar-wrapper .menu .sidebar-item {
        margin: 5px 10px !important;
    }

    body.sidebar-mini .sidebar-wrapper .menu .sidebar-link {
        padding: 6px 0 !important;
        justify-content: center !important;
        text-align: center !important;
        position: relative;
        border: none !important;
        border-radius: 12px !important;
        transform: none !important;
    }

    body.sidebar-mini .sidebar-wrapper .menu .sidebar-link::after {
        display: none !important;
    }

    body.sidebar-mini .sidebar-wrapper .menu .sidebar-item.active .sidebar-link {
        background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%) !important;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
    }

    body.sidebar-mini .sidebar-wrapper .menu .sidebar-link i,
    body.sidebar-mini .sidebar-wrapper .menu .sidebar-link svg {
        margin: 0 auto !important;
        font-size: 1.2rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 38px !important;
        height: 38px !important;
        border-radius: 10px !important;
    }

    body.sidebar-mini .sidebar-wrapper .menu .sidebar-item.active .sidebar-link i,
    body.sidebar-mini .sidebar-wrapper .menu .sidebar-item.active .sidebar-link svg {
        background: rgba(255, 255, 255, 0.2) !important;
        color: #ffffff !important;
    }

    body.sidebar-mini .sidebar-wrapper .menu .sidebar-link span {
        display: none !important;
    }

    body.sidebar-mini .sidebar-wrapper .menu .submenu {
        display: none !important;
    }

    body.sidebar-mini .mat-sidebar-legal {
        display: none !important;
    }

    /* Sleek Floating Tooltip on Hover in Mini Mode */
    body.sidebar-mini .sidebar-wrapper .menu .sidebar-item {
        position: relative;
    }

    body.sidebar-mini .sidebar-wrapper .menu .sidebar-link[data-tooltip]:hover::after {
        content: attr(data-tooltip);
        position: absolute;
        left: 78px;
        top: 50%;
        transform: translateY(-50%);
        background: #1e293b;
        color: #ffffff;
        padding: 6px 12px;
        font-size: 12px;
        font-weight: 500;
        white-space: nowrap;
        border-radius: 6px;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
        z-index: 1090;
        pointer-events: none;
        letter-spacing: 0.2px;
        animation: miniTooltipAnim 0.15s ease-out forwards;
    }

    body.sidebar-mini .sidebar-wrapper .menu .sidebar-link[data-tooltip]:hover::before {
        content: '';
        position: absolute;
        left: 72px;
        top: 50%;
        transform: translateY(-50%);
        border: 5px solid transparent;
        border-right-color: #1e293b;
        z-index: 1090;
        pointer-events: none;
    }

    @keyframes miniTooltipAnim {
        from { opacity: 0; transform: translateY(-50%) translateX(-4px); }
        to { opacity: 1; transform: translateY(-50%) translateX(0); }
    }
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
#main {
    margin-left: 280px !important;
    margin-top: 64px !important;
    padding: 22px 26px !important;
    min-height: calc(100vh - 64px) !important;
    background-color: #f1f5f9 !important;
    background-image: linear-gradient(rgba(241, 245, 249, 0.82), rgba(241, 245, 249, 0.88)), url('../../images/bg_finance_chart.jpg') !important;
    background-attachment: fixed !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Classic header adjustment */
#main header.mb-3 {
    margin-bottom: 1rem !important;
}

/* Hide redundant burger button in #main since we have it in top navbar */
#main header.mb-3 .burger-btn {
    display: none !important;
}

/* ==========================================================================
   Material Design Cards
   ========================================================================== */
.card {
    background: #ffffff !important;
    border: none !important;
    border-radius: 4px !important;
    box-shadow: var(--shadow-material-card) !important;
    margin-bottom: 22px !important;
    transition: box-shadow 0.25s ease !important;
}

.card:hover {
    box-shadow: var(--shadow-material-hover) !important;
}

.card .card-header {
    background: transparent !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 14px 20px !important;
    border-top-left-radius: 4px !important;
    border-top-right-radius: 4px !important;
}

.card .card-header h6,
.card .card-header h5,
.card .card-header h4 {
    color: var(--primary-main) !important;
    font-weight: 700 !important;
    margin-bottom: 0 !important;
    letter-spacing: 0.2px;
}

.card .card-body {
    padding: 20px !important;
}

/* ==========================================================================
   Material Design Raised Buttons
   ========================================================================== */
.btn {
    font-family: inherit !important;
    font-weight: 500 !important;
    border-radius: 3px !important;
    padding: 6px 14px !important;
    font-size: 13px !important;
    box-shadow: var(--shadow-material-sm) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    letter-spacing: 0.2px !important;
    border: none !important;
}

.btn:hover, .btn:focus {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22) !important;
    transform: translateY(-1px);
}

.btn:active {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18) !important;
    transform: translateY(0);
}

.btn-primary {
    background-color: #1e40af !important;
    color: #ffffff !important;
}

.btn-primary:hover {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
}

.btn-success {
    background-color: #10b981 !important;
    color: #ffffff !important;
}

.btn-danger {
    background-color: #ef4444 !important;
    color: #ffffff !important;
}

.btn-warning {
    background-color: #f59e0b !important;
    color: #ffffff !important;
}

.btn-info {
    background-color: #0ea5e9 !important;
    color: #ffffff !important;
}

.btn-sm {
    padding: 4px 10px !important;
    font-size: 12px !important;
}

/* ==========================================================================
   Material Form Controls
   ========================================================================== */
.form-control,
.form-select {
    border: 1px solid #cbd5e1 !important;
    border-radius: 3px !important;
    padding: 7px 12px !important;
    font-size: 13px !important;
    color: #334155 !important;
    background-color: #ffffff !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    box-shadow: none !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 2px var(--primary-focus) !important;
    outline: none !important;
}

.form-control-label,
label {
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    margin-bottom: 5px !important;
}

/* Ensure text inside buttons does not get overridden by label styling */
.btn label,
.btn span,
button label,
button span,
.btn > label,
button > label {
    color: inherit !important;
    cursor: pointer;
    margin-bottom: 0 !important;
    font-weight: 600 !important;
    line-height: inherit !important;
}

.btn-primary label,
.btn-primary:disabled label,
.btn-danger label,
.btn-danger:disabled label,
.btn-secondary label,
.btn-secondary:disabled label,
.btn-success label,
.btn-success:disabled label,
.btn-dark label,
.btn-dark:disabled label {
    color: #ffffff !important;
}

/* ==========================================================================
   Material Tables
   ========================================================================== */
.table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
    margin-bottom: 1rem !important;
}

.table thead th {
    background-color: #f8fafc !important;
    color: #334155 !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    border-top: none !important;
    border-bottom: 2px solid #e2e8f0 !important;
    padding: 12px 14px !important;
    vertical-align: middle !important;
}

.table tbody td {
    padding: 10px 14px !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #f1f5f9 !important;
    border-top: none !important;
    font-size: 12.5px !important;
    color: #334155 !important;
}

.table tbody tr:hover {
    background-color: #f8fafc !important;
}

/* ==========================================================================
   Responsive Viewports (Mobile & Tablet)
   ========================================================================== */
@media (max-width: 1280px) {
    .mat-brand-title {
        font-size: 20px;
    }
    .mat-brand-title-img {
        height: 28px;
    }
    .mat-brand-subtitle {
        font-size: 15px;
    }
}

@media (max-width: 1199.98px) {
    #sidebar {
        left: -280px;
    }

    #sidebar.active {
        left: 0;
    }

    #main {
        margin-left: 0 !important;
        padding: 16px !important;
    }

    .mat-brand-divider {
        display: none;
    }

    .mat-brand-text {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .mat-brand-title {
        font-size: 18px;
    }
    .mat-brand-title-img {
        height: 26px;
    }

    .mat-brand-subtitle {
        font-size: 13px;
        display: block;
    }

    .mat-user-chip-name {
        max-width: 100px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 767.98px) {
    .mat-navbar {
        padding: 0 12px;
    }

    .mat-brand-title {
        font-size: 15px;
    }
    .mat-brand-title-img {
        height: 22px;
    }

    .mat-brand-subtitle {
        display: none;
    }

    .mat-user-chip {
        display: none;
    }

    .mat-btn-logout span {
        display: none;
    }
}

/* ==========================================================================
   SKRU Hero Welcome Banner Component
   ========================================================================== */
.skru-hero-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #1d4ed8 100%);
    border-radius: 16px;
    color: #ffffff;
    padding: 28px 32px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(30, 58, 138, 0.25), 0 8px 10px -6px rgba(30, 58, 138, 0.2);
    margin-bottom: 24px;
}

.skru-hero-banner::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
}

.skru-hero-banner::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: 20%;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-brand-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-logo-card {
    background: rgba(255, 255, 255, 0.96);
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hero-title {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.35;
    color: #ffffff;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.hero-subtitle {
    font-size: 0.92rem;
    color: #e2e8f0;
    font-weight: 500;
    line-height: 1.45;
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.hero-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-badge-year {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fef08a;
}

/* ==========================================================================
   Project Management & Table Styling (show_project.php)
   ========================================================================== */

/* Page Header Banner */
.project-header-banner {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #2563eb 100%);
    border-radius: 18px;
    padding: 24px 28px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(30, 58, 138, 0.25);
}

.project-header-chart-bg {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 480px;
    max-width: 55%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.4;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.project-header-banner .row {
    position: relative;
    z-index: 2;
}

.project-header-banner::after {
    content: '';
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.project-header-icon-box {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.project-header-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #e0f2fe;
    font-size: 15px;
    font-weight: 600;
    padding: 2px 12px;
    border-radius: 20px;
    margin-bottom: 6px;
}

.project-header-title {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 4px;
    letter-spacing: -0.2px;
}

.project-header-sub {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

/* Banner Breadcrumb Pill */
.banner-breadcrumb-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 3px 12px;
    border-radius: 20px;
    margin-top: 8px;
}

.banner-breadcrumb-pill .breadcrumb {
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    font-size: 12.5px;
    display: flex;
    align-items: center;
}

.banner-breadcrumb-pill .breadcrumb-item {
    display: inline-flex;
    align-items: center;
    font-size: 12.5px;
}

.banner-breadcrumb-pill .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: color 0.15s ease;
    display: inline-flex;
    align-items: center;
}

.banner-breadcrumb-pill .breadcrumb-item a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.banner-breadcrumb-pill .breadcrumb-item.active {
    color: #67e8f9;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.banner-breadcrumb-pill .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 15px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.55);
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
}


.project-stat-pill {
    background: #ffffff;
    color: #1e293b;
    border-radius: 12px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-add-project {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 7px 15px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.btn-add-project:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
}

/* Modern Filter Card */
.filter-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
    margin-bottom: 24px;
    overflow: hidden;
}

.filter-card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-card-header-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.filter-card-body {
    padding: 18px 20px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-input-wrap {
    position: relative;
}

.filter-input-wrap .form-control,
.filter-input-wrap .form-select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 13px;
    padding: 6px 11px;
    transition: all 0.2s ease;
}

.filter-input-wrap .form-control:focus,
.filter-input-wrap .form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Quarter Pill Checkboxes */
.quarter-chips-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.quarter-chip-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.quarter-chip-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.quarter-chip-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.quarter-chip-label input[type="checkbox"]:checked + .quarter-chip-badge {
    background: #eff6ff;
    color: #2563eb;
    border-color: #93c5fd;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.18);
}

/* Table Card Container */
.project-table-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    margin-bottom: 30px;
}

.project-table-top-bar {
    background: #ffffff;
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.project-count-badge {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Modern Project Data Table */
.project-modern-table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.project-modern-table thead th {
    background: #f8fafc;
    color: #334155;
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 11px 12px;
    border-bottom: 2px solid #e2e8f0;
    border-top: none;
    vertical-align: middle;
}

.project-modern-table tbody tr {
    transition: background-color 0.15s ease;
}

.project-modern-table tbody tr:hover {
    background-color: #f8faff;
}

.project-modern-table tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: #1e293b;
    vertical-align: middle;
}

/* Specific Column Styles */
.td-row-num {
    text-align: center;
    font-weight: 700;
    color: #64748b;
    font-size: 12.5px;
    width: 48px;
}

.project-code-tag {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 4px;
    margin-bottom: 2px;
    letter-spacing: 0.2px;
}

.project-name-link {
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
    line-height: 1.45;
    display: block;
    margin-bottom: 2px;
}

.project-budget-val {
    font-weight: 700;
    font-size: 13px;
    color: #0284c7;
    white-space: nowrap;
    text-align: right;
}

.project-paid-val {
    font-weight: 700;
    font-size: 13px;
    color: #16a34a;
    white-space: nowrap;
    text-align: right;
}

/* Quarter Status Dots in Table */
.quarter-status-group {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.quarter-status-badge {
    width: 25px;
    height: 22px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
}

.quarter-status-badge.active {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

.quarter-status-badge.inactive {
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    opacity: 0.65;
}

/* Status Badges */
.status-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill-1 { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; } /* เขียนโครงการ */
.status-pill-2 { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; } /* เสนออนุมัติ */
.status-pill-31 { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; } /* ระหว่างจัดอบรม */
.status-pill-32 { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; } /* เบิกจ่ายงบ */
.status-pill-33 { background: #faf5ff; color: #7e22ce; border: 1px solid #e9d5ff; } /* สรุปประเมิน */
.status-pill-4 { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; } /* เสร็จสิ้น */
.status-pill-5 { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; } /* ยกเลิก */

/* Compact Action Buttons */
.table-action-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.btn-table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 8px;
    transition: all 0.15s ease;
    text-decoration: none;
    width: 100%;
    line-height: 1.3;
}

.btn-table-action.btn-view {
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
}
.btn-table-action.btn-view:hover {
    background: #0284c7;
    color: #ffffff;
}

.btn-table-action.btn-status {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}
.btn-table-action.btn-status:hover {
    background: #2563eb;
    color: #ffffff;
}

.btn-table-action.btn-track {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.btn-table-action.btn-track:hover {
    background: #475569;
    color: #ffffff;
}

.btn-table-action.btn-delete {
    background: #fff1f2;
    color: #e11d48;
    border: 1px solid #fecdd3;
}
.btn-table-action.btn-delete:hover {
    background: #e11d48;
    color: #ffffff;
}

/* File Download Buttons */
.btn-file-doc {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    text-decoration: none;
    margin-bottom: 3px;
}
.btn-file-pdf {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}
.btn-file-pdf:hover {
    background: #dc2626;
    color: #ffffff;
}
.btn-file-word {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}
.btn-file-word:hover {
    background: #1d4ed8;
    color: #ffffff;
}
.btn-file-disabled {
    background: #f1f5f9;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    pointer-events: none;
}

/* ==========================================================================
   Project View Executive Report Styles
   ========================================================================== */
.report-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}
.report-card:hover {
    box-shadow: 0 8px 25px -4px rgba(0, 0, 0, 0.08);
}
.report-card-header {
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.report-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.report-card-title i {
    font-size: 18px;
    color: #2563eb;
    background: #eff6ff;
    padding: 6px 10px;
    border-radius: 10px;
}
.report-card-body {
    padding: 24px;
}
.report-field-group {
    margin-bottom: 18px;
}
.report-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.report-value {
    font-size: 14.5px;
    font-weight: 500;
    color: #1e293b;
    word-break: break-word;
}
.report-value-highlight {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}
.report-box-text {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.65;
    color: #334155;
    white-space: pre-line;
}
.report-quarter-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    height: 100%;
    transition: all 0.2s ease;
}
.report-quarter-card.active-quarter {
    background: #f0fdf4;
    border-color: #86efac;
}
.report-quarter-card .q-title {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 4px;
}
.report-quarter-card.active-quarter .q-title {
    color: #166534;
}
.report-quarter-card .q-amount {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
}
.report-quarter-card.active-quarter .q-amount {
    color: #15803d;
}
.report-quarter-card .q-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 6px;
}
.sdg-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    margin: 4px;
}
.stepper-header-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   Modern Modal UI System (view_project.php & system-wide)
   ========================================================================== */
.modal-content.modern-modal-content {
    border: none !important;
    border-radius: 24px !important;
    box-shadow: 0 25px 70px -10px rgba(15, 23, 42, 0.25), 0 10px 30px -5px rgba(59, 130, 246, 0.12) !important;
    overflow: hidden !important;
    background: #ffffff !important;
}

.modern-modal-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%) !important;
    padding: 20px 28px !important;
    border-bottom: none !important;
    position: relative;
    color: #ffffff !important;
}

.modern-modal-header .modal-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.modern-modal-header .modal-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin: 0 !important;
    line-height: 1.3;
}

.modern-modal-header .modal-subtitle {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 3px;
    margin-bottom: 0;
}

.modern-modal-header .btn-close-white {
    filter: brightness(0) invert(1);
    opacity: 0.85;
    transition: all 0.2s ease;
}

.modern-modal-header .btn-close-white:hover {
    opacity: 1;
    transform: scale(1.1);
}

.modal-section-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 14px -3px rgba(15, 23, 42, 0.04);
    transition: all 0.25s ease;
}

.modal-section-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
}

.modal-section-card.card-blue {
    background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
    border-left: 4px solid #3b82f6;
}

.modal-section-card.card-green {
    background: linear-gradient(180deg, #f7fdf9 0%, #ffffff 100%);
    border-left: 4px solid #10b981;
}

.modal-section-card.card-amber {
    background: linear-gradient(180deg, #fffdf7 0%, #ffffff 100%);
    border-left: 4px solid #f59e0b;
}

.modal-section-card.card-purple {
    background: linear-gradient(180deg, #faf8ff 0%, #ffffff 100%);
    border-left: 4px solid #8b5cf6;
}

.modal-section-card.card-slate {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-left: 4px solid #64748b;
}

.modal-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-section-title i {
    font-size: 18px;
}

.target-group-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.target-group-card:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

.target-group-card.has-target {
    border-color: #3b82f6;
    background: #eff6ff;
}

.target-group-card .form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.target-group-card .group-label {
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    min-width: 170px;
    flex-shrink: 0;
}

.modern-data-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    min-height: 52px;
}

.modern-data-box .box-label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modern-data-box textarea.modern-textarea {
    width: 100%;
    background: transparent;
    border: none;
    font-size: 13.5px;
    line-height: 1.6;
    color: #1e293b;
    resize: none;
    padding: 0;
}

.modern-data-box textarea.modern-textarea:focus {
    outline: none;
    box-shadow: none;
}

/* Action media tiles */
.media-action-tile {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    height: 100%;
}

.media-action-tile:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px -2px rgba(15, 23, 42, 0.08);
}

.media-action-tile .tile-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.media-action-tile .tile-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.media-action-tile.tile-video .tile-icon {
    background: #fee2e2;
    color: #dc2626;
}

.media-action-tile.tile-news .tile-icon {
    background: #e0e7ff;
    color: #4f46e5;
}

.media-action-tile.tile-doc .tile-icon {
    background: #e0f2fe;
    color: #0284c7;
}

/* Photo Gallery Grid in Modal */
.modal-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 12px;
}

.photo-grid-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.photo-grid-card:hover {
    border-color: #818cf8;
    transform: translateY(-3px);
    box-shadow: 0 10px 22px -4px rgba(99, 102, 241, 0.18);
}

.photo-grid-card .photo-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin: 0 auto 8px auto;
    transition: all 0.2s ease;
}

.photo-grid-card.has-image {
    background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
    border-color: #c7d2fe;
}

.photo-grid-card.has-image .photo-icon-circle {
    background: #e0e7ff;
    color: #4f46e5;
}

.photo-grid-card .photo-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
}

.photo-grid-card .btn-photo-view {
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 20px;
    padding: 3px 12px;
    width: 100%;
}

/* ==========================================================================
   SweetAlert Pastel Theme Overrides
   ========================================================================== */
.sweet-overlay {
    background-color: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
}

.sweet-alert {
    background: linear-gradient(180deg, #fcfdff 0%, #ffffff 100%) !important;
    border: 1px solid rgba(199, 210, 254, 0.7) !important;
    border-radius: 24px !important;
    padding: 26px !important;
    box-shadow: 0 25px 60px -10px rgba(99, 102, 241, 0.22), 0 10px 25px -5px rgba(56, 189, 248, 0.15) !important;
    font-family: 'Nunito', 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.sweet-alert h2 {
    color: #1e293b !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    margin: 12px 0 14px 0 !important;
}

.sweet-alert p {
    color: #475569 !important;
    font-size: 14.5px !important;
    line-height: 1.6 !important;
}

.sweet-alert button.confirm {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 6px 18px -2px rgba(79, 70, 229, 0.38) !important;
    border-radius: 50px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    padding: 9px 28px !important;
    letter-spacing: 0.2px;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sweet-alert button.confirm:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 22px -2px rgba(79, 70, 229, 0.5) !important;
}

.sweet-alert button.cancel {
    background: #f1f5f9 !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
    border-radius: 50px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    padding: 9px 24px !important;
    transition: all 0.2s ease !important;
}

.sweet-alert button.cancel:hover {
    background: #e2e8f0 !important;
    color: #334155 !important;
}

/* Custom Modal Widening in SweetAlert with Soft Pastel Accents */
.swal-wide {
    width: 82% !important;
    max-width: 880px !important;
    height: auto !important;
    background: #ffffff !important;
    border: 1px solid rgba(224, 231, 255, 0.8) !important;
    box-shadow: 0 25px 65px -10px rgba(99, 102, 241, 0.25) !important;
    border-radius: 24px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    padding: 24px 28px !important;
}

.swal-wide2 {
    width: 520px !important;
    max-width: 95vw !important;
    background: #ffffff !important;
    border: 1px solid rgba(224, 231, 255, 0.8) !important;
    box-shadow: 0 25px 65px -10px rgba(99, 102, 241, 0.25) !important;
    border-radius: 22px !important;
    padding: 24px !important;
}

.sweet-alert img {
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1) !important;
    border: 2px solid #f1f5f9 !important;
}

/* SweetAlert on top of Bootstrap Modals (Modal is 1055, backdrop is 1050) */
.sweet-overlay {
    z-index: 99998 !important;
}
.sweet-alert {
    z-index: 99999 !important;
}

/* Structured Text Hierarchy (Main Headers & Indented Sub-items) */
.report-box-text .report-main-header {
    font-weight: 700;
    color: #1e293b;
    margin-top: 10px;
    margin-bottom: 5px;
    font-size: 14.5px;
}
.report-box-text .report-main-item {
    font-weight: 600;
    color: #334155;
    margin-top: 6px;
    margin-bottom: 4px;
}
.report-box-text .report-sub-item {
    color: #334155;
    line-height: 1.68;
    margin-bottom: 4px;
    position: relative;
}
.report-box-text .report-level-2 {
    padding-left: 28px !important;
}
.report-box-text .report-level-3 {
    padding-left: 52px !important;
}
.report-box-text .report-bullet {
    padding-left: 24px !important;
}
.report-box-text .report-tabbed {
    padding-left: 28px !important;
}
.report-box-text .report-empty-line {
    height: 8px;
}
.report-box-text .report-line {
    line-height: 1.68;
    margin-bottom: 4px;
}

/* ==========================================================================
   Update Status Form UI Modernization
   ========================================================================== */
.update-status-body {
    background-color: #f8fafc !important;
    font-family: 'Nunito', 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* Stepper Modernization */
.card-stepper {
    background: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06) !important;
    border-radius: 18px !important;
    overflow: hidden;
}
.card-stepper .card-header {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

/* Form Container and Table Styling */
.update-form-card {
    background: #ffffff !important;
    border-radius: 20px !important;
    border: 1px solid rgba(226, 232, 240, 0.85) !important;
    box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.06) !important;
    padding: 30px !important;
    margin-bottom: 30px !important;
}

.update-form-table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 10px !important;
}

.update-form-table tr[bgcolor="#F8F8FF"] {
    background-color: #f8fafc !important;
    border-radius: 12px !important;
    transition: all 0.2s ease;
}

.update-form-table tr[bgcolor="#F8F8FF"]:hover {
    background-color: #f1f5f9 !important;
}

.update-form-table tr[bgcolor="#F8F8FF"] > td {
    padding: 14px 18px !important;
    vertical-align: middle;
    border: none !important;
}

.update-form-table tr[bgcolor="#F8F8FF"] > td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    width: 15px !important;
    padding-right: 0 !important;
}

.update-form-table tr[bgcolor="#F8F8FF"] > td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.update-form-table label {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
}

.update-form-table label i {
    font-size: 1.15em;
    vertical-align: middle;
}

.update-form-table .form-control,
.update-form-table .form-select {
    border-radius: 10px !important;
    border: 1.5px solid #cbd5e1 !important;
    padding: 8px 14px !important;
    font-size: 13.5px !important;
    color: #1e293b !important;
    background-color: #ffffff !important;
    transition: all 0.2s ease !important;
}

.update-form-table .form-control:focus,
.update-form-table .form-select:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16) !important;
}

.update-form-table .form-control:disabled,
.update-form-table .form-select:disabled {
    background-color: #f1f5f9 !important;
    color: #64748b !important;
    opacity: 0.85;
}

/* Sub tables (Activities & Disbursements) */
.update-sub-table {
    border-radius: 12px !important;
    overflow: hidden !important;
    border: 1px solid #e2e8f0 !important;
    margin-top: 10px;
    margin-bottom: 10px;
}

.update-sub-table thead th {
    background: #f1f5f9 !important;
    color: #334155 !important;
    font-weight: 700 !important;
    font-size: 13.5px !important;
    padding: 12px 14px !important;
    border-bottom: 2px solid #cbd5e1 !important;
}

.update-sub-table tbody td {
    padding: 12px 14px !important;
    font-size: 13.5px !important;
    color: #334155 !important;
    vertical-align: middle !important;
}

/* Action Bar Container */
.update-action-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px !important;
    background: #f8fafc !important;
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
    margin-top: 24px;
}

.update-action-footer .btn {
    border-radius: 10px !important;
    font-weight: 600 !important;
    padding: 9px 22px !important;
    font-size: 13.5px !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.update-action-footer .btn:hover {
    transform: translateY(-1px);
}

/* Modern Modals */
.modal-content {
    border-radius: 20px !important;
    border: 1px solid rgba(226, 232, 240, 0.85) !important;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.22) !important;
    overflow: hidden;
}

.modal-header:not(.modern-modal-header) {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 18px 24px !important;
}

.modal-header.modern-modal-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%) !important;
    padding: 20px 28px !important;
    border-bottom: none !important;
    color: #ffffff !important;
}

.modal-title {
    font-weight: 700 !important;
    font-size: 16px !important;
    color: #1e293b !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body {
    padding: 24px !important;
}

.modal-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    padding: 14px 24px !important;
    border-radius: 0 0 20px 20px !important;
}


