#theory-planner{padding-bottom:24px;margin-bottom:20px;border-bottom:1px solid #ddd}#theory-planner .ts-toolbar{display:flex;flex-wrap:wrap;align-items:end;gap:12px;margin:12px 0}#theory-planner .ts-toolbar label{display:flex;flex-direction:column;gap:4px;min-width:150px;flex:1}#theory-planner input,#theory-planner select{min-height:34px}#theory-planner .ts-scroll{overflow-x:auto}#theory-planner .ts-calendar{display:grid;grid-template-columns:110px repeat(5,minmax(125px,1fr));gap:5px;min-width:760px}#theory-planner .ts-head{background:#e7edf5;color:#172c47;font-weight:700;padding:12px;border-radius:5px;text-align:center}#theory-planner .ts-head small{display:block;font-weight:400}#theory-planner .ts-time{font-size:12px;color:#4b5563;padding:12px 5px;align-self:center}#theory-planner .ts-cell{min-height:78px;border:1px dashed #b6c2d0;border-radius:6px;padding:10px;cursor:pointer;display:flex;flex-direction:column;justify-content:center;gap:6px}#theory-planner .ts-empty{color:#778394;background:#f7f9fc;text-align:center}#theory-planner .ts-filled{border:1px solid var(--ts-color);border-left:6px solid var(--ts-color);background:color-mix(in srgb,var(--ts-color) 10%,white)}#theory-planner .ts-cell strong{font-size:13px}#theory-planner .ts-cell small{font-size:11px}#theory-planner .ts-break{background:#f1f4f7;color:#687383;text-align:center;font-size:11px;padding:9px 3px;border-radius:5px}#theory-planner .ts-overlay[hidden]{display:none}#theory-planner .ts-overlay{position:fixed;inset:0;background:#0008;z-index:9999;display:flex;align-items:center;justify-content:center;padding:15px}#theory-planner .ts-dialog{background:white;color:#172033;width:min(500px,100%);padding:24px;border-radius:10px;box-shadow:0 15px 50px #0004;display:flex;flex-direction:column;gap:13px}#theory-planner .ts-dialog label{display:flex;flex-direction:column;gap:5px}#theory-planner .ts-dialog-head,#theory-planner .ts-dialog-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}#theory-planner .ts-dialog-head h3{margin:0}
#theory-planner .ts-signatures{border-top:1px solid #dbe3eb;padding-top:10px;max-height:250px;overflow-y:auto}#theory-planner .ts-signatures h4{margin:0 0 8px}#theory-planner .ts-sign-row{padding:6px 0;border-bottom:1px solid #edf0f3;display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}#theory-planner .ts-sign-row button{font-size:12px}

/* Flexible time-proportional theory calendar, aligned with Flight Planning */
#theory-planner .ts-week-panel{margin:18px 0 24px;border:1px solid #d5dfea;border-radius:9px;overflow:hidden;background:white;min-width:900px}
#theory-planner .ts-week-panel h3{margin:0;padding:14px 18px;background:#f6f9fc}
#theory-planner .ts-flex-calendar{display:grid;grid-template-columns:65px repeat(5,minmax(165px,1fr));}
#theory-planner .ts-flex-head{background:#f0f5fa;text-align:center;font-size:14px;font-weight:700;padding:12px 6px;border-left:1px solid #dae4ee}
#theory-planner .ts-flex-head small{display:block;font-weight:400;margin-top:5px}
#theory-planner .ts-flex-axis{position:relative;background:#f9fbfe}
#theory-planner .ts-axis-hour{position:absolute;left:8px;transform:translateY(-50%);font-size:12px;color:#60748b}
#theory-planner .ts-flex-day{position:relative;border-left:1px solid #dae4ee;background:linear-gradient(to bottom,transparent calc(100% - 1px),#e2e9f0 0);background-size:100% calc(100% / var(--ts-hours))}
#theory-planner .ts-flex-block{position:absolute;left:4px;width:calc(100% - 8px);border-radius:6px;padding:8px;text-align:left;display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:5px;overflow:hidden;min-height:0;cursor:pointer;print-color-adjust:exact}
#theory-planner .ts-flex-block strong{font-size:13px;line-height:1.2}
#theory-planner .ts-flex-block span{font-size:12px}
#theory-planner .ts-flex-block small{font-size:11px}
#theory-planner .ts-flex-empty{border:1px dashed #a8b7c7;background:#f7f9fc;color:#6b7f93;text-align:center;align-items:center}
#theory-planner .ts-flex-filled{border:1px solid var(--ts-color);border-left:6px solid var(--ts-color);background:color-mix(in srgb,var(--ts-color) 15%,white);color:#172d46}
#theory-planner .ts-flex-block:hover{filter:brightness(.97);z-index:2}

#theory-planner .ts-flex-break{border:1px solid #b7c5d4;background:#e8eef5;color:#42576e;text-align:center;align-items:center;padding:3px;gap:1px}
#theory-planner .ts-flex-break strong{font-size:11px}#theory-planner .ts-flex-break span,#theory-planner .ts-flex-break small{font-size:10px}
#theory-planner .ts-flex-completed{border:1px solid #aeb5be;border-left:6px solid #7b8590;background:#d6d9dd;color:#3d454d}

