/* Shared ASTM module presentation. Authentication and business handlers stay
   in their existing Razor components; no separate mobile screens are used. */
.app-shell .module-screen { --module-navy:#102b45; --module-gold:#c79b49; --module-ink:#203449; --module-muted:#627487; --module-line:#d5dedf; --module-paper:#fff; min-width:0; color:var(--module-ink); }
.app-shell .module-screen:not([data-module=dashboard]) { font-size:15px; line-height:1.5; }
.app-shell .module-screen:not([data-module=dashboard]) *, .app-shell .module-screen:not([data-module=dashboard]) *::before, .app-shell .module-screen:not([data-module=dashboard]) *::after { box-sizing:border-box; }
.app-shell .module-screen:not([data-module=dashboard]) h1 { margin:0 0 8px; color:var(--module-navy); font-size:clamp(27px,2.5vw,36px); line-height:1.2; letter-spacing:-.025em; text-wrap:balance; scroll-margin-top:16px; }
.app-shell .module-screen:not([data-module=dashboard]) :is(h2,h3) { color:var(--module-navy); line-height:1.3; text-wrap:balance; }
.app-shell .module-screen:not([data-module=dashboard]) :is(.page-head,.page-header,.head-actions,.actions,.row-actions,.buttons,.list-tools,.export-actions,.editor-actions,.modal-actions,.preview-actions) { display:flex; align-items:center; flex-wrap:wrap; gap:10px; min-width:0; }
.app-shell .module-screen:not([data-module=dashboard]) .page-head { justify-content:space-between; margin-bottom:24px; padding-bottom:16px; border-bottom:1px solid var(--module-line); }
.app-shell .module-screen:not([data-module=dashboard]) :is(.filters,.filter-bar,.toolbar,.picker,.tag-filters,.period-picker,.settlement-filters,.driver-filters,.history-filters) { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; min-width:0; max-width:100%; padding:16px; margin:16px 0; border:1px solid var(--module-line); border-radius:9px; background:var(--module-paper); }
.app-shell .module-screen:not([data-module=dashboard]) :is(.filters,.filter-bar,.toolbar,.picker,.tag-filters,.period-picker,.settlement-filters,.driver-filters,.history-filters) > :is(input,select,label) { flex:1 1 180px; min-width:0; max-width:100%; }
.app-shell .module-screen:not([data-module=dashboard]) :is(button,.button,.file-button),
.app-shell .module-screen :is(a.button,a.file-button,a.primary,a.danger,a.delete-action,a.record-link,a.action-button) { min-height:36px; max-width:100%; padding:8px 13px; border:1px solid var(--module-line); border-radius:7px; background:var(--module-paper); color:var(--module-navy); font:inherit; font-weight:600; line-height:1.3; overflow-wrap:anywhere; cursor:pointer; touch-action:manipulation; -webkit-tap-highlight-color:#c79b4935; }
.app-shell .module-screen:not([data-module=dashboard]) :is(button,.button,.file-button):hover,
.app-shell .module-screen :is(a.button,a.file-button,a.primary,a.danger,a.delete-action,a.record-link,a.action-button):hover { border-color:#a1813c; background:#fffaf0; }
.app-shell .module-screen :is(a.button,a.file-button,a.primary,a.danger,a.delete-action,a.record-link,a.action-button) { display:inline-flex; align-items:center; justify-content:center; text-align:center; text-decoration:none; vertical-align:middle; }
.app-shell .module-screen:not([data-module=dashboard]) :is(.row-actions,.row-buttons,.actions,.buttons,.export-actions) > a:not(.button):not(.primary):not(.danger):not(.delete-action),
.app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] > tbody > tr > td:last-child > a:not(.button):not(.primary):not(.danger):not(.delete-action) { display:inline-flex; align-items:center; justify-content:center; min-height:36px; max-width:100%; padding:8px 13px; border:1px solid var(--module-line); border-radius:7px; background:var(--module-paper); color:var(--module-navy); font:inherit; font-weight:600; line-height:1.3; text-align:center; text-decoration:none; overflow-wrap:anywhere; vertical-align:middle; cursor:pointer; touch-action:manipulation; -webkit-tap-highlight-color:#c79b4935; }
.app-shell .module-screen:not([data-module=dashboard]) :is(.row-actions,.row-buttons,.actions,.buttons,.export-actions) > a:not(.button):not(.primary):not(.danger):not(.delete-action):hover,
.app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] > tbody > tr > td:last-child > a:not(.button):not(.primary):not(.danger):not(.delete-action):hover { border-color:#a1813c; background:#fffaf0; text-decoration:none; }
.app-shell .module-screen:not([data-module=dashboard]) :is(.primary,button.primary,.action-button:not(.secondary)) { background:var(--module-navy)!important; border-color:var(--module-gold); color:#fff!important; }
.app-shell .module-screen:not([data-module=dashboard]) :is(button.danger,button.delete-action,a.danger,a.delete-action) { color:#9d242b; border-color:#ddb6b8; }
.app-shell .module-screen:not([data-module=dashboard]) button:disabled { opacity:.6; cursor:default; }
.app-shell .module-screen:not([data-module=dashboard]) :is(a,button,input,select,textarea,summary):focus-visible { outline:3px solid #3477a8; outline-offset:3px; }
.app-shell .module-screen:not([data-module=dashboard]) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]),select,textarea) { min-width:0; max-width:100%; min-height:40px; padding:9px 11px; border:1px solid #b9c9d2; border-radius:7px; background:#fff; color:var(--module-ink); font:inherit; }
.app-shell .module-screen:not([data-module=dashboard]) textarea { width:100%; min-height:96px; resize:vertical; }
.app-shell .module-screen:not([data-module=dashboard]) input[type=file] { width:100%; min-width:0; max-width:100%; }
.app-shell .module-screen:not([data-module=dashboard]) :is(input[type=checkbox],input[type=radio]) { flex:none; width:20px; height:20px; accent-color:var(--module-navy); }
.app-shell .module-screen:not([data-module=dashboard]) :is(.check,.sent-check) { display:flex; flex-wrap:wrap; align-items:center; gap:8px; min-height:44px; }
.app-shell .module-screen:not([data-module=dashboard]) :is(.grid,.form-grid,.editor-grid,.extended-grid,.fields,.two,.role-grid,.sef-grid,.columns) { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr)); gap:14px; min-width:0; }
.app-shell .module-screen:not([data-module=dashboard]) :is(.grid,.form-grid,.editor-grid,.extended-grid,.fields,.two,.role-grid,.sef-grid,.columns) > * { min-width:0; max-width:100%; }
.app-shell .module-screen:not([data-module=dashboard]) :is(.grid,.form-grid,.editor-grid,.extended-grid,.fields,.two) > label { display:grid; gap:6px; color:#29455f; font-weight:600; }
.app-shell .module-screen:not([data-module=dashboard]) :is(.card,.table-card,.editor-card,.driver-editor,.absence-editor,.order-editor,.vehicle-editor,.sef-card) { min-width:0; max-width:100%; padding:20px; border:1px solid var(--module-line); border-top:3px solid var(--module-gold); border-radius:9px; background:var(--module-paper); box-shadow:0 5px 16px #122e4508; }
.app-shell .module-screen:not([data-module=dashboard]) :is(.tabs,.vehicle-tabs,.invoice-tabs) { display:flex; flex-wrap:wrap; gap:7px; padding-bottom:10px; border-bottom:1px solid var(--module-line); }
.app-shell .module-screen:not([data-module=dashboard]) :is(.tabs,.vehicle-tabs,.invoice-tabs) > button.active { background:var(--module-navy); color:#fff; border-color:var(--module-gold); }
.app-shell .module-screen:not([data-module=dashboard]) :is(.summary,.metrics,.decision-summary,.settlement-summary) { display:flex; flex-wrap:wrap; gap:12px; min-width:0; }
.app-shell .module-screen:not([data-module=dashboard]) :is(.summary,.metrics,.decision-summary,.settlement-summary) > * { min-width:0; max-width:100%; }
.app-shell .module-screen:not([data-module=dashboard]) :is(.error,.editor-error) { padding:12px 14px; border-radius:7px; background:#fff0f0; color:#9d242b; overflow-wrap:anywhere; }
.app-shell .module-screen:not([data-module=dashboard]) :is(.empty,.notice,.hint,.copy-info,.editor-note) { overflow-wrap:anywhere; }
.app-shell .module-screen:not([data-module=dashboard]) .module-table-wrap { min-width:0; max-width:100%; width:100%; overflow-x:auto; overscroll-behavior-x:contain; }
.app-shell .module-screen:not([data-module=dashboard]) .module-table-wrap > table { width:100%; min-width:760px; border-collapse:collapse; background:#fff; font-size:14px; }
.app-shell .module-screen:not([data-module=dashboard]) .module-table-wrap :is(th,td) { padding:12px; border:0; border-bottom:1px solid #e4e9eb; text-align:left; vertical-align:top; }
.app-shell .module-screen:not([data-module=dashboard]) .module-table-wrap th { color:var(--module-navy); background:#edf1f2; font-size:13px; font-weight:700; }
.app-shell .module-screen:not([data-module=dashboard]) .module-table-wrap td { color:var(--module-ink); font-variant-numeric:tabular-nums; }
.app-shell .module-screen:not([data-module=dashboard]) .module-table-wrap :is(tr.selected,tr.active-row) > td { background:#fff8e7; }
.app-shell .module-screen:not([data-module=dashboard]) .module-table-wrap td::before { display:none; }
.app-shell .module-screen:not([data-module=dashboard]) :is(.company-layout,.vehicle-layout,.layout) { min-width:0; }
.app-shell .module-screen:not([data-module=dashboard]) :is(.company-layout,.vehicle-layout,.layout) > * { min-width:0; max-width:100%; }
.app-shell .module-screen:not([data-module=dashboard]) [data-module-overlay] { z-index:100; padding:18px; overscroll-behavior:contain; }
.app-shell .module-screen:not([data-module=dashboard]) [data-module-dialog] { min-width:0; max-width:100%; max-height:calc(100dvh - 36px); overflow:auto; overscroll-behavior:contain; background:#fff; border-radius:10px; border-top:3px solid var(--module-gold); }
.app-shell .module-screen:not([data-module=dashboard]) :is(iframe,video,img,canvas) { max-width:100%; }
@media(max-width:880px) {
    .app-shell .module-screen:not([data-module=dashboard]) :is(button,.button,.file-button),
.app-shell .module-screen :is(a.button,a.file-button,a.primary,a.danger,a.delete-action,a.record-link,a.action-button) { min-height:44px; }
    .app-shell .module-screen:not([data-module=dashboard]) :is(.row-actions,.row-buttons,.actions,.buttons,.export-actions) > a:not(.button):not(.primary):not(.danger):not(.delete-action),
    .app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] > tbody > tr > td:last-child > a:not(.button):not(.primary):not(.danger):not(.delete-action) { min-height:44px; }
    .app-shell .module-screen:not([data-module=dashboard]) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea) { font-size:16px; min-height:44px; }
    .app-shell .module-screen:not([data-module=dashboard]) :is(.company-layout,.vehicle-layout,.layout,.columns) { display:grid; grid-template-columns:minmax(0,1fr); }
    .app-shell .module-screen:not([data-module=dashboard]) :is(.editor,.editor-card,.card-editor,.form-editor,.driver-editor,.absence-editor,.order-editor,.vehicle-editor,.invoice-modal,.link-modal,.import-modal,.nbs-modal,.details) { min-width:0; max-width:100%; }
    .app-shell .module-screen:not([data-module=dashboard]) [data-module-overlay] { padding:10px; align-items:flex-start; }
    .app-shell .module-screen:not([data-module=dashboard]) [data-module-dialog] { width:100%!important; max-width:100%!important; max-height:calc(100dvh - 20px); margin:0; padding:16px; }
}
@media(max-width:880px) {
    .app-shell .module-screen:not([data-module=dashboard]) :is(.filters,.filter-bar,.toolbar,.picker,.tag-filters,.period-picker,.settlement-filters,.driver-filters,.history-filters) { padding:13px; }
    .app-shell .module-screen:not([data-module=dashboard]) :is(.filters,.filter-bar,.toolbar,.picker,.tag-filters,.period-picker,.settlement-filters,.driver-filters,.history-filters) > :is(input,select,label) { flex-basis:100%; width:100%; }
    .app-shell .module-screen:not([data-module=dashboard]) :is(.grid,.form-grid,.editor-grid,.extended-grid,.fields,.two,.role-grid,.sef-grid,.columns) { grid-template-columns:minmax(0,1fr); }
    .app-shell .module-screen:not([data-module=dashboard]) :is(.card,.table-card,.editor-card,.driver-editor,.absence-editor,.order-editor,.vehicle-editor,.sef-card) { padding:15px; }
    .app-shell .module-screen:not([data-module=dashboard]) .module-table-wrap { overflow:visible; }
    .app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] { display:block; width:100%; min-width:0!important; background:transparent; }
    .app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] > thead { position:absolute; width:1px; height:1px; padding:0; margin:-1px; clip-path:inset(50%); overflow:hidden; white-space:nowrap; }
    .app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] > :is(tbody,tfoot) { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; width:100%; }
    .app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] > :is(tbody,tfoot) > tr { display:grid; grid-template-columns:minmax(0,1fr); min-width:0; padding:13px; border:1px solid var(--module-line); border-radius:9px; background:#fff; box-shadow:0 4px 12px #122e4506; }
    .app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] :is(td,tbody th,tfoot th) { display:block; min-width:0; max-width:100%; width:auto!important; padding:8px 0; border-bottom:1px solid #edf0f1; text-align:left!important; white-space:normal; overflow-wrap:anywhere; }
    .app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] :is(td,tbody th,tfoot th):last-child { border-bottom:0; }
    .app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] [data-label]::before { content:attr(data-label); display:block; margin:0 0 4px; color:var(--module-muted); font-size:12px; line-height:1.3; font-weight:600; }
    .app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] [data-full-row]::before { display:none; }
    .app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] :is(input:not([type=checkbox]),select,textarea) { width:100%; max-width:100%; }
    .app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] :is(tr.selected,tr.active-row) { border-left:3px solid var(--module-gold); }
    .app-shell .module-screen:not([data-module=dashboard]) :is(.row-actions,.actions,.modal-actions,.editor-actions) { gap:8px; }
}
@media(prefers-reduced-motion:reduce) {
    .app-shell .module-screen:not([data-module=dashboard]) * { scroll-behavior:auto!important; transition:none!important; animation:none!important; }
}
@media print {
    .app-shell .module-screen:not([data-module=dashboard]) .module-table-wrap { overflow:visible; }
    .app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] { display:table; min-width:0; width:100%; }
    .app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] > thead { position:static; display:table-header-group; width:auto; height:auto; margin:0; clip-path:none; overflow:visible; white-space:normal; }
    .app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] > tbody { display:table-row-group; }
    .app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] > tfoot { display:table-footer-group; }
    .app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] > :is(tbody,tfoot) > tr { display:table-row; }
    .app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] :is(th,td) { display:table-cell; padding:5px; }
    .app-shell .module-screen:not([data-module=dashboard]) table[data-module-table] [data-label]::before { display:none; }
}

