/* Ad Orbit reference design. Shared by all console pages; layout hooks stay stable. */
.payment-detail-dialog { width: min(880px,95vw); max-height: 85vh; padding: 24px; border: 1px solid #e0e6f2; border-radius: 10px; color: #132044; background: white; }
.payment-detail-dialog::backdrop { background: #13204466; }
.payment-detail-dialog form { float: right; }
.payment-detail-dialog p { margin: 14px 0; }
:root {
  color-scheme: light;
  --sidebar-width: 208px; --bi-sidebar: 208px;
  --topbar-height: 56px; --bi-header: 56px;
  --bi-bg: #f5f7fc; --bi-surface: #fff; --bi-subtle: #f8faff;
  --bi-border: #e0e6f2; --bi-border-strong: #c8d2e6;
  --bi-text: #132044; --bi-text-2: #596987; --bi-muted: #73829b;
  --bi-primary: #4b45f5; --bi-primary-hover: #3731d8; --bi-primary-soft: #eeefff;
  --bi-success: #13845c; --bi-warning: #99610d; --bi-danger: #c63745;
  --primary-500: #4b45f5; --primary-600: #3731d8;
  --glass-bg: #fff; --glass-bg-hover: #f8faff;
  --glass-border: #e0e6f2; --glass-border-strong: #c8d2e6;
  --glass-shadow: none; --glass-shadow-sm: none; --glass-shadow-lg: 0 12px 40px #1420441a;
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 10px;
  --font-sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
html, body, .admin-layout, .main-content { color: var(--bi-text); background: var(--bi-bg); }
body { font: 13px/1.5 var(--font-sans); font-variant-numeric: tabular-nums; background: var(--bi-bg) !important; }
button, input, select, textarea { font: inherit; }
a { color: var(--bi-primary); }
.text-muted { color: var(--bi-text-2) !important; }
.sidebar { width: var(--sidebar-width); background: #fff; border-right: 1px solid var(--bi-border); box-shadow: none; backdrop-filter: none; }
.sidebar-logo { min-height: 56px; padding: 10px 14px; gap: 9px; background: #fff; border-bottom: 1px solid var(--bi-border); }
.sidebar-logo strong { color: var(--bi-primary); font-size: 16px; line-height: 1.2; }
.sidebar-logo small { color: var(--bi-text-2); font-size: 10px; margin-top: 2px; }
.sidebar-logo-icon { width: 30px; height: 30px; border-radius: 7px; background: var(--bi-primary); box-shadow: none; }
.sidebar-logo-icon::before { width: 14px; height: 16px; left: 7px; top: 5px; border-radius: 3px; }
.sidebar-logo-icon::after { content: ""; width: 8px; height: 2px; top: 11px; left: 10px; background: #fff; box-shadow: 0 4px 0 #fff; }
.sidebar-nav { padding: 10px 8px 20px; }
.nav-section-label { margin: 13px 10px 5px; font-size: 10px; color: var(--bi-muted); letter-spacing: .03em; }
.nav-item { min-height: 34px; padding: 7px 10px; margin: 2px 0; gap: 9px; color: #495a79; font-size: 12px; border: 0; border-radius: 5px; }
.nav-item:hover { color: var(--bi-primary); background: var(--bi-subtle); }
.nav-item.active { color: var(--bi-primary); background: var(--bi-primary-soft); border: 0; }
.nav-item.active::after { left: 0; right: auto; width: 3px; height: 18px; border-radius: 2px; background: var(--bi-primary); box-shadow: none; }
.nav-icon { display: inline-flex; flex: 0 0 16px; width: 16px; align-items: center; justify-content: center; }
.orbit-icon { width: 16px; height: 16px; flex-shrink: 0; vertical-align: middle; pointer-events: none; }
.admin-layout.collapsed .nav-item .nav-icon { display: inline-flex; }
.admin-layout.collapsed .nav-section-label { display: none; }
.main-content { min-width: 0; margin-left: var(--sidebar-width); }
.top-header { min-height: 56px; height: 56px; padding: 0 20px; background: #fff; border-bottom: 1px solid var(--bi-border); color: var(--bi-text); box-shadow: none; backdrop-filter: none; }
.breadcrumb { color: var(--bi-text); font-size: 14px; }
.header-actions { gap: 8px; }
.header-business-meta, .header-role-badge { font-size: 11px; color: var(--bi-text-2); background: transparent; }
.status-indicator { padding: 0; color: var(--bi-text-2); background: transparent; font-size: 11px; }
.status-dot { width: 6px; height: 6px; box-shadow: none; }
.hamburger-btn { width: 32px; height: 32px; padding: 6px; border: 1px solid var(--bi-border); background: #fff; }
.hamburger-btn span { width: 18px; background: var(--bi-text-2); }
.content-wrapper { max-width: none; padding: 20px 22px 32px; }
.page.active { animation: none; }
.page-title { font-size: 24px; font-weight: 750; letter-spacing: -.5px; margin: 0 0 10px; color: var(--bi-text); }
.page-eyebrow { color: var(--bi-primary); font-size: 11px; margin-bottom: 4px; }
.page-subtitle, .page-context, .page > .text-muted { color: var(--bi-text-2); font-size: 12px; line-height: 1.6; margin-bottom: 16px; }
.page > .dash-controls, .dashboard-toolbar .dash-controls, .ap-toolbar-panel {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
  background: #fff; border: 1px solid var(--bi-border); border-radius: 8px;
  padding: 14px; margin-bottom: 14px; box-shadow: none;
}
.dash-controls .form-group, .ap-controls .form-group { margin: 0; min-width: 150px; flex: 1 1 160px; }
.dash-controls .date-range-field, .ap-controls .date-range-field { min-width: 322px; flex: 2 1 322px; }
.date-range-inputs input { width: 142px; flex: 1 1 142px; min-width: 0; }
label, .form-group label { color: #495a79; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  min-height: 36px; color: var(--bi-text) !important; background: #fff !important;
  border: 1px solid var(--bi-border-strong) !important; border-radius: 5px;
  padding: 7px 10px; font-size: 12px; box-shadow: none; color-scheme: light;
}
input::placeholder, textarea::placeholder { color: #73829b; opacity: 1; }
input[type="checkbox"], input[type="radio"] { min-height: auto; width: 16px; height: 16px; accent-color: var(--bi-primary); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--bi-primary); outline-offset: 2px; box-shadow: none;
}
input:disabled, select:disabled, button:disabled { opacity: .6; cursor: not-allowed; }
input[type="date"] { min-width: 142px; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .8; filter: none; cursor: pointer; }
.date-range-inputs { display: flex; align-items: center; gap: 6px; min-height: 36px; background: #fff !important; border: 0 !important; padding: 0; }
.date-range-inputs input[type="date"], .date-range-inputs input[type="datetime-local"] { min-height: 36px; color: var(--bi-text) !important; }
.date-range-separator, .date-range-caption { color: var(--bi-text-2); font-size: 12px; }
.quick-date-bar, .date-range-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: transparent; border: 0; padding: 0; margin-bottom: 14px; }
.quick-date-btn, .date-preset { min-height: 30px; padding: 4px 9px; border: 1px solid var(--bi-border); border-radius: 5px; background: #fff; color: #495a79; font-size: 12px; }
.quick-date-btn:hover, .quick-date-btn.active, .date-preset:hover, .date-preset.active { color: var(--bi-primary); background: var(--bi-primary-soft); border-color: #bcbaff; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 7px 13px; font-size: 12px; font-weight: 600; border-radius: 5px; box-shadow: none; white-space: nowrap; }
.btn-primary, .btn-success { color: #fff; background: var(--bi-primary); border-color: var(--bi-primary); }
.btn-primary:hover, .btn-success:hover { background: var(--bi-primary-hover); box-shadow: none; }
.btn-secondary, .btn-ghost { color: #435574; background: #fff; border: 1px solid var(--bi-border-strong); }
.btn-secondary:hover, .btn-ghost:hover { color: var(--bi-primary); background: var(--bi-primary-soft); border-color: #bcbaff; }
.btn-danger { color: #bb3040; background: #fff5f5; border: 1px solid #f2c2c8; box-shadow: none; }
.btn-sm, .top-header .btn { min-height: 30px; padding: 4px 9px; font-size: 11px; }
.panel, .kpi-card, .bi-kpi-card, .monitor-status-card, .report-card, .creative-insight-card,
.naming-result-card, .builder-result-card, .ltv-chart-card, .ltv-overview-card, .bi-value-cell, .metric-cell {
  color: var(--bi-text); background: #fff; border: 1px solid var(--bi-border); border-radius: 8px; box-shadow: none; backdrop-filter: none;
}
.panel { margin-bottom: 16px; overflow: visible; }
.panel-header { min-height: 44px; padding: 10px 14px; gap: 10px; flex-wrap: wrap; background: #fff; border-bottom: 1px solid var(--bi-border); border-radius: 8px 8px 0 0; }
.panel-title, .card-title, .bi-section-title { color: var(--bi-text); font-size: 13px; font-weight: 700; }
.panel-title-icon { color: var(--bi-primary); background: transparent; box-shadow: none; }
.panel-body { padding: 14px; }
.kpi-grid, .bi-kpi-grid, .ltv-overview-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-card, .bi-kpi-card, .ltv-overview-card { min-height: 108px; padding: 15px; }
.kpi-label, .bi-kpi-head, .ltv-overview-label { color: var(--bi-text-2); font-size: 12px; }
.kpi-value, .bi-kpi-value, .ltv-overview-value { color: var(--bi-text); font-size: 24px; font-weight: 750; line-height: 1.3; margin-top: 8px; }
.table-wrapper, .chart-container, .ap-table-wrap { background: #fff; border: 1px solid var(--bi-border); border-radius: 6px; box-shadow: none; }
.table-wrapper, .ap-table-wrap { overflow-x: auto; }
.data-table, .ap-table { font-size: 12px; }
.data-table th, .ap-table thead th, .ap-table .ap-th-name { padding: 10px 12px; background: #f3f6fc; color: #495a79; font-size: 12px; border-color: var(--bi-border); box-shadow: none; }
.data-table td, .ap-table tbody td { padding: 10px 12px; color: #283958; border-color: var(--bi-border); font-size: 12px; line-height: 1.5; }
.data-table tbody tr:hover td, .ap-table tbody tr:hover td { background: #f6f7ff; }
.ap-table .ap-td-name, .ap-summary td, .ap-summary .ap-td-name { color: var(--bi-text); background: #f8faff; }
.list-empty, .bi-empty, .empty-state, .loading-state, .bi-unavailable { padding: 24px; color: var(--bi-text-2) !important; background: var(--bi-subtle) !important; border-color: var(--bi-border) !important; }
.ap-meta, .ltv-meta { padding: 10px 12px; margin-bottom: 12px; color: #445d89; background: #eff5ff; border: 1px solid #d7e4fc; border-radius: 6px; font-size: 12px; }
.ltv-warning { color: #8a5710; background: #fff8ea; border-color: #efd8a9; }
.ltv-funnel-track, .ltv-status-track, .ltv-quality-breakdown-track { background: #e8edf7; }
.ltv-status.active { color: #13744f; background: #e8f7ef; }
.ltv-status.canceled { color: #b12f42; background: #fff0f2; }
.ltv-status.unpaid { color: #8a5710; background: #fff5df; }
.ltv-status.expired, .ltv-status.incomplete, .ltv-status.unknown { color: #596987; background: #eef2f8; }
.ltv-operations-section { margin-top: 16px; padding: 14px; background: #fff; border: 1px solid var(--bi-border); border-radius: 8px; }
.ltv-operations-heading { margin-bottom: 12px; color: var(--bi-text); }
.business-date-picker { position: relative; }
.business-date-trigger { display: flex; justify-content: space-between; gap: 10px; align-items: center; width: 100%; min-height: 36px; padding: 7px 10px; color: var(--bi-text); background: #fff; border: 1px solid var(--bi-border-strong); border-radius: 5px; }
.business-date-popover { position: absolute; top: calc(100% + 6px); left: 0; z-index: 350; width: 294px; padding: 12px; color: var(--bi-text); background: #fff; border: 1px solid var(--bi-border-strong); border-radius: 8px; box-shadow: 0 12px 32px #14204424; }
.business-date-popover[hidden] { display: none; }
.business-date-head, .business-date-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.business-date-week, .business-date-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 2px; text-align: center; }
.business-date-week { margin: 10px 0 6px; color: var(--bi-text-2); }
.business-date-day { min-height: 34px; padding: 0; color: var(--bi-text); background: #fff; border: 0; border-radius: 5px; }
.business-date-day:hover { background: var(--bi-primary-soft); }
.business-date-day.is-selected { color: #fff; background: var(--bi-primary); }
.business-date-head button, .business-date-actions button { padding: 6px 8px; color: var(--bi-primary); border: 0; border-radius: 5px; background: #fff; cursor: pointer; }
.business-date-actions { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--bi-border); }
.toast, .modal-content, .drawer-content { color: var(--bi-text); background: #fff; border-color: var(--bi-border); border-radius: 8px; box-shadow: 0 12px 32px #14204424; }
.tabs { background: #fff; border-color: var(--bi-border); }
.tab { color: var(--bi-text-2); font-size: 12px; }
.tab.active { color: var(--bi-primary); border-color: var(--bi-primary); }
.bottom-status { padding: 0 22px 20px; }
body > .card { border-color: var(--bi-border); border-radius: 10px; box-shadow: 0 8px 32px #1420440a; }
.brand h1 { color: var(--bi-primary); }
.brand-icon { background: var(--bi-primary); box-shadow: none; border-radius: 8px; }
@media (min-width: 1400px) { .bi-kpi-grid { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media (max-width: 1100px) { .header-business-meta { display: none; } .header-actions { gap: 5px; } }
@media (max-width: 900px) {
  .sidebar { width: 240px; } .main-content { margin-left: 0; }
  .content-wrapper { padding: 16px 12px 84px; } .top-header { padding: 0 12px; }
  .page-title { font-size: 22px; } .page > .dash-controls { align-items: stretch; }
  .dash-controls .form-group { flex: 1 1 180px; } .dash-controls .btn { align-self: flex-end; }
}
@media (max-width: 600px) {
  .header-role-badge, .status-indicator { display: none; }
  .header-actions .btn { font-size: 10px; padding: 4px 6px; }
  .top-header .breadcrumb { font-size: 12px; }
  .kpi-grid, .bi-kpi-grid, .ltv-overview-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .kpi-card, .bi-kpi-card, .ltv-overview-card { padding: 12px; }
  .kpi-value, .bi-kpi-value, .ltv-overview-value { font-size: 20px; }
  .dash-controls .date-range-field { min-width: 0; flex-basis: 100%; }
  .date-range-inputs { flex-wrap: wrap; } .date-range-inputs input[type="date"] { flex: 1; }
  .business-date-popover { width: min(294px,calc(100vw - 50px)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
