/* Shared screen layout keeps invoice-history CSS out of the startup JS bundle. */
@media screen {
  body#cell-campus-ui .shell.studio-shell .invoice-history-panel {
    --history-columns: minmax(0, 1fr) minmax(140px, .55fr) 260px;
    --neo-surface: #e9eef4;
    --neo-raised: 7px 7px 16px #cbd3de, -7px -7px 16px #ffffff;
    --neo-control: 4px 4px 9px #cbd3de, -4px -4px 9px #ffffff;
    --neo-inset: inset 4px 4px 9px #cbd3de, inset -4px -4px 9px #ffffff;
    padding: clamp(16px, 2.4vw, 32px);
    border: 1px solid #f7f9fc;
    border-radius: 24px;
    background: var(--neo-surface) !important;
    box-shadow: 12px 12px 28px #cbd3de, -12px -12px 28px #ffffff !important;
    overflow: visible;
  }
  body#cell-campus-ui .studio-shell .invoice-history-panel .form-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; margin-bottom: 24px;
  }
  body#cell-campus-ui .studio-shell .invoice-history-panel h2 { margin: 4px 0 8px; font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -.7px; }
  body#cell-campus-ui .studio-shell .invoice-history-description { margin: 0; color: var(--ent-muted); font-size: 13px; line-height: 1.6; }
  body#cell-campus-ui .studio-shell .invoice-history-panel .form-head > button { flex: 0 0 auto; min-height: 44px; padding: 0 18px; border-radius: 14px; background: #e9eef4 !important; border: 1px solid #f7f9fc !important; color: #075875 !important; box-shadow: var(--neo-control); }
  body#cell-campus-ui .studio-shell .invoice-history-toolbar { display: flex; align-items: center; gap: 24px; padding: 20px; margin-bottom: 26px; border: 1px solid #f7f9fc; background: var(--neo-surface); border-radius: 18px; box-shadow: var(--neo-raised); }
  body#cell-campus-ui .studio-shell .invoice-history-toolbar .history-search { flex: 1; display: grid; gap: 8px; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; min-width: 0; color: var(--ent-ink); font-size: 12px; font-weight: 600; }
  body#cell-campus-ui .studio-shell .invoice-history-toolbar input { width: 100%; min-width: 0; min-height: 46px; margin: 0; padding: 12px 15px; border: 1px solid #dce3ed !important; border-radius: 13px; background: var(--neo-surface) !important; color: #24374c !important; box-shadow: var(--neo-inset); }
  body#cell-campus-ui .studio-shell .invoice-history-toolbar input::placeholder { color: #5e6c80; opacity: 1; }
  body#cell-campus-ui .studio-shell .invoice-history-count { display: grid; gap: 5px; flex: 0 0 auto; color: var(--ent-ink); font-size: 17px; font-weight: 700; }
  body#cell-campus-ui .studio-shell .invoice-history-count small { color: var(--ent-muted); font-size: 11px; font-weight: 400; }
  body#cell-campus-ui .studio-shell .invoice-history-panel .history-table-heading { grid-template-columns: var(--history-columns); gap: 24px; padding: 12px 18px; border-radius: 12px; background: var(--neo-surface); color: #526174; font-size: 11px; font-weight: 600; letter-spacing: .4px; }
  body#cell-campus-ui .studio-shell .invoice-history-panel .history-table-heading > :last-child { text-align: right; }
  body#cell-campus-ui .studio-shell .invoice-history-panel .invoice-history-list { gap: 20px; margin-top: 12px; }
  body#cell-campus-ui .studio-shell .invoice-history-panel .invoice-history-list > article {
    display: grid; grid-template-columns: var(--history-columns);
    grid-template-areas: 'identity financials actions' 'notices notices notices';
    align-items: center; column-gap: 24px; row-gap: 0; padding: 20px 18px;
    margin: 0; border: 1px solid #f7f9fc; border-radius: 18px; background: var(--neo-surface) !important; box-shadow: var(--neo-raised);
  }
  body#cell-campus-ui .studio-shell .invoice-history-panel .invoice-history-list > article:hover { background: #ecf1f7 !important; }
  body#cell-campus-ui .studio-shell .invoice-history-panel .invoice-history-identity { grid-area: identity; display: grid; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
  body#cell-campus-ui .studio-shell .invoice-history-identity strong { color: var(--ent-ink); font-size: 14px; line-height: 1.5; }
  body#cell-campus-ui .studio-shell .invoice-history-identity > span { font-size: 13px; line-height: 1.5; }
  body#cell-campus-ui .studio-shell .invoice-history-identity > small { font-size: 12px; color: var(--ent-muted); }
  body#cell-campus-ui .studio-shell .invoice-history-panel .invoice-history-financials { grid-area: financials; display: grid; gap: 7px; justify-items: start; min-width: 0; font-variant-numeric: tabular-nums; }
  body#cell-campus-ui .studio-shell .invoice-history-financials b { font-size: 18px; letter-spacing: -.3px; overflow-wrap: anywhere; }
  body#cell-campus-ui .studio-shell .invoice-history-financials small { font-size: 12px; color: var(--ent-muted); }
  body#cell-campus-ui .studio-shell .invoice-history-financials .status-badge { width: fit-content; max-width: 100%; white-space: normal; font-size: 10px; padding: 4px 9px; border-radius: 6px; }
  body#cell-campus-ui .studio-shell .invoice-history-panel .invoice-history-list .history-actions {
    grid-area: actions; display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center; gap: 8px !important; width: 100%; min-width: 0;
  }
  body#cell-campus-ui .studio-shell .invoice-history-panel .history-actions > button,
  body#cell-campus-ui .studio-shell .invoice-history-panel .row-more-menu > summary {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    box-sizing: border-box; width: 100%; height: 42px; min-height: 42px;
    margin: 0; padding: 0 10px; border-radius: 9px; font-size: 12px; line-height: 1;
    font-weight: 600; white-space: nowrap;
  }
  body#cell-campus-ui .studio-shell .invoice-history-panel .row-more-menu { min-width: 0; margin: 0; }
  body#cell-campus-ui .studio-shell .invoice-history-panel .history-actions > button.ghost,
  body#cell-campus-ui .studio-shell .invoice-history-panel .row-more-menu > summary { background: var(--neo-surface) !important; color: #24374c !important; border: 1px solid #f7f9fc !important; border-radius: 13px; box-shadow: var(--neo-control); }
  body#cell-campus-ui .studio-shell .invoice-history-panel .row-more-menu > summary::after { content: '⌄'; margin-left: 2px; }
  body#cell-campus-ui .studio-shell .invoice-history-panel .row-more-menu[open] > summary { box-shadow: var(--neo-inset); color: #075875 !important; }
  body#cell-campus-ui .studio-shell .invoice-history-panel .history-actions .whatsapp-action { background: var(--neo-surface) !important; color: #14633f !important; border: 1px solid #f7f9fc !important; border-radius: 13px; box-shadow: var(--neo-control); }
  body#cell-campus-ui .studio-shell .invoice-history-panel .history-actions .whatsapp-action:hover { background: #e2eee8 !important; }
  body#cell-campus-ui .studio-shell .invoice-history-panel .whatsapp-action > span { color: #14633f !important; }
  body#cell-campus-ui .studio-shell .invoice-history-panel .row-more-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; width: min(232px, calc(100vw - 64px)); max-height: 320px; overflow-y: auto; right: 0; left: auto; padding: 12px; background: var(--neo-surface); border: 1px solid #f7f9fc; border-radius: 16px; box-shadow: 8px 8px 22px #b6c1d0, -5px -5px 14px #ffffff; }
  body#cell-campus-ui .studio-shell .invoice-history-panel .row-more-actions > button { width: 100%; min-height: 42px; height: auto; margin: 0; padding: 10px 12px; text-align: left; white-space: normal; line-height: 1.5; font-size: 12px; border-radius: 10px; background: var(--neo-surface) !important; border: 1px solid #d5dde8 !important; color: #24374c !important; box-shadow: 2px 2px 5px #cbd3de, -2px -2px 5px #fff; }
  body#cell-campus-ui .studio-shell .invoice-history-panel .row-more-actions > button.danger { color: #a12d41 !important; }
  body#cell-campus-ui .studio-shell .invoice-history-panel .row-more-actions > button:disabled { opacity: .5; box-shadow: none; cursor: not-allowed; }
  /* The shared workspace skin sets control shadows with !important. */
  body#cell-campus-ui .studio-shell .invoice-history-panel :is(.form-head > button, .history-actions > button) { box-shadow: var(--neo-control) !important; }
  body#cell-campus-ui .studio-shell .invoice-history-panel .invoice-history-toolbar input { box-shadow: var(--neo-inset) !important; }
  body#cell-campus-ui .studio-shell .invoice-history-panel :is(.form-head > button, .history-actions > button, .row-more-actions > button):active:not(:disabled) { box-shadow: var(--neo-inset) !important; }
  body#cell-campus-ui .studio-shell .invoice-history-panel .invoice-history-notices { grid-area: notices; display: grid; gap: 6px; margin-top: 18px; padding: 14px 16px; background: var(--neo-surface); border-left: 3px solid #3e809a; border-radius: 12px; box-shadow: var(--neo-inset); overflow-wrap: anywhere; }
  body#cell-campus-ui .studio-shell .invoice-history-notices .invoice-whatsapp-status { margin: 0; font-size: 12px; line-height: 1.6; }
  body#cell-campus-ui .studio-shell .invoice-history-panel .empty-report { padding: 36px 16px; margin: 0; text-align: center; color: var(--ent-muted); line-height: 1.7; }
  body#cell-campus-ui .studio-shell .invoice-history-panel :is(button, summary, input):focus-visible { outline: 2px solid #179fd1; outline-offset: 3px; }
  @media (max-width: 1100px) {
    body#cell-campus-ui .studio-shell .invoice-history-panel .history-table-heading { display: none; }
    body#cell-campus-ui .studio-shell .invoice-history-panel .invoice-history-list { gap: 14px; }
    body#cell-campus-ui .studio-shell .invoice-history-panel .invoice-history-list > article {
      grid-template-columns: minmax(0, 1fr) minmax(100px, .65fr);
      grid-template-areas: 'identity financials' 'actions actions' 'notices notices';
      gap: 18px 14px; padding: 18px; border: 1px solid #f7f9fc; border-radius: 18px;
    }
    body#cell-campus-ui .studio-shell .invoice-history-panel .invoice-history-financials { justify-items: end; text-align: right; }
    body#cell-campus-ui .studio-shell .invoice-history-panel .invoice-history-list .history-actions { padding-top: 14px; border-top: 1px solid var(--ent-line); }
    body#cell-campus-ui .studio-shell .invoice-history-panel .invoice-history-notices { margin-top: 0; }
  }
  @media (max-width: 560px) {
    body#cell-campus-ui .studio-shell .invoice-history-panel .form-head { align-items: stretch; flex-direction: column; gap: 16px; }
    body#cell-campus-ui .studio-shell .invoice-history-panel .form-head > button { width: 100%; }
    body#cell-campus-ui .studio-shell .invoice-history-toolbar { align-items: stretch; flex-direction: column; gap: 12px; padding: 14px; }
    body#cell-campus-ui .studio-shell .invoice-history-count { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; }
    body#cell-campus-ui .studio-shell .invoice-history-panel .invoice-history-list > article { padding: 14px; }
    body#cell-campus-ui .studio-shell .invoice-history-financials b { font-size: 16px; }
    body#cell-campus-ui .studio-shell .invoice-history-panel .history-actions > button,
    body#cell-campus-ui .studio-shell .invoice-history-panel .row-more-menu > summary { height: 44px; min-height: 44px; padding-inline: 6px; }
  }
}
