/* Presentation only. Screen rules leave the existing print styles intact.
   Scope document edits away from Summary's PDF clone. No visibility overrides:
   authentication and hidden/disabled states remain owned by the application. */
@media screen {
  body {
    --bg0: #0c1420;
    --bg1: #111e2d;
    --panel: #152334;
    --panel2: #132131;
    --stroke: #2b3d50;
    --stroke2: #3b5269;
    --text: #edf3fa;
    --muted: #aebed0;
    --accent: #24b5ad;
    --accent2: #309dca;
    --shadow: 0 8px 28px #00000024;
  }
  body:not(.page-login) {
    margin: 0;
    padding: 24px;
    background: radial-gradient(ellipse at 90% 0, #1b384748, transparent 55%), #0c1420;
    color: var(--text);
  }
  .document-table-scroll, #mainContent > .master-table-section {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
  }
  body > header.app-header {
    background: #101c2bf2;
    border: 1px solid #2b3d50;
    border-radius: 16px;
    box-shadow: 0 8px 24px #00000020;
    margin-bottom: 28px;
    top: 12px;
  }
  header.app-header .app-nav {
    max-width: 1440px;
    padding: 12px;
    gap: 12px;
  }
  header.app-header .nav-left { gap: 3px; }
  header.app-header .nav-link {
    font: 500 13px/1.5 "Inter", "Segoe UI", Arial, sans-serif;
    color: #b8c7d8;
    border-radius: 9px;
    padding: 10px 12px;
    transition: background .15s, color .15s;
  }
  header.app-header .nav-link:hover { background: #213348; color: #fff; }
  header.app-header .nav-link.nav-active {
    background: #163e43;
    border-color: #28716f;
    color: #9aeee5;
    box-shadow: inset 0 -2px #43c2b8;
  }
  header.app-header .nav-logout {
    border: 1px solid #3b5269;
    background: #1c2e42;
    border-radius: 9px;
    padding: 9px 16px;
    font: 600 13px/1.5 "Inter", "Segoe UI", Arial, sans-serif;
    box-shadow: none;
  }
  body #mainContent { max-width: 1320px; margin-inline: auto; }
  #mainContent > h1 {
    text-align: left;
    text-transform: none;
    letter-spacing: -.7px;
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.3;
    margin: 0 0 24px;
    font-weight: 700;
    color: #edf3fa;
  }
  #mainContent > :is(.form-section, .summary-section, .section, .table-section, .client-panel, .toolbar) {
    border: 1px solid #2b3d50;
    border-radius: 14px;
    background: #152334;
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
  }
  #mainContent > .action-buttons {
    background: transparent;
    box-shadow: none;
    border: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  #mainContent :is(.form-row, .field) > label {
    color: #b8c7d8;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
  }
  #mainContent :is(.form-section, .summary-section, .section, .client-panel, .toolbar) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    background: #101c2b;
    color: #edf3fa;
    border: 1px solid #3b5269;
    border-radius: 8px;
    padding: 11px 12px;
    font-size: 14px;
    min-width: 0;
    box-sizing: border-box;
  }
  #mainContent :is(.section, .client-panel, .toolbar, .form-section, .summary-section) option {
    color: #edf3fa;
    background: #101c2b;
  }
  #mainContent input::placeholder, #mainContent textarea::placeholder { color: #91a5bb; opacity: 1; }
  #mainContent :is(.table-section, .section) thead th {
    background: #203449;
    color: #dce8f5;
    font-weight: 600;
    letter-spacing: .3px;
  }
  #mainContent :is(.table-section, .section) tbody tr:hover { background: #ffffff04; }
  #mainContent :is(button, a.primary-btn),
  body > :is(.main-container, .sheet) button,
  #pdfRoot:not(.pdf-export) .actions button {
    border-radius: 8px;
    box-shadow: none;
    font-weight: 600;
    letter-spacing: 0;
  }
  #mainContent :is(.primary-btn:not(.danger-btn), button[type="submit"]),
  #mainContent .action-buttons button:first-child,
  body > .main-container :is(.add-btn, .btn-pdf, .pdf-btn),
  #pdfRoot:not(.pdf-export) .actions .add-btn {
    background: #207c79;
    border: 1px solid #389e98;
    color: #fff;
    text-decoration: none;
  }
  #mainContent :is(.danger-btn, .delete-btn) { background: #542638; border-color: #8f4458; color: #ffced7; }
  #mainContent .client-actions .primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 16px;
  }
  #mainContent button:disabled { opacity: .45; cursor: not-allowed; }
  body :is(button, a, input, select, textarea, summary):focus-visible {
    outline: 2px solid #7ae1d7;
    outline-offset: 3px;
  }
  #mainContent .folders details { background: #101c2b; border-color: #2b3d50; padding: 16px; border-radius: 10px; }
  #mainContent .folders summary { font-weight: 600; letter-spacing: 0; padding: 4px; }
  #mainContent .inv-item { padding-block: 16px; flex-wrap: wrap; }
  #mainContent :is(.inv-meta, .empty) { color: #aebed0; }
  #mainContent .client-panel h2 { font-size: 24px; letter-spacing: -.5px; margin: 0 0 8px; }
  #mainContent .client-panel p { color: #aebed0; line-height: 1.6; }
  #mainContent .client-checkbox { line-height: 1.6; }
  #mainContent .client-panel input[type="checkbox"] { accent-color: #36b9ad; }
  body > :is(.main-container, .sheet), body > #pdfRoot:not(.pdf-export) {
    border-color: #2b3d50;
    border-radius: 14px;
    box-shadow: var(--shadow);
  }
  body > #pdfRoot:not(.pdf-export) :is(.title, .pdf-title) {
    letter-spacing: .3px;
    font-weight: 600;
  }
  body > #pdfRoot:not(.pdf-export) .title { font-size: 26px; text-align: left; margin-block: 24px 16px; }
  body > #pdfRoot:not(.pdf-export) .panel { border-radius: 12px; border-color: #2b3d50; box-shadow: none; }
  body > #pdfRoot:not(.pdf-export) :is(.panel-row, .to-label) { font-size: 13px; font-weight: 500; }
  body > #pdfRoot:not(.pdf-export) :is(input, textarea) { border-radius: 8px; }
  body > #pdfRoot:not(.pdf-export) thead th { background: #203449; font-weight: 600; letter-spacing: .3px; }
  body.page-login {
    padding: 32px 7%;
    min-height: 100vh;
    height: auto;
    background-color: #101c2b;
  }
  body.page-login::before { background: linear-gradient(90deg, #0c14204d, #0c1420d9); }
  .page-login > h1 { position: absolute; top: 36px; left: 7%; transform: none; font-size: 20px; max-width: 80%; }
  .page-login .box {
    width: min(100%, 420px);
    padding: 36px;
    background: #f8fafc;
    border: 1px solid #fff;
    border-radius: 20px;
    box-shadow: 0 24px 70px #00000040;
  }
  .page-login .box h2 { color: #17394a; text-align: left; font-size: 26px; letter-spacing: -.6px; }
  .page-login .sub { text-align: left; line-height: 1.6; margin-bottom: 24px; }
  .page-login .box input { min-height: 46px; border-radius: 8px; }
  .page-login .box button { background: #207c79; min-height: 46px; border-radius: 8px; }
  .page-login .box button:hover { background: #196763; }
  .page-login .footer-note { color: #d7e3ee; }
  @media (max-width: 700px) {
    body:not(.page-login) { padding: 12px; }
    body > header.app-header { top: 6px; margin-bottom: 20px; }
    header.app-header .app-nav { flex-wrap: wrap; padding: 8px; gap: 8px; }
    header.app-header .nav-left { flex: 1 1 100%; }
    header.app-header .nav-link { padding: 8px 10px; font-size: 12px; }
    header.app-header .nav-logout { margin-left: auto; padding: 6px 14px; }
    #mainContent > :is(.form-section, .summary-section, .section, .table-section, .client-panel, .toolbar) { padding: 16px; }
    #mainContent .form-row { gap: 8px; }
    #mainContent .form-row > label { width: 100%; }
    #mainContent .form-row > :is(input, select, textarea) { flex-basis: 100%; width: 100%; }
    body > .main-container:has(.header h4) { margin-right: 0; padding: 14px; }
    body > .main-container:has(.header h4) > div:not(.header) {
      white-space: normal;
      flex-wrap: wrap;
      min-width: 0;
      max-width: 100%;
    }
    body > .main-container:has(.header h4) > div > div { flex: 1 1 100%; min-width: 0; }
    body > .main-container:has(.header h4) .input-1 { min-width: 0; }
    body > .main-container:has(.header h4) .header h4::before,
    body > .main-container:has(.header h4) .header h4::after { display: none; }
    .sheet .document-table-scroll .headerTable { min-width: 600px; }
    body > #pdfRoot:not(.pdf-export) .two-col { grid-template-columns: minmax(0, 1fr); }
    body > #pdfRoot:not(.pdf-export) .panel-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    body > #pdfRoot:not(.pdf-export) #summaryTable { display: block; max-width: 100%; overflow-x: auto; }
    body > #pdfRoot:not(.pdf-export) #summaryTable :is(th, td) { min-width: 72px; }
    body > #pdfRoot:not(.pdf-export) #summaryTable :is(th, td):nth-child(3) { min-width: 200px; }
    .page-login > h1 { top: 24px; left: 6%; font-size: 17px; }
    body.page-login { padding: 100px 20px 70px; justify-content: center; }
    .page-login .box { padding: 28px 24px; }
  }
}
@media (prefers-reduced-motion: reduce) {
  body *, body *::before, body *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
