/*
 * Business Central Process (BP) design system — shared styles for guided stepper
 * processes such as Project Planner, Project Controller, and Task Controller.
 *
 * STANDARD: All BP step detail views (current and upcoming) should use these
 * tp-* / bcp-* / bvsa-* classes and rely on this global stylesheet instead of
 * inlining a <style> block per component. Loaded globally from _Host.cshtml.
 */

.tp-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    padding: 10px 14px;
    margin: -4px 0 12px;
    background: #f7f9fc;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    font-size: 13px;
    color: #37474f;
}
.tp-meta-item { display: flex; align-items: center; gap: 8px; }
.tp-meta-label { color: #607d8b; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.tp-meta-label i { color: #1976d2; }
.tp-meta-value { font-weight: 600; color: #263238; }
.tp-meta-item-due { margin-left: auto; }
.tp-due-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    line-height: 1.2;
    border: 1px solid transparent;
    white-space: nowrap;
}
.tp-due-ok { background: #e8f5e9; color: #1b5e20; border-color: #c8e6c9; }
.tp-due-warn { background: #fff3e0; color: #e65100; border-color: #ffe0b2; }
.tp-due-danger { background: #ffebee; color: #b71c1c; border-color: #ffcdd2; }
.tp-due-passed { background: #b71c1c; color: #fff; border-color: #b71c1c; text-transform: uppercase; letter-spacing: .5px; }
.tp-due-neutral { background: #eceff1; color: #455a64; border-color: #cfd8dc; }

.tp-lock-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    margin: 0 0 12px;
    background: linear-gradient(135deg, #fff8e1, #fffde7);
    border: 1px solid #ffe082;
    border-radius: 10px;
    color: #6d4c41;
}
.tp-lock-banner > i { font-size: 22px; color: #ef6c00; flex: 0 0 auto; }
.tp-lock-banner .tp-lock-banner-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.tp-lock-banner .tp-lock-banner-text strong { color: #4e342e; font-size: 14px; line-height: 1.3; }
.tp-lock-banner .tp-lock-banner-text span { color: #6d4c41; font-size: 12.5px; line-height: 1.4; }
.tp-lock-banner-warn { background: #fff8e1; border-color: #ffe082; }

.tp-step-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tp-step-nav-btn {
    border: 1px solid #cfd8dc;
    background: #fff;
    color: #455a64;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.tp-step-nav-btn:hover:not(:disabled) { background: #eceff1; }
.tp-step-nav-btn.active {
    background: #1976d2;
    border-color: #1976d2;
    color: #fff;
}
.tp-step-nav-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.bcp-step1-section {
    background: #fff;
    border: 1px solid #e3e8ef;
    border-radius: 12px;
    padding: 14px 16px 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.bcp-step1-section-title {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef1f5;
    font-size: 14px;
    font-weight: 700;
    color: #37474f;
    display: flex;
    align-items: center;
    gap: 8px;
}
.bcp-step1-section-title i { color: #1976d2; }
.tp-required { color: #c62828; font-weight: 700; margin-left: 2px; }

.bcp-form-field-wide { grid-column: 1 / -1; }
.bcp-entries-section { margin-bottom: 16px; }
.bcp-hint { color: #616161; font-size: 14px; margin-bottom: 12px; display: flex; align-items: flex-start; gap: 6px; }
.bcp-hint i { color: #1976d2; margin-top: 2px; }
.bcp-step-setup { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 4px; }
.bcp-form-field { display: flex; flex-direction: column; gap: 6px; }
.bcp-form-field label { font-size: 13px; color: #616161; font-weight: 600; }

.bcp-data-grid { border: 1px solid #e3e8ef; border-radius: 10px; overflow: hidden; }

.tp-review { display: flex; flex-direction: column; gap: 12px; }
.tp-review-card {
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    background: #fff;
    padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.tp-review-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef1f5;
}
.tp-review-card-title {
    font-weight: 600;
    font-size: 14px;
    color: #263238;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tp-review-card-title i { color: #1976d2; }
.tp-review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 16px;
}
.tp-review-field { display: flex; flex-direction: column; gap: 2px; }
.tp-review-field span { color: #607d8b; font-size: 12px; }
.tp-review-field strong { color: #263238; font-size: 14px; }
.tp-review-empty {
    margin: 0;
    color: #607d8b;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tp-mb { margin-bottom: 12px; }
.tp-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* KPI grid (mirrors Baseline-vs-Actual report) */
.bvsa-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    align-items: stretch;
    width: 100%;
}
.bvsa-kpi {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.bvsa-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex: 0 0 auto;
}
.bvsa-kpi-value { font-size: 18px; font-weight: 700; color: #263238; line-height: 1.1; }
.bvsa-kpi-label { font-size: 12px; color: #607d8b; margin-top: 2px; }

.bvsa-badge-ok, .bvsa-badge-bad {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    font-size: 11px;
}
.bvsa-badge-ok { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.bvsa-badge-bad { background: #fafafa; color: #9e9e9e; border: 1px solid #e0e0e0; }

/* MRP coverage pill (in Start Tasks grid) */
.tp-coverage-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 12px;
    border: 1px solid transparent;
    line-height: 1.2;
}
.tp-coverage-pill i { font-size: 11px; }
.tp-coverage-ok { background: #e8f5e9; color: #1b5e20; border-color: #a5d6a7; }
.tp-coverage-warn { background: #fff3e0; color: #ef6c00; border-color: #ffcc80; }
.tp-coverage-bad { background: #ffebee; color: #b71c1c; border-color: #ef9a9a; }
.tp-coverage-na { background: #eceff1; color: #607d8b; border-color: #cfd8dc; }

/* Process dialog modal */
.tp-modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1000001;
    display: flex; align-items: center; justify-content: center;
}
.tp-modal {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 620px;
    width: 96vw;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .18);
    max-height: 92vh;
    overflow-y: auto;
}
.tp-modal-wide { max-width: 900px; }
.tp-modal h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: #263238;
    display: flex; align-items: center; gap: 8px;
}
.tp-modal-hint {
    color: #607d8b;
    font-size: 13px;
    margin: 0 0 14px;
    line-height: 1.5;
}
.tp-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eef1f5;
}
.tp-checkbox-row { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: #263238; }

/* Coverage banner inside dialog */
.tp-coverage-banner {
    display: flex; flex-direction: column; gap: 8px;
    padding: 12px 14px;
    margin: 0 0 14px;
    border-radius: 10px;
    border: 1px solid transparent;
}
.tp-coverage-banner-head {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px;
}
.tp-coverage-banner-head i { font-size: 16px; }
.tp-coverage-banner-pct { margin-left: auto; font-weight: 800; font-size: 18px; }
.tp-coverage-banner-bar {
    width: 100%; height: 8px;
    background: rgba(0, 0, 0, .08);
    border-radius: 999px; overflow: hidden;
}
.tp-coverage-banner-bar-fill { height: 100%; transition: width .3s ease-in-out; }
.tp-coverage-banner-body { font-size: 12.5px; }
.tp-coverage-banner-ok { background: #e8f5e9; border-color: #a5d6a7; color: #1b5e20; }
.tp-coverage-banner-ok .tp-coverage-banner-bar-fill { background: #2e7d32; }
.tp-coverage-banner-warn { background: #fff3e0; border-color: #ffcc80; color: #ef6c00; }
.tp-coverage-banner-warn .tp-coverage-banner-bar-fill { background: #ef6c00; }
.tp-coverage-banner-bad { background: #ffebee; border-color: #ef9a9a; color: #b71c1c; }
.tp-coverage-banner-bad .tp-coverage-banner-bar-fill { background: #c62828; }
.tp-coverage-details { margin-top: 4px; }
.tp-coverage-details summary { cursor: pointer; font-weight: 600; font-size: 12.5px; }
.tp-coverage-list { margin: 6px 0 0; padding-left: 22px; font-size: 12.5px; }
.tp-coverage-list li { margin-bottom: 3px; }
.tp-coverage-list-sub { color: #607d8b; font-weight: 500; margin-left: 4px; font-size: 12px; }

/* ----------------------------------------------------------------------------
   BCP step-detail shell (mirrors BusinessCentralProcessStepDetailView.razor's
   <style>). Exposed globally so non-BusinessCentralProcess BPs that replicate
   the shell (e.g. Site Report, a Document) render identically without rendering
   the shell component itself.
   ------------------------------------------------------------------------- */
.bcp-step-detail.document-detail-full-page {
    display: block;
    min-height: 100vh;
    width: 100%;
    background: #f5f5f5;
    padding-top: 0;
    overflow: visible;
    box-sizing: border-box;
    --header-height: 92px;
}
.bcp-step-detail .document-detail-layout {
    display: flex;
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}
.bcp-step-detail .document-detail-left-column,
.bcp-step-detail .bcp-left-column {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
}
.bcp-step-detail .bcp-step-main-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}
.bcp-step-detail .document-detail-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 24px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}
.bcp-step-detail .document-detail-header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    padding: 0 32px;
}
.bcp-step-detail .document-detail-back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.bcp-step-detail .document-detail-back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}
.bcp-step-detail .document-detail-header-info { flex: 1; }
.bcp-step-detail .document-detail-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.bcp-step-detail .document-detail-header-title i { font-size: 24px; }
.bcp-step-detail .document-detail-header-title h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: white;
}
.bcp-step-detail .document-detail-header-subtitle {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}
.bcp-step-detail .document-detail-header-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}
.bcp-step-detail .bcp-help-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}
.bcp-step-detail .bcp-help-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.28);
}
.bcp-step-detail .document-detail-content {
    flex: 1;
    min-height: 200px;
    padding: 24px 32px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    overflow-x: hidden;
}
.bcp-step-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 32px;
    background: linear-gradient(135deg, #34495e 0%, #3d5a6e 100%);
    color: white;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    flex-wrap: wrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.bcp-step-indicator {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}
.bcp-step-nav-right { display: flex; gap: 8px; }
.bcp-step-nav-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.bcp-step-nav-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); }
.bcp-step-nav-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.bcp-step-nav-btn-next,
.bcp-step-nav-btn-apply {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.35);
}
.bcp-step-nav-btn-next:hover:not(:disabled),
.bcp-step-nav-btn-apply:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
}
.bcp-step-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #212121;
}
.bcp-step-body { margin-bottom: 20px; }
.bcp-step-footer {
    flex-shrink: 0;
    border-top: 1px solid rgba(0,0,0,0.08);
    background: linear-gradient(135deg, #3d5668 0%, #4a6782 100%);
    color: #fff;
    padding: 10px 32px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}
.bcp-step-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    max-width: 100%;
}
.bcp-step-footer-spacer {
    min-width: 1px;
    flex: 0 0 1px;
}
.bcp-step-footer-indicator {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}
.bcp-step-footer-right {
    display: flex;
    gap: 8px;
}
.bcp-step-footer-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 14px;
    font-weight: 500;
}
.bcp-step-footer-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.22); }
.bcp-step-footer-btn:disabled { opacity: 0.5; }
.bcp-step-footer-btn-next,
.bcp-step-footer-btn-apply {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
}
