:root{font-family:Segoe UI,system-ui,sans-serif;line-height:1.5;color:#1a1a2e;background:#f4f6fb}*{box-sizing:border-box}body{margin:0}a{color:#2563eb}.app-shell{display:grid;grid-template-columns:240px 1fr;min-height:100vh}.sidebar{background:#111827;color:#f9fafb;padding:1.5rem 1rem;display:flex;flex-direction:column;position:sticky;top:0;height:100vh;max-height:100vh;overflow-y:auto;align-self:start}.sidebar h1{font-size:1.1rem;margin:0}.brand{display:flex;align-items:center;gap:.6rem;margin-bottom:1rem}.brand img{border-radius:6px}.module-picker{display:flex;flex-direction:column;gap:.5rem;margin-bottom:1.25rem}.module-card{display:flex;flex-direction:column;gap:.15rem;padding:.7rem .85rem;border-radius:10px;border:1px solid #1f2937;background:#0f172a;color:#9ca3af;text-decoration:none;transition:border-color .15s,background .15s,color .15s}.module-card:hover{border-color:#374151;color:#e5e7eb}.module-card.active{border-color:#3b82f6;background:linear-gradient(135deg,#1e3a5f,#111827);color:#fff;box-shadow:inset 3px 0 #3b82f6}.module-card-title{font-size:.88rem;font-weight:700;line-height:1.2}.module-card-sub{font-size:.72rem;opacity:.85}.sidebar-section{padding-top:1rem;border-top:1px solid #1f2937}.sidebar-bottom{flex-shrink:0}.sidebar-spacer{flex:1 1 auto;min-height:0}.module-nav{flex:none}.sidebar-section-label{font-size:.7rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:#6b7280;margin-bottom:.35rem;padding:0 .75rem}.sidebar-section a{display:block;color:#d1d5db;text-decoration:none;padding:.5rem .75rem;border-radius:6px;margin-bottom:.25rem}.sidebar-section a.active,.sidebar-section a:hover{background:#1f2937;color:#fff}.module-switcher{display:flex;gap:.35rem;margin-bottom:1rem;padding:.25rem;background:#0f172a;border-radius:8px}.module-switcher a{flex:1;text-align:center;padding:.45rem .5rem;border-radius:6px;color:#9ca3af;text-decoration:none;font-size:.8rem;font-weight:600}.module-switcher a.active,.module-switcher a:hover{background:#1f2937;color:#fff}.sidebar nav a,.module-nav a{display:block;color:#d1d5db;text-decoration:none;padding:.5rem .75rem;border-radius:6px;margin-bottom:.25rem}.sidebar nav a.active,.sidebar nav a:hover,.module-nav a.active,.module-nav a:hover{background:#1f2937;color:#fff}.sidebar-footer{padding-top:1.5rem}.main{padding:1.5rem 2rem}.card{background:#fff;border-radius:10px;padding:1.25rem;box-shadow:0 1px 3px #00000014;margin-bottom:1rem}table{width:100%;border-collapse:collapse;font-size:.875rem}th,td{border-bottom:1px solid #e5e7eb;padding:.5rem;text-align:left;vertical-align:top}th{background:#f9fafb}tbody td{background:#fff}tbody td.calculated{background:#f3f4f6}input,select,textarea,button{font:inherit}input,select,textarea{width:100%;padding:.4rem .5rem;border:1px solid #d1d5db;border-radius:6px}button{background:#2563eb;color:#fff;border:none;border-radius:6px;padding:.5rem 1rem;cursor:pointer}button.secondary{background:#6b7280}button.danger{background:#dc2626}.form-row{margin-bottom:.75rem}.form-row label{display:block;font-size:.85rem;font-weight:600;margin-bottom:.25rem}.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem}.grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:1rem}@media(max-width:1100px){.grid-4{grid-template-columns:1fr 1fr}.grid-3{grid-template-columns:1fr}}.stat-card h3{margin:0 0 .5rem;font-size:.85rem;color:#6b7280;font-weight:600}.stat-value{font-size:1.75rem;margin:0;font-weight:700}.risk-badge{display:inline-block;min-width:2rem;text-align:center;padding:.15rem .5rem;border-radius:6px;font-weight:700;font-size:.9rem}.risk-low{background:#dcfce7;color:#166534}.risk-medium{background:#fef9c3;color:#854d0e}.risk-high{background:#ffedd5;color:#c2410c}.risk-critical{background:#fee2e2;color:#991b1b}.risk-none{background:#f3f4f6;color:#6b7280}.filter-bar{display:flex;gap:.75rem;align-items:center;flex-wrap:wrap;padding:.75rem 1rem}.filter-bar select{width:auto;min-width:160px}.split-view{display:flex;gap:1rem;align-items:flex-start}.detail-panel{width:420px;max-width:40%;max-height:75vh;overflow:auto;flex-shrink:0}.detail-panel--expanded{width:100%;max-width:none;max-height:none;flex:1;padding-left:1.5rem;padding-right:1.5rem}.detail-panel-header{display:flex;align-items:center;gap:.75rem;margin-bottom:.75rem;flex-wrap:wrap}.detail-panel-header h3{margin:0;flex:1;min-width:0}.detail-panel-header-actions{display:flex;gap:.5rem;align-items:center;flex-shrink:0}.detail-panel--expanded .detail-panel-header,.detail-panel--expanded .detail-panel-body{width:100%;max-width:960px;margin-left:auto;margin-right:auto}.detail-panel-body{max-width:960px}.detail-panel--expanded .risk-multi-select{max-height:16rem}.detail-panel--expanded .text-block{max-height:none}.row-selected td{background:#eff6ff!important}.text-block{white-space:pre-wrap;font-size:.875rem;line-height:1.5;max-height:200px;overflow:auto;padding:.5rem;background:#f9fafb;border-radius:6px}.text-clamp{max-width:280px}.chip-row{display:flex;flex-wrap:wrap;gap:.5rem}.chip{background:#e5e7eb;padding:.35rem .75rem;border-radius:999px;font-size:.85rem}@media(max-width:900px){.split-view{flex-direction:column}.detail-panel{width:100%;max-width:none}.grid-2{grid-template-columns:1fr}}.login-page{min-height:100vh;display:flex;align-items:center;justify-content:center}.login-card{width:400px}.badge{display:inline-block;padding:.15rem .5rem;border-radius:999px;font-size:.75rem;background:#dbeafe;color:#1d4ed8;text-transform:capitalize}.badge-draft{background:#fef3c7;color:#92400e}.badge-in_review{background:#dbeafe;color:#1d4ed8}.badge-approved{background:#dcfce7;color:#166534}.muted{color:#6b7280;font-size:.85rem}.notif-row{display:flex;gap:.5rem;margin-bottom:.5rem}.calculated{background:#f3f4f6;color:#374151}.read-only-banner{display:flex;align-items:center;gap:1rem;flex-wrap:wrap;margin-bottom:1rem;padding:.75rem 1rem;background:#fffbeb;border:1px solid #fcd34d}.nested-card{background:#f9fafb;margin-top:.75rem;padding:1rem}.risk-multi-select-wrap{display:flex;flex-direction:column;gap:.5rem}.risk-multi-select-search{width:100%}.risk-multi-select{display:flex;flex-direction:column;gap:.35rem;max-height:12rem;overflow-y:auto;padding:.5rem;border:1px solid var(--border, #e5e7eb);border-radius:4px;background:#fff}.risk-multi-select-empty{margin:.25rem 0;font-size:.875rem}.risk-multi-select-item{display:flex;flex-direction:row;align-items:flex-start;gap:.6rem;cursor:pointer;font-size:.9rem;padding:.15rem 0}.risk-multi-select-check{flex:0 0 auto;width:1rem;height:1rem;margin:.15rem 0 0;cursor:pointer}.risk-multi-select-label{flex:1;min-width:0;line-height:1.4}.treatment-plan-form,.treatment-plan-fields{margin-top:.5rem}button.link-button{background:none;border:none;color:#2563eb;padding:0;cursor:pointer;font:inherit;text-decoration:underline}.sort-header-wrap{display:inline-flex;align-items:center;gap:.2rem;max-width:100%}.sort-header-label{display:inline-flex;align-items:center;gap:.15rem;font-weight:600;line-height:1.3}.sort-header{display:inline-flex;align-items:center;justify-content:center;background:none;border:none;padding:0;margin:0;font:inherit;color:inherit;cursor:pointer;flex-shrink:0}.sort-header-btn:hover{color:#2563eb}.sort-header-active{color:#1d4ed8}.sort-indicator{font-size:.65rem;opacity:.45;line-height:1}.sort-header-active .sort-indicator{opacity:1}.error{color:#dc2626;margin-top:.5rem}.toolbar{display:flex;gap:.5rem;margin-bottom:1rem;flex-wrap:wrap}.card.table-scroll{padding:0}.table-scroll{overflow:auto;max-height:70vh;position:relative;border:1px solid #e5e7eb;border-radius:8px}.table-scroll table{margin:0;border-collapse:separate;border-spacing:0}.table-scroll thead th{position:sticky;top:0;z-index:2;background-color:#f9fafb;box-shadow:0 1px #e5e7eb}.table-scroll thead th .sort-header-wrap,.table-scroll thead th .sort-header-btn{background-color:#f9fafb}.table-scroll tbody td{background-color:#fff}.table-scroll tbody td.calculated{background-color:#f3f4f6}.table-scroll tbody td select,.table-scroll tbody td input{width:100%;min-width:4.5rem;font-size:.85rem;padding:.35rem 1.75rem .35rem .5rem}.table-scroll tbody td select{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.system-child-row td{background-color:#f8fafc}.system-child-row td.calculated{background-color:#f1f5f9}.system-child-name{padding-left:1.25rem!important}.system-child-label{color:#94a3b8;font-weight:600}.system-parent-row+.system-child-row td{border-top-color:#e2e8f0}.system-actions{white-space:nowrap}.systems-table{table-layout:auto}.systems-table .col-system{min-width:7rem}.systems-table .col-narrow{width:4.75rem;min-width:4.75rem;white-space:nowrap}.systems-table .col-owner{min-width:9rem}.systems-table .col-dependent{min-width:14rem}.systems-table .col-type{min-width:10.5rem}.systems-table .col-classification{min-width:9.5rem}.systems-table .col-backup{min-width:10.5rem}.systems-table .col-time{min-width:11.75rem;width:11.75rem;white-space:nowrap}.systems-table .col-owner select,.systems-table .col-dependent select,.systems-table .col-type select,.systems-table .col-classification select,.systems-table .col-backup select,.systems-table .col-time select{width:100%}.assessment-picker-block{margin-bottom:1rem}.api-keys-panel{margin-top:1.5rem;padding-top:1.25rem;border-top:1px solid #e5e7eb}.api-keys-panel h4{margin:0 0 .5rem}.api-keys-new-key{margin:.75rem 0;padding:.75rem;background:#eff6ff;border:1px solid #bfdbfe;border-radius:8px}.api-keys-new-key code{display:block;word-break:break-all;font-size:.85rem}.api-keys-create{margin:1rem 0}.api-keys-list ul{list-style:none;margin:.75rem 0 0;padding:0}.api-keys-list li{padding:.65rem 0;border-bottom:1px solid #e5e7eb}.api-keys-list-row{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem}.assessment-picker{display:flex;align-items:center;gap:.75rem;margin-bottom:1rem;flex-wrap:wrap}.assessment-picker select{width:auto;min-width:220px}.tabs.sub-tabs{flex-wrap:wrap;margin-bottom:1rem}.tabs.sub-tabs button{font-size:.8rem;padding:.4rem .65rem}.info-tip{position:relative;display:inline-block;vertical-align:middle}.info-tip-trigger{width:1.1rem;height:1.1rem;padding:0;border-radius:50%;font-size:.7rem;font-weight:700;line-height:1;background:#e5e7eb;color:#374151;border:none;cursor:pointer;vertical-align:middle}.info-tip-trigger-active{background:#2563eb;color:#fff}.info-tip-panel{position:fixed;z-index:1000;box-sizing:border-box;width:18rem;max-width:min(18rem,calc(100vw - 24px));padding:.65rem .75rem;background:#111827;color:#f9fafb;border-radius:8px;font-size:.78rem;font-weight:400;line-height:1.45;box-shadow:0 8px 24px #00000040;transform:translate(-50%);pointer-events:auto;white-space:normal;overflow:visible;overflow-wrap:break-word;word-wrap:break-word}.info-tip-panel>div{white-space:normal;overflow-wrap:break-word;word-wrap:break-word}.info-tip-panel strong{display:block;margin-bottom:.35rem;font-size:.82rem}.lookup-list{list-style:none;margin:0;padding:0}.lookup-add-form{display:flex;flex-wrap:wrap;align-items:flex-end;gap:.75rem 1rem;margin-bottom:1rem}.lookup-add-form .form-row{flex:1 1 12rem;min-width:10rem;margin:0}.lookup-add-form .lookup-add-btn{flex:0 0 auto;width:auto;min-width:4.5rem}.lookup-list li{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.5rem 0;border-bottom:1px solid #e5e7eb}.lookup-list li:last-child{border-bottom:none}.table-scroll thead th .info-tip{margin-left:.15rem}.tabs{display:flex;gap:.25rem;margin-bottom:1rem}.tabs button{background:#e5e7eb;color:#374151}.tabs button.active{background:#2563eb;color:#fff}.snapshot-card{border:1px solid #e5e7eb;border-radius:8px;padding:1rem;margin-bottom:.75rem;display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap}.import-data-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:1rem}.import-data-card h3{margin-top:0}.import-data-actions{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-top:1rem}.import-file-label{position:relative;overflow:hidden;cursor:pointer;max-width:100%;text-overflow:ellipsis;white-space:nowrap}.import-file-label input[type=file]{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;cursor:pointer}
