@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

/* Shared: required-field asterisk (replaced inline color:red !important across many forms). */
/* ADA: pure red (#f00) is 4.00 on white; #cc0000 = 5.89. */
.required-asterisk { color: #cc0000 !important; }
/* Shared: pointer cursor (replaced inline cursor:pointer). */
.cursor-pointer { cursor: pointer; }
/* Shared: 20px top margin (replaced inline margin-top:20px on config page containers). */
.mt-20 { margin-top: 20px; }
/* Shared: 10px top margin (replaced inline margin-top:10px). */
.mt-10 { margin-top: 10px; }
/* Shared: 10px right margin + 900px max-width (replaced inline equivalents). */
.me-10 { margin-right: 10px; }
.mw-900 { max-width: 900px; }
/* Shared: suppress mouse-click ring; keep keyboard focus visible (modals). */
.no-focus:focus:not(:focus-visible) { outline: none !important; box-shadow: none !important; }
.no-focus:focus-visible {
    outline: 2px solid var(--phs-accent-link) !important;
    outline-offset: 2px;
    box-shadow: var(--phs-focus-ring) !important;
}
/* Shared keyboard focus ring for icon buttons and custom controls */
.phs-focus-ring:focus:not(:focus-visible) { outline: none; box-shadow: none; }
.phs-focus-ring:focus-visible {
    outline: 2px solid var(--phs-accent-link);
    outline-offset: 2px;
    box-shadow: var(--phs-focus-ring);
}
/* Shared: hidden-by-default error text (was duplicated in _AddProjectModal). */
/* ADA: pure red is 4.00 on white; #d32f2f = 4.98. */
.form-error { color: #d32f2f; display: none; }
/* Shared utility for layout bare buttons (replaced two inline button styles). */
.btn-bare { background: none; border: none; cursor: pointer; padding: 0; }
.btn-bare-rel { position: relative; }
/* Layout small flex wrappers (replaced 1 inline). */
.layout-meta-row { display: flex; align-items: center; gap: 8px; margin-top: 1px; }
/* AD search component (replaced inline). */
.ad-phone-min { min-width: 220px; }
.ad-results-scroll { max-height: 220px; overflow-y: auto; }
/* ADA: #f1416c is 3.68 on white; #d32f2f = 4.98. */
.ad-error-color { color: #d32f2f; }
/* Avatar circles in the user dropdown (replaced inline). */
.avatar-50 { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }

/* Shared one-off geometry utilities (replaced inline equivalents). */
.mt-35 { margin-top: 35px; }
.ms-3px { margin-left: 3px; }
.mw-1200 { max-width: 1200px; }
.minh-150 { min-height: 150px; }
/* Status dot: static geometry as a class, color via state class so no inline style is needed. */
.status-dot { width: 10px; height: 10px; border-radius: 50%; }
.status-dot-on { background-color: green; }
.status-dot-off { background-color: gray; }
/* Dashboard Quick Actions preview keeps white labels (moved out of the view's inline <style>). */
.dashboard-qa-config .qa-preview { color: #ffffff; }
.dashboard-qa-config .qa-preview .qa-preview-label { color: #ffffff !important; }
/* Shared: 24px font (replaced inline font-size:1.5rem). */
.fs-24 { font-size: 1.5rem; }

:root {
    /* ============================================================
       PHS design tokens (DESIGN.md canonical — use in feature CSS)
       ============================================================ */
    --phs-font-family: "Open Sans", system-ui, -apple-system, sans-serif;

    /* Ink */
    --phs-ink-primary: #181C32;
    --phs-ink-heading: #111827;
    --phs-ink-body: #374151;
    --phs-ink-muted: #6b7280;

    /* Surfaces */
    --phs-surface-page: #f5f8fa;
    --phs-surface-card: #ffffff;
    --phs-surface-pm-highlight: #edf8ff;

    /* Borders */
    --phs-border-default: #e4e6ef;
    --phs-border-subtle: #e2e8f0;
    --phs-border-card: #e5e7eb;

    /* Actions & links */
    --phs-accent-link: #0d6efd;
    --phs-primary-action: #2563eb;
    --phs-primary-action-hover: #1d4ed8;
    --phs-link-ada: #0954a5;
    --phs-button-dark: #3F4254;

    /* Brand */
    --phs-header-bar: #2C294B;
    --phs-brand-purple-deep: #25143e;
    --phs-brand-purple-banner: #3d2066;
    --phs-brand-purple-tint: #f3f0ff;
    --phs-brand-purple-border: #e9e3f7;
    --phs-brand-blue-tint: #f0f7ff;
    --phs-brand-blue-border: rgba(59, 130, 246, 0.4);

    /* Elevation */
    --phs-shadow-ambient-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
    --phs-shadow-ambient-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --phs-shadow-banner: 0 8px 28px rgba(45, 23, 74, 0.28);
    /* ADA: solid ring (the alpha version computed ~1.4:1 vs white - below the
       3:1 non-text floor). #1565c0 = 5.75:1 on white, 5.4:1 on the page tint. */
    --phs-focus-ring: 0 0 0 2px #1565c0;
    --phs-focus-ring-strong: 0 0 0 3px #1565c0;

    /* Layout */
    --phs-icon-btn-size: 2.75rem;
    --phs-app-sidebar-rail-width: 96px;
    --phs-app-header-height: 60px;
    --phs-app-sidebar-content-offset: calc(var(--phs-app-sidebar-rail-width, 72px) + 1rem);

    /* Radius */
    --phs-radius-sm: 6px;
    --phs-radius-md: 8px;
    --phs-radius-lg: 10px;
    --phs-radius-xl: 12px;
    --phs-radius-card-soft: 20px;
    --phs-radius-pill: 999px;

    /* Spacing */
    --phs-space-xs: 0.35rem;
    --phs-space-sm: 0.65rem;
    --phs-space-md: 1rem;
    --phs-space-lg: 1.25rem;
    --phs-space-xl: 1.75rem;

    /* Type scale */
    --phs-type-body: 0.9375rem;
    --phs-type-small: 0.875rem;
    --phs-type-label: 0.8125rem;
    --phs-type-title: 1.0625rem;
    --phs-type-headline: 1.5rem;

    /* Z-index scale */
    --phs-z-base: 1;
    --phs-z-dropdown: 100;
    --phs-z-sticky: 200;
    --phs-z-sidebar: 300;
    --phs-z-modal: 1000;
    --phs-z-toast: 1100;
    --phs-z-skip-link: 9999;
    --phs-z-editor-aux: 99999;
    --phs-z-editor-field: 9999;
    --phs-z-editor-dialog: 999999;
    --phs-z-editor-overlay: 999998;
    --phs-z-sidebar-rail: 999999;
    --phs-z-tour-highlight: 99999997;
    --phs-z-tour-backdrop: 99999996;
    --phs-z-tour-tooltip: 99999999;

    --phs-z-search-dropdown: 10000;
    --phs-z-datepicker: 10050;
    --phs-z-datepicker-popup: 10060;

    /* Motion */
    --phs-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --phs-duration-fast: 150ms;
    --phs-duration-medium: 200ms;
    --phs-transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;

    /* Semantic accents (status / charts) */
    --phs-status-success: #50CD89;
    --phs-status-danger: #F1416C;
    --phs-status-warning: #FFC700;
    --phs-status-info: #009EF7;
    --phs-status-neutral: #9ca3af;
    --phs-accent-red: #FF6B6B;
    --phs-accent-yellow: #FFD93D;
    --phs-accent-teal: #4ECDC4;

    /* === Legacy aliases (existing site.css / Metronic consumers) === */
    --primary-gradient: var(--phs-primary-gradient);
    --bg-primary: var(--phs-surface-card);
    --bg-secondary: #f7fafc;
    --bg-card: var(--phs-surface-card);
    --text-primary: var(--phs-ink-primary);
    --text-secondary: var(--phs-ink-body);
    --text-muted: var(--phs-ink-muted);
    --border-color: var(--phs-border-subtle);
    --shadow-sm: var(--phs-shadow-ambient-sm);
    --shadow-md: var(--phs-shadow-ambient-md);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12);
    --header-bg: #2d3748;
    --accent-red: var(--phs-accent-red);
    --accent-yellow: var(--phs-accent-yellow);
    --accent-teal: var(--phs-accent-teal);
    --transition: var(--phs-transition);
    --app-sidebar-rail-width: var(--phs-app-sidebar-rail-width);
    --app-header-height: var(--phs-app-header-height);
    --app-sidebar-content-offset: var(--phs-app-sidebar-content-offset);
}

/* ============================================================
   PHS extracted primitives (consume tokens from :root above)
   ============================================================ */
.phs-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--phs-icon-btn-size);
    height: var(--phs-icon-btn-size);
    padding: 0;
    border: 1px solid var(--phs-border-subtle);
    border-radius: var(--phs-radius-lg);
    background: var(--phs-surface-card);
    color: var(--phs-accent-link);
    cursor: pointer;
    transition: background var(--phs-duration-fast) ease, border-color var(--phs-duration-fast) ease, color var(--phs-duration-fast) ease;
}

.phs-icon-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--phs-primary-action-hover);
}

.phs-icon-btn:focus {
    outline: none;
}

.phs-icon-btn:focus-visible {
    box-shadow: var(--phs-focus-ring);
}

.phs-card-surface {
    background: var(--phs-surface-card);
    border: 1px solid var(--phs-border-card);
    border-radius: var(--phs-radius-xl);
    box-shadow: var(--phs-shadow-ambient-sm);
}

.phs-alignment-tile {
    border-radius: var(--phs-radius-xl);
    border: 1px solid var(--phs-brand-purple-border);
    background-color: var(--phs-brand-purple-tint);
}

.phs-dashboard-shell {
    font-family: var(--phs-font-family);
    font-size: var(--phs-type-body);
    color: var(--phs-ink-body);
    line-height: 1.6;
}

/*
[data-theme="dark"] {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-card: #2d3748;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
    --border-color: #4a5568;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --header-bg: #171923;
}*/

/* Prevent accidental horizontal page scroll (dropdowns use position: fixed) */
html {
    overflow-x: hidden;
    max-width: 100%;
}

#kt_app_root {
    /* Use clip + explicit visible, not hidden: "overflow-x: hidden" forces overflow-y to compute
       to "auto", which silently turned #kt_app_root into a second vertical scroll container on top
       of the window (a double scrollbar on long pages). clip stops horizontal overflow without that
       promotion, and the explicit overflow-y:visible keeps this from scrolling vertically at all,
       leaving the window as the single page scroller (which the scroll-listeners already expect). */
    overflow-x: clip;
    overflow-y: visible;
    max-width: 100%;
}

/* ============================================
   1. BASE STYLES & RESETS
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--phs-surface-page);
    min-height: 100vh;
}

/* ============================================
   2. HEADER STYLES
   ============================================ */
/* Header Styles */
main-header {
    background: var(--header-bg)!important;
    padding: 1.25rem 2rem;
    box-shadow: var(--shadow-md)!important;
    position: sticky;
    top: 0;
    z-index: var(--phs-z-sticky, 200);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

    .logo:hover {
        opacity: 0.9;
    }

.logo-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.625rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: var(--transition);
}

.logo:hover .logo-icon {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.logo-title {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.logo-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.8;
    letter-spacing: 0.02em;
}


/* Base header styling */
#kt_app_header,
.app-header.nav_bg {
/*    background-color: #2C294B !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;*/
    border-bottom: none !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 10px;
    padding: 0 2rem;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

#kt_app_header_container {
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
    max-width: 100% !important;
    margin-right: 10%;
}

#kt_app_header_wrapper {
    width: 100%;
    margin-right: 10%;
}

