/* Dashboard Specific Styles */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;1,400&display=swap');

.dashboard-container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 0 1.25rem 2rem;
    box-sizing: border-box;
}

/* Dashboard Grid - Updated for responsive rows */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: min-content;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

/* Enhanced card shadows for overlap effect */
.dashboard-page .card,
.dashboard-page .dashboard-action-btn,
.dashboard-page .subscription-card {
    box-shadow: var(--phs-shadow-ambient-sm);
}

/* Intro: tagline row + single row of colored action buttons */
.dashboard-intro {
    margin-bottom: 1rem;
}

/* Sponsor tagline - compact caption form (option B): small muted line + small
   image, right-aligned above the quick actions. Revert = restore 17px/#000
   tagline, 40px img with icon-btn min-height, and 0.5rem row margin. */
.dashboard-tagline-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem 0.5rem;
    margin-bottom: 0.35rem;
}

.dashboard-tagline {
    font-family: "Open Sans", system-ui, -apple-system, sans-serif;
    font-size: 0.8rem;
    font-style: italic;
    font-weight: 400;
    color: #64748b;
    line-height: 1.35;
    margin: 0;
    flex: 0 1 auto;
    max-width: min(100%, 48rem);
    text-align: right;
}

.dashboard-tagline-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.dashboard-actions-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    align-items: stretch;
}

.dashboard-action-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
    padding: 0.55rem 0.85rem;
    min-height: 44px;
    border: none;
    border-radius: 10px;
    color: var(--phs-surface-card);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    width: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    text-align: left;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

    .dashboard-action-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
        filter: brightness(1.04);
        color: var(--phs-surface-card);
    }

    .dashboard-action-btn:focus-visible {
        outline: 3px solid #2563eb;
        outline-offset: 2px;
    }

    [data-theme="dark"] .dashboard-action-btn:focus-visible {
        outline-color: #93c5fd;
    }

.dashboard-action-btn__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: transparent;
}

    .dashboard-action-btn__icon i {
        font-size: 1rem;
        color: var(--phs-surface-card);
    }

.dashboard-action-btn__label {
    flex: 1;
    line-height: 1.2;
}

[data-theme="dark"] .dashboard-tagline {
    color: #b0b0b0;
}

.card-icon {
    position: absolute;
    top: 14px;
    right: 18px;
    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, transform 0.2s ease;
}

    .card-icon:hover {
        background-color: rgba(59, 130, 246, 0.15);
        transform: scale(1.05);
    }

    /* === Force consistent blue duotone colors === */

    .card-icon .ki-duotone {
        color: var(--phs-primary-action) !important;
    }

        .card-icon .ki-duotone .path1,
        .card-icon .ki-duotone .path3 {
            color: var(--phs-primary-action) !important;
        }

        .card-icon .ki-duotone .path2,
        .card-icon .ki-duotone .path4 {
            color: #93c5fd !important;
        }

    /* Hover color shift */

    .card-icon:hover .ki-duotone .path1,
    .card-icon:hover .ki-duotone .path3 {
        color: #1e40af !important;
    }

    .card-icon:hover .ki-duotone .path2,
    .card-icon:hover .ki-duotone .path4 {
        color: #60a5fa !important;
    }

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    padding: 1.75rem;
    height: auto; /* Changed from 100% to auto */
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--phs-ink-primary);
    margin: 0;
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--phs-ink-muted);
    margin-top: 0.25rem;
}

.card-actions {
    display: flex;
    gap: 0.25rem;
}

.action-dot {
    width: 5px;
    height: 5px;
    background: var(--phs-ink-muted);
    border-radius: 50%;
}

/* Activities Section */
.activities-section {
    grid-column: span 4;
    align-self: start; /* Align to top of row */
}

.activity-item {
    display: flex;
    gap: 0.875rem;
    padding: 1rem 0;
    align-items: flex-start;
    position: relative;
}

    .activity-item::before {
        content: '';
        position: absolute;
        left: 63px;
        top: 28px;
        width: 2px;
        height: calc(100% + 0.5rem);
        background: #F3F6F9;
    }

    .activity-item:last-child::before {
        display: none;
    }

.activity-time {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--phs-ink-muted);
    min-width: 45px;
}

.activity-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-top: 2px;
    flex-shrink: 0;
    border: 3px solid;
    background: white;
    position: relative;
    z-index: 1;
}

    .activity-indicator.yellow {
        border-color: var(--phs-status-warning);
    }

    .activity-indicator.green {
        border-color: var(--phs-status-success);
    }

    .activity-indicator.red {
        border-color: var(--phs-status-danger);
    }

    .activity-indicator.blue {
        border-color: var(--phs-status-info);
    }

.activity-text {
    font-size: 0.875rem;
    color: var(--phs-button-dark);
    line-height: 1.4;
    margin: 0;
}

.text-link {
    color: var(--phs-status-info);
    text-decoration: none;
    font-weight: 600;
}

    .text-link:hover {
        text-decoration: underline;
    }

/* Trends Section */
.trends-section {
    grid-column: span 4;
    align-self: start; /* Align to top of row */
}

.chart-area {
    height: 190px;
    background: linear-gradient(to bottom, #F3F6F9 0%, var(--phs-surface-card) 100%);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 0;
    border-bottom: 1px solid #F3F6F9;
}

    .list-item:last-child {
        border-bottom: none;
    }

.list-icon {
    width: 40px;
    min-height: var(--phs-icon-btn-size);
    height: var(--phs-icon-btn-size);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-weight: 700;
}

.list-content {
    flex: 1;
}

.list-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--phs-button-dark);
    margin: 0 0 0.25rem 0;
}

.list-subtitle {
    font-size: 0.85rem;
    color: var(--phs-ink-muted);
    margin: 0;
}

.list-badge {
    background: #E8FFF3;
    color: var(--phs-status-success);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Todo Section */
.todo-section {
    grid-column: span 4;
    align-self: start;
    height: auto;
    min-height: 0;
}
.todo-section-big {
    grid-column: span 6;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.todo-section-big--statewide {
    grid-column: span 12;
    align-self: start;
}

.todo-section-big--statewide > .dash-summary-card {
    flex: 0 0 auto;
    height: auto;
}

.todo-section-big > .dash-summary-card {
    flex: 1;
    width: 100%;
    min-height: 0;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid #F3F6F9;
}

    .todo-item:last-child {
        border-bottom: none;
    }

.todo-indicator {
    flex-shrink: 0;
    width: 3px;
    height: 35px;
    border-radius: 2px;
}

.todo-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #F3F6F9;
}

.todo-content {
    flex: 1;
}

.todo-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2a71e7 !important;
    margin: 0 0 0.125rem 0;
}

.todo-date {
    font-size: 0.8rem;
    color: var(--phs-ink-muted);
    margin: 0;
}

