.tm-panel,.tm-client-panel{background:#fff;border:1px solid #dfe5ef;border-radius:16px;color:#23334b;font-family:Inter,Arial,sans-serif;padding:22px;margin-bottom:24px;box-sizing:border-box}
.tm-head{display:flex;justify-content:space-between;align-items:center;gap:18px;flex-wrap:wrap;margin-bottom:20px}
.tm-head h2,.tm-client-panel h3{font-size:23px;letter-spacing:-.035em;font-weight:800;color:#192847;margin:0 0 6px}
.tm-head p,.tm-muted{font-size:12px;line-height:1.7;color:#64748b;margin:6px 0 16px}
.tm-panel button,.tm-dialog button,.tm-client-panel button{font:700 12px Inter,Arial,sans-serif;background:#f1f4fa;color:#334155;border:1px solid #dce3ef;border-radius:8px;padding:10px 13px;cursor:pointer}
.tm-panel .tm-primary,.tm-dialog .tm-primary{background:#3730a3;color:#fff;border-color:#3730a3}
.tm-panel button:disabled,.tm-dialog button:disabled{opacity:.5;cursor:wait}
.tm-filters,.tm-row-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.tm-filters{margin:14px 0 20px}
.tm-panel input,.tm-panel select,.tm-dialog input,.tm-dialog select,.tm-dialog textarea,.tm-client-panel input,.tm-client-panel select,.tm-client-panel textarea{box-sizing:border-box;background:#fafbfe;color:#24334b;border:1px solid #cfd8e7;border-radius:8px;padding:10px 11px;min-width:0;font:500 13px Inter,Arial,sans-serif}
.tm-panel input:focus,.tm-panel select:focus,.tm-dialog input:focus,.tm-dialog select:focus,.tm-dialog textarea:focus,.tm-client-panel input:focus,.tm-client-panel select:focus,.tm-client-panel textarea:focus{outline:2px solid #818cf8;outline-offset:2px}
.tm-filters label{font-size:11px;color:#64748b;display:flex;align-items:center;gap:6px}
.tm-table-scroll{overflow:auto;width:100%}
.tm-table{border-collapse:collapse;width:100%;font-size:12px;min-width:800px;text-align:left}
.tm-table th{background:#f4f6fb;color:#56637b;font-size:10px;text-transform:uppercase;letter-spacing:.04em;padding:12px}
.tm-table td{border-bottom:1px solid #e7ecf4;padding:14px 12px;vertical-align:middle}
.tm-table .tm-total-row td{background:#eef2ff;border-top:2px solid #a5b4fc;font-weight:750}
.tm-table strong,.tm-table small{display:block;overflow-wrap:anywhere}.tm-table small{color:#64748b;font-size:11px;margin-top:5px}
.tm-table .tm-row-actions{display:table-cell;min-width:250px}.tm-row-actions button{margin:2px;padding:8px 10px;font-size:11px}
.tm-status{display:inline-block;background:#eef2ff;color:#4338ca;padding:6px 9px;border-radius:20px;font-weight:700;font-size:11px}
.tm-error{font-size:12px;color:#b91c1c;line-height:1.7}.tm-empty{text-align:center;padding:30px!important;color:#64748b}
.tm-dialog{padding:0;width:min(920px,94vw);max-height:90vh;border:1px solid #dce3ef;border-radius:18px;background:white;color:#24334b;box-shadow:0 30px 90px #0f172a66;font-family:Inter,Arial,sans-serif}
.tm-dialog::backdrop{background:#0f172a99;backdrop-filter:blur(3px)}
.tm-dialog-head{display:flex;justify-content:space-between;gap:16px;align-items:start;padding:23px 26px;background:#f7f9fd;border-bottom:1px solid #e2e8f0}
.tm-dialog-head h2{font-size:23px;margin:0 0 6px;color:#192847;font-weight:800;letter-spacing:-.035em}.tm-dialog-head p{font-size:12px;color:#64748b;line-height:1.7;margin:0;max-width:670px}
.tm-dialog .tm-close{font-size:23px;padding:2px 10px;background:#fff}.tm-dialog-body{padding:24px 26px;overflow:auto;max-height:64vh}
.tm-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px 20px;margin-bottom:20px}
.tm-grid label,.tm-label,.tm-client-panel>label{display:flex;flex-direction:column;gap:7px;font-size:12px;font-weight:650;color:#475569}
.tm-grid label>span{font-size:12px}.tm-dialog .tm-check,.tm-client-panel .tm-check{flex-direction:row;align-items:center;gap:9px}.tm-check input{width:17px;height:17px}
.tm-actions{display:flex;justify-content:flex-end;gap:10px;border-top:1px solid #e2e8f0;padding:18px 26px;background:#fafbfe}
.tm-client-panel{margin-top:24px;background:#f8faff}.tm-client-panel h3{font-size:20px}.tm-client-panel h4{margin:20px 0 10px}.tm-client-panel select{width:100%}
.tm-client-panel input[type="number"],.tm-client-panel input[type="text"],.tm-client-panel textarea{width:100%;background:white!important;color:#24334b!important;border:1px solid #cfd8e7!important}
.tm-addition{display:grid;grid-template-columns:2fr 1fr 1fr 36px;gap:10px;align-items:end;margin-bottom:12px}.tm-addition label{display:flex;flex-direction:column;font-size:11px;gap:6px}
.tm-preview{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;background:#eef2ff;border:1px solid #dce3fa;border-radius:10px;padding:16px;margin-top:18px}.tm-preview span{display:block;font-size:10px;color:#64748b;margin-bottom:7px}.tm-preview strong{font-size:14px;color:#243b6b}
.tm-assignment-list{display:flex;flex-direction:column;gap:8px;max-height:45vh;overflow:auto}.tm-assignment-list label{display:flex;align-items:center;gap:12px;padding:12px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;font-size:12px}.tm-assignment-list small{display:block;margin-top:5px;color:#64748b}
#module-tour-reports{padding:24px;flex-direction:column}.tm-report-note{font-size:12px;line-height:1.7;color:#64748b;padding:14px;background:#f5f7fc;border-radius:8px}
.tm-legacy{margin:20px 0}.tm-legacy>summary{padding:14px 18px;border:1px solid #dce3ef;border-radius:10px;background:#f8fafc;font-weight:700;color:#475569;cursor:pointer;font-size:13px;margin-bottom:18px}
@media(max-width:700px){.tm-grid{grid-template-columns:1fr}.tm-preview{grid-template-columns:1fr 1fr}.tm-addition{grid-template-columns:1fr 1fr}.tm-panel{padding:16px}.tm-filters{align-items:stretch}.tm-filters>input,.tm-filters>select{width:100%}.tm-dialog-body{padding:18px}.tm-dialog-head{padding:18px}.tm-head h2{font-size:21px}#module-tour-reports{padding:12px}}

/* Explicit centering survives the application's global margin reset. */
#tm-dialog{position:fixed;inset:0;margin:auto!important;width:min(840px,calc(100vw - 32px));height:fit-content;max-height:90vh;max-height:90dvh;overflow:hidden;box-sizing:border-box;border-radius:18px}
#tm-dialog[open]{display:flex;flex-direction:column}
#tm-dialog .tm-dialog-head{flex-shrink:0;background:#fff;padding:24px 28px;align-items:center}
#tm-dialog .tm-dialog-head h2{font-size:22px;letter-spacing:-.025em}
#tm-dialog .tm-dialog-head p{margin-top:6px;max-width:620px;line-height:1.6}
#tm-dialog .tm-close{width:34px;height:34px;flex-shrink:0;border-radius:9px;display:grid;place-items:center;padding:0;background:#f8fafc;color:#64748b}
#tm-dialog>form{display:flex;flex-direction:column;min-height:0;overflow:hidden;flex:1}
#tm-dialog .tm-dialog-body{min-height:0;overflow-y:auto;max-height:none;padding:24px 28px;background:#fafbfe}
#tm-dialog .tm-tour-section{padding:0 0 20px;margin:0 0 20px;border-bottom:1px solid #e2e8f0}
#tm-dialog .tm-tour-section h3{font-size:13px;font-weight:750;color:#334155;margin:0 0 14px;letter-spacing:.01em}
#tm-dialog .tm-tour-section .tm-muted{margin:-6px 0 16px;font-size:12px}
#tm-dialog .tm-tour-section .tm-grid{margin:0;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px}
#tm-dialog input,#tm-dialog select,#tm-dialog textarea{width:100%;min-height:42px;background:#fff;border-color:#cbd5e1;box-shadow:0 1px 2px #0f172a04}
#tm-dialog input[type="checkbox"]{width:17px;min-height:0}
#tm-dialog textarea{resize:vertical}
#tm-dialog .tm-actions{flex-shrink:0;padding:16px 28px;background:#fff}
#tm-dialog .tm-save-hint{margin-right:auto;align-self:center;font-size:11px;color:#64748b}
#tm-dialog .tm-primary{background:#4338ca;border-color:#4338ca;box-shadow:0 2px 4px #312e8120}
#tm-dialog .tm-primary:hover{background:#3730a3}
#packages-view .tm-legacy{margin-top:20px}
#packages-view .tm-legacy>summary{display:flex;align-items:center;gap:12px;padding:16px 18px;margin:0;list-style:none;background:#fff;border:1px solid #dce3ed;border-radius:12px;color:#475569}
#packages-view .tm-legacy>summary::-webkit-details-marker{display:none}
#packages-view .tm-legacy>summary::before{content:'\203A';font-size:23px;color:#64748b;line-height:1}
#packages-view .tm-legacy[open]>summary::before{transform:rotate(90deg)}
#packages-view .tm-legacy>summary::after{content:'View records';margin-left:auto;font-size:11px;color:#4338ca;white-space:nowrap}
#packages-view .tm-legacy[open]>summary::after{content:'Hide records'}
#packages-view .tm-legacy-count{padding:4px 8px;background:#f1f5f9;border-radius:6px;font-size:11px;color:#64748b}
#packages-view .tm-legacy-note{font-size:12px;line-height:1.7;color:#64748b;padding:16px 4px;margin:0}
/* Do not let any global display rule expose closed legacy content. */
#packages-view .tm-legacy:not([open])>:not(summary){display:none!important}
@media(max-width:700px){
  #tm-dialog{width:calc(100vw - 20px);max-height:94vh;max-height:94dvh;border-radius:14px}
  #tm-dialog .tm-dialog-head,#tm-dialog .tm-dialog-body{padding:18px}
  #tm-dialog .tm-tour-section .tm-grid{grid-template-columns:1fr}
  #tm-dialog .tm-actions{padding:14px 18px}
  #tm-dialog .tm-save-hint{display:none}
  #packages-view .tm-legacy>summary{flex-wrap:wrap;gap:8px;font-size:12px}
}
/* Management statements keep labels fixed while tour/month columns compare. */
.tm-financial-statement{border:1px solid #dce4ef;border-radius:14px;overflow:hidden;margin:24px 0;background:#fff}
.tm-financial-statement>header{padding:20px 22px;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#f8faff;border-bottom:1px solid #dce4ef}
.tm-statement-eyebrow{font-size:10px;font-weight:750;letter-spacing:.08em;color:#526782}
.tm-financial-statement h3{font-size:19px;margin:5px 0 0;color:#1c3155;letter-spacing:-.025em}
.tm-statement-count{font-size:11px;color:#526782;white-space:nowrap}
.tm-statement-table{width:100%;border-collapse:separate;border-spacing:0;font-size:12px;color:#334155;font-variant-numeric:tabular-nums}
.tm-statement-table th,.tm-statement-table td{padding:12px 18px;border-bottom:1px solid #e7ecf4;vertical-align:middle;min-width:200px;text-align:right;white-space:nowrap}
.tm-statement-table th:first-child{position:sticky;left:0;text-align:left;min-width:290px;max-width:340px;white-space:normal;z-index:1;background:#fff;border-right:1px solid #e7ecf4}
.tm-statement-table thead th{background:#243b6b;color:#fff;text-align:right;padding-top:17px;padding-bottom:17px}
.tm-statement-table thead th:first-child{background:#243b6b}
.tm-statement-table thead strong,.tm-statement-table small{display:block;white-space:normal;line-height:1.5}
.tm-statement-table small{font-size:10px;font-weight:400;opacity:.8;margin-top:4px}
.tm-statement-table tbody th{font-weight:500}
.tm-statement-table tr:nth-child(even)>*{background:#f8fafc}
.tm-statement-table .tm-statement-total>*{background:#edf2fa;font-weight:750;color:#243b6b;border-top:1px solid #d5e0f0}
.tm-statement-table .tm-statement-result>*{background:#eaf6f1;color:#11634c;font-weight:800}
.tm-statement-table td.tm-negative{color:#b42318}
.tm-statement-audit{margin:18px 0;border:1px solid #e0e7f0;border-radius:10px;padding:14px 18px;color:#526782;font-size:12px}
.tm-statement-audit>summary{cursor:pointer;font-weight:650;color:#33496b}
.tm-statement-audit>p{font-size:12px;line-height:1.8;margin-top:12px}
.tm-statement-audit .tm-table-scroll{margin-top:14px}
@media(max-width:700px){.tm-statement-table th:first-child{min-width:180px;max-width:200px}.tm-statement-table th,.tm-statement-table td{padding:11px 12px;min-width:180px}.tm-financial-statement>header{padding:16px}.tm-financial-statement h3{font-size:17px}}