/* Logo section */
.app-header-logo {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

    .app-header-logo a img {
        display: none; /* Hide logo for Metronic style */
    }

    /* Title styling */
    .navtitle,
    .app-header-logo h1 {
        font-size: 1.5rem !important;
        font-weight: 700 !important;
        color: white !important;
        margin: 0 !important;
        letter-spacing: -0.5px;
    }

        /* Environment badge */
        .navtitle text {
            background: rgba(255, 199, 0, 0.2);
            padding: 0.25rem 0.75rem;
            border-radius: 6px;
            font-size: 0.875rem !important;
            font-weight: 600 !important;
            margin-left: 0.5rem;
            border: 1px solid rgba(255, 199, 0, 0.3);
        }

/* ============================================
   3. NAVIGATION & USER AREA
   ============================================ */

/* Right side user area */
.nav_user {
    background: transparent !important;
    border-left: none !important;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 40px;

}

.app-navbar {
    display: flex;
    align-items: center;
    padding: 0;

}

/* ============================================
   4. SEARCH STYLES
   ============================================ */

.main-header .search-container,
.navbar-search {
    position: relative;
    width: 250px;
}

    .main-header .search-input,
    .navbar-search input {
        width: 100%;
        min-height: var(--phs-icon-btn-size);
        height: var(--phs-icon-btn-size);
        background: rgba(255, 255, 255, 0.1) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        border-radius: 8px;
        padding: 0 1rem 0 2.5rem;
        color: #ffffff !important;
        font-size: 0.9rem;
        outline: none;
        transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    }

        .main-header .search-input:focus-visible,
        .navbar-search input:focus-visible {
            outline: 2px solid var(--phs-accent-link);
            outline-offset: 2px;
            box-shadow: var(--phs-focus-ring);
        }

        .main-header .search-input::placeholder,
        .navbar-search input::placeholder {
            color: rgba(255, 255, 255, 0.5) !important;
        }

        .main-header .search-input:focus,
        .navbar-search input:focus {
            background: rgba(255, 255, 255, 0.15) !important;
            border-color: rgba(255, 255, 255, 0.25) !important;
        }

    .main-header .search-icon,
    .navbar-search i {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: white !important;
        font-size: 0.9rem;
        pointer-events: none;
    }

/* ============================================
   5. BUTTON STYLES
   ============================================ */

/* Primary action button */
.new-goal-btn,
.navbar-primary-btn {
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 2px 8px rgba(30, 144, 255, 0.3);
    white-space: nowrap;
    margin-left: 10px !important;
}

    .new-goal-btn:hover,
    .navbar-primary-btn:hover {
        background: #1d4ed8;
        box-shadow: 0 4px 12px rgba(30, 144, 255, 0.4);
        transform: translateY(-1px);
    }

    .new-goal-btn:active,
    .navbar-primary-btn:active {
        transform: translateY(0);
        box-shadow: 0 2px 6px rgba(30, 144, 255, 0.3);
    }

/* Icon buttons */
.navbar-icon-btn,
.menu-trigger {
    width: 40px;
    min-height: var(--phs-icon-btn-size);
        height: var(--phs-icon-btn-size);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    /*background: rgba(255, 255, 255, 0.1);*/
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

    .navbar-icon-btn:hover,
    .menu-trigger:hover {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.2);
    }

    .navbar-icon-btn i {
        font-size: 1.1rem;
    }

    /* Notification badge */
    .navbar-icon-btn .badge {
        position: absolute;
        top: -4px;
        right: -4px;
        background: #15803d;
        color: #ffffff;
        font-size: 0.7rem;
        font-weight: 700;
        padding: 2px 5px;
        border-radius: 10px;
        min-width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

/* Sign in link */
.atag {
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    padding: 0.625rem 1.5rem;
    border-radius: 8px;
    background: #0954a5;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    display: inline-block;
}

    .atag:hover {
        background: #073e7a;
        box-shadow: 0 4px 12px rgba(0, 158, 247, 0.3);
    }

    .atag span {
        color: #ffffff !important;
    }

/* ============================================
   6. DROPDOWN MENU STYLES
   ============================================ */

.menu-container {
    position: relative;
    padding-right: 0 !important;
    padding-left: 0 !important;
    margin-left: 1rem;
}

    .dropdown-menu,
    .menu-container .menu {
        position: absolute;
        right: 0;
        top: 100%;
        margin-top: 0.5rem;
        min-width: 200px;
        background: white !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15) !important;
        padding: 0.5rem !important;
        border: 1px solid #E4E6EF !important;
        z-index: 10500 !important;
    }

        .dropdown-menu.d-none {
            display: none !important;
        }

        .menu-container .menu a {
            color: #3F4254 !important;
            padding: 0.75rem 1rem !important;
            border-radius: 6px !important;
            font-weight: 500 !important;
            font-size: 0.9rem !important;
            display: block;
            text-decoration: none;
        }

            .menu-container .menu a:hover {
                background-color: #F3F6F9 !important;
                color: #0954a5 !important;
            }

.dropdown-divider {
    border-color: #E4E6EF !important;
    margin: 0.5rem 0 !important;
    width: 100% !important;
    margin-left: 0 !important;
}

.menu-container .menu .btn,
.dropdown-menu .btn {
    background-color: #0954a5 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 0.625rem 1rem !important;
    font-weight: 600 !important;
    margin-top: 0.5rem !important;
    width: 100% !important;
    font-size: 0.9rem !important;
    cursor: pointer;
}

    .menu-container .menu .btn:hover,
    .dropdown-menu .btn:hover {
        background-color: #073e7a !important;
    }

/* ============================================
   7. CONTENT WRAPPER STYLES
   ============================================ */

/* Default wrapper styling */
.app-wrapper {
    margin-top: 80px;
    padding: 2rem;
}

/* ============================================
   8. DASHBOARD-SPECIFIC STYLES
   ============================================ */

/* Dashboard page header adjustments */
.dashboard-page #kt_app_header {
/*    height: 150px !important;
*/    z-index: 1 !important;
}



/* Enhanced card shadows for dashboard */
.dashboard-page .card,
.dashboard-page .dashboard-action-btn,
.dashboard-page .subscription-card {
    box-shadow: var(--phs-shadow-ambient-sm);
}

/* ============================================
   9. UTILITY CLASSES
   ============================================ */

.text-white {
    color: white !important;
}

.login-info {
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
}

/* Filter for making images white */
.menu-trigger img {
    filter: brightness(0) invert(1);
}

/* ============================================
   10. RESPONSIVE STYLES
   ============================================ */

@media (max-width: 991px) {
    .app-header,
    #kt_app_header {
        height: auto;
        min-height: 70px;
        padding: 0 1rem;
    }

    .navtitle,
    .app-header-logo h1 {
        font-size: 1.1rem !important;
    }

    .navbar-search {
        display: none;
    }

    .main-header-nav .search-container {
        display: flex;
    }

    .menu-container {
        padding-right: 0 !important;
        padding-left: 0 !important;
        margin-left: 0.5rem;
    }

    .navbar-primary-btn,
    .new-goal-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .dashboard-page #kt_app_header {
        height: 200px !important;
    }

}

/* ============================================
   11. CLEAN UP & OVERRIDES
   ============================================ */

/* Remove conflicting styles */
#chatMenu::after {
    display: none !important;
}
/* ============================================
   STICKY HEADER STYLES - Add to site.css
   ============================================ */

/* Update main header to be relative instead of fixed */
#kt_app_header,
.app-header.nav_bg {
    position: relative !important; /* Changed from fixed */
    top: auto !important;
    z-index: 100;
}

/* Adjust content wrapper for non-fixed header */
.app-wrapper {
    margin-top: 0 !important; /* Remove top margin since header isn't fixed */
    padding: 2rem;
}

/* Dashboard specific adjustments for overlap effect */
.dashboard-page #kt_app_header {
/*    height: 180px !important;
*/    z-index: 1 !important;
    position: relative !important; /* Keep relative positioning */
}

.dashboard-page .app-wrapper {
    margin-top: 80px !important;
    position: relative;
    z-index: 10;
    padding: 0 1.25rem 2rem;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .sticky-header {
        height: 50px;
        padding: 0 1rem;
    }

    .sticky-header-title {
        font-size: 1rem;
    }

    .sticky-header-nav .search-container {
        display: none;
    }

    .sticky-header-nav .new-goal-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }

    .sticky-header-nav .menu-trigger {
        width: 30px;
        height: 30px;
    }
}


/* ============================================
   THEME SWITCHER STYLES
   ============================================ */

/* Theme CSS Variables — semantic aliases over PHS primitives */
:root {
    --bg-primary: var(--phs-surface-page);
    --bg-secondary: var(--phs-surface-card);
    --bg-header: var(--phs-header-bar);
    --text-primary: var(--phs-ink-primary);
    --text-secondary: var(--phs-ink-body);
    --text-muted: var(--phs-ink-muted);
    --border-color: var(--phs-border-default);
    --card-bg: var(--phs-surface-card);
    --card-shadow: rgba(82, 63, 105, 0.15);
}

/* Dark theme */
[data-theme="dark"] {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-header: #0f0f1e;
    --text-primary: #f0f0f0;
    --text-secondary: #d0d0d0;
    --text-muted: #8a8a9e;
    --border-color: #2a2a4e;
    --card-bg: #16213e;
    --card-shadow: rgba(0, 0, 0, 0.5);

    /* ADA Phase 0: the --phs-ink-* inks, page surface, and focus ring were NOT
       redefined for dark, so token-driven text kept its light values and vanished
       on dark surfaces. These dark values are script-verified to meet WCAG AA on
       every dark surface in the portal (worst case = the lightest, #374151):
       muted #a7aebb >=4.62, body #dfe3ea >=8.0, heading #f4f6fb >=9.5. */
    --phs-ink-heading: #f4f6fb;
    --phs-ink-body: #dfe3ea;
    --phs-ink-muted: #a7aebb;
    --phs-surface-page: #1a1a2e;
    --phs-focus-ring: 0 0 0 2px #7db8ff;
    --phs-focus-ring-strong: 0 0 0 3px #7db8ff;
}

/* Apply theme variables to body and main elements */
body {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}


/* Update cards with theme */
.card,
.menu-card,
.subscription-card {
    background: var(--card-bg) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: background-color 0.3s ease;
}

.card-title,
.menu-card-title,
.todo-title,
.product-name {
    color: var(--text-primary) !important;
}

.card-subtitle,
.activity-text,
.list-title,
.todo-date,
.product-description {
    color: var(--text-secondary) !important;
}

.activity-time,
.list-subtitle,
.product-tech {
    color: var(--text-muted) !important;
}

/* Theme switcher button styles */
.theme-switcher {
    position: relative;
    display: inline-block;
}

.theme-switcher-btn {
    width: 40px;
    min-height: var(--phs-icon-btn-size);
        height: var(--phs-icon-btn-size);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-switcher-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.theme-switcher-btn i {
    color: white;
    font-size: 1.1rem;
}

/* Theme dropdown menu */
.theme-dropdown {
    position: absolute;
    bottom: 100%; /* Position above the button */
    right: 0;
    margin-bottom: 0.5rem; /* Space between button and dropdown */
    background: white;
    border-radius: 8px;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15); /* Shadow going upward */
    padding: 0.5rem;
    min-width: 180px;
    display: none;
    z-index: var(--phs-z-editor-aux);
    animation: slideUp 0.2s ease-out;
}

