/* GruzPotok Final — UI-01 design system.
 *
 * Scoped: every rule targets a gpf-* class or html.gpf-shell, so nothing here restyles existing
 * markup unless the shell is on. Colours, type and radii use the owner's --gp-* tokens in
 * gp-design-tokens.css. Both themes follow :root[data-theme]. Layout sizes come from
 * ui-blueprints/docs/design-tokens.json (sidebar 244, topbar 74, padding 36, inputs 46, buttons 44).
 */
:root {
  --gpf-brand-navy: #172D64;
  --gpf-bg: var(--gp-bg);
  --gpf-paper: var(--gp-surface);
  --gpf-ink: var(--gp-text);
  --gpf-ink-soft: var(--gp-text-2);
  --gpf-muted: var(--gp-text-muted);
  --gpf-border: var(--gp-border);
  --gpf-hover: var(--gp-surface-2);
  --gpf-primary: var(--gp-primary);
  --gpf-on-primary: var(--gp-on-primary);
  --gpf-success: var(--gp-success);
  --gpf-success-bg: var(--gp-success-soft);
  --gpf-warning: var(--gp-warning);
  --gpf-warning-bg: var(--gp-warning-soft);
  --gpf-danger: var(--gp-danger);
  --gpf-danger-bg: var(--gp-danger-soft);
  --gpf-info-bg: var(--gp-primary-soft);
  --gpf-focus: var(--gp-info);
  --gpf-sidebar-bg: #132657;
  --gpf-sidebar-ink: #d7e3ff;
  --gpf-sidebar-active: #2555B8;
  --gpf-sidebar-w: 244px;
  --gpf-topbar-h: 74px;
  --gpf-pad: 36px;
  --gpf-radius: var(--gp-r-md);
  --gpf-input-h: 46px;
  --gpf-btn-h: 44px;
  --gpf-touch: var(--gp-tap);
  --gpf-bottom-nav-h: 67px;
  --gpf-safe-top: env(safe-area-inset-top, 0px);
  --gpf-safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
}
:root[data-theme="dark"] { --gpf-sidebar-bg: #132657; }
:root[data-app-mode="mini"] {
  --gpf-safe-top: max(54px, env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
}

/* ── GpIcon ───────────────────────────────────────────────────────────── */
.gpf-icon {
  width: 24px; height: 24px; display: inline-block; flex: none; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.gpf-icon--20 { width: 20px; height: 20px; }
.gpf-icon--32 { width: 32px; height: 32px; }
.gpf-sprite-host { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── Focus ────────────────────────────────────────────────────────────── */
.gpf-btn:focus-visible, .gpf-chip:focus-visible, .gpf-nav-item:focus-visible,
.gpf-action-card:focus-visible, .gpf-banner-link:focus-visible, .gpf-input:focus-visible {
  outline: 3px solid var(--gpf-focus); outline-offset: 2px;
}

/* ── Button / Input / Chip / Badge ────────────────────────────────────── */
.gpf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--gpf-btn-h); padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font-family: inherit; font-weight: 600; font-size: 14px; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.gpf-btn--primary { background: var(--gpf-primary); color: var(--gpf-on-primary); }
.gpf-btn--secondary { background: var(--gpf-paper); color: var(--gpf-ink); border-color: var(--gpf-border); }
.gpf-btn--ghost { background: transparent; color: var(--gpf-ink-soft); }
.gpf-btn:hover { filter: brightness(1.05); }
.gpf-btn[disabled], .gpf-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.gpf-input {
  width: 100%; min-height: var(--gpf-input-h); padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--gpf-border); background: var(--gpf-paper); color: var(--gpf-ink); font-family: inherit; font-size: 14px;
}
.gpf-input[aria-invalid="true"] { border-color: var(--gpf-danger); }
.gpf-field-error { color: var(--gpf-danger); font-size: 13px; margin-top: 4px; }
.gpf-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--gpf-border); background: var(--gpf-paper); color: var(--gpf-ink-soft); font-family: inherit; font-weight: 500; font-size: 13px;
  cursor: pointer;
}
.gpf-chip[aria-pressed="true"] { background: var(--gpf-info-bg); border-color: var(--gp-link); color: var(--gp-link); }
.gpf-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-family: inherit; font-weight: 600; font-size: 12px; line-height: 1.4; background: var(--gpf-hover); color: var(--gpf-ink-soft);
}
.gpf-badge--success { background: var(--gpf-success-bg); color: var(--gpf-success); }
.gpf-badge--warning { background: var(--gpf-warning-bg); color: var(--gpf-warning); }
.gpf-badge--danger { background: var(--gpf-danger-bg); color: var(--gpf-danger); }
.gpf-badge--info { background: var(--gpf-info-bg); color: var(--gp-link); }