.todo-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-green {
    background: #E8FFF3;
    color: var(--phs-status-success);
}

.badge-blue {
    background: #E1F0FF;
    color: var(--phs-status-info);
}

.badge-yellow {
    background: #FFF8DD;
    color: var(--phs-status-warning);
}

.badge-pink {
    background: #FFE2E5;
    color: var(--phs-status-danger);
}

/* Products Section */
.products-section {
    grid-column: 5 / span 8;
    align-self: start; /* Align to top of row */
}

.tabs {
    display: flex;
    gap: 0.5rem;
}

.tab {
    padding: 0.375rem 0.875rem;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--phs-ink-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--phs-transition);
}

    .tab.active {
        background: #F3F6F9;
        color: var(--phs-button-dark);
    }

.product-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #F3F6F9;
    gap: 1rem;
}

    .product-item:last-child {
        border-bottom: none;
    }

.product-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

    .product-icon.pink {
        background: #FFE2E5;
        color: var(--phs-status-danger);
    }

    .product-icon.blue {
        background: #E1F0FF;
        color: var(--phs-status-info);
    }

    .product-icon.purple {
        background: #F3E8FF;
        color: #7239EA;
    }

    .product-icon.red {
        background: #FFE2E5;
        color: var(--phs-status-danger);
    }

    .product-icon.green {
        background: #E8FFF3;
        color: var(--phs-status-success);
    }

.product-info {
    flex: 1;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--phs-ink-primary);
    margin: 0 0 0.125rem 0;
}

.product-description {
    font-size: 0.8rem;
    color: var(--phs-ink-muted);
    margin: 0;
}

.product-tech {
    font-size: 0.85rem;
    color: var(--phs-ink-muted);
    min-width: 120px;
    margin: 0 1rem;
}

.product-status {
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-approved {
    background: #E8FFF3;
    color: var(--phs-status-success);
}

.status-progress {
    background: #FFF8DD;
    color: var(--phs-status-warning);
}

.status-success {
    background: #E1F0FF;
    color: var(--phs-status-info);
}

.status-rejected {
    background: #FFE2E5;
    color: var(--phs-status-danger);
}

.product-arrow {
    color: var(--phs-ink-muted);
    font-size: 1rem;
}

/* Subscription Cards */
.subscription-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    align-self: start; /* Align to top of row */
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.subscription-icon-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.subscription-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

    .subscription-icon.pink {
        background: #FFE2E5;
        color: var(--phs-status-danger);
    }

    .subscription-icon.blue {
        background: #E1F0FF;
        color: var(--phs-status-info);
    }

.subscription-info h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--phs-ink-primary);
    margin: 0 0 0.125rem 0;
}

.subscription-info p {
    font-size: 0.8rem;
    color: var(--phs-ink-muted);
    margin: 0;
}

.progress-section {
    margin-bottom: 1.25rem;
}

.progress-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--phs-ink-primary);
    margin-bottom: 0.5rem;
}

.progress-bar-wrapper {
    height: 6px;
    background: #F3F6F9;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
}

    .progress-bar-fill.pink {
        background: var(--phs-status-danger);
    }

    .progress-bar-fill.blue {
        background: var(--phs-status-info);
    }

.team-section {
    margin-top: 1.5rem;
}

.team-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--phs-ink-primary);
    margin-bottom: 0.5rem;
}

.team-avatars {
    display: flex;
}

.team-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid white;
    margin-left: -10px;
}

    .team-avatar:first-child {
        margin-left: 0;
    }

.team-avatar-1 {
    background: linear-gradient(135deg, #FFA726, #FB8C00);
}

.team-avatar-2 {
    background: linear-gradient(135deg, #5C6BC0, #3949AB);
}

.team-avatar-3 {
    background: linear-gradient(135deg, #26C6DA, #00ACC1);
}

.team-avatar-4 {
    background: linear-gradient(135deg, #EC407A, #D81B60);
}

/* =============================================
   RESPONSIVE BREAKPOINTS
   ============================================= */

/* Large laptops / small desktops (1024 - 1200px) */
@media (max-width: 1200px) {
    .dashboard-container {
        padding: 0 1.25rem 1.5rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(12, 1fr);
        gap: 1rem;
    }

    .dashboard-tagline {
        font-size: 0.8rem;
    }

    .dashboard-actions-row {
        gap: 0.6rem;
    }

    .project-activity-section,
    .todo-section {
        grid-column: span 4;
    }

    .todo-section-big {
        grid-column: span 6;
    }

    .products-section {
        grid-column: span 8;
    }

    .subscription-card {
        grid-column: span 4 !important;
    }

    .dash-summary-chart-row .chart-container {
        width: 176px;
        height: 176px;
    }
}

/* Smaller laptops / tablets landscape (768 - 1024px) */
@media (max-width: 1024px) {
    .dashboard-container {
        padding: 0 1rem 1rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .dashboard-actions-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-tagline {
        font-size: 0.8rem;
    }

    .dashboard-tagline-img {
        width: 24px;
        height: 24px;
    }

    .project-activity-section,
    .todo-section {
        grid-column: span 1;
    }

    .todo-section-big {
        grid-column: span 1;
    }

    .products-section {
        grid-column: span 2;
    }

    .subscription-card {
        grid-column: span 1 !important;
    }

    .card {
        padding: 1.25rem;
    }

    .card-scroll {
        max-height: 340px !important;
        height: 340px !important;
    }

    .dash-summary-chart-row .chart-container {
        width: 168px;
        height: 168px;
    }

    .design-2 .info-item {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .filter-row {
        flex-direction: column;
        gap: 8px;
    }

    .filter-row .filter-col {
        min-width: unset;
    }
}

/* Tablets portrait / large phones (576 - 768px) */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }

    .project-activity-section,
    .activities-section,
    .trends-section,
    .todo-section,
    .todo-section-big,
    .products-section,
    .subscription-card {
        grid-column: 1 / -1 !important;
    }

    .dashboard-actions-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .dashboard-action-btn {
        min-height: 42px;
        padding: 0.5rem 0.65rem;
        font-size: 0.8125rem;
        gap: 0.45rem;
    }

    .dashboard-action-btn__icon {
        width: 32px;
        height: 32px;
    }

        .dashboard-action-btn__icon i {
            font-size: 0.9rem;
        }

    .dashboard-tagline {
        font-size: 0.8rem;
    }

    .dashboard-tagline-img {
        width: 24px;
        height: 24px;
    
    }

    .card-scroll {
        max-height: 300px !important;
        height: 300px !important;
    }

    .dash-summary-chart-row {
        flex-direction: column;
        align-items: stretch;
    }

    .dash-statewide-summary-card {
        min-height: 0;
    }

    .dash-statewide-summary-panel {
        min-height: 0;
    }

    .dash-statewide-summary-card__body {
        flex-direction: column;
    }

    .dash-statewide-summary-row {
        grid-template-columns: 1fr;
    }

    #tour-project-status .dash-summary-card-head {
        padding-right: 1.25rem;
    }

    #tour-tactical-status .legend-section {
        grid-template-columns: 1fr;
    }

    #tour-project-status .legend-section.info-panel {
        grid-template-columns: 1fr;
    }

    #tour-tactical-status .dash-summary-chart-row .chart-container,
    #tour-project-status .dash-summary-chart-row .chart-container {
        width: 168px;
        height: 168px;
    }

    .dash-statewide-summary-divider {
        width: auto;
        height: 1px;
        margin: 0.5rem 1.25rem 0.75rem;
    }

    .dash-statewide-summary-panel .dash-summary-card-head {
        padding-right: 1.25rem;
    }

    .dash-statewide-summary-card__toolbar {
        position: static;
        display: flex;
        justify-content: flex-end;
        padding: 1rem 1.25rem 0;
    }

    .dash-summary-chart-row .chart-section {
        align-self: center;
    }

    .dash-summary-chart-row .chart-container {
        width: 170px;
        height: 170px;
    }

    .design-2 .info-panel {
        width: 100%;
    }

    .design-b6 .legend-label {
        font-size: 0.75rem;
    }

    .project-activity-card {
        height: auto;
        max-height: 400px;
    }
}