[data-theme="dark"] .theme-dropdown {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.theme-dropdown.show {
    display: block;
}

.theme-option {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    color: var(--text-primary);
}

.theme-option:hover {
    background: #F3F6F9;
}

[data-theme="dark"] .theme-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.theme-option.active {
    background: #E1F0FF;
    color: #0954a5;
}

[data-theme="dark"] .theme-option.active {
    background: rgba(0, 158, 247, 0.2);
    color: #4CB8FF;
}

.theme-option i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.theme-option span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Sticky header theme switcher */
.sticky-header .theme-switcher-btn {
    width: 35px;
    height: 35px;
}

/* Dark theme specific adjustments */
[data-theme="dark"] .menu-card-icon {
    background: #16213e !important;
    color: var(--text-muted);
}

[data-theme="dark"] .todo-checkbox {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .activity-item::before,
[data-theme="dark"] .list-item,
[data-theme="dark"] .todo-item,
[data-theme="dark"] .product-item {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

[data-theme="dark"] .chart-area {
    background: linear-gradient(to bottom, var(--card-bg) 0%, var(--bg-secondary) 100%);
}

/* Smooth transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}


.user-menu-container {
    position: relative;
    display: inline-block;
}

.user-menu-trigger {
    width: 40px;
    min-height: var(--phs-icon-btn-size);
        height: var(--phs-icon-btn-size);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

    .user-menu-trigger:hover {
        background: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.2);
    }

    .user-menu-trigger i {
        color: white;
        font-size: 1.1rem;
    }

/* Simple User Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 1rem;
    display: none;
    z-index: var(--phs-z-editor-aux);
    animation: slideDown 0.2s ease-out;
    width: fit-content !important;
    min-width: 160px; 
    white-space: nowrap; 
}


.menu-item a.menu-link {
    display: block;
    color: #3F4254;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

    .menu-item a.menu-link:hover {
        background-color: #F3F6F9;
    }

.separator {
    height: 1px;
    background-color: #E4E6EF;
    margin: 8px 0;
}

.symbol img {
    border-radius: 50%;
    width: 50px;
    height: 50px;
}


@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown.show {
    display: block;
}

/* Logout Button */
.logout-btn {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    color: #F1416C;
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    font-size: 0.9rem;
    font-weight: 600;
}

    .logout-btn:hover {
        background: #FFE2E5;
    }

    .logout-btn i {
        margin-right: 0.75rem;
        font-size: 1rem;
    }

.delegate-btn {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    color: #F1416C;
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    font-size: 0.9rem;
    font-weight: 600;
}

    .delegate-btn:hover {
        background: #FFE2E5;
    }

    .delegate-btn i {
        margin-right: 0.75rem;
        font-size: 1rem;
    }

/* Dark theme support */
[data-theme="dark"] .user-dropdown {
    background: #16213e;
    border: 1px solid #2a2a4e;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .logout-btn:hover {
    background: rgba(241, 65, 108, 0.1);
}
[data-theme="dark"] .delegate-btn:hover {
    background: rgba(241, 65, 108, 0.1);
}
/* Sticky header adjustments */
.sticky-header .user-menu-trigger {
    width: 35px;
    height: 35px;
}

.sticky-header .user-dropdown {
    min-width: 140px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .user-dropdown {
        min-width: 120px;
        right: -10px;
    }

    .logout-btn {
        padding: 0.625rem 0.75rem;
        font-size: 0.85rem;
    }
    .delegate-btn {
        padding: 0.625rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* ============================================
   AUTHENTICATION-BASED HEADER VISIBILITY
   ============================================ */

/* For non-authenticated users */
body:not(.authenticated) #kt_app_header {
    display: none !important;
}

body:not(.authenticated) .sticky-header {
    position: fixed !important;
    top: 0 !important;
    transform: none !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body:not(.authenticated) .app-wrapper {
    margin-top: 60px !important; /* Height of sticky header */
}

/* For authenticated users - ensure main header is visible */
body.authenticated #kt_app_header {
    display: block !important;
    position: relative !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* For authenticated users - sticky header hidden by default */
body.authenticated .sticky-header {
    position: fixed;
    top: -80px;
    transition: transform 0.3s ease;
}

    body.authenticated .sticky-header.show {
        transform: translateY(80px);
    }

/* Dashboard specific for authenticated users */
body.authenticated.dashboard-page #kt_app_header {
    display: block !important;
    height: 100px !important;
    position: relative !important;
}


/* Regular pages for authenticated users */
body.authenticated:not(.dashboard-page) .app-wrapper {
    margin-top: 0 !important;
}


/* Global User Dropdown */
.user-dropdown {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0.75rem !important;
    width: auto;
    min-width: 160px;
    max-width:fit-content;
    z-index: var(--phs-z-skip-link);
    transition: opacity 0.15s ease, transform 0.15s ease;
    transform: translateY(-4px);
    transform-origin: top center;
    opacity: 0;
}

    .user-dropdown button,
    .user-dropdown .dropdown-item {
        width: 100%;
        text-align: left;
        padding: 0.5rem 0.75rem;
        border-radius: 6px;
    }

    .user-dropdown button:hover,
    .user-dropdown .dropdown-item:hover {
        background-color: #f8f9fa;
    }
 
    .user-dropdown[style*="display: block"] {
        opacity: 1;
        transform: translateY(0);
    }



.main-card {
    width: 70vw;
    background: #ffffff;
    border-radius: 20px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.main-card-content {
    width: 100%;
    position: relative;
    text-align: center;
}

    .main-card-content img {
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 150px; 
        height: 133px;
    }

    .main-card-content .department-name {
        color: #4A90E2;
        font-size: 2.0rem;
        margin: 0 0 0.5rem 0;
        font-weight: 500;
    }

    .main-card-content .project-title {
        color: #333333;
        font-size: 1.2rem;
        font-weight: 600;
        margin: 0 0 0.5rem 0;
    }

    .main-card-content .project-tactical-planName {
        color: #333333;
        font-size: 1.2rem;
        font-weight: 600;
        margin: 0 0 0.5rem 0;
    }

    .main-card-content .project-date {
        color: #2563eb;
        font-size: 1.3rem;
        margin: 0;
        font-weight: 400;
    }

/* --- View Tactical Plan Modal Styling --- */
.modal-content {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    background-color: #fff !important;
    padding-bottom: 1.5rem;
    overflow: hidden;
}

/* Header */
.modal-header {
    border: none !important;
    justify-content: center;
    padding-top: 1.75rem;
    padding-bottom: 0;
    background: transparent !important;
    background-color: #2563eb !important;
    color: white !important;
}

/* Title */
.modal-title {
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
}
    .modal-title .btn-close {
       
        color: white !important;
    }
/* Form labels */
.modal-body .form-label {
    color: #4b5563;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Input fields */
.modal-body .form-control {
    border: 1px solid #767676 !important;
    background-color: #f9fafb !important;
    border-radius: 10px !important;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

    .modal-body .form-control:focus {
        background-color: #fff !important;
        border-color: #3b82f6 !important;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
    }

/* Buttons */
.modal-footer {
    border-top: none !important;
    justify-content: center;
    padding: 1.5rem 2rem 1rem;
    background-color: #fff;
}

.btn-light {
    background-color: #f3f4f6 !important;
    color: #374151 !important;
    border: none !important;
    font-weight: 600;
    border-radius: 10px !important;
    padding: 0.625rem 1.5rem !important;
}

    .btn-light:hover {
        background-color: #e5e7eb !important;
    }

.btn-primary {
    background-color: #2563eb !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 600;
    border-radius: 10px !important;
    padding: 0.625rem 1.5rem !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

    .btn-primary:hover {
        background-color: #1d4ed8 !important;
        color: #ffffff !important;
        border-color: #1d4ed8 !important;
        background-image: none !important;
    }

/* Primary hover/focus vs. Metronic: see ~/css/after-theme-overrides.css (loads after style.bundle) */

.btn:focus,
.btn:focus-visible,
.btn:active {
    opacity: 1 !important;
}

.btn-secondary:focus,
.btn-secondary:focus-visible,
.btn-secondary:active,
.btn-secondary.active {
    color: #ffffff !important;
}

.btn-light:focus,
.btn-light:focus-visible,
.btn-light:active {
    color: #374151 !important;
    background-color: #e5e7eb !important;
}

.btn-outline-primary:focus,
.btn-outline-primary:focus-visible,
.btn-outline-primary:active {
    color: #ffffff !important;
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

/* Responsive */
@media (max-width: 768px) {

    .modal-content {
        padding: 1rem !important;
    }
}

/* --- Required field indicator --- */
.form-label .text-danger {
    margin-left: 2px;
    font-weight: 700;
    font-size: 1rem;
}

/* --- Validation styles --- */
.is-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

.invalid-feedback {
    display: block;
    color: #dc2626;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}


.form-label .text-danger,
label .text-danger {
    color: #dc2626 !important; 

    font-weight: 700 !important;
    margin-left: 2px;
    font-size: 1rem;
    line-height: 1;
    vertical-align: middle;
}

 

 

/* Dark Mode Support for Main Card */
[data-theme="dark"] .main-card {
    background: #1e1e2d;
    border-color: #2b2b40;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .main-card-content .department-name {
    color: #3699ff;
}

[data-theme="dark"] .main-card-content .project-title {
    color: #ffffff;
}

[data-theme="dark"] .main-card-content .project-date {
    color: #3699ff;
}

/* Optional: Add a subtle glow effect for the image in dark mode */
[data-theme="dark"] .main-card-content img {
    filter: brightness(0.9);
}

/* Dark Mode Support for Modals - Complete */

/* Modal Content Container */
[data-theme="dark"] .modal-content {
    background-color: #1e1e2d !important;
    border-color: #2b2b40 !important;
    color: #ffffff;
}

    /* Modal Header - Multiple specific selectors to ensure it works */
    [data-theme="dark"] .modal .modal-header,
    [data-theme="dark"] .modal-dialog .modal-header,
    [data-theme="dark"] .modal-content > .modal-header,
    [data-theme="dark"] #addProjectModal .modal-header,
    [data-theme="dark"] .modal.show .modal-header,
    [data-theme="dark"] .modal.fade.show .modal-header,
    [data-theme="dark"] div.modal .modal-header,
    [data-theme="dark"] div.modal-dialog .modal-header {
        background-color: #1e1e2d !important;
        background: #1e1e2d !important;
        border-bottom: 1px solid #2b2b40 !important;
    }

/* Modal Body */
[data-theme="dark"] .modal-body {
    background-color: #1e1e2d !important;
    color: #ffffff;
}

/* Modal Footer */
[data-theme="dark"] .modal-footer {
    background-color: #1e1e2d !important;
    border-top: 1px solid #2b2b40 !important;
}

/* Modal Title */
[data-theme="dark"] .modal-title {
    color: #ffffff;
}

/* Modal titles using Metronic .text-dark keep readable light text on the dark modal.
   Needs !important to beat .text-dark{color:var(--bs-text-dark)!important}. */
[data-theme="dark"] .modal .text-dark {
    color: #f8f9fa !important;
}

/* Form Labels */
[data-theme="dark"] .modal .form-label {
    color: #b5b5c3;
}

/* Form Controls (Inputs, Selects, Textareas) */
[data-theme="dark"] .modal .form-control {
    background-color: #1b1b29;
    border-color: #2b2b40;
    color: #ffffff;
}

    [data-theme="dark"] .modal .form-control:focus {
        background-color: #1b1b29;
        border-color: #3699ff;
        color: #ffffff;
        box-shadow: 0 0 0 0.25rem rgba(54, 153, 255, 0.25);
    }

    [data-theme="dark"] .modal .form-control::placeholder {
        color: #6c6c80;
    }

    /* Disabled form controls */
    [data-theme="dark"] .modal .form-control:disabled {
        background-color: #151521;
        color: #565674;
    }

/* Close Button */
[data-theme="dark"] .modal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Cancel/Light Button */
[data-theme="dark"] .modal .btn-light {
    background-color: #2b2b40;
    border-color: #2b2b40;
    color: #b5b5c3;
}

    [data-theme="dark"] .modal .btn-light:hover {
        background-color: #323248;
        border-color: #323248;
        color: #ffffff;
    }

/* Primary Button */
[data-theme="dark"] .modal .btn-primary {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

    [data-theme="dark"] .modal .btn-primary:hover {
        background-color: #1d4ed8;
        border-color: #1d4ed8;
        color: #ffffff !important;
    }

/* Required Asterisk */
/* !important needed to beat the light .required-asterisk !important rule. #f64e60 = 4.68 on #16213e. */
[data-theme="dark"] .required-asterisk {
    color: #f64e60 !important;
}

/* Date Input Calendar Icon */
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* Modal Backdrop (optional - makes it slightly darker) */
[data-theme="dark"] .modal-backdrop {
    background-color: #000000;
    opacity: 0.6;
}

/* Select Dropdowns if you have any */
[data-theme="dark"] .modal .form-select {
    background-color: #1b1b29;
    border-color: #2b2b40;
    color: #ffffff;
}

    [data-theme="dark"] .modal .form-select:focus {
        background-color: #1b1b29;
        border-color: #3699ff;
        color: #ffffff;
        box-shadow: 0 0 0 0.25rem rgba(54, 153, 255, 0.25);
    }

/* Checkbox and Radio Buttons */
[data-theme="dark"] .modal .form-check-input {
    background-color: #1b1b29;
    border-color: #2b2b40;
}

    [data-theme="dark"] .modal .form-check-input:checked {
        background-color: #3699ff;
        border-color: #3699ff;
    }

[data-theme="dark"] .modal .form-check-label {
    color: #b5b5c3;
}

/* Alert Messages in Modals */
[data-theme="dark"] .modal .alert-danger {
    background-color: #3a2434;
    border-color: #f64e60;
    color: #f64e60;
}

[data-theme="dark"] .modal .alert-success {
    background-color: #1c3238;
    border-color: #1bc5bd;
    color: #1bc5bd;
}

[data-theme="dark"] .modal .alert-warning {
    background-color: #392f28;
    border-color: #ffa800;
    color: #ffa800;
}

[data-theme="dark"] .modal .alert-info {
    background-color: #2a3547;
    border-color: #3699ff;
    color: #3699ff;
}

/* Invalid Feedback Text */
[data-theme="dark"] .modal .invalid-feedback {
    color: #f64e60;
}

/* Valid Feedback Text */
[data-theme="dark"] .modal .valid-feedback {
    color: #1bc5bd;
}

/* Ensure all modal variations are covered */
[data-theme="dark"] .modal.show .modal-dialog .modal-content,
[data-theme="dark"] .modal.fade.show .modal-dialog .modal-content {
    background-color: #1e1e2d !important;
}

/* --- Section headers (work in both light & dark modes) --- */
.modal-body h6 {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15); /* visible on dark */

    padding-bottom: 0.25rem;
    color: var(--bs-body-color, #1e293b); /* Bootstrap variable if defined */
}

/* Force visible color in dark mode */

[data-theme="dark"] .modal-body h6 {
    color: #ffffff !important; /* Light gray text */

    border-color: rgba(255, 255, 255, 0.25) !important;
}

/* === Modal text color fix for dark mode === */

[data-theme="dark"] .modal-content {
    background-color: #1e1e2f !important;
    color: #e5e7eb !important;
}

[data-theme="dark"] .modal-body,
[data-theme="dark"] .modal-body label,
[data-theme="dark"] .modal-body h6,
[data-theme="dark"] .modal-body input,
[data-theme="dark"] .modal-body select,
[data-theme="dark"] .modal-body textarea {
    color: #e5e7eb !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: #2a2a3d !important;
    border-color: #444 !important;
    color: #f3f4f6 !important;
}


/* === Dark Mode Styling (no Bootstrap variables) === */

/* Modal base background + text color */

[data-theme="dark"] .modal-content,
.dark-mode .modal-content {
    background-color: #1e1e2f !important;
    color: #e5e7eb !important;
}

/* Labels, section headers, and general text */

[data-theme="dark"] .modal-body,
[data-theme="dark"] .modal-body label,
[data-theme="dark"] .modal-body h6,
.dark-mode .modal-body,
.dark-mode .modal-body label,
.dark-mode .modal-body h6 {
    color: #e5e7eb !important;
}

/* Input fields, dropdowns, textareas */

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] textarea,
.dark-mode .form-control,
.dark-mode .form-select,
.dark-mode textarea {
    background-color: #2a2a3d !important;
    border-color: #444 !important;
    color: #f3f4f6 !important;
}

    /* Focused inputs */

    [data-theme="dark"] .form-control:focus,
    [data-theme="dark"] .form-select:focus,
    [data-theme="dark"] textarea:focus,
    .dark-mode .form-control:focus,
    .dark-mode .form-select:focus,
    .dark-mode textarea:focus {
        background-color: #2f3145 !important;
        color: #f3f4f6 !important;
        border-color: #3b82f6 !important;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
    }

    /* Placeholder text */

    [data-theme="dark"] .form-control::placeholder,
    [data-theme="dark"] textarea::placeholder,
    .dark-mode .form-control::placeholder,
    .dark-mode textarea::placeholder {
        color: var(--phs-ink-muted) !important;
        opacity: 1 !important;
    }

/* Dropdown options */

[data-theme="dark"] select option,
.dark-mode select option {
    background-color: #2a2a3d !important;
    color: #f3f4f6 !important;
}

/* Section headers */

[data-theme="dark"] .modal-body h6,
.dark-mode .modal-body h6 {
    color: #e5e7eb !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
}


/* Base card styling */

.phase-card {
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

    /* Icon positioning */

    .phase-card .phase-icon {
        position: absolute;
        top: 16px;
        right: 20px;
        width: 36px;
        height: 36px;
        background-color: rgba(59, 130, 246, 0.08);
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }

        .phase-card .phase-icon:hover {
            background-color: rgba(59, 130, 246, 0.15);
        }

/* List items */

.phase-item {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .phase-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }


.navbar-icon-btn,
.menu-trigger,
.user-menu-trigger,
.theme-switcher-btn {
    background: #3a365f !important; /* Dark background */
    border: 1px solid #2C294B !important;
}

    .navbar-icon-btn:hover,
    .menu-trigger:hover,
    .user-menu-trigger:hover,
    .theme-switcher-btn:hover {
        background: #3a365f !important; /* Slightly lighter on hover */
        border-color: #3a365f !important;
    }

/* Search container with dark background */
.main-header .search-container,
.navbar-search {
    position: relative;
    width: 250px;
}

    .main-header .search-input,
    .navbar-search input {
        width: 100%;
        min-height: var(--phs-icon-btn-size);
        height: var(--phs-icon-btn-size);
        background: white !important; /* Dark background like the icon buttons */
        border: 1px solid #2C294B !important; /* Matching border */
        border-radius: 8px;
        padding: 0 1rem 0 2.5rem;
        color: black !important; /* Keep white text */
        font-size: 0.9rem;
        outline: none;
        transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    }

        .main-header .search-input::placeholder,
        .navbar-search input::placeholder {
            color: black !important; /* Slightly transparent white */
        }

        .main-header .search-input:focus,
        .navbar-search input:focus {
            background: whitesmoke !important; /* Slightly lighter on focus */
            border-color: #4a466f !important; /* Lighter border on focus */
            box-shadow: 0 0 0 2px rgba(44, 41, 75, 0.2) !important;
        }

    .main-header .search-icon,
    .navbar-search i {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: black !important; /* Keep icon white */
        font-size: 0.9rem;
        pointer-events: none;
    }

/* Sticky header search container - same treatment */
.sticky-header .search-container .search-input {
    background: #2C294B !important;
    border: 1px solid #2C294B !important;
    color: #ffffff !important;
}

    .sticky-header .search-container .search-input:focus {
        background: #3a365f !important;
        border-color: #4a466f !important;
    }


.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    background-color: #ffffff;
    color: #1e1e2e;
    z-index: 1050;
    min-height: 60px;
    height: auto;
    box-sizing: border-box;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid #e4e6ef;
}

.main-header .logo {
    color: #2c294b;
    justify-content: flex-start;
    text-align: left;
    gap: 0;
}

.main-header .logo-text-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

    .main-header .logo-text-link:hover {
        color: inherit;
        text-decoration: none;
        opacity: 0.92;
    }

.main-header .logo-text {
    align-items: flex-start;
    text-align: left;
}

.main-header .logo-title,
.main-header .logo-subtitle {
    text-align: left;
}

/* Figma “Page Heading”: main title + env suffix (e.g. … - Local) */
.main-header .logo-title {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.25;
    color: #2c294b;
    letter-spacing: -0.01em;
}

.main-header .logo-subtitle {
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.35;
    color: #2c294b;
    opacity: 1;
}

/* Dark mode: primary app bar follows theme (--bg-header on html[data-theme="dark"]) */
[data-theme="dark"] .main-header {
    background-color: var(--bg-header);
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 16px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .main-header .logo {
    color: var(--text-primary);
}

[data-theme="dark"] .main-header .logo-title,
[data-theme="dark"] .main-header .logo-subtitle {
    color: var(--text-primary);
}

[data-theme="dark"] .main-header .logo-subtitle {
    opacity: 0.88;
}

[data-theme="dark"] .main-header .header-hamburger .hamburger-line {
    background: var(--text-primary);
}

[data-theme="dark"] .main-header .search-container {
    /* No fill on the wrapper - the input carries the only background. A second
       translucent layer here stacked with the input and framed it two-tone. */
    background: transparent !important;
    box-shadow: none;
}

/* Header sits to the right of the fixed sidebar so it does not cover the rail */
body.sidebar-enabled .main-header {
    left: var(--app-sidebar-rail-width);
    width: calc(100% - var(--app-sidebar-rail-width));
}

@media (max-width: 768px) {
    body.sidebar-enabled .main-header {
        left: 0;
        width: 100%;
    }
}

body.sidebar-enabled .impersonation-bar {
    padding-left: var(--app-sidebar-rail-width);
}

body.sidebar-enabled .main-header-container {
    max-width: none;
    width: 100%;
    padding-right: 1rem;
}

/* Main column: use horizontal space; rail offset + gutter (padding-right set in sideBar for rail pages) */
body.sidebar-enabled #main-content.app-wrapper {
    max-width: none;
}

@media (max-width: 768px) {
    body.sidebar-enabled .impersonation-bar {
        padding-left: 0;
    }
}

.main-header-container {
    max-width: 1400px;
    width: 100%;
    flex: 1 1 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    box-sizing: border-box;
}

.main-header-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

.main-header-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Search box */
.main-header .search-container {
    position: relative;
    display:flex;
    align-items:center;
}

.main-header .search-input {
    height:34px;
    width:200px;
    background-color: white;
    border: none;
    border-radius: 6px;
    padding: 0px 30px 0px 10px;
    font-size: 0.9rem;
    text-align:center;
}

.main-header .search-icon {
    position: absolute;
    right: 10px;
    font-size:0.9rem;
    color: #555;
}

/* Main header search — flat in the bar (overrides globalSearch.css) */
.main-header .header-nav-search-slot {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    margin-right: 0.5rem;
    box-sizing: border-box;
}

.main-header .search-container {
    position: relative;
    flex: 1 1 auto;
    width: 380px;
    min-width: 280px;
    max-width: min(480px, 100%);
    margin-right: 0;
    box-sizing: border-box;
}

.main-header .header-quicklinks-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1.15rem;
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 0.25rem;
}

.main-header .header-quicklinks-strip[hidden] {
    display: none !important;
}

.main-header .header-quicklinks-strip__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #2c294b;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    padding: 0.25rem 0;
}

    .main-header .header-quicklinks-strip__link:hover,
    .main-header .header-quicklinks-strip__link:focus {
        color: #2c294b;
        border-bottom-color: rgba(44, 41, 75, 0.35);
    }

    .main-header .header-quicklinks-strip__link .header-nav-icon {
        font-size: 1rem;
    }

[data-theme="dark"] .main-header .header-quicklinks-strip__link {
    color: var(--text-primary);
}

    [data-theme="dark"] .main-header .header-quicklinks-strip__link:hover,
    [data-theme="dark"] .main-header .header-quicklinks-strip__link:focus {
        color: var(--text-primary);
        border-bottom-color: rgba(255, 255, 255, 0.35);
    }

.main-header .search-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    height: 38px;
    line-height: 1.25;
    padding: 8px 44px 8px 14px;
    border: none !important;
    border-radius: 8px;
    background-color: #f3f6f9 !important;
    color: #3f4254 !important;
    text-align: left;
    box-shadow: none !important;
    font-size: 0.9rem;
}

.main-header .search-input::placeholder {
    color: #5b6472 !important;
}

.main-header .search-input:focus {
    outline: none !important;
    background-color: #eceef2 !important;
    border: none !important;
    box-shadow: none !important;
}

/* Keyboard focus needs a visible ring; the :focus rule above strips it, so restore one
   for :focus-visible only (WCAG 2.4.7). Outline #0d6efd clears 3:1 on both headers. */
.main-header .search-input:focus-visible {
    outline: 2px solid #0d6efd !important;
    outline-offset: 2px !important;
}

.main-header .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    left: auto;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    letter-spacing: 0;
    font-weight: 400;
    pointer-events: none;
}

[data-theme="dark"] .main-header .search-input {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #e4e6ef !important;
}

[data-theme="dark"] .main-header .search-input:focus {
    background-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .main-header .search-input::placeholder {
    color: #92929f !important;
}

/* --- Header Icon Buttons --- */
.menu-trigger,
.user-menu-trigger,
.theme-switcher-btn,
.header-settings-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background-color: #f3f6f9;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

    .menu-trigger i,
    .user-menu-trigger i,
    .theme-switcher-btn i,
    .header-settings-trigger i {
        color: #3f4254 !important;
        font-size: 0.95rem;
        opacity: 0.95;
    }

    /* Hover highlight */
    .menu-trigger:hover,
    .user-menu-trigger:hover,
    .theme-switcher-btn:hover,
    .header-settings-trigger:hover {
        background-color: #ebedf3;
        border-color: #e4e6ef;
        transform: translateY(-1px);
    }

        .menu-trigger:hover i,
        .user-menu-trigger:hover i,
        .theme-switcher-btn:hover i,
        .header-settings-trigger:hover i {
            opacity: 1;
        }

/* Main header icons: no tile by default; light hover only (gear, bell, user, theme) */
.main-header .menu-trigger,
.main-header .user-menu-trigger,
.main-header .header-settings-trigger,
.main-header .header-more-menu-btn,
.main-header .header-show-search-btn,
.main-header .theme-switcher-btn {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none;
    transform: none;
}

    .main-header .menu-trigger:hover,
    .main-header .user-menu-trigger:hover,
    .main-header .header-settings-trigger:hover,
    .main-header .header-more-menu-btn:hover,
    .main-header .header-show-search-btn:hover,
    .main-header .theme-switcher-btn:hover {
        background-color: #eceef2 !important;
        border: none !important;
        transform: none;
    }

        .main-header .menu-trigger:hover i,
        .main-header .user-menu-trigger:hover i,
        .main-header .header-settings-trigger:hover i,
        .main-header .header-more-menu-btn:hover i,
        .main-header .header-show-search-btn:hover i,
        .main-header .theme-switcher-btn:hover i {
            color: #181c32 !important;
            opacity: 1;
        }

        .main-header .menu-trigger:hover i.header-nav-icon,
        .main-header .user-menu-trigger:hover i.header-nav-icon,
        .main-header .header-settings-trigger:hover i.header-nav-icon,
        .main-header .header-more-menu-btn:hover i.header-nav-icon,
        .main-header .header-show-search-btn:hover i.header-nav-icon {
            color: #2c294b !important;
        }

[data-theme="dark"] .main-header .menu-trigger:hover,
[data-theme="dark"] .main-header .user-menu-trigger:hover,
[data-theme="dark"] .main-header .header-settings-trigger:hover,
[data-theme="dark"] .main-header .header-more-menu-btn:hover,
[data-theme="dark"] .main-header .header-show-search-btn:hover,
[data-theme="dark"] .main-header .theme-switcher-btn:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .main-header .menu-trigger:hover i,
[data-theme="dark"] .main-header .user-menu-trigger:hover i,
[data-theme="dark"] .main-header .header-settings-trigger:hover i,
[data-theme="dark"] .main-header .header-more-menu-btn:hover i,
[data-theme="dark"] .main-header .header-show-search-btn:hover i,
[data-theme="dark"] .main-header .theme-switcher-btn:hover i {
    color: #f5f8fa !important;
    opacity: 1;
}

/* Header nav icons — Figma: Font Awesome 6 Pro Regular 20px, fill #2C294B */
.main-header .header-nav-icon {
    color: #2c294b !important;
    font-family: "Font Awesome 6 Pro", "Font Awesome 6 Free", "Font Awesome 6 Brands", var(--fa-style-family, "Font Awesome 6 Free") !important;
    font-style: normal !important;    
    font-size: 1.25rem !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
}

.main-header .header-nav-icon svg {
    color: #2c294b !important;
    width: 1em !important;
    height: 1em !important;
    vertical-align: -0.0625em;
}

.main-header .search-icon {
    color: #2c294b !important;
    font-family: "Font Awesome 6 Pro", "Font Awesome 6 Free", "Font Awesome 6 Brands", var(--fa-style-family, "Font Awesome 6 Free") !important;
    font-style: normal !important;
    font-weight: 400 !important;
}

.main-header .search-icon svg {
    color: #2c294b !important;
    width: 1em !important;
    height: 1em !important;
    vertical-align: -0.0625em;
}

[data-theme="dark"] .main-header .header-nav-icon,
[data-theme="dark"] .main-header .search-icon {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .main-header .header-nav-icon svg,
[data-theme="dark"] .main-header .search-icon svg {
    color: var(--text-primary) !important;
}

/* Gear / ellipsis omit .header-nav-icon — match bar foreground in dark mode */
[data-theme="dark"] .main-header .header-settings-trigger > i,
[data-theme="dark"] .main-header .header-more-menu-btn > i {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .main-header .menu-trigger:hover i.header-nav-icon,
[data-theme="dark"] .main-header .user-menu-trigger:hover i.header-nav-icon,
[data-theme="dark"] .main-header .header-settings-trigger:hover i.header-nav-icon,
[data-theme="dark"] .main-header .header-more-menu-btn:hover i.header-nav-icon,
[data-theme="dark"] .main-header .header-show-search-btn:hover i.header-nav-icon {
    color: #f5f8fa !important;
}

/* Trailing | + “more” (⋯) menu */
.header-nav-trailing {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.15rem;
    flex-shrink: 0;
}

.header-nav-sep {
    font-size: 0.95rem;
    font-weight: 300;
    color: rgba(44, 41, 75, 0.38);
    user-select: none;
    line-height: 1;
}

[data-theme="dark"] .main-header .header-nav-sep {
    color: rgba(255, 255, 255, 0.38);
}

.header-more-menu-wrap {
    position: relative;
    flex-shrink: 0;
    z-index: 30;
}

    .header-more-menu-wrap.is-open {
        z-index: 10070;
    }

.header-more-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s ease;
}

    .header-more-menu-btn:hover {
        background-color: #eceef2 !important;
    }

[data-theme="dark"] .header-more-menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.header-show-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s ease;
}

    .header-show-search-btn:hover {
        background-color: #eceef2 !important;
    }

[data-theme="dark"] .header-show-search-btn:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.header-more-menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 11.75rem;
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.12);
    z-index: 10075;
}

    .header-more-menu-panel[hidden] {
        display: none !important;
    }

.header-more-menu-panel__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
    text-decoration: none;
    border: none;
    background: none;
    padding: 0.45rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    box-sizing: border-box;
}

    .header-more-menu-panel__item .header-nav-icon {
        font-size: 1rem;
        flex-shrink: 0;
    }

    .header-more-menu-panel__item:hover,
    .header-more-menu-panel__item:focus {
        background: #f1f5f9;
        color: #0f172a;
        outline: none;
    }

[data-theme="dark"] .header-more-menu-panel {
    background: #1b2744;
    border-color: #334e68;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .header-more-menu-panel__item {
    color: #e2e8f0;
}

    [data-theme="dark"] .header-more-menu-panel__item:hover,
    [data-theme="dark"] .header-more-menu-panel__item:focus {
        background: #0f172a;
        color: #f8fafc;
    }

/* Gear menu: font size + theme */
.header-settings-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.header-settings-dropdown {
    position: fixed;
    z-index: 10060;
    min-width: 280px;
    max-width: min(320px, calc(100vw - 24px));
    background: #ffffff;
    border: 1px solid #e4e6ef;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 0;
}

.header-settings-dropdown-inner {
    padding: 12px 14px 14px;
}

.header-settings-heading {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 8px;
}

.header-settings-group {
    margin: 0;
}

.header-settings-divider {
    height: 1px;
    background: #eff2f5;
    margin: 12px 0;
}

.header-settings-theme-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e4e6ef;
    background: #f9f9fb;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #3f4254;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

    .header-settings-theme-btn:hover {
        background: #f3f6f9;
        border-color: #dcdfe6;
    }

.header-settings-theme-label {
    text-align: left;
}

.header-settings-theme-btn .ki-duotone {
    flex-shrink: 0;
    font-size: 1.35rem;
    color: #5e6278;
}

[data-theme="dark"] .header-settings-dropdown {
    background: #1e1e2d;
    border-color: #2b2b40;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .header-settings-heading {
    color: #92929f;
}

[data-theme="dark"] .header-settings-divider {
    background: #2b2b40;
}

[data-theme="dark"] .header-settings-theme-btn {
    background: #252536;
    border-color: #2b2b40;
    color: #e4e6ef;
}

    [data-theme="dark"] .header-settings-theme-btn:hover {
        background: #2b2b40;
        border-color: #3f4254;
    }

 
/* --- Settings Button --- */
.new-goal-btn {
    height: 34px;
    padding: 0 16px;
    border: none;
    border-radius: 6px;
    background-color: #2563eb;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s;
}

    .new-goal-btn:hover {
        background-color: #1d4ed8;
        transform: translateY(-1px);
    }
 


body {
    padding-top: 70px;
}


/* User Dropdown Styling */
.user-dropdown {
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 120px;
    z-index: 2000;
    padding: 8px 0;
    width: fit-content !important;
}

    .user-dropdown button.logout-btn {
        background: none;
        border: none;
        color: orangered;
        padding: 8px 16px;
        width: 100%;
        text-align: left;
        cursor: pointer;
        font-size: 0.9rem;
    }

        .user-dropdown button.logout-btn:hover {
            background-color: #f5f5f5;
        }

    .user-dropdown button.delegate-btn {
        background: none;
        border: none;
        color: #7E8299;
        padding: 8px 16px;
        width: 100%;
        text-align: left;
        cursor: pointer;
        font-size: 0.9rem;
    }

        .user-dropdown button.delegate-btn:hover {
            background-color: #f5f5f5;
        }
/* ===========================
   No Access Page Styling
   =========================== */

.no-access-page body,
.no-access-page main,
.no-access-page {
    background-color: #f9fafc;
}

.no-access-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    text-align: center;
    color: #000;
}

.no-access-icon {
    font-size: 100px;
    color: #000;
    margin-bottom: 25px;
}

.no-access-title {
    font-size: 1.625rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 10px;
}

.no-access-message {
    font-size: 1rem;
    color: #888;
    line-height: 1.6;
}

.no-access-page .app-header,
.no-access-page .nav_user,
.no-access-page .app-navbar {
    display: none !important;
}

.theme-rotate {
    animation: rotateTheme 0.3s ease-in-out;
    transform-origin: center;
}

@keyframes rotateTheme {
    from {
        transform: rotate(0deg);
        opacity: 0.6;
    }

    to {
        transform: rotate(360deg);
        opacity: 1;
    }
}

.settings-dropdown {
    background-color: #fff;
    border-radius: 8px;
    color: black !important;
    min-width: 220px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    margin-top:3px;
    font-weight:bold !important;
}


    .settings-dropdown .dropdown-item:hover {
        background-color: ButtonShadow;
        color: black !important;
        border-radius: 8px;
        min-width: 220px;
    }

[data-theme="dark"] .settings-dropdown {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color:white!important;
}
    [data-theme="dark"].settings-dropdown .dropdown-item:hover {
        background: var(--card-bg);
        border: 1px solid var(--border-color);
    }

.settings-menu-trigger .btn.active {
    filter: brightness(95%);
}


/* Universal Cancel Modal - Professional Design */
#universalCancelModal .modal-dialog {
    max-width: 420px;
}

#universalCancelModal .modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

#universalCancelModal .modal-body {
    background: #ffffff;
    position: relative;
}

/* Warning Icon Styling */
#universalCancelModal .warning-icon-wrapper {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    animation: pulseWarning 2s infinite;
}