/* ── Card / states ────────────────────────────────────────────────────── */
.gpf-card {
  background: var(--gpf-paper); border: 1px solid var(--gpf-border); border-radius: var(--gpf-radius);
  padding: 20px; color: var(--gpf-ink);
}
.gpf-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 16px; text-align: center; color: var(--gpf-muted); }
.gpf-state .gpf-icon { width: 32px; height: 32px; }
.gpf-state--error { color: var(--gpf-danger); }
.gpf-state__title { font-family: inherit; font-weight: 600; font-size: 15px; color: var(--gpf-ink); }
.gpf-skeleton { display: inline-block; min-width: 3ch; height: 1em; border-radius: 6px; background: var(--gpf-hover); animation: gpf-pulse 1.2s ease-in-out infinite; }
@keyframes gpf-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .gpf-skeleton { animation: none; } }

/* ── Dashboard (02) ───────────────────────────────────────────────────── */
.gpf-dash { display: flex; flex-direction: column; gap: 24px; max-width: 1240px; margin: 0 auto; padding: 8px 0 32px; color: var(--gpf-ink); }
.gpf-dash__title { font-family: inherit; font-weight: 700; font-size: 28px; line-height: 1.2; margin: 0; }
.gpf-dash__lead { margin: 4px 0 0; color: var(--gpf-muted); font-size: 14px; }
.gpf-dash__actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.gpf-action-card {
  display: flex; align-items: flex-start; gap: 14px; text-align: left; width: 100%;
  background: var(--gpf-paper); border: 1px solid var(--gpf-border); border-radius: var(--gpf-radius);
  padding: 22px; min-height: 104px; color: var(--gpf-ink); cursor: pointer; font: inherit;
}
.gpf-action-card:hover { border-color: var(--gpf-primary); }
.gpf-action-card__icon { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--gpf-info-bg); color: var(--gp-link); }
.gpf-action-card__title { font-family: inherit; font-weight: 700; font-size: 18px; line-height: 1.25; display: block; }
.gpf-action-card__hint { color: var(--gpf-muted); font-size: 13px; display: block; margin-top: 4px; }
.gpf-dash__metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.gpf-metric { display: flex; flex-direction: column; gap: 6px; }
.gpf-metric__label { color: var(--gpf-muted); font-size: 13px; }
.gpf-metric__value { font-family: inherit; font-weight: 700; font-size: 28px; line-height: 1.1; color: var(--gpf-ink); }
.gpf-metric__note { font-size: 12px; color: var(--gpf-muted); }
.gpf-metric--error .gpf-metric__note { color: var(--gpf-danger); }
.gpf-metric__note .gpf-btn { min-height: 44px; padding: 0 10px; margin-left: -10px; color: var(--gp-link); }
.gpf-dash__links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gpf-dash__links .gpf-btn { justify-content: flex-start; width: 100%; }
@media (max-width: 1100px) {
  .gpf-dash__actions, .gpf-dash__metrics { grid-template-columns: 1fr; }
  .gpf-dash__links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Banners (01 / 09 / 10) ───────────────────────────────────────────── */
.gpf-banner { margin: 0 auto 32px; max-width: 1240px; padding: 0 16px; }
.gpf-banner-link { display: block; border-radius: var(--gpf-radius); overflow: hidden; line-height: 0; }
.gpf-banner img { display: block; width: 100%; height: auto; }

/* ── Desktop shell: sidebar 244 + topbar 74 (logged in, ≥1200px, site mode) ── */
.gpf-sidebar { display: none; }
html.gpf-shell .gpf-sidebar {
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 110;
  width: var(--gpf-sidebar-w); background: var(--gpf-sidebar-bg); color: var(--gpf-sidebar-ink);
  padding: 18px 12px 16px; overflow-y: auto;
}
.gpf-sidebar__logo { display: block; padding: 2px 12px 26px; }
.gpf-sidebar__logo img { display: block; width: 176px; height: auto; }
.gpf-sidebar__logo .ltext { fill: #ffffff !important; }
.gpf-sidebar__group { display: flex; flex-direction: column; gap: 8px; }
.gpf-sidebar__group + .gpf-sidebar__group { margin-top: 16px; }
.gpf-sidebar__more { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; cursor: pointer; list-style: none; font-size: 14px; }
.gpf-sidebar__more::-webkit-details-marker { display: none; }
.gpf-sidebar__footer { margin-top: auto; padding-top: 24px; display: grid; gap: 8px; }
.gpf-sidebar__caption { font-family: inherit; font-weight: 600; font-size: 11px; line-height: 1; letter-spacing: .08em; text-transform: uppercase; color: rgba(215, 227, 255, .55); padding: 6px 12px; }
.gpf-nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 12px;
  border: 0; border-radius: 10px; background: transparent; color: inherit; font-family: inherit; font-weight: 500; font-size: 14px; text-align: left; cursor: pointer;
}
.gpf-nav-item:hover { background: rgba(255, 255, 255, .07); color: #ffffff; }
.gpf-nav-item[aria-current="page"] { background: var(--gpf-sidebar-active); color: #ffffff; font-weight: 600; }
.gpf-nav-item .gpf-icon { width: 24px; height: 24px; }
html.gpf-shell body { padding-left: var(--gpf-sidebar-w); }
html.gpf-shell .site-header { min-height: var(--gpf-topbar-h); display: flex; align-items: center; }
html.gpf-shell .site-header > .container { max-width: none; width: 100%; padding-left: var(--gpf-pad); padding-right: var(--gpf-pad); }
html.gpf-shell body > main { width: 100%; max-width: none; padding: 36px; margin: 0; min-width: 0; }
html.gpf-shell .site-header { background: var(--gpf-paper); border-bottom: 1px solid var(--gpf-border); box-shadow: none; }
/* The sidebar carries the logo and the section links; the header keeps its actions. */
html.gpf-shell .site-header .gp-logo-link,
html.gpf-shell .site-header nav { display: none !important; }
.gpf-topbar-heading, .gpf-topbar-search { display: none; }
html.gpf-shell .gpf-topbar-heading { display: grid; gap: 3px; margin-right: auto; flex-shrink: 0; }
html.gpf-shell .gpf-topbar-title { font-family: inherit; font-weight: 700; font-size: 18px; line-height: 1.2; color: var(--gpf-ink); }
.gpf-topbar-subtitle { font-size: 12px; color: var(--gpf-muted); }
html.gpf-shell .gpf-topbar-search { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 16px; background: var(--gpf-bg); border: 1px solid var(--gpf-border); border-radius: 10px; color: var(--gpf-muted); font: inherit; font-size: 13px; cursor: pointer; }
.gpf-topbar-search:focus-visible, .gpf-sidebar__more:focus-visible { outline: 3px solid var(--gpf-focus); outline-offset: 2px; }
:root[data-theme="dark"] html.gpf-shell .gpf-sidebar, html.gpf-shell[data-theme="dark"] .gpf-sidebar { border-right: 1px solid var(--gp-border-strong); }


/* Owner screen 04 occupies the workspace while preserving the shared navigation. */
@media (min-width: 1200px) {
  html.gpf-shell:has(#loadCardPanel:not(.hidden)) #page-loads { visibility: hidden; }
  html.gpf-shell #loadCardPanel:not(.hidden) {
    visibility: visible; position: fixed !important; left: calc(var(--gpf-sidebar-w) + 36px) !important; right: 36px !important;
    top: calc(var(--gpf-topbar-h) + 36px) !important; bottom: 24px !important; width: auto !important; max-width: none !important;
    flex: none !important; z-index: 110; overflow-y: auto !important; background: var(--gpf-paper); border: 1px solid var(--gpf-border); border-radius: 14px;
  }
  html.gpf-shell #loadCardPanel .loads-card-shell { position: static !important; max-height: none !important; border: 0; border-radius: 0; }
  .gpf-cargo-layout { display: grid !important; grid-template-columns: minmax(0,1.6fr) minmax(280px,1fr); gap: 24px; align-items: start; }
  .gpf-cargo-main,.gpf-cargo-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
  .gpf-cargo-aside .loads-card-sticky-bar { order: -1; position: static; }
}
html.gpf-ui #loadCardPanel .loads-card-toolbar { background: var(--gpf-paper) !important; border-bottom: 1px solid var(--gpf-border); }
html.gpf-ui #loadCardPanel :is(.loads-card-section,.loads-card-stat) { background: var(--gpf-paper); border-color: var(--gpf-border); box-shadow: none; }
html.gpf-ui #loadCardPanel :is(.loads-card-title,.loads-card-route-value,.loads-card-stat-value) { color: var(--gpf-ink); }
html.gpf-ui #loadCardPanel .loads-card-description { color: var(--gpf-ink-soft); }
html.gpf-ui #loadCardPanel :is(.loads-card-label,.loads-card-stat-label,.loads-card-stat-note,.loads-card-route-meta) { color: var(--gpf-muted); }
html.gpf-ui #mobileFiltersBtn { display: inline-flex !important; min-height: 44px; align-items: center; gap: 8px; color: var(--gpf-ink); }

/* ── ИИ-помощники (SoftZero) ──────────────────────────────────────────── */
.gpf-assistants { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.gpf-assistant { display: flex; flex-direction: column; gap: 12px; }
.gpf-assistant__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gpf-assistant__title { margin: 0; font-family: inherit; font-weight: 700; font-size: 18px; line-height: 1.25; margin-right: auto; }
.gpf-assistant__identity { flex: 1; min-width: 0; }
.gpf-assistant__role { margin: 4px 0 0; color: var(--gpf-muted); font-size: 13px; }
.gpf-assistants > .gpf-assistant .gpf-badge { width: fit-content; }
.gpf-assistants > .gpf-assistant .gpf-assistant__head { align-items: flex-start; }
.gpf-assistants > .gpf-assistant .gpf-assistant__head > .gpf-badge { flex-basis: auto; margin-left: 56px; }
.gpf-assistants__support { max-width: 720px; }
.gpf-assistant__text { margin: 0; color: var(--gpf-ink-soft); font-size: 14px; line-height: 1.5; }
.gpf-assistant__note { margin: 0; color: var(--gpf-muted); font-size: 13px; }
.gpf-assistant .gpf-btn { align-self: flex-start; }
@media (max-width: 900px) { .gpf-assistants { grid-template-columns: 1fr; } }
/* Mobile: the shell paints its own page backgrounds; give the UI-01 pages the theme one. */
body.gp-mobile #page-assistants, body.gp-mobile #page-dashboard {
  padding: 16px; background: var(--gp-bg); color: var(--gp-text); min-height: calc(100vh - 120px);
}

/* One owner palette and SVG set for the existing mobile/PWA/TWA shell. */
.gpf-logo-dark { display: none; }
:root[data-theme="dark"] .gpf-logo-dark { display: block; }
:root[data-theme="dark"] .gpf-logo-light { display: none; }
.gp-logo-link img { max-width: 100%; height: auto; }
html.gpf-ui body { background: var(--gpf-bg) !important; color: var(--gpf-ink); }
html.gpf-ui .site-header .header-btn-primary { background: var(--gpf-primary); color: var(--gpf-on-primary); }
html.gpf-ui[data-theme] body.gp-mobile #gp-mobile-topbar {
  background: var(--gpf-paper) !important;
  border-bottom-color: var(--gpf-border) !important;
  min-height: calc(64px + var(--gpf-safe-top)); padding-top: var(--gpf-safe-top);
  padding-left: 16px; padding-right: 16px; gap: 8px;
}
html.gpf-ui[data-theme] body.gp-mobile #gp-mobile-topbar-title {
  color: var(--gpf-muted) !important; font-size: 12px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.gp-mobile #gp-mobile-topbar-logo { width: 124px; flex-shrink: 0; }
body.gp-mobile #gp-mobile-topbar-logo img { width: 124px; height: auto; }
html.gpf-ui[data-theme] body.gp-mobile #gp-mobile-nav {
  min-height: calc(67px + var(--gpf-safe-bottom)); padding-bottom: var(--gpf-safe-bottom);
  background: var(--gpf-paper) !important; border-top-color: var(--gpf-border) !important;
  box-shadow: none !important; backdrop-filter: none !important;
}
html.gpf-ui body.gp-mobile .gp-mobile-nav-btn {
  min-height: 66px; min-width: 44px; padding: 8px 2px;
  color: var(--gpf-muted); gap: 6px;
}
html.gpf-ui body.gp-mobile .gp-mobile-nav-label { font-size: 11px; }
html.gpf-ui body.gp-mobile .gp-mobile-nav-btn.active { color: var(--gp-link); }
html.gpf-ui body.gp-mobile .gp-mobile-nav-btn.active .gp-mobile-nav-icon svg { stroke: currentColor; }
html.gpf-ui body.gp-mobile .gp-mobile-nav-btn::before { display: none; }
html.gpf-ui body.gp-mobile .gp-mobile-nav-icon,
html.gpf-ui body.gp-mobile .gp-mobile-nav-icon svg { width: 24px; height: 24px; }
html.gpf-ui body.gp-mobile .gpf-mobile-create .gp-mobile-nav-icon {
  width: 44px; height: 44px; border-radius: 14px; background: var(--gp-primary); color: #fff;
}
html.gpf-ui body.gp-mobile .gpf-mobile-create .gp-mobile-nav-label { display: none; }
html.gpf-ui body.gp-mobile #gp-mobile-fab { display: none !important; }
html.gpf-ui body.gp-mobile {
  padding-top: calc(64px + var(--gpf-safe-top)) !important;
  padding-bottom: calc(67px + var(--gpf-safe-bottom)) !important;
}
html.gpf-ui body.gp-mobile .gp-topbar-action { color: var(--gpf-ink-soft) !important; min-width: 44px; min-height: 44px; }
html.gpf-ui body.gp-mobile .gpf-mobile-menu { display: inline-flex; }
html.gpf-ui body.gp-mobile main.container {
  width: 100%; padding: 16px 16px 88px !important; background: var(--gpf-bg);
}
html.gpf-ui body.gp-mobile .page-content { padding: 0 !important; }
html.gpf-ui body.gp-mobile #mobileDrawer {
  display: flex !important; z-index: 9400; background: var(--gpf-paper); color: var(--gpf-ink);
}
html.gpf-ui body.gp-mobile #mobileDrawerOverlay { display: block !important; z-index: 9390; }
html.gpf-ui body.gp-mobile #mobileDrawerOverlay.hidden { display: none !important; }
html.gpf-ui body.gp-mobile .gpf-dash__title { font-size: 24px; }
html.gpf-ui body.gp-mobile .gp-mobile-nav-btn:focus-visible,
html.gpf-ui body.gp-mobile .gp-topbar-action:focus-visible {
  outline: 3px solid var(--gpf-focus); outline-offset: -3px;
}
html.gpf-ui body.gp-mobile #mobileDrawer [data-nav-action="close_mobile_menu"] {
  min-width: 44px; min-height: 44px;
}
.gpf-mobile-account { padding: 8px 16px 16px; border-top: 1px solid var(--gpf-border); }
.gpf-mobile-account.hidden { display: none; }
html.gpf-ui[data-theme] #mobileDrawer .mobile-nav-item {
  background: transparent !important; color: var(--gpf-ink) !important;
  border-color: transparent !important; box-shadow: none !important;
}
html.gpf-ui[data-theme] #mobileDrawer .mobile-nav-item[aria-current="page"] {
  background: var(--gp-primary-soft) !important; color: var(--gp-link) !important;
}
html.gpf-ui[data-theme] #mobileDrawer .gp-mn-title { color: inherit !important; }
html.gpf-ui[data-theme] #mobileDrawer .gp-mn-sub,
html.gpf-ui[data-theme] #mobileDrawer .gp-mn-section-label { color: var(--gpf-muted) !important; }
html.gpf-ui[data-theme] #mobileDrawer .gp-mn-icon { color: inherit !important; background: var(--gpf-hover) !important; }
html.gpf-ui .ob-role-btn {
  color: var(--gpf-ink); background: var(--gpf-paper); border-color: var(--gpf-border);
}
html.gpf-ui .ob-role-btn strong { color: var(--gpf-ink); }
@media (max-width: 600px) {
  html.gpf-ui body.gp-mobile #gpMobileThemeSwitcher { display: none !important; }
  body.gp-mobile #gp-mobile-topbar-actions { gap: 0; }
}