/* Small phones (< 576px) */
@media (max-width: 576px) {
    .dashboard-container {
        padding: 0 0.5rem 1rem;
    }

    .dashboard-grid {
        gap: 0.75rem;
    }

    .dashboard-tagline {
        font-size: 0.8rem;
    }

    .dashboard-tagline-img {
        width: 24px;
        height: 24px;
    }

    .dashboard-tagline-row {
        justify-content: flex-end;
        align-items: center;
    }

    .card {
        padding: 1rem;
    }

    .dash-summary-chart-row .chart-container {
        width: 150px;
        height: 150px;
    }

    .project-activity-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .project-activity-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .todo-badge {
        font-size: 0.6rem;
    }
}

/* Project Recent Activity Section */
.project-activity-section {
    grid-column: span 4;
    align-self: start;
}

.project-activity-card {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.15rem;
    height: auto;
    max-height: 260px;
    display: flex;
    flex-direction: column;
}

.project-activity-header {
    font-size: 1rem;
    font-weight: 700;
    color: var(--phs-ink-primary);
    margin: 0 0 0.75rem 0;
    flex-shrink: 0;
}

.project-activity-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
}

    /* Custom scrollbar */
    .project-activity-list::-webkit-scrollbar {
        width: 6px;
    }

    .project-activity-list::-webkit-scrollbar-track {
        background: #F3F6F9;
        border-radius: 3px;
    }

    .project-activity-list::-webkit-scrollbar-thumb {
        background: var(--phs-ink-muted);
        border-radius: 3px;
    }

        .project-activity-list::-webkit-scrollbar-thumb:hover {
            background: var(--phs-ink-muted);
        }

.project-activity-item {
    display: flex;
    gap: 1rem;
    padding: 0.875rem 0;
    align-items: flex-start;
    position: relative;
    margin-bottom: 0.5rem;
}

    .project-activity-item::before {
        content: '';
        position: absolute;
        left: 8px;
        top: 32px;
        width: 2px;
        height: calc(100% + 0.5rem);
        background: #F3F6F9;
        z-index: 0;
    }

    .project-activity-item:last-child::before {
        display: none;
    }

.activity-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-top: 2px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

    .activity-dot.blue {
        background: #3B82F6;
    }

    .activity-dot.green {
        background: var(--phs-status-success);
    }

    .activity-dot.red {
        background: var(--phs-status-danger);
    }

.project-activity-content {
    flex: 1;
    background: #F9F9F9;
    border-radius: 10px;
    padding: 0.875rem;
    border: 1px #F3F6F9;
}

.project-activity-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.375rem;
}

.project-codes {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-code-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--phs-ink-muted);
}

.project-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--phs-ink-primary);
}

.activity-status-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-updated {
    background: #E1F0FF;
    color: #1E3A8A;
}

.status-inserted {
    background: #E8FFF3;
    color: var(--phs-status-success);
}

.status-deleted {
    background: #FFE2E5;
    color: var(--phs-status-danger);
}

.project-description {
    font-size: 0.8rem;
    color: #4B5563;
    margin: 0.5rem 0;
    line-height: 1.4;
}

.project-activity-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.activity-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50% !important;
    background: #E1F0FF;
    display: flex;
    justify-content: center;
    color: #3B82F6;
    font-size: 0.65rem;
    font-weight: 600;
    align-items: center;
    overflow: hidden;
}
    .user-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.user-name {
    font-size: 0.75rem;
    color: var(--phs-ink-muted);
}

.activity-time-label {
    font-size: 0.75rem;
    color: var(--phs-ink-muted);
}

[data-theme="dark"] .card-title h2 {
    color: var(--phs-surface-card) !important;
}

[data-theme="dark"] .project-activity-section {
    background: #0f1115;
    border-radius: 12px;
}

