/* Phase 2: scoped, responsive operational workspace. No external dependencies. */
.phase1-admin .p2 { --p2-blue:#0876e8; --p2-navy:#12334f; --p2-muted:#627790; --p2-line:#e1eaf3; color:#142e48; min-width:0; }
.p2 [hidden], .p2-pane[hidden] { display:none !important; }
.p2 *, .p2 *::before, .p2 *::after { box-sizing:border-box; }
.p2 .p2-head { display:flex; justify-content:space-between; align-items:center; gap:20px; margin:0 0 22px; }
.p2 .p2-eyebrow { font-size:10px; font-weight:800; color:#6d8aa6; letter-spacing:.12em; margin-bottom:7px; }
.p2 h1 { font-size:28px; line-height:1.2; font-weight:800; margin:0 0 7px; color:#103552; }
.p2 h2 { font-size:18px; line-height:1.35; font-weight:750; margin:0; color:#163b5c; }
.p2 h3 { font-size:16px; font-weight:750; margin:0 0 10px; color:#163b5c; }
.p2 p { line-height:1.5; }
.p2 .p2-head p { margin:0; color:var(--p2-muted); font-size:14px; }
.p2 .p2-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.p2 button, .p2 a.p2-button { cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:7px; border:1px solid #d8e5f2; border-radius:8px; min-height:38px; padding:8px 12px; background:#fff; color:#1763a1; font-size:13px; font-weight:650; text-decoration:none; line-height:1.25; }
.p2 button:hover { background:#edf6ff; border-color:#a8ceee; }
.p2 button:disabled { cursor:not-allowed; opacity:.48; }
.p2 button.p2-primary, .p2 .so-primary { background:var(--p2-blue); border-color:var(--p2-blue); color:white; box-shadow:0 3px 8px #0472e31a; }
.p2 button.p2-primary:hover { background:#086bd0; }
.p2 .p2-danger { color:#bb3242; background:#fff6f6; border-color:#f1cdd2; }
.p2 .p2-good { color:#087745; background:#ebfbf3; border-color:#b6e5d0; }
.p2 .p2-icon { display:inline-flex; width:18px; height:18px; flex:0 0 auto; }
.p2 .p2-icon svg { width:100%; height:100%; }
.p2 .p2-card, .p2 .card { background:#fff; border:1px solid var(--p2-line); border-radius:12px; padding:20px; margin:0; box-shadow:0 2px 5px #29486804; min-width:0; }
.p2 .p2-card + .p2-card, .p2-pane > .card + .card { margin-top:14px; }
.p2 .p2-section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.p2 .p2-sub { display:block; font-size:12px; font-weight:400; color:var(--p2-muted); line-height:1.45; margin-top:4px; }
.p2 .p2-muted { color:var(--p2-muted); font-size:13px; }
.p2 .p2-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:0 0 18px; }
.p2 .p2-kpi { background:#fff; border:1px solid var(--p2-line); border-radius:10px; padding:17px 18px; display:flex; align-items:flex-start; gap:12px; min-width:0; }
.p2 .p2-kpi > .p2-icon { padding:10px; width:43px; height:43px; border-radius:12px; background:#e9f3ff; color:#0876e8; }
.p2 .p2-kpi:nth-child(2)> .p2-icon { color:#129766; background:#e8f8f0; }
.p2 .p2-kpi:nth-child(3)> .p2-icon { color:#a96b0b; background:#fff5df; }
.p2 .p2-kpi:nth-child(4)> .p2-icon { color:#7753d2; background:#f1edfc; }
.p2 .p2-kpi span:not(.p2-icon) { font-size:12px; color:var(--p2-muted); }
.p2 .p2-kpi strong { display:block; font-size:24px; line-height:1.4; color:#123858; font-weight:800; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.p2 .p2-tabs { display:flex; align-items:center; gap:5px; border-bottom:1px solid var(--p2-line); margin:0 0 20px; padding:0 0 1px; overflow:auto; scrollbar-width:thin; }
.p2 .p2-tabs button { border:0; border-bottom:3px solid transparent; border-radius:7px 7px 0 0; padding:11px 15px; color:#62748b; white-space:nowrap; background:none; }
.p2 .p2-tabs button[aria-selected=true], .p2 .p2-tabs button.active { color:#056edf; border-bottom-color:#0876e8; background:#f5faff; }
.p2 .p2-count { border-radius:5px; padding:2px 6px; background:#edf2f7; font-size:11px; margin-left:3px; }
.p2 .p2-filters { display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end; margin-bottom:17px; }
.p2 label { display:flex; flex-direction:column; gap:6px; font-size:12px; font-weight:650; color:#3b5673; min-width:0; }
.p2 .p2-filters label { flex:1 1 125px; }
.p2 .p2-filters label.p2-search { flex:2 1 215px; }
.p2 input, .p2 select, .p2 textarea { min-height:39px; width:100%; max-width:100%; border:1px solid #d6e3f0; border-radius:7px; padding:8px 10px; color:#183b5c; background:#fff; font:inherit; font-size:13px; }
.p2 input[type=checkbox] { width:17px; height:17px; min-height:17px; flex:none; }
.p2 input:focus, .p2 select:focus, .p2 textarea:focus { outline:2px solid #1d8efa66; outline-offset:1px; }
.p2 button:focus-visible, .p2 a:focus-visible, .p2 summary:focus-visible { outline:3px solid #1686ef; outline-offset:3px; }
.p2 .p2-split { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(305px,1fr); gap:18px; align-items:start; }
.p2 .p2-split.p2-wide-list { grid-template-columns:minmax(0,1.85fr) minmax(300px,1fr); }
.p2 .p2-split > * { min-width:0; }
.p2 .p2-detail { position:sticky; top:82px; }
.p2 .p2-detail > .p2-card { padding:20px; }
.p2 .p2-table-wrap { overflow-x:auto; border:1px solid #e8eef6; border-radius:9px; }
.p2 table { width:100%; min-width:0; border-collapse:collapse; font-size:13px; }
.p2 table th { background:#f2f6fb; color:#304d6d; font-size:11px; text-align:left; padding:11px 10px; font-weight:750; white-space:nowrap; border:0; }
.p2 table td { border:0; border-bottom:1px solid #edf2f8; padding:11px 10px; vertical-align:middle; color:#2f4867; line-height:1.4; }
.p2 table tr:last-child td { border-bottom:0; }
.p2 table tbody tr:hover { background:#f6faff; }
.p2 table tr.p2-selected { background:#edf6ff; }
.p2 table .p2-row-title { border:0; background:transparent; padding:0; min-height:30px; justify-content:flex-start; text-align:left; font-weight:700; color:#066fce; overflow-wrap:anywhere; }
.p2 table .p2-num { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.p2 .p2-badge { display:inline-flex; align-items:center; border-radius:6px; padding:4px 7px; color:#466484; background:#eef3f8; font-size:11px; font-weight:650; line-height:1.3; }
.p2 .p2-badge.good { background:#e5f8ee; color:#0a7748; }
.p2 .p2-badge.warn { background:#fff3d9; color:#925b0b; }
.p2 .p2-badge.bad { background:#ffecee; color:#b93045; }
.p2 .p2-badge.blue { background:#e7f2ff; color:#176ebf; }
.p2 .p2-avatar { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border-radius:50%; color:#1477c5; background:#e9f3ff; font-size:12px; font-weight:800; flex:none; }
.p2 .p2-person { display:flex; align-items:center; gap:9px; }
.p2 .p2-avatar-large { width:54px; height:54px; border-radius:15px; font-size:19px; }
.p2 .p2-detail-top { display:flex; align-items:center; gap:13px; margin-bottom:18px; }
.p2 .p2-info { display:grid; grid-template-columns:minmax(95px,.75fr) minmax(0,1.25fr); gap:0; margin:12px 0; font-size:13px; }
.p2 .p2-info dt, .p2 .p2-info dd { margin:0; padding:10px 0; border-bottom:1px solid #eff3f8; }
.p2 .p2-info dt { color:#6c7d94; }
.p2 .p2-info dd { color:#264865; font-weight:600; overflow-wrap:anywhere; padding-left:12px; }
.p2 .p2-note { padding:13px 15px; border-radius:8px; font-size:12px; line-height:1.6; margin:14px 0; background:#eff7ff; color:#356389; border:1px solid #d7eaff; }
.p2 .p2-warning { background:#fff8e9; color:#875a12; border-color:#f4e2b9; }
.p2 .p2-empty { padding:38px 22px; text-align:center; color:#748aa1; font-size:13px; line-height:1.65; }
.p2 .p2-empty .p2-icon { display:block; width:34px; height:34px; margin:0 auto 12px; color:#9db6ce; }
.p2 .p2-pagination { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-top:14px; color:#687f96; font-size:12px; }
.p2 .p2-pagination > div { display:flex; gap:6px; }
.p2 .p2-pagination button { min-width:35px; min-height:33px; padding:5px 10px; }
.p2 .p2-timeline { margin:15px 0; padding-left:15px; border-left:2px solid #dfebf7; }
.p2 .p2-timeline p { margin:0 0 15px; position:relative; font-size:13px; }
.p2 .p2-timeline p::before { content:''; position:absolute; width:8px; height:8px; border-radius:50%; background:#398ada; left:-20px; top:6px; }
.p2 .p2-detail-money { font-size:28px; color:#0875d9; line-height:1.3; font-weight:800; margin:15px 0; }
.p2 #so-message:empty, .p2 #p2-message:empty { display:none; }
.p2 #so-message, .p2 #p2-message { margin:0 0 15px; padding:13px; border-radius:8px; background:#edf8f1; color:#276747; }
.p2 #so-message.so-error, .p2 #p2-message.error { background:#fff0f1; color:#b13348; }
.p2 .p2-preview-file { background:#f2f5f8; border:1px solid #e1e8f0; border-radius:9px; margin:15px 0; padding:10px; overflow:hidden; }
.p2 .p2-preview-file img { display:block; width:100%; max-height:420px; object-fit:contain; }
.p2 .p2-preview-file iframe { display:block; width:100%; height:440px; border:0; background:white; }
.p2 .p2-file-list article { display:flex; gap:12px; align-items:center; justify-content:space-between; padding:14px 0; border-bottom:1px solid #ebf1f7; }
.p2 .p2-file-list article > div { min-width:0; overflow-wrap:anywhere; }
.p2 .p2-pane { display:block; min-width:0; }
.p2 .p2-pane > .card { margin:0 0 16px; }
.p2 details.card > summary { cursor:pointer; font-weight:700; color:#376083; list-style-position:inside; }
.p2 details.card[open] > summary { margin-bottom:16px; }
.p2 .p2-grid2 { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.p2 .p2-settings-layout { display:grid; grid-template-columns:210px minmax(0,1fr); gap:20px; align-items:start; }
.p2 .p2-settings-nav { position:sticky; top:82px; padding:10px; }
.p2 .p2-settings-nav button { width:100%; justify-content:flex-start; padding:12px; border:0; font-size:13px; margin:2px 0; color:#58718c; background:white; }
.p2 .p2-settings-nav button.active { color:#056fe3; background:#eaf4ff; }
.p2 .p2-settings-nav p { padding:8px; font-size:11px; color:#71869d; line-height:1.6; }
.p2 .p2-settings-body .grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-bottom:16px; }
.p2 .p2-settings-body h3, .p2 .p2-settings-body h4 { margin-bottom:15px; }
.p2 .p2-settings-body .muted { font-size:12px; line-height:1.6; }
.p2 .p2-settings-body .lang-switch { display:flex; gap:8px; }
.p2 .p2-settings-brand { display:flex; gap:16px; align-items:center; }
.p2 .p2-settings-brand img { width:55px; height:55px; }
.p2 .p2-settings-brand strong { font-size:23px; color:#113b5b; }
.p2 .p2-mini-bars { display:flex; align-items:flex-end; gap:8px; height:120px; padding:12px 0 0; }
.p2 .p2-mini-bars > div { flex:1; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:5px; min-width:0; }
.p2 .p2-mini-bars i { display:block; background:linear-gradient(#65b0ff,#1381ed); min-height:2px; width:75%; border-radius:4px 4px 0 0; }
.p2 .p2-mini-bars small { font-size:10px; color:#7387a0; }
.p2 .p2-mini-bars b { font-size:10px; color:#385c7e; font-weight:600; }
.p2 .p2-checkline { display:flex; justify-content:space-between; gap:14px; align-items:center; padding:12px 0; border-bottom:1px solid #edf2f7; font-size:13px; }
.p2 .p2-progress { height:6px; border-radius:99px; overflow:hidden; background:#e9f0f6; margin:8px 0 16px; }
.p2 .p2-progress > i { display:block; height:100%; background:#278be7; }
.p2 .p2-reports .rep-print-area { margin-top:15px; }
.p2 .p2-reports .row, .p2 .p2-pane .row { gap:9px; flex-wrap:wrap; }
.p2 .p2-legacy-details { display:grid; gap:16px; }
.phase1-admin #docs-review .modal-panel, .phase1-admin #accounting-dialog { border:1px solid #dce8f3; border-radius:14px; color:#244766; }
.phase1-admin #accounting-dialog::backdrop { background:#10294466; }
.phase1-admin #accounting-dialog input,.phase1-admin #accounting-dialog select,.phase1-admin #accounting-dialog textarea { border:1px solid #d7e4f0; border-radius:7px; }
.p2 .p2-dirty { color:#9b660c; background:#fff6df; border:1px solid #f0dbaa; border-radius:7px; padding:9px 12px; font-size:12px; margin-bottom:14px; }
@media(min-width:1700px){ .p2 .p2-split { grid-template-columns:minmax(0,2fr) minmax(350px,1fr); } }
@media(max-width:1150px){ .p2 .p2-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); } .p2 .p2-split,.p2 .p2-split.p2-wide-list { grid-template-columns:minmax(0,1fr); } .p2 .p2-detail { position:static; } .p2 .p2-settings-layout { grid-template-columns:175px minmax(0,1fr); } }
@media(max-width:700px){
 .p2 .p2-head { align-items:flex-start; flex-direction:column; gap:14px; margin-bottom:18px; }
 .p2 h1 { font-size:24px; } .p2 .p2-kpi { padding:12px; gap:9px; } .p2 .p2-kpi strong { font-size:21px; } .p2 .p2-kpi>.p2-icon { width:34px; height:34px; padding:7px; }
 .p2 .p2-card,.p2 .card { padding:15px; border-radius:10px; } .p2 .p2-filters { gap:10px; }
 .p2 .p2-table-wrap { overflow-x:auto; } .p2 table th, .p2 table td { padding:9px 8px; font-size:12px; }
 .p2 table .p2-mobile-hide { display:none; }
 .p2 .p2-settings-layout { grid-template-columns:1fr; gap:12px; }
 .p2 .p2-settings-nav { position:static; display:flex; overflow:auto; gap:5px; padding:6px; }
 .p2 .p2-settings-nav button { width:auto; white-space:nowrap; flex:none; } .p2 .p2-settings-nav p { display:none; }
 .p2 .p2-settings-body .grid,.p2 .p2-grid2 { grid-template-columns:1fr; }
 .p2 .p2-tabs { margin-bottom:14px; } .p2 .p2-tabs button { padding:11px; font-size:12px; }
 .p2 .p2-actions button { min-height:40px; } .p2 .p2-file-list article { align-items:flex-start; flex-direction:column; }
 .p2 .p2-person { gap:6px; } .p2 .p2-avatar { width:28px; height:28px; font-size:10px; }
 .p2 .p2-pagination { flex-wrap:wrap; } .p2 .p2-preview-file iframe { height:340px; }
 .p2 .p2-settings-body table input { min-width:125px; }
}
@media(prefers-reduced-motion:reduce){ .p2 * { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
@media print { .p2 .p2-actions,.p2 .p2-filters,.p2 .p2-tabs,.p2 .p2-settings-nav { display:none!important; } .p2 .p2-split { display:block; } .p2 .p2-card { break-inside:avoid; box-shadow:none; } .p2 .p2-detail { position:static; } }

/* Compatibility with legacy utility selectors; preserve accessible hidden states. */
body.phase1-admin .p2 [hidden] { display:none!important; }
body.phase1-admin .p2 .p2-settings-body .grid { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
.p2 #p2-doc-tools { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-bottom:16px; align-items:start; }
.p2 #p2-doc-tools > details[open] { grid-column:1/-1; }
.p2 #doc-message:empty { display:none; }
.p2 #doc-message:not(:empty) { grid-column:1/-1; }
body.phase1-admin .p2 .chart-track > i { background:linear-gradient(90deg,#399bf2,#086edf)!important; }
@media(max-width:850px){ .p2 #p2-doc-tools { grid-template-columns:1fr; } }
@media(max-width:700px){ body.phase1-admin .p2 .p2-settings-body .grid { grid-template-columns:1fr!important; } }
/* Legacy .modal-panel is display:flex; closed native dialogs must leave no overlay. */
body.phase1-admin dialog#p2-dialog:not([open]), body.phase1-admin dialog#accounting-dialog:not([open]) { display:none!important; }
@media(max-width:768px){
 /* Legacy auto-stacked tables contain several siblings in a single cell.
    A vertical flow keeps names and descriptions readable, not clipped off-card. */
 body.phase1-admin .p2 table.stack-table td { display:block; white-space:normal; overflow-wrap:anywhere; max-width:100%; text-align:left; }
 body.phase1-admin .p2 table.stack-table td::before { display:block; margin:0 0 5px; font-size:10px; color:#72869c; }
 body.phase1-admin .p2 table.stack-table td>* { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
 body.phase1-admin .p2 table.stack-table td.p2-mobile-hide { display:none!important; }
}
