/* APEX editorial palette. Screen-only: issued documents keep their own print design. */
@media screen {
  :root { --ink:#203149; --ink-2:#3d526d; --paper:#f1f4f8; --panel:#ffffff; --line:#d7e0eb; --muted:#617187; --mint:#e5edf9; --mint-strong:#355faa; --blue:#e6edf9; --shadow:0 10px 35px #17283e0a; }
  body { background:#f1f4f8; color:var(--ink); }
  body .app-shell .main { background:#f1f4f8; }
  body .app-shell .sidebar,body .app-shell:has(#view-mobile.active) > .sidebar { background:#17283e; border-right:1px solid #293e59; }
  body .app-shell .sidebar .brand { border-bottom-color:#344963; }
  body .app-shell .nav-item { color:#d5e0ee; border-radius:7px; transition:background-color .15s,color .15s; }
  body .app-shell .nav-item:hover { background:#2a4161; color:#fff; }
  body .app-shell .nav-item.active { background:#2f4d75; color:#fff; box-shadow:inset 3px 0 #86adff; }
  body .app-shell .nav-item.active :is(.nav-label,.nav-icon) { color:#fff; }
  body .app-shell .topbar { background:#fff; border-bottom:1px solid #d7e0eb; box-shadow:0 2px 8px #17283e03; }
  body .app-shell :is(.primary-button,.filter-search-button) { background:#263f61; color:#fff; border-color:#263f61; }
  body .app-shell :is(.primary-button,.filter-search-button):hover:not(:disabled) { background:#355986; }
  body .app-shell .soft-button { background:#e7eef8; color:#2e4d76; border-color:#d8e2f0; }
  body .app-shell :is(.workspace-tab,.tab-button,.report-category-tab).active { background:#263f61; color:#fff; border-color:#263f61; }
  body .app-shell :is(.panel,.report-card,.overall-status-panel,.insight-card) { border-color:#d7e0eb; }
  body .app-shell .hero-card { background:#203654; color:#fff; border-color:#203654; }
  body .app-shell .hero-card :is(h2,strong,.section-kicker) { color:#fff; }
  body .app-shell .hero-card :is(p,small) { color:#d4e0ef; }
  body .app-shell #view-ai .ai-hero { background:#203654; border:1px solid #203654; border-radius:12px; }
  body .app-shell #view-ai .ai-hero h3 { color:#fff; }
  body .app-shell #view-ai .ai-hero p { color:#e2ebf7; line-height:1.55; }
  /* Empty financial tables need no off-screen columns or horizontal scrolling. */
  @media(max-width:820px) {
    body .app-shell #claim-settlement-print-area .claim-settlement-table:has(.financial-empty-row) { min-width:0; }
    body .app-shell :is(.invoice-list-table,.claim-settlement-table):has(.financial-empty-row) { display:block; width:100%; min-width:0; }
    body .app-shell :is(.invoice-list-table,.claim-settlement-table):has(.financial-empty-row) thead { display:none; }
    body .app-shell :is(.invoice-list-table,.claim-settlement-table):has(.financial-empty-row) tbody,
    body .app-shell .financial-empty-row,
    body .app-shell .financial-empty-row td { display:block; box-sizing:border-box; width:100%; min-width:0; white-space:normal; }
    body .app-shell .financial-empty-row td { padding:18px 12px; text-align:center; }
    body .app-shell .financial-empty-row :is(strong,small,span) { display:block; white-space:normal; overflow-wrap:anywhere; }
    body .app-shell .financial-empty-row small { margin-top:6px; }
    body .app-shell .financial-empty-row .invoice-empty { padding:0; }
  }
  body .app-shell .overall-status-panel { background:transparent; padding:0; border:0; }
  body .app-shell .overall-status-head { padding:14px 0; }
  #view-ai.showing-performance > :is(.ai-hero,.insight-grid) { display:none; }
  body .app-shell .report-category-tabs { padding:4px; border:1px solid #d7e0eb; background:#fff; border-radius:9px; gap:4px; margin-bottom:20px; grid-template-columns:repeat(4,minmax(0,1fr)); }
  @media(max-width:700px) { body .app-shell .report-category-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); } }
  body .app-shell .report-category-tab { border-radius:6px; border:0; min-height:40px; }
  body .app-shell input:focus-visible,body .app-shell select:focus-visible,body .app-shell textarea:focus-visible,body .app-shell button:focus-visible { outline:2px solid #5078c4; outline-offset:2px; }
  body .app-shell #detail-visits-panel .visit-form { background:#fafcff; border-color:#cbd8e8; }
  #ticket-detail-modal .ticket-detail-modal { background:#f7f9fc; border-color:#ccd8e6; }
  #ticket-detail-modal .detail-tab.active { background:#263f61; color:#fff; border-color:#263f61; }
  #ticket-detail-modal .soft-button { background:#e7eef8; color:#2e4d76; border-color:#d8e2f0; }
  #ticket-detail-modal .primary-button { background:#263f61; color:#fff; border-color:#263f61; }
  #ticket-detail-modal .service-save-row { background:#f0f4fa; border-color:#cbd8e8; }
  #ticket-detail-modal #detail-visits-panel .visit-form { background:#fff; border-color:#cbd8e8; }
  #ticket-detail-modal .detail-record-header { color:#203149; }
  .previous-visit-readonly .service-notes-workflow,.previous-visit-readonly .service-status-grid,.previous-visit-readonly .service-advanced-fields > .visit-er-grid,.previous-visit-readonly .service-button-explainer { display:none; }
  .previous-visit-readonly .service-visit-guidance { border-left:3px solid #5879a8; background:#eaf0f9; color:#2e4d76; padding:14px; }
  .feature-new-badge { display:inline-flex; align-items:center; justify-content:center; margin-left:7px; padding:2px 6px; background:#dbe8ff; color:#244c99; border:1px solid #90afdf; border-radius:4px; font-size:.625rem; font-weight:800; line-height:1.25; letter-spacing:.055em; vertical-align:middle; flex-shrink:0; animation:apex-new-arrival 1.2s ease-in-out 3; }
  @keyframes apex-new-arrival { 0%,100% { box-shadow:0 0 0 0 #6490e300; } 50% { box-shadow:0 0 0 4px #6490e331; } }
  @media(prefers-reduced-motion:reduce) { .feature-new-badge { animation:none; } body .app-shell .nav-item { transition:none; } }
  @media(max-width:700px) {
    body .app-shell > .main { padding-bottom:max(112px,env(safe-area-inset-bottom)); }
  }
}
:root #session-expiry-notice {
  position:fixed; top:12px; left:50%; transform:translateX(-50%); z-index:12000;
  width:max-content; max-width:calc(100vw - 32px); padding:12px 18px;
  background:#fff4ce; color:#513a00; border:1px solid #c18b24; border-radius:10px;
  box-shadow:0 8px 24px #14213d26; font:600 .875rem/1.5 system-ui,sans-serif;
}
body:not([data-app-surface="app"]) #session-expiry-notice { display:none; }
.account-signout-row { display:flex; align-items:center; gap:8px; min-width:0; }
#mobile-welcome { display:none; }
@media screen and (max-width:820px) {
  #mobile-welcome { display:block; color:#344e70; font-size:.875rem; font-weight:650; line-height:1.3; max-width:190px; overflow-wrap:anywhere; }
  .account-signout-row { max-width:100%; }
  body .app-shell #sign-out-button { flex-shrink:0; min-height:40px; font-size:.8125rem; }
  #mobile-welcome.compact-account-name .mobile-welcome-prefix { display:none; }
}
@media screen and (max-width:360px) {
  #mobile-welcome .mobile-welcome-prefix { display:none; }
}
