.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 8px; padding: 8px 13px; font-size: .82rem; font-weight: 760; text-decoration: none; }
.button-primary { background: var(--blue-700); color: #fff; box-shadow: 0 2px 5px rgba(23,79,186,.2); }
.button-primary:hover { background: #103f9a; }
.button-secondary { border-color: var(--line-strong); background: #fff; color: var(--navy-900); }
.button-secondary:hover { background: var(--surface-subtle); }
.button-danger { border-color: #e9b4ba; background: #fff; color: var(--red-800); }
.button-quiet { background: transparent; color: var(--blue-700); }
.button-wide { width: 100%; }
.text-button { border: 0; background: transparent; color: var(--blue-700); padding: 4px 0; font-size: .8rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.icon-button { width: 40px; height: 40px; display: grid; flex: 0 0 auto; place-items: center; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--navy-900); font-size: 1.15rem; }
.icon-button:hover { background: var(--surface-subtle); }
.notification-button { position: relative; font-size: .7rem; color: var(--burgundy-700); }
.notification-button span { position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; background: var(--burgundy-700); color: #fff; font-size: .58rem; font-weight: 800; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); padding: 18px 20px 14px; }
.card-header h2, .card-header h3 { margin-bottom: 3px; }
.card-body { padding: 20px; }
.card-footer { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding: 14px 20px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.summary-card { min-height: 130px; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); padding: 17px 18px; }
.summary-card::after { content: ""; position: absolute; inset: auto -25px -35px auto; width: 90px; height: 90px; border-radius: 50%; background: var(--blue-100); opacity: .65; }
.summary-card.emphasis { background: var(--navy-950); border-color: var(--navy-950); }
.summary-card.emphasis::after { background: var(--purple-700); }
.summary-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: .77rem; font-weight: 700; }
.summary-value { display: block; color: var(--navy-950); font-size: clamp(1.35rem, 2.4vw, 1.8rem); font-weight: 820; letter-spacing: -.035em; }
.summary-note { display: block; margin-top: 7px; color: var(--muted); font-size: .72rem; }
.summary-card.emphasis .summary-label, .summary-card.emphasis .summary-note { color: rgba(255,255,255,.67); }
.summary-card.emphasis .summary-value { color: #fff; }
.status { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 999px; padding: 3px 8px; font-size: .69rem; font-weight: 780; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.healthy, .status.recorded, .status.paid, .status.current, .status.matched, .status.issued { border-color: #b9dfca; background: var(--green-100); color: var(--green-800); }
.status.watch, .status.awaiting, .status.submitted, .status.partial, .status.possible { border-color: #f0d28c; background: var(--amber-100); color: var(--amber-800); }
.status.danger, .status.overdue, .status.over, .status.duplicate, .status.not-found { border-color: #edbbc0; background: var(--red-100); color: var(--red-800); }
.status.draft, .status.void, .status.incomplete, .status.partner { border-color: #ccd4de; background: #f0f3f6; color: #586477; }
.status.nearly { border-color: #d7c3e8; background: var(--purple-100); color: var(--purple-700); }
.table-card { overflow: hidden; }
.table-scroll { width: 100%; overflow-x: auto; }
.table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); padding: 13px 16px; }
.table-tools input[type="search"] { width: min(320px, 100%); }
.table-tools select { width: auto; min-width: 150px; }
.table-tools .spacer { flex: 1; }
.table-link { border: 0; background: transparent; color: var(--blue-700); padding: 0; font-weight: 750; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.table-link:hover { text-decoration-color: currentColor; }
.table-empty { padding: 30px; color: var(--muted); text-align: center; }
.toolbar-card { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 14px; }
.toolbar-card label { min-width: 150px; flex: 1; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 24px; margin: 0; }
.detail-list div { min-width: 0; }
.detail-list dt { color: var(--muted); font-size: .7rem; font-weight: 780; letter-spacing: .04em; text-transform: uppercase; }
.detail-list dd { margin: 3px 0 0; color: var(--navy-950); font-weight: 650; overflow-wrap: anywhere; }
.notice { display: grid; grid-template-columns: auto 1fr; gap: 12px; border: 1px solid #b8cfe8; border-radius: 10px; background: #eff6ff; padding: 14px; }
.notice strong { display: block; margin-bottom: 2px; }
.notice.warning { border-color: #edc98a; background: #fff8e7; }
.notice.danger { border-color: #e8b3b9; background: var(--red-100); }
.notice.success { border-color: #afd8c1; background: var(--green-100); }
.notice-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.75); font-weight: 900; }
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); padding-inline: 14px; }
.tab { border-bottom: 3px solid transparent; background: transparent; color: var(--muted); padding: 13px 11px 10px; font-size: .76rem; font-weight: 750; white-space: nowrap; }
.tab.active { border-color: var(--blue-700); color: var(--blue-700); }
.timeline { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline::before { content: ""; position: absolute; top: 9px; bottom: 12px; left: 7px; width: 2px; background: var(--line); }
.timeline li { position: relative; display: grid; grid-template-columns: 16px 98px 1fr; gap: 10px; padding-bottom: 17px; }
.timeline-dot { z-index: 1; width: 16px; height: 16px; border: 4px solid #fff; border-radius: 50%; background: var(--blue-600); box-shadow: 0 0 0 1px var(--blue-600); }
.timeline time { color: var(--muted); font-size: .73rem; }
.timeline p { margin: -2px 0 0; font-size: .82rem; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.form-grid > .field-12 { grid-column: span 12; }
.form-grid > .field-8 { grid-column: span 8; }
.form-grid > .field-6 { grid-column: span 6; }
.form-grid > .field-4 { grid-column: span 4; }
.form-grid > .field-3 { grid-column: span 3; }
.form-section { display: grid; gap: 14px; }
.form-section + .form-section { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 22px; }
.form-section-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.form-section-heading h2, .form-section-heading h3 { margin-bottom: 4px; }
.form-actions { position: sticky; z-index: 10; bottom: 10px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 24px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.95); box-shadow: 0 7px 25px rgba(16,26,53,.12); padding: 12px; backdrop-filter: blur(10px); }
.allocation-row, .line-item-row { display: grid; grid-template-columns: minmax(260px, 2fr) minmax(130px, .7fr) 40px; align-items: end; gap: 10px; border-radius: 10px; background: var(--surface-subtle); padding: 11px; }
.line-item-row { grid-template-columns: minmax(240px, 2fr) 90px 140px 40px; }
.allocation-status { display: flex; justify-content: space-between; gap: 10px; border-radius: 8px; padding: 10px 12px; font-size: .78rem; }
.allocation-status.valid { background: var(--green-100); color: var(--green-800); }
.allocation-status.invalid { background: var(--amber-100); color: var(--amber-800); }
.upload-zone { display: grid; place-items: center; gap: 8px; min-height: 150px; border: 2px dashed #aebbd0; border-radius: 12px; background: #f8faff; color: var(--muted); padding: 20px; text-align: center; }
.upload-icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-100); color: var(--blue-700); font-size: 1.3rem; }
.document-preview { border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); padding: 16px; }
.attachment-thumb { min-height: 360px; display: grid; place-items: center; border: 1px solid var(--line); background: linear-gradient(155deg, #f7f8fa, #eef1f5); color: var(--muted); text-align: center; }
.attachment-paper { width: min(78%, 310px); aspect-ratio: 8.5 / 11; display: grid; align-content: start; gap: 14px; border: 1px solid #d6d9dd; background: #fff; box-shadow: 0 12px 22px rgba(16,26,53,.13); padding: 28px 20px; transform: rotate(-1deg); }
.attachment-paper::before { content: "VERIZON BUSINESS"; color: #bc1b2b; font-weight: 900; letter-spacing: .05em; }
.attachment-paper .fake-line { height: 6px; background: #dce1e8; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-action { min-height: 88px; display: grid; align-content: center; justify-items: start; gap: 5px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy-900); padding: 14px; text-align: left; }
.quick-action:hover { border-color: #9cb8e1; background: #f7faff; }
.quick-action span { color: var(--blue-700); font-size: 1.2rem; }
.attention-list, .activity-list, .report-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.attention-item, .activity-item, .report-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 13px 0; }
.attention-item:last-child, .activity-item:last-child, .report-item:last-child { border-bottom: 0; }
.attention-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--amber-100); color: var(--amber-800); font-weight: 850; }
.attention-item h3, .activity-item p { margin: 0; }
.attention-item p { margin: 2px 0 0; color: var(--muted); font-size: .75rem; }
.budget-bar { display: flex; height: 18px; overflow: hidden; border-radius: 999px; background: #e2e7ee; }
.budget-bar span { min-width: 2px; }
.budget-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; color: var(--muted); font-size: .71rem; }
.budget-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; background: var(--legend-color); }
dialog { width: min(92vw, 540px); border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 0; }
dialog::backdrop { background: rgba(16,26,53,.55); backdrop-filter: blur(2px); }
.dialog-card { padding: 0; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); padding: 20px 22px 15px; }
.dialog-header h2 { margin: 0; }
#dialog-body { padding: 20px 22px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); padding: 14px 22px 20px; }
.toast-region { position: fixed; z-index: 100; right: 18px; bottom: 18px; width: min(380px, calc(100vw - 36px)); display: grid; gap: 8px; }
.toast { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 10px; border: 1px solid #b9dfca; border-radius: 10px; background: #fff; box-shadow: var(--shadow-md); padding: 13px 14px; animation: toast-in .2s ease-out; }
.toast p { margin: 0; font-size: .8rem; }
.toast button { background: transparent; color: var(--muted); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@media (max-width: 1180px) { .summary-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) {
  .detail-list { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .form-grid > .field-8, .form-grid > .field-6, .form-grid > .field-4, .form-grid > .field-3 { grid-column: span 12; }
  .allocation-row, .line-item-row { grid-template-columns: 1fr 120px 40px; }
  .line-item-row .line-description { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .summary-card { min-height: 115px; padding: 14px; }
  .summary-note { display: none; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .allocation-row, .line-item-row { grid-template-columns: 1fr 40px; }
  .allocation-row label:nth-child(2), .line-item-row label:not(:first-child) { grid-column: 1; }
  .allocation-row .remove-row, .line-item-row .remove-row { grid-column: 2; grid-row: 1; }
  .form-actions { justify-content: stretch; }
  .form-actions .button { flex: 1; }
}
