/* Shared sizing for every administration and staff page. */
body.firm-compact{font-family:Arial,sans-serif;font-size:14px;line-height:1.45}
.firm-compact .admin-main{padding:20px 22px;margin-left:290px;min-width:0}
.firm-compact .admin-sidebar{width:290px;border-right-width:3px}
.firm-compact .admin-brand{padding:18px 14px}
.firm-compact .admin-brand-title{font-size:18px;line-height:1.12;letter-spacing:.3px}
.firm-compact .admin-brand-subtitle{font-size:14px}
.firm-compact .admin-menu{padding:14px 12px 24px}
.firm-compact .admin-menu a,.firm-compact .firm-nav-group summary{font-size:14px;padding:10px 12px}
.firm-compact .firm-nav-group>a{font-size:14px!important}
.firm-compact .admin-header-card{padding:14px 18px;margin-bottom:20px;border-radius:9px;box-shadow:0 2px 8px #00000005}
.firm-compact .admin-header-card h4{font-size:18px;line-height:1.3}
.firm-compact .admin-header-card small{font-size:14px}
.firm-compact .firm-user-tools{font-size:14px;gap:14px}
.firm-compact .firm-avatar{width:32px;height:32px}
.firm-compact h1,.firm-compact .page-title{font-size:24px;line-height:1.25;font-weight:600}
.firm-compact .admin-main h2{font-size:16px;line-height:1.4;font-weight:600}
.firm-compact .admin-main h3{font-size:15px;line-height:1.4}
.firm-compact .admin-main h4{font-size:18px}
.firm-compact .admin-main h5,.firm-compact .admin-main h6{font-size:14px}
.firm-compact .work-heading{margin-bottom:16px;gap:14px}
.firm-compact .work-heading h1{font-size:24px;margin-bottom:6px}
.firm-compact .work-heading p,.firm-compact .page-subtitle{font-size:14px}
.firm-compact .work-card,.firm-compact .workspace-card,.firm-compact .erp-card,.firm-compact .summary-card{border-radius:8px;box-shadow:none;margin-bottom:14px}
.firm-compact .work-card{padding:14px 16px}
.firm-compact .workspace-card-header,.firm-compact .erp-card-header,.firm-compact .card-header{padding:10px 14px}
.firm-compact .workspace-card-body,.firm-compact .card-body{padding:14px 16px}
.firm-compact .workspace-header{padding:14px 16px}
.firm-compact .workspace-subtitle{font-size:18px;line-height:1.35}
.firm-compact .form-control,.firm-compact .form-select{font-size:14px;line-height:1.4;padding:6px 10px;min-height:36px;border-radius:5px}
.firm-compact .form-select{padding-right:30px}
.firm-compact textarea.form-control{min-height:90px}
.firm-compact .form-label,.firm-compact .work-form label,.firm-compact .work-filters label{font-size:14px;margin-bottom:5px}
.firm-compact .work-form label{margin-top:10px}
.firm-compact .btn,.firm-compact .matter-section-nav button{font-size:14px;line-height:1.4;padding:6px 10px;min-height:36px;border-radius:5px}
.firm-compact .work-actions{gap:8px;margin-top:12px}
.firm-compact .matter-section-nav{gap:6px;margin:14px 0}
.firm-compact .matter-row-actions .btn{font-size:14px;min-height:30px;padding:5px 9px}
.firm-compact .table,.firm-compact .workspace-table,.firm-compact .erp-table{font-size:14px;line-height:1.45}
.firm-compact .table th,.firm-compact .workspace-table th{font-size:14px;font-weight:600}
.firm-compact .table td,.firm-compact .table th{padding:9px 10px;vertical-align:middle}
.firm-compact .table .small,.firm-compact .erp-muted{font-size:14px}
.firm-compact .badge{font-size:10px;font-weight:600;padding:4px 6px}
.firm-compact .alert{font-size:14px;padding:10px 14px;border-radius:6px;margin-bottom:14px}
.firm-compact .modal-title{font-size:18px}
.firm-compact .modal-header,.firm-compact .modal-footer{padding:12px 16px}
.firm-compact .modal-body{padding:16px}
.firm-compact .modal-content{border-radius:10px}
.firm-compact .fs-3,.firm-compact .summary-value,.firm-compact .firm-dashboard h2{font-size:24px!important}
.firm-compact .firm-register .firm-register-title h2{font-size:15px;margin:0}
.firm-compact .firm-register .btn,.firm-compact .firm-page-size .form-select{font-size:14px;min-height:30px;padding:5px 9px}
.firm-compact .firm-page-size .form-select{padding-right:28px}
.firm-compact .firm-register nav .btn{min-height:28px;padding:4px 9px}
.firm-compact .login-card h1{font-size:24px}
.firm-compact .login-card .form-control{min-height:36px}
@media(max-width:767px){.firm-compact .admin-sidebar{width:100%!important}.firm-compact .admin-main{margin-left:0!important;padding:12px!important}.firm-compact .admin-header-card{padding:12px 14px!important}.firm-compact .admin-header-card h4{font-size:16px}.firm-compact .form-control,.firm-compact .form-select{min-height:36px;font-size:14px}.firm-compact .btn{min-height:34px}.firm-compact .work-card{padding:12px}.firm-compact .work-heading h1{font-size:20px}}

/* Match the readable SALAM console scale. */
.firm-compact .firm-register-page{font-size:14px}
.firm-compact .firm-register-title>span,.firm-compact .firm-page-size,.firm-compact .table small{font-size:13px}
.firm-compact .admin-main h5,.firm-compact .admin-main h6,.firm-compact .firm-register .firm-register-title h2{font-size:16px}
.firm-compact .table th,.firm-compact .form-label,.firm-compact .work-form label,.firm-compact .work-filters label{font-size:13px}
.firm-compact .admin-main{padding:26px 30px}
.firm-compact .work-card,.firm-compact .workspace-card,.firm-compact .erp-card{border-radius:6px;box-shadow:0 2px 4px #00000012}
.firm-compact .firm-bell>summary{position:relative;display:flex;justify-content:center;align-items:center;width:40px;height:40px;border:1px solid #dce3df;border-radius:50%;background:#fff;gap:0}
.firm-compact .firm-bell>summary:hover,.firm-compact .firm-bell[open]>summary{background:#edf5f0;border-color:#198754}
.firm-compact .firm-bell>summary:focus-visible{outline:2px solid #198754;outline-offset:3px}
.firm-compact .firm-bell svg{width:21px;height:21px}
.firm-compact .firm-bell .firm-count{position:absolute;right:-5px;top:-5px;min-width:19px;height:19px;padding:0 4px;border:2px solid white;display:flex;align-items:center;justify-content:center;font-size:11px;line-height:1;border-radius:12px}
.firm-compact .firm-user-menu{font-size:14px;padding:16px;border-radius:6px}
.firm-compact .firm-user-menu a{border-bottom:1px solid #edf1ee;text-decoration:none;padding:10px 0}
.firm-compact .admin-content a:not(.btn){color:#0b6349}

/* One layout for all standalone creation forms. */
.firm-compact .firm-create-page{max-width:960px;margin:0 auto}
.firm-compact .firm-create-page .work-form{max-width:none}
.firm-compact .firm-create-page .work-heading{margin-bottom:20px}
.firm-compact .firm-create-page .work-heading h1{font-size:24px}
.firm-compact .firm-create-page .work-card,.firm-compact .firm-create-page .erp-card{margin-bottom:16px;border:1px solid #e0e6e2;border-radius:6px}
.firm-compact .firm-create-page .card-body{padding:16px}
.firm-compact .firm-create-page .case-section-title,.firm-compact .firm-create-page .client-section-title,.firm-compact .firm-create-page h2{font-size:16px;font-weight:600;color:#262626;margin:0 0 6px}
.firm-compact .firm-create-page .form-label,.firm-compact .firm-create-page label{font-size:13px;font-weight:600}
.firm-compact .firm-create-page .case-summary-box{padding:10px 12px;border:1px solid #dce3df;border-radius:5px;background:#f8faf9}
.firm-compact .firm-create-actions{display:flex;justify-content:flex-end;gap:8px;margin:16px 0 24px}
@media(max-width:767px){.firm-compact .firm-create-page .work-heading{align-items:flex-start;flex-direction:column}.firm-compact .firm-create-page .work-heading h1{font-size:22px}}

/* Stable console frame; matter tabs use the page scrollbar. */
html{scrollbar-gutter:stable}
@supports not (scrollbar-gutter:stable){html{overflow-y:scroll}}
.firm-compact .admin-sidebar{scrollbar-gutter:stable;overflow-anchor:none}
.firm-compact .admin-main,.firm-compact .admin-content,.firm-compact .matter-sections{min-width:0;max-width:100%}
.firm-compact .matter-section-panel{height:auto;min-width:0;max-width:100%;overflow:visible;padding:2px 4px 12px 2px}
.firm-compact #matter-overview{align-content:start}
.firm-compact .matter-section-panel>.workspace-card{min-width:0;max-width:100%}
.firm-compact .matter-section-panel .table-responsive{min-width:0;max-width:100%;overflow-x:auto}
.firm-compact .matter-section-panel .workspace-card-body{min-width:0;overflow-wrap:anywhere}
.firm-compact .matter-section-nav{min-width:0;max-width:100%}

/* Keep scrollbars slim; expanding navigation must not change their width. */
html{scrollbar-width:thin;scrollbar-color:#9aa69f #f4f5f7}
.firm-compact .admin-sidebar{scrollbar-width:thin;scrollbar-color:#a58c40 #092e24}
.firm-compact .matter-section-panel,.firm-compact .table-responsive{scrollbar-width:thin;scrollbar-color:#9aa69f transparent}
html::-webkit-scrollbar,.firm-compact .admin-sidebar::-webkit-scrollbar,.firm-compact .matter-section-panel::-webkit-scrollbar,.firm-compact .table-responsive::-webkit-scrollbar{width:6px;height:6px}
html::-webkit-scrollbar-thumb,.firm-compact .matter-section-panel::-webkit-scrollbar-thumb,.firm-compact .table-responsive::-webkit-scrollbar-thumb{background:#9aa69f;border-radius:6px}
.firm-compact .admin-sidebar::-webkit-scrollbar-thumb{background:#a58c40;border-radius:6px}
.firm-compact .admin-sidebar::-webkit-scrollbar-track{background:#092e24}
/* AMO-style frame: stationary brand and one menu scroll area when needed. */
@media(min-width:768px){
 .firm-compact .admin-sidebar{display:flex;flex-direction:column;overflow:hidden;scrollbar-gutter:auto;height:100vh;height:100dvh}
 .firm-compact .admin-sidebar>.admin-brand{flex:0 0 auto}
 .firm-compact .admin-sidebar>.admin-menu{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:transparent transparent}
 .firm-compact .admin-sidebar>.admin-menu:hover,.firm-compact .admin-sidebar>.admin-menu:focus-within{scrollbar-color:#a58c40 transparent}
 .firm-compact .admin-sidebar>.admin-menu::-webkit-scrollbar{width:6px}
 .firm-compact .admin-sidebar>.admin-menu::-webkit-scrollbar-thumb{background:transparent;border-radius:6px}
 .firm-compact .admin-sidebar>.admin-menu:hover::-webkit-scrollbar-thumb,.firm-compact .admin-sidebar>.admin-menu:focus-within::-webkit-scrollbar-thumb{background:#a58c40}
}

/* Shared dashboard and register summaries. */
.firm-compact .firm-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:0 0 20px}
.firm-compact .firm-summary-card{box-sizing:border-box;min-width:0;height:112px;padding:18px 20px;background:#fff;border:1px solid #dfe5e2;border-radius:6px;box-shadow:0 1px 3px rgba(0,0,0,.04);display:flex;flex-direction:column;justify-content:space-between}
.firm-compact .firm-summary-label{font-size:14px;line-height:20px;font-weight:400;color:#596860}
.firm-compact .firm-summary-value{font-size:28px!important;line-height:32px;font-weight:600;color:#073f30}
.firm-compact .firm-summary-note{font-size:13px;line-height:20px;color:#66736c;margin:-8px 0 16px}
@media(max-width:767px){.firm-compact .firm-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:360px){.firm-compact .firm-summary-card{padding:14px 12px}}

/* Keep short appointment values intact; let descriptions wrap instead. */
.firm-compact #appointments .workspace-table th{white-space:nowrap;overflow-wrap:normal;word-break:normal}
.firm-compact #appointments .workspace-table td:nth-child(1),
.firm-compact #appointments .workspace-table td:nth-child(2),
.firm-compact #appointments .workspace-table td:nth-child(5){white-space:nowrap;overflow-wrap:normal;word-break:normal}
.firm-compact #appointments .workspace-table td:nth-child(3){min-width:220px;white-space:normal;overflow-wrap:break-word}
.firm-compact #appointments .workspace-table td:nth-child(4){min-width:90px;overflow-wrap:normal;word-break:normal}

/* Both consoles: keep task dates and status labels on one line. */
.firm-compact #tasks .workspace-table th{white-space:nowrap;overflow-wrap:normal;word-break:normal}
.firm-compact #tasks .workspace-table td:nth-child(3),
.firm-compact #tasks .workspace-table td:nth-child(4){white-space:nowrap;overflow-wrap:normal;word-break:normal}
.firm-compact #tasks .workspace-table td:nth-child(2){min-width:150px;overflow-wrap:normal;word-break:normal}
.firm-compact #tasks .workspace-table td:first-child:not([colspan]){min-width:220px;white-space:normal;overflow-wrap:break-word}

/* Shared communication table: wrap prose, keep short labels intact. */
.firm-compact #communications .workspace-table{min-width:720px;width:100%}
.firm-compact #communications .workspace-table th,
.firm-compact #communications .workspace-table td:nth-child(1),
.firm-compact #communications .workspace-table td:nth-child(2),
.firm-compact #communications .workspace-table td:nth-child(5){white-space:nowrap;overflow-wrap:normal;word-break:normal}
.firm-compact #communications .workspace-table td:nth-child(3){min-width:110px;overflow-wrap:normal;word-break:normal}
.firm-compact #communications .workspace-table td:nth-child(4){min-width:220px;overflow-wrap:break-word}

/* Keep opening checks outside the paired Overview summaries. */
.firm-compact #matter-overview{align-items:start}
.firm-compact #matter-overview>#opening-checks{grid-column:1/-1}
.firm-compact #opening-checks .workspace-card-body{display:flex;flex-wrap:wrap;align-items:center;gap:12px 24px}
.firm-compact #opening-checks .workspace-card-body>p{flex-basis:100%;margin:0}
.firm-compact #opening-checks .workspace-card-body>.d-flex{flex:0 1 auto;justify-content:flex-start!important;align-items:center;gap:8px!important;border:0!important;padding:0!important}
.firm-compact #opening-checks .workspace-card-body>button{margin-top:0!important;margin-left:auto}
.firm-compact #matter-overview .workspace-table:has(.empty-state) thead{display:none}
.firm-compact #matter-overview .workspace-table:has(.empty-state){margin-bottom:0}
.firm-compact #matter-overview .workspace-table .empty-state{padding:10px 0;border:0;color:#66736e;text-align:left}
.firm-compact #matter-overview .workspace-card-body:has(.empty-state){padding-top:8px;padding-bottom:12px}
@media(max-width:767px){.firm-compact #opening-checks .workspace-card-body>.d-flex{flex-basis:100%}}

.firm-compact .opening-status{display:inline-block;padding:4px 10px;border-radius:20px;font-size:.875rem;line-height:1.4;white-space:nowrap}
.firm-compact .opening-status-pending{background:#fff3cd;color:#664d03}
.firm-compact .opening-status-done{background:#d1e7dd;color:#0f5132}
.firm-compact .opening-status-na{background:#e9ecef;color:#41464b}
#opening-feedback{scroll-margin-top:20px}

/* The root already reserves scrollbar space. Do not add Bootstrap's
   second compensation when a modal locks body scrolling. */
@supports (scrollbar-gutter:stable){
 body.firm-compact.modal-open{padding-right:0!important}
 body.firm-compact .modal{padding-left:0!important;padding-right:0!important}
}

.firm-compact #openingChecksModal .opening-form-section{border:1px solid #dce4df;border-radius:8px;padding:16px;margin-bottom:16px;background:#fff}
.firm-compact #openingChecksModal .opening-form-section h6{font-size:1rem;font-weight:600;color:#262626;margin:0 0 12px;padding-bottom:10px;border-bottom:1px solid #e5eae7}
.firm-compact #openingChecksModal .opening-form-section label{display:block;margin:10px 0 6px}
.firm-compact #openingChecksModal .opening-form-section .form-text{margin-bottom:0}

.firm-compact .activity-history-table{min-width:760px}
.firm-compact .activity-history-table th:first-child{width:110px;white-space:nowrap}
.firm-compact .activity-history-table th:nth-child(2){width:190px}

.firm-compact .activity-history-table td{vertical-align:middle}
.firm-compact .activity-history-table .activity-preview{overflow-wrap:anywhere}

/* Property summary follows the paired matter and fee cards. */
.firm-compact #matter-overview>#property-summary{grid-column:1/-1}
.firm-compact .property-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px 24px}
.firm-compact .property-summary-item{min-width:0}
.firm-compact .property-summary-value{overflow-wrap:anywhere;text-align:left}
@media(max-width:1100px){.firm-compact .property-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:575px){.firm-compact .property-summary-grid{grid-template-columns:1fr;gap:14px}}

/* Paired overview cards share each row height and grow with their content. */
.firm-compact #matter-overview{display:block}
.firm-compact .matter-overview-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:16px;align-items:stretch}
.firm-compact .matter-overview-columns>.workspace-card{margin:0;min-width:0;height:auto}
.firm-compact #matter-overview>#tasks,.firm-compact #matter-overview>#appointments{margin-bottom:16px}
.firm-compact .workflow-section-status{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:6px}
@media(max-width:767px){.firm-compact .matter-overview-columns{grid-template-columns:1fr}}
