/* v0.9.2 visual correction: readable tables, protected action columns and dialog safe areas. */
.main-content{max-width:1540px}
.panel{min-width:0}
.table-scroll{scrollbar-gutter:stable}
.data-table th,.data-table td{overflow-wrap:anywhere}
.data-table .row-actions{min-width:0;flex-wrap:nowrap;white-space:nowrap}

/* The plan table must fit the ordinary desktop workspace instead of hiding its actions. */
.plan-data-table.table-scroll{overflow-x:auto}
.plan-data-table.data-table{width:100%;min-width:1331px;table-layout:fixed}
.plan-data-table.data-table th,.plan-data-table.data-table td{height:auto;min-height:49px;padding:9px 8px;line-height:1.45}
.plan-data-table.data-table th:nth-child(1){width:38px}
.plan-data-table.data-table th:nth-child(2){width:92px}
.plan-data-table.data-table th:nth-child(3){width:112px}
.plan-data-table.data-table th:nth-child(4){width:88px}
.plan-data-table.data-table th:nth-child(5){width:112px}
.plan-data-table.data-table th:nth-child(6){width:170px}
.plan-data-table.data-table th:nth-child(7){width:96px}
.plan-data-table.data-table th:nth-child(8){width:160px}
.plan-data-table.data-table th:nth-child(9){width:245px}
.plan-data-table.data-table th:nth-child(10){width:86px}
.plan-data-table.data-table th:nth-child(11){width:132px}
.plan-data-table.data-table .cell-readonly,.plan-data-table.data-table .content-clamp{max-width:100%}
.plan-data-table.data-table .cell-date,.plan-data-table.data-table .cell-select,.plan-data-table.data-table .cell-picker{width:100%;min-width:0;padding-inline:6px}
.plan-data-table.data-table td:last-child,.plan-data-table.data-table th:last-child{position:sticky;right:0;z-index:2;background:#fff;box-shadow:-7px 0 10px -10px rgba(23,50,77,.55)}
.plan-data-table.data-table th:last-child{z-index:3;background:#f8fafc}
.plan-data-table.data-table tr.editing-row td{background:#fff1c7;border-top:1px solid #dfb24a;border-bottom:1px solid #dfb24a}
.plan-data-table.data-table tr.editing-row td:first-child{box-shadow:inset 5px 0 0 #c47b0b}
.plan-data-table.data-table tr.editing-row td:last-child,.plan-data-table.data-table tr.new-plan-row td:last-child{background:#fff1c7}
.plan-data-table.data-table tr.editing-row:hover td{background:#ffe8aa}
.plan-data-table.data-table tr.editing-row .status{background:#e7ad36;color:#4e3300}
.plan-data-table.data-table tr.editing-row td:last-child .row-actions,.plan-data-table.data-table tr.editing-row td:last-child .inline-link{background:transparent!important;box-shadow:none!important}
.plan-mobile-card.editing-row{background:#fff1c7!important;border-color:#dfb24a!important;box-shadow:inset 5px 0 0 #c47b0b,0 5px 14px rgba(115,73,8,.12)!important}
.plan-mobile-card.editing-row .status{background:#e7ad36;color:#4e3300}
.plan-mobile-card.editing-row .task-card-bottom,.plan-mobile-card.editing-row .row-actions,.plan-mobile-card.editing-row .inline-link{background:transparent!important;box-shadow:none!important}

@media(min-width:901px){
  .object-picker-dialog .picker-tools{grid-template-columns:minmax(260px,2fr) auto repeat(3,minmax(110px,1fr));align-items:end}
  .object-picker-dialog .picker-tools .picker-search,.object-picker-dialog .picker-tools .quiet-button,.object-picker-dialog .picker-tools label:nth-of-type(2),.object-picker-dialog .picker-tools label:nth-of-type(3),.object-picker-dialog .picker-tools label:nth-of-type(4){grid-column:auto}
  .object-picker-dialog .picker-tools input,.object-picker-dialog .picker-tools select,.object-picker-dialog .picker-tools .quiet-button{height:34px;min-height:34px;box-sizing:border-box}
}

body.cell-choice-open{overflow:hidden}
.plan-data-table .cell-select,.plan-data-table .cell-date,.plan-data-table .cell-picker,.plan-data-table .cell-multiselect>summary{height:34px;min-height:34px;box-sizing:border-box;border:1px solid #c8d8de;border-radius:8px;background:#fff;color:#29485c;font-size:11px}
.plan-data-table .cell-picker,.plan-data-table .cell-multiselect-trigger{display:flex;align-items:center;width:100%;min-width:0;padding:6px 8px}
.cell-multiselect-trigger{position:relative;height:34px;min-height:34px;box-sizing:border-box;padding-right:24px;border:1px solid #c8d8de;border-radius:8px;background:#fff;color:#29485c;cursor:pointer;text-align:left}
.cell-multiselect-trigger::after{content:'▾';position:absolute;right:8px;color:#66808e;font-size:10px}
.cell-multiselect-trigger b{flex:0 0 auto;font-size:11px}.cell-multiselect-trigger small{overflow:hidden;margin-left:5px;white-space:nowrap;text-overflow:ellipsis;font-size:9px;color:#66808e}
.plan-content-overlay{position:fixed;z-index:95;inset:0;background:transparent}
.plan-content-overlay>section{position:fixed;max-height:min(332px,calc(100dvh - 24px));overflow:hidden;border:1px solid #bcd2d6;border-radius:9px;background:#fff;box-shadow:0 9px 24px rgba(19,47,62,.19)}
.plan-content-overlay header{display:flex;min-height:38px;align-items:center;justify-content:space-between;padding:5px 6px 5px 10px;border-bottom:1px solid #e1e9eb}.plan-content-overlay header b{color:#17324d;font-size:11px}.plan-content-overlay header div{display:flex;gap:3px}.plan-content-overlay header button{min-width:42px;height:28px;padding:0 7px;border:0;border-radius:6px;background:transparent;color:#15766f;font-size:10px;font-weight:700;cursor:pointer}.plan-content-overlay header button:hover{background:#e9f5f2}
.plan-content-options{max-height:290px;overflow-y:auto;padding:5px;overscroll-behavior:contain}.plan-content-options label{display:flex;min-height:34px;align-items:center;gap:7px;padding:5px 7px;border-radius:6px;color:#29485c;font-size:11px}.plan-content-options label:hover{background:#eef7f5}
.plan-select-overlay{display:grid;position:fixed;z-index:90;inset:0;place-items:center;padding:14px;background:rgba(18,43,57,.24)}
.plan-select-overlay>section{width:min(360px,100%);max-height:min(430px,72dvh);overflow:hidden;border:1px solid #cbdce1;border-radius:12px;background:#fff;box-shadow:0 18px 46px rgba(19,47,62,.24)}
.plan-select-overlay header{display:flex;min-height:42px;align-items:center;justify-content:space-between;padding:8px 10px 8px 13px;border-bottom:1px solid #dce6e9;color:#17324d}
.plan-select-overlay header b{font-size:12px}.plan-select-overlay header button{width:30px;height:30px;border:0;border-radius:7px;background:#edf4f5;color:#365569;font-size:17px;cursor:pointer}
.plan-select-overlay section>div{max-height:calc(min(430px,72dvh) - 43px);overflow-y:auto;padding:7px;overscroll-behavior:contain}
.plan-select-overlay section>div>button{display:flex;width:100%;min-height:40px;align-items:center;justify-content:space-between;padding:8px 10px;border:0;border-radius:8px;background:#fff;color:#29485c;text-align:left;cursor:pointer}
.plan-select-overlay section>div>button:hover,.plan-select-overlay section>div>button.active{background:#e7f5f1;color:#126f68}.plan-select-overlay section>div>button i{font-size:9px;font-style:normal;font-weight:800}

/* Approval lists use the available width and preserve breathing room around long facts. */
.approval-data-table.data-table,.rectification-data-table.data-table{width:100%;min-width:940px;table-layout:fixed}
.approval-data-table.data-table th,.approval-data-table.data-table td,
.rectification-data-table.data-table th,.rectification-data-table.data-table td{height:auto;padding:10px 11px;line-height:1.5}
.approval-data-table.data-table th:nth-child(1){width:142px}.approval-data-table.data-table th:nth-child(2){width:76px}.approval-data-table.data-table th:nth-child(3){width:80px}.approval-data-table.data-table th:nth-child(4){width:112px}.approval-data-table.data-table th:nth-child(5){width:72px}.approval-data-table.data-table th:nth-child(6){width:86px}.approval-data-table.data-table th:nth-child(7){width:auto}.approval-data-table.data-table th:nth-child(8){width:80px}.approval-data-table.data-table th:nth-child(9){width:66px}
.rectification-data-table.data-table th:nth-child(1){width:150px}.rectification-data-table.data-table th:nth-child(2){width:78px}.rectification-data-table.data-table th:nth-child(3){width:86px}.rectification-data-table.data-table th:nth-child(4){width:auto}.rectification-data-table.data-table th:nth-child(5){width:86px}.rectification-data-table.data-table th:nth-child(6){width:98px}.rectification-data-table.data-table th:nth-child(7){width:88px}.rectification-data-table.data-table th:nth-child(8){width:76px}
.approval-data-table.data-table td:last-child,.approval-data-table.data-table th:last-child,
.rectification-data-table.data-table td:last-child,.rectification-data-table.data-table th:last-child{position:sticky;right:0;z-index:2;background:#fff;box-shadow:-7px 0 10px -10px rgba(23,50,77,.5)}
.approval-data-table.data-table th:last-child,.rectification-data-table.data-table th:last-child{z-index:3;background:#f8fafc}

/* Dialogs keep a visible safety margin and an inner content rail on desktop/tablet. */
.v091-process-dialog{width:min(1080px,calc(100vw - 72px));max-height:88dvh;border-radius:14px}
.v091-process-dialog .detail-head{padding:13px 18px}
.v091-process-dialog .detail-body{padding:0 18px 18px}
.v091-process-dialog .v090-people{margin:0 -18px;padding-inline:18px}
.v091-process-dialog .v091-process-scroll{margin:12px 0 0;border:1px solid #dce5eb;border-radius:10px}
.v091-process-dialog .v091-decision{margin-top:12px;border:1px solid #dce5eb;border-radius:10px;overflow:hidden}
.v091-process-dialog .readonly-notice{margin-top:12px}
.v091-confirm-dialog,.v091-change-dialog,.dialog-wide{max-width:calc(100vw - 64px);border-radius:14px}

@media(max-width:1180px) and (min-width:721px){
  .v091-process-dialog{width:calc(100vw - 48px);max-height:90dvh}
  .dialog-xwide:not(.task-work-dialog):not(.object-picker-dialog){max-width:calc(100vw - 48px);border-radius:14px}
  .plan-data-table.data-table{min-width:1295px}
}

@media(max-width:720px){
  .plan-content-options{max-height:min(280px,calc(100dvh - 74px))}
  .v091-process-dialog{width:calc(100vw - 18px);max-height:calc(100dvh - 18px);border-radius:13px}
  .v091-process-dialog .detail-head{padding:10px 12px}
  .v091-process-dialog .detail-body{padding:0 10px 10px}
  .v091-process-dialog .v090-people{margin:0 -10px;padding-inline:10px}
  .v091-process-dialog .v091-process-scroll{margin-top:8px}
  .v091-process-dialog .v091-decision{margin-top:8px}
  .v091-confirm-dialog,.v091-change-dialog,.dialog-wide{max-width:calc(100vw - 18px)}
}

/* Teacher and rectifier desktop lists follow the owner table rhythm and keep actions visible. */
.identity-inspector .panel>.table-scroll .data-table,
.identity-rectifier .panel>.table-scroll .data-table{width:100%;min-width:1050px;table-layout:fixed}
.identity-inspector .panel>.table-scroll .data-table th,
.identity-inspector .panel>.table-scroll .data-table td,
.identity-rectifier .panel>.table-scroll .data-table th,
.identity-rectifier .panel>.table-scroll .data-table td{height:auto;padding:10px 11px;line-height:1.5}
.identity-inspector .panel>.table-scroll .data-table th:nth-child(1){width:102px}
.identity-inspector .panel>.table-scroll .data-table th:nth-child(2){width:66px}
.identity-inspector .panel>.table-scroll .data-table th:nth-child(3){width:88px}
.identity-inspector .panel>.table-scroll .data-table th:nth-child(4){width:148px}
.identity-inspector .panel>.table-scroll .data-table th:nth-child(5){width:auto}
.identity-inspector .panel>.table-scroll .data-table th:nth-child(6){width:72px}
.identity-inspector .panel>.table-scroll .data-table th:nth-child(7){width:104px}
.identity-inspector .panel>.table-scroll .data-table th:nth-child(8){width:148px}
.identity-inspector .panel>.table-scroll .data-table td:last-child,
.identity-inspector .panel>.table-scroll .data-table th:last-child,
.identity-rectifier .panel>.table-scroll .data-table td:last-child,
.identity-rectifier .panel>.table-scroll .data-table th:last-child{position:sticky;right:0;z-index:2;background:#fff;box-shadow:-7px 0 10px -10px rgba(23,50,77,.5)}
.identity-inspector .panel>.table-scroll .data-table th:last-child,
.identity-rectifier .panel>.table-scroll .data-table th:last-child{z-index:3;background:#f8fafc}
.identity-inspector .panel>.table-scroll .row-actions,
.identity-rectifier .panel>.table-scroll .row-actions{justify-content:flex-end}
