:root {
  color-scheme: light;
  --ink: #172b43;
  --muted: #708096;
  --line: #e2e9f0;
  --canvas: #f4f7fa;
  --paper: #ffffff;
  --nav: #142439;
  --nav-soft: #203850;
  --teal: #138b84;
  --teal-dark: #087b75;
  --blue: #4464df;
  --green: #168267;
  --amber: #aa7414;
  --red: #b54745;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 12% 15%, #d9f2ee, transparent 36%), radial-gradient(ellipse at 88% 80%, #e0e8ff, transparent 35%), var(--canvas); }
.login-card { width: min(480px, 100%); padding: 24px; border: 1px solid #e0e7ef; border-radius: 22px; background: rgba(255,255,255,.96); box-shadow: 0 24px 75px #14243918; }
.portal-language-tools { display: flex; justify-content: flex-end; min-height: 22px; margin-bottom: 4px; }
.brand-lockup { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.brand-lockup strong { display: block; font-size: 18px; letter-spacing: .2px; }
.brand-lockup small { display: block; margin-top: 2px; color: #8e9bad; font-size: 9px; letter-spacing: 1.2px; }
.brand-mark { width: 43px; height: 43px; display: block; object-fit: contain; padding: 3px; border-radius: 14px; background: white; box-shadow: 0 8px 18px #108a8230; }
.login-kicker { margin-top: 14px; color: var(--teal-dark); font-size: 12px; font-weight: 700; }
.login-card h1 { margin: 4px 0; font-size: 25px; }
.muted { color: var(--muted); line-height: 1.8; }
.login-card .muted { margin: 4px 0 12px; font-size: 13px; }
.local-login-fields { display: grid; gap: 6px; margin: 0 0 10px; }
.local-login-fields label { margin-top: 2px; color: #42566e; font-size: 12px; font-weight: 700; }
.local-login-fields input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: #fbfcfe; color: var(--ink); transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.local-login-fields input:focus { border-color: var(--blue); background: white; box-shadow: 0 0 0 3px #4464df1b; }
.login-title-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.login-title-icon { width: 36px; height: 36px; display: grid; flex: none; place-items: center; border-radius: 11px; color: #087b75; background: linear-gradient(135deg, #dff5f0, #e7edff); }
.login-title-row .login-title-icon + h1 { margin: 0; }
.login-title-row--badge { display: inline-flex; width: fit-content; padding: 6px 16px 6px 6px; border-radius: 999px; background: linear-gradient(135deg, #e3f8f3, #eef1ff); box-shadow: 0 2px 10px #0e8a7d14; }
.login-title-row--badge .login-title-icon { width: 30px; height: 30px; border-radius: 999px; color: #ffffff; background: linear-gradient(135deg, var(--teal), var(--teal-dark)); }
.login-title-row--badge h1 { font-size: 16px; font-weight: 800; letter-spacing: .1px; color: var(--teal-dark); }
.merchant-portal-card { margin-top: 17px; padding: 15px; border: 1px solid #dce8ea; border-radius: 15px; background: linear-gradient(135deg, #f2fbf8, #f6f8ff); }
.merchant-portal-heading { display: flex; align-items: center; gap: 10px; }
.merchant-portal-icon { width: 34px; height: 34px; display: grid; flex: none; place-items: center; border-radius: 11px; color: #087b75; background: #dff5f0; font-size: 17px; font-weight: 800; }
.merchant-portal-eyebrow { display: block; color: #178079; font-size: 9px; font-weight: 700; }
.merchant-portal-heading h2 { margin: 2px 0 0; font-size: 14px; }
.portal-badge { margin-right: auto; padding: 5px 8px; border: 1px solid #d8e6e9; border-radius: 999px; color: #597082; background: #ffffffc7; font-size: 9px; white-space: nowrap; }
.merchant-portal-card > p { margin: 10px 0 12px; font-size: 11px; line-height: 1.75; }
.merchant-portal-url { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid #e4ebf0; border-radius: 9px; color: #718096; background: #ffffffb5; font-size: 9px; }
.merchant-portal-url code { overflow-wrap: anywhere; color: #40536c; direction: ltr; font: 10px Consolas, monospace; text-align: left; }
.merchant-portal-card .button.full { margin-top: 10px; }
.local-portal-links { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.local-portal-links .button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.local-origin { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: #8693a5; font-size: 11px; }
.login-card .notice { margin: 6px 0; padding: 8px 11px; }
.login-card .button.full { margin-top: 6px; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { position: fixed; z-index: 5; inset: 0 0 0 auto; width: 255px; display: flex; flex-direction: column; padding: 23px 15px 15px; background: var(--nav); color: #e8eff8; }
.sidebar .brand-lockup { padding: 0 9px 20px; color: white; border-bottom: 1px solid #ffffff17; }
.sidebar .brand-mark { background: #b8eee6; box-shadow: none; }
.workspace-label { margin: 19px 10px 9px; color: #8497ad; font-size: 10px; font-weight: 700; letter-spacing: .4px; }
.main-nav { flex: 1; overflow-y: auto; }
.nav-section-title { margin: 17px 10px 7px; color: #8092a8; font-size: 10px; font-weight: 700; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 0; border-radius: 10px; color: #c2cedd; background: transparent; text-align: right; font-size: 12px; transition: background .16s ease, color .16s ease; }
.nav-item:hover { color: white; background: #ffffff0e; }
.nav-item.active { color: white; background: linear-gradient(100deg, #168b85, #147b7a); box-shadow: 0 7px 18px #07162044; }
.nav-icon { width: 20px; display: inline-grid; place-items: center; color: #9eb2c8; font-size: 15px; }
.nav-item.active .nav-icon { color: white; }
.merchant-subnav { display: grid; gap: 4px; margin: 4px 8px 13px 18px; padding-inline-start: 10px; border-inline-start: 1px solid #ffffff20; }
.merchant-subnav-item { width: 100%; min-height: 37px; justify-content: flex-start; padding: 8px 10px; border: 0; border-radius: 8px; color: #aebed0; background: transparent; text-align: right; font-size: 10px; }
.merchant-subnav-item:hover { color: #ffffff; background: #ffffff10; }
.merchant-subnav-item.active { color: #ffffff; background: #138a84; font-weight: 750; box-shadow: 0 5px 14px #07162033; }
.desktop-setup-steps { padding-inline-start: 24px; line-height: 1.9; }
.desktop-setup-steps li + li { margin-top: 10px; }
.sidebar-bottom { padding-top: 13px; border-top: 1px solid #ffffff17; }
.local-card { display: flex; align-items: center; gap: 10px; margin: 0 3px 9px; padding: 11px; border-radius: 11px; background: #ffffff0b; }
.local-card b, .local-card small { display: block; }
.local-card b { font-size: 11px; }
.local-card small { margin-top: 3px; color: #91a3b8; font-size: 10px; direction: ltr; text-align: right; }
.health-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: white; color: #617186; font-size: 10px; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #14a27f; box-shadow: 0 0 0 3px #14a27f1c; }
.health-pill.offline .status-dot { background: #d5962f; box-shadow: 0 0 0 3px #d5962f22; }
.main-area { width: calc(100% - 255px); min-height: 100vh; margin-right: 255px; }
.portal-ltr { direction: ltr; text-align: left; }
.portal-ltr .sidebar { inset: 0 auto 0 0; }
.portal-ltr .main-area { margin-right: 0; margin-left: 255px; }
.portal-ltr .nav-item { text-align: left; }
.portal-ltr .local-card small { text-align: left; }
.portal-ltr .portal-badge { margin-right: 0; margin-left: auto; }
.portal-ltr .table-wrap table { text-align: left; }
.portal-ltr .hero:after { right: -55px; left: auto; }
.topbar { position: sticky; z-index: 3; top: 0; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: #ffffffed; backdrop-filter: blur(16px); }
.breadcrumb { color: #8a97a8; font-size: 10px; }
.page-title { margin-top: 4px; font-size: 16px; font-weight: 750; }
.topbar-end { display: flex; align-items: center; gap: 17px; }
.portal-refresh-action { display: inline-flex; align-items: center; gap: 5px; }
.portal-refresh-glyph { font-size: 15px; line-height: 1; }
.profile-chip { display: flex; align-items: center; gap: 9px; min-width: 140px; }
.profile-chip b, .profile-chip small { display: block; }
.profile-chip b { font-size: 11px; }
.profile-chip small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 12px; color: #087c78; background: #dff5f0; font-size: 13px; font-weight: 800; }
.page-content { max-width: 1500px; margin: 0 auto; padding: 27px 30px 42px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 19px; }
.page-heading h1 { margin: 0; font-size: 23px; letter-spacing: -.25px; }
.page-heading p { max-width: 760px; margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-section-content { min-width: 0; }
.portal-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; margin-bottom: 16px; padding: 15px; border: 1px solid #e0e8f1; border-radius: 12px; background: #f7f9fc; }
.portal-filter-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.portal-filter-actions .button { min-height: 40px; }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 14px; border: 1px solid transparent; border-radius: 9px; font-size: 11px; font-weight: 650; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .52; cursor: not-allowed; transform: none; }
.button.primary { color: white; background: var(--blue); box-shadow: 0 5px 13px #4464df25; }
.button.primary:hover { background: #3554cd; box-shadow: 0 7px 18px #4464df38; }
.button.teal { color: white; background: var(--teal); }
.button.teal:hover { background: var(--teal-dark); }
.button.secondary { color: #40536c; border-color: #dce5ee; background: white; }
.button.secondary:hover { background: #f7fafc; border-color: #cbd8e4; }
.button.danger { color: #a13f3d; border-color: #f1d2d0; background: #fff8f7; }
.button.danger:hover { background: #fff0ee; }
.button.quiet { color: #64758a; border-color: transparent; background: transparent; }
.button.small { min-height: 30px; padding: 6px 9px; font-size: 10px; }
.button.full { width: 100%; margin-top: 13px; min-height: 44px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; }
.mobile-only { display: none; }
.hero { position: relative; overflow: hidden; margin-bottom: 18px; padding: 23px 25px; border-radius: 16px; color: white; background: linear-gradient(112deg, #17374d, #155e67 66%, #168881); box-shadow: 0 12px 30px #183c4b20; }
.hero:after { position: absolute; left: -55px; top: -90px; width: 250px; height: 250px; border: 1px solid #ffffff18; border-radius: 50%; box-shadow: 0 0 0 26px #ffffff08, 0 0 0 52px #ffffff06; content: ""; }
.hero h1 { position: relative; z-index: 1; margin: 0 0 6px; font-size: 23px; }
.hero p { position: relative; z-index: 1; max-width: 720px; margin: 0; color: #d8e8eb; font-size: 11px; line-height: 1.8; }
.hero .button { position: relative; z-index: 1; margin-top: 15px; }
.grid { display: grid; gap: 13px; }
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.two-col { grid-template-columns: minmax(0, 1.5fr) minmax(270px, .9fr); align-items: start; }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { min-width: 0; margin-bottom: 15px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: 0 3px 11px #12243b05; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.card-header h2 { margin: 0; font-size: 14px; }
.card-header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.kpi-card { position: relative; min-height: 115px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.kpi-label { color: #718197; font-size: 10px; }
.kpi-value { margin-top: 13px; font-size: 24px; font-weight: 760; letter-spacing: -.4px; }
.kpi-foot { margin-top: 5px; color: #8e9aac; font-size: 9px; }
.kpi-icon { position: absolute; left: 15px; top: 14px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; color: #197c7a; background: #e5f5f3; font-size: 12px; font-weight: 700; }
.portal-ltr .kpi-icon { right: 15px; left: auto; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.field { width: 100%; min-height: 39px; padding: 9px 11px; border: 1px solid #dbe4ec; border-radius: 8px; outline: 0; color: var(--ink); background: white; font-size: 11px; transition: border .14s ease, box-shadow .14s ease; }
.field:focus { border-color: #6a85e7; box-shadow: 0 0 0 3px #4464df19; }
.field::placeholder { color: #a0adbb; }
.localized-date-control { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 5px; align-items: center; }
.localized-date-display { direction: ltr; text-align: start; font-variant-numeric: tabular-nums; }
.localized-date-trigger { display: grid; width: 38px; min-height: 39px; padding: 8px; place-items: center; }
.localized-date-trigger svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.localized-date-native { position: absolute; inset-inline-end: 39px; bottom: 1px; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.localized-date-field .form-help { direction: ltr; text-align: start; }
textarea.field { min-height: 86px; resize: vertical; line-height: 1.7; }
.search-field { width: min(360px, 100%); }
.filter-field { width: auto; min-width: 155px; }
.field-label { display: block; margin-bottom: 6px; color: #52647a; font-size: 10px; font-weight: 650; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.portal-form { gap: 9px; }
.analytics-filter { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; padding: 12px; border: 1px solid #e8edf4; border-radius: 11px; background: #f8faff; }
.analytics-submit { display: flex; align-items: end; }
.analytics-submit .button { width: 100%; justify-content: center; }
.analytics-kpis { margin-block: 14px 20px; }
.analytics-currency-section { margin-block: 16px 20px; padding: 14px 16px; border: 1px solid #e5eaf4; border-radius: 13px; background: linear-gradient(180deg, #fbfcff, #fff); }
.analytics-currency-section + .analytics-currency-section { margin-block-start: 18px; }
.analytics-currency-heading { display: flex; align-items: center; gap: 7px; margin: 0; color: #3349b8; font-size: 13px; }
.analytics-currency-heading bdi { padding: 3px 8px; border: 1px solid #d8e0ff; border-radius: 999px; background: #f0f3ff; color: #304acb; font-size: 10px; }
.portal-sales-chart { margin: 14px 0 20px; padding: 14px 16px 8px; border: 1px solid #e8edf4; border-radius: 11px; background: linear-gradient(180deg, #fbfcff, #fff); }
.portal-sales-chart svg { display: block; width: 100%; max-height: 250px; overflow: visible; }
.portal-sales-chart .chart-label { fill: #7c899c; font: 9px sans-serif; }
.chart-legend { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; color: #64748b; font-size: 10px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: #465ce5; }
.form-field { min-width: 0; }
.form-field.full-span { grid-column: 1 / -1; }
.employee-permission-picker { min-width: 0; margin: 0; padding: 10px 12px; border: 1px solid #e3eaf4; border-radius: 10px; }
.employee-permission-picker legend { padding-inline: 5px; }
.employee-permission-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; max-height: 240px; overflow: auto; }
.employee-permission-option { display: flex; align-items: flex-start; gap: 8px; min-width: 0; padding: 7px 8px; border-radius: 7px; background: #f8faff; color: #475569; font-size: 10px; line-height: 1.6; }
.employee-permission-option input { flex: 0 0 auto; margin-top: 2px; accent-color: #465ce5; }
.employee-permission-option:has(input:disabled) { color: #93a0af; background: #f4f6f8; }
#portalEmployeeAddForm { gap: 6px; }
#portalEmployeeAddForm .field-label { margin-bottom: 4px; }
#portalEmployeeAddForm .employee-permission-picker { padding-block: 8px; }
.modal-body:has(#portalEmployeeAddForm) { padding-block: 12px; }
.form-help { display: block; margin-top: 5px; color: #8795a6; font-size: 9px; line-height: 1.6; }
.form-error { margin: 10px 0; padding: 9px 11px; border: 1px solid #f1d2d0; border-radius: 8px; color: #a13f3d; background: #fff8f7; font-size: 10px; line-height: 1.7; }
.notice { margin: 10px 0; padding: 11px 13px; border: 1px solid transparent; border-radius: 9px; font-size: 10px; line-height: 1.75; }
.notice.info { border-color: #d6e7f3; color: #45647c; background: #f2f8fc; }
.notice.success { border-color: #cbe8dc; color: #276d58; background: #f0faf5; }
.notice.warning { border-color: #f0e1bd; color: #86601e; background: #fffaf0; }
.notice.error { border-color: #f0d2d0; color: #963d3b; background: #fff6f5; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 650; white-space: nowrap; }
.badge.green { color: #237357; background: #e8f6ef; }
.badge.blue { color: #3c57b9; background: #edf1ff; }
.badge.amber { color: #96610e; background: #fff5df; }
.badge.red { color: #a13f3d; background: #fff0ee; }
.badge.gray { color: #68798c; background: #f0f3f6; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid #e8edf2; border-radius: 9px; }
table { width: 100%; border-collapse: collapse; min-width: 680px; text-align: right; }
thead { background: #f7f9fb; }
th { padding: 11px 12px; color: #728198; font-size: 9px; font-weight: 700; white-space: nowrap; }
td { padding: 11px 12px; border-top: 1px solid #edf1f4; color: #344960; font-size: 10px; vertical-align: middle; }
tbody tr:hover { background: #fbfcfd; }
.primary-cell { color: var(--ink); font-weight: 650; }
.secondary-cell { display: block; margin-top: 4px; color: #8a98a8; font-size: 9px; font-weight: 400; }
.empty-state { padding: 38px 20px; color: #8492a2; text-align: center; font-size: 11px; }
.empty-symbol { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 10px; border-radius: 14px; color: #4d6edc; background: #edf1ff; font-size: 18px; }
.list-stack { display: grid; gap: 8px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid #edf1f4; border-radius: 9px; background: white; }
.list-row b, .list-row small { display: block; }
.list-row b { font-size: 10px; }
.list-row small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.onboarding-progress { margin-bottom: 13px; padding: 12px; border: 1px solid #e7edf5; border-radius: 10px; background: #f8faff; }
.onboarding-progress-label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: #51637a; font-size: 10px; }
.onboarding-progress-label span { color: #405bdd; font-weight: 750; }
.onboarding-progress progress { display: block; width: 100%; height: 8px; overflow: hidden; border: 0; border-radius: 999px; background: #e5eaf3; accent-color: #405bdd; }
.onboarding-progress progress::-webkit-progress-bar { border-radius: 999px; background: #e5eaf3; }
.onboarding-progress progress::-webkit-progress-value { border-radius: 999px; background: linear-gradient(90deg, #405bdd, #16a085); }
.onboarding-progress progress::-moz-progress-bar { border-radius: 999px; background: linear-gradient(90deg, #405bdd, #16a085); }
.onboarding-list { display: grid; gap: 8px; }
.onboarding-step { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 11px; border: 1px solid #edf1f5; border-radius: 10px; background: white; }
.onboarding-step-mark { display: grid; flex: 0 0 25px; width: 25px; height: 25px; place-items: center; border-radius: 50%; font-size: 10px; font-weight: 750; }
.onboarding-step-mark.done { color: #237357; background: #e8f6ef; }
.onboarding-step-mark.pending { color: #6c7a91; background: #f0f3f7; }
.onboarding-step-copy { flex: 1; min-width: 0; }
.onboarding-step-copy b, .onboarding-step-copy small { display: block; }
.onboarding-step-copy b { color: #344960; font-size: 10px; }
.onboarding-step-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.55; }
@media (max-width: 560px) { .onboarding-step { align-items: flex-start; flex-wrap: wrap; } .onboarding-step .button, .onboarding-step .badge { margin-inline-start: 35px; } }
.metric-line { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid #eef2f5; font-size: 10px; }
.metric-line:last-child { border-bottom: 0; }
.metric-line span { color: var(--muted); }
.metric-line b { text-align: left; }
.toolbar-group { display: flex; flex-wrap: wrap; gap: 7px; }
.toolbar-group-spaced { margin-top: 12px; }
.check-row { display: flex; align-items: flex-start; gap: 8px; font-size: 10px; line-height: 1.65; }
.check-row input { accent-color: var(--teal); }
.divider { height: 1px; margin: 14px 0; background: #edf1f4; }
.feature-list { display: flex; flex-wrap: wrap; gap: 6px; }
.feature-chip { padding: 6px 8px; border-radius: 7px; color: #527064; background: #edf7f2; font-size: 9px; }
.feature-chip small { display: block; margin-top: 3px; color: #77899b; font: 8px Consolas, monospace; direction: ltr; }
.plan-entitlement-editor { min-width: 0; padding: 12px; border: 1px solid #e5ebf2; border-radius: 11px; background: #f9fbfd; }
.plan-entitlement-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.plan-entitlement-heading b, .plan-entitlement-heading small { display: block; }
.plan-entitlement-heading b { color: #263c52; font-size: 11px; }
.plan-entitlement-heading small { margin-top: 4px; color: #718197; font-size: 9px; line-height: 1.6; }
.plan-feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 12px; }
.plan-feature-option { display: grid; gap: 8px; min-width: 0; padding: 9px 10px; border: 1px solid #e6ebf1; border-radius: 9px; background: white; }
.plan-feature-toggle { display: flex; align-items: flex-start; gap: 8px; min-width: 0; cursor: pointer; }
.plan-feature-toggle input { flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--teal); }
.plan-feature-toggle span { display: grid; min-width: 0; }
.plan-feature-toggle b { color: #354a60; font-size: 9px; }
.plan-feature-toggle small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.plan-feature-toggle code { margin-top: 4px; color: #8a97a6; font-size: 8px; }
.plan-feature-limit { display: grid; grid-template-columns: minmax(110px, .75fr) minmax(75px, 1fr); align-items: center; gap: 8px; padding-top: 7px; border-top: 1px solid #eff2f6; color: #728197; font-size: 8px; }
.plan-feature-limit .field { min-height: 32px; padding: 6px 8px; font-size: 9px; }
.plan-feature-limit .field:disabled { opacity: .45; }
.timeline { display: grid; gap: 10px; }
.timeline-item { position: relative; padding: 2px 16px 10px 0; border-right: 2px solid #d9e9e6; }
.timeline-item:before { position: absolute; top: 4px; right: -5px; width: 8px; height: 8px; border: 2px solid white; border-radius: 50%; background: #198b83; content: ""; }
.timeline-item b { display: block; font-size: 10px; }
.timeline-item p { margin: 5px 0; color: #586b80; font-size: 10px; line-height: 1.7; white-space: pre-wrap; }
.timeline-item small { color: #8a98a8; font-size: 9px; }
.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 22px; background: #0f2033a8; backdrop-filter: blur(3px); }
.modal-card { width: min(720px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid #e6edf3; border-radius: 16px; background: white; box-shadow: 0 24px 70px #0c192640; }
.modal-card.wide { width: min(930px, 100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 18px 21px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 16px; }
.modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.modal-body { overflow: auto; padding: 18px 21px 21px; }
.modal-footer { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 8px; padding: 13px 21px; border-top: 1px solid var(--line); background: #fbfcfd; }
.secret-box { direction: ltr; text-align: left; word-break: break-all; font-family: Consolas, monospace; }
.toast-root { position: fixed; z-index: 40; left: 20px; bottom: 20px; display: grid; gap: 7px; }
.toast { max-width: min(430px, calc(100vw - 40px)); padding: 12px 15px; border: 1px solid #d7e1e8; border-radius: 10px; color: #263c52; background: white; box-shadow: 0 10px 30px #11243a21; font-size: 10px; line-height: 1.6; animation: toast-in .18s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.loading { display: flex; align-items: center; gap: 10px; padding: 45px; color: #728197; font-size: 11px; }
.spinner { width: 17px; height: 17px; border: 2px solid #d8e0e8; border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.inline-code { direction: ltr; display: inline-block; padding: 2px 5px; border-radius: 4px; color: #486079; background: #f1f4f7; font: 9px Consolas, monospace; }
.mobile-menu-open .sidebar { transform: translateX(0); }
@media (max-width: 1120px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-content { padding-inline: 22px; }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(105%); transition: transform .2s ease; box-shadow: -12px 0 35px #0a19252b; }
  .main-area { width: 100%; margin-right: 0; }
  .mobile-only { display: grid; }
  .topbar { justify-content: flex-start; padding: 10px 14px; }
  .topbar-end { margin-right: auto; gap: 8px; }
  .profile-chip { min-width: 0; }
  .profile-chip small { display: none; }
  .health-pill { display: none; }
  .page-content { padding: 20px 14px 32px; }
  .portal-ltr .sidebar { transform: translateX(-105%); }
  .portal-ltr.mobile-menu-open .sidebar { transform: translateX(0); }
  .portal-ltr .topbar-end { margin-right: 0; margin-left: auto; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .login-card { padding: 26px 21px; }
  .topbar { min-height: 64px; }
  .breadcrumb { font-size: 9px; }
  .page-title { font-size: 14px; }
  .profile-chip b { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
  .avatar { width: 31px; height: 31px; }
  .page-heading { display: block; }
  .heading-actions { margin-top: 13px; }
  .page-heading h1 { font-size: 20px; }
  .kpi-grid { gap: 8px; }
  .kpi-card { min-height: 102px; padding: 12px; }
  .kpi-value { font-size: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .employee-permission-list { grid-template-columns: 1fr; }
  .analytics-filter { grid-template-columns: 1fr; }
  .portal-filter-grid { grid-template-columns: 1fr; padding: 12px; }
  .portal-filter-actions .button { flex: 1 1 120px; }
  .form-field.full-span { grid-column: auto; }
  .search-field { width: 100%; }
  .modal-backdrop { padding: 9px; }
  .modal-card { max-height: 94vh; border-radius: 12px; }
  .modal-header, .modal-body { padding-inline: 15px; }
  .modal-footer { padding-inline: 15px; }
  .plan-feature-grid { grid-template-columns: 1fr; }
  .plan-entitlement-heading { display: block; }
  .plan-entitlement-heading .badge { display: inline-flex; margin-top: 7px; }
}

/* Keep portal pages usable on phones and narrow tablet screens. */
html, body { max-width: 100%; overflow-x: clip; }
.app-shell, .main-area, .page-content, .card, .card-header, .grid, .form-grid, .form-field { min-width: 0; }
.main-area { min-width: 0; }
.card-header > :first-child { min-width: 0; }
.card-header > .button { flex: none; }
.table-wrap { max-width: 100%; overscroll-behavior-inline: contain; }
.table-wrap table { width: 100%; }
.notice, .page-heading p, .card-header p { overflow-wrap: anywhere; }
@media (max-width: 820px) {
  body.mobile-menu-open::before { position: fixed; z-index: 4; inset: 0; display: block; background: #0b172599; content: ""; }
  .sidebar { width: min(290px, 86vw); }
  .portal-ltr .main-area { width: 100%; margin-left: 0; }
  .topbar { min-width: 0; gap: 10px; }
  .topbar > :nth-child(2) { min-width: 0; }
  .topbar-end { min-width: 0; }
  .page-content { width: 100%; }
  .three-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-header { flex-wrap: wrap; }
  .analytics-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .login-view { min-height: 100svh; padding: 12px; }
  .login-card { width: 100%; padding: 22px 16px; }
  .topbar { gap: 8px; padding-inline: 10px; }
  .topbar-end { gap: 6px; }
  .topbar-end .button { min-height: 34px; padding-inline: 8px; }
  .portal-refresh-label { display: none; }
  .profile-chip { gap: 6px; }
  .profile-chip b { max-width: 82px; }
  .page-content { padding: 15px 10px 28px; }
  .page-heading h1 { font-size: 18px; line-height: 1.35; }
  .heading-actions, .heading-actions .button { width: 100%; }
  .card { padding: 13px; }
  .card-header { align-items: stretch; }
  .card-header > .button { width: 100%; }
  .three-col { grid-template-columns: 1fr; }
  .analytics-filter { grid-template-columns: minmax(0, 1fr); padding: 9px; }
  .analytics-submit .button, .form-field > .button { width: 100%; min-height: 42px; }
  .toolbar { align-items: stretch; }
  .toolbar > .button, .toolbar-group { width: 100%; }
  .toolbar-group > .button { flex: 1; }
  .table-wrap { margin-inline: 0; }
  .table-wrap table { min-width: 650px; }
  .list-row { align-items: flex-start; }
  .local-portal-links { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .topbar-end [data-portal-language-toggle] { max-width: 72px; overflow: hidden; }
  .profile-chip b { max-width: 62px; }
}

:root {
  --canvas: #f2f5f9;
  --line: #e3e9f0;
  --paper: #ffffff;
}
.main-area { background: linear-gradient(180deg, #f8fafd 0, var(--canvas) 260px); }
.topbar { box-shadow: 0 4px 18px #14243908; }
.breadcrumb { letter-spacing: .1px; }
.page-content { padding-top: 30px; }
.page-heading { align-items: center; margin-bottom: 22px; }
.page-heading h1 { font-size: 25px; font-weight: 800; letter-spacing: -.4px; }
.page-heading p { line-height: 1.85; }
.card {
  margin-bottom: 17px;
  padding: 19px;
  border-color: #e3e9f0;
  border-radius: 16px;
  box-shadow: 0 5px 20px #19334d08;
}
.card-header { margin-bottom: 16px; }
.card-header h2 { font-size: 15px; font-weight: 750; }
.card-header p { line-height: 1.8; }
.kpi-card {
  min-height: 122px;
  border-color: #e3e9f0;
  border-radius: 15px;
  background: linear-gradient(145deg, #ffffff, #fbfcfe);
  box-shadow: 0 4px 14px #19334d07;
}
.kpi-value { font-variant-numeric: tabular-nums; }
.button { border-radius: 10px; }
.button.primary { box-shadow: 0 5px 14px #4464df2b; }
.button:focus-visible, .icon-button:focus-visible, .field:focus-visible {
  outline: 3px solid #4464df45;
  outline-offset: 2px;
}
.field { min-height: 42px; border-color: #d9e2ec; border-radius: 10px; }
.field-label { color: #465b72; font-size: 11px; }
.portal-filter-grid, .analytics-filter {
  border-color: #e1e8f1;
  border-radius: 14px;
  background: linear-gradient(145deg, #f7f9fc, #f3f6fa);
}
.table-wrap { border-color: #e3e9f0; border-radius: 12px; }
thead { background: #f6f8fb; }
th { padding-block: 13px; }
td { padding-block: 12px; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: #f7f9fc; }
.notice { border-radius: 11px; }
.portal-update-notice p { margin: 5px 0 0; }
.empty-state { padding-block: 44px; }
@media (max-width: 820px) {
  .page-content { padding-top: 21px; }
  .page-heading { margin-bottom: 17px; }
  .page-heading h1 { font-size: 22px; }
  .card { padding: 16px; border-radius: 15px; }
  .kpi-card { min-height: 108px; }
}
@media (max-width: 560px) {
  .topbar { box-shadow: 0 3px 14px #1424390a; }
  .page-content { padding-top: 17px; }
  .page-heading h1 { font-size: 20px; }
  .card { padding: 14px; }
  .card-header { gap: 9px; margin-bottom: 13px; }
  .card-header h2 { font-size: 14px; }
  .button { min-height: 40px; }
  .button.small { min-height: 32px; }
  .field { min-height: 42px; }
}

.progress-track { block-size: .45rem; margin-block: .35rem .75rem; overflow: hidden; border-radius: 999px; background: var(--surface-muted, #e8eaf0); }
.progress-track > span { block-size: 100%; border-radius: inherit; background: var(--accent, #6750a4); }
