:root {
  color-scheme: light;
  --navy: #101a2e;
  --navy-soft: #1b2944;
  --ink: #172033;
  --muted: #738097;
  --line: #e6eaf0;
  --surface: #ffffff;
  --background: #f4f6f9;
  --accent: #e8794b;
  --accent-dark: #c95e35;
  --green: #238b67;
  --red: #bd5660;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 250px; background: var(--navy); color: #fff; padding: 30px 20px 22px; display: flex; flex-direction: column; gap: 28px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; font-weight: 800; background: linear-gradient(135deg, #f2a06e, var(--accent)); box-shadow: 0 10px 24px #0003; }
.sidebar h1 { margin: 4px 0 0; font-size: 17px; letter-spacing: -.02em; }
.eyebrow { margin: 0; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.sidebar .eyebrow { color: #aebbd1; }
.side-nav { display: grid; gap: 7px; margin-top: 5px; }
.side-nav a { color: #aebbd1; text-decoration: none; border-radius: 10px; padding: 12px 13px; display: flex; gap: 11px; align-items: center; font-size: 13px; font-weight: 650; }
.side-nav a.active { background: #ffffff14; color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.side-nav a:hover { background: #ffffff12; color: #fff; }
.side-nav span { width: 16px; text-align: center; font-size: 17px; }
.muted-link { opacity: .65; }
.sidebar-footer { margin-top: auto; display: flex; gap: 8px; align-items: center; color: #91a0ba; font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #56c995; box-shadow: 0 0 0 4px #56c99522; }
.main-content { width: min(1440px, 100%); padding: 48px clamp(24px, 5vw, 78px); margin: 0 auto; }
.page-header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 25px; }
.page-header h2 { margin: 7px 0 8px; font-size: clamp(28px, 3.2vw, 40px); letter-spacing: -.045em; }
.page-description { max-width: 600px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.button { border: 0; border-radius: 9px; padding: 11px 15px; font-size: 13px; font-weight: 750; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--accent); color: white; box-shadow: 0 8px 18px #e8794b2e; }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { color: #46536b; background: #eef1f5; }
.button-secondary:hover { background: #e4e8ee; }
.public-warning { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border: 1px solid #f0d9ad; background: #fff9ed; color: #886227; border-radius: 9px; font-size: 12px; margin-bottom: 20px; }
.public-warning span { color: #d89b35; font-size: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card { width: 100%; border: 1px solid var(--line); background: var(--surface); text-align: left; border-radius: 13px; padding: 18px 20px; box-shadow: 0 4px 12px #1b294408; }
.stat-filter { font: inherit; color: inherit; cursor: pointer; transition: .18s ease; }
.stat-filter:hover, .stat-filter.active { border-color: #e8794b66; box-shadow: 0 8px 20px #e8794b1c; transform: translateY(-1px); }
.stat-label, .stat-note { display: block; font-size: 12px; color: var(--muted); }
.stat-card strong { display: block; margin: 7px 0 4px; font-size: 28px; letter-spacing: -.04em; }
.stat-note.positive { color: var(--green); }
.directory-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 8px 24px #1b29440b; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.search-box { display: flex; align-items: center; gap: 10px; width: min(360px, 100%); color: #9aa5b7; border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.toolbar-actions { display: flex; align-items: center; gap: 12px; }
.result-count { color: var(--muted); font-size: 12px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { padding: 12px 18px; color: #8b96a8; background: #fbfcfd; text-align: left; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; font-weight: 800; white-space: nowrap; }
td { padding: 14px 18px; border-top: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
tbody tr:hover { background: #fcfcfd; }
.customer-name { color: var(--ink); font-weight: 750; }
.customer-row { cursor: pointer; }
.customer-row:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.code { color: #44516b; font-weight: 700; }
.tax-profile, .capabilities { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { display: inline-flex; padding: 4px 7px; border-radius: 5px; background: #f0f2f5; color: #68758b; font-size: 10px; font-weight: 750; }
.tag.yes { background: #e8f5ef; color: var(--green); }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.active { background: #e9f6ef; color: var(--green); }
.status.inactive { background: #f4edf0; color: var(--red); }
.loading-cell, .empty-cell { padding: 55px; text-align: center; color: var(--muted); }
.modal-backdrop { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; padding: 20px; background: #101a2e99; backdrop-filter: blur(4px); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(700px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border-radius: 16px; box-shadow: 0 20px 60px #101a2e4d; }
.details-modal { width: min(760px, 100%); }
.details-header-actions { display: flex; align-items: center; gap: 8px; }
.details-header-actions .button { padding: 8px 11px; font-size: 12px; }
.detail-section-title { grid-column: 1 / -1; padding: 11px 14px 8px; color: #61708a; background: #e9edf3; font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.details-content { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; padding: 20px 26px 26px; background: var(--line); }
.detail-item { display: grid; gap: 7px; min-height: 70px; padding: 14px; background: var(--surface); }
.detail-spacer { min-height: 70px; background: #e9edf3; }
.detail-item-wide { grid-column: 1 / -1; }
.detail-label { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.detail-item strong { color: var(--ink); font-size: 14px; font-weight: 700; overflow-wrap: anywhere; white-space: pre-line; }
.detail-input { width: 100%; border: 0; border-bottom: 1px solid transparent; outline: 0; padding: 0; color: var(--ink); background: transparent; font: inherit; font-size: 14px; font-weight: 700; }
.detail-input:focus { border-bottom-color: var(--accent); }
.detail-checkbox { display: flex; align-items: center; gap: 9px; min-height: 22px; color: var(--ink); }
.detail-checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }
.detail-item pre { margin: 0; color: #46536b; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.modal-header { display: flex; justify-content: space-between; padding: 24px 26px 18px; border-bottom: 1px solid var(--line); }
.modal-header h3 { margin: 6px 0 0; font-size: 23px; letter-spacing: -.035em; }
.icon-button { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #dce2ea; border-radius: 50%; color: var(--muted); background: var(--surface); font-size: 18px; line-height: 1; }
.icon-button:hover { color: var(--ink); border-color: #aeb8c7; background: #f5f7fa; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 17px; padding: 24px 26px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #61708a; font-size: 11px; font-weight: 800; }
.field input:not([type="checkbox"]), .field select, .field textarea { width: 100%; border: 1px solid #dfe4eb; border-radius: 8px; outline: 0; padding: 10px 11px; color: var(--ink); background: #fff; font-size: 13px; }
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #e8794b1c; }
.checkbox-field { display: flex; align-items: center; gap: 9px; min-height: 40px; }
.checkbox-field input { width: 16px; height: 16px; accent-color: var(--accent); }
.checkbox-field label { font-size: 13px; color: var(--ink); }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 26px; border-top: 1px solid var(--line); }
.toast { position: fixed; z-index: 10; right: 24px; bottom: 24px; max-width: 340px; padding: 12px 15px; color: #fff; background: var(--navy); border-radius: 8px; box-shadow: 0 10px 28px #101a2e3b; font-size: 12px; transform: translateY(20px); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #8e3848; }
@media (max-width: 800px) { .sidebar { width: 74px; padding: 22px 13px; align-items: center; } .sidebar > div:not(.brand-mark), .side-nav a:not(.active), .side-nav a.active { font-size: 0; padding: 12px; } .sidebar h1, .sidebar .eyebrow, .sidebar-footer span:last-child { display: none; } .side-nav a span { font-size: 18px; } .main-content { padding: 28px 18px; } .page-header { align-items: flex-start; flex-direction: column; } .stats-grid { gap: 8px; } .stat-card { padding: 14px; } .stat-card strong { font-size: 22px; } }
@media (max-width: 500px) { .stats-grid { grid-template-columns: 1fr; } .toolbar { align-items: stretch; flex-direction: column; } .toolbar-actions { justify-content: space-between; } .form-grid, .details-content { grid-template-columns: 1fr; padding: 20px; } .field.full, .detail-item-wide { grid-column: auto; } .detail-spacer { display: none; } .modal-header, .modal-footer { padding-left: 20px; padding-right: 20px; } }
