/* Ordervia UI/UX Design System 1.0 — shared application foundations.
 * Load after feature styles. Keep workflow geometry in feature stylesheets.
 * Public marketing and printed invoices deliberately have separate typography.
 */
@font-face {
  font-family:Inter; font-style:normal; font-weight:100 900; font-display:swap;
  src:url('/ui-assets/inter-latin-wght-normal.woff2') format('woff2');
}
:root {
  --ov-color-navy: #142b49;
  --ov-color-deep: #0c2039;
  --ov-color-action: #285b96;
  --ov-color-canvas: #f3f6fa;
  --ov-color-surface: #fff;
  --ov-color-text: #172c42;
  --ov-color-muted: #53687d;
  --ov-color-line: #dce5ee;
  --ov-color-control: #64748b;
  --ov-color-success: #166534;
  --ov-color-warning: #92400e;
  --ov-color-danger: #b91c1c;
  --ov-font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ov-text-body: 14px;
  --ov-text-small: 12px;
  --ov-text-section: 18px;
  --ov-text-title: 24px;
  --ov-text-subheading: 16px;
  --ov-text-dialog: 20px;
  --ov-text-kpi: 28px;
  --ov-text-brand: 32px;
  --ov-space-1: 4px;
  --ov-space-2: 8px;
  --ov-space-3: 12px;
  --ov-space-4: 16px;
  --ov-space-6: 24px;
  --ov-space-8: 32px;
  --ov-radius-control: 8px;
  --ov-radius-card: 8px;
  --ov-radius-dialog: 12px;
  --ov-radius-small: 4px;
  --ov-radius-pill: 999px;
  --ov-sidebar-width: 240px;
  --ov-header-height: 60px;
  --ov-page-padding: 24px;
  --ov-layer-menu: 30;
  --ov-control-height: 40px;
  --ov-focus: 3px solid var(--ov-color-action);
  /* Compatibility aliases for existing modules. */
  --navy: var(--ov-color-navy);
  --deep: var(--ov-color-deep);
  --blue: var(--ov-color-action);
  --pale: var(--ov-color-canvas);
  --line: var(--ov-color-line);
  --ink: var(--ov-color-text);
  --muted: var(--ov-color-muted);
}
@media screen {
  body {font-family:var(--ov-font);font-size:var(--ov-text-body);line-height:1.5}
  .shell, .bw-shell {--navy:var(--ov-color-navy);--ink:var(--ov-color-text);--muted:var(--ov-color-muted);--line:var(--ov-color-line);--pale:var(--ov-color-canvas)}
  #app .shell .top h1, .bw-shell .top h1 {font-size:var(--ov-text-title);line-height:1.333;font-weight:600;letter-spacing:normal}
  .shell .card h2, .bw-page .card h2, .rw-panel h2, .rw-heading, .ar-header h2 {font-size:var(--ov-text-section);line-height:1.555;font-weight:600}
  .shell .card, .bw-page .card, .rw-panel, .rw-toolbar {border-radius:var(--ov-radius-card)}
  .shell .primary, .shell .secondary, dialog .primary, dialog .secondary,
  .bw-shell .primary, .bw-shell .secondary, .bw-page .small {
    font-family:var(--ov-font);font-size:var(--ov-text-body);font-weight:500;
    min-height:var(--ov-control-height);line-height:1.4286;border-radius:var(--ov-radius-control);
    padding:8px 12px;box-sizing:border-box;
  }
  .shell label, dialog label, .bw-page label, .rw-toolbar label, .rw-panel-head label {
    font-size:var(--ov-text-body);line-height:1.4286;font-weight:500;
  }
  .shell :is(input,select,textarea), .bw-page :is(input,select,textarea),
  .rw-toolbar :is(input,select), dialog :is(input,select,textarea) {
    font-family:var(--ov-font);font-size:var(--ov-text-body);line-height:1.4286;
    border-color:var(--ov-color-control);border-radius:var(--ov-radius-control);
  }
  .shell :is(input,select):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not(.ov-password-field > input),
  dialog :is(input,select):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not(.ov-password-field > input) {
    min-height:var(--ov-control-height);height:auto;padding:8px 10px;
  }
  .shell :is(.bw-tabs,.sales-workspace-tabs,.rw-tabs,.ar-tabs) :is(a,button),
  .bw-shell .sales-workspace-tabs :is(a,button) {
    font-family:var(--ov-font);font-size:var(--ov-text-body);font-weight:500;
    min-height:44px;line-height:20px;padding:12px;box-sizing:border-box;
  }
  .shell :is(.bw-tabs,.sales-workspace-tabs,.rw-tabs,.ar-tabs) :is([aria-current=page],[aria-pressed=true]) {
    color:#fff;background:var(--ov-color-navy);border-bottom-color:var(--ov-color-navy);
  }
  .shell table, .bw-page table, .rw-table {font-size:var(--ov-text-body);line-height:1.4286}
  .shell th, .bw-page th, .rw-table th {font-size:var(--ov-text-small);font-weight:600;text-transform:none;letter-spacing:normal}
  .shell :is(td,th), .bw-page :is(td,th), .rw-table :is(td,th) {padding:12px}
  .shell :is(td,th) {font-variant-numeric:tabular-nums}
  /* Fixed-layout customer actions wrap between controls, never inside words. */
  .bw-customer-controls .customer-card-actions {flex-wrap:wrap}
  .bw-customer-controls .customer-card-actions :is(button,a) {white-space:nowrap}
  .shell .stat-label, .rw-cards span, .shell .pill {font-size:var(--ov-text-small);line-height:1.333}
  dialog:not(.photo-dialog):not(.ov-image-dialog) {border-radius:var(--ov-radius-dialog);max-width:calc(100vw - 24px);max-height:90dvh;overflow:auto}
  dialog h2, .bw-dialog h2, .email-workflow-dialog h2 {font-size:20px;line-height:1.4;font-weight:600}
  :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible {outline:var(--ov-focus);outline-offset:3px}
  :is(button,input,select,textarea):disabled {cursor:not-allowed}
  input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] {border-color:var(--ov-color-danger)}
  @media(max-width:850px), (pointer:coarse) {
    :root {--ov-control-height:44px}
    .shell :is(input,select,textarea), .bw-page :is(input,select,textarea),
    .rw-toolbar :is(input,select), dialog :is(input,select,textarea) {font-size:16px}
    .shell .primary, .shell .secondary, .bw-shell .top :is(button,a.primary,a.secondary),
    .bw-page .small, dialog .primary, dialog .secondary {min-height:44px}
    .bw-shell .sales-workspace-tabs :is(button,a) {font-size:var(--ov-text-body)}
  }
  @media(prefers-reduced-motion:reduce) {
    *, *::before, *::after {scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
  }
}