[data-theme="dark"] .project-activity-card {
    background: #16213e;
    border: 1px solid #22252b;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

[data-theme="dark"] .project-activity-content {
    background: #1b1e24 !important;
}

[data-theme="dark"] .project-activity-content,
[data-theme="dark"] .project-activity-content * {
    color: var(--phs-surface-card) !important;

}
    [data-theme="dark"] .project-activity-content:hover {
        background: #16213f;
    }


[data-theme="dark"] .project-activity-header {
    color: #e7eaf0;
}

[data-theme="dark"] .project-activity-list {
    scrollbar-width: thin;
    scrollbar-color: #444 #1a1c20;
}

[data-theme="dark"] .project-activity-item {
    background: #16213e;
}
/*
    [data-theme="dark"] .project-activity-item:hover {
        background: #16213e;
    }
*/
[data-theme="dark"] .project-activity-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

[data-theme="dark"] .project-code-badge {
    background: #2b3039;
    color: #d0d3d9;
    border-radius: 6px;
}


[data-theme="dark"] .project-description {
    color: #b9bcc3;
}

[data-theme="dark"] .project-activity-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

[data-theme="dark"] .activity-user .user-avatar {
    background: #2f333a;
    color: #e1e3e8;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

[data-theme="dark"] .user-name {
    color: #d6d8dd;
}

[data-theme="dark"] .activity-time-label {
    color: #9ea2ab;
}


[data-theme="dark"] .activity-status-badge {
    color: white;
}

[data-theme="dark"] .status-updated {
    background: #1a4b8c;
}

[data-theme="dark"] .status-inserted {
    background: #15572a;
}

[data-theme="dark"] .status-deleted {
    background: #dc3545;
}

[data-theme="dark"] .mb-0 {
    color: white !important;
}

[data-theme="dark"] .activity-dot {
    border-radius: 50%;
}

    [data-theme="dark"] .activity-dot.blue {
        background: #3a8bff;
    }

    [data-theme="dark"] .activity-dot.green {
        background: #4cd964;
    }

    [data-theme="dark"] .activity-dot.red {
        background: #ff4f6d;
    }

/*EVENTS WIDGET CSS*/
.fallback-menu {
    display: none;
    position: absolute;
    min-width: 180px;
    z-index: var(--phs-z-editor-aux);
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    border-radius: 6px;
    padding: 6px 0;
    font-size: .95rem;
}

    .fallback-menu.show {
        display: block;
    }

    .fallback-menu .menu-item, .fallback-menu .menu-link {
        padding: 8px 14px;
        display: flex;
        align-items: center;
        gap: 10px;
        color: #222;
        text-decoration: none;
    }

        .fallback-menu .menu-item:hover, .fallback-menu .menu-link:hover {
            background: #f3f6ff;
        }

/* DARK MODE SUPPORT */
[data-theme="dark"] .fallback-menu{
    background: #1c1c43;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
}


    [data-theme="dark"] .fallback-menu .menu-item,
    [data-theme="dark"] .fallback-menu .menu-link {
        color: #e5e5f0;
    }


        [data-theme="dark"] .fallback-menu .menu-item:hover,
        [data-theme="dark"] .fallback-menu .menu-link:hover{
            background: rgba(255, 255, 255, 0.06);
        }

[data-theme="dark"] .manage-label{
    color: #000 !important; 
}

/*******************************************/




.designs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.design-wrapper {
    position: relative;
}

.design-label {
    background: rgba(255, 255, 255, 0.35);
    color: white;
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 0.9375rem;
    text-align: center;
}

.design-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.4);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.6875rem;
    margin-left: 8px;
    font-weight: 700;
}

/* Base Card Styles */
.card {
    background: white;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: var(--phs-transition);
}

    .card:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    }

/* The statewide summary cards span the full row width, so the generic .card:hover lift makes them
   visibly jump. Keep them anchored on hover - no translate, no shadow swell. Higher specificity
   (.card.dash-statewide-summary-card) so it wins over .card:hover regardless of source order. */
.card.dash-statewide-summary-card:hover {
    transform: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.card-header {
    padding: 16px 10px;
    border-bottom: 1px solid var(--phs-border-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 20px !important;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.card-icon {
    font-size: 1.25rem;
}

.settings-icon {
    cursor: pointer;
    color: #4b5057;
    font-size: 1.125rem;
    transition: color 0.2s;
}

    .settings-icon:hover {
        color: var(--phs-ink-body);
    }

.filter-section {
    padding: 16px 20px;
    background-color: #f9fafb;
    border-bottom: 1px solid var(--phs-border-card);
}

.filter-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--phs-ink-muted);
    margin-bottom: 8px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-row .filter-col {
    flex: 1;
    min-width: 120px;
}

.filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--phs-ink-body);
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

    .filter-select:hover {
        border-color: var(--phs-ink-muted);
    }

    .filter-select:focus {
        outline: none;
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

/* Status colors */
.status-not-started {
    background-color: var(--phs-ink-muted);
}

.status-initiated {
    background-color: #60A5FA;
}

.status-in-progress {
    background-color: #FBBF24;
}

.status-approved {
    background-color: #10B981;
}

.status-completed {
    background-color: var(--phs-status-success);
}

.status-updating {
    background-color: #A78BFA;
}

.status-submitted {
    background-color: #a310b9;
}

.status-abandoned {
    background-color: #FF7723;
}

/* Dashboard summary doughnuts only — darker variants of status hues (chips elsewhere unchanged).
   Colors match the chart bgColor arrays in Index.cshtml. All pass WCAG non-text 3:1 in both themes. */
#tour-project-status .status-not-started {
    background-color: #b4557f;
}

#tour-project-status .status-in-progress {
    background-color: #2d7f9d;
}

#tour-project-status .status-completed {
    background-color: #1a9e5c;
}

#tour-project-status .status-abandoned {
    background-color: #c25708;
}

/* Tactical statuses (TacticalPlanStatusId): 1 Initiated, 2 In Dev, 4 Approved, 5 Updating, 7 Delayed, 8 Submitted */
#tour-tactical-status .status-initiated {
    background-color: #7189d8;
}

#tour-tactical-status .status-in-progress {
    background-color: #2d7f9d;
}

#tour-tactical-status .status-approved {
    background-color: #2e8b2e;
}

#tour-tactical-status .status-updating {
    background-color: #8b79d6;
}

#tour-tactical-status .status-not-started {
    background-color: #b4557f;
}

#tour-tactical-status .status-submitted {
    background-color: #8064cf;
}

.status-on-track {
    background-color: #10B981;
}

.status-not-on-track {
    background-color: #F59E0B;
}

/* Dashboard summary cards (Tactical Plan + Project status) */
.dash-summary-card {
    border-radius: 18px;
    box-shadow: 0 4px 22px rgba(82, 63, 105, 0.08), 0 2px 8px rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.9);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dash-summary-filters {
    padding: 0 1.25rem 0.85rem;
    flex-shrink: 0;
    background: transparent;
    border: none;
}

.dash-summary-filters.filter-row {
    margin-bottom: 0;
}

.dash-summary-chart-row--fill {
    flex: 1;
    min-height: 0;
    align-items: center;
}

.dash-summary-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.1rem 1.25rem 0.5rem;
    flex-shrink: 0;
}

.dash-summary-card-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e1b4b;
    line-height: 1.25;
}

/* Tactical: chart + legend in one row */
.dash-summary-chart-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.25rem 1.25rem 1.25rem;
    flex-wrap: nowrap;
}

.dash-summary-chart-row .chart-section {
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
}

.dash-summary-chart-row .chart-container {
    position: relative;
    width: 188px;
    height: 188px;
    margin: 0 auto;
}

.dash-summary-chart-row .legend-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
    margin: 0;
    align-self: stretch;
    justify-content: center;
}

.design-b6 .legend-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #f1f5f9;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #e8eef5;
}

.design-b6 .legend-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1e293b;
    font-size: 0.82rem;
    font-weight: 600;
    min-width: 0;
}

.design-b6 .legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.design-b6 .legend-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    flex-shrink: 0;
    text-align: right;
}

/* Pair Tactical Plan + Project status panels inside combined statewide card */
.dash-statewide-summary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: stretch;
}

/* Each summary is its own card now; size the card and its panel to their content.
   (The old combined card relied on a fill chain through __body that no longer exists,
   so without this the cards collapse to just the title and clip the rest.) */
