/* Store owner portal — extends admin.css */

.portal-owner {
  --bg: #eef3f7;
  --card: #ffffff;
  --text: #143044;
  --muted: #5b7388;
  --accent: #0e6aa8;
  --accent-hover: #0b5588;
  --border: #d9e4ee;
  --owner-navy: #0a3048;
  --owner-radius: 12px;
  --owner-shadow: 0 1px 2px rgba(10, 48, 72, 0.05), 0 10px 24px rgba(10, 48, 72, 0.05);
}

.portal-owner .portal-sidebar-owner {
  --sidebar-w: 248px;
  --sidebar-bg: #0a3048;
  --sidebar-fg: #d5e4ef;
  --sidebar-muted: #8aa3b8;
  --sidebar-active-bg: rgba(255, 255, 255, 0.14);
  --sidebar-active-fg: #ffffff;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
}

.portal-owner a.owner-tab:hover,
.portal-owner a.nav-item:hover,
.portal-owner a.metric-card-link:hover,
.portal-owner a.metric-card-link:focus,
.portal-owner .owner-jump-tabs a:hover,
.portal-owner .owner-jump-tabs a:focus {
  text-decoration: none;
}

.portal-owner .portal-mobile-bar-owner {
  background: #f0f7fc;
}

.portal-owner .owner-banner {
  margin-top: 0;
}

.owner-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px 420px at 8% -8%, #d7eef8 0%, transparent 55%),
    radial-gradient(700px 360px at 108% 0%, #d7efe4 0%, transparent 50%),
    #eef3f7;
}

.owner-login-card {
  max-width: 420px;
  width: 100%;
  margin: 2rem auto;
  padding: 2rem 1.75rem 1.6rem;
  border-radius: 16px;
  box-shadow: var(--owner-shadow, 0 16px 40px rgba(10, 48, 72, 0.1));
}

.owner-login-card h1 {
  margin: 0.35rem 0 0.4rem;
  text-align: center;
  font-size: 1.45rem;
}

.owner-login-lead {
  text-align: center;
  margin: 0 0 1.1rem;
}

.owner-login-card .btn {
  width: 100%;
  min-height: 2.6rem;
  font-weight: 700;
}

.owner-login-page .wrap {
  width: 100%;
  max-width: 460px;
  margin: 0;
  padding: 1rem;
}

.owner-topbar {
  background: #0d3d5c;
}

.owner-sync-guide {
  border-radius: 14px;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}

.owner-sync-guide-warn {
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.owner-sync-guide-info {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
}

.owner-sync-guide-ok {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.owner-sync-guide h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.owner-sync-guide p {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
}

.owner-sync-guide-steps {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.owner-sync-guide-links {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.owner-hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.35rem;
}

.owner-hero-meta {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.95rem;
}

.owner-hero-code {
  font-weight: 600;
  font-family: ui-monospace, monospace;
}

.owner-hero-tagline {
  margin: 0 0 0.75rem;
}

.owner-sync-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 0.5rem;
}

.owner-profile-hint {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  font-size: 0.92rem;
}

.owner-profile-hint p {
  margin: 0;
}

.owner-sync-alert {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  font-size: 0.92rem;
}

.owner-sync-alert-auth {
  background: #fef2f2;
  border-color: #fecaca;
}

.owner-banner {
  font-size: 0.88rem;
  margin: 0 0 1.25rem;
  padding: 0.5rem 0.75rem;
  background: #eef6fc;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
}

.owner-nav a.active {
  font-weight: 600;
  text-decoration: underline;
}

.form-stack label {
  display: block;
  font-weight: 600;
  margin: 0.75rem 0 0.3rem;
  font-size: 0.9rem;
}

.form-stack input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}

.grid-metrics.owner-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.metric-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.metric-card label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.metric-card strong {
  font-size: 1.35rem;
}

.low-stock-list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.92rem;
}

.metric-card.highlight {
  background: #e8f5f0;
  border-color: #008060;
}

.metric-card strong.money {
  font-size: 1.5rem;
  color: #0d3d5c;
}

.metric-card strong.small {
  font-size: 0.95rem;
}

.owner-table {
  font-size: 0.9rem;
}

