/*
 * KHUDII Welfare Organization - Core PHP UI
 * Visual language ported from the original React interface.
 */
:root {
    --kh-green: #0B6B50;
    --kh-green-dark: #095540;
    --kh-green-soft: rgba(11, 107, 80, .10);
    --kh-green-border: rgba(11, 107, 80, .22);
    --kh-bg: #F5F7F6;
    --kh-surface: #FFFFFF;
    --kh-surface-soft: #F7F8F7;
    --kh-text: #1F2933;
    --kh-muted: #667085;
    --kh-border: #E5E7EB;
    --kh-gold: #D4A72C;
    --kh-danger: #C2413A;
    --kh-warning: #B7791F;
    --kh-info: #2563EB;
    --kh-radius: 12px;
    --kh-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
    --bs-primary: #0B6B50;
    --bs-primary-rgb: 11, 107, 80;
    --bs-link-color: #0B6B50;
    --bs-link-hover-color: #095540;
    --bs-body-color: #1F2933;
    --bs-body-bg: #F5F7F6;
    --bs-border-color: #E5E7EB;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--kh-text);
    background: var(--kh-bg);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--kh-green); }
a:hover { color: var(--kh-green-dark); }
.text-muted { color: var(--kh-muted) !important; }
.text-primary { color: var(--kh-green) !important; }
.bg-primary { background-color: var(--kh-green) !important; }
.extra-small { font-size: 11px !important; }

