/**
 * HYDRA admin — enterprise content shell (Linear / Stripe tone).
 * Unlayered; load late. Visual only — no route logic.
 */

/* —— App canvas —— */
@media (min-width: 769px) {
  body.use-new-ui .topbar {
    position: sticky;
    top: 0;
    width: 100%;
    left: auto;
    right: auto;
    transform: none;
  }
}

body.use-new-ui {
  background: var(--workspace-bg);
  color: var(--text-primary, #0f172a);
}

body.use-new-ui .main-content,
body.use-new-ui #contentScroll.content-scroll {
  background: transparent;
}

body.use-new-ui #contentScroll.content-scroll {
  padding: 0 0 24px;
  min-height: 0;
  flex: 1 1 auto;
  box-sizing: border-box;
}

/* Topbar — frosted, lifts off workspace */
body.use-new-ui header.topbar,
body.use-new-ui .topbar {
  background: var(--topbar-bg, rgba(255, 255, 255, 0.72));
  border-bottom: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.14));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6), 0 4px 16px rgba(15, 23, 42, 0.04);
  backdrop-filter: var(--topbar-blur, blur(12px));
  -webkit-backdrop-filter: var(--topbar-blur, blur(12px));
}

/* —— Centered content shell —— */
body.use-new-ui #appContent.content-container {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

body.use-new-ui .page-shell.container-xl,
body.use-new-ui .page-shell.content-stage {
  max-width: none;
  margin: 0;
  width: 100%;
}

/* Workspace shell — full width after sidebar; left-aligned column inside */
body.use-new-ui .app-content-shell,
body.use-new-ui .page-shell.app-content-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px var(--admin-gutter, 28px) 32px;
  box-sizing: border-box;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  outline: none;
}

body.use-new-ui .app-content-shell .page-content {
  width: 100%;
  max-width: var(--admin-content-max, 1680px);
  margin-left: auto;
  margin-right: auto;
  min-width: 0;
}

body.use-new-ui .route-page:not([hidden]),
body.use-new-ui .route-page.dashboard-page {
  width: 100%;
  max-width: 100%;
  margin: 0;
  transform: none;
  zoom: 1;
}

body.use-new-ui .dashboard-layout,
body.use-new-ui .dashboard-premium-wrap,
body.use-new-ui .dashboard-page {
  width: 100%;
  max-width: var(--admin-content-max, 1680px);
  margin-left: auto;
  margin-right: auto;
}

/* Topbar: same left edge + max line length as page content */
body.use-new-ui header.topbar,
body.use-new-ui .topbar {
  width: 100%;
}

body.use-new-ui .topbar-inner {
  width: 100%;
  max-width: var(--admin-content-max, 1680px);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--admin-gutter, 28px);
  padding-right: var(--admin-gutter, 28px);
  box-sizing: border-box;
}

/* —— Page header rhythm —— */
body.use-new-ui .page-header,
body.use-new-ui .sf-inq-page-head,
body.use-new-ui .route-page:not([hidden]) > .orders-page > .orders-desk-top:first-child,
body.use-new-ui .route-page:not([hidden]) .customers-intelligence > .customers-toolbar:first-child {
  margin-bottom: 18px;
}

body.use-new-ui .topbar-title-group {
  min-width: 0;
}

/* —— Route grids: tighter, focused —— */
body.use-new-ui .route-page:not([hidden]) .cards {
  gap: 18px;
}

body.use-new-ui .route-page:not([hidden]) .section-block + .section-block {
  margin-top: 18px;
}

@media (min-width: 769px) {
  body.use-new-ui.route-dashboard .dashboard-layout .dashboard-premium-wrap,
  body.use-new-ui.route-dashboard .dashboard-layout .dashboard-kpi-grid,
  body.use-new-ui.route-dashboard .dashboard-layout .owner-mid-grid,
  body.use-new-ui.route-dashboard .dashboard-layout .dashboard-lower-grid {
    gap: 18px;
  }

  body.use-new-ui.route-dashboard .dashboard-layout .dashboard-lower-grid {
    align-items: stretch;
  }

  body.use-new-ui.route-dashboard .dashboard-layout .dashboard-lower-grid > .panel,
  body.use-new-ui.route-dashboard .dashboard-layout .owner-mid-grid > .panel {
    min-height: 280px;
    display: flex;
    flex-direction: column;
  }

  body.use-new-ui.route-dashboard .dashboard-layout .owner-snapshot-panel,
  body.use-new-ui.route-dashboard .dashboard-layout .owner-warning-panel {
    height: 100%;
  }
}