#universalCancelModal .warning-icon {
    width: 40px;
    min-height: var(--phs-icon-btn-size);
        height: var(--phs-icon-btn-size);
    color: #f39c12;
}

/* Title and Text */
#universalCancelModal .modal-title {
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    color: #2c3e50;
}

#universalCancelModal p.text-muted {
    color: #6c757d !important;
    line-height: 1.6;
}

/* App dark theme forces .modal-body to #1e1e2d; the light #6c757d body text is too
   dark on it. */
[data-theme="dark"] #universalCancelModal p.text-muted {
    color: #adb5bd !important;
}

/* Buttons */
#universalCancelModal .btn {
    border-radius: 10px;
    padding: 12px 24px;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

#universalCancelModal .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

    #universalCancelModal .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
        background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    }

    #universalCancelModal .btn-primary:focus {
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    }

#universalCancelModal .btn-outline-danger {
    background: transparent;
    color: #dc3545;
    border: 2px solid #f5f6fa;
    font-weight: 400;
}

    #universalCancelModal .btn-outline-danger:hover {
        background: #fff5f5;
        border-color: #ffebeb;
        color: #dc3545;
        transform: translateY(-1px);
    }

/* Animation for warning icon */
@keyframes pulseWarning {
    0% {
        box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(243, 156, 18, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(243, 156, 18, 0);
    }
}

/* Modal animation */
#universalCancelModal.show .modal-dialog {
    animation: slideInScale 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInScale {
    0% {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Modal backdrop — solid overlay (no glassmorphism) */
.modal-backdrop.show {
    background-color: rgba(0, 0, 0, 0.45);
}

/* Responsive adjustments */
@media (max-width: 576px) {
    #universalCancelModal .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }

    #universalCancelModal .modal-title {
        font-size: 1.25rem;
    }

    #universalCancelModal .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
}

/* Theming is data-theme driven; the OS prefers-color-scheme block here forced a white
   modal body under a dark frame and left muted text unreadable, so it was removed. Dark
   styling comes from the [data-theme="dark"] rules instead. */
.btn-info.me-2.view-btn {
    background-color: #6366f1;
    color: #ffffff !important;
}

.btn-danger.delete-btn {
    background-color: #e85757 !important; /* indigo background */
    color: #ffffff !important; /* white text */
}

/* Add to your layout CSS or separate CSS file */
.delete-icon-wrapper {
    width: 64px;
    height: 64px;
    background: #FEE2E2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.delete-icon {
    width: 32px;
    height: 32px;
    color: #DC2626;
}

.warning-icon-wrapper {
    width: 64px;
    height: 64px;
    background: #FEF3C7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.warning-icon {
    width: 32px;
    height: 32px;
    color: #F59E0B;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: var(--phs-z-skip-link);
}

    .loading-overlay .spinner-border {
        width: 3rem;
        height: 3rem;
    }


[data-theme="dark"] .main-header .search-input {
    background-color: #16213e !important;
    /* Subtle edge so the single-tone field still reads on the dark header. */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.hide{
    display:none!important;
}

.underline{
    text-decoration:underline;
}

.ui-autocomplete {
    z-index: 1051 !important; 
}

.modal-body {
    overflow: visible; 
}

.rqrd{
    color:red;
}

#kt_app_content{
    margin-top: 50px !important;
}

/* Impersonation Badge - Fresh Lime */
:root {
    --impersonation-color: #84cc16;
}

.impersonation-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
    padding: 6px 16px;
    background: linear-gradient(135deg, #84cc16, #a3e635);
    color: #1f2937;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: soft-pulse 1.5s ease-in-out infinite;
}

    .impersonation-badge i {
        font-size: 0.9rem;
    }

/* Pulsating glow effect */
@keyframes soft-pulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(132, 204, 22, 0.5);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 20px rgba(132, 204, 22, 1),
                    0 0 40px rgba(163, 230, 53, 0.8);
        opacity: 0.85;
    }
}