.dash-statewide-summary-row > .dash-summary-card {
    flex: 0 0 auto;
    height: auto;
}

.dash-statewide-summary-row .dash-statewide-summary-panel {
    flex: 0 0 auto;
}

.dash-statewide-summary-card {
    position: relative;
    min-height: 0;
    height: auto;
}

.dash-statewide-summary-card__toolbar {
    position: absolute;
    top: 0.65rem;
    right: 1rem;
    z-index: 3;
}

.dash-statewide-summary-card__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    background: #1e1b4b;
    color: #fff !important;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(30, 27, 75, 0.18);
    transition: background 0.15s ease, transform 0.15s ease;
}

.dash-statewide-summary-card__link:hover {
    background: #312e81;
    color: #fff !important;
    transform: translateY(-1px);
}

.dash-statewide-summary-card__body {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    min-height: 0;
    flex: 1;
}

.dash-statewide-summary-panel {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-top: 0;
}

.dash-statewide-summary-panel .dash-summary-card-head {
    padding: 0.65rem 1rem 0.2rem;
    flex-shrink: 0;
}

/* Only the project card reserves corner space for the Statewide Dashboard link. */
#tour-project-status .dash-summary-card-head {
    padding-right: 10.5rem;
}

.dash-statewide-summary-panel .dash-summary-card-title {
    font-size: 0.98rem;
    line-height: 1.2;
}

.dash-statewide-summary-panel .dash-summary-filters {
    flex-shrink: 0;
    padding: 0 1rem 0.4rem;
}

#tour-tactical-status .dash-summary-chart-row.dash-summary-chart-row--fill,
#tour-project-status .dash-summary-chart-row.dash-summary-chart-row--fill {
    margin-top: 0.25rem;
    padding: 0 1rem 0.75rem;
    align-items: flex-start;
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
}

#tour-tactical-status .dash-summary-chart-row .chart-section,
#tour-project-status .dash-summary-chart-row .chart-section {
    align-self: flex-start;
    padding-top: 0;
}

#tour-tactical-status .dash-summary-chart-row .chart-container,
#tour-project-status .dash-summary-chart-row .chart-container {
    width: 158px;
    height: 158px;
}

#tour-tactical-status .legend-section,
#tour-project-status .legend-section.info-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    align-content: start;
    align-self: start;
    justify-content: stretch;
    overflow: visible;
    max-height: none;
    padding-right: 0.1rem;
}

#tour-tactical-status .design-b6 .legend-item,
#tour-project-status .design-2 .info-item {
    padding: 4px 6px;
    min-height: 0;
    border-radius: 8px;
}

#tour-tactical-status .design-b6 .legend-label,
#tour-project-status .design-2 .info-label {
    font-size: 0.72rem;
    line-height: 1.15;
}

#tour-tactical-status .design-b6 .legend-label span:last-child {
    word-break: break-word;
}

#tour-tactical-status .design-b6 .legend-value,
#tour-project-status .design-2 .info-value {
    font-size: 0.8125rem;
}

#tour-project-status .info-item-wrap {
    display: contents;
}

.dash-statewide-summary-divider {
    width: 1px;
    flex-shrink: 0;
    align-self: stretch;
    background: var(--phs-border-card);
    margin: 0.65rem 0 0.75rem;
}

#tour-tactical-status .dash-summary-filters {
    position: relative;
    z-index: 2;
}

/* Design 2: Project status — same row layout as tactical summary */
.design-2 .info-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.design-2 .info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 0.82rem;
    border: 1px solid #e8eef5;
}

.design-2 .info-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #1e293b;
    font-weight: 600;
    min-width: 0;
}

.design-2 .info-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.design-2 .info-value {
    font-weight: 700;
    color: #0f172a;
    flex-shrink: 0;
}

.design-2 .info-item-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.design-2 .info-nested {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-left: 0.35rem;
    padding: 8px 10px;
    border: 1px solid var(--phs-border-subtle);
    border-radius: 8px;
    background: #f8fafc;
}

.design-2 .info-item--nested {
    padding: 6px 8px;
    font-size: 0.78rem;
    background: #f8fafc;
}

.design-2 .info-nested-mark {
    color: #64748b;
    font-size: 0.85rem;
    margin-right: 2px;
    flex-shrink: 0;
}

.design-2 .info-nested-caption {
    font-size: 0.72rem;
    padding-left: 2px;
}


[data-theme="dark"] .card-title {
    color: white !important;
}


[data-theme="dark"] .progress-title {
    color: white !important;
}

[data-theme="dark"] .progress-label {
    color: white !important;
}

[data-theme="dark"] .filter-label {
    color: white !important;
}

[data-theme="dark"] .progress-value {
    color: white !important;
}

[data-theme="dark"] .radial-percentage {
    color: white !important;
}

[data-theme="dark"] .filter-select {
    background-color: #16213e !important;
    color: white !important;
    border: 1px solid var(--phs-surface-card)22 !important;
}

[data-theme="dark"] .filter-section {
    padding: 16px 20px;
    background-color: #1b1f32 !important;
    border-bottom: 1px solid var(--phs-surface-card)22 !important;
}

[data-theme="dark"] .radial-card {
    padding: 16px 20px;
    background-color: #1b1f32 !important;
    border: 1px solid var(--phs-surface-card)22 !important;
}

[data-theme="dark"] .progress-bar-bg {
    border: 1px solid var(--phs-surface-card)22 !important;
    height: 20px;
    background: #1b1f32;
    border-radius: 10px;
    overflow: hidden;
}

.filter-col {
    display: flex;
    flex-direction: column;
}

.filter-small-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6B7280;
    margin-bottom: 4px;
    line-height: 1;
}

/* ========== Dashboard first row: trio cards (Activity / Announcements / Events) ========== */
.dashboard-sq-card {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: 0.7rem 1rem 0.75rem;
    background: var(--phs-surface-card);
    border-radius: 16px;
    box-shadow: 0 4px 22px rgba(82, 63, 105, 0.1), 0 2px 8px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.9);
    overflow: hidden;
    height: 320px;
}

.dashboard-sq-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-bottom: 0.3rem;
}

.dashboard-sq-card__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1e1b4b;
    line-height: 1.2;
}

.dashboard-sq-card__headlink {
    color: #3b82f6;
    font-size: 1rem;
    line-height: 1;
    border: none;
    background: transparent;
    text-decoration: none;
    padding: 0.25rem;
    cursor: pointer;
}

    .dashboard-sq-card__headlink:hover {
        color: var(--phs-primary-action);
    }