/* Shared table controls; sorting uses native data, and exports retain all filtered rows. */
button.table-sort{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;border:0;background:transparent;color:inherit;font:inherit;font-weight:inherit;text-align:left;padding:.1rem;cursor:pointer;margin:0}button.table-sort:hover,button.table-sort:focus-visible{color:#916917;outline:2px solid #c2a15c;outline-offset:3px}button.table-sort span{font-size:.7rem;opacity:.7}.table-pager{display:flex;align-items:center;justify-content:flex-end;gap:.5rem;flex-wrap:wrap;padding:.8rem .4rem;background:white;color:#193b52;border-top:1px solid #dce2e7}.table-pager label{display:flex;align-items:center;gap:.4rem;flex-direction:row}.table-pager select{width:auto;min-width:4rem;padding:.4rem}.table-pager button{padding:.4rem .65rem;min-width:2.2rem}.table-pager button:disabled{opacity:.45;cursor:default}@media(max-width:600px){.table-pager{justify-content:flex-start;font-size:.85rem}}@media print{.table-pager{display:none}.table-sort span{display:none}}
/* Preserve native calendars; remove the small accidental stepper target. */
.module-screen input:is([type="date"],[type="datetime-local"],[type="month"],[type="time"])::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.module-screen input:is([type="date"],[type="datetime-local"],[type="month"],[type="time"])::-webkit-calendar-picker-indicator { cursor: pointer; padding: 4px; }
.module-screen input[data-date-invalid="true"] { border-color: #b42318 !important; outline-color: #b42318; }