/* Respect reduced motion preferences (site-wide) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .impersonation-badge {
        animation: none;
    }
}



.ml-5{
    margin-left: 5px;
}

.filter-label{
    white-space: nowrap;
    margin-top: 5px;
}

.btn-gradient-primary {
    /* !important: this is a custom class, not a Bootstrap variant, so Metronic's .btn
       (background-color: var(--bs-btn-bg)=transparent; color: var(--bs-btn-color)=body ink)
       loads later at equal specificity and wins — leaving the button transparent with dark
       text, which vanished on the dark footer. Pin the fill + label so it stays visible. */
    background-color: #15803d !important;
    border: none;
    color: white !important;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
    margin-left: 10px;
}

    .btn-gradient-primary:hover {
        background-color: #166534 !important;
        color: #fff !important;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
    }

    .btn-gradient-primary:active {
        transform: translateY(0);
        box-shadow: 0 1px 3px rgba(22, 163, 74, 0.2);
    }

/* TP wizard footer CTA: darker green so the white label clears 4.5:1,
   and white stays on hover. Scoped so other uses keep their look.
   The box is pinned to match the sibling footer buttons: Cancel (.btn-light) and
   Previous (.btn-secondary) both force padding 0.625rem + border:none + radius 10px
   with !important, but .btn-gradient-primary has no !important, so its own padding
   lost the cascade to Metronic's .btn (0.775rem + 1px border) and it rendered ~6px
   taller. The .tp-fixed-footer specificity beats .btn, so match the siblings here. */