/* Shared layout and component contracts. Feature styles supply data geometry. */
@media screen {
  #app .ov-app-shell .content {padding:var(--ov-page-padding);min-width:0}
  #app .ov-app-shell .sidebar {width:var(--ov-sidebar-width);background:var(--ov-color-surface);color:var(--ov-color-text);border-right:1px solid var(--ov-color-line);padding:24px 16px;display:flex;flex-direction:column}
  #app .ov-app-shell .sidebar .logo {font-size:var(--ov-text-brand);padding:0 8px}
  #app .ov-app-shell .sidebar .tagline {padding:0 8px;margin:4px 0 24px}
  #app .ov-app-shell .sidebar nav {display:flex;flex-direction:column;gap:4px}
  #app .ov-app-shell .sidebar :is(.logo,.nav) {color:var(--ov-color-navy)}
  #app .ov-app-shell .sidebar .tagline, #app .ov-app-shell .sidebar-bottom {color:var(--ov-color-muted)}
  #app .ov-app-shell .sidebar .nav {font-size:var(--ov-text-body);font-weight:500;border-radius:var(--ov-radius-control);min-height:44px;text-decoration:none;padding:12px;margin:0}
  #app .ov-app-shell .sidebar .nav.active {color:#fff;background:var(--ov-color-navy);box-shadow:none}
  #app .ov-app-shell .sidebar .nav:hover:not(.active) {background:#e6eef8}
  #app .ov-app-shell .top {min-height:var(--ov-header-height);margin-bottom:var(--ov-space-4)}
  #app .ov-app-shell .card {padding:var(--ov-space-4);margin-bottom:var(--ov-space-4);box-shadow:none}
  #app .ov-app-shell :is(.card h3,.rw-panel h3) {font-size:var(--ov-text-subheading);line-height:1.5;font-weight:600}
  #app .ov-app-shell .row {gap:var(--ov-space-2)}
  #app .ov-app-shell :is(.grid,.form-grid) {gap:var(--ov-space-4)}
  #app .ov-app-shell :is(button,a.ov-navigation-link):not(.product-title-link), .ov-dialog button {font-family:var(--ov-font);font-size:var(--ov-text-body);font-weight:500;line-height:20px;min-height:var(--ov-control-height);box-sizing:border-box}
  #app .ov-app-shell .mini-qty button {font-size:var(--ov-text-dialog);min-height:44px}
  #app .ov-app-shell .studio-group.cs-product {height:auto;min-height:176px}
  #app .ov-app-shell .cs-product h3 {font-size:var(--ov-text-body);line-height:20px}
  #app .ov-app-shell .stat {font-size:var(--ov-text-kpi);line-height:1.3}
  /* Contain native select option overflow in WebKit without clipping the grid. */
  #app .ov-app-shell .compact-filter-grid>div, #app .ov-app-shell #shop-browse-filters>div {overflow:hidden}
  #app .ov-app-shell .compact-filter-grid :is(input,select):focus-visible {outline-offset:-3px}
  #app .ov-app-shell.sales-workspace-shell .compact-filter-grid :is(input,select) {min-height:44px;height:44px}
  #app .ov-app-shell .compact-toolbar .card {padding:0;margin:0;border:0;box-shadow:none}
  #app .ov-app-shell .compact-dock {left:calc(var(--ov-sidebar-width) + var(--ov-page-padding));right:var(--ov-page-padding)}
  #app .ov-app-shell:not(.sales-workspace-shell) .compact-card .shop-photo {height:var(--ov-catalog-photo-height,clamp(85px,12vh,140px))}
  #app .ov-app-shell :is(.ar-cards,.rw-cards) strong {font-size:var(--ov-text-kpi);line-height:1.3}
  #app .ov-app-shell :is(.primary,.secondary), .ov-dialog :is(.primary,.secondary) {display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
  #app .ov-app-shell :is(input,select,textarea), .ov-dialog :is(input,select,textarea) {box-sizing:border-box}
  #app .ov-app-shell :is(input[type=checkbox],input[type=radio]), .ov-dialog :is(input[type=checkbox],input[type=radio]) {accent-color:var(--ov-color-action)}
  #app .ov-app-shell :is(.rw-toolbar,.ar-toolbar,.bw-toolbar) {gap:var(--ov-space-3)}
  #app .ov-app-shell :is(.bw-tabs,.sales-workspace-tabs,.rw-tabs,.ar-tabs,.orders-detail-tabs,.sales-tabs) :is(a,button) {font-size:var(--ov-text-body);font-weight:500;min-height:44px;padding:12px;line-height:20px}
  #app .ov-app-shell :is(.rw-tabs,.ar-tabs) [aria-current], #app .ov-app-shell :is(.bw-tabs,.sales-workspace-tabs,.orders-detail-tabs,.sales-tabs) :is([aria-current=page],[aria-pressed=true]) {color:white;background:var(--ov-color-navy);border-bottom-color:var(--ov-color-navy)}
  #app .ov-app-shell :is(.ar-badge,.rw-status,.pill,.bw-status) {font-size:var(--ov-text-small);line-height:1.333;border-radius:var(--ov-radius-small)}
  #app .ov-app-shell :is(.ar-paid,.success) {color:var(--ov-color-success)}
  #app .ov-app-shell :is(.ar-late,.rw-out,.error) {color:var(--ov-color-danger)}
  #app .ov-app-shell :is(.ar-badge,.rw-low) {color:var(--ov-color-warning)}
  #app .ov-app-shell :is(.ar-badge.ar-paid) {color:var(--ov-color-success)}
  #app .ov-app-shell :is(.ar-badge.ar-late) {color:var(--ov-color-danger)}
  #app .ov-app-shell tbody td {height:44px}
  .ov-number {text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
  .ov-loading {display:flex;align-items:center;gap:var(--ov-space-2);color:var(--ov-color-muted)}
  .ov-skeleton {display:inline-block;width:64px;height:16px;border-radius:var(--ov-radius-small);background:var(--ov-color-line)}
  .ov-footer {font-size:var(--ov-text-small);margin-top:var(--ov-space-6)}
  .ov-dialog:not(.ov-image-dialog) {width:min(640px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:90dvh;border:1px solid var(--ov-color-line);border-radius:var(--ov-radius-dialog);padding:var(--ov-space-6);color:var(--ov-color-text);background:var(--ov-color-surface);box-sizing:border-box;overflow:auto}
  .ov-dialog[data-ov-dialog-size=large]:not(.ov-image-dialog) {width:min(960px,calc(100vw - 32px))}
  .ov-dialog::backdrop,.ov-navigation-drawer::backdrop {background:#0c2039b8}
  .ov-dialog>header {display:flex;gap:var(--ov-space-4);align-items:start;justify-content:space-between;margin-bottom:var(--ov-space-4)}
  .ov-dialog>header button {flex-shrink:0}
  .ov-dialog h2 {font-size:var(--ov-text-dialog);line-height:1.4;font-weight:600;margin-top:0}
  .ov-dialog label {font-size:var(--ov-text-body);font-weight:500}
  .ov-dialog :is(input,select,textarea) {font-family:var(--ov-font);font-size:var(--ov-text-body)}
  .ov-dialog :is(td,th) {padding:var(--ov-space-3);font-size:var(--ov-text-body)}
  .ov-dialog table {width:100%;border-collapse:collapse}
  .ov-dialog .table-wrap {overflow:auto}
  .ov-skip-link {position:fixed;left:16px;top:-100px;z-index:100;background:white;color:var(--ov-color-navy);padding:12px;border:2px solid var(--ov-color-action);border-radius:var(--ov-radius-control)}
  .ov-skip-link:focus {top:12px}
  #app .ov-app-shell .ov-mobile-menu, #app .ov-app-shell .ov-mobile-signout {display:none}
  .ov-navigation-drawer {position:fixed;inset:0 auto 0 0;margin:0;width:min(360px,100vw);height:100dvh;max-height:100dvh;max-width:100vw;border:0;border-radius:0;padding:var(--ov-space-4);color:var(--ov-color-text);background:white;overflow:auto;box-sizing:border-box}
  .ov-navigation-drawer header {display:flex;gap:12px;align-items:center;justify-content:space-between;border-bottom:1px solid var(--ov-color-line);padding-bottom:16px}
  .ov-navigation-drawer h2 {font-size:var(--ov-text-dialog);margin:0}
  .ov-navigation-drawer nav {display:flex;flex-direction:column;gap:4px;margin:16px 0}
  .ov-navigation-drawer .nav {display:flex;gap:12px;align-items:center;text-align:left;min-height:44px;color:var(--ov-color-text);background:transparent;border:0;border-radius:var(--ov-radius-control);padding:12px;text-decoration:none;font-size:var(--ov-text-body)}
  .ov-navigation-drawer .nav.active {color:white;background:var(--ov-color-navy)}
  .login :is(input,select,textarea,button) {font-family:var(--ov-font);font-size:var(--ov-text-body);min-height:var(--ov-control-height);border-radius:var(--ov-radius-control)}
  .login .login-card {border-radius:var(--ov-radius-dialog)}
  @media(min-width:851px) {
    #app .ov-app-shell:not(.sales-workspace-shell) .compact-filters {position:relative}
    #app .ov-app-shell:not(.sales-workspace-shell) .compact-heading {min-height:44px;margin-bottom:4px;padding-right:55%}
    #app .ov-app-shell:not(.sales-workspace-shell) .compact-heading small {display:none}
    #app .ov-app-shell:not(.sales-workspace-shell) .compact-filter-grid {display:flex;gap:12px;overflow:auto;padding-bottom:4px}
    #app .ov-app-shell:not(.sales-workspace-shell) .compact-search {flex:2 0 180px}
    #app .ov-app-shell:not(.sales-workspace-shell) #shop-browse-filters {display:contents}
    #app .ov-app-shell:not(.sales-workspace-shell) #shop-browse-filters>div {flex:1 0 110px;min-width:0}
    #app .ov-app-shell:not(.sales-workspace-shell) .compact-filter-grid label {white-space:nowrap}
    #app .ov-app-shell:not(.sales-workspace-shell) .compact-toolbar {position:absolute;top:16px;bottom:auto;right:16px;width:auto;max-width:55%;margin:0;flex-wrap:nowrap;gap:8px}
    #app .ov-app-shell:not(.sales-workspace-shell) .compact-toolbar .card {flex-wrap:nowrap;flex-shrink:0}
    #app .ov-app-shell:not(.sales-workspace-shell) .compact-toolbar :is(button,span) {white-space:nowrap}
  }
  @media(max-width:850px) {
    :root {--ov-page-padding:16px}
    #app .ov-app-shell .sidebar {width:100%;border-right:0;border-bottom:1px solid var(--ov-color-line);height:auto;position:static;padding:8px 12px}
    #app .ov-app-shell .sidebar nav {display:flex;flex-direction:row;overflow:auto;gap:4px}
    #app .ov-app-shell .sidebar .nav {white-space:nowrap;flex-shrink:0}
    #app .ov-app-shell .sidebar-bottom, #app .ov-app-shell .sidebar>button.nav {display:none}
    #app .ov-app-shell .sidebar :is(.logo,.tagline) {display:none}
    #app .ov-app-shell .ov-mobile-menu, #app .ov-app-shell .ov-mobile-signout {display:inline-flex;min-height:44px}
    #app .ov-app-shell .compact-dock {left:10px;right:10px}
    #app .ov-app-shell .top {min-height:var(--ov-header-height)}
    .ov-dialog:not(.ov-image-dialog) {padding:var(--ov-space-4)}
    .ov-dialog[data-ov-dialog-size=large]:not(.ov-image-dialog) {width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;border-radius:0}
    .ov-dialog :is(input,select,textarea), .login :is(input,select,textarea) {font-size:16px}
    .ov-dialog :is(button,a.primary,a.secondary), .ov-navigation-drawer :is(button,a) {min-height:44px}
  }
}


/* Retailer applications reuse the shared form and dialog tokens. */
#retailer-application-form textarea,
#retailer-onboarding-dialog textarea {
  box-sizing:border-box;width:100%;min-height:80px;resize:vertical;
  padding:var(--ov-space-3,12px);border:1px solid var(--line);
  border-radius:var(--ov-radius-control);font:inherit;color:var(--ink);background:white;
}
#retailer-application-form label:has(input[type=checkbox]) {
  display:flex;align-items:flex-start;gap:10px;line-height:1.5;margin:16px 0;
}
#retailer-application-form input[type=checkbox] {
  flex:0 0 20px;width:20px;min-height:20px;height:20px;margin:0;
}
#retailer-onboarding-dialog {width:min(960px,calc(100vw - 24px));box-sizing:border-box}
#retailer-onboarding-dialog dl {display:grid;grid-template-columns:minmax(120px,160px) minmax(0,1fr);gap:10px 16px}
#retailer-onboarding-dialog dd {margin:0;min-width:0}
#retailer-onboarding-dialog .row {flex-wrap:wrap}
#onboarding-share-link {flex:1 1 240px;min-width:0}
@media(max-width:600px) {
  #retailer-application-form .form-grid {grid-template-columns:minmax(0,1fr)}
  #retailer-onboarding-dialog dl {grid-template-columns:minmax(0,1fr);gap:4px}
  #retailer-onboarding-dialog dd {margin-bottom:10px}
}

:root{--ov-text-input-mobile:16px}

/* Visibility button overlays its own password field without adding a second row. */
.ov-password-field{display:block;position:relative;min-width:0}
.ov-password-field>input{width:100%;min-height:44px;padding-inline-end:48px}
.ov-password-field>input::-ms-reveal{display:none}
.ov-password-field>button.ov-password-toggle{
  position:absolute;inset-inline-end:1px;inset-block-start:50%;transform:translateY(-50%);
  display:grid;place-items:center;width:44px;min-width:44px;height:44px;min-height:44px;
  padding:0;margin:0;border:0;border-radius:7px;background:transparent;color:#334b68;
  box-shadow:none;cursor:pointer;
}
.ov-password-field>button.ov-password-toggle:hover{background:#e9eff6}
.ov-password-field>button.ov-password-toggle:focus-visible{outline:2px solid #285b96;outline-offset:-4px}
.ov-password-toggle:not([data-visible]) [data-ov-eye-slash]{display:none}

.ov-auth-mark{margin-bottom:14px}
