/* Shared workspace layout. Kept separate from document and print styling. */
@media screen {
  :root { --workspace-line:#e3e7e1; --workspace-muted:#68756b; --mobile-nav-height:calc(64px + env(safe-area-inset-bottom,0px)); }
  .app-layout { padding-inline-start:236px; background:#f5f6f2; }
  .app-layout, .app-layout .page-content, .app-layout .panel, .app-layout .topbar { min-width:0; }
  .app-layout .sidebar { width:236px; background:#103c2c; box-shadow:none; }
  .app-layout .sidebar-brand { min-height:88px; padding:20px 18px; gap:11px; border-color:#ffffff15; }
  .app-layout .sidebar-logo { width:38px; height:42px; object-fit:contain; }
  .app-layout .sidebar-brand strong { font-size:15px; letter-spacing:.2px; }
  .app-layout .sidebar-brand small { font-size:10px; margin-top:3px; color:#c1cabe; }
  .app-layout .sidebar-scroll { padding:12px 10px; overscroll-behavior:contain; scrollbar-width:thin; }
  .app-layout .nav-group summary { min-height:45px; padding:11px 10px; font-size:12.5px; gap:10px; line-height:1.6; }
  .app-layout .nav-group summary .icon { width:18px; height:18px; flex-shrink:0; }
  .app-layout .nav-subitem { min-height:42px; font-size:12px; line-height:1.7; padding:10px 15px; }
  .app-layout .sidebar-footer { padding:14px 16px; border-color:#ffffff15; }
  .app-layout .workspace-caption { gap:9px; }
  .app-layout .workspace-caption span { font-size:10px; }
  .app-layout .workspace-caption small { display:none; }
  .app-layout .topbar { height:68px; background:#fff; color:#193d2c; padding-inline:30px; border-bottom:1px solid var(--workspace-line); box-shadow:none; }
  .app-layout .topbar-path, .app-layout .topbar-date { color:var(--workspace-muted); }
  .app-layout .topbar-path strong, .app-layout .profile-copy strong { color:#193d2c; }
  .app-layout .profile-copy small { color:var(--workspace-muted); }
  .app-layout .profile-chip { border-color:var(--workspace-line); background:#fff; }
  .app-layout .topbar .icon-button { color:#526457; background:#fff; }
  .app-layout .page-content { max-width:1360px; padding:28px 30px 36px; }
  .app-layout .panel { border:1px solid var(--workspace-line); border-radius:16px; box-shadow:0 2px 4px #16302003; }
  .app-layout .panel-head { border-color:var(--workspace-line); }
  .app-layout .page-heading { gap:16px; }
  .app-layout .page-heading h1 { font-size:25px; line-height:1.5; letter-spacing:0; }
  .app-layout .app-footer { color:#7a857c; border-color:var(--workspace-line); font-size:11px; margin-top:24px; padding-top:18px; }
  .taiba-dashboard { gap:22px; }
  .dashboard-welcome { padding:0; align-items:center; }
  .dashboard-welcome p { font-size:13px; color:var(--workspace-muted); margin:0 0 3px; }
  .dashboard-welcome h1 { font-size:28px; font-weight:800; line-height:1.5; }
  .dashboard-welcome time { color:var(--workspace-muted); font-size:12px; }
  .dashboard-search-form { min-height:48px; padding:2px 12px; gap:8px; border-color:var(--workspace-line); border-radius:11px; box-shadow:none; }
  .app-layout .dashboard-search-form input { font-size:14px; height:42px; }
  .dashboard-search-form>button { min-height:42px; font-size:12px; }
  .dashboard-search-unified { grid-template-columns:105px minmax(0,1fr) 44px; }
  .dashboard-search-unified select { width:100%; min-width:0; height:40px; padding:6px 8px; border:0; border-inline-end:1px solid var(--workspace-line); border-radius:0; background:#fff; color:#415b48; font:inherit; font-size:13px; }
  .dashboard-search-unified>button { display:grid; place-items:center; background:#f0f5eb; color:#215332; width:36px; min-width:36px; height:36px; min-height:36px; justify-self:end; }
  .dashboard-search-unified>button .icon { width:18px; height:18px; }
  .taiba-dashboard .dashboard-shortcuts { gap:10px; }
  .dashboard-shortcuts .erp-shortcut { min-height:90px; border:1px solid var(--workspace-line); border-radius:12px; box-shadow:none; gap:8px; transition:background .15s,border-color .15s; }
  .dashboard-shortcuts .erp-shortcut>span { width:32px; height:32px; border-radius:9px; background:#f0f5ef; }
  .dashboard-shortcuts .erp-shortcut .icon { width:19px; height:19px; }
  .dashboard-shortcuts .erp-shortcut strong { font-size:12px; font-weight:600; }
  .dashboard-shortcuts .erp-shortcut:hover { background:#f7faf6; border-color:#b7c8b9; transform:none; }
  .dashboard-workspace-head { padding:20px 22px 14px; }
  .dashboard-workspace-head h2 { font-size:17px; }
  .dashboard-workspace-head p { color:var(--workspace-muted); font-size:12px; margin-top:3px; }
  .dashboard-workspace-head .text-link { min-height:44px; font-size:12px; }
  .dashboard-tabs { margin:0 22px; padding:0; gap:26px; border-color:var(--workspace-line); }
  .dashboard-tabs>button { min-height:48px; font-size:13px; padding:12px 4px; gap:7px; color:var(--workspace-muted); }
  .dashboard-tabs>button[aria-selected=true] { color:#124a30; border-bottom-color:#b69242; }
  .dashboard-tabs>button>span { font-size:10px; min-width:18px; background:#eef2ec; color:#526457; }
  .dashboard-tab-panel { padding:22px; }
  .dashboard-metric-grid { gap:14px; margin-bottom:22px; }
  .dashboard-metric { min-height:126px; padding:18px 16px; gap:9px; border-color:var(--workspace-line); border-radius:12px; box-shadow:none; background:#fff; }
  .dashboard-metric:first-child { background:#f3f7f1; border-color:#d9e4d5; }
  .dashboard-metric>span { color:#506252; font-size:13px; padding-inline-end:25px; line-height:1.5; }
  .dashboard-metric>strong { font-size:32px; font-weight:700; line-height:1.15; font-variant-numeric:tabular-nums; }
  .dashboard-metric>small { font-size:11px; color:var(--workspace-muted); line-height:1.6; }
  .dashboard-metric>.icon { width:18px; height:18px; color:#879e82; inset-inline-end:15px; top:19px; }
  .dashboard-widget { border-color:var(--workspace-line); border-radius:12px; overflow:hidden; }
  .dashboard-widget-head { padding:14px 16px; background:#fafbf8; border-color:var(--workspace-line); }
  .dashboard-widget-head h3 { font-size:13px; }
  .dashboard-widget-head>span { color:var(--workspace-muted); font-size:11px; }
  .dashboard-empty { min-height:206px; padding:22px 16px; }
  .dashboard-empty>span { background:#f1f5ee; color:#668160; width:42px; height:42px; border-radius:50%; }
  .dashboard-empty h3 { font-size:15px; }
  .dashboard-empty p { color:var(--workspace-muted); font-size:12px; line-height:1.8; }
  .dashboard-section-links>button { font-size:12px; border-color:#eef1eb; }
  .dashboard-account-activity .panel-head { background:#fff; }
  .app-layout .activity-item { border-color:#e9ede6; }
  .dashboard-report-grid>article { border-color:var(--workspace-line); }
  .app-layout .table-wrap { max-width:100%; overscroll-behavior-inline:contain; }
  .app-layout .form-grid>.field { min-width:0; }
}

@media screen and (max-width:1100px) and (min-width:921px) {
  .app-layout { padding-inline-start:220px; }
  .app-layout .sidebar { width:220px; }
  .app-layout .page-content { padding-inline:22px; }
  .taiba-dashboard .dashboard-shortcuts { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .dashboard-shortcuts .erp-shortcut { flex-direction:row; justify-content:flex-start; min-height:58px; padding:10px 12px; }
}

@media screen and (max-width:920px) {
  body.drawer-open { overflow:hidden; }
  .app-layout { padding-inline-start:0; }
  .app-layout .sidebar { width:min(74vw,264px); height:100dvh; padding:0; border-radius:20px 0 0 20px; overflow:hidden; }
  .app-layout .sidebar-brand { min-height:86px; padding:19px 14px; padding-inline-end:44px; gap:9px; }
  .app-layout .sidebar-brand strong { font-size:13px; white-space:nowrap; }
  .app-layout .sidebar-logo { width:31px; height:38px; }
  .app-layout .sidebar-close { width:36px; height:36px; min-height:36px; top:25px; left:8px; border-radius:10px; }
  .app-layout .sidebar-scroll { padding:8px; }
  .app-layout .nav-group summary { font-size:12px; min-height:46px; padding:10px 9px; }
  .app-layout .drawer-overlay.open { background:#122a2066; backdrop-filter:blur(3px); }
  .app-layout .topbar { height:60px; padding-inline:16px; gap:12px; }
  .app-layout .topbar-left { min-width:0; gap:10px; }
  .app-layout .mobile-menu { width:40px; min-width:40px; min-height:40px; height:40px; background:#f5f7f2; border:0; border-radius:10px; }
  .app-layout .topbar .show-mobile { display:flex; align-items:center; gap:7px; font-size:14px; font-weight:750; white-space:nowrap; }
  .app-layout .show-mobile img { width:24px; height:26px; object-fit:contain; }
  .app-layout .topbar-right { gap:6px; }
  .app-layout .topbar .profile-chip { padding:0; height:40px; border:0; }
  .app-layout .topbar .avatar { width:34px; height:34px; font-size:11px; background:#eef3e9; color:#215332; border:1px solid #e0e8d9; }
  .app-layout .topbar .icon-button { width:34px; min-width:34px; min-height:40px; height:40px; padding:7px; }
  .app-layout .page-content { padding:22px 20px 34px; }
}

@media screen and (max-width:740px) {
  .app-layout .page-content { padding:22px 16px calc(var(--mobile-nav-height) + 24px); }
  .app-layout .panel { border-radius:14px; }
  .taiba-dashboard { gap:18px; }
  .dashboard-welcome { gap:10px; flex-wrap:nowrap; align-items:flex-end; }
  .dashboard-welcome p { font-size:12px; margin-bottom:4px; }
  .dashboard-welcome h1 { font-size:25px; line-height:1.4; }
  .dashboard-welcome time { font-size:10px; padding-bottom:4px; white-space:nowrap; margin:0; }
  .dashboard-search-grid { gap:8px; grid-template-columns:1fr; }
  .dashboard-search-form { min-height:46px; padding:0 10px; border-radius:10px; }
  .app-layout .dashboard-search-form input { height:44px; font-size:16px; }
  .dashboard-search-form input::placeholder { font-size:12px; }
  .dashboard-search-form>.icon { width:17px; height:17px; }
  .dashboard-search-form>button { min-height:44px; font-size:12px; }
  .dashboard-search-unified { grid-template-columns:87px minmax(0,1fr) 36px; gap:8px; }
  .dashboard-search-unified select { font-size:13px; padding-inline:4px; }
  .dashboard-search-unified>button { min-height:36px; }
  .taiba-dashboard .dashboard-shortcuts { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .dashboard-shortcuts .erp-shortcut { flex-direction:row; justify-content:flex-start; min-height:54px; padding:9px 10px; gap:8px; border-radius:11px; text-align:start; }
  .dashboard-shortcuts .erp-shortcut>span { width:28px; height:28px; flex-shrink:0; border-radius:8px; }
  .dashboard-shortcuts .erp-shortcut strong { font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
  .dashboard-shortcuts .erp-shortcut .icon { width:17px; height:17px; }
  .dashboard-workspace-head { padding:16px 14px 10px; }
  .dashboard-workspace-head h2 { font-size:16px; }
  .dashboard-workspace-head p { font-size:11px; line-height:1.6; max-width:210px; }
  .dashboard-workspace-head .text-link { font-size:11px; gap:5px; }
  .dashboard-tabs { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); gap:4px; margin:0 14px; padding:0; overflow:visible; }
  .dashboard-tabs>button { justify-content:center; min-width:0; min-height:46px; padding:10px 3px; gap:5px; font-size:12px; white-space:normal; }
  .dashboard-tabs>button>.icon { display:none; }
  .dashboard-tabs>button>span { font-size:10px; min-width:17px; padding-inline:4px; }
  .dashboard-tab-panel { padding:14px; }
  .dashboard-metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:14px; }
  .dashboard-metric { min-height:112px; padding:13px 11px; gap:9px; border-radius:10px; }
  .dashboard-metric>span { font-size:12px; padding:0; }
  .dashboard-metric>strong { font-size:29px; line-height:1.1; }
  .dashboard-metric>small { font-size:10px; line-height:1.7; }
  .dashboard-metric>.icon { display:none; }
  .dashboard-overview-columns { grid-template-columns:1fr; gap:14px; }
  .dashboard-widget-head { padding:12px; align-items:center; }
  .dashboard-widget-head h3 { font-size:12px; }
  .dashboard-widget-head>span { font-size:10px; }
  .dashboard-empty { min-height:168px; padding:20px 12px; }
  .dashboard-empty h3 { font-size:14px; }
  .dashboard-empty p { font-size:12px; }
  /* These section links repeat the full drawer and quick links above. */
  .dashboard-sections { display:none; }
  .dashboard-account-activity .panel-head { padding:14px; }
  .dashboard-account-activity .panel-head h2 { font-size:14px; }
  .app-layout .activity-item { padding:13px 14px; align-items:flex-start; gap:9px; }
  .app-layout .activity-description { font-size:12px; line-height:1.8; }
  .app-layout .activity-description small { font-size:11px; line-height:1.8; margin-top:3px; }
  .app-layout .activity-time { font-size:10px; line-height:1.8; max-width:63px; }
  .app-layout .activity-icon { width:29px; height:29px; min-width:29px; }
  .app-layout .mobile-bottom { height:var(--mobile-nav-height); padding:5px 12px calc(5px + env(safe-area-inset-bottom,0px)); border-color:var(--workspace-line); box-shadow:0 -4px 18px #15302508; background:#fff; }
  .app-layout .mobile-bottom .bottom-item { min-height:48px; gap:4px; border-radius:11px; font-size:10px; }
  .app-layout .mobile-bottom .bottom-item.active { background:#eef4e9; color:#164a2c; }
  .app-layout .mobile-bottom .bottom-item .icon { width:20px; height:20px; }
  .erp-sticky-actions { bottom:var(--mobile-nav-height); padding:10px 12px; margin-inline:0; gap:10px; border-radius:12px; }
  .erp-sticky-actions>span { font-size:10px; }
  .app-layout .field input, .app-layout .field select, .app-layout .field textarea, .erp-action-modal .field input, .erp-action-modal .field select, .erp-action-modal .field textarea { font-size:16px; }
  .app-layout .field label { font-size:13px; }
  .app-layout .page-heading h1 { font-size:23px; }
  .app-layout .page-heading .subtitle { font-size:12px; line-height:1.8; }
  .app-layout .app-footer { margin-top:18px; padding-top:16px; gap:5px; font-size:10px; text-align:center; justify-content:center; flex-wrap:wrap; }
  .app-layout .app-footer>span:last-child { display:none; }
}

@media screen and (max-width:430px) {
  .erp-record-top .form-grid { grid-template-columns:minmax(0,1fr); }
  .erp-record-top .form-grid .field { grid-column:auto; }
  .erp-sticky-actions { flex-wrap:wrap; }
  .erp-sticky-actions>div { margin-inline-start:auto; }
}

@media (prefers-reduced-motion:reduce) {
  .app-layout .sidebar, .dashboard-shortcuts .erp-shortcut { transition:none; }
}