/* —— Premium table shells (orders / inquiries / customers) —— */
@media (min-width: 769px) {
  body.use-new-ui .orders-page .orders-table-shell,
  body.use-new-ui .storefront-inquiries-page .sf-inq-table-wrap.sf-inq-table-desktop,
  body.use-new-ui .customers-page .customer-table-wrap,
  body.use-new-ui .customers-page .customers-main-table-wrap .table-wrap {
    border-radius: 24px;
    background: var(--surface, rgba(255, 255, 255, 0.88));
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
    overflow: hidden;
  }

  body.use-new-ui .storefront-inquiries-page .sf-inq-page.panel {
    background: var(--panel-bg, rgba(255, 255, 255, 0.88));
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
  }
}

/* —— Empty states: centered card, no dead void —— */
body.use-new-ui .empty-state.compact,
body.use-new-ui .empty-state.empty-state--compact,
body.use-new-ui .hydra-inq-empty {
  max-width: 440px;
  margin: 36px auto;
  padding: 28px 24px;
  border-radius: 20px;
  background: var(--surface, rgba(255, 255, 255, 0.88));
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
  color: #5c6b80;
  text-align: center;
  line-height: 1.45;
}

body.use-new-ui .empty-state.compact::before,
body.use-new-ui .hydra-inq-empty::before {
  content: "◇";
  display: block;
  font-size: 28px;
  line-height: 1;
  margin-bottom: 10px;
  color: #94a3b8;
  font-weight: 300;
}

body.use-new-ui .empty-state-title {
  color: #334155;
  font-weight: 700;
}

/* —— Responsive —— */
@media (max-width: 768px) {
  body.use-new-ui #contentScroll.content-scroll {
    padding-top: calc(var(--mobile-topbar-h, 56px) + 8px);
    padding-bottom: var(--mobile-scroll-bottom-pad, calc(var(--mobile-bottom-nav-h, 72px) + env(safe-area-inset-bottom, 0px)));
  }

  body.use-new-ui .app-content-shell,
  body.use-new-ui .page-shell.app-content-shell {
    padding: 12px 14px 28px;
  }
}

@media (min-width: 769px) and (max-width: 1100px) {
  body.use-new-ui .app-content-shell,
  body.use-new-ui .page-shell.app-content-shell {
    padding-inline: 20px;
  }
}

/* Dashboard KPI elevation — wins over dashboard-premium-desktop (loads later) */
body.use-new-ui.route-dashboard .app-layout #hydraDashKpi .premium-kpi-card {
  background: var(--surface-elevated, rgba(255, 255, 255, 0.94));
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.use-new-ui.route-dashboard .app-layout #hydraDashKpi .premium-kpi-card--secondary {
  background: rgba(255, 255, 255, 0.82);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body.use-new-ui.route-dashboard .app-layout #hydraDashKpi .premium-kpi-head .card-title {
  font-size: var(--type-kpi-label);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary, #5f6b7c);
}

body.use-new-ui.route-dashboard .app-layout #hydraDashKpi .premium-kpi-card:not(.premium-kpi-card--secondary) .card-value {
  font-size: var(--type-kpi-value);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #0f172a;
  font-weight: 800;
}

body.use-new-ui.route-dashboard .app-layout #hydraDashKpi .premium-kpi-card--secondary .card-value {
  font-size: var(--type-kpi-value-sm);
}

body.use-new-ui.route-dashboard .app-layout #hydraDashKpi .premium-kpi-foot .kpi-trend {
  font-size: var(--type-kpi-meta);
  font-weight: 500;
  color: var(--text-secondary, #5f6b7c);
}

body.use-new-ui.route-dashboard .app-layout #hydraDashKpi .premium-kpi-card.kpi-tone-revenue .premium-kpi-icon {
  background: rgba(59, 130, 246, 0.2);
}

body.use-new-ui.route-dashboard .app-layout #hydraDashKpi .premium-kpi-card.kpi-tone-profit .premium-kpi-icon {
  background: rgba(16, 185, 129, 0.2);
}

body.use-new-ui.route-dashboard .app-layout #hydraDashKpi .premium-kpi-card.kpi-tone-cod .premium-kpi-icon {
  background: rgba(245, 158, 11, 0.22);
}

body.use-new-ui.route-dashboard .app-layout #hydraDashKpi .premium-kpi-card.kpi-tone-orders .premium-kpi-icon {
  background: rgba(99, 102, 241, 0.2);
}