/* Header */
.top-header {
    position: sticky;
    top: 0;
    z-index: 1040;
    background: var(--kh-surface);
    border-bottom: 1px solid var(--kh-border);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
}
.top-header-inner {
    width: min(1280px, 100%);
    height: 60px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.header-brand-wrap, .header-brand, .header-actions, .profile-trigger { display: flex; align-items: center; }
.header-brand-wrap { min-width: 0; gap: 8px; }
.header-brand { gap: 10px; min-width: 0; color: var(--kh-text); }
.header-brand:hover { color: var(--kh-text); }
.brand-icon, .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: var(--kh-green);
    color: #fff;
    box-shadow: var(--kh-shadow);
}
.brand-icon i { font-size: 17px; }
.brand-copy strong { display: block; font-size: 15px; line-height: 1.15; letter-spacing: -.02em; white-space: nowrap; }
.brand-mobile { display: none !important; }
.nonprofit-badge {
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    margin-left: 4px;
    border-radius: 6px;
    border: 1px solid var(--kh-green-border);
    background: var(--kh-green-soft);
    color: var(--kh-green);
    font-size: 10px;
    font-weight: 700;
}
.header-search { flex: 1 1 420px; max-width: 460px; position: relative; }
.header-search > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--kh-muted); font-size: 13px; pointer-events: none; }
.header-search input {
    width: 100%;
    height: 34px;
    padding: 0 35px 0 34px;
    border: 1px solid var(--kh-border);
    border-radius: 9px;
    outline: 0;
    background: var(--kh-surface-soft);
    color: var(--kh-text);
    font-size: 12px;
    transition: .18s ease;
}
.header-search input:hover, .header-search input:focus { background: #fff; border-color: var(--kh-green); box-shadow: 0 0 0 2px rgba(11, 107, 80, .08); }
.header-search input::placeholder { color: var(--kh-muted); }
.search-shortcut { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: 1px solid var(--kh-border); background: #fff; color: var(--kh-muted); font: 10px/1 monospace; border-radius: 4px; padding: 3px 5px; }
.header-actions { flex: 0 0 auto; gap: 7px; }
.header-divider { width: 1px; height: 18px; background: var(--kh-border); margin: 0 2px; }
.icon-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--kh-muted);
    transition: .18s ease;
}
.icon-btn:hover { background: var(--kh-surface-soft); color: var(--kh-text); }
.icon-btn i { font-size: 17px; }
.notification-btn { position: relative; }
.notification-dot { position: absolute; width: 8px; height: 8px; border-radius: 999px; background: var(--kh-gold); top: 7px; right: 7px; box-shadow: 0 0 0 2px #fff; }
.profile-trigger { border: 0; background: transparent; padding: 1px 0 1px 3px; gap: 8px; color: var(--kh-text); }
.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--kh-border);
    box-shadow: 0 0 0 1px rgba(16, 24, 40, .04);
}
.avatar-fallback { display: inline-flex; align-items: center; justify-content: center; background: var(--kh-green-soft); color: var(--kh-green); font-size: 12px; font-weight: 800; }
.profile-copy { flex-direction: column; text-align: left; line-height: 1.15; }
.profile-copy strong { font-size: 11px; color: var(--kh-text); max-width: 135px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.profile-copy small { margin-top: 3px; font-size: 10px; color: var(--kh-muted); }

/* Layout */
.app-shell {
    min-height: calc(100vh - 60px);
    margin: 0 auto;
    display: flex;
    align-items: stretch;
}
.sidebar {
    width: 228px;
    flex: 0 0 228px;
    align-self: stretch;
    background: #fff;
    border-right: 1px solid var(--kh-border);
    z-index: 1032;
}
.sidebar-inner {
    position: sticky;
    top: 60px;
    min-height: calc(100vh - 60px);
    padding: 22px 13px 18px;
    display: flex;
    flex-direction: column;
}
.sidebar-section-label { padding: 0 10px 7px; color: #98A2B3; font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.sidebar-link {
    min-height: 40px;
    padding: 9px 10px;
    border-radius: 9px;
    color: var(--kh-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: .16s ease;
}
.sidebar-link:hover { color: var(--kh-text); background: var(--kh-surface-soft); }
.sidebar-link.active { color: var(--kh-green); background: var(--kh-green-soft); font-weight: 700; }
.sidebar-link-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-link-main i { width: 18px; text-align: center; font-size: 15px; }
.sidebar-count {
    min-width: 23px;
    padding: 2px 7px;
    border: 1px solid var(--kh-border);
    border-radius: 999px;
    background: var(--kh-surface-soft);
    color: var(--kh-muted);
    text-align: center;
    font-size: 9px;
    line-height: 15px;
}
.sidebar-link.active .sidebar-count { border-color: var(--kh-green); background: var(--kh-green); color: #fff; }
.sidebar-fund-card { margin-top: auto; padding: 12px; border: 1px solid var(--kh-border); background: var(--kh-surface-soft); border-radius: 12px; }
.fund-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 10px; }
.fund-head strong { color: var(--kh-text); }
.fund-head span { color: var(--kh-green); font-weight: 800; }
.fund-track { height: 6px; margin: 8px 0 6px; border-radius: 999px; overflow: hidden; background: var(--kh-border); }
.fund-track span { display: block; height: 100%; border-radius: inherit; background: var(--kh-green); }
.sidebar-fund-card small { color: var(--kh-muted); font-size: 9px; }
.sidebar-bottom { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--kh-border); }
.sidebar-logout { color: #B42318; }
.sidebar-logout:hover { color: #B42318; background: #FEF3F2; }
.sidebar-overlay { display: none; }
.content-area { min-width: 0; flex: 1 1 auto; padding: 24px 28px 36px; overflow: hidden; }
.mobile-tabbar { display: none; }
.app-footer { width: min(1280px, 100%); margin: 0 auto; padding: 14px 28px 20px 256px; display: flex; justify-content: space-between; gap: 12px; color: var(--kh-muted); font-size: 10px; }

/* Common UI */
.btn { --bs-btn-border-radius: 8px; font-weight: 600; font-size: 12px; }
.btn-sm { --bs-btn-padding-y: .36rem; --bs-btn-padding-x: .75rem; --bs-btn-font-size: .75rem; }
.btn-primary, .btn-khudii { --bs-btn-color: #fff; --bs-btn-bg: var(--kh-green); --bs-btn-border-color: var(--kh-green); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--kh-green-dark); --bs-btn-hover-border-color: var(--kh-green-dark); --bs-btn-active-bg: var(--kh-green-dark); --bs-btn-active-border-color: var(--kh-green-dark); }
.btn-outline-primary, .btn-khudii-outline { --bs-btn-color: var(--kh-text); --bs-btn-bg: #fff; --bs-btn-border-color: var(--kh-border); --bs-btn-hover-color: var(--kh-text); --bs-btn-hover-bg: var(--kh-surface-soft); --bs-btn-hover-border-color: #D0D5DD; }
.btn-secondary { --bs-btn-color: var(--kh-text); --bs-btn-bg: var(--kh-surface-soft); --bs-btn-border-color: var(--kh-border); --bs-btn-hover-color: var(--kh-text); --bs-btn-hover-bg: #EEF1EF; --bs-btn-hover-border-color: #D0D5DD; }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--kh-border); --bs-btn-hover-bg: var(--kh-surface-soft); --bs-btn-hover-border-color: #D0D5DD; }
.rounded-pill.btn { border-radius: 8px !important; }
.card {
    --bs-card-border-color: var(--kh-border);
    background: var(--kh-surface);
    border: 1px solid var(--kh-border) !important;
    border-radius: var(--kh-radius) !important;
    box-shadow: var(--kh-shadow) !important;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.card:hover { box-shadow: 0 3px 8px rgba(16,24,40,.06) !important; }
.card h4, .card h5, .card h6 { color: var(--kh-text); }
.content-area > .d-flex:first-child h4, .content-area h2, .content-area h1 { color: var(--kh-text); letter-spacing: -.02em; }
.content-area > .d-flex:first-child { gap: 16px; flex-wrap: wrap; }
.content-area > .d-flex:first-child h4 { font-size: 20px; }
.form-control, .form-select, .input-group-text {
    min-height: 38px;
    border-color: var(--kh-border);
    border-radius: 8px;
    color: var(--kh-text);
    background-color: #fff;
    font-size: 12px;
}
.form-control:focus, .form-select:focus { border-color: var(--kh-green); box-shadow: 0 0 0 2px rgba(11,107,80,.09); }
.input-group .input-group-text { background: var(--kh-surface-soft); color: var(--kh-muted); }
.input-group > .form-control:not(:first-child) { border-left: 0; }
.form-label { color: #344054; font-size: 11px; }
.form-check-input:checked { background-color: var(--kh-green); border-color: var(--kh-green); }
.table { --bs-table-color: var(--kh-text); --bs-table-bg: transparent; --bs-table-hover-bg: #FAFBFA; margin: 0; }
.table thead th { border-bottom-color: var(--kh-border); background: var(--kh-surface-soft) !important; color: var(--kh-muted); font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.table tbody td { border-bottom-color: #EEF0F1; font-size: 12px; }
.table > :not(caption) > * > * { padding: .78rem .8rem; }
.progress { background: #EAECF0; border-radius: 999px; }
.progress-bar { background-color: var(--kh-green) !important; border-radius: 999px; }
.badge { border-radius: 6px; font-size: 9px; font-weight: 700; padding: 5px 7px; }
.badge-urgent { background: #FEF3F2; color: #B42318; border: 1px solid #FECDCA; }
.badge-high { background: #FFF6ED; color: #C4320A; border: 1px solid #FDDCAB; }
.badge-medium { background: #FFFAEB; color: #B54708; border: 1px solid #FEDF89; }
.badge-low { background: #EFF8FF; color: #175CD3; border: 1px solid #B2DDFF; }
.badge-completed, .badge-approved { background: #ECFDF3; color: #027A48; border: 1px solid #ABEFC6; }
.badge-in-progress, .badge-active { background: var(--kh-green-soft); color: var(--kh-green); border: 1px solid var(--kh-green-border); }
.badge-pending, .badge-to-do { background: #F2F4F7; color: #475467; border: 1px solid #EAECF0; }
.badge-on-hold { background: #FFFAEB; color: #B54708; border: 1px solid #FEDF89; }
.badge-rejected, .badge-archived { background: #FEF3F2; color: #B42318; border: 1px solid #FECDCA; }
.pagination { --bs-pagination-color: var(--kh-muted); --bs-pagination-border-color: var(--kh-border); --bs-pagination-hover-color: var(--kh-green); --bs-pagination-hover-bg: var(--kh-green-soft); --bs-pagination-focus-box-shadow: none; --bs-pagination-active-bg: var(--kh-green); --bs-pagination-active-border-color: var(--kh-green); }
.page-link { font-size: 11px; }
.list-group-item { border-color: var(--kh-border); background: transparent; }
.alert { border-radius: 10px; font-size: 12px; }
.khudii-alert { box-shadow: var(--kh-shadow); }
.stat-card-icon { width: 46px; height: 46px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; background: var(--kh-green-soft) !important; color: var(--kh-green) !important; }
.avatar-circle { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; object-fit: cover; background: var(--kh-green-soft); color: var(--kh-green); border: 1px solid var(--kh-green-border); font-size: 11px; font-weight: 800; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Dropdown / Modal */
.khudii-dropdown { border: 1px solid var(--kh-border); border-radius: 11px; padding: 6px; box-shadow: 0 12px 30px rgba(16,24,40,.12); }
.dropdown-heading { padding: 8px 10px 6px; color: var(--kh-text); font-size: 11px; font-weight: 800; }
.dropdown-empty { padding: 18px 12px; text-align: center; color: var(--kh-muted); font-size: 11px; }
.notification-menu { width: min(330px, calc(100vw - 24px)); }
.notification-item { display: block; padding: 9px 10px; border-radius: 8px; color: var(--kh-text); text-decoration: none; }
.notification-item:hover { background: var(--kh-surface-soft); color: var(--kh-text); }
.notification-item strong { display: block; font-size: 11px; }
.notification-item span { display: block; margin-top: 3px; color: var(--kh-muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu { min-width: 210px; }
.khudii-dropdown .dropdown-item { border-radius: 7px; padding: 8px 10px; font-size: 11px; display: flex; align-items: center; gap: 8px; }
.khudii-dropdown .dropdown-item:hover { background: var(--kh-surface-soft); }
.khudii-modal { border: 1px solid var(--kh-border); border-radius: 14px; box-shadow: 0 24px 60px rgba(16,24,40,.18); }
.global-search-field { position: relative; }
.global-search-field > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--kh-muted); z-index: 3; }
.global-search-field input { padding-left: 40px; }

/* Auth */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 560px); background: #fff; }
.auth-brand-panel { position: relative; overflow: hidden; min-height: 100vh; background: linear-gradient(145deg, #07533F 0%, #0B6B50 48%, #0B7456 100%); color: #fff; padding: clamp(36px, 7vw, 88px); display: flex; flex-direction: column; justify-content: space-between; }
.auth-brand-panel::before, .auth-brand-panel::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.10); }
.auth-brand-panel::before { width: 460px; height: 460px; right: -180px; top: -130px; box-shadow: 0 0 0 80px rgba(255,255,255,.025), 0 0 0 160px rgba(255,255,255,.018); }
.auth-brand-panel::after { width: 250px; height: 250px; left: -100px; bottom: -80px; }
.auth-brand-lockup, .auth-brand-copy { position: relative; z-index: 1; }
.auth-logo { display: inline-flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 800; }
.auth-logo .brand-icon { background: #fff; color: var(--kh-green); }
.auth-brand-copy { max-width: 650px; }
.auth-brand-copy h1 { max-width: 650px; margin: 0 0 16px; color: #fff; font-size: clamp(32px, 4.7vw, 62px); line-height: 1.02; letter-spacing: -.045em; }
.auth-brand-copy p { max-width: 590px; color: rgba(255,255,255,.76); font-size: 15px; line-height: 1.7; }
.auth-points { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.auth-point { border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.08); border-radius: 999px; padding: 7px 11px; font-size: 10px; font-weight: 700; }
.auth-form-panel { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px; background: #fff; }
.auth-card { width: min(390px, 100%); }
.auth-card h2 { margin: 0; color: var(--kh-text); font-size: 25px; letter-spacing: -.03em; }
.auth-card > p { margin: 7px 0 28px; color: var(--kh-muted); font-size: 12px; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; margin-bottom: 7px; color: #344054; font-size: 11px; font-weight: 700; }
.auth-input { position: relative; }
.auth-input > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--kh-muted); }
.auth-input .form-control { min-height: 42px; padding-left: 36px; }
.auth-help-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 22px; }
.auth-demo { margin-top: 24px; padding: 12px; border: 1px solid var(--kh-border); border-radius: 10px; background: var(--kh-surface-soft); color: var(--kh-muted); font-size: 10px; line-height: 1.6; }
.auth-demo strong { color: var(--kh-text); }
.auth-footer-note { margin-top: 26px; color: #98A2B3; text-align: center; font-size: 9px; }

/* Error pages */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.error-card { width: min(440px, 100%); padding: 34px; border: 1px solid var(--kh-border); border-radius: 16px; background: #fff; box-shadow: var(--kh-shadow); text-align: center; }
.error-card .brand-mark { margin: 0 auto 18px; }
.error-card h1 { font-size: 24px; }
.error-card p { color: var(--kh-muted); font-size: 12px; }

/* Print */
@media print {
    .top-header, .sidebar, .mobile-tabbar, .app-footer, .no-print, .sidebar-overlay { display: none !important; }
    .app-shell { display: block; width: 100%; }
    .content-area { padding: 0 !important; }
    body { background: #fff; }
    .card { box-shadow: none !important; }
}

/* Tablet / Mobile */
@media (max-width: 991.98px) {
    .top-header-inner { padding: 0 16px; }
    .sidebar { width: 210px; flex-basis: 210px; }
    .content-area { padding: 22px 20px 34px; }
    .app-footer { padding-left: 230px; }
}

@media (max-width: 767.98px) {
    .top-header-inner { height: 56px; padding: 0 12px; gap: 8px; }
    .brand-desktop { display: none !important; }
    .brand-mobile { display: block !important; }
    .brand-copy strong { font-size: 13px; }
    .brand-icon { width: 31px; height: 31px; }
    .header-actions { gap: 3px; }
    .btn-sm { --bs-btn-padding-x: .6rem; }
    .app-shell { display: block; min-height: calc(100vh - 56px); }
    .sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        bottom: 0;
        width: min(310px, 84vw);
        transform: translateX(-104%);
        transition: transform .22s ease;
        border-right: 1px solid var(--kh-border);
        box-shadow: 12px 0 36px rgba(16,24,40,.14);
        z-index: 1033;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-inner { position: static; min-height: 100%; max-height: calc(100vh - 56px); overflow-y: auto; }
    .sidebar-overlay { position: fixed; inset: 56px 0 0; z-index: 1031; background: rgba(16,24,40,.28); opacity: 0; visibility: hidden; transition: .2s ease; }
    .sidebar-overlay.show { display: block; opacity: 1; visibility: visible; }
    .mobile-tabbar { display: block; position: sticky; top: 56px; z-index: 1028; border-bottom: 1px solid var(--kh-border); background: #fff; padding: 6px 10px; }
    .mobile-tabbar-scroll { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
    .mobile-tabbar-scroll::-webkit-scrollbar { display: none; }
    .mobile-tab { flex: 0 0 auto; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 8px; color: var(--kh-muted); text-decoration: none; font-size: 10px; font-weight: 700; white-space: nowrap; }
    .mobile-tab.active { color: var(--kh-green); background: var(--kh-green-soft); }
    .mobile-tab b { min-width: 17px; padding: 1px 4px; border-radius: 999px; border: 1px solid var(--kh-border); text-align: center; font-size: 8px; }
    .mobile-tab.active b { background: var(--kh-green); color: #fff; border-color: var(--kh-green); }
    .content-area { padding: 17px 13px 28px; overflow: visible; }
    .app-footer { padding: 13px; flex-direction: column; align-items: center; text-align: center; }
    .content-area > .d-flex:first-child { align-items: flex-start !important; }
    .content-area > .d-flex:first-child h4 { font-size: 18px; }
    .table > :not(caption) > * > * { padding: .65rem .7rem; }
    .card { border-radius: 11px !important; }
    .auth-page { grid-template-columns: 1fr; }
    .auth-brand-panel { display: none; }
    .auth-form-panel { min-height: 100vh; padding: 24px 18px; background: var(--kh-bg); }
    .auth-card { padding: 24px 20px; border: 1px solid var(--kh-border); border-radius: 14px; background: #fff; box-shadow: var(--kh-shadow); }
}

@media (max-width: 479.98px) {
    .brand-copy strong { max-width: 112px; overflow: hidden; text-overflow: ellipsis; }
    .header-actions .btn-khudii { padding-left: 8px; padding-right: 8px; }
    .content-area { padding-left: 10px; padding-right: 10px; }
    .auth-help-row { align-items: flex-start; flex-direction: column; gap: 8px; }
}

/* Dashboard parity with original React layout */
.dashboard-greeting { border-radius: 16px !important; }
.dashboard-org-label { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; color: var(--kh-green); font-size: 11px; font-weight: 800; }
.dashboard-title { font-size: 24px; line-height: 1.2; font-weight: 800; }
.dashboard-greeting p { font-size: 12px; }
.kpi-card { min-height: 118px; }
.kpi-label { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-bottom: 9px; color: var(--kh-muted); font-size: 9px; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.kpi-label i { color: var(--kh-green); font-size: 14px; }
.kpi-value { margin-top: auto; color: var(--kh-text); font-size: 23px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; }
.kpi-money { font-size: 18px; white-space: nowrap; }
.kpi-note { margin-top: 5px; color: var(--kh-muted); font-size: 9px; }
.kpi-warning { color: #D99A16 !important; }
.kpi-complete, .text-success-kh { color: #16865B !important; }
.kpi-dot-green { color: var(--kh-green) !important; font-size: 8px !important; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.section-head h3 { margin: 0; color: var(--kh-text); font-size: 14px; font-weight: 800; }
.section-head p { margin: 4px 0 0; color: var(--kh-muted); font-size: 10px; }
.section-head a { flex: 0 0 auto; text-decoration: none; font-size: 10px; font-weight: 700; }
.section-head.compact { align-items: center; margin-bottom: 13px; }
.project-progress-list, .task-dashboard-list, .activity-list, .team-mini-list { display: flex; flex-direction: column; }
.project-progress-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 235px); gap: 18px; padding: 15px 0; border-top: 1px solid #EEF0F1; color: inherit; text-decoration: none; }
.project-progress-item:first-child { border-top: 0; padding-top: 2px; }
.project-progress-item:hover strong { color: var(--kh-green); }
.project-progress-main { min-width: 0; }
.project-progress-main > strong { display: block; margin: 7px 0 3px; color: var(--kh-text); font-size: 12px; }
.project-progress-main > small { display: block; color: var(--kh-muted); font-size: 9px; }
.project-code { color: var(--kh-muted); font: 9px/1 monospace; }
.project-budget-cell { text-align: right; min-width: 0; }
.project-budget-cell > strong { display: block; color: var(--kh-text); font-size: 11px; }
.project-budget-cell > small { display: block; color: var(--kh-muted); font-size: 9px; }
.project-budget-cell .progress { height: 5px; }
.project-budget-cell > span { display: block; margin-top: 4px; color: var(--kh-muted); font-size: 8px; }
.task-dashboard-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto 42px; gap: 10px; align-items: center; min-height: 60px; padding: 10px 0; border-top: 1px solid #EEF0F1; color: inherit; text-decoration: none; }
.task-dashboard-row:first-child { border-top: 0; }
.task-check-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--kh-green-soft); color: var(--kh-green); }
.task-dashboard-main { min-width: 0; }
.task-dashboard-main strong, .team-mini-row strong, .deadline-row strong { display: block; overflow: hidden; color: var(--kh-text); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.task-dashboard-main small, .team-mini-row small, .deadline-row small { display: block; margin-top: 3px; overflow: hidden; color: var(--kh-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.task-assignees-mini { display: flex; padding-left: 8px; }
.task-assignees-mini span { width: 24px; height: 24px; margin-left: -7px; border: 2px solid #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--kh-green-soft); color: var(--kh-green); font-size: 8px; font-weight: 800; }
.task-progress-number { color: var(--kh-green); font: 800 10px/1 monospace; text-align: right; }
.activity-row { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid #EEF0F1; }
.activity-row:first-child { border-top: 0; padding-top: 2px; }
.activity-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--kh-green-soft); color: var(--kh-green); }
.activity-row p { margin: 0; color: var(--kh-text); font-size: 9px; line-height: 1.4; }
.activity-row small, .activity-row time { display: block; margin-top: 2px; color: var(--kh-muted); font-size: 8px; line-height: 1.35; }
.team-mini-row { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid #EEF0F1; }
.team-mini-row:first-child { border-top: 0; padding-top: 2px; }
.team-mini-row img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1px solid var(--kh-border); }
.team-mini-row > span:last-child { color: var(--kh-muted); font-size: 8px; }
.deadline-card .section-head { margin-bottom: 6px; }
.deadline-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid #EEF0F1; color: inherit; text-decoration: none; }
.deadline-row > span { border-radius: 6px; padding: 4px 6px; background: #FEF3F2; color: #B42318; font-size: 8px; font-weight: 800; }
.empty-state { padding: 16px 4px; color: var(--kh-muted); font-size: 10px; }

@media (max-width: 767.98px) {
    .dashboard-title { font-size: 20px; }
    .dashboard-kpis .col { min-width: 0; }
    .kpi-card { min-height: 108px; padding: 12px !important; }
    .kpi-value { font-size: 20px; }
    .kpi-money { font-size: 15px; }
    .project-progress-item { grid-template-columns: 1fr; gap: 9px; }
    .project-budget-cell { text-align: left; }
    .task-dashboard-row { grid-template-columns: 28px minmax(0,1fr) auto; }
    .task-dashboard-row .task-assignees-mini, .task-dashboard-row .badge { display: none; }
}

/* Projects */
.page-hero { border-radius: 16px !important; }
.page-hero h2 { font-size: 20px; font-weight: 800; letter-spacing: -.025em; }
.page-hero p { font-size: 11px; }
.filter-strip { box-shadow: none !important; }
.search-control { position: relative; }
.search-control i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); z-index: 2; color: var(--kh-muted); }
.search-control input { padding-left: 35px; }
.project-card { justify-content: space-between; border-radius: 16px !important; }
.project-card:hover { border-color: rgba(11,107,80,.28) !important; transform: translateY(-1px); }
.project-card h3 { margin: 9px 0 7px; font-size: 14px; line-height: 1.4; }
.project-card h3 a { color: var(--kh-text); text-decoration: none; }
.project-card:hover h3 a { color: var(--kh-green); }
.project-card p { min-height: 37px; margin: 0 0 16px; color: var(--kh-muted); font-size: 10px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.category-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--kh-muted); font-size: 9px; font-weight: 700; }
.category-chip i, .category-list-preview i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.project-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.project-meta-grid > span { min-width: 0; padding: 9px; border: 1px solid var(--kh-border); border-radius: 9px; background: var(--kh-surface-soft); display: grid; grid-template-columns: 16px 1fr; column-gap: 6px; }
.project-meta-grid i { grid-row: span 2; align-self: center; color: var(--kh-green); }
.project-meta-grid small { color: var(--kh-muted); font-size: 8px; }
.project-meta-grid strong { overflow: hidden; color: var(--kh-text); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.project-card-bottom { margin-top: 18px; }
.budget-line, .budget-foot { display: flex; justify-content: space-between; gap: 8px; }
.budget-line { margin-bottom: 7px; color: var(--kh-muted); font-size: 9px; }
.budget-line strong { color: var(--kh-text); font-size: 9px; }
.project-card-bottom .progress { height: 6px; }
.budget-foot { margin-top: 6px; color: var(--kh-muted); font-size: 8px; }
.btn-link-kh { color: var(--kh-green); text-decoration: none; font-size: 10px; font-weight: 800; }
.icon-action { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--kh-border); border-radius: 8px; background: #fff; color: var(--kh-muted); text-decoration: none; }
.icon-action:hover { background: var(--kh-surface-soft); color: var(--kh-green); }
.category-list-preview { display: flex; flex-wrap: wrap; gap: 6px; }
.category-list-preview span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border: 1px solid var(--kh-border); border-radius: 7px; color: var(--kh-muted); font-size: 9px; }
.empty-panel { min-height: 230px; align-items: center; justify-content: center; text-align: center; color: var(--kh-muted); }
.empty-panel > i { font-size: 32px; color: var(--kh-green); }
.empty-panel strong { margin-top: 8px; color: var(--kh-text); }
.empty-panel span { margin-top: 3px; font-size: 10px; }

/* Tasks / Kanban */
.view-switcher { display: flex; padding: 4px; border: 1px solid var(--kh-border); border-radius: 10px; background: var(--kh-surface-soft); }
.view-switcher a { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; border-radius: 7px; color: var(--kh-muted); text-decoration: none; font-size: 9px; font-weight: 700; }
.view-switcher a.active { background: #fff; color: var(--kh-green); box-shadow: var(--kh-shadow); }
.kanban-board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 4px; }
.kanban-column { min-width: 230px; padding: 10px; border: 1px solid var(--kh-border); border-radius: 14px; background: #F9FAF9; }
.kanban-head { min-height: 35px; padding: 3px 4px 9px; display: flex; align-items: center; justify-content: space-between; color: var(--kh-text); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.kanban-head > span { display: flex; align-items: center; gap: 7px; }
.kanban-head b { min-width: 22px; padding: 2px 6px; border: 1px solid var(--kh-border); border-radius: 999px; background: #fff; color: var(--kh-muted); text-align: center; font-size: 8px; }
.kanban-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #98A2B3; }
.kanban-dot.gold { background: var(--kh-gold); }.kanban-dot.green { background: #1F8A70; }.kanban-dot.complete { background: #16865B; }
.kanban-stack { display: flex; flex-direction: column; gap: 9px; }
.kanban-card { padding: 13px; border: 1px solid var(--kh-border); border-radius: 12px; background: #fff; box-shadow: var(--kh-shadow); }
.kanban-card:hover { border-color: rgba(11,107,80,.28); }
.task-project-code { color: var(--kh-muted); font: 8px/1 monospace; }
.kanban-card h3 { margin: 10px 0 6px; font-size: 11px; line-height: 1.4; }
.kanban-card h3 a { color: var(--kh-text); text-decoration: none; }
.kanban-card h3 a:hover { color: var(--kh-green); }
.kanban-card p { height: 29px; margin: 0 0 10px; color: var(--kh-muted); font-size: 8px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-progress-head { display: flex; justify-content: space-between; margin-bottom: 5px; color: var(--kh-muted); font-size: 8px; }
.task-progress-head strong { color: var(--kh-green); }
.kanban-card .progress { height: 5px; }
.kanban-meta { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 7px; margin-top: 12px; color: var(--kh-muted); font-size: 8px; }
.kanban-card .task-assignees-mini span { width: 21px; height: 21px; }
.kanban-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 11px; padding-top: 9px; border-top: 1px solid #EEF0F1; }
.kanban-actions a { color: var(--kh-muted); text-decoration: none; font-size: 9px; font-weight: 700; }
.kanban-actions a:hover { color: var(--kh-green); }
.kanban-empty { padding: 24px 10px; border: 1px dashed #D0D5DD; border-radius: 10px; color: #98A2B3; text-align: center; font-size: 9px; }
.task-table-progress { min-width: 105px; display: flex; align-items: center; gap: 7px; }
.task-table-progress .progress { width: 70px; height: 5px; }
.task-table-progress span { color: var(--kh-green); font-size: 8px; font-weight: 800; }
@media (max-width: 767.98px) { .view-switcher span { display: none; } .kanban-board { grid-template-columns: repeat(4, 82vw); margin-right: -10px; padding-right: 10px; } }

/* Team directory */
.team-card { border-radius: 16px !important; }
.team-card:hover { border-color: rgba(11,107,80,.25) !important; }
.team-card-head { display: grid; grid-template-columns: 48px minmax(0,1fr) 30px; gap: 11px; align-items: center; }
.team-card-head > img, .team-avatar-fallback { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--kh-border); object-fit: cover; }
.team-avatar-fallback { display: flex; align-items: center; justify-content: center; background: var(--kh-green-soft); color: var(--kh-green); font-size: 15px; font-weight: 800; }
.team-card-title { min-width: 0; }
.team-card-title h3 { min-width: 0; max-width: 100%; margin: 0; overflow: hidden; color: var(--kh-text); font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.team-card-title > span { display: block; margin-top: 3px; color: var(--kh-green); font-size: 9px; font-weight: 700; }
.status-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; }.status-dot.active { background: #16865B; }.status-dot.inactive { background: #C94A4A; }
.team-designation { margin: 14px 0 10px; min-height: 30px; color: var(--kh-muted); font-size: 10px; line-height: 1.5; }
.team-contact-list { display: flex; flex-direction: column; gap: 8px; }
.team-contact-list > a, .team-contact-list > span { display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 5px; align-items: center; color: var(--kh-muted); text-decoration: none; font-size: 9px; }
.team-contact-list i { color: var(--kh-green); }
.team-contact-list b, .team-contact-list span { overflow: hidden; color: var(--kh-text); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.team-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 17px; padding-top: 13px; border-top: 1px solid var(--kh-border); }

/* Expenses */
.expense-summary-card { min-height: 118px; display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: center; }
.expense-summary-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.expense-summary-icon.approved { background: #ECFDF3; color: #16865B; }.expense-summary-icon.pending { background: #FFFAEB; color: #D99A16; }.expense-summary-icon.total { background: var(--kh-green-soft); color: var(--kh-green); }
.expense-summary-card small { display: block; color: var(--kh-muted); font-size: 9px; font-weight: 700; }
.expense-summary-card strong { display: block; margin-top: 4px; color: var(--kh-text); font-size: 18px; letter-spacing: -.025em; }
.expense-summary-card div > span { display: block; margin-top: 3px; color: var(--kh-muted); font-size: 8px; }
.expense-amount { color: var(--kh-green); white-space: nowrap; }
.receipt-link { color: var(--kh-green); text-decoration: none; font-size: 9px; font-weight: 700; }

/* Reports */
.report-card { padding: 1.25rem; }
.report-tabs { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: thin; }
.report-tab { white-space: nowrap; padding: .7rem 1rem; border-radius: .7rem; color: var(--kh-muted); font-weight: 700; text-decoration: none; transition: .18s ease; }
.report-tab:hover { color: var(--kh-green); background: #eef7f3; }
.report-tab.active { color: #fff; background: var(--kh-green); }
.text-kh-green { color: var(--kh-green) !important; }
.empty-table { text-align: center; color: var(--kh-muted); padding: 2.25rem !important; }
@media (max-width: 767.98px) { .report-card { padding: .85rem; } .report-tab { padding: .6rem .8rem; font-size: .82rem; } }

/* Settings */
.settings-card { box-shadow: var(--kh-shadow); border: 1px solid var(--kh-border) !important; border-radius: var(--kh-radius); }
.settings-divider { height: 1px; background: var(--kh-border); margin: 1.5rem 0; }
.settings-side-icon { width: 42px; height: 42px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--kh-green-soft); color: var(--kh-green); font-size: 19px; margin-bottom: 1rem; }
.settings-status-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.settings-status-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--kh-border); font-size: .85rem; }
.settings-status-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.settings-status-list span { color: var(--kh-muted); }
.settings-status-list strong { color: var(--kh-text); text-align: right; }
