/* One app shell across desktop, tablet and mobile. */
:root { --app-sidebar:248px; --app-header:100px; --ui-accent:#3159d9; }
body {background:#f4f6fb;color:#17233c;}
body .container {max-width:none;width:100%;padding:0 24px;}
body .topbar,body .app-header,body header {min-height:88px;}
body #mainPanel {display:block!important;position:relative;padding:24px 0 48px;margin-left:0!important;}
body #mainPanel.hidden {display:none!important;}
body.authenticated #mainPanel {padding-left:var(--app-sidebar)!important;}
/* R48: the fixed sidebar is cleared by #mainPanel's padding, so <main> itself must span the window.
   styles.css still centred <main> in a 1500px column (its override keys on an old body class), which
   added the sidebar offset to the centring margin and left a wide empty band left of every page.
   #mainPanel keeps its own 24px right padding, so <main> needs no side margin. */
body.authenticated main {width:auto!important;max-width:none!important;margin:0 0 64px!important;box-sizing:border-box;}
body #appSidebar {position:fixed!important;inset:var(--app-header) auto 0 0!important;width:var(--app-sidebar)!important;max-width:var(--app-sidebar)!important;display:flex!important;flex-direction:column;gap:8px;padding:24px 16px;box-sizing:border-box;overflow:auto;background:#fff;border-right:1px solid #dce2ef;z-index:30;transform:none!important;}
body:not(.authenticated) #appSidebar,body:not(.authenticated) #sectionNav {display:none!important;}
body #appSidebar .tab {width:100%;min-height:44px;text-align:left;border-radius:10px;margin:0;padding:12px 14px;white-space:normal;}
body #appSidebar .tab.active {background:#eaf0ff;color:#2448b2;font-weight:700;}
body #appSidebar #loan-management-nav,body #appSidebar #approvalTabButton,body #appSidebar #r16UserAdminMenu,body #appSidebar #r16PasswordMenu {display:none!important;}
body .tab-content {margin:0!important;max-width:none;width:auto;padding:0 0 0 24px!important;}
body .tab-content.hidden {display:none!important;}
body .panel,body .equipment-card,body .profile-card {border:1px solid #dce2ef;border-radius:14px;background:#fff;padding:20px;box-shadow:0 2px 8px #17233c05;}
body .equipment-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(255px,1fr));gap:18px;}
body button,body .btn {min-height:40px;border-radius:8px;line-height:1.35;padding:9px 14px;cursor:pointer;}
body button:disabled {opacity:.5;cursor:not-allowed;}
body input,body select,body textarea {min-height:42px;border:1px solid #c9d3e6;border-radius:8px;padding:9px 12px;box-sizing:border-box;max-width:100%;}
body label {display:flex;flex-direction:column;gap:6px;font-size:14px;}
body .ops-search {display:flex;flex-wrap:wrap;align-items:end;gap:12px;margin:16px 0;}
body .ops-search input[type=search] {width:300px;}
body .ops-form {display:grid;gap:14px;}
body .ops-table-wrap {width:100%;overflow-x:auto;}
body .ops-table {width:100%;border-collapse:collapse;}
body .ops-table th,body .ops-table td {padding:14px 12px;text-align:left;border-bottom:1px solid #e5eaf3;vertical-align:middle;}
body .badge {display:inline-block;border-radius:6px;padding:4px 8px;font-size:12px;background:#eef2f9;color:#35486b;}
body .badge.unavailable {background:#fee6e6;color:#a51f30;}
body .badge.available {background:#ddf5ed;color:#13674e;}
body .metric-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:24px;}
body .metric-grid .panel {min-width:0;}
body .metric {display:block;font-size:32px;margin-top:8px;}
body .loan-row {display:flex;justify-content:space-between;gap:16px;align-items:center;padding:16px 0;border-bottom:1px solid #e5eaf3;}
body .row-actions {display:flex;gap:8px;flex-wrap:wrap;}
body .integrated-dialog {width:min(560px,calc(100% - 32px));max-height:85vh;overflow:auto;border:0;border-radius:16px;padding:24px;box-sizing:border-box;}
body dialog::backdrop {background:#17233c88;}
body .book-icon {background:#eef2ff;color:#3159d9;display:grid;place-items:center;font-size:44px;height:100px;border-radius:10px;}
body .copy-list {display:grid;gap:10px;max-height:55vh;overflow:auto;}
body .copy-row {padding:14px;}
body .copy-row p {margin:7px 0;overflow-wrap:anywhere;}
body .my-loan-section {margin:16px 0;}
body .my-loan-table {min-width:820px;}
body .my-loan-table td:nth-child(2) {min-width:140px;}
body .equipment-card {min-width:0;overflow-wrap:anywhere;}
body .equipment-card button {margin:12px 6px 0 0;}
body #sectionNav {display:flex;gap:6px;flex-wrap:wrap;}
body .user-label {white-space:nowrap;}
body #brandHomeLink {color:inherit;text-decoration:none;}
@media(max-width:1199px) { :root {--app-sidebar:210px;} body .metric-grid {grid-template-columns:repeat(2,minmax(0,1fr));} }
@media(max-width:767px) {
 :root {--app-sidebar:248px;--app-header:110px;}
 body .container {padding:0 12px;}
 body.authenticated #mainPanel {padding-left:0!important;}
 body.authenticated main {margin:0 0 48px!important;padding:0 16px;}
 body.authenticated #mainPanel {padding-right:0!important;margin-right:0!important;}
 body #appSidebar {transform:translateX(-100%)!important;box-shadow:8px 0 24px #17233c22;}
 body #mainPanel.sidebar-open #appSidebar {transform:translateX(0)!important;}
 body .tab-content {padding:0!important;}
 body .ops-search {display:grid;grid-template-columns:1fr;}
 body .ops-search input[type=search] {width:100%;}
 body .loan-row {align-items:flex-start;flex-direction:column;}
 body .metric-grid {gap:10px;}
 body .metric-grid .panel {padding:14px;}
 body .my-loan-section {padding:12px;}
 body .top-actions {flex-wrap:wrap;gap:6px;}
 body h1 {font-size:20px;}
 body .subtitle {display:none;}
 body .profile-layout {grid-template-columns:1fr;}
}
