:root {
  --navy-950: #071a33;
  --navy-900: #0b2a54;
  --navy-800: #103968;
  --blue-600: #1769e0;
  --blue-500: #2785f5;
  --cyan-500: #16a6c9;
  --indigo-500: #6366d9;
  --ink-900: #172033;
  --ink-700: #46526a;
  --ink-500: #748096;
  --line: #e6ebf2;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --danger: #d83a4d;
  --success: #18885e;
  --shadow-sm: 0 1px 2px rgba(12, 36, 67, .05), 0 5px 16px rgba(12, 36, 67, .05);
  --shadow-lg: 0 24px 70px rgba(7, 26, 51, .2);
  --radius: 16px;
  --sidebar: 248px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink-900); background: var(--canvas); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif; font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.is-hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.eyebrow { margin: 0 0 8px; color: var(--blue-600); font-size: 12px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; padding: 3px; border: 1px solid rgba(255,255,255,.32); border-radius: 11px; background: #fff; }
.brand-mark img, .login-logo img, .loading-logo img { width: 100%; height: 100%; display: block; object-fit: contain; }

/* Loading and login */
.app-loading { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; color: var(--ink-500); background: radial-gradient(circle at 50% 42%, #fff 0, #f5f8fc 38%, #edf3fa 100%); }
.loading-stage { width: min(320px, calc(100vw - 48px)); display: flex; flex-direction: column; align-items: center; }
.loading-logo { width: 86px; height: 86px; overflow: visible; }
.loading-logo img { mix-blend-mode: multiply; }
.loading-stage strong { margin-top: 20px; color: var(--navy-950); font-size: 20px; letter-spacing: .03em; }
.loading-stage > span { margin-top: 11px; font-size: 13px; letter-spacing: .06em; }
.loading-progress { width: 168px; height: 3px; overflow: hidden; margin-top: 20px; border-radius: 999px; background: #dce5f1; }
.loading-progress i { width: 42%; height: 100%; display: block; border-radius: inherit; background: var(--blue-600); animation: loading-slide 1.25s ease-in-out infinite; }
@keyframes loading-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(350%); } }
.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(480px, .92fr); background: #fff; }
.login-brand { position: relative; overflow: hidden; display: flex; align-items: center; padding: 9vw; color: #fff; background: linear-gradient(145deg, #071a33 0%, #0b2e5d 62%, #0d4d87 100%); }
.login-brand::before, .login-brand::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; }
.login-brand::before { width: 38vw; height: 38vw; right: -16vw; top: -12vw; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.018); }
.login-brand::after { width: 310px; height: 310px; left: -210px; bottom: -70px; }
.login-brand__content { position: relative; z-index: 1; max-width: 540px; }
.login-logo { width: 96px; height: 96px; display: grid; place-items: center; overflow: hidden; margin-bottom: 42px; padding: 6px; border: 1px solid rgba(255,255,255,.45); border-radius: 20px; background: #fff; }
.login-brand .eyebrow { color: #77bdff; }
.login-brand h1 { margin: 0; font-size: clamp(42px, 5vw, 66px); line-height: 1.12; letter-spacing: -.055em; }
.login-tagline { margin: 22px 0 0; color: rgba(255,255,255,.76); font-size: 21px; letter-spacing: .08em; }
.login-feature { display: flex; align-items: flex-start; gap: 16px; margin-top: 90px; color: rgba(255,255,255,.76); font-size: 18px; line-height: 1.7; }
.login-feature__line { width: 44px; height: 2px; flex: 0 0 auto; margin-top: 10px; background: var(--blue-500); }
.login-feature p { max-width: 480px; margin: 0; }
.login-panel { display: grid; place-items: center; padding: 56px; background: linear-gradient(180deg, #fff 0%, #f9fbfe 100%); }
.login-card { width: min(100%, 430px); }
.login-card__mobile-brand { display: none; }
.login-heading { margin-bottom: 36px; }
.login-heading h2 { margin: 0 0 9px; color: var(--ink-900); font-size: 32px; letter-spacing: -.04em; }
.login-heading > p:last-child { margin: 0; color: var(--ink-500); font-size: 15px; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.field > span { color: var(--ink-700); font-size: 14px; font-weight: 650; }
.field input, .field select, .field textarea, .compact-select { width: 100%; min-height: 46px; border: 1px solid #d9e0e9; border-radius: 10px; outline: none; color: var(--ink-900); background: #fff; transition: border-color .18s, box-shadow .18s; }
.field input, .field select, .compact-select { padding: 0 13px; }
.field textarea { padding: 12px 13px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .compact-select:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(39,133,245,.12); }
.input-shell { position: relative; display: flex; align-items: center; }
.input-shell > svg { position: absolute; left: 15px; z-index: 1; color: #7b879b; }
.input-shell input { min-height: 54px; padding: 0 48px; border-radius: 12px; }
.input-shell .icon-button { position: absolute; right: 6px; width: 42px; height: 42px; display: grid; place-items: center; border: 0; color: #6c7890; background: transparent; }
.primary-button, .secondary-button, .danger-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 10px; font-size: 14px; font-weight: 750; transition: transform .15s, box-shadow .15s, background .15s; }
.primary-button { border: 1px solid var(--blue-600); color: #fff; background: linear-gradient(180deg, #247dec, #1261ce); box-shadow: 0 5px 14px rgba(23,105,224,.2); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(23,105,224,.25); }
.primary-button--large { width: 100%; min-height: 54px; justify-content: space-between; margin-top: 8px; padding: 0 22px; border-radius: 12px; font-size: 16px; }
.secondary-button { border: 1px solid #d9e1eb; color: var(--ink-700); background: #fff; }
.secondary-button:hover { color: var(--blue-600); border-color: #a7c9f5; background: #f7fbff; }
.danger-button { border: 1px solid #f0cbd0; color: var(--danger); background: #fff7f8; }
button:disabled { cursor: not-allowed; opacity: .58; transform: none !important; }
.form-message { margin: -4px 0 14px; padding: 10px 12px; border-radius: 9px; font-size: 14px; }
.form-message--error, .inline-error { color: #b7283b; background: #fff2f4; border: 1px solid #ffd7dd; }
.login-help { margin: 20px 0 0; color: #929bad; font-size: 13px; text-align: center; }
.login-legal { margin: 13px 0 0; color: #a2aab8; font-size: 11px; line-height: 1.6; text-align: center; }

/* App shell */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar); display: flex; flex-direction: column; color: #fff; background: linear-gradient(180deg, var(--navy-950), var(--navy-900)); box-shadow: 12px 0 35px rgba(7,26,51,.08); }
.sidebar__brand { min-height: 92px; display: flex; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar__brand > div:last-child { min-width: 0; display: flex; flex-direction: column; }
.sidebar__brand strong { font-size: 16px; white-space: nowrap; }
.sidebar__brand span { margin-top: 2px; color: rgba(255,255,255,.45); font-size: 10px; letter-spacing: .13em; }
.sidebar__nav { flex: 1; display: flex; flex-direction: column; gap: 5px; padding: 28px 14px; }
.sidebar__nav a { position: relative; min-height: 48px; display: flex; align-items: center; gap: 14px; padding: 0 14px; border-radius: 10px; color: rgba(255,255,255,.62); font-size: 14px; font-weight: 650; transition: color .18s, background .18s; }
.sidebar__nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar__nav a.is-active { color: #fff; background: linear-gradient(90deg, rgba(39,133,245,.28), rgba(39,133,245,.09)); }
.sidebar__nav a.is-active::before { content: ""; position: absolute; left: -14px; width: 3px; height: 25px; border-radius: 0 3px 3px 0; background: #50a9ff; }
.nav-icon { width: 24px; color: #7ebfff; font-size: 22px; text-align: center; line-height: 1; }
.nav-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.nav-copy strong { color: inherit; font-size: inherit; font-weight: 700; }
.nav-copy small { margin-top: 5px; color: rgba(255,255,255,.36); font-size: 9px; font-weight: 650; letter-spacing: .12em; }
.sidebar__nav a.is-active .nav-copy small { color: rgba(255,255,255,.62); }
.sidebar__footer { min-height: 82px; display: flex; align-items: center; gap: 10px; padding: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; }
.sidebar-user .avatar { width: 36px; height: 36px; border-radius: 10px; }
.sidebar-user > div:last-child { min-width: 0; display: flex; flex-direction: column; }
.sidebar-user strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user span { color: rgba(255,255,255,.48); font-size: 12px; }
.avatar { display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--blue-500), #0e5fc9); font-weight: 850; }
.sidebar-logout { width: 34px; height: 34px; border: 0; border-radius: 9px; color: rgba(255,255,255,.55); background: rgba(255,255,255,.06); font-size: 20px; }
.workspace { min-height: 100vh; display: flex; flex-direction: column; margin-left: var(--sidebar); }
.topbar { height: 92px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 3vw, 46px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); backdrop-filter: blur(12px); }
.topbar h1 { margin: 1px 0 0; font-size: 24px; letter-spacing: -.035em; }
.topbar-date { margin: 0; color: var(--ink-500); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.secure-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid #dcebe5; border-radius: 999px; color: #487264; background: #f5fbf8; font-size: 12px; font-weight: 650; }
.secure-chip i { width: 7px; height: 7px; border-radius: 50%; background: #2ba36f; box-shadow: 0 0 0 3px rgba(43,163,111,.12); }
.mobile-avatar { display: none; border: 0; }
.page-content { width: 100%; flex: 1; padding: clamp(22px, 3vw, 42px); }
.workspace-footer { padding: 15px 24px 20px; color: #8a95a7; font-size: 12px; line-height: 1.6; text-align: center; }
.mobile-nav { display: none; }

/* Common content */
.welcome-strip { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; min-height: 156px; margin-bottom: 24px; padding: 30px 34px; border: 1px solid #dce8f6; border-radius: var(--radius); background: linear-gradient(112deg, #fff 0%, #f2f8ff 67%, #e5f2ff 100%); box-shadow: var(--shadow-sm); }
.welcome-strip::after { content: ""; position: absolute; right: 54px; top: -44px; width: 180px; height: 180px; border: 32px solid rgba(23,105,224,.035); border-radius: 50%; }
.welcome-strip > * { position: relative; z-index: 1; }
.welcome-strip h2 { margin: 0 0 7px; font-size: 27px; letter-spacing: -.04em; }
.welcome-strip p:last-child { margin: 0; color: var(--ink-500); font-size: 14px; }
.welcome-strip--compact { min-height: 130px; }
.role-badge, .owner-chip { display: inline-flex; align-items: center; padding: 7px 11px; border: 1px solid #cfe1fa; border-radius: 999px; color: var(--blue-600); background: rgba(255,255,255,.75); font-size: 12px; font-weight: 750; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.metric-card { min-height: 144px; display: flex; align-items: center; gap: 19px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.metric-icon { width: 52px; height: 52px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 15px; font-size: 25px; }
.metric-card--blue .metric-icon { color: var(--blue-600); background: #eaf3ff; }
.metric-card--cyan .metric-icon { color: #0789a9; background: #e7f8fb; }
.metric-card--indigo .metric-icon { color: #565ac6; background: #efefff; }
.metric-card p, .metric-card span { margin: 0; color: var(--ink-500); font-size: 13px; }
.metric-card strong { display: block; margin: 2px 0; font-size: 31px; line-height: 1.2; letter-spacing: -.04em; }
.dashboard-grid, .stats-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(310px, .8fr); gap: 22px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.panel-heading, .data-panel__heading { min-height: 79px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel-heading h3, .data-panel__heading h2 { margin: 0 0 3px; font-size: 17px; }
.panel-heading p, .data-panel__heading p { margin: 0; color: var(--ink-500); font-size: 12px; }
.panel-heading a { color: var(--blue-600); font-size: 13px; font-weight: 700; }
.recent-list { padding: 6px 14px 12px; }
.recent-order { display: grid; grid-template-columns: 40px minmax(110px, 1fr) auto auto; align-items: center; gap: 12px; padding: 14px 8px; border-bottom: 1px solid #edf0f4; }
.recent-order:last-child { border-bottom: 0; }
.recent-order__icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--blue-600); background: #eef5ff; }
.recent-order div { min-width: 0; display: flex; flex-direction: column; }
.recent-order strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.recent-order small { color: var(--ink-500); font-size: 12px; }
.recent-order__meta { text-align: right; }
.quick-actions { padding: 10px 15px 15px; }
.quick-actions a { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 14px 8px; border-bottom: 1px solid #edf0f4; }
.quick-actions a:last-child { border: 0; }
.quick-actions a > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--blue-600); background: #eef5ff; font-size: 21px; }
.quick-actions div { display: flex; flex-direction: column; }
.quick-actions strong { font-size: 13px; }
.quick-actions small { color: var(--ink-500); font-size: 12px; }
.quick-actions i { color: #a2adbd; font-size: 23px; font-style: normal; }
.status-tag { display: inline-flex; align-items: center; justify-content: center; min-width: 62px; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-tag--pending { color: #9a6715; background: #fff5dc; }
.status-tag--progress { color: #1765bd; background: #eaf3ff; }
.status-tag--done { color: #187653; background: #e6f7ef; }
.status-tag--cancelled { color: #8c5660; background: #f4edef; }

/* Toolbars and tables */
.page-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.search-box { width: min(420px, 100%); position: relative; }
.search-box span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #7e8a9e; font-size: 22px; }
.search-box input { width: 100%; height: 44px; padding: 0 14px 0 43px; border: 1px solid #dbe2eb; border-radius: 11px; outline: 0; color: var(--ink-900); background: #fff; }
.search-box input:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(39,133,245,.1); }
.toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.compact-select { width: auto; min-width: 118px; min-height: 42px; }
.data-panel { overflow: hidden; }
.storage-note { color: var(--ink-500); font-size: 12px; text-align: right; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 46px; padding: 0 17px; color: #6e7a90; background: #f8fafc; font-size: 12px; font-weight: 750; text-align: left; white-space: nowrap; }
td { min-height: 62px; padding: 14px 17px; border-top: 1px solid #edf0f4; color: var(--ink-700); font-size: 13px; vertical-align: middle; }
td > strong, td > small { display: block; }
td > strong { color: var(--ink-900); font-size: 13px; }
td small { max-width: 260px; overflow: hidden; margin-top: 3px; color: var(--ink-500); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 5px; }
.row-actions button, .record-card footer button { padding: 5px 8px; border: 0; border-radius: 7px; color: var(--blue-600); background: transparent; font-size: 12px; font-weight: 700; }
.row-actions button:hover { background: #eef5ff; }
.row-actions .danger-link, .record-card footer .danger-link { color: var(--danger); }
.file-cell { min-width: 190px; display: flex; align-items: center; gap: 10px; }
.file-cell > span { width: 36px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; color: var(--blue-600); background: #eaf3ff; font-size: 9px; font-weight: 850; }
.file-cell > div { min-width: 0; }
.file-cell strong { max-width: 220px; display: block; overflow: hidden; color: var(--ink-900); text-overflow: ellipsis; white-space: nowrap; }
.mobile-card-list { display: none; }
.pagination { min-height: 62px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--ink-500); font-size: 12px; }
.pagination button { min-width: 72px; height: 34px; border: 1px solid #dce3ec; border-radius: 8px; color: var(--ink-700); background: #fff; font-size: 12px; }
.empty-state { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 35px; text-align: center; }
.empty-state > span { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 15px; color: var(--blue-600); background: #edf5ff; font-size: 27px; }
.empty-state h3 { margin: 0 0 6px; font-size: 16px; }
.empty-state p { margin: 0; color: var(--ink-500); font-size: 13px; }
.page-loader { min-height: 220px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink-500); font-size: 13px; }
.spinner { width: 16px; height: 16px; display: inline-block; border: 2px solid rgba(255,255,255,.45); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; }
.spinner--blue { color: var(--blue-600); border-color: #cfe0f6; border-top-color: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }
.inline-error { margin: 20px; padding: 12px 14px; border-radius: 10px; font-size: 13px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; visibility: hidden; opacity: 0; background: rgba(5,20,40,.55); backdrop-filter: blur(3px); transition: opacity .18s, visibility .18s; }
.modal.is-open { visibility: visible; opacity: 1; }
.modal-card { width: min(100%, 670px); max-height: calc(100vh - 48px); overflow-y: auto; border-radius: 18px; background: #fff; box-shadow: var(--shadow-lg); transform: translateY(12px) scale(.985); transition: transform .18s; }
.modal.is-open .modal-card { transform: none; }
.modal-card--narrow { width: min(100%, 590px); }
.modal-card > header { min-height: 88px; display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.modal-card > header h2 { margin: 0; font-size: 20px; }
.modal-card > header button { width: 38px; height: 38px; border: 0; border-radius: 10px; color: var(--ink-500); background: #f3f6f9; font-size: 25px; line-height: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; padding: 24px; }
.form-grid .field--wide { grid-column: 1 / -1; }
.form-grid footer { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 9px; margin: 4px -24px -24px; padding: 17px 24px; border-top: 1px solid var(--line); background: #fafbfd; }
.upload-drop { min-height: 142px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-bottom: 21px; border: 1px dashed #a9c6ec; border-radius: 13px; color: var(--ink-700); background: #f7fbff; text-align: center; cursor: pointer; }
.upload-drop > span { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 10px; color: var(--blue-600); background: #e6f1ff; font-size: 22px; }
.upload-drop strong { font-size: 14px; }
.upload-drop small { max-width: 85%; overflow: hidden; margin-top: 4px; color: var(--ink-500); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.upload-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.modal-open { overflow: hidden; }

/* Customer matching and quick enrichment */
.customer-picker { position: relative; }
.customer-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.search-box--form { width: 100%; }
.search-box--form input { height: 46px; }
.customer-results { position: absolute; z-index: 5; left: 0; right: 0; top: 82px; overflow: hidden; border: 1px solid #d8e2ef; border-radius: 12px; background: #fff; box-shadow: 0 16px 35px rgba(7,26,51,.14); }
.customer-results > button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 0; border-bottom: 1px solid #edf1f5; color: var(--ink-900); background: #fff; text-align: left; }
.customer-results > button:last-child { border-bottom: 0; }
.customer-results > button:hover { background: #f3f8ff; }
.customer-results > button div { min-width: 0; display: flex; flex-direction: column; }
.customer-results > button strong { font-size: 14px; }
.customer-results > button small, .customer-results > button > span { overflow: hidden; color: var(--ink-500); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.customer-no-result { padding: 14px; }
.customer-no-result strong, .customer-no-result small { display: block; }
.customer-no-result strong { font-size: 14px; }
.customer-no-result small { margin-top: 3px; color: var(--ink-500); font-size: 12px; }
.selected-customer { min-height: 58px; display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 12px; border: 1px solid #cfe2fa; border-radius: 11px; background: #f4f9ff; }
.selected-customer > div { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.selected-customer strong { font-size: 14px; }
.selected-customer small { overflow: hidden; color: var(--ink-500); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.selected-customer > button { padding: 5px 8px; border: 0; color: var(--blue-600); background: transparent; font-size: 13px; font-weight: 750; }
.incomplete-chip, .complete-chip { padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.incomplete-chip { color: #9a6715; background: #fff1cf; }
.complete-chip { color: #187653; background: #e5f7ee; }
.duplicate-warning { margin-top: 10px; padding: 10px 12px; border: 1px solid #f1d69b; border-radius: 10px; color: #815c18; background: #fff8e8; font-size: 12px; }
.duplicate-warning strong { margin-right: 6px; }
.duplicate-warning button { margin: 2px 4px 2px 0; padding: 3px 7px; border: 1px solid #e2bd68; border-radius: 7px; color: #75500d; background: #fff; font-size: 12px; }
.customer-create-fields, .customer-enrichment { margin-bottom: 20px; padding: 16px; border: 1px solid #d9e5f3; border-radius: 13px; background: #f8fbff; }
.subsection-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.subsection-heading > div { display: flex; flex-direction: column; }
.subsection-heading strong { font-size: 14px; }
.subsection-heading small { margin-top: 3px; color: var(--ink-500); font-size: 12px; }
.subsection-heading > button { border: 0; color: var(--blue-600); background: transparent; font-size: 12px; font-weight: 750; }
.subsection-heading > span { padding: 3px 7px; border-radius: 999px; color: var(--blue-600); background: #e8f2ff; font-size: 11px; font-weight: 750; }
.nested-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.nested-form-grid .field--wide { grid-column: 1 / -1; }
.nested-form-grid .field { margin-bottom: 14px; }
.nested-form-grid .field:last-child { margin-bottom: 0; }
.field-hint { margin-top: -2px; color: var(--ink-500); font-size: 11px; }

/* Statistics and profile */
.stats-grid { grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); }
.status-bars { padding: 20px 22px 24px; }
.status-bar { display: grid; grid-template-columns: 1fr 45px; gap: 8px 13px; margin-bottom: 17px; }
.status-bar > div:first-child { grid-column: 1 / -1; display: flex; justify-content: space-between; color: var(--ink-700); font-size: 13px; }
.bar-track { height: 8px; overflow: hidden; border-radius: 999px; background: #edf1f5; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--blue-500); }
.bar-fill--pending { background: #dca833; }.bar-fill--progress { background: var(--blue-500); }.bar-fill--done { background: #2aa174; }.bar-fill--cancelled { background: #a98a91; }
.status-bar small { color: var(--ink-500); font-size: 11px; text-align: right; }
.info-list { padding: 10px 22px 22px; }
.info-list p { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink-500); font-size: 13px; }
.info-list p:last-child { border: 0; }.info-list span { display: block; margin-bottom: 3px; color: var(--ink-900); font-weight: 750; }
.profile-layout { display: grid; grid-template-columns: minmax(260px, .65fr) minmax(400px, 1.35fr); gap: 22px; max-width: 950px; }
.profile-card { min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 34px; text-align: center; }
.profile-avatar { width: 82px; height: 82px; display: grid; place-items: center; margin-bottom: 17px; border-radius: 24px; color: #fff; background: linear-gradient(145deg, var(--blue-500), #0a55b9); box-shadow: 0 15px 30px rgba(23,105,224,.25); font-size: 24px; font-weight: 900; }
.profile-card h2 { margin: 0 0 5px; font-size: 21px; }.profile-card p { margin: 0 0 18px; color: var(--ink-500); font-size: 12px; }
.profile-details { overflow: hidden; }
.profile-details dl { margin: 0; padding: 5px 22px 18px; }
.profile-details dl > div { min-height: 61px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.profile-details dt { color: var(--ink-500); font-size: 13px; }.profile-details dd { margin: 0; color: var(--ink-900); font-size: 13px; font-weight: 700; text-align: right; }
.profile-details .danger-button { margin: 2px 22px 22px; }

/* Toasts and fatal */
.toast-region { position: fixed; z-index: 200; right: 22px; top: 20px; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast { width: min(560px, calc(100vw - 32px)); display: flex; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid #dfe6ee; border-radius: 12px; background: #fff; box-shadow: 0 15px 40px rgba(7,26,51,.17); opacity: 0; transform: translateY(-10px); transition: .22s; }
.toast.is-visible { opacity: 1; transform: none; }.toast > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--success); font-weight: 850; }.toast--error > span { background: var(--danger); }.toast--info > span { background: var(--blue-600); }.toast p { margin: 0; font-size: 13px; }
.fatal-state { min-height: 55vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }.fatal-state > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: var(--danger); background: #fff0f2; font-weight: 900; }.fatal-state h2 { margin: 14px 0 4px; }.fatal-state p { margin: 0 0 18px; color: var(--ink-500); }.fatal-state button { padding: 9px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }

@media (max-width: 1100px) {
  :root { --sidebar: 218px; }
  .sidebar__brand { padding: 0 15px; }.sidebar__brand strong { font-size: 14px; }
  .metric-card { padding: 20px; }.dashboard-grid { grid-template-columns: 1fr; }
  .recent-order { grid-template-columns: 40px 1fr auto; }.recent-order .status-tag { display: none; }
}

@media (max-width: 820px) {
  body { padding-bottom: calc(69px + env(safe-area-inset-bottom)); }
  .login-view { display: block; background: linear-gradient(165deg, #e8f3ff 0, #fff 40%); }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; padding: 28px 22px; background: transparent; }
  .login-card { padding: 28px 22px; border: 1px solid rgba(215,226,239,.85); border-radius: 19px; background: rgba(255,255,255,.92); box-shadow: 0 20px 55px rgba(12,42,82,.12); }
  .login-card__mobile-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 38px; }
  .login-card__mobile-brand > div:last-child { display: flex; flex-direction: column; }.login-card__mobile-brand strong { font-size: 15px; }.login-card__mobile-brand span { color: var(--ink-500); font-size: 9px; letter-spacing: .13em; }
  .login-heading h2 { font-size: 28px; }
  .sidebar { display: none; }
  .workspace { margin: 0; }
  .topbar { position: sticky; top: 0; z-index: 12; height: 72px; padding: 0 18px; }
  .topbar h1 { font-size: 20px; }.topbar-date { display: none; }.secure-chip { display: none; }
  .mobile-avatar { width: 38px; height: 38px; display: grid; border-radius: 11px; font-size: 12px; }
  .page-content { padding: 16px 14px 20px; }
  .workspace-footer { padding: 10px 22px 17px; font-size: 10px; }
  .mobile-nav { position: fixed; inset: auto 0 0 0; z-index: 30; height: calc(65px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); padding: 5px 5px env(safe-area-inset-bottom); border-top: 1px solid #dde4ed; background: rgba(255,255,255,.96); box-shadow: 0 -8px 25px rgba(10,35,65,.07); backdrop-filter: blur(14px); }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #7b8799; }
  .mobile-nav a > span { font-size: 21px; line-height: 1; }.mobile-nav small { font-size: 10px; font-weight: 650; }.mobile-nav a.is-active { color: var(--blue-600); }
  .welcome-strip { min-height: 148px; align-items: flex-start; padding: 24px 20px; }.welcome-strip h2 { font-size: 22px; }.welcome-strip .role-badge { position: absolute; left: 20px; bottom: 18px; }.welcome-strip::after { right: 20px; top: -28px; width: 110px; height: 110px; border-width: 20px; }
  .welcome-strip--compact { min-height: 125px; }.welcome-strip--compact .role-badge { position: static; }
  .metric-grid { grid-template-columns: 1fr; gap: 11px; }.metric-card { min-height: 104px; padding: 18px; }.metric-icon { width: 46px; height: 46px; }.metric-card strong { font-size: 26px; }
  .dashboard-grid, .stats-grid, .profile-layout { grid-template-columns: 1fr; gap: 14px; }
  .quick-panel { display: none; }
  .recent-order { grid-template-columns: 38px minmax(0,1fr) auto; padding: 13px 3px; }.recent-order__meta strong { font-size: 12px; }
  .page-toolbar { align-items: stretch; flex-direction: column; gap: 10px; }.search-box { width: 100%; }.toolbar-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }.toolbar-actions > :only-child { grid-column: 1 / -1; }.toolbar-actions .compact-select { width: 100%; }.toolbar-actions .primary-button, .toolbar-actions .secondary-button { padding: 0 9px; }
  .data-panel__heading { min-height: 72px; padding: 15px 16px; }.storage-note { display: none; }
  .table-wrap { display: none; }.mobile-card-list { display: grid; gap: 10px; padding: 12px; background: #f7f9fc; }
  .record-card { overflow: hidden; padding: 15px; border: 1px solid #e3e8ef; border-radius: 13px; background: #fff; box-shadow: 0 3px 10px rgba(10,35,65,.04); }
  .record-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 13px; }.record-card header > div:first-child { min-width: 0; display: flex; flex-direction: column; }.record-card header strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }.record-card header span:not(.status-tag):not(.owner-chip) { color: var(--ink-500); font-size: 11px; }.record-card .owner-chip { max-width: 105px; overflow: hidden; padding: 4px 7px; text-overflow: ellipsis; white-space: nowrap; }
  .record-card dl { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px 15px; margin: 0; }.record-card dl > div { min-width: 0; }.record-card dt { color: var(--ink-500); font-size: 10px; }.record-card dd { overflow: hidden; margin: 2px 0 0; color: var(--ink-700); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }.record-card footer { display: flex; justify-content: flex-end; gap: 8px; margin: 14px -15px -15px; padding: 9px 10px; border-top: 1px solid var(--line); background: #fbfcfd; }
  .file-record .file-cell { min-width: 0; }.file-record .file-cell strong { max-width: calc(100vw - 115px); }.file-record header { display: block; }
  .pagination { justify-content: center; }
  .modal { align-items: end; padding: 0; }.modal-card { width: 100%; max-height: 91vh; border-radius: 20px 20px 0 0; transform: translateY(30px); }.modal-card > header { min-height: 76px; padding: 15px 18px; }.form-grid { grid-template-columns: 1fr; padding: 18px; }.form-grid .field--wide { grid-column: 1; }.form-grid footer { grid-column: 1; margin: 2px -18px -18px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); position: sticky; bottom: 0; }.form-grid footer button { flex: 1; }
  .customer-search-row { grid-template-columns: 1fr; }.customer-results { top: 126px; }.selected-customer { align-items: flex-start; flex-wrap: wrap; }.selected-customer > div { flex-basis: calc(100% - 100px); }.nested-form-grid { grid-template-columns: 1fr; }.nested-form-grid .field--wide { grid-column: 1; }.customer-create-fields, .customer-enrichment { padding: 14px; }.subsection-heading { flex-direction: column; }.subsection-heading > button { padding: 0; }
  .profile-card { min-height: 280px; }.profile-layout { max-width: none; }
  .toast-region { right: 16px; top: 12px; }
}

@media (max-width: 390px) {
  .login-panel { padding: 16px; }.login-card { padding: 24px 18px; }
  .toolbar-actions { grid-template-columns: 1fr; }.toolbar-actions > * { grid-column: 1 !important; }
  .record-card dl { grid-template-columns: 1fr; }.recent-order__meta { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Comfortable desktop density: default for office monitors and laptops */
@media (min-width: 821px) {
  :root { --sidebar: 270px; }
  body { font-size: 18px; }
  .brand-mark { width: 56px; height: 56px; }
  .sidebar__brand { min-height: 112px; gap: 15px; padding: 0 23px; }
  .sidebar__brand strong { font-size: 19px; }
  .sidebar__brand span { font-size: 12px; }
  .sidebar__nav { gap: 8px; padding: 28px 15px; }
  .sidebar__nav a { min-height: 64px; gap: 17px; padding: 0 18px; font-size: 18px; }
  .nav-icon { font-size: 25px; }
  .nav-copy small { font-size: 10px; }
  .sidebar-user strong { font-size: 17px; }
  .sidebar-user span { font-size: 14px; }
  .topbar { height: 98px; padding: 0 38px; }
  .topbar h1 { font-size: 30px; }
  .topbar-date { font-size: 15px; }
  .secure-chip { padding: 9px 13px; font-size: 15px; }
  .page-content { max-width: none; margin: 0; padding: 34px 38px 44px; }
  .welcome-strip { min-height: 168px; padding: 33px 36px; }
  .welcome-strip h2 { font-size: 33px; }
  .welcome-strip p:last-child { font-size: 18px; }
  .eyebrow { font-size: 14px; }
  .role-badge, .owner-chip { padding: 8px 12px; font-size: 15px; }
  .metric-card { min-height: 155px; padding: 25px; }
  .metric-card p, .metric-card span { font-size: 16px; }
  .metric-card strong { font-size: 38px; }
  .panel-heading h3, .data-panel__heading h2 { font-size: 22px; }
  .panel-heading p, .data-panel__heading p, .panel-heading a { font-size: 16px; }
  .page-toolbar { margin-bottom: 21px; }
  .search-box { width: min(500px, 100%); }
  .search-box input { height: 50px; font-size: 17px; }
  .search-box--form { width: 100%; }
  .primary-button, .secondary-button, .danger-button { min-height: 48px; padding: 0 19px; font-size: 17px; }
  .compact-select { min-height: 48px; font-size: 17px; }
  .data-panel__heading { min-height: 86px; padding: 20px 24px; }
  .storage-note { font-size: 15px; }
  th { height: 56px; padding: 0 20px; font-size: 16px; }
  td { padding: 19px 20px; font-size: 17px; }
  td > strong { font-size: 17px; }
  td small { margin-top: 4px; font-size: 15px; }
  .status-tag { min-width: 76px; padding: 6px 11px; font-size: 15px; }
  .row-actions button { padding: 8px 9px; font-size: 16px; }
  .pagination { min-height: 70px; font-size: 16px; }
  .pagination button { min-width: 84px; height: 41px; font-size: 15px; }
  .recent-order { padding: 17px 9px; }
  .recent-order strong, .quick-actions strong { font-size: 17px; }
  .recent-order small, .quick-actions small { font-size: 15px; }
  .quick-actions a { padding: 16px 8px; }
  .modal-card { width: min(100%, 780px); }
  .modal-card--narrow { width: min(100%, 680px); }
  .modal-card > header h2 { font-size: 25px; }
  .field > span { font-size: 17px; }
  .field input, .field select, .field textarea { min-height: 50px; font-size: 17px; }
  .customer-results > button strong, .selected-customer strong, .subsection-heading strong { font-size: 17px; }
  .customer-results > button small, .customer-results > button > span, .selected-customer small, .subsection-heading small { font-size: 15px; }
  .field-hint, .upload-drop small, .duplicate-warning, .toast p { font-size: 15px; }
  .workspace-footer { font-size: 13px; }
}
