.routine-shell{display:grid;gap:20px}.routine-tabs{display:flex;gap:8px;overflow:auto;padding:4px 2px 8px}.routine-tabs button{border:0;background:#eef2f7;color:#4d6074;border-radius:999px;padding:10px 18px;white-space:nowrap;font-weight:700}.routine-tabs button.active{background:#173fb5;color:#fff}.routine-hero{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;padding:22px;border:1px solid #dfe6ec;border-radius:18px;background:linear-gradient(135deg,#f8fbff,#eef4ff)}.routine-hero h2{margin:4px 0 8px}.shift-badge{min-width:150px;text-align:center;padding:14px;border-radius:14px;background:#fff;border:1px solid #d8e2f2}.shift-badge strong{display:block;font-size:28px;color:#173fb5}.routine-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px}.routine-card{padding:20px;border:1px solid #dfe6ec;border-radius:16px;background:#fff}.routine-card h3{margin:5px 0 8px}.routine-card .meta{color:#65778d}.routine-progress{height:8px;background:#e7edf7;border-radius:999px;overflow:hidden;margin:14px 0}.routine-progress i{display:block;height:100%;background:#1a45bd}.routine-empty{padding:34px;text-align:center;border:1px dashed #cbd5e1;border-radius:16px;color:#65778d}.routine-orders{display:grid;gap:8px}.routine-order{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px;border:1px solid #e4e9ef;border-radius:12px;background:#fff}.routine-order small{display:block;color:#64748b}.role-toolbar{display:flex;flex-wrap:wrap;gap:12px;align-items:end}.role-toolbar .field{min-width:190px;margin:0}.role-scroll{overflow:auto;border:1px solid #dfe6ec;border-radius:16px;background:#fff;max-height:66vh}.role-table{border-collapse:separate;border-spacing:0;min-width:1100px;width:100%}.role-table th,.role-table td{padding:8px;border-right:1px solid #e6ebf0;border-bottom:1px solid #e6ebf0;text-align:center;min-width:48px}.role-table th{position:sticky;top:0;background:#f4f7fb;z-index:2}.role-table th:first-child,.role-table td:first-child{position:sticky;left:0;min-width:220px;text-align:left;background:#fff;z-index:3}.role-table th:first-child{background:#f4f7fb;z-index:4}.role-code{width:42px;height:34px;border:0;border-radius:8px;background:#eef3fa;font-weight:800;color:#334155;cursor:pointer}.role-code.td{background:#dbeafe;color:#1744a8}.role-code.tn{background:#1e3a8a;color:#fff}.role-code.exception{background:#fff1c7;color:#8a5500}.role-code.off{color:#94a3b8}.role-member-config{display:grid;grid-template-columns:1fr 120px 140px 130px;gap:8px;align-items:center}.routine-config-list{display:grid;gap:10px}.routine-config-row{display:grid;grid-template-columns:70px 160px 1fr 110px 90px 90px;gap:12px;align-items:center;padding:12px;border:1px solid #e1e7ee;border-radius:12px;background:#fff}.routine-config-row.inactive{opacity:.55}.routine-dialog{width:min(980px,calc(100vw - 24px));max-height:92vh;border:0;border-radius:20px;padding:0;box-shadow:0 22px 80px #07162b66}.routine-dialog::backdrop{background:#07162baa}.routine-dialog form{padding:24px}.routine-dialog header,.routine-dialog footer{display:flex;justify-content:space-between;gap:14px;align-items:center}.routine-dialog footer{justify-content:flex-end;margin-top:20px}.routine-checklist{display:grid;gap:12px;max-height:62vh;overflow:auto;padding-right:6px}.routine-item{padding:14px;border:1px solid #dfe6ec;border-radius:14px}.routine-item-head{display:flex;justify-content:space-between;gap:14px}.routine-item textarea{min-height:72px}.routine-statuses{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}.routine-statuses label{padding:8px 12px;border:1px solid #d8e0ea;border-radius:999px}.extraction-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(310px,1fr));gap:12px}.extraction-asset{padding:14px;border:1px solid #dfe6ec;border-radius:14px}.extraction-asset h4{margin:0 0 10px;color:#173fb5}.extraction-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}.extraction-fields label{font-size:12px;color:#607086}.extraction-fields input{width:100%;padding:9px;border:1px solid #ccd6e2;border-radius:8px}.routine-toast{position:fixed;right:18px;bottom:18px;z-index:9999;padding:13px 18px;border-radius:12px;background:#173fb5;color:white;box-shadow:0 10px 30px #11224b44}@media(max-width:760px){.routine-hero{flex-direction:column}.shift-badge{width:100%}.routine-config-row{grid-template-columns:60px 1fr}.routine-config-row>*:nth-child(n+3){grid-column:1/-1}.role-member-config{grid-template-columns:1fr 1fr}.role-member-config strong{grid-column:1/-1}.routine-dialog form{padding:16px}.extraction-fields{grid-template-columns:1fr}.routine-order{align-items:flex-start;flex-direction:column}.routine-order button{width:100%}}
.user-crew-select{min-width:118px;padding:.55rem .7rem;border:1px solid #cad5cf;border-radius:10px;background:#fff;color:#18322c;font:inherit;font-weight:700}.user-crew-select:disabled{opacity:.65}
.user-crew-select{min-width:118px;padding:.55rem .7rem;border:1px solid #cad5cf;border-radius:10px;background:#fff;color:#18322c;font:inherit;font-weight:700}.user-crew-select:disabled{opacity:.65}
/* Keep role-exception controls reachable on small mobile screens. */
.routine-dialog{max-height:92dvh;overflow:hidden;overscroll-behavior:contain}
.routine-dialog form{height:min(92dvh,820px);max-height:92dvh;display:flex;flex-direction:column;overflow:hidden}
.routine-dialog form>header{flex:0 0 auto}.routine-dialog .routine-checklist{flex:1 1 auto;max-height:none;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:6px 8px 24px 2px}.routine-dialog form>footer{position:sticky;bottom:0;z-index:3;flex:0 0 auto;margin:14px -24px -24px;padding:14px 24px calc(14px + env(safe-area-inset-bottom));background:#fff;border-top:1px solid #dfe6ec;box-shadow:0 -8px 18px #07162b12}
.routine-dialog.extraction-dialog .extraction-grid{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:4px 8px 28px 2px}
@media(max-width:760px){.routine-dialog form>footer{margin:12px -16px -16px;padding:12px 16px;display:grid;grid-template-columns:1fr 1fr}.routine-dialog form>footer .primary{grid-column:1/-1}}
.shift-roster-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.shift-roster-grid article{display:grid;gap:5px;padding:14px;border-radius:12px;background:#f4f7fb;border:1px solid #dce5f1}.shift-roster-grid article.current{background:#eaf0ff;border-color:#1744bd}.shift-roster-grid span{color:#5d6f84;line-height:1.45}
.generator-dialog form{height:min(92dvh,720px)}.generator-dialog-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;padding:8px 6px 44px}.generator-dialog-body>label{display:grid;gap:8px;margin:12px 0}.generator-dialog-body input,.generator-dialog-body select,.generator-dialog-body textarea{width:100%;min-height:44px}.generator-dialog-body textarea{min-height:120px}
html.routine-modal-open,html.routine-modal-open body{overflow:hidden;overscroll-behavior:none}
html:has(.routine-dialog[open]),body:has(.routine-dialog[open]){overflow:hidden;overscroll-behavior:none}
@media(max-width:760px){.shift-roster-grid{grid-template-columns:1fr}.routine-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}.routine-dialog form{height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);padding:14px}.routine-dialog form>footer{margin:0 -14px -14px;padding:10px 14px calc(10px + env(safe-area-inset-bottom))}.routine-dialog .routine-checklist,.routine-dialog.extraction-dialog .extraction-grid{padding-bottom:max(60px,env(safe-area-inset-bottom))}.generator-dialog-body{padding-bottom:max(72px,calc(env(safe-area-inset-bottom) + 44px))}}
.generator-card{display:flex;align-items:center;justify-content:space-between;gap:18px;border-color:#f0c36b;background:#fffbeb}.generator-card p{margin-bottom:0}.generator-actions{display:flex;flex-wrap:wrap;gap:9px;align-items:center;justify-content:flex-end}.generator-confirmed,.generator-failure-recorded{display:grid;gap:3px;min-width:190px;padding:12px 16px;border-radius:12px;background:#dcfce7;color:#166534}.generator-failure-recorded{background:#fee2e2;color:#b42318}.generator-confirmed small,.generator-failure-recorded small{display:block}.generator-failure-button{border-color:#c73d31;color:#9f1f16;background:#fff5f4}@media(max-width:760px){.generator-card{align-items:stretch;flex-direction:column}.generator-card button{width:100%}.generator-actions{align-items:stretch;flex-direction:column}.generator-actions>*{width:100%}}
.role-table th.operational-today,.role-table td.operational-today{background:#edf5ff;box-shadow:inset 1px 0 #bfdbfe,inset -1px 0 #bfdbfe}