.owner-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.owner-app-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.owner-app-card h2,
.owner-app-card p {
  margin: 0;
}

.owner-app-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #e8f5f0;
  color: #0d3d5c;
  font-weight: 800;
  font-size: 0.82rem;
}

.owner-app-note {
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 720px) {
  .owner-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .owner-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    font-size: 0.85rem;
  }

  .owner-nav a {
    padding: 0.2rem 0;
  }

  .grid-metrics.owner-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .wrap {
    padding: 0.75rem;
  }

  .data {
    display: block;
    overflow-x: auto;
  }
}

.low-stock-list li {
  margin: 0.25rem 0;
}

.owner-export-link {
  font-weight: 600;
  white-space: nowrap;
}

.owner-nav {
  font-size: 0.88rem;
}

/* Owner BI dashboard */
.owner-dash-filters {
  margin-bottom: 1rem;
}

.owner-dash-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.owner-dash-filter-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.owner-dash-filter-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.owner-range-btn.active {
  background: var(--accent);
  color: #fff;
}

.owner-dash-custom-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.owner-dash-custom-range label {
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.owner-dash-loading {
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.owner-dash-empty {
  text-align: center;
  padding: 2rem 1.5rem;
}

.owner-dash-warn {
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.75rem;
  background: #fff8e6;
  border: 1px solid #f5d08a;
  border-radius: 8px;
  font-size: 0.88rem;
  color: #7a5c00;
}

.owner-est-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.35rem;
  margin-left: 0.25rem;
  background: #fef0c7;
  color: #93370d;
  border-radius: 4px;
  vertical-align: middle;
}

.owner-card-sub {
  display: block;
  font-size: 0.72rem;
  margin-top: 0.2rem;
}

.owner-dash-meta {
  margin-top: 0.5rem;
  font-size: 0.82rem;
}

.owner-dash-charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.owner-chart-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.owner-chart-sub {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
}

.owner-chart-wrap {
  position: relative;
  height: 280px;
}

.owner-chart-wrap--tall {
  height: 300px;
}

.owner-dash-tables-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.table-wrap {
  overflow-x: auto;
}

.owner-sync-alert {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  font-size: 0.92rem;
}

.owner-sync-alert p {
  margin: 0.35rem 0;
}

@media (max-width: 720px) {
  .owner-chart-wrap,
  .owner-chart-wrap--tall {
    height: 240px;
  }
}

/* Owner dashboard tidy layout */
.owner-dashboard-shell {
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(11, 31, 51, 0.05);
}

.owner-hero {
  padding: 1.15rem 1.25rem;
}

.owner-hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 1rem;
  align-items: start;
}

.owner-hero h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.2;
}

.owner-hero-copy {
  min-width: 0;
}

.owner-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.65rem 0 0.5rem;
}

.owner-info-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  max-width: 100%;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--text);
  font-size: 0.85rem;
  white-space: nowrap;
}

.owner-info-chip strong {
  margin-left: 0.25rem;
}

.owner-sync-panel {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem;
  border: 1px solid #cfe1f2;
  border-radius: 8px;
  background: #f6fbff;
}

.owner-sync-health-label,
.owner-dash-filter-label {
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.owner-license-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.owner-license-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfe;
}

