/* Intern page actions share the portal's navy/light-gray design. */
body[data-portal="intern"] .module-header .header-right,
body[data-portal="intern"] .module-header .header-actions {
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}
body[data-portal="intern"] .module-header button,
body[data-portal="intern"] .shell-action {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  box-sizing:border-box; min-height:38px; padding:8px 14px;
  border:1px solid #dce5ee; border-radius:6px; background:#eef3f7;
  color:#153e68; font:600 12px/1.5 'Segoe UI',Arial,sans-serif;
  text-decoration:none; white-space:nowrap; box-shadow:none; cursor:pointer;
}
body[data-portal="intern"] .module-header button.primary,
body[data-portal="intern"] .module-header button[type="submit"],
body[data-portal="intern"] .shell-action.primary {
  color:#fff; background:#153e68; border-color:#153e68;
}
body[data-portal="intern"] .module-header button:hover,
body[data-portal="intern"] .shell-action:hover { filter:brightness(.96); }
body[data-portal="intern"] .module-header button:disabled,
body[data-portal="intern"] .shell-action:disabled { opacity:.65; cursor:wait; }
body[data-portal="intern"] .shell-action.danger { background:#fff1f2; color:#a72c3d; border-color:#efc9d0; }
body[data-portal="intern"] .shell-action.small { min-height:32px; padding:5px 10px; font-size:12px; }
body[data-portal="intern"] .shell-action:focus-visible { outline:3px solid #9bb8d4; outline-offset:2px; }
/* Record forms use permanent labels, compact controls and the same card layout. */
.record-card { max-width:1120px; margin:0 auto; padding:26px; background:#fff; border:1px solid #dfe7ef; border-radius:10px; box-shadow:0 3px 14px #183d6008; }
.record-page .form-grid,.customer-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.customer-columns { gap:28px; margin-top:28px; }
.record-page .input-group,.record-page label.field { display:flex; flex-direction:column; gap:7px; margin:0 0 18px; min-width:0; }
.record-page .input-group label,.record-page .input-group input:focus+label,.record-page .input-group input:valid+label { position:static; order:-1; transform:none; font-size:13px; font-weight:600; color:#49627a; pointer-events:auto; }
.record-page .record-card input:not([type=hidden]),.record-page .record-card select,.settings-page input:not([type=hidden]),.settings-page select {
  width:100%; min-width:0; height:40px; padding:9px 11px; border:1px solid #cedae5; border-radius:6px; background:#fff; color:#243e57; font:14px/1.4 'Segoe UI',Arial,sans-serif; box-sizing:border-box; box-shadow:none;
}
.record-page .record-card input:focus,.record-page .record-card select:focus,.settings-page input:focus,.settings-page select:focus { outline:2px solid #d5e5f3; border-color:#678dab; }
.record-page .record-card input::placeholder,.settings-page input::placeholder { color:#8192a2; }
.record-page .form-actions { justify-content:flex-end; align-items:center; flex-wrap:wrap; gap:10px; margin-top:10px; padding-top:18px; border-top:1px solid #e6edf3; }
.record-page .section-title { margin:0 0 20px; padding-bottom:12px; border-bottom:1px solid #dfe7ef; font-size:17px; }
.record-page .contact-form,.record-page .document-upload { padding:18px; background:#f7f9fb; border:1px solid #e1e8ee; border-radius:8px; margin:16px 0 24px; }
.record-page .contact-form .field { font-size:13px; font-weight:600; color:#49627a; margin:0; }
.record-page .contact-form>.field { margin-top:14px; }
.record-page .contact-form .form-grid { gap:14px; }
.record-page .sub-table td { border-color:#e1e8ee; padding:11px; overflow-wrap:anywhere; }
.record-page .sub-table td:last-child { min-width:100px; }
.record-page .sub-table .shell-action { margin:3px 0; }
.record-page .doc-tiles-grid { gap:14px; }
.record-page .doc-tile { text-align:left; padding:18px; color:#49627a; border:1px solid #dfe7ef; border-radius:8px; background:#fff; box-shadow:none; }
.record-page .doc-tile:hover { transform:none; border-color:#9eb8cf; background:#f7faff; box-shadow:none; }
.record-page .doc-label { font-size:14px; color:#153e68; }
.record-page .doc-count { font-size:27px; margin:8px 0; }
.record-page .doc-tile small { color:#718396; font-size:12px; }
.record-page .upload-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) auto; gap:12px; align-items:end; }
.record-page .upload-fields label { font-size:13px; color:#49627a; font-weight:600; }
.record-page .module-header>div:first-child { min-width:0; max-width:100%; }
.record-page .module-header h2 { min-width:0; white-space:normal; overflow-wrap:anywhere; }
.record-page .upload-fields br { display:none; }
.record-page .upload-fields input,.record-page .upload-fields select { margin-top:7px; }
.record-page .upload-fields input[type=file] { padding:7px; font-size:12px; }
.record-page input[type=file]::file-selector-button { border:0; border-radius:4px; background:#eef3f7; color:#153e68; padding:4px 7px; margin-right:8px; }
/* Price lists and rates. Horizontal overflow stays inside each table. */
.settings-page .container { max-width:1400px; padding:0 28px; margin:24px auto; }
.settings-pagehead { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom:20px; }
.settings-pagehead h1 { font-size:22px; margin:0; overflow-wrap:anywhere; }
.settings-page .settings-card { background:#fff; border:1px solid #dfe7ef; border-radius:10px; box-shadow:0 3px 14px #183d6008; margin-bottom:24px; overflow:hidden; }
.settings-page .card-header { display:flex; justify-content:space-between; align-items:center; gap:14px; flex-wrap:wrap; background:white; padding:20px 22px; border-bottom:1px solid #e1e8ee; }
.settings-page .card-header h2 { color:#153e68; font-size:17px; }
.settings-page .card-controls { display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap; }
.settings-page .card-controls label { font-size:12px; color:#49627a; font-weight:600; }
.settings-page .card-controls select { display:block; width:230px; margin-top:5px; }
.settings-page .settings-content { padding:20px 22px; }
.settings-page .table-scroll { overflow-x:auto; }
.settings-page table.settings-table { width:100%; min-width:740px; border-collapse:collapse; text-align:left; }
.settings-page table.settings-table th { text-align:left; }
.settings-page input.money-input { text-align:right; font-weight:600; }
.settings-page .alert { padding:12px 16px; margin-bottom:18px; border:1px solid #c8dece; border-radius:6px; background:#f0f8f2; color:#2c6040; }
.settings-page .alert-error { background:#fff1f2; color:#a72c3d; border-color:#efc9d0; }
.settings-page table.settings-table th { font-size:12px; font-weight:600; padding:12px 10px; background:#f2f6fa; border-bottom:1px solid #dfe7ef; }
.settings-page table.settings-table td { padding:9px 10px; border-bottom:1px solid #e6edf3; }
.settings-page .table-actions { display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px; padding-top:18px; }
.settings-page .object-actions a { margin-right:6px; }
.settings-page .hering-grid { display:grid; grid-template-columns:2fr 1fr; gap:22px; }
.settings-page .rates-panel,.settings-page .calc-box { min-width:0; background:#f7f9fb; border:1px solid #e1e8ee; padding:18px; border-radius:8px; }
.settings-page .calc-box { text-align:left; }
.settings-page .calc-box h3,.settings-page .rates-panel h3 { margin-top:0; color:#153e68; font-size:15px; }
.settings-page .rate-fields { display:grid; grid-template-columns:minmax(0,1fr) 130px; gap:10px; align-items:center; font-size:13px; }
.settings-page .calc-box p { font-size:13px; }
.settings-page .settings-dialog { border:1px solid #dfe7ef; border-radius:10px; width:min(560px,calc(100% - 24px)); padding:24px; max-height:90vh; overflow:auto; color:#344b62; }
.settings-page .settings-dialog::backdrop { background:#132b4366; }
.settings-page .settings-dialog label { display:block; font-size:13px; margin:14px 0; }
.settings-page .settings-dialog label input { display:block; margin-top:6px; }
.settings-page .settings-dialog .form-actions { display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; }
.email-status { margin:16px 30px 0; padding:12px 16px; background:#eef4f9; border:1px solid #c9dcea; border-radius:8px; font-size:13px; line-height:1.6; }
.email-status:empty { display:none; }
.email-status a { color:#153e68; font-weight:600; }
@media(max-width:1000px) { .customer-columns { grid-template-columns:1fr; }.record-page .upload-fields { grid-template-columns:1fr 1fr; } }
@media(max-width:650px) {
  .record-card { padding:18px; }.record-page .form-grid,.record-page .upload-fields,.settings-page .hering-grid { grid-template-columns:1fr; }
  .record-page .sub-table,.record-page .sub-table tbody { display:block; width:100%; }
  .record-page .sub-table tr { display:block; border:1px solid #e1e8ee; border-radius:6px; margin-bottom:10px; }
  .record-page .sub-table td { display:block; width:auto; border:0; min-width:0!important; text-align:left!important; }
  .record-page .sub-table td+td { border-top:1px solid #edf1f5; }
  .settings-page .container { padding:0 14px; }.settings-page .card-header,.settings-page .settings-content { padding:18px; }.settings-page .card-controls,.settings-page .card-controls label,.settings-page .card-controls select { width:100%; }
  .record-page .form-actions .shell-action { flex:1; }.settings-page .rate-fields { grid-template-columns:minmax(0,1fr) 110px; }.email-status { margin:12px 16px 0; }
}
body[data-portal="intern"] .billing-toolbar {
  position:static; min-height:74px; background:#fff; color:#153e68;
  padding:16px 30px; border-bottom:1px solid #e1e7ed; box-shadow:none;
}
body[data-portal="intern"] .billing-toolbar h2 { font-size:17px; }
body[data-portal="intern"] .not-applicable { color:#8192a2; }
/* The wide paper scrolls inside its own region, keeping navigation reachable. */
@media screen {
  .billing-sheet-scroll { overflow-x:auto; padding:22px 30px 32px; }
  .billing-sheet-scroll #sheet-container {
    margin:0 auto; border:1px solid #e1e7ed; border-radius:8px;
    box-shadow:0 3px 14px #183d6012;
  }
}
@media (max-width:820px) {
  body[data-portal="intern"] .billing-toolbar { padding:18px; }
  .billing-sheet-scroll { padding:16px; }
}
@media (max-width:480px) {
  body[data-portal="intern"] .billing-toolbar .header-right { width:100%; }
  body[data-portal="intern"] .billing-toolbar .primary { flex:1; }
}
@media print {
  body.billing-page { padding:0!important; background:white; }
  .billing-page .shell-sidebar,.billing-page .shell-portalbar,
  .billing-page .shell-menu-toggle,.billing-page .shell-scrim,
  .billing-page .shell-crumb,.billing-page .billing-toolbar { display:none!important; }
  .billing-sheet-scroll { overflow:visible; padding:0; }
  .billing-sheet-scroll #sheet-container { margin:0; box-shadow:none; border:0; border-radius:0; }
}

.settings-fold > summary {cursor:pointer;list-style:none;}
.settings-fold > summary::-webkit-details-marker {display:none;}
.settings-fold > summary small {display:block;color:#6c8296;font-size:12px;font-weight:400;margin-top:5px;}
.settings-fold .fold-chevron {font-size:24px;transition:transform .15s;}
.settings-fold[open] > summary .fold-chevron {transform:rotate(180deg);}
.settings-fold > summary:focus-visible {outline:2px solid #1b609b;outline-offset:-4px;}
.settings-page .str-object-table {min-width:1100px;}
.str-object-table td:nth-child(1) {width:65px;}
.str-object-table td:nth-child(2) {min-width:310px;}
.str-object-table td:nth-child(n+3) {width:115px;}
.overview-search {display:flex;align-items:end;gap:20px;flex-wrap:wrap;margin-bottom:20px;}
.overview-search label {display:block;font-weight:600;flex:1;max-width:560px;}
.overview-search input {display:block;width:100%;margin-top:8px;padding:12px;border:1px solid #cbdbe9;border-radius:6px;font:inherit;}
.overview-search [role="status"] {color:#627a90;}
.data-table tr[hidden] {display:none;}

.customer-list-tabs{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}
.customer-row-actions{display:inline-grid;grid-auto-flow:column;grid-auto-columns:minmax(112px,1fr);align-items:stretch;gap:10px}
body[data-portal="intern"] .customer-row-actions .shell-action{width:100%;min-height:40px;margin:0;padding:8px 14px;font-size:13px}
.customer-archive-badge{display:block;font-size:12px;color:#6d7e90;margin-top:5px}
.customer-archive-notice{padding:15px 18px;background:#eaf3fb;border-left:4px solid #173e69;border-radius:6px}
.customer-archive-notice.error{background:#fff0f0;border-color:#a92835}
.customer-archive-dialog{width:min(560px,92vw);padding:26px;border:1px solid #dce5ee;border-radius:14px;color:#29445b}
.customer-archive-dialog::backdrop{background:#102f4a88}
.customer-archive-dialog h2{margin-top:0;color:#173e69}
.customer-archive-dialog label{display:grid;gap:8px;margin:18px 0}
.customer-archive-dialog input[type=password]{padding:12px;border:1px solid #cbd9e5;border-radius:7px;width:100%;box-sizing:border-box}
.customer-archive-dialog label.customer-archive-confirm{display:flex;align-items:flex-start;gap:10px}
.customer-archive-confirm input{width:18px;height:18px;flex:0 0 18px}
