.panel, .metric, .metric-card { border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: var(--radius); background: var(--surface); }
.panel { padding: 22px; min-width: 0; }
.section { margin-bottom: 22px; }
.panel-head { gap: 14px; margin-bottom: 20px; align-items: center; }
.panel h2, .panel-head h2 { font-size: 16px; letter-spacing: -.35px; font-weight: 620; color: var(--text); line-height: 1.4; }
.panel h3 { font-size: 14px; font-weight: 600; }
.eyebrow { font-size: 10px; font-weight: 550; letter-spacing: .8px; color: var(--muted); }
.muted, .panel-note, .hint { color: var(--muted); line-height: 1.6; }
.grid { gap: 20px; }
.grid > *, .field-grid > *, .panel-head > *, .button-row > * { min-width: 0; }
.metric, .metric-card { padding: 19px 21px; min-height: 108px; }
.metric > span, .metric-card > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.metric > strong, .metric-card > strong { font-size: 28px; font-weight: 620; letter-spacing: -1px; color: var(--text); line-height: 1.3; }
.primary-button, .secondary-button, .ghost-button, .danger-button, .small-button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 9px 14px; font-size: 12px; line-height: 1.35; font-weight: 550; border-radius: 7px; border: 1px solid transparent; box-shadow: none; }
.primary-button { color: #fff; background: var(--brand); border-color: var(--brand); }
.primary-button:hover { color: #fff; background: var(--brand-dark); border-color: var(--brand-dark); }
.secondary-button, .ghost-button, .small-button { color: #344054; background: #fff; border-color: #dfe3e8; }
.secondary-button:hover, .ghost-button:hover, .small-button:hover { background: #f6f8fa; border-color: #bbc5ce; color: var(--text); }
.small-button { padding: 6px 10px; min-height: 31px; font-size: 11px; }
.danger-button { color: var(--danger); background: #fff; border-color: #f6d2d5; }
.danger-button:hover { background: #fff0f1; color: #9f1b25; }
.icon-button { width: 38px; height: 38px; padding: 8px; }
button:disabled { opacity: .55; cursor: not-allowed; }
.button-row { gap: 8px; flex-wrap: wrap; }
.field { gap: 7px; font-size: 12px; font-weight: 550; color: #344054; }
.field small { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea, .search-input, select, input[type=search] { max-width: 100%; min-width: 0; border: 1px solid #dce1e7; border-radius: 7px; padding: 10px 12px; font-size: 13px; font-weight: 400; color: var(--text); background: #fff; box-shadow: 0 1px 2px #10182803; }
.field input:focus, .field select:focus, .field textarea:focus, .search-input:focus { border-color: #23977a; outline: 3px solid #20b48622; }
.field:has([required]) > .required-indicator { color: var(--danger); }
.field-grid { gap: 20px; }
.fieldset-section { border: 0; border-top: 1px solid var(--border); padding: 22px 0 0; margin: 22px 0 0; min-width: 0; }
.fieldset-section legend { padding: 0 10px 0 0; font-weight: 600; font-size: 13px; }
.search-input { width: 100%; }
.table-wrap { max-width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; }
.data-table { font-size: 12px; min-width: 0; }
.data-table th { background: #f8fafb; color: #667085; font-size: 10px; letter-spacing: .15px; text-transform: none; font-weight: 550; padding: 12px 15px; white-space: nowrap; }
.data-table td { border-bottom: 1px solid #eef1f4; padding: 16px 15px; vertical-align: middle; }
.data-table td strong { font-weight: 550; }
.data-table tbody tr:hover { background: #fafcfb; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td .muted { font-size: 11px; }
.status-pill, .customer-contact-status { font-size: 10px; font-weight: 550; padding: 4px 8px; line-height: 1.4; border-radius: 5px; background: #f2f4f7; color: #475467; }
.status-pill.ok, .customer-contact-status.is-green { color: #067647; background: #e9f8f0; border-color: #c8ebd8; }
.status-pill.warn, .customer-contact-status.is-orange { color: #935b08; background: #fff6e6; border-color: #f5e0b5; }
.status-pill.danger, .customer-contact-status.is-red { color: #b4232c; background: #fff0f1; border-color: #f6d2d5; }
.notice { border-radius: 8px; padding: 14px 16px; font-weight: 400; font-size: 12px; border: 1px solid #dbe8f6; background: #f2f7fd; color: #34577b; }
.empty-state { border: 1px dashed #dce3e8; border-radius: 9px; background: #fafcfc; padding: 30px 18px; color: #667085; font-size: 12px; font-weight: 400; text-align: center; }
.empty-state strong { color: #344054; font-size: 13px; display: block; margin: 12px 0 4px; }
.empty-state p { margin: 4px 0 15px; }
.empty-state .ui-icon { color: #849c93; width: 24px; height: 24px; }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-size: 11px; font-weight: 550; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }
.ui-dialog { border: 1px solid var(--border); border-radius: 14px; padding: 24px; width: min(560px, calc(100% - 32px)); max-height: 80dvh; box-shadow: 0 24px 80px #10182833; color: var(--text); }
.ui-dialog::backdrop, .app-dialog::backdrop { background: #10201b66; backdrop-filter: blur(3px); }
.ui-dialog h2 { margin: 0; font-size: 18px; }
.ui-dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 15px; }
.ui-dialog .field { display: grid; }
.ui-search-results { margin-top: 18px; display: grid; gap: 6px; }
.ui-search-results a, .quick-action-link { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; align-items: center; font-size: 12px; }
.ui-search-results a:hover, .quick-action-link:hover { border-color: #b6d7ca; background: #f5faf7; }
.ui-search-results a small { color: var(--muted); display: block; }
.ui-search-status { color: var(--muted); font-size: 12px; }
.skeleton-layout { display: grid; gap: 22px; }
.skeleton-row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 20px; }
.skeleton-block { height: 112px; border-radius: 12px; background: #e9edf0; }
.skeleton-panel { height: 280px; background: #edf0f3; border-radius: 12px; }
.skeleton-title { height: 24px; width: 230px; background: #e2e8eb; border-radius: 5px; }
.portal-hero { padding: 6px 0 14px; border: 0; background: none; }
.portal-hero h2 { font-size: 27px; letter-spacing: -.9px; font-weight: 600; color: var(--text); }
.portal-grid { gap: 20px; }
.portal-card { border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 24px; background: #fff; }
.portal-card:hover { transform: none; border-color: #adcebf; box-shadow: 0 6px 18px #0b4d450a; }
.portal-card h2 { font-size: 19px; letter-spacing: -.5px; }
.portal-card p { font-size: 12px; }
.portal-card > strong { font-size: 12px; color: var(--brand); background: #edf7f1; border-radius: 5px; }
@media (max-width: 820px) { .panel { padding: 18px; } .panel-head { flex-wrap: wrap; } .grid.three, .grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); } .skeleton-row { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 540px) {
  .grid.two, .field-grid, .grid.three { grid-template-columns: minmax(0,1fr); }
  .grid.four { gap: 12px; } .metric, .metric-card { padding: 16px; } .metric > strong { font-size: 25px; }
  .table-wrap:has(.mobile-cards) { border: 0; overflow: visible; }
  .data-table.mobile-cards, .mobile-cards tbody { display: block; width: 100%; }
  .mobile-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .mobile-cards tr { display: grid; grid-template-columns: minmax(0,1fr); border: 1px solid var(--border); border-radius: 9px; margin-bottom: 12px; padding: 12px; }
  .mobile-cards td { display: block; border: 0; padding: 7px 0; overflow-wrap: anywhere; }
  .mobile-cards td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 10px; margin-bottom: 3px; font-weight: 500; }
  .mobile-cards td:first-child { padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
  .mobile-cards td:first-child::before, .mobile-cards td:last-child::before { display: none; }
  .mobile-cards td:last-child .button-row { gap: 6px; }
  .portal-hero h2 { font-size: 24px; }
}
.category-pill { color: var(--brand-dark); background: var(--color-accent-light); }
.metric-card { display: grid; align-content: start; gap: 8px; }
.metric > strong, .metric-card > strong { overflow-wrap: anywhere; }
.detail-list { min-width: 0; grid-template-columns: minmax(0,1fr); }
.detail-list > div { min-width: 0; }
.detail-list > div > strong { min-width: 0; text-align: right; overflow-wrap: anywhere; }
.customer-contact-status { max-width: 100%; white-space: normal; }
@media (min-width: 821px) { .sidebar .sidebar-close, .topbar .mobile-menu { display: none; } }
@media (max-width: 820px) { .topbar .mobile-menu { font-size: 18px; } }

#contact-status-settings .detail-list > div { flex-wrap: wrap; align-items: center; }
#contact-status-settings .detail-list > div > span:first-child { flex: 1 1 130px; min-width: 0; overflow-wrap: anywhere; }
#contact-status-settings .detail-list > div > span:nth-child(2) { flex: 1 1 130px; font-size: 12px; color: var(--muted); }
#contact-status-settings input[type="checkbox"] { width: 18px; min-height: 18px; height: 18px; margin: 0 8px 0 0; vertical-align: middle; accent-color: var(--brand); }
#contact-status-settings input[type="color"] { padding: 4px; cursor: pointer; }
#contact-status-settings [data-status-error] { color: var(--danger); }

/* Company-wide navigation editor. */
.menu-settings { grid-column: 1 / -1; min-width: 0; scroll-margin-top: 100px; }
.menu-editor-controls { border: 0; padding: 0; margin: 0; min-width: 0; }
.menu-editor-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 24px; align-items: start; }
.menu-editor-group { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; }
.menu-editor-group > summary { cursor: pointer; padding: 14px; overflow-wrap: anywhere; }
.menu-editor-fields { padding: 0 14px 14px; }
.menu-editor-item { min-width: 0; margin: 14px 0; padding: 12px; border: 1px solid var(--border); border-radius: 6px; }
.menu-editor-item legend { font-size: 12px; padding: 0 5px; }
.menu-editor-group input:not([type=checkbox]), .menu-editor-group select { min-width: 0; width: 100%; }
.menu-checkbox { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.menu-checkbox input { width: auto; }
.menu-settings .button-row { flex-wrap: wrap; margin-top: 12px; }
.menu-add-item { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.menu-add-item .field { flex: 1 1 180px; }
.menu-preview { padding: 16px; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.menu-preview-group { margin-top: 18px; overflow-wrap: anywhere; }
.menu-preview-group strong { display: block; font-size: 12px; margin-bottom: 6px; }
.menu-preview-link { display: block; padding: 8px; border-radius: 5px; background: var(--bg); margin-top: 4px; font-size: 13px; }
.nav-list .nav-label, .nav-group-label { overflow-wrap: anywhere; min-width: 0; }
.nav-list .ui-icon { flex-shrink: 0; }
@media (max-width: 820px) { .menu-editor-layout { grid-template-columns: minmax(0, 1fr); } }