/* Owner screen 02: activity and attention panels use authenticated data. */
.gpf-dash__activity { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; }
.gpf-panel-title { font-size: 18px; font-weight: 700; margin: 0; }
.gpf-dash__recent { margin-top: 16px; color: var(--gpf-muted); font-size: 14px; }
.gpf-recent-load { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 16px 0; text-align: left; border: 0; border-top: 1px solid var(--gpf-border); background: transparent; color: var(--gpf-ink); font: inherit; cursor: pointer; }
.gpf-recent-load strong { display: block; font-weight: 600; }
.gpf-recent-load small { display: block; margin-top: 6px; color: var(--gpf-muted); }
.gpf-recent-load__price { flex-shrink: 0; color: var(--gp-link); font-weight: 600; }
.gpf-recent-load:focus-visible { outline: 3px solid var(--gpf-focus); outline-offset: 2px; }
.gpf-dash__tasks { display: grid; margin-top: 16px; }
.gpf-dash__tasks .gpf-btn { justify-content: flex-start; white-space: normal; text-align: left; }
@media (max-width: 1100px) { .gpf-dash__metrics { grid-template-columns: repeat(2,minmax(0,1fr)); } .gpf-dash__activity { grid-template-columns: 1fr; } }
@media (max-width: 380px) { .gpf-dash__metrics { grid-template-columns: 1fr; } .gpf-recent-load { align-items: flex-start; flex-direction: column; gap: 8px; } }

