:root {
    --tevet-green: #0b6e4f;
    --tevet-green-dark: #084c37;
    --tevet-gold: #f0a500;
    --sidebar-w: 250px;
    --sidebar-mini: 72px;
    --topbar-h: 64px;
    --line: #eceff1;
}

body {
    background: #f5f7f9;
    font-size: .95rem;
}

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: #fff;
    border-right: 1px solid var(--line);
    color: #495057;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1030;
    transition: width .2s ease, left .2s ease;
    scrollbar-width: thin;
}
.sidebar .brand {
    height: var(--topbar-h);
    padding: 0 1.1rem;
    font-weight: 700;
    color: #212529;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: .6rem;
    white-space: nowrap;
    line-height: 1.15;
}
.sidebar .brand-logo { height: 38px; width: auto; object-fit: contain; flex-shrink: 0; }
.sidebar .brand small { font-weight: 500; color: var(--tevet-green); font-size: .75rem; }
.sidebar .nav-section {
    padding: 1rem 1.35rem .35rem;
    font-size: .7rem;
    font-weight: 700;              /* the section headings stand out from the links under them */
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #5c6873;
    white-space: normal;           /* a long heading wraps onto a second line */
    line-height: 1.3;
}
.sidebar a.nav-link {
    color: #495057;
    margin: 1px .65rem;
    padding: .5rem .75rem;
    border-radius: .5rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    white-space: normal;           /* a link whose name is longer than the menu drops to a second line */
    font-size: .9rem;
    line-height: 1.25;
    transition: background-color .15s, color .15s;
}
.sidebar a.nav-link .nav-text { min-width: 0; overflow-wrap: anywhere; }
.sidebar a.nav-link i { font-size: 1.1rem; width: 1.25rem; text-align: center; flex-shrink: 0; }
.sidebar a.nav-link:hover { background: #f1f6f4; color: var(--tevet-green); }
.sidebar .nav-count { margin-left: auto; font-size: .68rem; font-weight: 600; }
.sidebar a.nav-link.active {
    background: rgba(11, 110, 79, .1);
    color: var(--tevet-green);
    font-weight: 600;
}

/* ---- Content area ---- */
.content-wrap { margin-left: var(--sidebar-w); transition: margin-left .2s ease;
                /* A column as tall as the window, so the footer sits at the bottom even on short pages. */
                min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: var(--topbar-h);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
    padding: 0 1.25rem;
}
.topbar h5 { font-weight: 600; font-size: 1.05rem; }
.sidebar-toggle {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: #495057;
    font-size: 1.35rem;
}
.sidebar-toggle:hover { background: #f1f3f5; color: var(--tevet-green); }
.page-body { padding: 1.25rem; flex: 1 0 auto; }
.app-footer { flex-shrink: 0; border-top: 1px solid var(--line); background: #fff; }

/* Icons only: desktop when collapsed, tablets always (the full menu slides in over the page) */
@media (min-width: 1200px) {
    .sidebar-collapsed .sidebar { width: var(--sidebar-mini); }
    .sidebar-collapsed .content-wrap { margin-left: var(--sidebar-mini); }
    .sidebar-collapsed .sidebar .brand-text,
    .sidebar-collapsed .sidebar .nav-text { display: none; }
    .sidebar-collapsed .sidebar .brand { justify-content: center; padding: 0; }
    .sidebar-collapsed .sidebar .brand-logo { height: 34px; }
    .sidebar-collapsed .sidebar .nav-section { padding: 0; margin: .6rem 1.1rem; border-top: 1px solid var(--line); }
    .sidebar-collapsed .sidebar a.nav-link { justify-content: center; padding: .6rem 0; }
    .sidebar-collapsed .sidebar a.nav-link { position: relative; }
    .sidebar-collapsed .sidebar .nav-count { position: absolute; top: 2px; right: 8px; margin: 0; font-size: .6rem; padding: .2em .45em; }
}
@media (min-width: 769px) and (max-width: 1199.98px) {
    .sidebar:not(.open) { width: var(--sidebar-mini); }
    .content-wrap { margin-left: var(--sidebar-mini); }
    .sidebar:not(.open) .brand-text,
    .sidebar:not(.open) .nav-text { display: none; }
    .sidebar:not(.open) .brand { justify-content: center; padding: 0; }
    .sidebar:not(.open) .brand-logo { height: 34px; max-width: 54px; }
    .sidebar:not(.open) .nav-section { padding: 0; margin: .6rem 1.1rem; border-top: 1px solid var(--line); }
    .sidebar:not(.open) a.nav-link { justify-content: center; padding: .7rem 0; position: relative; }
    .sidebar:not(.open) .nav-count { position: absolute; top: 2px; right: 8px; margin: 0; font-size: .6rem; padding: .2em .45em; }
    .sidebar.open { width: min(300px, 85vw); }
}

/* Drawer — phones */
@media (max-width: 768px) {
    .sidebar { left: auto; width: min(300px, 85vw); transform: translateX(-105%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
    .sidebar.open { transform: none; }
    .content-wrap { margin-left: 0; }
}

/* The open menu (tablets, phones): over the page, with a dimmed backdrop */
.sidebar-backdrop { display: none; }
.sidebar-close { display: none; }
@media (max-width: 1199.98px) {
    .sidebar { height: 100dvh; overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom); }
    .sidebar.open { box-shadow: 0 0 40px rgba(0, 0, 0, .2); z-index: 1045; }
    .sidebar.open .sidebar-close { display: inline-flex; position: absolute; top: calc(var(--topbar-h) / 2 - 19px); right: .6rem;
        width: 38px; height: 38px; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: #f1f3f5; color: #495057; }
    .sidebar.open a.nav-link { padding: .65rem .75rem; }
    .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 1040; background: rgba(15, 30, 24, .45);
        opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s linear .2s; }
    .nav-open .sidebar-backdrop { opacity: 1; visibility: visible; transition: opacity .2s ease; }
    .nav-open, .nav-open body { overflow: hidden; }
}

/* ---- Phones and tablets: an app feel ---- */
html { -webkit-tap-highlight-color: transparent; }
a, button, .btn, [role="button"], label, select, summary { touch-action: manipulation; }
.is-scrolled .topbar { box-shadow: 0 2px 12px rgba(8, 76, 55, .08); }

/* The tab bar at the bottom (phones only) */
.tabbar { display: none; }
@media (max-width: 768px) {
    :root { --topbar-h: 56px; --tabbar-h: 60px; }
    body { font-size: .93rem; }
    .topbar { padding: 0 .5rem 0 .35rem; padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
    .topbar-title { font-size: 1rem !important; max-width: 52vw; }
    .table-responsive > .tbl-wide { min-width: var(--tbl-min, 640px); }
    .table-responsive { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
    .page-body { padding: .85rem .75rem calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 1rem); }
    .app-footer { display: none; }

    .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035;
        height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
        background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .04); }
    .tabbar .tab { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
        border: 0; background: none; padding: 6px 2px 4px; color: #6c7a74; text-decoration: none; font-size: .68rem; font-weight: 500; }
    .tabbar .tab-ic { position: relative; display: flex; align-items: center; justify-content: center; width: 52px; height: 28px; border-radius: 14px;
        font-size: 1.25rem; transition: background-color .2s, color .2s; }
    .tabbar .tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tabbar .tab.active { color: var(--tevet-green); font-weight: 700; }
    .tabbar .tab.active .tab-ic { background: rgba(11, 110, 79, .12); }
    .tabbar .tab:active .tab-ic { background: rgba(11, 110, 79, .18); }
    .tabbar .tab-badge { position: absolute; top: -3px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
        background: #dc3545; color: #fff; font-size: .62rem; font-weight: 700; line-height: 17px; text-align: center; border: 2px solid #fff; box-sizing: content-box; }

    /* Headings with buttons beside them wrap instead of squeezing */
    .page-body > .d-flex.justify-content-between, .card-header.d-flex { flex-wrap: wrap; gap: .5rem; }
    .page-body > .d-flex.justify-content-between > .d-flex { flex-wrap: wrap; }
    /* Tab strips scroll sideways */
    .page-body .nav-tabs, .page-body .nav-pills { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
    .page-body .nav-tabs::-webkit-scrollbar, .page-body .nav-pills::-webkit-scrollbar { display: none; }
    .page-body .nav-tabs .nav-link, .page-body .nav-pills .nav-link { white-space: nowrap; }
    .card-body { padding: .9rem; }
    .stat-card .stat-value { font-size: 1.25rem; }
    .stat-card .stat-icon { font-size: 1.9rem; }
    .top-search-menu { position: fixed; left: 8px; right: 8px; width: auto; }

    /* Pop-ups rise from the bottom as a sheet */
    .modal-dialog, .modal-dialog-centered { margin: 0; max-width: none; min-height: 100%; display: flex; align-items: flex-end; }
    .modal-content { border: 0; border-radius: 18px 18px 0 0; max-height: 94dvh; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom); }
    .modal-content::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: #d5dcd9; margin: 8px auto 0; flex-shrink: 0; }
    .modal-dialog-scrollable .modal-content { overflow: hidden; }
    .modal.fade .modal-dialog { transform: translateY(40px); transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
    .modal.show .modal-dialog { transform: none; }
    .modal-footer { position: sticky; bottom: 0; background: #fff; }

    /* Pop-up messages sit just under the top bar, full width */
    .swal2-container.swal2-top-end { padding-right: 8px; padding-left: 8px; }
    .swal2-top-end > .swal2-popup:not(.swal2-toast) { width: 100% !important; }
}

/* Touch screens: larger targets, and 16px inputs so phones do not zoom in on them */
@media (pointer: coarse) {
    .btn { min-height: 40px; }
    .btn-sm { min-height: 34px; }
    .form-check-input { width: 1.2em; height: 1.2em; }
    .dropdown-item { padding-top: .55rem; padding-bottom: .55rem; }
    .act-menu-btn { width: 38px; height: 38px; }
    .sidebar a.nav-link { padding-top: .6rem; padding-bottom: .6rem; }
}
@media (pointer: coarse) and (max-width: 1199.98px) {
    .form-control, .form-select, .input-group-text { font-size: 16px; }
    .form-control-sm, .form-select-sm { font-size: 16px; }
}

/* The notifications list fits the screen */
.topbar .dropdown-menu { max-width: calc(100vw - 16px); }

/* Opened from the home screen (no browser bar): no text selection on the chrome, no rubber band */
@media (display-mode: standalone) {
    body { overscroll-behavior-y: none; }
    .topbar, .tabbar, .sidebar { -webkit-user-select: none; user-select: none; }
}

@media print {
    .tabbar, .sidebar, .sidebar-backdrop, .topbar { display: none !important; }
    .content-wrap { margin-left: 0 !important; }
}

/* ---- Stat cards ---- */
.stat-card {
    border: none;
    border-radius: .6rem;
    color: #fff;
    overflow: hidden;
}
.stat-card .stat-icon { font-size: 2.4rem; opacity: .35; }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-card .stat-label { font-size: .8rem; opacity: .9; }
.bg-grad-green { background: linear-gradient(135deg, #0b6e4f, #0e8a63); }
.bg-grad-blue  { background: linear-gradient(135deg, #1c6fb3, #2a8fd6); }
.bg-grad-gold  { background: linear-gradient(135deg, #d98e00, #f0a500); }
.bg-grad-teal  { background: linear-gradient(135deg, #117a8b, #17a2b8); }
.bg-grad-purple{ background: linear-gradient(135deg, #5b3a8e, #7b52b3); }
.bg-grad-rose  { background: linear-gradient(135deg, #a31545, #cc2a5e); }

.card { border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0, 0, 0, .03); border-radius: .65rem; }
.card-header { background: #fff; border-bottom: 1px solid var(--line); font-weight: 600; }

/* ---- Login ---- */
.login-page { background: #fff; }
.login-logo { height: 56px; width: auto; object-fit: contain; }
.text-tevet { color: var(--tevet-green) !important; }
.bg-tevet { background-color: var(--tevet-green) !important; }
.bg-tevet-gold { background-color: var(--tevet-gold) !important; }
.btn-tevet { background: var(--tevet-green); border-color: var(--tevet-green); color: #fff; font-weight: 600; }
.btn-tevet:hover, .btn-tevet:focus { background: var(--tevet-green-dark); border-color: var(--tevet-green-dark); color: #fff; }
.login-page .form-control:focus { border-color: var(--tevet-green); box-shadow: 0 0 0 .2rem rgba(11, 110, 79, .15); }

.login-section-title {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6c757d;
}
.login-card {
    max-width: 440px;
    width: 100%;
    margin: auto;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(8, 76, 55, .08);
}
.demo-accounts summary { cursor: pointer; }
.demo-account { cursor: pointer; }

.fin-panel {
    background: #fff;
    border: 1px solid #eef0f2;
    border-radius: .75rem;
    padding: 1rem 1.1rem;
}
.fin-tile {
    position: relative;
    height: 100%;
    padding: .9rem 1rem;
    border-radius: .75rem;
    border: 1px solid #eef0f2;
    border-top: 3px solid var(--tone);
    background: #fff;
    overflow: hidden;
}
.fin-tile .fin-icon { position: absolute; right: .75rem; top: .6rem; font-size: 1.4rem; color: var(--tone); opacity: .3; }
.fin-tile .fin-value { font-size: 1.2rem; font-weight: 700; color: #212529; white-space: nowrap; }
.fin-tile .fin-label { font-size: .75rem; color: #6c757d; }
.fin-green { --tone: #0b6e4f; }
.fin-gold  { --tone: #f0a500; }
.fin-teal  { --tone: #17a2b8; }
.fin-blue  { --tone: #2a8fd6; }

/* ---- Row action menu: a ⋮ button whose menu pops up above the row ---- */
.act-menu-btn { width: 32px; height: 32px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center;
                justify-content: center; color: #4b5a54; background: transparent; border: 1px solid transparent; }
.act-menu-btn:hover, .act-menu-btn[aria-expanded="true"] { background: #e6f4ee; color: var(--tevet-green); border-color: #cfe6dc; }
.act-menu .dropdown-menu { min-width: 250px; padding: .4rem; border: 1px solid #e3ebe7; border-radius: 12px;
                           box-shadow: 0 14px 40px rgba(8, 76, 55, .16); font-size: .875rem; }
.act-menu .dropdown-menu.show { animation: act-pop .16s ease-out; }
.act-menu .dropdown-menu form { margin: 0; }
.act-menu .dropdown-item { display: flex; align-items: flex-start; gap: .65rem; border-radius: 8px; padding: .5rem .65rem; white-space: normal; }
.act-menu .dropdown-item > i { font-size: 1.05rem; line-height: 1.25; width: 1.1rem; text-align: center; flex-shrink: 0; }
.act-menu .dropdown-item span { display: flex; flex-direction: column; line-height: 1.25; font-weight: 500; }
.act-menu .dropdown-item small { color: #7a8a83; font-weight: 400; font-size: .75rem; margin-top: 1px; }
.act-menu .dropdown-item:hover, .act-menu .dropdown-item:focus { background: #f1f8f5; }
.act-menu .dropdown-item.text-danger:hover { background: #fdf0f1; }
.act-menu .dropdown-divider { margin: .35rem .25rem; }
.act-menu-head { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8a9893; padding: .3rem .65rem .4rem; }
@keyframes act-pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .act-menu .dropdown-menu.show { animation: none; } }

/* ---- Multi-step form (New / Edit proposal call) ---- */
.wiz-steps { display: flex; gap: 0; padding: .75rem 1rem; border-bottom: 1px solid #edf1ef; background: #fafcfb; counter-reset: none; }
.wiz-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; background: none; border: 0; position: relative;
            color: #8a9893; font-size: .78rem; font-weight: 600; padding: 0; cursor: pointer; }
.wiz-step + .wiz-step::before { content: ''; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: #e1e8e5; z-index: 0; }
.wiz-step.done + .wiz-step::before, .wiz-step.active::before { background: var(--tevet-green); }
.wiz-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative; z-index: 1;
           background: #fff; border: 2px solid #d5e0db; color: #8a9893; font-weight: 700; transition: all .2s; }
.wiz-step.active .wiz-dot { background: var(--tevet-green); border-color: var(--tevet-green); color: #fff; box-shadow: 0 0 0 4px rgba(11, 110, 79, .15); }
.wiz-step.active { color: var(--tevet-green); }
.wiz-step.done .wiz-dot { background: #e6f4ee; border-color: var(--tevet-green); color: var(--tevet-green); }
.wiz-step.done .wiz-dot { font-size: 0; }
.wiz-step.done .wiz-dot::after { content: '\F26E'; font-family: 'bootstrap-icons'; font-size: 1rem; }
.wiz-pane { animation: wiz-in .2s ease-out; }
@keyframes wiz-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
.wiz-card { border: 1px solid #e6ece9; border-radius: 12px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.wiz-card h6 { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--tevet-green); margin-bottom: .8rem; }
.wiz-doc { display: grid; grid-template-columns: auto 1fr 130px auto auto; gap: .5rem; align-items: center;
           border: 1px solid #e6ece9; border-radius: 10px; padding: .45rem .6rem; background: #fbfdfc; }
@media (max-width: 575.98px) { .wiz-doc { grid-template-columns: 1fr auto; } .wiz-doc > i, .wiz-doc .wd-type { display: none; } .wiz-doc .form-switch { grid-column: 1; } }
.wiz-review-head { background: linear-gradient(135deg, #f1f8f5, #e6f4ee); border: 1px solid #d5eadf; border-radius: 12px; padding: .9rem 1rem; margin-bottom: 1rem; }
@media (prefers-reduced-motion: reduce) { .wiz-pane { animation: none; } }

/* Switches and checks in the call form use the TEVET green */
#callWizard .form-check-input:checked { background-color: var(--tevet-green); border-color: var(--tevet-green); }
#callWizard .form-check-input:focus { border-color: #7fbfa8; box-shadow: 0 0 0 .2rem rgba(11, 110, 79, .2); }

/* ---- M&E drill-down (monitoring.php): windows -> institutions -> programmes ---- */
.me-card { display: block; height: 100%; background: #fff; border: 1px solid #e3ebe7; border-radius: 14px; padding: 1.1rem 1.15rem; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s, border-color .15s; }
.me-card:hover { color: inherit; border-color: #b9dccd; box-shadow: 0 10px 28px rgba(8, 76, 55, .1); transform: translateY(-2px); }
.me-win { border-top: 1px solid #e3ebe7; }   /* same as the other sides: no coloured ribbon on the window cards */
.me-win-code { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 32px; padding: 0 .6rem; border-radius: 8px; background: #e6f4ee; color: var(--tevet-green); font-weight: 800; }
.me-mini { display: flex; gap: 1rem; }
.me-mini > div { display: flex; flex-direction: column; line-height: 1.2; }
.me-mini strong { font-size: 1.05rem; }
.me-mini span { font-size: .72rem; color: #7a8a83; }
.me-inst-ic { width: 42px; height: 42px; border-radius: 10px; background: #e6f4ee; color: var(--tevet-green); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.me-crumb { font-size: .875rem; }
.me-crumb a { color: var(--tevet-green); text-decoration: none; }
.me-crumb a:hover { text-decoration: underline; }
.me-prog { border-radius: 14px; border-color: #e3ebe7; }
.me-level:not(.d-none) { animation: wiz-in .2s ease-out; }
/* A sub-window's overall results (monitoring.php?window=…&sub=…) */
.me-hero { border: 1px solid #e3ebe7; border-radius: 16px; background: linear-gradient(135deg, #f4faf7 0%, #fff 55%); box-shadow: 0 6px 22px rgba(8, 76, 55, .06); }
.me-hero-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tevet-green); margin-bottom: .15rem; }
.me-hero-ring-box { display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fff; border: 1px solid #e8efeb; border-radius: 14px; padding: 1rem; }
.me-ring { --p: 0; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(currentColor calc(var(--p) * 1%), #e9efec 0); }
.me-ring > div { width: 104px; height: 104px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.me-ring strong { font-size: 1.7rem; font-weight: 800; color: #1d2b25; line-height: 1; }
.me-ring span { font-size: .72rem; color: #7a8a83; margin-top: .2rem; }
.me-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.me-tile { background: #fff; border: 1px solid #e8efeb; border-radius: 12px; padding: .65rem .8rem; display: grid; grid-template-columns: auto 1fr; column-gap: .6rem; align-items: center; }
.me-tile i { grid-row: span 2; width: 34px; height: 34px; border-radius: 9px; background: #e6f4ee; color: var(--tevet-green); display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.me-tile strong { font-size: 1.15rem; line-height: 1.1; color: #1d2b25; }
.me-tile span { font-size: .72rem; color: #7a8a83; }
.me-tile-warn i { background: #fdecea; color: #b42318; }
.me-hero .ms-strip { background: #fff; border: 1px solid #e8efeb; border-radius: 12px; padding: .5rem .8rem; }
@media (max-width: 575.98px) { .me-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Institutions toolbar: search, M&E status chips, grid/table */
.me-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.me-search { position: relative; flex: 1 1 220px; max-width: 320px; }
.me-search i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: #8a9a93; pointer-events: none; }
.me-search .form-control { padding-left: 2.1rem; border-radius: 999px; border-color: #dfe8e3; }
.me-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.me-chip { border: 1px solid #dfe8e3; background: #fff; color: #44534c; border-radius: 999px; padding: .3rem .75rem; font-size: .8rem; display: inline-flex; align-items: center; gap: .35rem; transition: background .15s, border-color .15s, color .15s; }
.me-chip span { background: #eef3f0; border-radius: 999px; padding: 0 .45rem; font-size: .72rem; font-weight: 700; }
.me-chip:hover { border-color: #b9dccd; }
.me-chip.active { background: var(--tevet-green); border-color: var(--tevet-green); color: #fff; }
.me-chip.active span { background: rgba(255, 255, 255, .22); }
.me-chip-attn i { color: #b42318; } .me-chip-done i { color: var(--tevet-green); }
.me-chip.active i { color: #fff; }
.me-view { margin-left: auto; background: #eef3f0; border-radius: 10px; padding: 3px; }
.me-view .btn { border: 0; border-radius: 8px !important; color: #5b6b64; }
.me-view .btn.active { background: #fff; color: var(--tevet-green); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.me-state { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 600; border-radius: 999px; padding: .15rem .6rem; background: #f1f3f2; color: #6b7a73; white-space: nowrap; }
.me-state-done { background: #e6f4ee; color: var(--tevet-green); }
.me-table-card { border: 1px solid #e3ebe7; border-radius: 14px; overflow: hidden; }
.me-table thead th { background: #f6f9f7; font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: #6b7a73; font-weight: 700; white-space: nowrap; border-bottom: 1px solid #e3ebe7; }
.me-table th.sortable { cursor: pointer; user-select: none; }
.me-table th.sortable::after { content: '\2195'; opacity: .3; margin-left: .3rem; }
.me-table th.asc::after { content: '\2191'; opacity: .9; } .me-table th.desc::after { content: '\2193'; opacity: .9; }
.me-table tbody tr[data-href] { cursor: pointer; }
.me-table td:first-child { min-width: 220px; }
.me-ptable td:first-child { min-width: 160px; }
.me-ptable th, .me-ptable td { padding-left: .55rem; padding-right: .55rem; }
.me-hist .list-group-item:first-child { border-top: 0; }
.me-score { display: inline-block; min-width: 3.4rem; font-weight: 600; }

/* ---- Compact stat cards (e.g. institution profile) ---- */
.mini-stat { display: flex; align-items: center; gap: .65rem; height: 100%; background: #fff; border: 1px solid #e3ebe7; border-left: 3px solid var(--c); border-radius: 10px; padding: .55rem .75rem; }
.mini-stat-ic { flex: 0 0 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1rem; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); }
.mini-stat-v { font-size: 1.05rem; font-weight: 700; line-height: 1.15; color: #1f2d27; white-space: nowrap; }
.mini-stat-l { font-size: .72rem; color: #6c7a74; line-height: 1.2; }
.min-w-0 { min-width: 0; }

/* Terms of Reference preview in the call form */
.wiz-tor-preview { border: 1px solid #e3ebe7; border-radius: 10px; overflow: hidden; background: #f6f8f7; }
.wiz-tor-preview iframe { display: block; width: 100%; height: 420px; border: 0; }

/* ---- Date picker (flatpickr): TEVET green, day/month/year ---- */
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.selected:focus { background: var(--tevet-green); border-color: var(--tevet-green); }
.flatpickr-day.today { border-color: var(--tevet-gold); }
.flatpickr-day.today:hover { background: #fff6e0; color: #1f2d27; }
.flatpickr-months .flatpickr-month, .flatpickr-current-month .flatpickr-monthDropdown-months { color: #0b3d2c; }
input.flatpickr-input[readonly] { background-color: #fff; cursor: pointer; }

/* Choose a call (applications.php, institutions) */
.call-choice { display: flex; gap: .75rem; align-items: center; border: 1px solid #e3ebe7; border-radius: 12px; padding: .75rem .9rem; transition: border-color .15s, box-shadow .15s; }
.call-choice:hover { border-color: #b9dccd; box-shadow: 0 6px 18px rgba(8, 76, 55, .08); }

/* Upload learners from Excel (my_beneficiaries.php) */
.li-step { display: flex; gap: .8rem; align-items: flex-start; padding: .6rem 0; }
.li-step + .li-step { border-top: 1px solid #edf1ef; }
.li-n { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--tevet-green); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: .85rem; }

/* Executive dashboard: provinces are chosen in place (no link underline) */
#geoProvinces .geo-row { cursor: pointer; }
#geoProvinces .geo-row:focus { outline: 2px solid rgba(11, 110, 79, .35); outline-offset: -2px; }

/* Funding by window (funding_windows.php) */
.fw-card { display: block; width: 100%; height: 100%; text-align: left; background: #fff; border: 1px solid #e3ebe7; border-radius: 12px; padding: .7rem .85rem; transition: border-color .15s, box-shadow .15s; }
.fw-card:hover { border-color: #b9dccd; }
.fw-card.active { border-color: var(--tevet-green); box-shadow: 0 0 0 3px rgba(11, 110, 79, .12); }
.fw-code { font-weight: 800; color: var(--tevet-green); font-size: .85rem; }
.fw-name { font-size: .78rem; color: #6c7a74; min-height: 2.1em; line-height: 1.2; }
.fw-fig { font-weight: 700; margin: .3rem 0; }
.fw-fig span { font-weight: 400; font-size: .75rem; color: #6c7a74; }
.fw-small { font-size: .72rem; color: #6c7a74; margin-top: .35rem; }
.fw-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.fw-chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #6c7a74; font-size: .9rem; }
.fw-chart-empty.d-none { display: none !important; }

/* Finance dashboard: a beneficiary row opens its programmes */
.fin-row { cursor: pointer; }
.fin-row:focus { outline: 2px solid rgba(11, 110, 79, .35); outline-offset: -2px; }

/* HRD disbursements (hrd.php): the award sheet, like the finance workbook */
.hrd-sheet table { font-size: .8rem; }
.hrd-sheet td, .hrd-sheet th { white-space: nowrap; }
.hrd-sheet td.small { white-space: normal; min-width: 160px; }
.hrd-sheet th.hrd-fees { background: #e6f4ee; }
.hrd-sheet th.hrd-allow { background: #fbf3df; }
.hrd-sheet .hrd-sub { background: #f3f8f6; }
.hrd-sheet .hrd-res { border-left: 2px solid #dfe6e2; }

/* Indicators & Targets (indicators.php): one card per indicator */
.ind-card { display: block; width: 100%; height: 100%; text-align: left; background: #fff; border: 1px solid #e3ebe7; border-radius: 12px; padding: .9rem 1rem; transition: border-color .15s, box-shadow .15s; }
.ind-card:hover, .ind-card:focus-visible { border-color: #b9dccd; box-shadow: 0 6px 18px rgba(8, 76, 55, .08); }
.ind-fig { font-size: 1.6rem; font-weight: 800; color: #1f2d27; line-height: 1.2; }
.ind-src { font-size: .72rem; color: #6c7a74; margin-top: .6rem; padding-top: .5rem; border-top: 1px dashed #e3ebe7; }
.ind-key-dash { display: inline-block; width: 18px; height: 0; border-top: 2px dashed #b8860b; margin-right: .35rem; vertical-align: middle; }

/* Disbursements (disbursements.php): the steps a payment moves through */
.pay-flow { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; background: #fff; border: 1px solid #e3ebe7; border-radius: 12px; padding: .65rem .9rem; }
.pay-flow-step { display: flex; align-items: center; gap: .45rem; }
.pay-flow-step > i { color: var(--tevet-green); font-size: 1.1rem; }
.pay-steps { display: flex; gap: 3px; }
.pay-steps span { flex: 1; height: 6px; border-radius: 3px; background: #e3ebe7; }
.pay-steps span.done { background: #139a63; }
.pay-row { cursor: pointer; }
a.mini-stat:hover { border-color: var(--c); }
.pay-timeline { list-style: none; padding: 0; margin: 0 0 1rem; border-left: 2px solid #e3ebe7; }
.pay-timeline li { position: relative; padding: 0 0 .6rem 1rem; color: #8a9893; }
.pay-timeline li::before { content: ""; position: absolute; left: -7px; top: .3rem; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #cfd8d4; }
.pay-timeline li.done { color: #1f2d27; }
.pay-timeline li.done::before { background: #139a63; border-color: #139a63; }
.pay-timeline li.returned::before { background: #c0392b; border-color: #c0392b; }

/* HRD beneficiaries (hrd.php): the four groups */
.hrd-g { font-weight: 600; }
.hrd-g-tuition { background: #eef1f0; color: #3f4d47; }
.hrd-g-accommodation { background: #e3effa; color: #1d5f99; }
.hrd-g-meals { background: #fbf1dc; color: #8a5a00; }
.hrd-g-both { background: #e6f4ee; color: #0b6e4f; }

/* A summary card that opens its breakdown */
a.mini-stat-link { color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.mini-stat-link:hover, a.mini-stat-link:focus-visible { border-color: var(--c); box-shadow: 0 4px 14px rgba(8, 76, 55, .08); color: inherit; }

/* ---- Pop-ups (SweetAlert2, assets/js/ui.js): top right, below the top bar, compact type ---- */
.swal2-container.swal2-top-end { padding-top: calc(var(--topbar-h, 64px) + 8px); padding-right: 16px; }
.swal2-top-end > .swal2-popup:not(.swal2-toast) { font-size: .8rem; padding: .9rem 1rem 1rem; width: min(360px, 92vw) !important; }
.swal2-top-end .swal2-title { font-size: 1rem; padding: .25rem .5rem 0; }
.swal2-top-end .swal2-html-container { font-size: .8rem; margin: .6rem .25rem 0; }
.swal2-top-end .swal2-icon { transform: scale(.6); margin: .25rem auto -.5rem; }
.swal2-top-end .swal2-actions { margin-top: .75rem; }
.swal2-top-end .swal2-actions .swal2-styled { font-size: .8rem; padding: .4rem .9rem; }
.swal2-top-end .swal2-close { font-size: 1.6rem; }
.swal2-top-end .swal2-input { font-size: .8rem; height: 2.2rem; margin: .5rem 0 0; }
.swal2-toast .swal2-title { font-size: .85rem; }

/* Reports written in the editor (report_view.php, Report Reviews) */
.rt-body h2 { font-size: 1.1rem; font-weight: 700; color: #0b6e4f; margin-top: 1.2rem; }
.rt-body h2:first-child { margin-top: 0; }
.rt-body h3 { font-size: 1rem; font-weight: 700; margin-top: 1rem; }
.rt-body p { margin-bottom: .6rem; }

/* Search in the top bar (search.php) */
.top-search { position: relative; flex: 1 1 auto; max-width: 460px; margin: 0 1rem; }
.top-search .input-group-text { border-right: 0; color: #6c757d; }
.top-search .form-control { border-left: 0; }
.top-search .form-control:focus { box-shadow: none; border-color: #ced4da; }
.top-search-menu { width: 100%; max-height: 70vh; overflow: auto; top: 100%; left: 0; margin-top: 4px; padding: .25rem 0; }
.top-search-menu.show { display: block; }
.top-search-menu .ts-item { display: flex; gap: .65rem; align-items: center; padding: .45rem .85rem; color: inherit; text-decoration: none; }
.top-search-menu .ts-item:hover, .top-search-menu .ts-item.active { background: #eef6f2; }
.top-search-menu .ts-item i { font-size: 1.1rem; color: #0b6e4f; width: 1.2rem; text-align: center; }
.top-search-menu .ts-type { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: #6c757d; }
/* Small action chips (Evaluators, Evaluator Fees) */
.ev-chip { display: inline-flex; align-items: center; gap: 5px; margin: 4px 4px 0 0; padding: 3px 10px; font-size: .74rem; font-weight: 500; line-height: 1.5;
           border: 1px solid #cfe3da; border-radius: 999px; background: #f3f8f6; color: #0b6e4f; text-decoration: none; cursor: pointer; transition: background .12s, border-color .12s; }
.ev-chip:hover { background: #e2f1ea; border-color: #0b6e4f; color: #0b6e4f; }
.ev-chip i { font-size: .85rem; }
.ev-chip-primary { background: #eef4fb; border-color: #c9dbf0; color: #1d5fa8; }
.ev-chip-primary:hover { background: #dfeaf7; border-color: #1d5fa8; color: #1d5fa8; }
.ev-chip-warn { background: #fff7e6; border-color: #f5d79a; color: #8a5a00; }
.ev-chip-warn:hover { background: #ffefcc; border-color: #d99a1c; color: #8a5a00; }
.ev-chip-done { background: #eaf7ef; border-color: #b7e0c5; color: #1a7c3e; }
.ev-chip-done:hover { background: #d9f0e2; border-color: #1a7c3e; color: #1a7c3e; }

/* ---- Top bar, right-hand side: icon buttons, account button, menus ---- */
.tb-actions { display: flex; align-items: center; gap: .3rem; flex-shrink: 0; }
.tb-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
           border-radius: 50%; border: 0; background: transparent; color: #5b6b64; font-size: 1.15rem; text-decoration: none;
           transition: background-color .15s ease, color .15s ease; }
.tb-icon:hover, .tb-icon[aria-expanded="true"] { background: #e9f4ef; color: var(--tevet-green); }
.tb-icon:focus-visible, .tb-account:focus-visible { outline: 2px solid var(--tevet-green); outline-offset: 2px; }
.tb-badge { position: absolute; top: 3px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
            background: #dc3545; color: #fff; font-size: .62rem; font-weight: 700; line-height: 17px; text-align: center;
            box-shadow: 0 0 0 2px #fff; }
.tb-badge-green { background: var(--tevet-green); }
.tb-sep { width: 1px; height: 26px; background: var(--line); margin: 0 .35rem; }
.tb-account { display: flex; align-items: center; gap: .55rem; padding: 3px 10px 3px 3px; border: 0; border-radius: 999px;
              background: transparent; color: #24302b; transition: background-color .15s ease; max-width: 260px; }
.tb-account:hover, .tb-account[aria-expanded="true"] { background: #eef5f2; }
.tb-avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px;
             border-radius: 50%; background: linear-gradient(135deg, var(--tevet-green), var(--tevet-green-dark)); color: #fff;
             font-size: .8rem; font-weight: 700; letter-spacing: .02em; }
.tb-avatar-lg { width: 42px; height: 42px; font-size: .95rem; }
.tb-who { flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.15; text-align: left; }
.tb-acct-head .tb-who { display: flex; }
.tb-name { font-weight: 600; font-size: .86rem; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-role { font-size: .72rem; color: #7a8a83; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-caret { font-size: .7rem; color: #8a9893; transition: transform .2s ease; }
.tb-account[aria-expanded="true"] .tb-caret { transform: rotate(180deg); }

.tb-menu { border: 1px solid #e3ebe7; border-radius: 14px; box-shadow: 0 16px 44px rgba(8, 76, 55, .16); padding: .4rem;
           font-size: .875rem; transform-origin: top right; }
.tb-menu.show { animation: tb-pop .18s cubic-bezier(.2, .8, .3, 1); }
@keyframes tb-pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
.tb-menu .dropdown-item { display: flex; align-items: center; gap: .65rem; border-radius: 9px; padding: .5rem .7rem; font-weight: 500;
                          color: #33413b; transition: background-color .12s ease; }
.tb-menu .dropdown-item i { font-size: 1rem; width: 1.1rem; text-align: center; color: #6b7c75; }
.tb-menu .dropdown-item:hover, .tb-menu .dropdown-item:focus { background: #f1f8f5; color: #1f2b26; }
.tb-menu .dropdown-divider { margin: .35rem .3rem; }
.tb-menu .tb-logout:hover, .tb-menu .tb-logout:focus { background: #fdf0f1; color: #b02a37; }
.tb-menu .tb-logout:hover i { color: #b02a37; }
.tb-acct { min-width: 250px; }
.tb-acct-head { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem .7rem; margin-bottom: .3rem; border-bottom: 1px solid var(--line); }

.tb-notif { width: 360px; padding: 0; overflow: hidden; }
.tb-menu-head { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; font-weight: 600;
                border-bottom: 1px solid var(--line); }
.tb-count { margin-left: .35rem; padding: .1rem .45rem; border-radius: 999px; background: #e9f4ef; color: var(--tevet-green);
            font-size: .7rem; font-weight: 600; }
.tb-link { font-size: .78rem; color: var(--tevet-green); }
.tb-notif-list { max-height: 380px; overflow-y: auto; padding: .3rem; scrollbar-width: thin; }
.tb-notif-item { display: flex; gap: .6rem; padding: .6rem .7rem; border-radius: 10px; color: inherit; text-decoration: none;
                 transition: background-color .12s ease; }
.tb-notif-item:hover { background: #f4f8f6; color: inherit; }
.tb-dot { flex-shrink: 0; width: 8px; height: 8px; margin-top: .4rem; border-radius: 50%; background: transparent; }
.tb-notif-item.is-unread .tb-dot { background: var(--tevet-green); }
.tb-notif-item.is-unread .tb-notif-title { color: #14201b; }
.tb-notif-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.tb-notif-title { font-weight: 600; font-size: .83rem; color: #44524c; }
.tb-notif-body { font-size: .78rem; color: #6c7a74; white-space: normal; }
.tb-notif-date { font-size: .7rem; color: #98a59f; }
.tb-empty { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1.75rem 1rem; color: #8a9893; font-size: .85rem; }
.tb-empty i { font-size: 1.6rem; }
.tb-menu-foot { display: flex; justify-content: center; align-items: center; gap: .35rem; padding: .65rem; border-top: 1px solid var(--line);
                font-size: .8rem; font-weight: 600; color: var(--tevet-green); text-decoration: none; }
.tb-menu-foot:hover { background: #f4f8f6; color: var(--tevet-green-dark); }
.top-search-menu.show { animation: tb-pop .16s ease-out; }

@media (max-width: 768px) {
    .tb-actions { gap: .1rem; }
    .tb-account { padding: 2px; }
    .tb-avatar { width: 32px; height: 32px; }
    .tb-notif { width: calc(100vw - 16px); }
}
@media (prefers-reduced-motion: reduce) {
    .tb-menu.show, .top-search-menu.show { animation: none; }
    .tb-caret { transition: none; }
}

/* ---- Live Chat, staff side (live_chat.php) ---- */
.lcs-tabs .nav-link { border-radius: 999px; padding: .35rem .9rem; color: #44524c; }
.lcs-tabs .nav-link.active { background: var(--tevet-green); color: #fff; }
.lcs-list-card, .lcs-conv { height: calc(100vh - 210px); min-height: 460px; overflow: hidden; }
.lcs-list { height: 100%; overflow-y: auto; scrollbar-width: thin; }
.lcs-grp { padding: .35rem .4rem .6rem; border-bottom: 1px solid var(--line); }
.lcs-gh { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #8a9893; padding: .5rem .55rem .35rem; }
.lcs-grp.is-waiting .lcs-gh { color: #b07800; }
.lcs-n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #eef2f0; color: #44524c; text-align: center; }
.is-waiting .lcs-n { background: #fff1d1; color: #8a5d00; }
.lcs-none { font-size: .8rem; color: #98a59f; padding: .1rem .55rem .3rem; }
.lcs-item { display: flex; align-items: center; gap: .6rem; padding: .5rem .55rem; border-radius: 10px; color: inherit; text-decoration: none; }
.lcs-item:hover { background: #f4f8f6; color: inherit; }
.lcs-item.active { background: #e6f4ee; }
.lcs-av { position: relative; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: #dfe9e4; color: var(--tevet-green-dark);
          display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.lcs-av.on::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #22a06b; box-shadow: 0 0 0 2px #fff; }
.lcs-it { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.lcs-nm { font-weight: 600; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcs-sub { font-size: .76rem; color: #7a8a83; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcs-wait { font-size: .72rem; font-weight: 700; color: #8a5d00; background: #fff1d1; padding: .1rem .45rem; border-radius: 999px; white-space: nowrap; }
.lcs-conv { display: flex; flex-direction: column; }
.lcs-empty { margin: auto; text-align: center; color: #7a8a83; padding: 2rem; }
.lcs-empty > i { font-size: 2.4rem; display: block; margin-bottom: .5rem; color: #b9c8c1; }
.lcs-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.lcs-hb { display: flex; gap: .4rem; }
.lcs-online { font-size: .7rem; color: #22a06b; font-weight: 600; }
.lcs-offline { font-size: .7rem; color: #98a59f; font-weight: 500; }
.lcs-msgs { flex: 1; overflow-y: auto; padding: 1rem; background: #f6f9f7; scrollbar-width: thin; }
.lcs-m { max-width: 78%; margin-bottom: .75rem; }
.lcs-who { font-size: .7rem; color: #7a8a83; margin: 0 .3rem .2rem; }
.lcs-b { padding: .55rem .8rem; border-radius: 14px; background: #fff; border: 1px solid #e3ebe7; line-height: 1.45; word-wrap: break-word; }
.lcs-bot .lcs-b { background: #f0f4f8; border-color: #e1e8ef; color: #44524c; }
.lcs-staff { margin-left: auto; }
.lcs-staff .lcs-who { text-align: right; }
.lcs-staff .lcs-b { background: var(--tevet-green); border-color: var(--tevet-green); color: #fff; }
.lcs-staff .lcs-b a { color: #fff; }
.lcs-sys { text-align: center; font-size: .75rem; color: #7a8a83; margin: .3rem 1rem .8rem; }
.lcs-foot { padding: .7rem 1rem; border-top: 1px solid var(--line); background: #fff; }
.lcs-reply { display: flex; gap: .5rem; align-items: flex-end; }
.lcs-reply textarea { resize: none; }
@media (max-width: 991px) { .lcs-list-card { height: auto; max-height: 300px; min-height: 0; } .lcs-conv { height: 70vh; } }

/* ---- Live Chat button on staff pages (includes/footer.php) ---- */
.sc-fab { position: fixed; right: 22px; bottom: 22px; z-index: 1040; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
          background: linear-gradient(135deg, var(--tevet-green), var(--tevet-green-dark)); color: #fff; font-size: 1.35rem; text-decoration: none;
          box-shadow: 0 10px 26px rgba(8, 76, 55, .32); transition: transform .18s ease, box-shadow .18s ease; }
.sc-fab:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 32px rgba(8, 76, 55, .4); }
.sc-fab { touch-action: none; cursor: grab; }   /* it can be dragged anywhere (includes/footer.php) */
.sc-fab.dragging { cursor: grabbing; transform: scale(1.08); transition: none; opacity: .9; }
.sc-fab:focus-visible { outline: 3px solid var(--tevet-gold); outline-offset: 3px; }
.sc-badge { position: absolute; top: -3px; right: -3px; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 11px; background: #dc3545; color: #fff;
            font-size: .7rem; font-weight: 700; line-height: 21px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.sc-fab.has::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--tevet-green); animation: sc-pulse 2s ease-out infinite; }
@keyframes sc-pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }
.sc-fab.ping { animation: sc-ping .6s ease; }
@keyframes sc-ping { 0%, 100% { transform: none; } 30% { transform: translateY(-6px) rotate(-8deg); } 60% { transform: translateY(0) rotate(6deg); } }
.lcs-dept { display: inline-block; background: #e7f0fb; color: #1d5fa8; border-radius: 999px; padding: 0 .45rem; font-size: .68rem; font-weight: 700; margin-right: .2rem; }
.lcs-scope { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: #eef2f5; border-radius: 10px; padding: 3px; margin: .6rem .6rem .2rem; }
.lcs-scope button { border: 0; background: transparent; border-radius: 8px; padding: .3rem; font-size: .78rem; font-weight: 600; color: #4b5866; }
.lcs-scope button.on { background: #fff; color: var(--tevet-green); box-shadow: 0 1px 3px rgba(16, 38, 64, .12); }
@media (max-width: 768px) { .sc-fab { right: 16px; bottom: calc(var(--tabbar-h, 60px) + env(safe-area-inset-bottom) + 14px); width: 50px; height: 50px; } }
@media print { .sc-fab { display: none; } }
@media (prefers-reduced-motion: reduce) { .sc-fab.has::after, .sc-fab.ping { animation: none; } }

/* Drag-and-drop file zone (app.js) */
.tf-drop { border: 2px dashed #c9d2db; border-radius: 14px; padding: 1.6rem 1rem; text-align: center; background: #fbfcfd; cursor: pointer; transition: all .15s; outline: none; }
.tf-drop:hover, .tf-drop.over, .tf-drop:focus-visible { border-color: var(--tevet-green); background: #f2f8f5; }
.tf-drop .bi-cloud-arrow-up { font-size: 2.4rem; color: var(--tevet-green); display: inline-block; transition: transform .15s; }
.tf-drop.over .bi-cloud-arrow-up { transform: translateY(-4px); }
.tf-drop .tf-drop-text { font-weight: 600; color: #1c2733; }
.tf-drop .tf-drop-hint { font-size: .8rem; color: #6b7785; }
.tf-drop.has-files .tf-drop-text, .tf-drop.has-files .tf-drop-hint { display: none; }
.tf-drop-files { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.tf-drop-file { display: inline-flex; align-items: center; gap: .3rem; background: #e6f4ee; color: #0b6e4f; border-radius: 999px; padding: .25rem .7rem; font-size: .82rem; font-weight: 600; max-width: 100%; }
.tf-drop-file small { color: #5c6876; font-weight: 400; }
.tf-drop.has-files::after { content: 'Click or drop again to change'; display: block; font-size: .75rem; color: #6b7785; margin-top: .5rem; }

/* Workbook preview under a drop zone */
.tf-preview { margin-top: .75rem; display: grid; gap: .6rem; }
.tf-preview-file { border: 1px solid #e3e8ee; border-radius: 12px; overflow: hidden; background: #fff; }
.tf-preview-head { padding: .5rem .8rem; font-weight: 600; font-size: .85rem; border-bottom: 1px solid #eef1f4; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.tf-preview-head .bi { color: #0b6e4f; }
.tf-preview-tabs { display: flex; flex-wrap: wrap; gap: .3rem; padding: .45rem .6rem 0; }
.tf-preview-tab { border: 1px solid #e3e8ee; background: #f6f8fa; border-radius: 999px; padding: .15rem .65rem; font-size: .78rem; color: #3a4654; }
.tf-preview-tab.active { background: var(--tevet-green); border-color: var(--tevet-green); color: #fff; }
.tf-preview-tab small { opacity: .75; }
.tf-preview-scroll { overflow: auto; max-height: 300px; margin: .5rem .6rem .6rem; border: 1px solid #eef1f4; border-radius: 8px; }
.tf-preview-table { border-collapse: collapse; font-size: .74rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-preview-table th { position: sticky; left: 0; background: #f6f8fa; color: #8a95a1; font-weight: 500; padding: .15rem .4rem; border-right: 1px solid #e3e8ee; text-align: right; }
.tf-preview-table td { padding: .15rem .45rem; border-bottom: 1px solid #f1f4f7; border-right: 1px solid #f1f4f7; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.tf-preview-table tr:first-child td { font-weight: 600; }
.tf-preview-note { font-size: .76rem; color: #6b7785; padding: 0 .6rem .5rem; }
.tf-preview-ok { color: #0b6e4f; font-weight: 600; font-size: .8rem; flex-basis: 100%; }
.tf-preview-bad { color: #b42318; font-weight: 600; font-size: .8rem; flex-basis: 100%; }

/* ---- The Year selector, top left (includes/header.php, includes/period.php) ---- */
.tb-year { display: inline-flex; align-items: center; gap: .3rem; background: #e6f4ee; border: 1px solid #cfe7da; border-radius: 10px; padding: .2rem .35rem .2rem .55rem; color: #0b6e4f; flex-shrink: 0; }
.tb-year select { border: 0; background: transparent; font-weight: 700; color: #0b6e4f; font-size: .9rem; padding: .1rem .2rem; cursor: pointer; outline: none; }
.tb-year:focus-within { box-shadow: 0 0 0 3px rgba(11, 110, 79, .2); }
@media (max-width: 575px) { .tb-year { padding: .15rem .25rem .15rem .4rem; } .tb-year .bi { display: none; } .tb-year select { font-size: .82rem; } }
@media print { .tb-year { display: none; } }