.owner-license-item > span {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.owner-license-item strong {
  font-size: 0.94rem;
}

.owner-license-item small {
  line-height: 1.35;
}

.owner-sync-alert .btn-row {
  margin: 0.65rem 0 0;
}

.owner-dash-filters {
  display: grid;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
}

.owner-filter-head,
.owner-section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.owner-filter-head h2,
.owner-section-head h2 {
  margin: 0 0 0.15rem;
  font-size: 1.02rem;
}

.owner-filter-head p,
.owner-section-head p {
  margin: 0;
  font-size: 0.86rem;
}

.owner-dash-filter-row {
  padding: 0.6rem 0;
  border-top: 1px solid #edf1f5;
}

.owner-dash-filter-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.owner-branch-select-wrap {
  min-width: min(100%, 240px);
}

.owner-branch-select-wrap select {
  width: 100%;
  min-height: 2.25rem;
  padding: 0.45rem 2rem 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.owner-dash-filter-btns {
  gap: 0.4rem;
}

.owner-range-btn {
  min-height: 2.15rem;
  padding: 0.4rem 0.7rem;
}

.owner-range-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.owner-dash-range-hint {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  font-size: 0.84rem;
}

.owner-dash-custom-range {
  margin-top: 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.owner-summary-card {
  padding: 1rem 1.25rem 1.15rem;
}

.grid-metrics.owner-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0.85rem 0 0;
}

.metric-card {
  border-radius: 8px;
  padding: 0.78rem 0.85rem;
}

.metric-card label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.metric-card strong,
.metric-card strong.money {
  display: block;
  font-size: 1.35rem;
  line-height: 1.2;
}

.owner-chart-card,
.owner-table-card {
  border-radius: 8px;
  padding: 1rem;
}

.owner-chart-card h2,
.owner-table-card h2 {
  font-size: 1rem;
}

.owner-chart-wrap {
  height: 260px;
}

.owner-chart-wrap-tall,
.owner-chart-wrap--tall {
  height: 300px;
}

.owner-help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.owner-help-card {
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
}

.owner-help-card summary {
  cursor: pointer;
  padding: 0.9rem 1rem;
  font-weight: 700;
  list-style: none;
}

.owner-help-card summary::-webkit-details-marker {
  display: none;
}

.owner-help-card summary::after {
  content: "+";
  float: right;
  color: var(--muted);
}

.owner-help-card[open] summary {
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.owner-help-card[open] summary::after {
  content: "-";
}

.owner-help-list {
  margin: 0;
  padding: 0.85rem 1rem 1rem 1.35rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

.owner-help-list li + li {
  margin-top: 0.4rem;
}

@media (max-width: 900px) {
  .owner-hero-main {
    grid-template-columns: 1fr;
  }

  .owner-sync-panel {
    max-width: none;
  }

  .grid-metrics.owner-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .owner-hero,
  .owner-dash-filters,
  .owner-summary-card {
    padding: 0.9rem;
  }

  .owner-hero h1 {
    font-size: 1.3rem;
  }

  .owner-info-chip {
    white-space: normal;
  }

  .owner-dash-filter-row {
    align-items: stretch;
    gap: 0.45rem;
  }

  .owner-dash-filter-label,
  .owner-branch-select-wrap,
  .owner-dash-filter-btns,
  .owner-range-btn {
    width: 100%;
  }

  .owner-dash-filter-btns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-metrics.owner-metrics {
    grid-template-columns: 1fr;
  }

  .owner-chart-wrap,
  .owner-chart-wrap-tall,
  .owner-chart-wrap--tall {
    height: 230px;
  }
}

/* Product list snapshots (owner products page) */
.pls-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin: 1rem 0;
}
.pls-save-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}
.pls-save-title {
  min-width: 220px;
  padding: 0.4rem 0.5rem;
}
.pls-last-qty {
  width: 5.5rem;
  padding: 0.25rem 0.35rem;
}
.pls-status {
  margin: 0;
  font-size: 0.9rem;
  width: 100%;
}
.pls-status.ok {
  color: #047857;
}
.pls-status.error {
  color: #b91c1c;
}
.pls-actions {
  white-space: nowrap;
}
.pls-actions .btn {
  margin-right: 0.35rem;
}
.pls-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow: auto;
}
.pls-modal[hidden] {
  display: none !important;
}
.pls-modal-card {
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
}
.pls-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* —— Owner visual refresh —— */

.portal-owner .portal-main {
  background: var(--bg);
}

.portal-owner .card {
  border-radius: var(--owner-radius);
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(10, 48, 72, 0.04);
}

.portal-owner .owner-banner {
  margin: 0 0 1rem;
  padding: 0.55rem 0.85rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.portal-owner .sidebar-license-timer {
  padding: 0.55rem 1rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #c9dcea;
  font-size: 0.78rem;
}

.owner-top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  padding: 0.7rem 1.35rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.owner-top-nav-brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex-shrink: 0;
}

.owner-top-nav-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b8499;
}

