:root {
    --sidebar-width: 288px;
    --app-bg: #f5f7fb;
    --primary: #0d6efd;
}

body {
    background: var(--app-bg);
    color: #1f2937;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0f172a, #1e293b);
    color: #fff;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    padding: 1.25rem;
    z-index: 10;
}

.brand-box {
    display: flex;
    gap: .75rem;
    align-items: center;
    padding: .75rem .5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.12);
    margin-bottom: 1rem;
}

.brand-icon,
.login-logo {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(13,110,253,.18);
    color: #60a5fa;
    font-size: 1.45rem;
}

.brand-title {
    font-weight: 800;
    letter-spacing: .04em;
}

.brand-subtitle {
    font-size: .78rem;
    color: #cbd5e1;
}

.sidebar-nav .nav-link {
    color: #cbd5e1;
    border-radius: 14px;
    padding: .82rem .9rem;
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: .25rem;
    transition: all .2s ease;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,.12);
}

.sidebar-nav .nav-link.active {
    box-shadow: inset 4px 0 0 #60a5fa;
}

.sidebar-parent-link {
    width: 100%;
    border: 0;
    text-align: left;
    background: transparent;
}

.sidebar-menu-chevron {
    font-size: .8rem;
    transition: transform .2s ease;
}

.sidebar-parent-link[aria-expanded="true"] .sidebar-menu-chevron {
    transform: rotate(180deg);
}

.sidebar-submenu {
    position: relative;
    margin: .15rem 0 .45rem 1.3rem;
    padding-left: .75rem;
    border-left: 1px solid rgba(255,255,255,.18);
}

.sidebar-nav .sidebar-submenu-link {
    min-height: 40px;
    padding: .58rem .75rem;
    margin-bottom: .15rem;
    border-radius: 10px;
    font-size: .86rem;
    color: #b8c5d6;
}

.sidebar-nav .sidebar-submenu-link i {
    font-size: .9rem;
}

.sidebar-nav .sidebar-submenu-link.active {
    background: rgba(255,255,255,.16);
    box-shadow: inset 3px 0 0 #60a5fa;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 1.25rem;
}

.content-wrap {
    padding-bottom: 2rem;
}

.topbar {
    padding: .85rem 1rem;
}

.card-soft,
.stat-card {
    border: none;
    border-radius: 1.1rem;
    box-shadow: 0 10px 30px rgba(15,23,42,.07);
}

.card-soft .card-header {
    background: #fff;
    border-bottom: 1px solid #eef2f7;
    border-radius: 1.1rem 1.1rem 0 0;
}

.stat-card {
    background: #fff;
    padding: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 130px;
}

.stat-label {
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    font-size: .78rem;
    letter-spacing: .04em;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
}

.stat-icon {
    font-size: 2.2rem;
    opacity: .9;
}

.table th {
    white-space: nowrap;
    color: #475569;
    font-size: .85rem;
}

.table td {
    vertical-align: middle;
    font-size: .9rem;
}

.btn-group-sm > .btn,
.btn-sm {
    border-radius: .6rem;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at top, #dbeafe, #f8fafc 45%, #eef2ff);
}

.login-card {
    width: min(440px, calc(100% - 2rem));
    background: #fff;
    border-radius: 1.25rem;
    padding: 2rem;
}

.login-logo {
    margin: 0 auto 1rem;
    background: #e0edff;
}

.gantt-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: .75rem;
}

.gantt-scroll::-webkit-scrollbar {
    height: 10px;
}

.gantt-scroll::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 999px;
}

.gantt-scroll::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 999px;
}

.gantt-wrap {
    --gantt-chart-width: 1200px;
    min-width: calc(220px + 1rem + var(--gantt-chart-width));
    width: max-content;
}

.gantt-range {
    font-size: .86rem;
    position: sticky;
    left: 0;
    z-index: 5;
    background: #fff;
    width: fit-content;
    padding-right: 1rem;
}

.gantt-head,
.gantt-row {
    display: grid;
    grid-template-columns: 220px var(--gantt-chart-width);
    gap: 1rem;
    align-items: center;
}

.gantt-head {
    margin-bottom: .9rem;
}

.gantt-row {
    margin-bottom: .75rem;
}

.gantt-label,
.gantt-label-head {
    font-weight: 600;
    font-size: .9rem;
    color: #334155;
    position: sticky;
    left: 0;
    z-index: 6;
    background: #fff;
    padding-right: .75rem;
}

.gantt-label-head {
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: .8rem;
}

.gantt-months,
.gantt-track {
    position: relative;
    overflow: hidden;
    width: var(--gantt-chart-width);
}

.gantt-months {
    height: 50px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
}

.gantt-month {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #cbd5e1;
    font-size: .78rem;
    font-weight: 700;
    color: #475569;
    background: rgba(255,255,255,.7);
    white-space: nowrap;
}

.gantt-track {
    height: 38px;
    background: #e2e8f0;
    border-radius: 999px;
}

.gantt-grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(148, 163, 184, .55);
    z-index: 1;
}

.gantt-current-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dc3545;
    z-index: 4;
}

.gantt-current-line-head span {
    position: absolute;
    top: 8px;
    left: 7px;
    background: #dc3545;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    padding: .25rem .5rem;
    border-radius: .5rem;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(220, 53, 69, .25);
}

.gantt-bar {
    position: absolute;
    top: 5px;
    bottom: 5px;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
    border-radius: 999px;
    min-width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    z-index: 3;
    box-shadow: 0 4px 10px rgba(37, 99, 235, .18);
}

.gantt-bar-p100 {
    background: linear-gradient(90deg, #16a34a, #4ade80);
}

.gantt-bar-p75 {
    background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.gantt-bar-p50 {
    background: linear-gradient(90deg, #0f766e, #2dd4bf);
}

.gantt-bar-p25 {
    background: linear-gradient(90deg, #d97706, #facc15);
}

.gantt-bar-p0 {
    background: linear-gradient(90deg, #dc2626, #f97316);
}

.progress {
    height: .6rem;
    border-radius: 999px;
}

.modal-content {
    border: none;
    border-radius: 1.1rem;
}

@media (max-width: 992px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-radius: 0 0 1.25rem 1.25rem;
    }
    .app-shell {
        display: block;
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .25rem;
    }
    .sidebar-menu-group {
        grid-column: 1 / -1;
    }
    .sidebar-submenu {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-left: .5rem;
    }
}


.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: .6rem;
}

.module-check {
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: .8rem;
    padding: .7rem .8rem;
    background: #f8fafc;
    font-size: .9rem;
}

.gantt-bar-sub {
    top: 9px;
    bottom: 9px;
    opacity: .9;
}


/* Responsive DataTables: collapse hidden columns into child rows instead of forcing wide tables. */
table.dataTable.datatable {
    width: 100% !important;
}

table.dataTable.datatable th,
table.dataTable.datatable td {
    white-space: nowrap;
}

table.dataTable.datatable td.child {
    white-space: normal;
    background: #f8fafc;
}

table.dataTable.datatable td.child ul.dtr-details {
    width: 100%;
    margin: 0;
}

table.dataTable.datatable td.child ul.dtr-details > li {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .45rem 0;
    border-bottom: 1px solid #e2e8f0;
}

table.dataTable.datatable td.child ul.dtr-details > li:last-child {
    border-bottom: none;
}

table.dataTable.datatable td.child .dtr-title {
    min-width: 150px;
    color: #475569;
    font-weight: 700;
}

table.dataTable.datatable td.child .dtr-data {
    white-space: normal;
    word-break: break-word;
}

table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
    cursor: default;
}

.table-responsive .dt-container {
    width: 100%;
}


/* Center all DataTable values. */
table.dataTable.datatable th,
table.dataTable.datatable td,
.table-centered-values th,
.table-centered-values td {
    text-align: center !important;
    vertical-align: middle !important;
}

/* Percentage values displayed as value-based bars inside DataTables. */
.percent-cell-td {
    min-width: 160px;
}

.percent-bar-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .18rem;
    min-width: 145px;
}

.percent-track {
    width: 112px;
    height: .65rem;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .08);
}

.percent-fill {
    height: 100%;
    border-radius: 999px;
}