.tp-fixed-footer .btn-gradient-primary {
    background-color: #15803d;
    margin-left: 0;
    font-size: 0.9rem;
    /* Metronic's .btn:not(.btn-outline):not(.btn-dashed):not(.btn-bordered):not(.btn-flush)
       :not(.btn-icon):not(.btn-hover-outline) chain is specificity (0,7,0) and forces
       padding calc(.775rem + 1px), so a plain (0,2,0) rule loses and the button stayed
       tall. The sibling .btn-secondary/.btn-light win that battle with !important; match
       that here so the padding actually applies and the height lines up at 36.4px. */
    padding: 0.625rem 1.5rem !important;
    border: none !important;
    border-radius: 10px;
}

    .tp-fixed-footer .btn-gradient-primary:hover {
        background-color: #166534;
        color: #fff;
    }


#alertsUnreadBadge {
    display: none;
    position: absolute;
    top: -6px; /* Move it up */
    right: -6px; /* Move it right (outside the icon edge) */
    min-width: 18px;
    height: 18px;
    background: #9B1C1C;
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    text-align: center;
    line-height: 18px;
    padding: 0 4px;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}


/* Alerts Modal Styles */

.alerts-modal {
    position: fixed;
    top: 66px;
    right: 48px;
    width: 390px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(40, 38, 98, 0.18);
    /* Above #globalUserDropdown (10000) and .header-settings-dropdown (10060) */
    z-index: 10090;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    min-height: 120px;
    overflow: hidden;
    font-family: inherit;
}

.alerts-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 10px 22px;
    background: #4e39b7;
    color: #fff;
    font-weight: 600;
    font-size: 1.125rem;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.alerts-modal-title {
    font-size: 1.125rem;
}

.alerts-modal-close {
    cursor: pointer;
    font-size: 1.375rem;
    font-weight: bold;
    color: #fff;
    opacity: 0.85;
    transition: opacity 0.2s;
}

    .alerts-modal-close:hover {
        opacity: 1;
    }

.alerts-modal-content {
    padding: 0 0 0 0;
    max-height: 360px;
    overflow-y: auto;
    background: #fff;
}

.alerts-modal-footer {
    padding: 8px 18px 10px 18px;
    background: #f6f6f9;
    text-align: right;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.alerts-modal-viewall {
    color: #4e39b7;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
}

    .alerts-modal-viewall:hover {
        text-decoration: underline;
    }

/* Modal Backdrop */

.alerts-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(48,44,93,0.10);
    z-index: 10085;
    display: none;
}

.alerts-modal-loading,
.alerts-modal-error {
    text-align: center;
    color: #6b7280;
    padding: 30px 0;
    font-size: 0.9375rem;
}

.alerts-modal-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.alerts-modal-list-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 18px 20px 12px 20px;
    border-bottom: 1px solid #f2f0f7;
    cursor: pointer;
    background: #fff;
    transition: background 0.12s;
}

    .alerts-modal-list-item:hover {
        background: #f8f7fb;
    }

    .alerts-modal-list-item:last-child {
        border-bottom: none;
    }

.alerts-modal-project-tag,
.alerts-modal-plan-tag {
    display: inline-block;
    padding: 2px 10px;
    font-size: 0.75rem;
    border-radius: 8px;
    background: #e7e3fa;
    color: #4e39b7;
    font-weight: 600;
    margin-right: 9px;
    margin-bottom: 3px;
}

.alerts-modal-plan-tag {
    background: #e4f0ff;
    color: #1e6bb8;
}

.alerts-modal-by {
    color: #6b7280;
    font-size: 0.8125rem;
    margin-left: 4px;
}

.alerts-modal-time {
    font-size: 0.75rem;
    color: #6b7280;
    margin-left: 8px;
}

.alerts-modal-unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #dc3545;
    border-radius: 50%;
    margin-right: 7px;
}

.btn btn-dark {
    color: white !important;
}

.alerts-modal-footer {
    padding: 10px 16px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.alerts-modal-viewall {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    transition: color 0.15s ease;
}

    .alerts-modal-viewall:hover {
        color: #1d4ed8;
        text-decoration: underline;
    }

.icon-chart {
    color: #4dabf7;
}

[data-theme="dark"] .icon-chart {
    color: white;
}

/* Alerts popup (bell) — match app dark theme */
[data-theme="dark"] .alerts-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .alerts-modal-header {
    background: #3f2f9a;
    color: #f8fafc;
}

[data-theme="dark"] .alerts-modal-content {
    background: var(--bg-secondary);
}

[data-theme="dark"] .alerts-modal-footer {
    background: var(--bg-primary);
    border-top-color: var(--border-color);
}

[data-theme="dark"] .alerts-modal-viewall {
    color: #a5b4fc;
}

[data-theme="dark"] .alerts-modal-viewall:hover {
    color: #c4d4ff;
}

[data-theme="dark"] .alerts-modal-backdrop {
    background: rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .alerts-modal-loading,
[data-theme="dark"] .alerts-modal-error {
    color: var(--text-muted);
}

[data-theme="dark"] .alerts-modal-list-item {
    background: var(--bg-secondary);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .alerts-modal-list-item:hover {
    background: var(--bg-primary);
}

[data-theme="dark"] .alerts-modal-msg {
    color: var(--text-primary);
}

[data-theme="dark"] .alerts-modal-by,
[data-theme="dark"] .alerts-modal-time {
    color: var(--text-muted);
}

[data-theme="dark"] .alerts-modal-project-tag {
    background: rgba(129, 140, 248, 0.22);
    color: #c4b5fd;
}

[data-theme="dark"] .alerts-modal-plan-tag {
    background: rgba(59, 130, 246, 0.22);
    color: #93c5fd;
}

/* ── Impersonation Banner ── */
.impersonation-bar {
    background: linear-gradient(90deg, #134e4a, #115e59);
    color: #fff;
    text-align: center;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: sticky;
    top: var(--app-header-height, 60px);
    z-index: 1045;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* On dashboard-page views #main-content is position:relative; z-index:10, which creates a stacking
   context that traps modals below the sticky impersonation bar (z-index 1045) - a tall centered modal
   then renders with its top hidden behind the bar. While a modal is open the page behind it is covered
   by the backdrop anyway, so drop that stacking context so the modal (z-index 1055) rises above the bar. */
body.modal-open #main-content {
    z-index: auto;
}

    .impersonation-bar i {
        font-size: 0.9rem;
    }

    .impersonation-bar .impersonation-role {
        background: rgba(255,255,255,0.2);
        padding: 1px 8px;
        border-radius: 4px;
        font-size: 0.75rem;
    }

    /* "Revert to My Account" action in the impersonation banner. White button with dark-teal text
       so it reads clearly on the green bar (good contrast) and matches the user-dropdown action. */
    .impersonation-bar .impersonation-revert-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 3px 12px;
        font-size: 0.75rem;
        font-weight: 600;
        color: #0f5e57;
        background: #ffffff;
        border: 1px solid #ffffff;
        border-radius: 4px;
        cursor: pointer;
        white-space: nowrap;
        transition: background-color 0.15s ease;
    }

        .impersonation-bar .impersonation-revert-btn:hover {
            background: #eafffb;
        }

        .impersonation-bar .impersonation-revert-btn:focus-visible {
            outline: 2px solid #ffffff;
            outline-offset: 2px;
        }

    /* Clickable role badge in the impersonation banner. Looks like the badge but signals it opens
       the mapped business units popup. */
    .impersonation-bar .impersonation-role--link {
        border: 1px solid rgba(255, 255, 255, 0.35);
        color: #fff;
        cursor: pointer;
        font-family: inherit;
        font-weight: 500;
        text-decoration: underline;
        text-underline-offset: 2px;
        transition: background-color 0.15s ease;
    }

        .impersonation-bar .impersonation-role--link:hover {
            background: rgba(255, 255, 255, 0.32);
        }

        .impersonation-bar .impersonation-role--link:focus-visible {
            outline: 2px solid #ffffff;
            outline-offset: 2px;
        }

/* Dark mode */
[data-bs-theme="dark"] .impersonation-bar,
.dark-mode .impersonation-bar {
    background: linear-gradient(90deg, #172e4a, #1d4ed8);
}

/* Impersonation role: mapped business units popup */
.imp-bu-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 360px);
    max-height: 70vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.25);
    z-index: 1000060;
    overflow: hidden;
}

.imp-bu-modal__backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1000059;
}

.imp-bu-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid #e8ecf1;
}

.imp-bu-modal__title {
    font-size: 1rem;
    font-weight: 700;
    color: #2c294b;
}

.imp-bu-modal__close {
    border: none;
    background: transparent;
    font-size: 1.4rem;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0 0.25rem;
}

    .imp-bu-modal__close:hover {
        color: #111827;
    }

.imp-bu-modal__subtitle {
    padding: 0.6rem 1.1rem 0;
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 600;
}

.imp-bu-modal__content {
    padding: 0.5rem 1.1rem 1.1rem;
    overflow-y: auto;
    max-height: calc(70vh - 96px);
}

.imp-bu-modal__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.imp-bu-modal__item {
    display: flex;
    flex-direction: column;
    padding: 0.6rem 0.75rem;
    border: 1px solid #e4e6ef;
    border-radius: 8px;
    background: #f9fafb;
}

.imp-bu-modal__name {
    font-weight: 600;
    color: #181c32;
}

.imp-bu-modal__type {
    font-size: 0.78rem;
    color: #6b7280;
}

.imp-bu-modal__loading,
.imp-bu-modal__empty {
    padding: 0.75rem 0;
    color: #6b7280;
    font-size: 0.875rem;
}

[data-theme="dark"] .imp-bu-modal,
[data-bs-theme="dark"] .imp-bu-modal {
    background: #1b2744;
    color: #e2e8f0;
}

[data-theme="dark"] .imp-bu-modal__header,
[data-bs-theme="dark"] .imp-bu-modal__header {
    border-bottom-color: #334e68;
}

[data-theme="dark"] .imp-bu-modal__title,
[data-bs-theme="dark"] .imp-bu-modal__title {
    color: #e2e8f0;
}

[data-theme="dark"] .imp-bu-modal__item,
[data-bs-theme="dark"] .imp-bu-modal__item {
    background: #243352;
    border-color: #334e68;
}

[data-theme="dark"] .imp-bu-modal__name,
[data-bs-theme="dark"] .imp-bu-modal__name {
    color: #f1f5f9;
}

/* Muted texts kept their light #6b7280 in dark, unreadable on the dark modal/item bg. */
[data-theme="dark"] .imp-bu-modal__type,
[data-theme="dark"] .imp-bu-modal__subtitle,
[data-theme="dark"] .imp-bu-modal__close,
[data-theme="dark"] .imp-bu-modal__loading,
[data-theme="dark"] .imp-bu-modal__empty,
[data-bs-theme="dark"] .imp-bu-modal__type,
[data-bs-theme="dark"] .imp-bu-modal__subtitle,
[data-bs-theme="dark"] .imp-bu-modal__close,
[data-bs-theme="dark"] .imp-bu-modal__loading,
[data-bs-theme="dark"] .imp-bu-modal__empty {
    color: #9ca3af;
}

/* =============================================
   Header Hamburger Menu - Responsive
   ============================================= */

.header-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 1000010;
}

.header-hamburger .hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: #3f4254;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.main-header .header-hamburger .hamburger-line {
    background: #2c294b;
}

.header-hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.header-hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.header-hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .main-header {
        z-index: 1000010;
    }

    .header-hamburger {
        display: flex;
    }

    .main-header-nav {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 60px;
        right: 0;
        width: 260px;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        background: #ffffff;
        box-shadow: -4px 4px 16px rgba(0, 0, 0, 0.12);
        padding: 16px;
        gap: 12px;
        z-index: 1000005;
        border-radius: 0 0 0 12px;
        border: 1px solid #e4e6ef;
        border-right: none;
        border-top: none;
    }

    .main-header-nav.open {
        display: flex;
    }

    .main-header-nav .header-nav-search-slot {
        width: 100%;
    }

    .main-header-nav .search-container {
        width: 100%;
    }

    .main-header-nav .search-input {
        width: 100%;
    }

    .main-header-nav .header-quicklinks-strip {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0.5rem;
    }

    .main-header-nav .theme-switcher,
    .main-header-nav .menu-trigger,
    .main-header-nav .user-menu-trigger,
    .main-header-nav .header-settings-trigger,
    .main-header-nav .header-more-menu-btn,
    .main-header-nav .header-show-search-btn {
        align-self: flex-start;
    }

    .main-header-nav .header-settings-menu {
        width: 100%;
    }

    .main-header .logo-text .logo-title {
        font-size: 1.125rem;
        line-height: 1.3;
    }

    .main-header .logo-text .logo-subtitle {
        font-size: 0.75rem;
        line-height: 1.35;
    }

    .header-mobile-backdrop {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        height: calc(100vh - 60px);
        background: rgba(0, 0, 0, 0.4);
        z-index: 1000004;
    }
}