.dashboard-sq-card__menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--phs-icon-btn-size);
    height: var(--phs-icon-btn-size);
    /* Keep the full tap target but stop it stretching the card header row. */
    margin-block: -0.6rem;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .dashboard-sq-card__menu-btn:hover,
    .dashboard-sq-card__menu-btn:focus-visible {
        background: #f1f5f9;
        color: #1e293b;
    }

    .dashboard-sq-card__menu-btn:focus-visible {
        outline: 2px solid #2563eb;
        outline-offset: 1px;
    }

    [data-theme="dark"] .dashboard-sq-card__menu-btn:focus-visible {
        outline-color: #93c5fd;
    }

.dashboard-sq-card--events {
    padding: 0.7rem 1rem 0.75rem;
    overflow: hidden;
}

.dashboard-sq-card__scroll--events {
    padding-top: 0.15rem;
}

/* Events card: custom ellipsis menu (avoids global .dropdown-menu / Bootstrap conflicts) */
.dqa-events-menu-wrap {
    position: relative;
    flex-shrink: 0;
    z-index: 30;
}

    .dqa-events-menu-wrap.is-open {
        z-index: 10620;
    }

.dqa-events-menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 11.75rem;
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    background: var(--phs-surface-card);
    border: 1px solid var(--phs-border-subtle);
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.12);
    z-index: 10625;
}

    .dqa-events-menu-panel[hidden] {
        display: none !important;
    }

.dqa-events-menu-panel__item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    white-space: nowrap;
}

button.dqa-events-menu-panel__item {
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font: inherit;
}

    .dqa-events-menu-panel__item:hover,
    .dqa-events-menu-panel__item:focus {
        background: #f1f5f9;
        color: #0f172a;
    }

.dqa-events-menu-panel__ic {
    width: 1.1rem;
    flex-shrink: 0;
    text-align: center;
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 400;
}

    .dqa-events-menu-panel__item:hover .dqa-events-menu-panel__ic,
    .dqa-events-menu-panel__item:focus .dqa-events-menu-panel__ic {
        color: #64748b;
    }

[data-theme="dark"] .dqa-events-menu-panel {
    background: #1b2744;
    border-color: #334e68;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .dqa-events-menu-panel__item,
[data-theme="dark"] button.dqa-events-menu-panel__item {
    color: var(--phs-border-subtle);
}

    [data-theme="dark"] .dqa-events-menu-panel__item:hover,
    [data-theme="dark"] .dqa-events-menu-panel__item:focus {
        background: #0f172a;
        color: #f8fafc;
    }

[data-theme="dark"] .dqa-events-menu-panel__ic {
    color: #94a3b8;
}

    [data-theme="dark"] .dqa-events-menu-panel__item:hover .dqa-events-menu-panel__ic,
    [data-theme="dark"] .dqa-events-menu-panel__item:focus .dqa-events-menu-panel__ic {
        color: #cbd5e1;
    }

.dashboard-sq-card__scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    margin-right: -2px;
}

    .dashboard-sq-card__scroll::-webkit-scrollbar {
        width: 5px;
    }

    .dashboard-sq-card__scroll::-webkit-scrollbar-thumb {
        background: #c7cdd8;
        border-radius: 4px;
    }

.dashboard-sq-empty {
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

/* Light theme: readable muted ink, beats Bootstrap .text-muted */
html:not([data-theme="dark"]) .dashboard-sq-empty.text-muted {
    color: #5d6a7d !important;
}

/* Recent activity rows (timeline rail: solid dot centered on vertical track) */
.dqa-activity-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.3rem 0;
}

.dqa-activity-meta {
    flex: 0 0 5rem;
    min-width: 0;
}

.dqa-activity-date,
.dqa-activity-time {
    font-weight: 700;
    font-size: 0.75rem;
    color: #1e293b;
    line-height: 1.15;
}

.dqa-activity-user {
    font-size: 0.65rem;
    color: #94a3b8;
    margin-top: 0.1rem;
    word-break: break-word;
}

.dqa-activity-rail {
    position: relative;
    width: 14px;
    flex-shrink: 0;
    align-self: stretch;
    min-height: 2.25rem;
}

.dqa-activity-rail-track {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #bae6fd 0%, #e0f2fe 50%, #bae6fd 100%);
    border-radius: 2px;
}

.dqa-activity-rail-dot {
    position: absolute;
    left: 50%;
    top: 0.42rem;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 0.42rem;
    color: var(--phs-primary-action);
    background: #fff;
    border-radius: 999px;
    padding: 2px;
    box-shadow: 0 0 0 1px #fff;
}

.dqa-activity-row--inserted .dqa-activity-rail-dot {
    color: #0d9488;
}

.dqa-activity-row--updated .dqa-activity-rail-dot {
    color: var(--phs-primary-action);
}

.dqa-activity-row--deleted .dqa-activity-rail-dot {
    color: #dc2626;
}

/* Curated recent-activity feed: one dot colour per event category, and a
   readable sentence layout (actor + verb, project link, relative time). */
.dqa-activity-rail-dot {
    font-size: 0.6rem;
    padding: 2px 3px;
}