.percent-fill-100 {
    background: linear-gradient(90deg, #16a34a, #4ade80);
}

.percent-fill-75 {
    background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.percent-fill-50 {
    background: linear-gradient(90deg, #0f766e, #2dd4bf);
}

.percent-fill-25 {
    background: linear-gradient(90deg, #d97706, #facc15);
}

.percent-fill-0 {
    background: linear-gradient(90deg, #dc2626, #f97316);
}

.percent-label {
    order: -1;
    min-width: 54px;
    font-size: .78rem;
    font-weight: 700;
    color: #334155;
    text-align: center;
    line-height: 1;
}

/* Replace the responsive collapse arrow with a green plus sign. */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before {
    content: '+' !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 1.15rem !important;
    height: 1.15rem !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 999px !important;
    background: #198754 !important;
    color: #fff !important;
    font-size: .95rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    box-shadow: 0 3px 8px rgba(25, 135, 84, .25) !important;
    position: absolute !important;
    left: .6rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

table.dataTable.dtr-inline.collapsed > tbody > tr.dt-hasChild > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr.dt-hasChild > th.dtr-control::before {
    content: '−' !important;
    background: #dc3545 !important;
    box-shadow: 0 3px 8px rgba(220, 53, 69, .22) !important;
}

table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
    cursor: pointer;
    position: relative !important;
    text-align: left !important;
    padding-left: 2.15rem !important;
}

/* Keep child-row details readable even with centered main table values. */
table.dataTable.datatable td.child,
table.dataTable.datatable td.child .dtr-title,
table.dataTable.datatable td.child .dtr-data {
    text-align: left !important;
}

.admin-panel-code { white-space: normal; word-break: break-word; }



.table-critical-row td {
    background-color: rgba(220, 53, 69, .06) !important;
}
.analysis-note {
    font-size: .86rem;
    color: #64748b;
}


/* Compact Project Analysis screen layout. */
.analysis-page {
    --analysis-chart-height: 112px;
}

.analysis-page .analysis-title-row {
    margin-top: -.35rem;
}

.analysis-page .analysis-stat-card {
    min-height: 82px;
    padding: .85rem 1rem;
}

.analysis-page .stat-label {
    font-size: .68rem;
}

.analysis-page .stat-value {
    font-size: 1.45rem;
    line-height: 1.05;
}

.analysis-page .stat-icon {
    font-size: 1.7rem;
}

.analysis-page .card-header {
    font-size: .92rem;
}

.analysis-page .card-body {
    padding-left: .75rem;
    padding-right: .75rem;
}

.analysis-chart-card {
    height: 160px;
}

.analysis-chart-stack .analysis-chart-card {
    height: 150px;
}

.analysis-chart-box {
    height: var(--analysis-chart-height);
    width: 100%;
    position: relative;
}

.analysis-chart-box canvas {
    width: 100% !important;
    height: 100% !important;
}

.analysis-table-card .nav-pills .nav-link {
    padding: .35rem .75rem;
    font-size: .86rem;
    border-radius: .6rem;
}

.analysis-note {
    font-size: .76rem;
    color: #64748b;
}

.analysis-page .table-filter-row .form-label {
    color: #475569;
}

.analysis-page .table-filter-row .form-select,
.analysis-page .table-filter-row .btn {
    min-height: 31px;
    font-size: .78rem;
}

.analysis-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
}

.analysis-page .dataTables_wrapper,
.analysis-page .dt-container {
    font-size: .82rem;
}

.analysis-page .table th,
.analysis-page .table td {
    padding: .38rem .45rem;
    font-size: .78rem;
}

.analysis-page .percent-track {
    width: 86px;
    height: .5rem;
}

.analysis-page .percent-bar-cell {
    min-width: 110px;
    gap: .12rem;
}

.analysis-page .percent-cell-td {
    min-width: 120px;
}

.analysis-page .percent-label {
    font-size: .7rem;
}

.analysis-page .badge {
    font-size: .68rem;
}

@media (max-height: 780px) {
    .analysis-page {
        --analysis-chart-height: 95px;
    }

    .analysis-chart-card,
    .analysis-chart-stack .analysis-chart-card {
        height: 132px;
    }

    .analysis-page .analysis-stat-card {
        min-height: 70px;
        padding: .65rem .85rem;
    }

    .analysis-page .stat-value {
        font-size: 1.25rem;
    }

    .analysis-page .stat-icon {
        font-size: 1.45rem;
    }
}

/* Dashboard analytics chart containers */
.dashboard-chart-box {
    height: 240px;
    position: relative;
}

.dashboard-chart-box canvas {
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 768px) {
    .dashboard-chart-box {
        height: 220px;
    }
}


.csv-error-list {
    font-size: .85rem;
    line-height: 1.35;
}

.csv-upload-inline-progress .progress-bar {
    transition: width .2s ease;
}

/* Web Settings: theme color, layout density, sidebar style, and card style. */
body.theme-blue { --theme-primary: #2563eb; --theme-primary-soft: rgba(37,99,235,.14); --theme-sidebar-start: #0f172a; --theme-sidebar-end: #1e293b; --theme-accent: #60a5fa; }
body.theme-green { --theme-primary: #15803d; --theme-primary-soft: rgba(21,128,61,.14); --theme-sidebar-start: #052e16; --theme-sidebar-end: #14532d; --theme-accent: #4ade80; }
body.theme-omgreen { --theme-primary: #377f6b; --theme-primary-soft: rgba(55,127,107,.14); --theme-sidebar-start: #10352c; --theme-sidebar-end: #377f6b; --theme-accent: #80c8b3; }
body.theme-purple { --theme-primary: #7c3aed; --theme-primary-soft: rgba(124,58,237,.14); --theme-sidebar-start: #2e1065; --theme-sidebar-end: #4c1d95; --theme-accent: #c084fc; }
body.theme-red { --theme-primary: #dc2626; --theme-primary-soft: rgba(220,38,38,.14); --theme-sidebar-start: #450a0a; --theme-sidebar-end: #7f1d1d; --theme-accent: #fca5a5; }
body.theme-slate { --theme-primary: #334155; --theme-primary-soft: rgba(51,65,85,.14); --theme-sidebar-start: #111827; --theme-sidebar-end: #374151; --theme-accent: #cbd5e1; }

body .sidebar { background: linear-gradient(180deg, var(--theme-sidebar-start, #0f172a), var(--theme-sidebar-end, #1e293b)); }
body .brand-icon,
body .login-logo { background: var(--theme-primary-soft, rgba(13,110,253,.18)); color: var(--theme-accent, #60a5fa); }
body .sidebar-nav .nav-link.active { box-shadow: inset 4px 0 0 var(--theme-accent, #60a5fa); }
body .btn-primary { --bs-btn-bg: var(--theme-primary, #0d6efd); --bs-btn-border-color: var(--theme-primary, #0d6efd); --bs-btn-hover-bg: color-mix(in srgb, var(--theme-primary, #0d6efd) 86%, #000); --bs-btn-hover-border-color: color-mix(in srgb, var(--theme-primary, #0d6efd) 86%, #000); }
body .text-primary { color: var(--theme-primary, #0d6efd) !important; }
body .bg-primary { background-color: var(--theme-primary, #0d6efd) !important; }

body.sidebar-light .sidebar { background: #fff; color: #1e293b; box-shadow: 10px 0 30px rgba(15,23,42,.06); }
body.sidebar-light .brand-box { border-bottom-color: #e2e8f0; }
body.sidebar-light .brand-subtitle,
body.sidebar-light .sidebar-nav .nav-link { color: #64748b; }
body.sidebar-light .sidebar-nav .nav-link:hover,
body.sidebar-light .sidebar-nav .nav-link.active { color: #0f172a; background: var(--theme-primary-soft, rgba(37,99,235,.12)); }
body.sidebar-gradient .sidebar { background: radial-gradient(circle at 20% 0%, var(--theme-accent, #60a5fa), transparent 25%), linear-gradient(180deg, var(--theme-sidebar-start, #0f172a), var(--theme-sidebar-end, #1e293b)); }

body.layout-compact { --sidebar-width: 252px; }
body.layout-compact .main-content { padding: .85rem; }
body.layout-compact .topbar { padding: .65rem .85rem; margin-bottom: .85rem !important; }
body.layout-compact .card-body { padding: .85rem; }
body.layout-compact .sidebar-nav .nav-link { padding: .62rem .75rem; }
body.layout-wide { --sidebar-width: 260px; }
body.layout-wide .main-content { padding-left: 1rem; padding-right: 1rem; }

body.cards-flat .card-soft,
body.cards-flat .stat-card { box-shadow: none; border: 1px solid #e2e8f0; }
body.cards-bordered .card-soft,
body.cards-bordered .stat-card { box-shadow: 0 6px 16px rgba(15,23,42,.04); border: 1px solid #cbd5e1; }

.settings-preview { background: linear-gradient(135deg, var(--theme-primary-soft, rgba(37,99,235,.14)), #f8fafc); border: 1px solid #e2e8f0; }
.settings-preview-sidebar { height: 38px; background: linear-gradient(90deg, var(--theme-sidebar-start, #0f172a), var(--theme-sidebar-end, #1e293b)); }
.settings-preview-card { border-top: 4px solid var(--theme-primary, #2563eb); }

/* Thinner embedded Gantt bars after moving detailed view to full-page Gantt. */
.gantt-head,
.gantt-row { grid-template-columns: 220px minmax(720px, var(--gantt-chart-width)); }
.gantt-row { margin-bottom: .45rem; }
.gantt-track { height: 28px; }
.gantt-bar { top: 7px; bottom: 7px; min-width: 34px; font-size: .68rem; box-shadow: 0 3px 8px rgba(37,99,235,.13); }
.gantt-bar-sub { top: 9px; bottom: 9px; opacity: .88; }
.gantt-months { height: 40px; }
.gantt-month { font-size: .7rem; }
.gantt-current-line-head span { top: 5px; font-size: .65rem; }


/* Embedded schedule Gantt: internal responsive scrollbar for long schedules. */
.embedded-gantt-card .card-body {
    padding: .65rem .8rem .75rem;
}
.gantt-scroll-compact {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: .45rem;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #e2e8f0;
}
.gantt-scroll-compact::-webkit-scrollbar {
    height: 8px;
}
.gantt-scroll-compact::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 999px;
}
.gantt-scroll-compact::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 999px;
}
.gantt-scroll-compact .gantt-wrap-compact {
    min-width: calc(170px + .5rem + var(--gantt-chart-width));
    width: max-content;
}
.gantt-scroll-compact .gantt-range {
    position: sticky;
    left: 0;
    z-index: 8;
    width: fit-content;
    background: #fff;
    padding-right: .75rem;
    font-size: .72rem;
}
.gantt-scroll-compact .gantt-head,
.gantt-scroll-compact .gantt-row {
    grid-template-columns: 170px var(--gantt-chart-width);
    gap: .5rem;
}
.gantt-scroll-compact .gantt-head {
    margin-bottom: .35rem;
}
.gantt-scroll-compact .gantt-row {
    margin-bottom: .22rem;
}
.gantt-scroll-compact .gantt-label,
.gantt-scroll-compact .gantt-label-head {
    position: sticky;
    left: 0;
    z-index: 7;
    background: #fff;
    padding-right: .35rem;
    font-size: .68rem;
    line-height: 1.15;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    overflow-wrap: anywhere;
    box-shadow: 8px 0 10px -12px rgba(15,23,42,.65);
}
.gantt-scroll-compact .gantt-label-head {
    z-index: 9;
    font-size: .62rem;
    letter-spacing: .03em;
}
.gantt-scroll-compact .gantt-months,
.gantt-scroll-compact .gantt-track {
    width: var(--gantt-chart-width);
}
.gantt-scroll-compact .gantt-months {
    height: 26px;
    border-radius: .55rem;
}
.gantt-scroll-compact .gantt-month {
    font-size: .55rem;
    font-weight: 700;
    letter-spacing: -.02em;
    padding: 0 .08rem;
}
.gantt-scroll-compact .gantt-track {
    min-height: 16px;
    border-radius: .45rem;
    background: #edf2f7;
}
.gantt-scroll-compact .gantt-bar {
    top: 3px;
    bottom: auto;
    min-width: 12px;
    font-size: .48rem;
    line-height: 1;
    box-shadow: none;
}
.gantt-scroll-compact .gantt-bar span {
    transform: scale(.92);
    max-width: 100%;
    overflow: hidden;
    text-overflow: clip;
}
.gantt-scroll-compact .gantt-bar-sub {
    top: 4px;
    bottom: 4px;
    opacity: .9;
}
.gantt-scroll-compact .gantt-grid-line {
    background: rgba(148, 163, 184, .32);
}
.gantt-scroll-compact .gantt-current-line {
    width: 1px;
}
.gantt-scroll-compact .gantt-current-line-head span {
    top: 2px;
    left: 3px;
    font-size: .48rem;
    padding: .08rem .22rem;
    border-radius: .3rem;
}
@media (max-width: 1200px) {
    .gantt-scroll-compact .gantt-head,
    .gantt-scroll-compact .gantt-row {
        grid-template-columns: 145px var(--gantt-chart-width);
    }
    .gantt-scroll-compact .gantt-wrap-compact {
        min-width: calc(145px + .5rem + var(--gantt-chart-width));
    }
    .gantt-scroll-compact .gantt-label,
    .gantt-scroll-compact .gantt-label-head {
        font-size: .62rem;
    }
    .gantt-scroll-compact .gantt-month { font-size: .48rem; }
}

/* Implementation Schedule Activities table refinements. */
.schedule-activities-table td.schedule-activity-cell,
.schedule-activities-table td.schedule-parent-cell {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.25;
    text-align: left !important;
}

.schedule-activities-table td.schedule-activity-cell {
    min-width: 190px;
    max-width: 280px;
}

.schedule-activities-table td.schedule-parent-cell {
    min-width: 150px;
    max-width: 220px;
}

.schedule-activities-table .percent-cell-td {
    min-width: 92px;
}

.schedule-activities-table .percent-bar-cell {
    min-width: 86px;
    gap: .08rem;
}

.schedule-activities-table .percent-track {
    width: 68px;
    height: .42rem;
}

.schedule-activities-table .percent-label {
    font-size: .66rem;
}

.schedule-summary-table th,
.schedule-summary-table td {
    text-align: center;
    vertical-align: middle;
}

.schedule-recommendations-card ol {
    columns: 1;
}

@media (min-width: 1200px) {
    .schedule-recommendations-card ol {
        columns: 2;
        column-gap: 2rem;
    }
}

/* Compact percentage bars in Schedule Activities; Weight percentage remains plain text. */
.schedule-activities-table .percent-cell-td {
    min-width: 105px;
}
.schedule-activities-table .percent-bar-cell {
    min-width: 92px;
}
.schedule-activities-table .percent-track {
    width: 74px;
    height: .48rem;
}
.schedule-activities-table .percent-label {
    font-size: .68rem;
}
.schedule-activities-table .no-percent-bar {
    min-width: auto !important;
    white-space: nowrap;
}

/* Project Analysis table heading wrap and compact cells. */
.analysis-wrap-headings th,
.analysis-datatable th {
    white-space: normal !important;
    line-height: 1.12;
    vertical-align: middle !important;
    max-width: 115px;
}
.analysis-datatable td {
    white-space: normal;
}
.analysis-datatable td.child .dtr-title,
.analysis-datatable td.child .dtr-data {
    white-space: normal;
}

/* Login page controlled by Web Settings */
.login-body.theme-blue,
.login-body.theme-green,
.login-body.theme-omgreen,
.login-body.theme-purple,
.login-body.theme-red,
.login-body.theme-slate {
    --login-gradient-start: color-mix(in srgb, var(--theme-primary, #2563eb) 18%, #f8fafc);
    --login-gradient-mid: #f8fafc;
    --login-gradient-end: color-mix(in srgb, var(--theme-accent, #60a5fa) 16%, #eef2ff);
    background:
        radial-gradient(circle at 18% 12%, var(--theme-primary-soft, rgba(37,99,235,.14)), transparent 28%),
        radial-gradient(circle at 88% 18%, color-mix(in srgb, var(--theme-accent, #60a5fa) 22%, transparent), transparent 30%),
        linear-gradient(135deg, var(--login-gradient-start), var(--login-gradient-mid) 45%, var(--login-gradient-end));
}

.login-shell {
    width: min(1040px, calc(100% - 2rem));
    min-height: 560px;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    align-items: stretch;
    border-radius: 2rem;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(15,23,42,.16);
    background: rgba(255,255,255,.76);
    backdrop-filter: blur(18px);
}

.login-hero-panel {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--theme-sidebar-start, #0f172a) 92%, #000), color-mix(in srgb, var(--theme-primary, #2563eb) 64%, #111827)),
        radial-gradient(circle at 30% 20%, var(--theme-accent, #60a5fa), transparent 30%);
    position: relative;
    isolation: isolate;
}

.login-hero-panel::after {
    content: '';
    position: absolute;
    inset: 1rem;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 1.35rem;
    pointer-events: none;
}

.login-hero-badge {
    width: fit-content;
    padding: .55rem .85rem;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    font-weight: 700;
    font-size: .86rem;
    margin-bottom: 1.4rem;
}

.login-hero-panel h1 {
    font-size: clamp(2.3rem, 5vw, 4rem);
    font-weight: 900;
    letter-spacing: -.06em;
    margin-bottom: 1rem;
}

.login-hero-panel p {
    max-width: 520px;
    color: rgba(255,255,255,.82);
    font-size: 1.03rem;
    line-height: 1.65;
}

.login-hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: .8rem;
    margin-top: 2rem;
}

.login-hero-metrics div {
    padding: .9rem;
    border-radius: 1rem;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.14);
}

.login-hero-metrics strong,
.login-hero-metrics span {
    display: block;
}

.login-hero-metrics span {
    font-size: .72rem;
    color: rgba(255,255,255,.72);
}

.login-shell .login-card {
    width: 100%;
    max-width: none;
    border-radius: 0;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.7rem, 4vw, 3rem);
}

.login-input-group .input-group-text {
    background: var(--theme-primary-soft, rgba(37,99,235,.14));
    color: var(--theme-primary, #2563eb);
    border-color: #e2e8f0;
}

.login-input-group .form-control {
    border-color: #e2e8f0;
}

.login-input-group .form-control:focus {
    border-color: var(--theme-primary, #2563eb);
    box-shadow: 0 0 0 .2rem var(--theme-primary-soft, rgba(37,99,235,.14));
}

.login-btn {
    border-radius: .9rem;
    font-weight: 800;
    box-shadow: 0 12px 26px var(--theme-primary-soft, rgba(37,99,235,.14));
}

body.login-compact .login-shell {
    width: min(460px, calc(100% - 2rem));
    min-height: auto;
    display: block;
    overflow: visible;
    background: transparent;
    box-shadow: none;
}

body.login-compact .login-hero-panel {
    display: none;
}

body.login-compact .login-card {
    border-radius: 1.25rem;
    box-shadow: 0 20px 50px rgba(15,23,42,.12) !important;
}

body.login-split .login-shell {
    grid-template-columns: 1.2fr .8fr;
}

body.login-split .login-hero-panel {
    background:
        radial-gradient(circle at 30% 16%, color-mix(in srgb, var(--theme-accent, #60a5fa) 34%, transparent), transparent 28%),
        linear-gradient(165deg, var(--theme-sidebar-start, #0f172a), var(--theme-sidebar-end, #1e293b));
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
        width: min(500px, calc(100% - 2rem));
        min-height: auto;
    }
    .login-hero-panel {
        display: none;
    }
    .login-shell .login-card {
        border-radius: 1.5rem;
    }
}


.regional-performance-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .75rem;
    width: 100%;
}

.regional-performance-card {
    background: #fff;
    border: none;
    border-radius: 1.1rem;
    box-shadow: 0 10px 30px rgba(15,23,42,.07);
    padding: .85rem;
    min-width: 0;
}

.compact-regional-card {
    min-height: 172px;
}

.regional-card-region {
    font-size: clamp(.85rem, .95vw, 1.05rem);
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.regional-card-icon {
    font-size: 1.1rem;
}

.regional-card-main {
    font-size: clamp(1.45rem, 2vw, 2.1rem);
    line-height: 1;
    font-weight: 900;
    color: #198754;
}

.regional-card-caption {
    color: #64748b;
    font-size: clamp(.62rem, .75vw, .76rem);
    font-weight: 700;
    margin: .2rem 0 .45rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.regional-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .42rem;
}

.regional-card-grid > div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: .72rem;
    padding: .42rem .46rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .25rem;
    min-width: 0;
}

.regional-card-grid span {
    color: #64748b;
    font-size: clamp(.58rem, .68vw, .72rem);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.regional-card-grid strong {
    color: #0f172a;
    font-size: clamp(.76rem, .9vw, .98rem);
    font-weight: 800;
}

.regional-card-grid .regional-this-year strong {
    color: #198754;
}

.regional-card-grid .regional-remaining strong {
    color: #dc3545;
}

@media (max-width: 1100px) {
    .regional-performance-strip {
        gap: .45rem;
    }
    .regional-performance-card {
        padding: .65rem;
    }
    .regional-card-grid > div {
        padding: .34rem .38rem;
    }
}


.project-progress-monitor {
    font-size: .74rem;
    line-height: 1.25;
    min-height: 1.2rem;
}

.trend-badge {
    min-width: 96px;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}


/* Compact PMMS progress bars and wrapped DataTable headers. */
table.datatable.wrap-column-headings th,
table.datatable.compact-progress-table th {
    white-space: normal !important;
    line-height: 1.15 !important;
    vertical-align: middle !important;
    max-width: 120px;
}

table.datatable.wrap-column-headings td {
    white-space: normal;
    word-break: normal;
}

table.datatable.compact-progress-table .percent-cell-td {
    min-width: 92px !important;
    width: 92px !important;
}

table.datatable.compact-progress-table .percent-bar-cell {
    min-width: 78px !important;
    gap: .12rem !important;
}

table.datatable.compact-progress-table .percent-track {
    width: 68px !important;
    height: .42rem !important;
}

table.datatable.compact-progress-table .percent-label {
    min-width: 42px !important;
    font-size: .68rem !important;
}

.project-name-wrap {
    max-width: 240px;
    white-space: normal !important;
    word-break: break-word;
    text-align: left !important;
    line-height: 1.25;
}

.weekly-trend-chart-box {
    min-height: 260px;
    height: 280px;
}

.weekly-trend-table td,
.weekly-trend-table th {
    white-space: normal !important;
    line-height: 1.15;
}


/* Weekly increase integrated under compact percent bars. */
.percent-bar-with-trend {
    gap: .12rem !important;
}

.trend-inline {
    width: 112px;
    max-width: 112px;
    min-height: .8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .12rem;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 700;
    line-height: 1;
    padding: .08rem .22rem;
    white-space: nowrap;
}

.trend-inline-up {
    background: #dcfce7;
    color: #15803d;
}

.trend-inline-down {
    background: #fee2e2;
    color: #b91c1c;
}

.trend-inline-neutral {
    background: #e2e8f0;
    color: #475569;
}

table.datatable.compact-progress-table .percent-bar-with-trend .trend-inline {
    width: 68px !important;
    max-width: 68px !important;
    font-size: .55rem !important;
    padding: .08rem .16rem !important;
}

.project-details-table .percent-cell-td,
.dashboard-accomplishment-table .percent-cell-td {
    min-width: 84px !important;
    width: 84px !important;
}

.project-details-table .percent-bar-cell,
.dashboard-accomplishment-table .percent-bar-cell {
    min-width: 74px !important;
}

/* Project Details workweek accomplishment modal. */
.weekly-progress-modal-dialog {
    max-width: min(1680px, 96vw);
}

.project-weekly-chart-box {
    height: 340px;
    min-height: 320px;
}

.weekly-progress-summary .mini-stat-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: .85rem 1rem;
    height: 100%;
}

.weekly-progress-summary .mini-stat-box span {
    display: block;
    font-size: .72rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
    margin-bottom: .35rem;
}

.weekly-progress-summary .mini-stat-box strong {
    font-size: 1.15rem;
    color: #0f172a;
}

#projectWeeklyProgressTable th {
    white-space: normal !important;
    line-height: 1.15;
}

@media (max-width: 991.98px) {
    .project-weekly-chart-box {
        height: 280px;
    }
}


/* Extra-large workweek accomplishment modal export/print layout. */
#weeklyProgressModal .modal-header {
    gap: 1rem;
}

#weeklyProgressModal .modal-body {
    overflow-x: hidden;
}

#weeklyProgressModal .btn-outline-success,
#weeklyProgressModal .btn-outline-secondary {
    white-space: nowrap;
}

.weekly-progress-modal-dialog.modal-xxl {
    max-width: min(1680px, 96vw);
}

@media print {
    #weeklyProgressModal .modal-header .btn,
    #weeklyProgressModal .btn-close,
    #weeklyProjectFilter,
    #weeklySubstationFilter {
        display: none !important;
    }
}

/* Improved main dashboard status overview cards. */
.dashboard-status-overview .dashboard-status-card {
    position: relative;
    min-height: 142px;
    padding: 1rem .92rem;
    border-radius: 1.15rem;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, .95);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .075);
}
.dashboard-status-overview .dashboard-status-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: var(--card-accent, var(--theme-primary, #2563eb));
}
.dashboard-status-overview .dashboard-status-card::after {
    content: '';
    position: absolute;
    right: -22px;
    top: -22px;
    width: 88px;
    height: 88px;
    border-radius: 999px;
    background: var(--card-soft, rgba(37, 99, 235, .10));
}
.dashboard-status-icon {
    position: absolute;
    right: .82rem;
    top: .82rem;
    width: 40px;
    height: 40px;
    border-radius: .95rem;
    display: grid;
    place-items: center;
    color: var(--card-accent, #2563eb);
    background: var(--card-soft, rgba(37, 99, 235, .10));
    font-size: 1.25rem;
    z-index: 1;
}
.dashboard-status-label {
    color: #64748b;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding-right: 46px;
    line-height: 1.15;
    min-height: 1.6rem;
}
.dashboard-status-value {
    color: #0f172a;
    font-size: clamp(1.35rem, 2.3vw, 2.05rem);
    font-weight: 900;
    line-height: 1;
    margin-top: .55rem;
    white-space: nowrap;
}
.dashboard-status-caption {
    color: #64748b;
    font-size: .72rem;
    font-weight: 600;
    margin-top: .4rem;
    white-space: normal;
    line-height: 1.2;
}
.dashboard-status-progress {
    height: .38rem;
    width: 100%;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    margin-top: .75rem;
}
.dashboard-status-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--card-accent, #2563eb);
}
.dashboard-status-card-primary { --card-accent: #2563eb; --card-soft: rgba(37, 99, 235, .12); }
.dashboard-status-card-info { --card-accent: #0ea5e9; --card-soft: rgba(14, 165, 233, .13); }
.dashboard-status-card-success { --card-accent: #16a34a; --card-soft: rgba(22, 163, 74, .13); }
.dashboard-status-card-danger { --card-accent: #dc2626; --card-soft: rgba(220, 38, 38, .12); }
.dashboard-status-card-warning { --card-accent: #d97706; --card-soft: rgba(217, 119, 6, .14); }

.equipment-energized-note {
    color: #dc3545;
    font-weight: 600;
}
.slr-link-wrapper {
    transition: all .18s ease;
}

/* Schedule modal fieldset grouping */
.schedule-fieldset {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 1rem;
  padding: 1rem 1rem 1.1rem;
  background: rgba(248, 250, 252, 0.85);
}
.schedule-fieldset legend {
  float: none;
  width: auto;
  margin-bottom: .75rem;
  padding: 0 .55rem;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #334155;
}
.schedule-fieldset .form-label {
  font-size: .78rem;
  font-weight: 700;
  color: #475569;
}
.schedule-fieldset .form-text {
  font-size: .72rem;
}

/* Project Details modal grouped layout */
.project-fieldset {
  background: linear-gradient(180deg, rgba(248, 250, 252, .96), rgba(255, 255, 255, .94));
}
.project-fieldset legend {
  color: #1e3a8a;
}
.project-fieldset .form-control[readonly] {
  background-color: #eef2ff;
  font-weight: 700;
}
.project-status-preview {
  border-style: dashed;
}


/* Topbar user placeholder and admin DataTable column-collapse controls */
.topbar-user .user-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--theme-primary-soft, rgba(37,99,235,.14));
    color: var(--theme-primary, #2563eb);
    font-size: 1.25rem;
    border: 1px solid rgba(37,99,235,.12);
}

.dt-admin-column-control {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: .9rem;
    padding: .65rem;
}

.dt-admin-column-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: .75rem;
    padding: .75rem;
}

.dt-admin-column-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .35rem .75rem;
}

.dt-admin-column-grid .form-check {
    margin-bottom: 0;
    color: #334155;
}

/* Shared modal fieldset style used by Project, Equipment, and Schedule forms. */
.pmms-fieldset {
    border: 1px solid color-mix(in srgb, var(--theme-primary, #2563eb) 28%, #cbd5e1);
    border-radius: 1rem;
    padding: 1rem 1rem 1.1rem;
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--theme-primary-soft, rgba(37,99,235,.14)) 88%, #e2e8f0),
            color-mix(in srgb, var(--theme-primary, #2563eb) 10%, #f1f5f9 90%)
        );
    box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 8px 20px rgba(15,23,42,.045);
}

.pmms-fieldset legend {
    float: none;
    width: auto;
    margin-bottom: .75rem;
    padding: 0 .55rem;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--theme-primary, #2563eb);
    background: color-mix(in srgb, #fff 72%, var(--theme-primary-soft, rgba(37,99,235,.14)));
    border-radius: 999px;
}

.pmms-fieldset .form-label {
    font-size: .78rem;
    font-weight: 700;
    color: #475569;
}

.pmms-fieldset .form-text {
    font-size: .72rem;
}

/* Dashboard DataTable current workweek label. */
.dashboard-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

.dashboard-workweek-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(37, 99, 235, .10);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, .20);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .01em;
    padding: .28rem .65rem;
    white-space: nowrap;
}

/* Issues and Concerns: keep long issue text readable in DataTables. */
table.dataTable.datatable th.issue-wrap-cell,
table.dataTable.datatable td.issue-wrap-cell {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 220px;
    max-width: 420px;
    text-align: left !important;
}


.issue-table-filter-card .form-label {
    margin-bottom: .35rem;
}

.issue-sort-buttons .btn {
    border-radius: 999px !important;
    font-weight: 700;
    margin-right: .35rem;
    margin-bottom: .35rem;
}

.issue-sort-buttons .btn.active {
    color: #fff;
    background: var(--theme-primary, #377f6b);
    border-color: var(--theme-primary, #377f6b);
}

.issues-table td[data-order] {
    white-space: nowrap;
    font-weight: 600;
}

/* Equipment Dashboard grand total highlight. */
.equipment-project-statistics-table th.grand-total-header,
.equipment-type-statistics-table th.grand-total-header,
.equipment-project-statistics-table td.grand-total-cell,
.equipment-type-statistics-table td.grand-total-cell {
    font-weight: 800 !important;
}

.equipment-project-statistics-table td.grand-total-cell,
.equipment-type-statistics-table td.grand-total-cell {
    background: #fff3cd !important;
    border-left: 2px solid #ffc107 !important;
    border-right: 2px solid #ffc107 !important;
}


/* Sidebar logo integration */
.brand-box-logo {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: .55rem;
    padding: .10rem 0 .90rem;
    margin-bottom: .70rem;
    text-align: center;
}
.sidebar-brand-logo {
    width: 176px;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    margin: 0 auto;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}
.sidebar-modules-title {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .65rem;
    color: #e2e8f0;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.sidebar-modules-title::before,
.sidebar-modules-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(226,232,240,.28);
}
body.layout-compact .sidebar-brand-logo { width: 156px; }
body.sidebar-light .sidebar-brand-logo {
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, .22));
}



/* Login logo image override */
.login-logo-image {
    width: min(235px, 78%);
    height: auto;
    padding: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
    display: block;
    margin: 0 auto 1rem;
}
.login-logo-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}
body.layout-compact .login-logo-image {
    width: min(210px, 74%);
}



/* Dashboard: larger percentage bars for better visualization. */
.dashboard-status-progress {
    height: .72rem;
    margin-top: .95rem;
}
.dashboard-tab-content table.datatable .percent-cell-td,
.dashboard-tab-content table.datatable.compact-progress-table .percent-cell-td,
.dashboard-tab-content .project-details-table .percent-cell-td,
.dashboard-tab-content .dashboard-accomplishment-table .percent-cell-td {
    min-width: 190px !important;
    width: 190px !important;
}
.dashboard-tab-content table.datatable .percent-bar-cell,
.dashboard-tab-content table.datatable.compact-progress-table .percent-bar-cell,
.dashboard-tab-content .project-details-table .percent-bar-cell,
.dashboard-tab-content .dashboard-accomplishment-table .percent-bar-cell {
    min-width: 170px !important;
    gap: .28rem !important;
}
.dashboard-tab-content table.datatable .percent-track,
.dashboard-tab-content table.datatable.compact-progress-table .percent-track,
.dashboard-tab-content .project-details-table .percent-track,
.dashboard-tab-content .dashboard-accomplishment-table .percent-track {
    width: 150px !important;
    height: .82rem !important;
}
.dashboard-tab-content table.datatable .percent-label,
.dashboard-tab-content table.datatable.compact-progress-table .percent-label,
.dashboard-tab-content .project-details-table .percent-label,
.dashboard-tab-content .dashboard-accomplishment-table .percent-label {
    font-size: .82rem !important;
    font-weight: 800 !important;
}
body.layout-compact .dashboard-tab-content table.datatable .percent-cell-td,
body.layout-compact .dashboard-tab-content table.datatable.compact-progress-table .percent-cell-td {
    min-width: 160px !important;
    width: 160px !important;
}
body.layout-compact .dashboard-tab-content table.datatable .percent-track,
body.layout-compact .dashboard-tab-content table.datatable.compact-progress-table .percent-track {
    width: 128px !important;
    height: .74rem !important;
}


/* Web Settings: lock/unlock topbar while scrolling vertically. */
body.topbar-locked .topbar {
    position: sticky;
    top: .85rem;
    z-index: 1040;
}
body.layout-compact.topbar-locked .topbar {
    top: .65rem;
}

/* Sidebar module grouping sections. */
.sidebar-section-title {
    margin: .95rem .25rem .35rem;
    color: rgba(226, 232, 240, .72);
    font-size: .70rem;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: .55rem;
}
.sidebar-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(226, 232, 240, .20);
}
body.sidebar-light .sidebar-section-title {
    color: #64748b;
}
body.sidebar-light .sidebar-section-title::after {
    background: #e2e8f0;
}

/* Activity Logs: keep cyber security log details readable. */
table.dataTable.cyber-security-log-table th.security-wrap-cell,
table.dataTable.cyber-security-log-table td.security-wrap-cell {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 180px;
    max-width: 360px;
    text-align: left !important;
}


/* Dashboard Main Dashboard: larger weekly increase/variance indicators below percentage bars. */
.dashboard-tab-content table.datatable .percent-bar-with-trend,
.dashboard-tab-content table.datatable.compact-progress-table .percent-bar-with-trend,
.dashboard-tab-content .dashboard-accomplishment-table .percent-bar-with-trend {
    gap: .34rem !important;
    align-items: center !important;
}
.dashboard-tab-content table.datatable .percent-bar-with-trend .trend-inline,
.dashboard-tab-content table.datatable.compact-progress-table .percent-bar-with-trend .trend-inline,
.dashboard-tab-content .dashboard-accomplishment-table .percent-bar-with-trend .trend-inline {
    width: 150px !important;
    max-width: 150px !important;
    min-height: 1.35rem !important;
    font-size: .82rem !important;
    font-weight: 900 !important;
    padding: .22rem .45rem !important;
    letter-spacing: .01em;
}
.dashboard-tab-content table.datatable .percent-bar-with-trend .trend-inline i,
.dashboard-tab-content table.datatable.compact-progress-table .percent-bar-with-trend .trend-inline i,
.dashboard-tab-content .dashboard-accomplishment-table .percent-bar-with-trend .trend-inline i {
    font-size: .92rem !important;
}
body.layout-compact .dashboard-tab-content table.datatable .percent-bar-with-trend .trend-inline,
body.layout-compact .dashboard-tab-content table.datatable.compact-progress-table .percent-bar-with-trend .trend-inline {
    width: 128px !important;
    max-width: 128px !important;
    min-height: 1.22rem !important;
    font-size: .74rem !important;
    padding: .18rem .34rem !important;
}


/* Dashboard embedded Project Summary action. */
.dashboard-summary-btn {
    white-space: nowrap;
    font-weight: 700;
}
.dashboard-accomplishment-table td:last-child,
.dashboard-accomplishment-table th:last-child {
    text-align: center;
    vertical-align: middle;
}

/* Ensure SweetAlert status and error dialogs stay above Bootstrap modals, fixed topbar, and DataTables controls. */
.swal2-container {
    z-index: 30000 !important;
}
.swal2-html-container .csv-error-list {
    text-align: left;
}

/* Main Dashboard: Schedule Actual % now includes weekly increase. */
.dashboard-accomplishment-table td:nth-child(4) .percent-bar-with-trend {
    min-width: 170px;
}
.dashboard-accomplishment-table td:nth-child(4) .trend-inline {
    background: rgba(55, 127, 107, .10);
    border-color: rgba(55, 127, 107, .25);
}

/* Mobile-responsive application shell and dashboard visualization. */
.sidebar-mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: .9rem;
    flex: 0 0 auto;
}
.sidebar-mobile-backdrop {
    display: none;
}

@media (max-width: 992px) {
    html, body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-shell {
        display: block;
        min-height: 100vh;
    }

    .sidebar-mobile-toggle {
        display: inline-flex;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: min(86vw, 320px) !important;
        height: 100vh !important;
        max-height: 100vh;
        overflow-y: auto;
        border-radius: 0 1.25rem 1.25rem 0 !important;
        transform: translateX(-105%);
        transition: transform .22s ease-in-out;
        z-index: 1055;
        padding: .95rem;
        box-shadow: 16px 0 40px rgba(15, 23, 42, .28);
    }

    body.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-mobile-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .54);
        z-index: 1050;
        backdrop-filter: blur(2px);
    }

    body.sidebar-mobile-open .sidebar-mobile-backdrop {
        display: block;
    }

    .sidebar-nav {
        display: block !important;
    }

    .sidebar-nav .nav-link {
        padding: .72rem .85rem;
        border-radius: .9rem;
        font-size: .92rem;
    }

    .sidebar-brand-logo,
    body.layout-compact .sidebar-brand-logo {
        width: 142px;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100%;
        padding: .75rem !important;
    }

    .content-wrap {
        padding-bottom: 1rem;
    }

    .topbar {
        position: sticky;
        top: .5rem;
        z-index: 1000;
        padding: .75rem !important;
        border-radius: 1rem !important;
        align-items: flex-start !important;
        gap: .75rem !important;
    }

    .topbar-title-wrap {
        min-width: 0;
        flex: 1 1 auto;
        align-items: flex-start !important;
    }

    .topbar-system-title {
        font-size: clamp(.92rem, 3.4vw, 1.15rem) !important;
        line-height: 1.2;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .topbar-user {
        flex: 0 0 auto;
        max-width: 42%;
        gap: .45rem !important;
    }

    .topbar-user-name {
        font-size: .86rem !important;
        max-width: 118px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-user-role {
        font-size: .72rem;
        max-width: 118px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-user .user-placeholder {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .nav-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: .4rem;
        padding-bottom: .35rem;
        -webkit-overflow-scrolling: touch;
    }

    .nav-pills .nav-link {
        white-space: nowrap;
        font-size: .86rem;
        padding: .5rem .75rem;
        border-radius: 999px;
    }

    .dashboard-status-overview {
        --bs-gutter-x: .65rem;
        --bs-gutter-y: .65rem;
    }

    .dashboard-status-card {
        min-height: 126px;
        padding: .9rem;
        border-radius: 1rem;
    }

    .dashboard-status-icon {
        width: 34px;
        height: 34px;
        font-size: 1.05rem;
        border-radius: .8rem;
    }

    .dashboard-status-label {
        font-size: .62rem;
        padding-right: 38px;
    }

    .dashboard-status-value {
        font-size: clamp(1.25rem, 6vw, 1.85rem);
    }

    .dashboard-status-caption {
        font-size: .68rem;
    }

    .dashboard-chart-box {
        height: 260px;
    }

    .card-soft,
    .stat-card {
        border-radius: 1rem;
    }

    .card-soft .card-header {
        padding: .75rem .85rem;
        font-size: .93rem;
        line-height: 1.25;
    }

    .card-body {
        padding: .8rem !important;
    }

    .dashboard-table-header {
        align-items: flex-start;
        gap: .4rem;
    }

    .dashboard-workweek-badge {
        margin-left: 0;
        font-size: .68rem;
        padding: .22rem .5rem;
    }

    .dt-container .row,
    div.dt-container div.dt-layout-row {
        gap: .45rem;
    }

    div.dt-container div.dt-layout-cell,
    div.dt-container div.dt-search,
    div.dt-container div.dt-length,
    div.dt-container div.dt-info,
    div.dt-container div.dt-paging {
        text-align: left !important;
        width: 100%;
    }

    div.dt-container div.dt-search input {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: .25rem;
    }

    div.dt-container div.dt-length select {
        min-width: 80px;
    }

    .table-responsive {
        border-radius: .9rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table th,
    .table td {
        font-size: .82rem;
        padding: .52rem .5rem;
    }

    table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
    table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
        padding-left: 2rem !important;
    }

    table.dataTable.datatable td.child ul.dtr-details > li {
        display: grid;
        grid-template-columns: minmax(95px, 34%) 1fr;
        gap: .5rem;
    }

    table.dataTable.datatable td.child .dtr-title {
        min-width: 0;
    }

    .dashboard-tab-content table.datatable .percent-cell-td,
    .dashboard-tab-content table.datatable.compact-progress-table .percent-cell-td,
    .dashboard-tab-content .dashboard-accomplishment-table .percent-cell-td {
        min-width: 148px !important;
        width: 148px !important;
    }

    .dashboard-tab-content table.datatable .percent-bar-cell,
    .dashboard-tab-content table.datatable.compact-progress-table .percent-bar-cell,
    .dashboard-tab-content .dashboard-accomplishment-table .percent-bar-cell {
        min-width: 136px !important;
    }

    .dashboard-tab-content table.datatable .percent-track,
    .dashboard-tab-content table.datatable.compact-progress-table .percent-track,
    .dashboard-tab-content .dashboard-accomplishment-table .percent-track {
        width: 118px !important;
        height: .72rem !important;
    }

    .dashboard-tab-content table.datatable .percent-bar-with-trend .trend-inline,
    .dashboard-tab-content table.datatable.compact-progress-table .percent-bar-with-trend .trend-inline,
    .dashboard-tab-content .dashboard-accomplishment-table .percent-bar-with-trend .trend-inline {
        width: 104px !important;
        max-width: 104px !important;
        font-size: .72rem !important;
    }

    .modal-dialog,
    .modal-xl,
    .modal-lg {
        max-width: calc(100vw - 1rem) !important;
        margin: .5rem auto;
    }

    .modal-content {
        border-radius: 1rem;
    }

    .modal-header,
    .modal-footer {
        padding: .75rem .9rem;
    }

    .modal-body {
        padding: .9rem;
        max-height: calc(100vh - 9rem);
        overflow-y: auto;
    }

    .pmms-fieldset,
    .schedule-fieldset {
        padding: .8rem .75rem .9rem;
        border-radius: .85rem;
    }

    .gantt-scroll {
        overflow-x: auto;
        border: 1px solid #e2e8f0;
        border-radius: .9rem;
        padding: .65rem;
        background: #fff;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: .55rem !important;
    }

    .topbar {
        flex-wrap: wrap;
    }

    .topbar-user {
        width: 100%;
        max-width: none;
        justify-content: flex-end;
    }

    .topbar-user-name,
    .topbar-user-role {
        max-width: 220px;
    }

    .dashboard-chart-box {
        height: 300px;
    }

    .stat-card {
        min-height: 104px;
        padding: .9rem;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .dt-admin-column-grid,
    .module-grid {
        grid-template-columns: 1fr;
    }

    table.dataTable.datatable td.child ul.dtr-details > li {
        grid-template-columns: 1fr;
    }

    .btn,
    .form-control,
    .form-select {
        font-size: .9rem;
    }

    .dashboard-summary-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 992px) {
    .topbar {
        position: relative;
        top: auto;
    }
    body.topbar-locked .topbar {
        position: sticky;
        top: .5rem;
    }
}

/* Searchable dropdown support */
.pmms-choices .choices__inner {
    min-height: calc(1.5em + .75rem + 2px);
    border-radius: .5rem;
    border-color: #dee2e6;
    background-color: #fff;
}
.pmms-choices.is-focused .choices__inner,
.pmms-choices.is-open .choices__inner {
    border-color: var(--theme-primary, #377f6b);
    box-shadow: 0 0 0 .2rem rgba(55, 127, 107, .14);
}
.pmms-choices .choices__list--dropdown,
.pmms-choices .choices__list[aria-expanded] {
    z-index: 2055;
    border-radius: .65rem;
    box-shadow: 0 16px 34px rgba(15, 23, 42, .16);
}
.modal .pmms-choices { margin-bottom: 0; }
.pmms-dt-processing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .75rem 1rem;
    font-weight: 700;
    color: var(--theme-primary, #377f6b);
}


/* Searchable select fields */
.pmms-choices,
.choices.pmms-choices {
    width: 100%;
    margin-bottom: 0;
}
.pmms-choices .choices__inner {
    min-height: calc(2.25rem + 2px);
    border-radius: .5rem;
    border-color: #dee2e6;
    background-color: #fff;
}
.pmms-choices .choices__list--dropdown,
.pmms-choices .choices__list[aria-expanded] {
    z-index: 2055;
}
.pmms-choices .choices__input--cloned {
    min-width: 100% !important;
}
.pmms-choices.is-disabled .choices__inner,
.pmms-choices.is-disabled .choices__input {
    background-color: #e9ecef;
    color: #6c757d;
}

/* Built-in searchable select fallback: works without external CDN libraries. */
select.pmms-select-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    left: -9999px !important;
}
.pmms-search-select {
    position: relative;
    width: 100%;
}
.pmms-search-control {
    position: relative;
}
.pmms-search-input {
    padding-right: 2.15rem !important;
    cursor: text;
}
.pmms-search-select.is-disabled .pmms-search-input {
    background-color: #e9ecef;
    opacity: 1;
    cursor: not-allowed;
}
.pmms-search-caret {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: .85rem;
    pointer-events: none;
}
.pmms-search-dropdown {
    position: absolute;
    z-index: 2055;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d7dee8;
    border-radius: .75rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .16);
    padding: .35rem;
}
.pmms-search-option {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    color: #1f2937;
    text-align: left;
    padding: .52rem .65rem;
    border-radius: .55rem;
    font-size: .92rem;
    line-height: 1.2;
}
.pmms-search-option:hover,
.pmms-search-option:focus,
.pmms-search-option.is-selected {
    background: var(--theme-primary-soft, rgba(37,99,235,.12));
    color: var(--theme-primary, #2563eb);
    outline: none;
}
.pmms-search-empty {
    padding: .65rem .75rem;
    color: #64748b;
    font-size: .88rem;
}
.modal .pmms-search-dropdown {
    z-index: 2065;
}


/* Hide custom searchable-select controls while SweetAlert is visible. This prevents open select search boxes from appearing above success/error dialogs. */
html.pmms-swal-active .pmms-search-select,
body.pmms-swal-active .pmms-search-select,
html.swal2-shown .pmms-search-select,
body.swal2-shown .pmms-search-select {
    visibility: hidden !important;
    pointer-events: none !important;
}
.swal2-container .pmms-search-select {
    visibility: visible !important;
    pointer-events: auto !important;
}
html.pmms-swal-active .pmms-search-dropdown,
body.pmms-swal-active .pmms-search-dropdown,
html.swal2-shown .pmms-search-dropdown,
body.swal2-shown .pmms-search-dropdown {
    display: none !important;
}


/* Administrator per-table DataTable processing mode selector. */
.dt-admin-server-control {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: .9rem;
    padding: .65rem;
}
.dt-admin-server-control select {
    max-width: 240px;
}

/* Issues and Concerns status statistic controls */
.issue-status-stat-card .issue-status-stat {
    border-radius: 999px;
    font-weight: 700;
}
.issue-status-stat-card .issue-status-stat.active {
    background: var(--theme-primary, #377f6b);
    color: #fff;
    border-color: var(--theme-primary, #377f6b);
}
.issue-status-stat-card .issue-status-stat.active .badge {
    background: #fff !important;
    color: var(--theme-primary, #377f6b) !important;
}

/* Dashboard: Upgrading Projects major equipment energization table. */
.upgrading-projects-equipment-table {
    border-collapse: collapse !important;
    width: 100% !important;
    font-size: .82rem;
}

.upgrading-projects-equipment-table th,
.upgrading-projects-equipment-table td {
    border: 1px solid #111827 !important;
    vertical-align: middle !important;
    text-align: center !important;
    padding: .38rem .45rem !important;
}

.upgrading-projects-equipment-table .upgrading-projects-title {
    background: #000 !important;
    color: #fff !important;
    font-size: .92rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-align: center !important;
}

.upgrading-projects-equipment-table .upgrading-projects-static-head,
.upgrading-projects-equipment-table .upgrading-projects-metric-head {
    background: #d9f0ce !important;
    color: #000 !important;
    font-weight: 800 !important;
}

.upgrading-projects-equipment-table .upgrading-projects-energization-head {
    background: #f6ddcf !important;
    color: #000 !important;
    font-weight: 900 !important;
}

.upgrading-projects-equipment-table .upgrading-projects-energization-head span {
    color: #d40000;
    font-size: .76rem;
    font-style: italic;
    font-weight: 800;
}

.upgrading-projects-equipment-table .upgrading-projects-total-cell {
    background: #fff200 !important;
    color: #000 !important;
    font-weight: 900 !important;
}

.upgrading-projects-equipment-table .project-id-cell {
    min-width: 190px;
    white-space: normal !important;
}

.upgrading-projects-percent-wrap {
    display: grid;
    grid-template-columns: minmax(72px, 1fr) auto;
    gap: .45rem;
    align-items: center;
    min-width: 130px;
}

.upgrading-projects-progress {
    height: 17px;
    background: #e0f2fe;
    border: 1px solid #0ea5e9;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.65);
    overflow: hidden;
}

.upgrading-projects-progress span {
    display: block;
    height: 100%;
    max-width: 100%;
    background: linear-gradient(90deg, #16c784 0%, #22c55e 45%, #bae6fd 100%);
}

.upgrading-projects-equipment-table .upgrading-projects-percent-cell strong {
    font-weight: 900;
    white-space: nowrap;
}

.upgrading-projects-equipment-table tfoot th {
    background: #f8fafc !important;
    font-weight: 900 !important;
}

.upgrading-projects-equipment-table tfoot .dashboard-grand-energized {
    background: #d9f0ce !important;
}

.upgrading-projects-footer-grand {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.15;
}

.upgrading-projects-footer-grand span {
    font-size: .72rem;
    font-weight: 800;
}

.upgrading-projects-footer-grand strong {
    font-size: .96rem;
    font-weight: 900;
}

.upgrading-projects-footer-grand small {
    color: #475569;
    font-size: .68rem;
    font-weight: 800;
}


/* Update: align Project Details percentage bars with Dashboard percentage bar sizing. */
.project-details-table .percent-cell-td,
table.project-details-table.compact-progress-table .percent-cell-td {
    min-width: 190px !important;
    width: 190px !important;
}
.project-details-table .percent-bar-cell,
table.project-details-table.compact-progress-table .percent-bar-cell {
    min-width: 170px !important;
    gap: .28rem !important;
}
.project-details-table .percent-track,
table.project-details-table.compact-progress-table .percent-track {
    width: 150px !important;
    height: .82rem !important;
}
.project-details-table .percent-label,
table.project-details-table.compact-progress-table .percent-label {
    font-size: .82rem !important;
    font-weight: 800 !important;
}
.project-details-table .percent-bar-with-trend .trend-inline,
table.project-details-table.compact-progress-table .percent-bar-with-trend .trend-inline {
    width: 150px !important;
    max-width: 150px !important;
    font-size: .7rem !important;
    padding: .12rem .28rem !important;
}
.pmms-long-textarea {
    min-height: 180px;
    resize: vertical;
}


/* Dashboard Equipment table project-id grouping row. */
.dashboard-equipment-project-group td {
    background: #e8f5ef !important;
    color: #123c34 !important;
    border-top: 2px solid #377f6b !important;
    border-bottom: 1px solid #b7d8cd !important;
    letter-spacing: .02em;
}

.user-placeholder.border-0 { display: inline-flex; align-items: center; justify-content: center; }
.sidebar-nav button.nav-link { color: inherit; }
.sidebar-nav button.nav-link:hover, .sidebar-nav button.nav-link:focus { color: inherit; }

/* PMMS polished detail view modal */
.view-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .75rem;
}
.view-detail-item {
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: .85rem;
    padding: .75rem .85rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 6px 14px rgba(15, 23, 42, .05);
    min-height: 74px;
}
.view-detail-label {
    font-size: .72rem;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: .35rem;
}
.view-detail-value {
    font-size: .95rem;
    font-weight: 500;
    color: #0f172a;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}
.currency-mask {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* View modals now mirror the grouped edit-modal layout while remaining read-only. */
.pmms-view-form {
    display: block;
}

.pmms-view-fieldset:last-child {
    margin-bottom: 0 !important;
}

.pmms-view-control {
    min-height: 38px;
    height: auto;
    background: #fff;
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
    overflow-wrap: anywhere;
    white-space: normal;
}

.pmms-view-textarea {
    min-height: 92px;
    line-height: 1.45;
}

.pmms-view-control .badge {
    font-size: .78rem;
}

.pmms-view-form .form-label {
    margin-bottom: .35rem;
}

/* Theme-based grouped modal panels - applied globally to all add/edit/view modals. */
.modal .pmms-fieldset,
.modal .schedule-fieldset,
.modal .project-fieldset,
.modal .pmms-view-fieldset {
    border: 1px solid color-mix(in srgb, var(--theme-primary, #2563eb) 36%, #94a3b8);
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--theme-primary-soft, rgba(37,99,235,.14)) 74%, #dbeafe 26%),
            color-mix(in srgb, var(--theme-primary, #2563eb) 18%, #e2e8f0 82%)
        );
    box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 10px 24px rgba(15,23,42,.075);
}

.modal .pmms-fieldset legend,
.modal .schedule-fieldset legend,
.modal .project-fieldset legend,
.modal .pmms-view-fieldset legend {
    color: color-mix(in srgb, var(--theme-primary, #2563eb) 84%, #0f172a);
    background:
        linear-gradient(135deg,
            color-mix(in srgb, #ffffff 62%, var(--theme-primary-soft, rgba(37,99,235,.14)) 38%),
            color-mix(in srgb, #ffffff 52%, var(--theme-primary, #2563eb) 10%, #e2e8f0 38%)
        );
    border: 1px solid color-mix(in srgb, var(--theme-primary, #2563eb) 22%, #cbd5e1);
}

.modal .pmms-fieldset .form-control,
.modal .pmms-fieldset .form-select,
.modal .schedule-fieldset .form-control,
.modal .schedule-fieldset .form-select,
.modal .project-fieldset .form-control,
.modal .project-fieldset .form-select,
.modal .pmms-view-fieldset .pmms-view-control {
    background-color: rgba(255,255,255,.92);
}

/* Energization sequence modal */
.energization-sequence-table th,
.energization-sequence-table td {
    vertical-align: middle;
}
.energization-sequence-table .sequence-input {
    text-align: center;
    font-weight: 700;
}

.energization-sequence-modal-wide,
.modal-dialog.pmms-modal-wide {
    max-width: min(98vw, 1680px);
}

.energization-sequence-table input[type="date"] {
    min-width: 148px;
}

.energization-sequence-table .form-text {
    font-size: .68rem;
    line-height: 1.15;
}

/* Energization sequence modal status controls */
.energization-sequence-table tr.sequence-row-energized > td {
    background-color: #d1e7dd !important;
}
.energization-sequence-table tr.sequence-row-energized:hover > td {
    background-color: #c3dfd4 !important;
}

.energization-sequence-table tr.sequence-row-scheduled > td {
    background-color: #fff3cd !important;
}
.energization-sequence-table tr.sequence-row-scheduled:hover > td {
    background-color: #ffe9a8 !important;
}
.energization-sequence-table tr.sequence-row-nonenergized .sequence-input[readonly] {
    background-color: #f8fafc !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
}
.energization-sequence-table .sequence-status-select {
    min-width: 205px;
    font-size: .78rem;
}
.energization-sequence-table .sequence-row-energized .sequence-status-select {
    border-color: #75b798;
    box-shadow: 0 0 0 .1rem rgba(25,135,84,.08);
}
.energization-sequence-table .sequence-row-scheduled .sequence-status-select {
    border-color: #ffda6a;
    box-shadow: 0 0 0 .1rem rgba(255,193,7,.12);
}
.energization-sequence-table .sequence-days-remaining {
    min-width: 120px;
    font-size: .78rem;
}


/* Update: align weekly increase indicators with accomplishment bar lengths on Dashboard and Project Details. */
.dashboard-tab-content .dashboard-accomplishment-table .percent-bar-with-trend .trend-inline,
.dashboard-tab-content table.datatable.compact-progress-table .percent-bar-with-trend .trend-inline,
.project-details-table .percent-bar-with-trend .trend-inline,
table.project-details-table.compact-progress-table .percent-bar-with-trend .trend-inline {
    width: 150px !important;
    max-width: 150px !important;
}
body.layout-compact .dashboard-tab-content .dashboard-accomplishment-table .percent-bar-with-trend .trend-inline,
body.layout-compact .dashboard-tab-content table.datatable.compact-progress-table .percent-bar-with-trend .trend-inline {
    width: 128px !important;
    max-width: 128px !important;
}

/* Update: longer status remarks boxes in project, equipment, and budget modals. */
.pmms-long-textarea {
    min-height: 180px;
    resize: vertical;
}


.energization-sequence-table .sequence-view-remarks-btn {
    min-width: 82px;
}
.sequence-remarks-viewer {
    white-space: pre-wrap;
    max-height: 360px;
    overflow: auto;
    background: #f8fafc;
    border: 1px solid #dbe3ef;
    border-radius: 0.75rem;
    padding: 1rem;
    line-height: 1.45;
}
.schedule-activities-table a.btn-outline-primary[href=""] {
    pointer-events: none;
}
.schedule-activities-table button.pmms-schedule-edit-btn,
.schedule-activities-table .pmms-schedule-edit-btn {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative;
    z-index: 3;
}


.documents-status-tile { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.documents-status-tile:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1rem rgba(15, 23, 42, .12); }
.schedule-tagged-drawings-cell { min-width: 180px; max-width: 360px; white-space: normal; }

/* Update: tagged drawings are shown only on actual activities and must wrap cleanly. */
.schedule-tagged-drawings-cell {
    min-width: 220px;
    max-width: 430px;
    white-space: normal !important;
}
.schedule-drawing-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .35rem;
    align-items: flex-start;
}
.schedule-drawing-badge-link {
    display: inline-flex;
    max-width: 100%;
}
.schedule-drawing-status-badge {
    display: inline-block;
    white-space: normal;
    text-align: left;
    line-height: 1.2;
    max-width: 260px;
    padding: .42rem .58rem;
}


/* Update: schedule tagged drawing badges are centered, light colored, and clickable. */
.schedule-tagged-drawings-cell {
    text-align: center !important;
    vertical-align: middle !important;
    min-width: 240px;
    max-width: 460px;
    white-space: normal !important;
}
.schedule-drawing-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .32rem .42rem;
    align-items: center;
    justify-content: center;
}
.schedule-drawing-status-badge.schedule-drawing-view-btn {
    border: 1px solid rgba(15, 23, 42, .12);
    box-shadow: 0 .15rem .35rem rgba(15, 23, 42, .06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
    max-width: 275px;
    padding: .44rem .62rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.schedule-drawing-status-badge.schedule-drawing-view-btn:hover,
.schedule-drawing-status-badge.schedule-drawing-view-btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 .35rem .75rem rgba(15, 23, 42, .12);
    border-color: rgba(15, 23, 42, .22);
}
.pmms-drawing-badge-approved {
    background: #dcfce7 !important;
    color: #166534 !important;
}
.pmms-drawing-badge-review {
    background: #fef9c3 !important;
    color: #854d0e !important;
}
.pmms-drawing-badge-comments {
    background: #dbeafe !important;
    color: #1e40af !important;
}
.pmms-drawing-badge-action {
    background: #fee2e2 !important;
    color: #991b1b !important;
}
.pmms-drawing-badge-neutral {
    background: #f1f5f9 !important;
    color: #334155 !important;
}

/* Update: equipment energization sequence details now show SEIL-tagged drawing documents with light status colors. */
.sequence-equipment-details-viewer .pmms-fieldset,
.sequence-drawing-tags-view .pmms-fieldset {
    text-align: left;
}
.sequence-drawing-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .45rem;
    align-items: center;
    justify-content: center;
    margin-bottom: .35rem;
}
.sequence-drawing-status-badge {
    border: 1px solid rgba(15, 23, 42, .12);
    box-shadow: 0 .12rem .28rem rgba(15, 23, 42, .06);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
    max-width: 280px;
    padding: .45rem .65rem;
    font-weight: 700;
}
.sequence-drawing-status-text {
    display: block;
    margin-top: .12rem;
    font-size: .72rem;
    font-weight: 600;
    opacity: .82;
}
.sequence-drawing-detail-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: .75rem;
}
.sequence-drawing-detail-card {
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .78);
    padding: .85rem;
    box-shadow: 0 .2rem .65rem rgba(15, 23, 42, .06);
}


.pmms-project-id-group-row td,
.dashboard-equipment-project-group td {
    background: linear-gradient(90deg, rgba(0, 128, 96, 0.15), rgba(0, 128, 96, 0.05)) !important;
    color: var(--pmms-theme-700, #075e54) !important;
    border-top: 2px solid rgba(0, 128, 96, 0.25) !important;
}

/* PMMS Data Assistant Chatbox */
.pmms-chatbox {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1060;
    font-size: 0.92rem;
}
.pmms-chatbox-toggle {
    border: 0;
    border-radius: 999px;
    padding: 0.8rem 1rem;
    background: linear-gradient(135deg, var(--pmms-primary, #0d6efd), #0b5ed7);
    color: #fff;
    box-shadow: 0 12px 30px rgba(13, 110, 253, 0.28);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}
.pmms-chatbox-toggle i { font-size: 1.2rem; }
.pmms-chatbox-panel {
    width: min(440px, calc(100vw - 32px));
    height: min(620px, calc(100vh - 90px));
    background: #fff;
    border-radius: 1.35rem;
    box-shadow: 0 18px 55px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    border: 1px solid rgba(13, 110, 253, 0.18);
    display: flex;
    flex-direction: column;
}
.pmms-chatbox-header {
    background: linear-gradient(135deg, var(--pmms-primary, #0d6efd), #084298);
    color: #fff;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.pmms-chatbox-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem;
    background: linear-gradient(180deg, #f8fbff, #eef4ff);
}
.pmms-chat-message {
    display: flex;
    margin-bottom: 0.85rem;
}
.pmms-chat-message.user { justify-content: flex-end; }
.pmms-chat-message.bot { justify-content: flex-start; }
.pmms-chat-bubble {
    max-width: 92%;
    border-radius: 1rem;
    padding: 0.8rem 0.9rem;
    line-height: 1.35;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
.pmms-chat-message.user .pmms-chat-bubble {
    background: var(--pmms-primary, #0d6efd);
    color: #fff;
    border-bottom-right-radius: 0.25rem;
}
.pmms-chat-message.bot .pmms-chat-bubble {
    background: #fff;
    color: #1f2937;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-bottom-left-radius: 0.25rem;
}
.pmms-chatbox-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    background: #fff;
}
.pmms-chatbox-form .form-control {
    border-radius: 999px;
}
.pmms-chatbox-form .btn {
    border-radius: 999px;
    min-width: 44px;
}
.pmms-chatbox-hints {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    padding: 0 0.85rem 0.85rem;
    background: #fff;
}
.pmms-chatbox-hints button {
    border: 1px solid rgba(13, 110, 253, 0.22);
    background: #eef5ff;
    color: #0b5ed7;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
}
.pmms-chat-answer-title {
    font-weight: 800;
    color: #0b3d91;
    margin-bottom: 0.55rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.pmms-chat-project-header {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.09), rgba(13, 110, 253, 0.02));
    border: 1px solid rgba(13, 110, 253, 0.14);
    border-radius: 0.85rem;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.75rem;
}
.pmms-chat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin-bottom: 0.7rem;
}
.pmms-chat-metric {
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0.85rem;
    padding: 0.65rem;
    min-width: 0;
}
.pmms-chat-metric span {
    display: block;
    color: #64748b;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.pmms-chat-metric strong {
    display: block;
    color: #0f172a;
    font-size: 0.98rem;
    word-break: break-word;
}
.pmms-chat-subtitle {
    font-weight: 700;
    margin: 0.7rem 0 0.35rem;
    color: #334155;
}
.pmms-chat-list {
    padding-left: 1.1rem;
    margin-bottom: 0;
}
.pmms-chat-list li { margin-bottom: 0.35rem; }
.pmms-chat-note {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 0.85rem;
    padding: 0.7rem;
}
.pmms-chat-typing {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #64748b;
}
.pmms-chat-typing span {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: #94a3b8;
    animation: pmms-chat-blink 1s infinite ease-in-out;
}
.pmms-chat-typing span:nth-child(2) { animation-delay: .15s; }
.pmms-chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes pmms-chat-blink {
    0%, 80%, 100% { opacity: .25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}
@media (max-width: 575.98px) {
    .pmms-chatbox { right: 12px; left: 12px; bottom: 12px; }
    .pmms-chatbox-panel { width: 100%; }
    .pmms-chatbox-toggle { width: 100%; justify-content: center; }
}

/* Project ID + Substation DataTable grouping */
.pmms-project-substation-group-row td {
    cursor: pointer;
    background: linear-gradient(90deg, rgba(0, 128, 96, 0.18), rgba(0, 128, 96, 0.07)) !important;
    color: var(--pmms-theme-700, #075e54) !important;
    border-top: 2px solid rgba(0, 128, 96, 0.30) !important;
    border-bottom: 1px solid rgba(0, 128, 96, 0.16) !important;
    padding: .7rem .9rem !important;
}
.pmms-group-toggle-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
}
.pmms-group-static-icon {
    width: 1.3rem;
    height: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(0, 128, 96, .20);
}
.pmms-grouped-project-substation tbody tr:not(.pmms-project-substation-group-row) td {
    transition: background-color .15s ease-in-out;
}

/* Dashboard - Project Highlights sub-module */
.project-highlights-hero {
    border: 1px solid rgba(234, 179, 8, .18);
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
}
.project-highlight-stat {
    min-height: 148px;
}
.project-highlight-feed {
    display: grid;
    gap: .8rem;
    max-height: 390px;
    overflow-y: auto;
    padding-right: .25rem;
}
.project-highlight-feed-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .8rem;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: #fff;
}
.project-highlight-feed-icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: .85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.project-highlight-activity-cell {
    min-width: 280px;
    white-space: normal;
}
/* Dashboard lazy loading optimization */
.dashboard-startup-note {
    background: linear-gradient(135deg, rgba(13, 110, 253, .08), rgba(25, 135, 84, .06));
}
.dashboard-lazy-tabs .dashboard-lazy-placeholder,
.dashboard-lazy-loading {
    min-height: 260px;
}
.dashboard-lazy-loading .spinner-border {
    width: 2.75rem;
    height: 2.75rem;
}
.dashboard-lazy-nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}


/* Dashboard module tabs - compact, light appearance */
.dashboard-module-tabs,
.dashboard-lazy-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .38rem;
    padding: .55rem;
    border: 1px solid #e2e8f0;
    border-radius: .85rem;
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .035);
}
.dashboard-module-tabs .nav-item,
.dashboard-lazy-nav .nav-item {
    margin: 0;
}
.dashboard-module-tabs .nav-link,
.dashboard-lazy-nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    border: 1px solid #dbe4ef;
    background: #ffffff;
    color: #475569;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.15;
    border-radius: 999px;
    padding: .42rem .72rem;
    box-shadow: 0 2px 7px rgba(15, 23, 42, .035);
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
.dashboard-module-tabs .nav-link i,
.dashboard-lazy-nav .nav-link i {
    font-size: .92rem;
}
.dashboard-module-tabs .nav-link:hover,
.dashboard-lazy-nav .nav-link:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 118, 110, .35);
    color: var(--pmms-theme-700, #075e54);
    background: #f9fffd;
    box-shadow: 0 5px 12px rgba(15, 23, 42, .06);
}
.dashboard-module-tabs .nav-link.active,
.dashboard-lazy-nav .nav-link.active {
    background: var(--pmms-theme-600, #0f766e);
    border-color: var(--pmms-theme-600, #0f766e);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(15, 118, 110, .18);
}
.dashboard-module-tabs .nav-link[data-dashboard-lazy-url]::after,
.dashboard-lazy-nav .nav-link[data-dashboard-lazy-url]::after {
    content: none !important;
    display: none !important;
}

/* Current workweek issue/activity monitoring additions */
.issue-followup-stat .stat-label,
.project-highlight-stat .stat-label {
    letter-spacing: .025em;
}
.pmms-preline {
    white-space: pre-line;
}

/* Select2 multi-select tags/chips for Issues Responsible Group */
.issue-responsible-group-select + .select2-container,
.pmms-select2-multi + .select2-container {
    width: 100% !important;
}
.select2-container--bootstrap-5 .select2-selection--multiple,
.select2-container--default .select2-selection--multiple {
    min-height: 42px;
    border-color: #ced4da;
    border-radius: 0.55rem;
    padding: 0.25rem 0.35rem;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice,
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    border: 1px solid rgba(35, 106, 92, 0.22);
    background: rgba(35, 106, 92, 0.10);
    color: #1f4d45;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    margin-top: 0.25rem;
    font-size: 0.84rem;
    font-weight: 600;
}
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove,
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #6c757d;
    margin-right: 0.35rem;
    border: 0;
}
.select2-dropdown.pmms-select2-dropdown {
    z-index: 2000;
}

/* Read-only responsible group tags in Issue view modal */
.pmms-view-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.pmms-view-tag {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    border: 1px solid rgba(35, 106, 92, 0.22);
    background: rgba(35, 106, 92, 0.10);
    color: #1f4d45;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.2;
    word-break: break-word;
}

/* Daily Project Inspection Log report-style view and compact filters */
.inspection-filter-card .form-label {
    margin-bottom: .25rem;
}
.inspection-activity-cell {
    min-width: 260px;
    max-width: 520px;
    white-space: normal;
    word-break: break-word;
}
.inspection-report-view {
    background: #ffffff;
    border: 1px solid #d7e3ea;
    border-radius: 16px;
    padding: 1rem;
}
.inspection-report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    border-bottom: 2px solid #0d6b62;
    padding-bottom: .75rem;
    margin-bottom: 1rem;
}
.inspection-report-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #123b45;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.inspection-report-date {
    border: 1px solid #b9d6d2;
    background: #eefaf8;
    color: #0d6b62;
    border-radius: 999px;
    padding: .35rem .75rem;
    font-weight: 700;
    white-space: nowrap;
}
.inspection-report-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .65rem;
    margin-bottom: 1rem;
}
.inspection-report-grid > div {
    border: 1px solid #e0eaef;
    border-radius: 12px;
    padding: .65rem .75rem;
    background: #f8fbfc;
}
.inspection-report-grid span {
    display: block;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6b7c88;
    font-weight: 700;
    margin-bottom: .2rem;
}
.inspection-report-grid strong {
    display: block;
    color: #243746;
    font-size: .92rem;
}
.inspection-report-section {
    border: 1px solid #e0eaef;
    border-radius: 14px;
    margin-top: .85rem;
    overflow: hidden;
}
.inspection-report-section h6 {
    margin: 0;
    background: #eaf7f4;
    color: #0d6b62;
    font-weight: 800;
    padding: .55rem .75rem;
    border-bottom: 1px solid #d4e8e4;
}
.inspection-report-activities {
    padding: .85rem;
    min-height: 90px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.45;
}
.inspection-photo-grid {
    padding: .85rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: .85rem;
}
.inspection-photo-card {
    border: 1px solid #d7e3ea;
    border-radius: 12px;
    padding: .45rem;
    margin: 0;
    background: #ffffff;
}
.inspection-photo-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 9px;
    display: block;
}
.inspection-photo-card figcaption {
    font-size: .72rem;
    color: #637381;
    margin-top: .35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 768px) {
    .inspection-report-grid {
        grid-template-columns: 1fr;
    }
    .inspection-report-header {
        flex-direction: column;
    }
}

/* Daily Project Inspection photo management, full-picture viewer, and PDF support */
.inspection-full-photo-preview {
    padding: .85rem;
    border-bottom: 1px solid #e0eaef;
    background: #f8fbfc;
}
.inspection-full-photo-toolbar {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    align-items: center;
    margin-bottom: .6rem;
    flex-wrap: wrap;
}
.inspection-full-photo-preview img {
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
    background: #0f172a;
    border-radius: 12px;
    display: block;
}
.inspection-photo-card.inspection-photo-select {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid #d7e3ea;
    cursor: pointer;
}
.inspection-photo-card.inspection-photo-select span {
    display: block;
    font-size: .72rem;
    color: #637381;
    margin-top: .35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.inspection-photo-card.inspection-photo-select.is-selected {
    border-color: #0d6b62;
    box-shadow: 0 0 0 3px rgba(13, 107, 98, .12);
}
.inspection-existing-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .75rem;
}
.inspection-existing-photo-item {
    border: 1px solid #d7e3ea;
    border-radius: 12px;
    padding: .45rem;
    background: #fff;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .4rem .55rem;
    align-items: center;
    cursor: pointer;
}
.inspection-existing-photo-item img {
    grid-column: 1 / -1;
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 9px;
    background: #f1f5f9;
}
.inspection-existing-photo-item span {
    font-size: .72rem;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.inspection-existing-photo-item em {
    font-style: normal;
    font-size: .72rem;
    color: #b42318;
    font-weight: 700;
}
@media (max-width: 768px) {
    .inspection-full-photo-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
    .inspection-full-photo-preview img {
        max-height: 58vh;
    }
}

/* User Management - Project-Based Personnel assignments */
.project-assignment-row .select2-container,
.user-project-assignment-select + .select2-container {
    width: 100% !important;
}
.assigned-projects-cell {
    white-space: normal !important;
    min-width: 260px;
    max-width: 520px;
}
.assigned-project-chip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    align-items: flex-start;
}
.assigned-project-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: .18rem .45rem;
    border-radius: 999px;
    background: #eef8f4;
    border: 1px solid #bee3d6;
    color: #245d4e;
    font-size: .75rem;
    font-weight: 600;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}
.project-based-personnel-table td,
.project-based-personnel-table th {
    vertical-align: middle;
}

/* Issues and Concerns table tag/wrap refinements */
.issues-table td,
.issues-table th {
    white-space: normal !important;
    vertical-align: middle !important;
}
.issues-table .responsible-group-cell,
.pmms-table-tags {
    white-space: normal !important;
}
.pmms-table-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .28rem;
    align-items: center;
    justify-content: center;
    max-width: 100%;
}
.pmms-table-tag {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    border-radius: 999px;
    border: 1px solid rgba(35, 106, 92, .24);
    background: rgba(35, 106, 92, .10);
    color: #1f4d45;
    padding: .16rem .5rem;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.issue-status-tabs {
    gap: .35rem;
}
.issue-status-tabs .nav-link {
    border: 1px solid rgba(15, 118, 110, .18);
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
    padding: .38rem .75rem;
    border-radius: 999px;
}
.issue-status-tabs .nav-link.active {
    background: var(--pmms-theme-600, #0f766e);
    color: #fff;
    border-color: var(--pmms-theme-600, #0f766e);
}
.dashboard-issue-tile {
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.dashboard-issue-tile:hover,
.dashboard-issue-tile.active {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .10);
    outline: 2px solid rgba(15, 118, 110, .22);
}
.project-details-module-tabs .nav-link {
    font-size: .9rem;
    font-weight: 800;
}
.project-warranty-field:disabled {
    cursor: not-allowed;
}

.weekly-recipient-sections{display:flex;flex-wrap:wrap;gap:.25rem .5rem;min-width:260px}.weekly-section-mini{display:inline-flex;align-items:center;font-size:.76rem;line-height:1.2;border:1px solid #dbe4ea;border-radius:999px;background:#f8fafc;padding:.22rem .55rem;white-space:nowrap}.weekly-section-mini .form-check-input{margin-top:0}.project-details-module-tabs,.budget-module-tabs{gap:.4rem}.issue-wrap-cell,.responsible-group-cell,.assigned-projects-cell{white-space:normal!important;word-break:break-word}.pmms-table-tags{display:flex;flex-wrap:wrap;gap:.25rem}.pmms-table-tag{display:inline-flex;align-items:center;border:1px solid #d6e4ef;background:#f8fbfd;border-radius:999px;padding:.15rem .45rem;font-size:.75rem;line-height:1.1}

/* Project Equipment Pivot Table and Pivot Chart */
.equipment-module-tabs{gap:.4rem}
.pivot-designer-grid{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:.75rem}
.pivot-filter-grid{display:grid;grid-template-columns:repeat(4,minmax(180px,1fr));gap:.75rem;padding-top:.75rem;border-top:1px solid #e7edf2}
.pivot-table-shell{max-height:620px;overflow:auto}
.equipment-pivot-table{min-width:680px;font-size:.78rem;margin-bottom:0}
.equipment-pivot-table th,.equipment-pivot-table td{padding:.35rem .5rem;white-space:nowrap;text-align:right;vertical-align:middle}
.equipment-pivot-table thead th{position:sticky;top:0;z-index:2;background:#eef4f7;color:#1f3a4a;text-align:center}
.equipment-pivot-table th:first-child,.equipment-pivot-table tbody th{text-align:left;position:sticky;left:0;z-index:1;background:#f8fafc;max-width:250px;white-space:normal;word-break:break-word}
.equipment-pivot-table thead th:first-child{z-index:3;background:#e5eef3}
.equipment-pivot-table .pivot-grand-total,.equipment-pivot-table .pivot-grand-total-row th,.equipment-pivot-table .pivot-grand-total-row td{font-weight:700;background:#edf6ef}
.pivot-chart-shell{height:520px;min-height:380px;position:relative}
.weekly-report-recipient-table.dataTable textarea{min-width:190px}
.weekly-report-recipient-table.dataTable .weekly-recipient-sections{min-width:230px}
@media (max-width:1199.98px){.pivot-designer-grid{grid-template-columns:repeat(3,minmax(160px,1fr))}.pivot-filter-grid{grid-template-columns:repeat(2,minmax(180px,1fr))}.pivot-chart-shell{height:420px}}
@media (max-width:767.98px){.pivot-designer-grid,.pivot-filter-grid{grid-template-columns:1fr}.pivot-chart-shell{height:360px}.equipment-pivot-table{font-size:.72rem}}

/* Equipment Pivot checkbox multi-select filters */
.pivot-checkbox-filter .dropdown{width:100%}
.pivot-checkbox-filter-button{display:flex;align-items:center;justify-content:space-between;gap:.5rem;min-height:31px;background:#fff;color:#334155;border-color:#cbd5e1}
.pivot-checkbox-filter-button .pivot-checkbox-filter-label{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pivot-checkbox-filter-menu{min-width:100%;max-width:420px;border:1px solid #d7e1e8;box-shadow:0 12px 30px rgba(15,23,42,.14)}
.pivot-checkbox-filter-options{max-height:280px;overflow:auto;padding:.35rem}
.pivot-checkbox-option{display:flex;align-items:flex-start;gap:.55rem;width:100%;padding:.42rem .5rem;margin:0;border-radius:.4rem;cursor:pointer;color:#334155;font-size:.82rem;line-height:1.25;white-space:normal}
.pivot-checkbox-option:hover{background:#f1f5f9}
.pivot-checkbox-option .form-check-input{flex:0 0 auto;margin-top:.12rem}
.pivot-checkbox-option span{min-width:0;word-break:break-word}
.pivot-checkbox-all{font-weight:700;border-bottom:1px solid #e5eaf0;border-radius:0;margin-bottom:.25rem;padding-bottom:.55rem}
.pivot-checkbox-filter-search{min-width:180px}

/* Dashboard Project Accomplishment status tabs */
.dashboard-project-status-tabs{gap:.35rem;flex-wrap:wrap}
.dashboard-project-status-tabs .nav-link{border:1px solid rgba(15,118,110,.18);background:#f8fafc;color:#334155;font-size:.8rem;font-weight:700;padding:.36rem .72rem;border-radius:999px}
.dashboard-project-status-tabs .nav-link.active{background:var(--pmms-theme-600,#0f766e);border-color:var(--pmms-theme-600,#0f766e);color:#fff;box-shadow:0 4px 12px rgba(15,118,110,.18)}

/* User Management - module action permissions */
.user-module-permissions-shell {
    border: 1px solid #dbe7ef;
    border-radius: 14px;
    overflow: auto;
    background: #fff;
}
.user-module-permissions-table {
    margin-bottom: 0;
    min-width: 620px;
}
.user-module-permissions-table thead th {
    background: #eef7f6;
    color: #214e48;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .02em;
    white-space: nowrap;
}
.user-module-permissions-table td,
.user-module-permissions-table th {
    vertical-align: middle;
}
.user-module-permissions-table .module-permission-disabled td {
    background: #f8fafc;
}
.user-module-permissions-table .module-permission-checkbox:disabled {
    cursor: not-allowed;
    opacity: .45;
}
@media (max-width: 768px) {
    .user-module-permissions-table {
        font-size: .82rem;
    }
}

/* Project Equipment status filter badges */
.equipment-status-filter-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: center;
}
.equipment-status-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    border-radius: 999px;
    font-weight: 700;
}
.equipment-status-filter-badge.active {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}
.equipment-status-filter-badge.active .badge,
.equipment-status-filter-badge.active .text-bg-light {
    background: rgba(255,255,255,.92) !important;
    color: #0f172a !important;
}

/* Test Forms module */
.test-form-stat-card {
    min-height: 104px;
}

.test-form-search {
    width: min(320px, 100%);
}

.test-form-description-preview {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.test-form-description-full {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.empty-state > i {
    display: inline-grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: var(--theme-primary-soft, rgba(37,99,235,.14));
    color: var(--theme-primary, #2563eb);
    font-size: 1.7rem;
}

.test-form-detail-grid > div {
    padding: .85rem;
    border: 1px solid #e2e8f0;
    border-radius: .9rem;
    background: #f8fafc;
}

.detail-label {
    color: #64748b;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: .25rem;
}

.detail-value {
    color: #1e293b;
    font-weight: 600;
}

@media (max-width: 768px) {
    .test-form-search {
        width: 100%;
    }
}