@media (max-width: 768px) {
    [data-theme="dark"] .main-header-nav {
        background: var(--bg-secondary);
        border-color: var(--border-color);
        box-shadow: -4px 4px 20px rgba(0, 0, 0, 0.45);
    }
}

@media (max-width: 480px) {
    .main-header .logo-text .logo-title {
        font-size: 1rem;
    }

    .main-header .logo-text .logo-subtitle {
        font-size: 0.6875rem;
    }

    .logo-icon {
        padding: 0.4rem;
    }

    .logo-icon svg {
        width: 20px;
        height: 20px;
    }
}


.main-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px 15px 30px;
    gap: 20px;
    background: #fff;
}

[data-theme="dark"] .main-header-container {
    background: transparent;
}

.logo-title {
    font-size: 1.625rem;
    font-weight: 400;
    color: #2C294B;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 0.875rem;
    font-weight: 400;
    color: #2C294B;
    margin-top: 2px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.main-header .search-container {
    width: 380px;
    min-height: var(--phs-icon-btn-size);
        height: var(--phs-icon-btn-size);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #F5F8FF;
    border-radius: 12px;
    box-shadow: 0 0 1px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
}

.main-header .search-input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 0.875rem;
    color: #63636B;
}

.header-nav-icon {
    font-size: 1.25rem;
    color: #2C294B;
}

.header-settings-trigger,
.menu-trigger,
.user-menu-trigger,
.header-more-menu-btn {
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-separator {
    width: 1px;
    height: 30px;
    background: #665DC6;
    margin: 0 10px;
}

/*layout css v2*/

/* ============================================
   Helpful Tips guidance card (shared step pages)
   ============================================ */

.guidance-card-ip {
    background-color: #e8efff;
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: none !important;
    border: none !important;
}

.guidance-card-ip__header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
    white-space: nowrap;
    min-height: 20px;
    font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-weight: 700;
    font-style: normal;
    font-size: 0.875rem;
    line-height: 20px;
    letter-spacing: 0;
}

.guidance-card-ip__header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1f2937;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    letter-spacing: inherit;
}

.guidance-card-ip__icon {
    color: #971fa0 !important;
    font-size: 0.875rem;
    flex-shrink: 0;
    line-height: 1;
}

.guidance-card-ip__title {
    font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-weight: 700;
    font-style: normal;
    font-size: 0.875rem;
    line-height: 20px;
    letter-spacing: 0;
    color: #4c1d95 !important;
    flex-shrink: 0;
}

.guidance-card-ip__chevron-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: inherit;
    border-radius: 6px;
    font-family: inherit;
    font-size: inherit;
    line-height: 20px;
}

.guidance-card-ip__chevron-btn:hover {
    background-color: rgba(151, 31, 160, 0.08);
}

.guidance-card-ip__chevron-btn:focus-visible {
    outline: 2px solid #971fa0;
    outline-offset: 2px;
}

.guidance-card-ip__chevron {
    color: #5b21b6;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    line-height: 1;
}

.guidance-card-ip__chevron-btn.collapsed .guidance-card-ip__chevron {
    transform: rotate(180deg);
}