.owner-top-nav-shop {
  font-size: 0.98rem;
  color: var(--owner-navy);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.owner-top-nav-scroll {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  min-width: 0;
  flex: 1;
  scrollbar-width: thin;
}

.owner-tab-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: max-content;
}

.owner-tab-group-label {
  display: none;
}

.owner-tab-pills {
  display: flex;
  gap: 0.3rem;
}

.owner-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.72rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: #3d566b;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
}

.owner-tab .nav-svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.8;
}

.owner-tab:hover,
.owner-tab:focus {
  background: #eef6fb;
  color: var(--owner-navy);
  text-decoration: none;
}

.owner-tab.active {
  background: var(--owner-navy);
  border-color: var(--owner-navy);
  color: #fff;
}

.owner-tab.active .nav-svg {
  opacity: 1;
}

.owner-branch-picker {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex-shrink: 0;
}

.owner-branch-picker-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b8499;
}

.owner-branch-picker select {
  min-width: 190px;
  max-width: 260px;
  min-height: 2.3rem;
  padding: 0.38rem 2rem 0.38rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f7fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235b7388' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 0.7rem center;
  appearance: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--owner-navy);
}

.owner-branch-picker select:focus,
.portal-owner .owner-search:focus,
.portal-owner .form-stack input:focus {
  outline: none;
  border-color: #8fb8d6;
  box-shadow: 0 0 0 3px rgba(14, 106, 168, 0.16);
  background-color: #fff;
}

.owner-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

.owner-page-head h1 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.owner-page-sub {
  margin: 0.25rem 0 0;
}

.owner-page-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.owner-count-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: #e8f4fb;
  color: var(--owner-navy);
  font-size: 0.82rem;
  font-weight: 700;
}

.owner-search-wrap {
  display: block;
  margin: 0 0 1rem;
}

.owner-search {
  width: 100%;
  max-width: 420px;
  min-height: 2.5rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  background: #f7fafc;
}

.owner-jump-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1rem;
}