.dqa-activity-row--new .dqa-activity-rail-dot { color: #0d9488; }
.dqa-activity-row--update .dqa-activity-rail-dot { color: var(--phs-primary-action); }
.dqa-activity-row--report .dqa-activity-rail-dot { color: #7c3aed; }
.dqa-activity-row--workflow .dqa-activity-rail-dot { color: #4f46e5; }
.dqa-activity-row--positive .dqa-activity-rail-dot { color: #16a34a; }
.dqa-activity-row--negative .dqa-activity-rail-dot { color: #dc2626; }
.dqa-activity-row--people .dqa-activity-rail-dot { color: #d97706; }
.dqa-activity-row--content .dqa-activity-rail-dot { color: #475569; }
.dqa-activity-row--due .dqa-activity-rail-dot { color: #d97706; }

.dqa-activity-headline {
    font-size: 0.875rem;
    line-height: 1.35;
    color: #334155;
}

.dqa-activity-actor {
    font-weight: 700;
    color: #1e293b;
}

.dqa-activity-when {
    font-size: 0.72rem;
    color: #5d6a7d;
    margin-top: 0.1rem;
}

[data-theme="dark"] .dqa-activity-when { color: #94a3b8; }
[data-theme="dark"] .dqa-activity-headline { color: #cbd5e1; }
[data-theme="dark"] .dqa-activity-actor { color: #f1f5f9; }

.dqa-activity-main {
    flex: 1;
    min-width: 0;
}

.dqa-activity-statusline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.4rem;
    font-size: 0.75rem;
    line-height: 1.25;
}

.dqa-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
}

    .dqa-status--inserted {
        color: #0d9488;
    }

    .dqa-status--updated {
        color: var(--phs-primary-action);
    }

    .dqa-status--deleted {
        color: #dc2626;
    }

.dqa-activity-field {
    font-weight: 700;
    color: #1e3a8a;
    text-decoration: none;
}

    .dqa-activity-field:hover {
        text-decoration: underline;
    }

.dqa-activity-values {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
}

.dqa-activity-ar {
    margin: 0 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
}

    .dqa-activity-ar i {
        font-size: 1.05rem;
        line-height: 1;
        font-weight: 900;
        -webkit-font-smoothing: antialiased;
        opacity: 0.92;
    }

/* Softer tints (still tied to action), slightly larger icon reads “bolder” */
.dqa-activity-row--inserted .dqa-activity-ar i {
    color: #5eead4;
}

.dqa-activity-row--updated .dqa-activity-ar i {
    color: #93c5fd;
}

.dqa-activity-row--deleted .dqa-activity-ar i {
    color: #fca5a5;
}

.dqa-activity-project {
    font-size: 0.8rem;
    color: #0954a5;
}

[data-theme="dark"] .dqa-activity-project {
    color: #93c5fd;
}

/* Announcements */
.dqa-ann-cols {
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 0.04em;
    font-size: 0.65rem !important;
    flex-shrink: 0;
}

/* Light theme: readable muted header, beats Bootstrap .text-muted */
html:not([data-theme="dark"]) .dqa-ann-cols.text-muted {
    color: #5d6a7d !important;
}

.dqa-ann-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.35rem;
    background: transparent;
    border-radius: 14px;
    border: 1px solid var(--phs-border-subtle);
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

    .dqa-ann-pill:last-child {
        margin-bottom: 0;
    }

    .dqa-ann-pill:hover,
    .dqa-ann-pill:focus-within {
        background: #f1f5f9;
        border-color: #cbd5e1;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

.dqa-ann-pill__left {
    min-width: 0;
    flex: 1;
}

.dqa-ann-title {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 0;
    font-weight: 700;
    font-size: 0.78rem;
    color: #1e3a8a;
    cursor: pointer;
    line-height: 1.2;
}

/* adacompliance.css sets button.announcement-title { font: inherit; padding: 12px 8px }
   for tap-target size, which blows the title up to the card's base font. Win the
   specificity contest and restate the intended type; keep a sane tap padding. */
.dashboard-sq-card button.dqa-ann-title {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    padding: 0.3rem 0;
    min-height: 0;
}

    .dqa-ann-title:hover {
        text-decoration: underline;
    }

.dqa-ann-date {
    font-size: 0.72rem;
    color: #5d6a7d;
    margin-top: 0;
    line-height: 1.2;
}

[data-theme="dark"] .dqa-ann-date { color: #94a3b8; }

.dqa-ann-pill__pri {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
    line-height: 1.2;
    padding: 0.32rem 0.72rem;
    border-radius: 999px;
    border: 1px solid;
}

.dqa-ann-pri__ic {
    font-size: 0.72rem;
    line-height: 1;
}

.dqa-ann-pri--high {
    color: #be123c;
    border-color: rgba(225, 29, 72, 0.5);
    background-color: rgba(225, 29, 72, 0.06);
}

.dqa-ann-pri--medium {
    color: #c2410c;
    border-color: rgba(234, 88, 12, 0.5);
    background-color: rgba(234, 88, 12, 0.07);
}

.dqa-ann-pri--low {
    color: #0f766e;
    border-color: rgba(15, 118, 110, 0.45);
    background-color: rgba(13, 148, 136, 0.08);
}

.dqa-ann-pri--other {
    color: #64748b;
    border-color: rgba(100, 116, 139, 0.45);
    background-color: rgba(148, 163, 184, 0.12);
    letter-spacing: 0.02em;
    max-width: 7.5rem;
    white-space: normal;
    text-align: center;
}

/* Events (card rows: title + description + meta; date badge right) */
.dqa-event-block {
    background: transparent;
    border: 1px solid var(--phs-border-subtle);
    border-radius: 12px;
    padding: 0.45rem 0.6rem;
    margin-bottom: 0.3rem;
    box-shadow: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

    .dqa-event-block:last-child {
        margin-bottom: 0;
    }

    .dqa-event-block:hover,
    .dqa-event-block:focus-within {
        background: #f1f5f9;
        border-color: #cbd5e1;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    }

.dqa-event-block__row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.85rem;
}

.dqa-event-block__main {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.dqa-event-title {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0 0 0.05rem 0;
    font-weight: 700;
    font-size: 0.82rem;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
    width: 100%;
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
}

    .dqa-event-title:hover {
        color: var(--phs-primary-action);
    }

.dqa-event-desc {
    margin: 0 0 0.15rem 0;
    font-size: 0.72rem;
    font-weight: 400;
    color: #64748b;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
}

.dqa-event-meta-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.6rem;
    font-size: 0.72rem;
    color: #5b6b82;
}

.dqa-event-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Clock / location: #0050A2 (FA webfont + FA kit/SVG; !important beats parent grey + theme rules) */
.dqa-event-meta-pill .dqa-event-meta-ic,
.dqa-event-meta-pill i.dqa-event-meta-ic {
    color: #0050a2 !important;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.dqa-event-meta-pill svg {
    color: #0050a2 !important;
    fill: #0050a2 !important;
}

    .dqa-event-meta-pill svg path {
        fill: currentColor !important;
    }

.dqa-event-meta-ic {
    color: #0050a2 !important;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.dqa-event-timeline {
    /* Sits inline at the end of the meta row - its own line cost each event ~a fifth of the card. */
    margin: 0 0 0 auto;
    padding: 0;
    font-size: 0.74rem;
    font-weight: 600;
    font-style: italic;
    line-height: 1.35;
    white-space: nowrap;
}

/* Past / upcoming / today — distinct colors */
.dqa-event-timeline--ago {
    color: #dc2626;
}

.dqa-event-timeline--in {
    color: #7c3aed;
}

.dqa-event-timeline--today {
    color: #047857;
    font-weight: 700;
}

.dqa-event-ics {
    color: #64748b;
    text-decoration: none;
    padding: 0.15rem;
    border-radius: 6px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

    .dqa-event-ics:hover {
        color: var(--phs-primary-action);
        background: rgba(37, 99, 235, 0.08);
    }

.dqa-event-date-badge {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    padding: 0.35rem 0.45rem;
    border-radius: 10px;
    background: linear-gradient(155deg, #2563eb 0%, var(--phs-primary-action-hover) 55%, #1e40af 100%);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
    text-align: center;
}

.dqa-event-date-badge__day {
    font-size: 1rem;
    font-weight: 700;
    color: var(--phs-surface-card);
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.dqa-event-date-badge__mon {
    font-size: 0.62rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-top: 0.05rem;
}

@media (max-width: 1024px) {
    .dashboard-sq-card {
        aspect-ratio: auto;
        min-height: 160px;
        max-height: min(46vw, 280px);
    }
}

@media (max-width: 576px) {
    .dashboard-sq-card__title {
        font-size: 1rem;
    }

    .dqa-ann-pill {
        align-items: flex-start;
        flex-direction: column;
    }

    .dqa-ann-pill__pri {
        align-self: flex-start;
    }

    .dqa-event-block__row {
        align-items: flex-start;
    }

    .dqa-event-date-badge {
        min-width: 2.5rem;
        padding: 0.3rem 0.35rem;
    }

    .dqa-event-date-badge__day {
        font-size: 0.92rem;
    }
}

[data-theme="dark"] .dashboard-sq-card {
    background: #16213e;
    border-color: #2d3548;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .dashboard-sq-card__title {
    color: var(--phs-border-subtle);
}

[data-theme="dark"] .dqa-activity-date,
[data-theme="dark"] .dqa-activity-time {
    color: #cbd5e1;
}

[data-theme="dark"] .dqa-activity-field {
    color: #93c5fd;
}

[data-theme="dark"] .dqa-activity-row--inserted .dqa-activity-ar i {
    color: #2dd4bf;
}

[data-theme="dark"] .dqa-activity-row--updated .dqa-activity-ar i {
    color: #7dd3fc;
}

[data-theme="dark"] .dqa-activity-row--deleted .dqa-activity-ar i {
    color: #fda4af;
}

[data-theme="dark"] .dqa-activity-rail-dot {
    background: #16213e;
    box-shadow: 0 0 0 1px #16213e;
}

[data-theme="dark"] .dqa-activity-rail-track {
    background: linear-gradient(180deg, #334e68 0%, #1e3a5f 50%, #334e68 100%);
}

[data-theme="dark"] .dqa-ann-pill {
    background: transparent;
    border-color: #334e68;
}

    [data-theme="dark"] .dqa-ann-pill:hover,
    [data-theme="dark"] .dqa-ann-pill:focus-within {
        background: #1b2744;
        border-color: #475569;
        box-shadow: none;
    }

[data-theme="dark"] .dqa-ann-title {
    color: #93c5fd;
}

[data-theme="dark"] .dqa-ann-pri--high {
    color: #fb7185;
    border-color: rgba(251, 113, 133, 0.55);
    background-color: rgba(251, 113, 133, 0.1);
}

[data-theme="dark"] .dqa-ann-pri--medium {
    color: #fdba74;
    border-color: rgba(253, 186, 116, 0.55);
    background-color: rgba(253, 186, 116, 0.1);
}

[data-theme="dark"] .dqa-ann-pri--low {
    color: #5eead4;
    border-color: rgba(94, 234, 212, 0.45);
    background-color: rgba(45, 212, 191, 0.1);
}

[data-theme="dark"] .dqa-ann-pri--other {
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.4);
    background-color: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .dashboard-sq-card__menu-btn {
    color: #94a3b8;
}

    [data-theme="dark"] .dashboard-sq-card__menu-btn:hover,
    [data-theme="dark"] .dashboard-sq-card__menu-btn:focus-visible {
        background: #1b2744;
        color: var(--phs-border-subtle);
    }

[data-theme="dark"] .dqa-event-block {
    background: transparent;
    border-color: #334e68;
    box-shadow: none;
}

    [data-theme="dark"] .dqa-event-block:hover,
    [data-theme="dark"] .dqa-event-block:focus-within {
        background: #1b2744;
        border-color: #475569;
    }

[data-theme="dark"] .dqa-event-title {
    color: #f1f5f9;
}

[data-theme="dark"] .dqa-event-desc {
    color: #94a3b8;
}

[data-theme="dark"] .dqa-event-meta-inline {
    color: #94a3b8;
}

[data-theme="dark"] .dqa-event-meta-pill .dqa-event-meta-ic,
[data-theme="dark"] .dqa-event-meta-pill i.dqa-event-meta-ic,
[data-theme="dark"] .dqa-event-meta-ic {
    color: #60a5fa !important;
}

[data-theme="dark"] .dqa-event-meta-pill svg {
    color: #60a5fa !important;
    fill: #60a5fa !important;
}

    [data-theme="dark"] .dqa-event-meta-pill svg path {
        fill: currentColor !important;
    }

[data-theme="dark"] .dqa-event-timeline--ago {
    color: #f87171;
}

[data-theme="dark"] .dqa-event-timeline--in {
    color: #c4b5fd;
}

[data-theme="dark"] .dqa-event-timeline--today {
    color: #34d399;
}

[data-theme="dark"] .dqa-event-ics {
    color: #94a3b8;
}

    [data-theme="dark"] .dqa-event-ics:hover {
        color: #93c5fd;
        background: rgba(147, 197, 253, 0.12);
    }

[data-theme="dark"] .dash-summary-card {
    background: #16213e;
    border-color: #2d3548;
}

[data-theme="dark"] .dash-summary-card-title {
    color: var(--phs-border-subtle);
}

[data-theme="dark"] .dash-summary-filters .filter-small-label {
    color: #94a3b8;
}

[data-theme="dark"] .design-b6 .legend-item,
[data-theme="dark"] .design-2 .info-item {
    background: #1b2744;
    border-color: #2d3a52;
}

[data-theme="dark"] .design-b6 .legend-label,
[data-theme="dark"] .design-2 .info-label {
    color: var(--phs-border-subtle);
}

[data-theme="dark"] .design-b6 .legend-value,
[data-theme="dark"] .design-2 .info-value {
    color: #f1f5f9;
}

[data-theme="dark"] .design-2 .info-nested {
    border-left-color: #475569;
}

[data-theme="dark"] .design-2 .info-item--nested {
    background: #0f172a;
}

/* Statewide Dashboard button: separate it from the dark card surface */
[data-theme="dark"] .dash-statewide-summary-card__link {
    background: #4338ca;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .dash-statewide-summary-card__link:hover {
    background: #4f46e5;
}

/* Announcements column header: readable muted ink on the dark card */
[data-theme="dark"] .dqa-ann-cols {
    color: #94a3b8 !important;
}

/* Keyboard focus for the trio-card interactive elements */
.dashboard-sq-card__headlink:focus-visible,
.dqa-ann-title:focus-visible,
.dqa-event-title:focus-visible,
.dqa-event-ics:focus-visible,
.dqa-activity-project:focus-visible,
.dash-statewide-summary-card__link:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

[data-theme="dark"] .dashboard-sq-card__headlink:focus-visible,
[data-theme="dark"] .dqa-ann-title:focus-visible,
[data-theme="dark"] .dqa-event-title:focus-visible,
[data-theme="dark"] .dqa-event-ics:focus-visible,
[data-theme="dark"] .dqa-activity-project:focus-visible,
[data-theme="dark"] .dash-statewide-summary-card__link:focus-visible {
    outline-color: #93c5fd;
}