.guidance-card-ip__body {
    margin-top: 14px;
    padding-top: 2px;
    color: #1f2937;
    font-size: 0.9375rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.guidance-card-ip__merge-row {
    display: block;
    white-space: normal;
    overflow-x: visible;
    width: 100%;
    margin-bottom: 0.75rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.guidance-card-ip__merge-row:last-child {
    margin-bottom: 0;
}

.guidance-card-ip__merge-row h5,
.guidance-card-ip__merge-row h6 {
    display: inline !important;
    margin: 0 !important;
    padding: 0 0.35rem 0 0 !important;
    font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-weight: 700;
    font-style: normal;
    font-size: 0.875rem;
    line-height: 1.45;
    letter-spacing: 0;
    color: #111827;
}

.guidance-card-ip__merge-row p {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.9375rem;
    font-weight: 400;
    color: #1f2937;
}

.guidance-card-ip__merge-row p + p {
    padding-left: 0.35rem !important;
}

.guidance-card-ip__merge-row > div {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.9375rem;
    font-weight: 400;
    color: #1f2937;
    vertical-align: baseline;
    max-width: 100%;
}

.guidance-card-ip__merge-row p:last-child,
.guidance-card-ip__merge-row > div:last-child {
    margin-bottom: 0 !important;
}

.guidance-card-ip__merge-row > div p,
.guidance-card-ip__merge-row > div div {
    display: inline !important;
    margin: 0 0 0 0.35rem !important;
    padding: 0 !important;
    font-weight: inherit;
    font-size: inherit;
    color: inherit;
}

.guidance-card-ip__merge-row > div span {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    font-weight: inherit;
    font-size: inherit;
    color: inherit;
}

.guidance-card-ip__merge-row > div p:last-child,
.guidance-card-ip__merge-row > div div:last-child {
    margin-bottom: 0 !important;
}

.guidance-card-ip__body > p,
.guidance-card-ip__body > div:not(.guidance-card-ip__merge-row) {
    white-space: normal;
    overflow-x: visible;
    overflow-wrap: anywhere;
    word-break: break-word;
    margin-bottom: 0.5rem;
}

.guidance-card-ip__body strong,
.guidance-card-ip__body b {
    font-weight: 700;
    color: #111827;
}

[data-theme="dark"] .guidance-card-ip {
    background-color: color-mix(in srgb, #971fa0 16%, #1a1a24);
}

[data-theme="dark"] .guidance-card-ip__header-left {
    color: #e5e7eb;
}

[data-theme="dark"] .guidance-card-ip__title {
    color: #e9d5ff !important;
}

[data-theme="dark"] .guidance-card-ip__icon {
    color: #e879f9 !important;
}

[data-theme="dark"] .guidance-card-ip__chevron {
    color: #ddd6fe;
}

[data-theme="dark"] .guidance-card-ip__chevron-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .guidance-card-ip__body {
    color: #e5e7eb;
}

[data-theme="dark"] .guidance-card-ip__merge-row h5,
[data-theme="dark"] .guidance-card-ip__merge-row h6,
[data-theme="dark"] .guidance-card-ip__body strong,
[data-theme="dark"] .guidance-card-ip__body b {
    color: #f9fafb;
}

/* The guidance paragraphs/divs/spans set their dark text color DIRECTLY (e.g.
   .guidance-card-ip__merge-row p { color:#1f2937 }), which beats the inherited
   [data-theme="dark"] .guidance-card-ip__body light color — so the guidance body text
   stayed dark-on-dark and invisible. Re-color the direct text targets to match the body
   (#e5e7eb = 12.75:1 on the dark card). Same specificity + later than the light rules. */
[data-theme="dark"] .guidance-card-ip__merge-row p,
[data-theme="dark"] .guidance-card-ip__merge-row > div p,
[data-theme="dark"] .guidance-card-ip__merge-row > div div,
[data-theme="dark"] .guidance-card-ip__merge-row > div span,
[data-theme="dark"] .guidance-card-ip__body > p,
[data-theme="dark"] .guidance-card-ip__body > div:not(.guidance-card-ip__merge-row) {
    color: #e5e7eb;
}

/* --- IP Project Measurement wizard (full-width step flow) --- */
.ip-measure-page {
    max-width: 100%;
}

.ip-measure-wizard {
    border-radius: 12px;
    overflow: hidden;
}

.ip-measure-wizard-body {
    min-height: 280px;
}

.ip-measure-step {
    display: none;
}

.ip-measure-step--active {
    display: block;
}

.ip-measure-step-badge {
    display: inline-block;
    font-family: "Open Sans", system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4c1d95;
    background: #ede9fe;
    border-radius: 999px;
    padding: 4px 12px;
    margin-bottom: 10px;
}

.ip-measure-step-title {
    font-family: "Open Sans", system-ui, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.ip-measure-requirement-hint {
    font-size: 0.8125rem;
}

.ip-measure-table-wrap {
    border: none;
    border-radius: 0;
    overflow: visible;
}

.ip-measure-table {
    font-family: "Open Sans", system-ui, sans-serif;
    margin-bottom: 0;
    --ip-measure-row-dash: #e4e6ef;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.ip-measure-table,
.ip-measure-table td,
.ip-measure-table th {
    border: none !important;
}

/* Header row: #F3F6F9 bar, 48px height, padding, 10px radius, column gap ~10px */
.ip-measure-table thead tr:first-child th {
    font-family: "Open Sans", system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    font-style: normal;
    line-height: 20px;
    letter-spacing: 0;
    vertical-align: middle;
    color: #3b3966;
    text-transform: none;
    background-color: #f3f6f9 !important;
    border-bottom: none !important;
    white-space: nowrap;
    height: 48px;
    box-sizing: border-box;
    padding-top: 15px;
    padding-bottom: 15px;
    padding-left: 10px;
    padding-right: 10px;
}

.ip-measure-table thead tr:first-child th:first-child {
    padding-left: 20px;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.ip-measure-table thead tr:first-child th:last-child {
    padding-right: 60px;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.ip-measure-table thead tr:first-child {
    border-bottom: 1px dashed var(--ip-measure-row-dash);
}

.ip-measure-table tbody tr {
    border-bottom: none !important;
}

/* Row separator: 1px dashed #E4E6EF */
.ip-measure-table tbody tr:not(:last-child) td {
    border-bottom: 1px dashed var(--ip-measure-row-dash) !important;
}

.ip-measure-table tbody tr.empty-row td {
    border-bottom: none !important;
    color: #6b7280;
}

.ip-measure-table tbody td {
    font-family: "Open Sans", system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    font-style: normal;
    line-height: 100%;
    letter-spacing: 0;
    vertical-align: middle;
    color: #000000;
    padding: 10px 14px;
    background-color: #fff;
}

.ip-measure-table .form-control,
.ip-measure-table .form-select {
    font-family: "Open Sans", system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 100%;
    color: #000000;
}

/* Add Measure (wizard) */
.ip-measure-wizard .btn-add-measure.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 138px;
    min-height: var(--phs-icon-btn-size);
        height: var(--phs-icon-btn-size);
    padding: 0 16px;
    border-radius: 6px;
    font-family: "Open Sans", system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1;
    color: #ffffff !important;
    border: none;
}

.ip-measure-wizard .btn-add-measure.btn-primary i {
    color: #ffffff;
}

.ip-measure-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    white-space: nowrap;
}

/* StoryBoard-aligned row actions */
.ip-measure-row-edit {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.ip-measure-row-edit .project-board-item__edit-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

.ip-measure-row-edit:hover .project-board-item__edit-img {
    opacity: 1;
}

.ip-measure-row-delete {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: red;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.ip-measure-row-delete:hover {
    color: darkred;
}

.ip-measure-row-delete i {
    font-size: 1rem;
}

.ip-measure-cell-text {
    font-family: "Open Sans", system-ui, sans-serif;
    font-size: 0.875rem;
    vertical-align: middle;
}

.ip-measure-cell-multiline {
    white-space: pre-wrap;
    word-break: break-word;
}

.ip-measure-footer {
    border-color: #e5e7eb !important;
}

.ip-measure-footer.ip-measure-footer-actions {
    gap: 9px;
}

.ip-measure-footer.ip-measure-footer-actions .ip-measure-footer-btn {
    min-width: 76px;
    min-height: var(--phs-icon-btn-size);
        height: var(--phs-icon-btn-size);
    padding: 0 16px;
    margin: 0;
    border-radius: 6px;
    font-family: "Open Sans", system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.2;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    border-style: solid;
    border-width: 1px;
    appearance: none;
    -webkit-appearance: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ip-measure-footer.ip-measure-footer-actions .ip-measure-footer-btn:disabled,
.ip-measure-footer.ip-measure-footer-actions .ip-measure-footer-btn.disabled {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

/* Outline: blue border + blue label (match spec #0646D3) */
.ip-measure-footer.ip-measure-footer-actions .ip-measure-footer-btn--outline {
    background-color: #fff !important;
    background-image: none !important;
    border-color: #0646d3 !important;
    color: #0646d3 !important;
    box-shadow: none !important;
}

.ip-measure-footer.ip-measure-footer-actions .ip-measure-footer-btn--outline:hover:not(:disabled) {
    background-color: #f0f6ff !important;
    border-color: #0646d3 !important;
    color: #0646d3 !important;
}

.ip-measure-footer.ip-measure-footer-actions .ip-measure-footer-btn--outline:focus-visible {
    outline: 2px solid #0646d3;
    outline-offset: 2px;
}

/* Primary: blue fill + white text */
.ip-measure-footer.ip-measure-footer-actions .ip-measure-footer-btn--primary {
    background-color: #0646d3 !important;
    background-image: none !important;
    border-color: #0646d3 !important;
    color: #fff !important;
    box-shadow: none !important;
}

.ip-measure-footer.ip-measure-footer-actions .ip-measure-footer-btn--primary:hover:not(:disabled) {
    background-color: #0536ad !important;
    border-color: #0536ad !important;
    color: #fff !important;
}

.ip-measure-footer.ip-measure-footer-actions .ip-measure-footer-btn--primary:focus-visible {
    outline: 2px solid #0646d3;
    outline-offset: 2px;
}

.ip-measure-aim-accordion {
    border: 1px solid #dbeafe;
    border-radius: 8px;
    overflow: hidden;
    background: #eff6ff;
}

.ip-measure-aim-head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: #eff6ff;
    font-family: "Open Sans", system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    color: #1e3a8a;
    text-align: left;
    cursor: pointer;
}

.ip-measure-aim-head .fa-chevron-down {
    transition: transform 0.2s ease;
}

.ip-measure-aim-head[aria-expanded="false"] .fa-chevron-down {
    transform: rotate(-90deg);
}

.ip-measure-aim-body {
    padding: 12px 16px 16px;
    background: #fff;
    border-top: 1px solid #dbeafe;
}

.ip-measure-page-footer {
    margin-top: auto;
    padding: 1rem 1.5rem 1.5rem;
}

.ip-measure-page-footer .ip-measure-last-updated {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0;
}

[data-theme="dark"] .ip-measure-step-title {
    color: #f3f4f6;
}

[data-theme="dark"] .ip-measure-table thead tr:first-child th {
    background-color: #1e293b !important;
    color: #e2e8f0;
}

[data-theme="dark"] .ip-measure-table-wrap {
    border: none;
}

[data-theme="dark"] .ip-measure-table {
    --ip-measure-row-dash: #4b5563;
}

[data-theme="dark"] .ip-measure-table tbody td {
    color: #e5e7eb;
    background-color: transparent;
}

[data-theme="dark"] .ip-measure-table .form-control,
[data-theme="dark"] .ip-measure-table .form-select {
    color: #f3f4f6;
}

[data-theme="dark"] .ip-measure-row-delete,
[data-theme="dark"] .ip-measure-row-delete i {
    color: #ff6b6b !important;
}

[data-theme="dark"] .ip-measure-row-delete:hover {
    color: #ff8787 !important;
}

[data-theme="dark"] .ip-measure-footer.ip-measure-footer-actions {
    border-color: var(--border-color, #334155) !important;
}

/* Footer keeps Bootstrap .bg-white in dark, so the light-blue outline button text
   sat on white. Give the footer a dark fill so the buttons read (8.81:1). */
[data-theme="dark"] .ip-measure-footer.bg-white {
    background-color: #16213e !important;
}

[data-theme="dark"] .ip-measure-footer.ip-measure-footer-actions .ip-measure-footer-btn--outline {
    background-color: transparent !important;
    border-color: #0646d3 !important;
    color: #93c5fd !important;
}

[data-theme="dark"] .ip-measure-footer.ip-measure-footer-actions .ip-measure-footer-btn--outline:hover:not(:disabled) {
    background-color: rgba(6, 70, 211, 0.15) !important;
    border-color: #0646d3 !important;
    color: #e0f2fe !important;
}

[data-theme="dark"] .ip-measure-footer.ip-measure-footer-actions .ip-measure-footer-btn--primary {
    background-color: #0646d3 !important;
    border-color: #0646d3 !important;
    color: #fff !important;
}

[data-theme="dark"] .ip-measure-footer.ip-measure-footer-actions .ip-measure-footer-btn--primary:hover:not(:disabled) {
    background-color: #0536ad !important;
    border-color: #0536ad !important;
    color: #fff !important;
}

/* Dark footer bg is #16213e; the #0646d3 focus outline is too dark on it, so use a
   lighter blue. */
[data-theme="dark"] .ip-measure-footer.ip-measure-footer-actions .ip-measure-footer-btn--outline:focus-visible,
[data-theme="dark"] .ip-measure-footer.ip-measure-footer-actions .ip-measure-footer-btn--primary:focus-visible {
    outline-color: #60a5fa;
}

/* ============================================================================
   Read-only project step editor (body.pm-readonly).
   Set by the layout when ViewBag.CanEditProjectContent is false - i.e. the
   viewer is a Project Manager who is NOT this project's assigned PM (admins,
   program admins, this plan's coordinator, and the assigned PM keep edit access).
   Hides every add / edit / delete control on the step-editor pages. Viewing and
   downloading stay available; the measure "Next" button stays but is wired to
   navigate without saving (see IPProjectMeasurement). Server endpoints remain the
   authoritative gate; this is the UX layer.
   ============================================================================ */
body.pm-readonly #addDataSource,            /* Aim Statement: Add Source */
body.pm-readonly .btn-edit-ds-row,          /* Aim Statement: edit source row */
body.pm-readonly .btn-remove-ds-row,        /* Aim Statement: delete source row */
body.pm-readonly .btn-add-measure,          /* Project Measure: Add Measure */
body.pm-readonly #ipMeasureBtnSaveExit,     /* Project Measure: Save & Exit */
body.pm-readonly #ipMeasureFormModalSave,   /* Project Measure: Add/Edit modal Save */
body.pm-readonly .btn-edit-row,             /* Project Measure: edit measure row */
body.pm-readonly .btn-remove-row,           /* Project Measure: delete measure row */
body.pm-readonly #btnAddMilestone,          /* Action Steps: Add Milestone */
body.pm-readonly .btn-edit-milestone,       /* Action Steps: edit milestone row */
body.pm-readonly .btn-delete-row,           /* Action Steps: delete milestone row */
body.pm-readonly #btnTriggerDocUpload,      /* Action Steps: Add Document */
body.pm-readonly #dropZone,                 /* Action Steps: drag/drop + click to upload */
body.pm-readonly #fileList,                 /* Action Steps: pending upload list */
body.pm-readonly .delete-new-file-btn,      /* Documents: remove pending file */
body.pm-readonly .delete-existing-btn {     /* Documents: delete saved document */
    display: none !important;
}

/* The primary step-editor footer actions were never in the list above, so they
   stayed clickable on a read-only project. Keep them visible but disabled so it's
   clear the action returns once the project is approved and its start date arrives.
   Covers every PDCA/PDSA text/report screen (these ids are shared across them). */
body.pm-readonly #btnSaveProblem,           /* Complete Section (text step editors) */
body.pm-readonly #btnSaveProblemDraft,      /* Save Draft (text step editors) */
body.pm-readonly #btnSaveDraft,             /* Save Draft (Monitoring, Measure Reporting) */
body.pm-readonly #btnMeasureSaveDraft,      /* Save Draft (IP Reports - measures) */
body.pm-readonly #btnMilestoneSaveDraft,    /* Save Draft (IP Reports - milestones) */
body.pm-readonly #btnMeasureSubmit,         /* Submit (IP Reports - measures) */
body.pm-readonly #btnMilestoneSubmit,       /* Submit (IP Reports - milestones) */
body.pm-readonly #btnSubmitReport,          /* Submit Report / Update (Monitoring & Results) */
body.pm-readonly #createReportBtn,          /* Create/Start Report (Monitoring & Results) */
body.pm-readonly #btnSaveActionStep {       /* Action Steps: Save */
    opacity: 0.5 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

/* Modal save buttons: their add/edit triggers are already hidden above so the
   modals never open, but hide these too as a backstop. */
body.pm-readonly #addDataSourceModalSaveBtn,
body.pm-readonly #btnSaveMeasureComment,
body.pm-readonly #btnSaveMilestoneModal {
    display: none !important;
}

/* ── Project step-editor shared header (Storyboard link + project facts + section title) ── */
.project-step-header {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eff2f5;
    margin-bottom: 1.25rem;
}

.project-step-header__facts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9375rem;
    color: #7e8299;
}

.project-step-header__back {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.7rem;
    border: 1px solid #e4e6ef;
    border-radius: 0.475rem;
    color: #5e6278;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

.project-step-header__back:hover {
    background-color: #f4f6fa;
    border-color: #d6d9e2;
    color: #181c32;
}

.project-step-header__divider {
    flex: 0 0 auto;
    width: 1px;
    height: 16px;
    background-color: #dbdfe9;
}

.project-step-header__project {
    font-weight: 600;
    color: #3f4254;
}

.project-step-header__type,
.project-step-header__status {
    display: inline-flex;
    align-items: center;
    padding: 0.14rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.project-step-header__type {
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 0.8125rem;
}

/* "Last updated" timestamp footnote on the PDCA/PDSA step screens: keep it quiet and
   secondary. Scoped to .fst-italic so the shared .last-updated class used elsewhere
   (guidance/substep notes) is left alone. */
.last-updated.fst-italic,
.ip-measure-last-updated {
    font-size: 0.75rem;
    color: #a1a5b7 !important;
    font-weight: 400;
}

.last-updated.fst-italic .fw-semibold,
.ip-measure-last-updated .fw-semibold {
    font-weight: 500 !important;
    color: inherit;
}

.project-step-header__type--ip {
    background-color: #eef2ff;
    color: #4338ca;
}

.project-step-header__type--qi {
    background-color: #e7f9f1;
    color: #0f766e;
}

.project-step-header__status {
    background-color: #e9f3ff;
    color: #0a58ca;
}

.project-step-header__dates {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.project-step-header__dates i {
    font-size: 0.75rem;
    color: #a1a5b7;
}

.project-step-header__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.625rem;
}

.project-step-header__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #181c32;
    line-height: 1.2;
}

/* Dark theme for the shared step header - every ink above is a light-theme hardcode. */
[data-theme="dark"] .project-step-header {
    border-bottom-color: #2b2b40;
}

[data-theme="dark"] .project-step-header__facts {
    color: #9ca3af;
}

[data-theme="dark"] .project-step-header__back {
    border-color: #3f4254;
    color: #cbd5e1;
}

[data-theme="dark"] .project-step-header__back:hover {
    background-color: #20202f;
    border-color: #4b5563;
    color: #f3f4f6;
}

[data-theme="dark"] .project-step-header__divider {
    background-color: #2b2b40;
}

[data-theme="dark"] .project-step-header__project {
    color: #e2e8f0;
}

[data-theme="dark"] .project-step-header__type--ip {
    background-color: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
}

[data-theme="dark"] .project-step-header__type--qi {
    background-color: rgba(45, 212, 191, 0.15);
    color: #5eead4;
}

[data-theme="dark"] .project-step-header__status {
    background-color: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
}

[data-theme="dark"] .project-step-header__dates i {
    color: #6b7280;
}

[data-theme="dark"] .project-step-header__title {
    color: #f3f4f6;
}

/* Shared Back button - compact control-height pill used on every page header.
   Replaces the oversized Metronic btn-dark + ki-black-left pattern. */
.phs-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    padding: 0.5rem 0.95rem;
    border: 1px solid #1e293b;
    border-radius: 8px;
    background: #1e293b;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease;
}

.phs-back-btn:hover,
.phs-back-btn:focus {
    background: #0f172a;
    color: #fff;
    text-decoration: none;
}

.phs-back-btn:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.phs-back-btn i {
    font-size: 0.8rem;
}

[data-theme="dark"] .phs-back-btn {
    background: #2b3a5c;
    border-color: #2b3a5c;
}

    [data-theme="dark"] .phs-back-btn:hover {
        background: #1f2c49;
    }

/* Primary action companion to .phs-back-btn. "New / Add" header buttons were falling
   back to the raw Metronic .btn (42.6px tall) and towered over the 31px back button
   beside them. This mirrors .phs-back-btn's compact box so header rows line up, with
   the portal primary-blue fill. --phs-primary-action (#2563eb) is not re-themed for
   dark, so one fill rule covers both themes; the white label clears 4.5:1 on it
   (5.17 rest / 6.70 hover). Reusable for every header action button. */
.phs-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    padding: 0.5rem 0.95rem;
    border: 1px solid var(--phs-primary-action);
    border-radius: 8px;
    background: var(--phs-primary-action);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.phs-primary-btn:hover,
.phs-primary-btn:focus {
    background: var(--phs-primary-action-hover);
    border-color: var(--phs-primary-action-hover);
    color: #fff;
    text-decoration: none;
}

.phs-primary-btn:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.phs-primary-btn i {
    font-size: 0.8rem;
}

/* Standard page title - every screen's main heading renders at the same size. */
.phs-page-title {
    font-size: 1.5rem !important;
    font-weight: 700;
    line-height: 1.25;
}