/* Owner screen 10: document identity, date, status and actions stay readable. */
.gpf-document-head,.gpf-document-row { display: grid; grid-template-columns: minmax(200px,1.5fr) 110px minmax(100px,.7fr) minmax(230px,1.4fr); align-items: center; gap: 16px; padding: 16px 0; }
.gpf-document-head { font-size: 12px; font-weight: 600; color: var(--gpf-muted); }
.gpf-document-row { border-top: 1px solid var(--gpf-border); font-size: 14px; }
.gpf-document-title strong,.gpf-document-title small { display: block; overflow-wrap: anywhere; }
.gpf-document-title small { color: var(--gpf-muted); margin-top: 4px; }
.gpf-document-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gpf-document-actions button { min-height: 44px; color: var(--gpf-ink); background: var(--gpf-paper); }
.gpf-document-message:empty { display: none; }
.gpf-document-message,.gpf-document-row > input { grid-column: 1 / -1; overflow-wrap: anywhere; }
.gpf-local-documents > summary { min-height: 60px; display: list-item; padding: 20px 24px; font-weight: 600; cursor: pointer; }
@media (max-width: 1100px) {
  .gpf-document-head { display: none; }
  .gpf-document-row { grid-template-columns: minmax(0,1fr) auto; gap: 12px; }
  .gpf-document-title { grid-column: 1 / -1; }
  .gpf-document-actions { grid-column: 1 / -1; }
}