#theory-planner .ts-sign-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
#theory-planner .ts-sign-actions [data-ts-remove]{border-color:#b45309;color:#92400e}
#theory-planner .ts-removed-row{font-size:12px;color:#7c4a12;padding:5px 0}
#toms-theory > [hidden]{display:none!important}

/* Clean, single-purpose Create Lesson form */
#theory-planner .ts-create-dialog{width:min(480px,100%);padding:28px;gap:22px;border-radius:14px}
#theory-planner .ts-create-dialog .ts-dialog-head{align-items:flex-start}
#theory-planner .ts-create-dialog .ts-dialog-head h3{font-size:21px;line-height:1.3}
#theory-planner .ts-create-subtitle{margin:7px 0 0;color:#64748b;font-size:13px;line-height:1.5}
#theory-planner .ts-create-dialog label{font-size:13px;font-weight:650;gap:9px}
#theory-planner .ts-create-dialog input{border:1px solid #cbd5e1;border-radius:8px;padding:11px 13px;min-height:44px;font-size:15px;width:100%;box-sizing:border-box;background:#fff;color:#172033}
#theory-planner .ts-create-dialog input:focus{outline:2px solid #3b82f6;outline-offset:1px;border-color:#3b82f6}
#theory-planner .ts-create-dialog .ts-dialog-actions{justify-content:flex-end;border-top:1px solid #e2e8f0;padding-top:17px}
#theory-planner .ts-create-dialog .ts-dialog-actions button{padding:10px 16px;border-radius:8px;cursor:pointer}
#theory-planner .ts-create-dialog .ts-secondary{background:#f1f5f9;color:#334155;border:1px solid #cbd5e1}
#theory-planner .ts-create-error{margin:0;color:#b91c1c;font-size:13px}

#theory-planner .ts-conduct-dialog{width:min(470px,100%);border-radius:16px;padding:30px;gap:16px;max-height:90vh;overflow-y:auto}#theory-planner .ts-conduct-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:14px;background:#e8f2fd;color:#215e9c;font-size:26px;font-weight:700}#theory-planner .ts-conduct-dialog h3{font-size:22px;line-height:1.25;margin:0}#theory-planner .ts-conduct-subtitle{font-size:14px;line-height:1.55;color:#526175;margin:0}#theory-planner .ts-conduct-details{background:#f4f7fb;border:1px solid #e0e7f0;padding:14px;border-radius:10px;font-size:13px;line-height:1.5}#theory-planner .ts-conduct-dialog .ts-dialog-actions{justify-content:flex-end;border-top:1px solid #e4e9f0;padding-top:18px}#theory-planner .ts-conduct-dialog button{border-radius:8px;padding:10px 16px;cursor:pointer}

#theory-planner .ts-action-dialog{width:min(470px,100%);border-radius:16px;padding:28px;gap:15px;max-height:90vh;overflow-y:auto}#theory-planner .ts-action-symbol{width:46px;height:46px;display:grid;place-items:center;background:#e8f2fd;color:#225c9a;border-radius:13px;font-size:25px;font-weight:700}#theory-planner .ts-action-dialog h3{font-size:22px;margin:0}#theory-planner .ts-action-subtitle{font-size:14px;color:#526175;line-height:1.5;margin:0}#theory-planner .ts-action-details{background:#f4f7fb;border:1px solid #dfe8f2;border-radius:11px;padding:14px;display:grid;gap:9px}#theory-planner .ts-action-details>div{display:flex;justify-content:space-between;gap:12px;font-size:13px}#theory-planner .ts-action-details span{text-align:right;overflow-wrap:anywhere}#theory-planner .ts-action-dialog #ts-action-reason-wrap{display:grid;gap:7px;font-weight:600}#theory-planner .ts-action-dialog #ts-action-reason-wrap[hidden]{display:none}#theory-planner .ts-action-dialog select,#theory-planner .ts-action-dialog input{border:1px solid #cbd5e1;border-radius:8px;padding:10px 12px;font:inherit;background:white}#theory-planner .ts-action-dialog .ts-dialog-actions{justify-content:flex-end;border-top:1px solid #e2e8f0;padding-top:16px}#theory-planner .ts-action-dialog button{border-radius:8px;padding:10px 17px;cursor:pointer}#theory-planner .ts-action-dialog .ts-danger{background:#b42318;color:white;border-color:#b42318}

#ts-action-overlay .ts-action-dialog{position:relative}
#ts-action-close{position:absolute;right:12px;top:10px;cursor:pointer}

#theory-planner .ts-instructor-legend{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;padding:10px 12px;margin:10px 0;background:#f3f7fb;border:1px solid #dbe5f0;border-radius:6px;font-size:12px;color:#172c47}
#theory-planner .ts-instructor-legend[hidden]{display:none}
#theory-planner .ts-legend-item{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
#theory-planner .ts-legend-swatch{display:inline-block;width:13px;height:13px;border-radius:3px;border:1px solid #0002;flex-shrink:0}