.owner-jump-tabs a {
  display: inline-flex;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: #3d566b;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}

.owner-jump-tabs a:hover,
.owner-jump-tabs a:focus {
  background: #eef6fb;
  color: var(--owner-navy);
  text-decoration: none;
}

a.metric-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

a.metric-card-link:hover,
a.metric-card-link:focus {
  transform: translateY(-2px);
  box-shadow: var(--owner-shadow);
  border-color: #b7d4e8;
  text-decoration: none;
}

.portal-owner .metric-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.portal-owner .metric-card.highlight {
  background: linear-gradient(180deg, #f1faf6 0%, #fff 72%);
  border-color: #b7e4d4;
}

.portal-owner .metric-card strong.money {
  color: var(--owner-navy);
}

.portal-owner .owner-dash-filter-btns {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.2rem;
  background: #eef3f7;
  border-radius: 10px;
}

.portal-owner .owner-range-btn {
  min-height: 2.05rem;
  padding: 0.35rem 0.75rem;
  background: transparent;
  color: #3d566b;
  box-shadow: none;
}

.portal-owner .owner-range-btn:hover {
  background: #fff;
  color: var(--owner-navy);
}

.portal-owner .owner-range-btn.active {
  background: #fff;
  color: var(--owner-navy);
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(10, 48, 72, 0.12);
}

.owner-status {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #eef2f6;
  color: #334155;
}

.owner-status-paid,
.owner-status-complete {
  background: #dcfce7;
  color: #166534;
}

.owner-status-unpaid,
.owner-status-due,
.owner-status-overdue {
  background: #fee2e2;
  color: #991b1b;
}

.owner-status-partial,
.owner-status-credit {
  background: #fef3c7;
  color: #92400e;
}

.portal-owner .content-tabs-card > .owner-page-head,
.portal-owner .content-tabs-card > .owner-search-wrap {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.portal-owner .content-tabs-card > .owner-page-head {
  padding-top: 1.25rem;
}

.portal-owner .content-tabs-card > .owner-search-wrap {
  margin-bottom: 0.75rem;
}

.portal-owner .content-tab-bar {
  background: #f7fafc;
  padding: 0 1rem;
}

.portal-owner .table-scroll {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  overflow-x: auto;
}

.portal-owner table.data {
  margin: 0;
}

.portal-owner table.data th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f8fb;
}

.portal-owner table.data td,
.portal-owner table.data th {
  padding: 0.65rem 0.75rem;
}

.portal-owner .pls-last-qty {
  width: 5.5rem;
  min-height: 2.1rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f7fafc;
}

.portal-owner .owner-workspace {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 1.25rem 2.25rem;
  box-sizing: border-box;
}

.portal-owner .portal-content {
  max-width: none;
  margin: 0;
  flex: 1;
  min-width: 0;
  padding: 1.1rem 0 2rem;
}

.portal-owner .portal-mobile-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-owner .portal-mobile-bar-owner {
  background: #fff;
}

.owner-insights-toggle {
  appearance: none;
  border: 0;
  background: var(--owner-navy);
  color: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

.owner-insights-toggle-bar {
  display: none;
  margin-left: auto;
}

.owner-insights-rail {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 4.4rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 0.95rem 1.05rem;
  box-shadow: var(--owner-shadow);
  max-height: calc(100vh - 5.5rem);
  overflow: auto;
}

.owner-insights-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.owner-insights-head h2 {
  margin: 0;
  font-size: 1rem;
}

.owner-insights-head .muted {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
}

.owner-insights-close {
  display: none;
  appearance: none;
  border: 0;
  background: #eef3f7;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}

.owner-insights-headlines p {
  margin: 0 0 0.45rem;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-size: 0.82rem;
  color: #9a3412;
}

.owner-insights-block {
  margin-top: 0.9rem;
}

.owner-insights-block h3 {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b8499;
}

.owner-insights-hint {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
}

.owner-insights-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.owner-insight {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.6rem;
  margin-bottom: 0.4rem;
  border-radius: 10px;
  background: #f7fafc;
  border: 1px solid #e8eef4;
  border-left: 3px solid #94a3b8;
}

.owner-insight strong {
  font-size: 0.86rem;
  color: var(--text);
}

.owner-insight-meta {
  font-size: 0.75rem;
  color: #5b7388;
}

.owner-insight-tip {
  font-size: 0.78rem;
  color: var(--owner-navy);
}

.owner-insight-critical {
  background: #fef2f2;
  border-color: #fecaca;
  border-left-color: #dc2626;
}

.owner-insight-warn {
  background: #fffbeb;
  border-color: #fde68a;
  border-left-color: #d97706;
}

.owner-insight-ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
  border-left-color: #16a34a;
}

.owner-insights-foot {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
}

@media (min-width: 901px) {
  .portal-owner .owner-top-nav-scroll {
    display: none;
  }

  .portal-owner .owner-top-nav {
    justify-content: space-between;
  }
}

@media (max-width: 900px) {
  .owner-top-nav {
    position: static;
    flex-wrap: wrap;
    padding: 0.55rem 0.85rem 0.7rem;
    align-items: stretch;
  }

  .owner-top-nav-brand {
    display: none;
  }

  .owner-top-nav-scroll {
    order: 2;
    width: 100%;
    padding-bottom: 0.1rem;
  }

  .owner-branch-picker {
    order: 1;
    width: 100%;
    margin-left: 0;
  }

  .owner-branch-picker select {
    max-width: none;
    width: 100%;
  }

  .portal-mobile-bar-owner {
    position: sticky;
    top: 0;
    z-index: 21;
  }
}

@media (min-width: 901px) and (max-width: 1279px) {
  .owner-insights-toggle-bar {
    display: inline-flex;
  }
}

@media (max-width: 1279px) {
  .owner-insights-rail {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    width: min(360px, 92vw);
    max-height: none;
    border-radius: 0;
    transform: translateX(100%);
    transition: transform 0.2s ease;
  }

  body.insights-open .owner-insights-rail {
    transform: translateX(0);
    box-shadow: -8px 0 24px rgba(11, 31, 51, 0.2);
  }

  .owner-insights-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (min-width: 1280px) {
  .owner-insights-toggle {
    display: none;
  }
}

@media (max-width: 620px) {
  .portal-owner .owner-workspace {
    padding: 0 0.75rem 1.5rem;
  }

  .portal-owner .owner-dash-filter-btns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
}