html.gpf-ui .gpf-document-package { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-height: 60px; padding: 12px 20px; }
html.gpf-ui .gpf-document-package > div { margin: 0; }
.gpf-document-row > .gpf-badge { justify-self: start; }

/* Shared owner components for screens 03–10. Existing actions and fields remain intact. */
html.gpf-ui .page-content :where(h1,h2,h3,h4) { color: var(--gpf-ink); }
html.gpf-ui :is(.service-shell-card,.service-hero-card,.directory-hero-card,.premium-card,.loads-table-shell,.vehicle-market-card-shell,.minimal-empty-card) {
  background: var(--gpf-paper) !important; color: var(--gpf-ink); border-color: var(--gpf-border) !important; border-radius: var(--gpf-radius); box-shadow: none !important;
}
html.gpf-ui .minimal-empty-icon { color: var(--gp-link); background: var(--gpf-hover); border-color: var(--gpf-border); }
html.gpf-ui .minimal-empty-text { color: var(--gpf-muted); }
html.gpf-ui .vm-ai-panel { background: var(--gpf-paper); border: 1px solid var(--gpf-border); border-radius: var(--gpf-radius); box-shadow: none; padding: 24px; }
html.gpf-ui .vm-ai-panel::before { display: none; }
html.gpf-ui .vm-ai-title { color: var(--gpf-ink); font-size: 24px; }
html.gpf-ui :is(.vm-ai-sub,.gp-ai-chip-label) { color: var(--gpf-muted); }
html.gpf-ui :is(.vm-ai-badge,.gp-ai-chip) { background: var(--gpf-hover); color: var(--gp-link); border-color: var(--gpf-border); }
html.gpf-ui .gp-ai-chip { min-height: 44px; }
html.gpf-ui .vm-ai-search-wrap { background: var(--gpf-bg); border-color: var(--gpf-border); }
html.gpf-ui .page-content :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { min-height: 46px; color: var(--gpf-ink); background: var(--gpf-paper); border-color: var(--gpf-border); }
html.gpf-ui :is(.vm-ai-btn,.premium-btn-add,[data-vehicles-action=create_vehicle],[data-vehicles-action=toggle_create_form]) { min-height: 44px; background: var(--gpf-primary); color: var(--gpf-on-primary); border-radius: 10px; box-shadow: none; }
html.gpf-ui .gp-filter-header { background: var(--gpf-paper); }
html.gpf-ui .gp-filter-title { color: var(--gpf-ink); font-size: 18px; }
html.gpf-ui .gp-filter-subtitle { color: var(--gpf-muted); }
html.gpf-ui [data-field=status] { display: inline-flex; white-space: nowrap; }
html.gpf-ui #dealsTableViewport { min-height: 300px; }
html.gpf-ui #dealsTableViewport th { white-space: nowrap; }
html.gpf-ui #dealsTableViewport tr { background: var(--gpf-paper); }
html.gpf-ui #dealsTableViewport tr:hover { background: var(--gpf-hover); }
html.gpf-ui #dealsTableViewport td:nth-child(2) { min-width: 180px; }
html.gpf-ui #dealsTableViewport [data-field=route] { gap: 8px; flex-wrap: wrap; }
html.gpf-ui #dealsTableViewport [data-field=actions] button { min-height: 44px; white-space: nowrap; }
html.gpf-ui [id^=modal-] > :is(div,form),html.gpf-ui dialog { background-color: var(--gpf-paper) !important; color: var(--gpf-ink) !important; border-color: var(--gpf-border) !important; border-radius: var(--gpf-radius) !important; }
@media (min-width: 1200px) { html.gpf-shell #filtersPanel { width: 236px; } }
@media (max-width: 767px) { html.gpf-ui .vm-ai-panel { padding: 16px; } }

html.gpf-ui .premium-btn-add { background: var(--gpf-primary) !important; box-shadow: none !important; border-radius: 10px !important; }
html.gpf-ui .premium-btn-add:hover { background: var(--gp-primary-press) !important; box-shadow: none !important; transform: none !important; }
html.gpf-ui .gp-ai-chip { min-height: 44px; background: var(--gpf-hover) !important; color: var(--gp-link) !important; border-color: var(--gpf-border) !important; }
html.gpf-ui .vm-ai-input { background: transparent !important; padding-left: 0; }
html.gpf-ui .vm-ai-btn { min-height: 44px; background: var(--gpf-primary); }

html.gpf-ui :is(#createLoadForm,#vehicleCreateForm) :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { min-height: 46px; color: var(--gpf-ink); background-color: var(--gpf-paper); border-color: var(--gpf-border); }
html.gpf-ui .load-parser-block { background: var(--gpf-hover); border-color: var(--gpf-border); }
html.gpf-ui .load-parser-label { color: var(--gp-link); }
html.gpf-ui .load-parser-btn,html.gpf-ui #createLoadForm button[type=submit] { min-height: 44px; background: var(--gpf-primary); color: var(--gpf-on-primary); box-shadow: none; }
html.gpf-ui .gpf-cargo-aside .loads-card-action { min-height: 44px; height: auto; white-space: normal; overflow: visible; text-overflow: clip; }
html.gpf-ui .gpf-cargo-aside .loads-card-action span { white-space: normal; overflow: visible; text-overflow: clip; }
@media (min-width: 1200px) {
  html.gpf-shell #modal-createLoad:not(.hidden) { align-items: center !important; justify-content: center !important; padding: 36px !important; }
  html.gpf-shell #modal-createLoad > div { width: min(1060px,calc(100vw - 72px)) !important; max-width: none !important; height: auto !important; max-height: calc(100dvh - 72px) !important; border-radius: 14px !important; animation: none !important; }
  html.gpf-shell #createLoadForm { display: grid !important; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); align-items: start; gap: 24px !important; }
  html.gpf-shell #createLoadForm > * { margin-top: 0 !important; min-width: 0; }
  #createLoad-priority-banner,#createLoadForm .load-parser-block { grid-column: 1 / -1; }
  #createLoadForm .gpf-load-route { grid-column: 1; grid-row: 3; }
  #createLoadForm .gpf-load-cargo { grid-column: 1; grid-row: 4; }
  #createLoadForm .gpf-load-date { grid-column: 1; grid-row: 5; }
  #createLoadForm .gpf-load-money { grid-column: 2; grid-row: 3; }
  #createLoadForm .gpf-load-contacts { grid-column: 2; grid-row: 4; }
  #createLoadForm .gpf-load-comment { grid-column: 2; grid-row: 5; }
  #load-form-errors,.gpf-load-actions { grid-column: 1 / -1; }
}

@media (min-width: 1200px) {
  #createLoadForm .load-parser-block { grid-row: 1; }
  #createLoad-priority-banner { grid-row: 2; }
  #createLoadForm #load-form-errors { grid-row: 6; }
  #createLoadForm .gpf-load-actions { grid-row: 7; }
}

.gpf-vehicle-extra { grid-column: 1 / -1; border: 1px solid var(--gpf-border); border-radius: 10px; padding: 0 14px; color: var(--gpf-ink); background: var(--gpf-paper); }
.gpf-vehicle-extra summary { min-height: 46px; padding: 12px 0; font-size: 14px; cursor: pointer; }
.gpf-vehicle-extra > div { padding-bottom: 16px; }
.gpf-vehicle-label { display: block; margin-bottom: 8px; color: var(--gpf-muted); font-size: 13px; }

/* Owner screen 09: chat beside the deal facts and document actions. */
html.gpf-ui .gp-deal-chat-header { background: var(--gpf-paper); color: var(--gpf-ink); border-bottom: 1px solid var(--gpf-border); }
html.gpf-ui .gp-deal-chat { border-color: var(--gpf-border); background: var(--gpf-paper); }
html.gpf-ui .gp-deal-chat-messages { background: var(--gpf-bg); }
html.gpf-ui .gp-deal-chat-input { background: var(--gpf-paper); border-color: var(--gpf-border); }
html.gpf-ui .gp-deal-chat-input input { min-width: 0; min-height: 44px; color: var(--gpf-ink); background: var(--gpf-paper); border-color: var(--gpf-border); }
html.gpf-ui .gp-deal-chat-input button { min-width: 44px; min-height: 44px; background: var(--gpf-primary); }
html.gpf-ui .gp-chat-msg.theirs .gp-chat-msg-bubble { background: var(--gpf-hover); color: var(--gpf-ink); }
html.gpf-ui .gp-chat-msg.mine .gp-chat-msg-bubble { background: var(--gpf-primary); color: var(--gpf-on-primary); }
html.gpf-ui .gp-chat-msg-time { color: var(--gpf-muted); }
@media (min-width: 1200px) {
  html.gpf-shell #modal-dealDetails:not(.hidden) { left: 244px !important; top: 74px !important; width: calc(100vw - 244px) !important; height: calc(100dvh - 74px) !important; padding: 36px !important; background: var(--gpf-bg) !important; align-items: stretch !important; overflow: hidden !important; }
  html.gpf-shell #modal-dealDetails > .gpf-deal-dialog { display: grid !important; grid-template-columns: minmax(0,1.3fr) minmax(320px,1fr); grid-template-rows: auto minmax(0,1fr) auto; width: 100%; max-width: none; max-height: none; height: 100%; margin: 0; overflow: hidden; }
  .gpf-deal-dialog__head,.gpf-deal-dialog__foot { grid-column: 1 / -1; }
  .gpf-deal-dialog__head { grid-row: 1; }
  .gpf-deal-dialog__foot { grid-row: 3; }
  html.gpf-shell #dealDetailsContent { grid-column: 2; grid-row: 2; min-height: 0; border-left: 1px solid var(--gpf-border); }
  html.gpf-shell #gpDealChat { grid-column: 1; grid-row: 2; min-height: 0; width: auto; height: auto; max-height: none; margin: 0; border: 0; }
  html.gpf-shell #gpChatMessages { flex: 1; height: auto; min-height: 0; max-height: none; }
  .gpf-deal-chat-entry { grid-column: 1; grid-row: 2; display: grid; align-content: center; justify-content: center; }
  .gpf-deal-dialog:has(#gpDealChat[style*="flex"]) .gpf-deal-chat-entry { display: none; }
}

html.gpf-ui #dealDocumentsForm input { min-height: 46px; background: var(--gpf-paper) !important; color: var(--gpf-ink); border-color: var(--gpf-border); }
html.gpf-ui :is(#dealDocumentsModal,#dealDocumentPreviewModal) button { min-height: 44px; }
html.gpf-ui #dealDocumentsSubmit { background: var(--gpf-primary); color: var(--gpf-on-primary); }
@media (min-width: 1200px) {
  html.gpf-shell #modal-dealDetails { --gp-modal-backdrop: var(--gpf-bg); }
  html.gpf-shell:has(#modal-dealDetails:not(.hidden)) body.modal-open .site-header { position: fixed !important; top: 0 !important; left: 244px; right: 0; width: auto; z-index: 130 !important; }
}

/* Owner screen 08 mobile: route-first cards, with full dates in the deal detail. */
@media (max-width: 767px) {
  html.gpf-ui .gpf-deals-heading { flex-direction: column; align-items: stretch; gap: 16px; }
  html.gpf-ui .gpf-deals-heading h1 { font-size: 24px; line-height: 30px; }
  html.gpf-ui .gpf-deals-heading select { width: 100%; }
  html.gpf-ui .gpf-deals-heading > div:last-child { width: 100%; }
  html.gpf-ui #dealsTableViewport { overflow-x: hidden !important; padding: 12px; }
  html.gpf-ui #dealsTableViewport table,html.gpf-ui #dealsTableBody { display: block; min-width: 0 !important; width: 100%; }
  html.gpf-ui #dealsTableViewport thead { display: none; }
  html.gpf-ui #dealsTableBody tr[data-deals-deal-id] { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: 72px 32px 44px; gap: 8px; height: 196px; box-sizing: border-box; margin-bottom: 12px; padding: 16px; border: 1px solid var(--gpf-border); border-radius: 14px; }
  html.gpf-ui #dealsTableBody tr[data-deals-deal-id] td { display: block !important; padding: 0; min-width: 0 !important; width: auto; border: 0; }
  html.gpf-ui #dealsTableBody tr[data-deals-deal-id] td:is(:nth-child(1),:nth-child(4)) { display: none !important; }
  html.gpf-ui #dealsTableBody tr[data-deals-deal-id] td:nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
  html.gpf-ui #dealsTableBody tr[data-deals-deal-id] td:nth-child(3) { grid-column: 1; grid-row: 2; align-self: center; }
  html.gpf-ui #dealsTableBody tr[data-deals-deal-id] td:nth-child(5) { grid-column: 2; grid-row: 2; align-self: center; }
  html.gpf-ui #dealsTableBody tr[data-deals-deal-id] td:nth-child(6) { grid-column: 1 / -1; grid-row: 3; }
  html.gpf-ui #dealsTableBody [data-field=route] { font-size: 16px; line-height: 22px; }
  html.gpf-ui #dealsTableBody [data-field=priceMeta] { display: none; }
  html.gpf-ui #dealsTableBody [data-field=price] { color: var(--gp-link); font-size: 18px; }
  html.gpf-ui #dealsTableBody [data-field=actions] button { width: 100%; }
  html.gpf-ui #dealsTableBody .ui-virtual-row-spacer,html.gpf-ui #dealsTableBody .ui-virtual-row-spacer td { display: block; }
}

@media (max-width: 767px) {
  html.gpf-ui #dealsTableBody tr[data-deals-deal-id] { background: var(--gpf-paper) !important; }
  html.gpf-ui #dealsTableBody [data-field=price] { color: var(--gp-link) !important; }
  html.gpf-ui body.gp-mobile #modal-dealDetails:not(.hidden) { top: calc(64px + var(--gpf-safe-top)) !important; bottom: calc(67px + var(--gpf-safe-bottom)) !important; height: auto !important; padding: 12px 16px !important; background: var(--gpf-bg) !important; --gp-modal-backdrop: var(--gpf-bg); align-items: stretch !important; }
  html.gpf-ui body.gp-mobile #modal-dealDetails > .gpf-deal-dialog { height: 100%; max-height: none !important; min-height: 0; margin: 0 !important; }
  html.gpf-ui body.gp-mobile .gpf-deal-dialog:has(#gpDealChat[style*="flex"]) #dealDetailsContent { flex: 0 1 140px; max-height: 140px; }
}
.gpf-deal-dialog__head button { min-width: 44px; min-height: 44px; }

/* Secondary screens retain their existing actions and state owners. */
html.gpf-ui #page-map { border: 1px solid var(--gpf-border); border-radius: 14px; background: var(--gpf-paper); }
html.gpf-ui :is(.gp-map-ai-icon,.gp-map-ai-btn,.gp-map-fab) { background: var(--gpf-primary); box-shadow: none; }
html.gpf-ui #gpMapOnline { background: var(--gpf-paper); color: var(--gpf-ink); border: 1px solid var(--gpf-border); }
html.gpf-ui #gpMapOnline .gp-map-online-sub { color: var(--gpf-muted); }
html.gpf-ui #gpMapOnline .gp-map-online-text { color: var(--gpf-ink); }
html.gpf-ui .gp-map-fab { background: var(--gpf-primary) !important; }
html.gpf-ui #gpMapOnline .gp-map-online-dot { background: var(--gpf-muted); }
html.gpf-ui #gpMapOnline[data-state=hidden] .gp-map-online-dot { background: var(--gpf-success); }
html.gpf-ui #gpMapOnline[data-state=error] .gp-map-online-dot { background: var(--gpf-warning); }
html.gpf-ui :is(#page-profile,#page-company,#page-analytics,#page-notifications) button { min-height: 44px; }
html.gpf-ui #page-profile .service-hero-card { box-shadow: none; }
html.gpf-ui :is(#modal-login,#modal-register) button[type=submit] { background: var(--gpf-primary) !important; color: var(--gpf-on-primary); box-shadow: none; }
html.gpf-ui[data-gpf-page=assistants] #floatingAiBtn { display: none !important; }

/* The requisites form uses the same approved surface in both themes. */
html.gpf-ui #modal-clientForm > div,
html.gpf-ui #modal-clientForm > div > .sticky {
  background: var(--gpf-paper) !important;
  color: var(--gpf-ink) !important;
}
