/* 经营驾驶舱 + 异常预警闭环 增强样式 */
.ad-cockpit,.ad-alerts-page{display:flex;flex-direction:column;gap:16px}
.ad-hero{display:flex;align-items:center;gap:24px;background:linear-gradient(100deg,#014DB2,#001645);border-radius:14px;padding:24px 28px;color:#fff;min-height:132px}
.ad-hero-left{display:flex;align-items:center;gap:18px;flex:1;min-width:0}
.ad-hero-icon{width:44px;height:44px;border-radius:12px;background:rgba(255,255,255,.16);display:grid;place-items:center;flex:none}
.ad-hero-icon svg{width:24px;height:24px}
.ad-hero-text{min-width:0}
.ad-hero-kicker{font-size:11px;color:#8FB8EC;letter-spacing:.5px}
.ad-hero-text h2{margin:4px 0;font-size:22px;color:#fff;font-weight:700}
.ad-hero-text p{margin:0;font-size:12px;color:#B9D2F2}
.ad-hero-stats{display:flex;gap:10px}
.ad-hero-stat{width:88px;height:72px;border-radius:10px;background:rgba(255,255,255,.13);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}
.ad-hero-stat strong{font-size:24px;font-weight:700;font-variant-numeric:tabular-nums}
.ad-hero-stat span{font-size:10px;color:#D7E6F8}
.ad-hero-stat .tone-critical{color:#FF9A9A}.ad-hero-stat .tone-warning{color:#FBBF24}.ad-hero-stat .tone-watch{color:#93C5FD}
.ad-hero-btn{border:0;background:#fff;color:#014DB2;border-radius:8px;padding:12px 18px;font-size:13px;font-weight:700;cursor:pointer;white-space:nowrap}
.ad-hero-btn:hover{background:#EAF1FB}
.ad-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.ad-kpi{background:#fff;border:1px solid #EAEAEA;border-radius:12px;padding:18px 20px;min-width:0}
.ad-kpi-label{font-size:12px;color:#6B7280}
.ad-kpi strong{display:block;font-size:28px;font-weight:700;color:#0A1628;margin:10px 0 6px;font-variant-numeric:tabular-nums;line-height:1.2}
.ad-kpi-sub{font-size:11px;color:#9CA3AF;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ad-kpi.danger strong{color:#DC2626}.ad-kpi.warn strong{color:#B45309}
.ad-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:16px;align-items:start}
.ad-card{background:#fff;border:1px solid #EAEAEA;border-radius:12px;padding:20px;min-width:0}
.ad-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.ad-card-head h3{margin:0;font-size:15px;font-weight:650;color:#0A1628}
.ad-card-sub{font-size:11px;color:#9CA3AF}
.ad-alert-arrow{font-size:18px;color:#9CA3AF}
.ad-badge{display:inline-block;font-size:10px;padding:2px 7px;border-radius:4px;font-weight:700;white-space:nowrap}
.ad-badge.sev-critical{background:#EF4444;color:#fff}
.ad-badge.sev-warning{background:#F59E0B;color:#fff}
.ad-badge.sev-watch{background:#3B82F6;color:#fff}
.ad-link-btn{border:0;background:none;color:#014DB2;font-size:12px;font-weight:600;cursor:pointer;padding:12px 0 0}
.ad-grid .ad-card-head { flex-wrap: wrap; gap: 3px 10px; }
.ad-grid .ad-card-sub { color: #596579; }
.ad-grid :focus-visible { outline: 2px solid #205d9b; outline-offset: -2px; }

.ad-cockpit-side { display: grid; align-content: start; gap: inherit; min-width: 0; }
.ad-ranking-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #e5e9ee;
  border-radius: 9px;
}
.ad-ranking-table { min-width: 318px; color: #172439; font-size: 12px; }
.ad-ranking-table :is(th, td) { padding: 6px 8px; }
.ad-ranking-table thead th { position: static; background: #f2f6f4; color: #475c54; font-weight: 650; }
.ad-ranking-table :is(.ad-ranking-rank, thead th:nth-child(2), .ad-ranking-store) { text-align: left; }
.ad-ranking-rank { width: 1%; }
.ad-ranking-table tbody :is(th, td) { border-bottom: 1px solid #edf0f3; }
.ad-ranking-table tbody tr:last-child > * { border-bottom: 0; }
.ad-ranking-table tbody tr:is(:hover, :focus-within) { background: #f2f7f4; }
.ad-ranking-table .ad-ranking-store { min-width: 76px; padding-block: 0; }
.ad-ranking-entry {
  display: grid;
  align-content: center;
  width: 100%;
  min-height: 39px;
  padding: 5px 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #172439;
  text-align: left;
  white-space: normal;
  line-height: 1.4;
}
.ad-ranking-entry:hover { color: #18563b; }
.ad-ranking-place {
  display: inline-block;
  min-width: 22px;
  padding: 2px 3px;
  border-radius: 5px;
  background: #edf4f0;
  color: #345e50;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ad-ranking-name { display: grid; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.ad-ranking-name strong, .ad-ranking-amount { font-size: 13px; font-weight: 650; }
.ad-ranking-name small { color: #596579; font-size: 11px; font-weight: 400; }
.ad-ranking-amount { width: 1%; text-align: right; font-variant-numeric: tabular-nums; }
.ad-ranking-amount.loss { color: #b12626; }
.ad-ranking-sort {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 28px;
  padding: 0 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
}
.ad-ranking-sort:is(.active, :hover) {
  color: #245e4a;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ad-ranking-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 9px;
}
.ad-ranking-pager button { min-height: 34px; padding-inline: 8px; }
.ad-ranking-page { color: #596579; font-size: 12px; font-variant-numeric: tabular-nums; }
.ad-ranking-card .ad-empty {
  margin: 0;
  padding: 12px;
  border: 1px solid #e5e9ee;
  border-radius: 9px;
  background: #f8faf9;
  color: #596579;
}

.ad-priority-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid #e5e9ee;
  border-radius: 9px;
  overflow: hidden;
}
.ad-priority-list li + li { border-top: 1px solid #edf0f3; }
.ad-priority-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 45px;
  padding: 6px 10px;
  border: 0;
  border-radius: 0;
  text-align: left;
  white-space: normal;
  color: #172439;
}
.ad-priority-button:hover, .ad-priority-button:focus-visible { background: #f8fafc; }
.ad-priority-button .ad-badge { padding: 3px 7px; font-size: 11px; border-radius: 5px; }
.ad-priority-button .sev-critical { background: #fef0f0; color: #a62424; }
.ad-priority-button .sev-warning { background: #fff2dc; color: #844800; }
.ad-priority-button .sev-watch { background: #edf3fd; color: #24589b; }
.ad-priority-content { display: grid; gap: 1px; min-width: 0; }
.ad-priority-content strong { color: #172439; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.ad-priority-content small { color: #596579; font-size: 11px; }
.ad-priority-button .ad-alert-arrow { line-height: 1; }
.ad-list-card .ad-link-btn { margin-top: 6px; padding: 5px 7px; }

.ad-region-axis, .ad-region-row {
  display: grid;
  grid-template-columns: minmax(74px, 1fr) minmax(60px, 2.6fr) minmax(54px, .7fr);
  align-items: center;
  gap: 10px;
}
.ad-region-scale { grid-column: 2; display: flex; justify-content: space-between; font-size: 10px; color: #596579; }
.ad-region-row { padding: 12px 0; border-bottom: 1px solid #edf0f3; }
.ad-region-name { color: #344054; font-size: 12px; overflow-wrap: anywhere; }
.ad-region-track { position: relative; height: 13px; background: #f0f3f6; border-radius: 4px; }
.ad-region-track::before {
  content: '';
  position: absolute;
  inset: -3px auto -3px 50%;
  width: 1px;
  background: #9ca9ba;
}
.ad-region-fill { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; }
.ad-region-fill.gain { left: 50%; background: #168366; }
.ad-region-fill.loss { right: 50%; background: #da4747; }
.ad-region-fill.flat { left: calc(50% - 2px); width: 5px; background: #65758b; }
.ad-region-value { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; color: #344054; }
.ad-region-value.loss { color: #b12626; }
.ad-region-value.gain { color: #087254; }
.ad-region-value.missing { color: #596579; font-weight: 400; }
.ad-region-legend { display: flex; gap: 16px; justify-content: flex-end; margin-top: 10px; font-size: 11px; color: #596579; }
.ad-region-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ad-region-legend span::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: #168366; }
.ad-region-legend .loss::before { background: #da4747; }

.ad-focus-card { grid-column: 1 / -1; }
.ad-focus-scroll { border: 1px solid #e5e9ee; border-radius: 9px; }
.ad-focus-hint { display: none; }
.ad-focus-scroll table.ad-focus-table { color: #344054; font-size: 12px; }
.ad-focus-table thead th { position: static; background: #f4f6f9; color: #475467; font-weight: 600; }
.ad-focus-table th, .ad-focus-table td { padding: 9px 12px; }
.ad-focus-table :is(th, td):nth-child(2) { text-align: left; }
.ad-focus-table tbody th { border-bottom: 1px solid #edf0f4; }
.ad-focus-table tbody tr:last-child > * { border-bottom: 0; }
.ad-focus-table tbody tr { cursor: pointer; }
.ad-focus-table tbody tr:hover, .ad-focus-table tbody tr:focus-within { background: #f0f6fc; }
.ad-store-link {
  border: 0;
  background: transparent;
  color: #1e5188;
  padding: 4px 3px;
  font-weight: 600;
}
.ad-store-link:hover { color: #194677; text-decoration: underline; }
.ad-coverage { display: inline-block; padding: 2px 7px; border-radius: 4px; background: #edf6f1; color: #215f49; font-size: 11px; }
.ad-coverage.partial { background: #fff1dc; color: #814600; }

@media (max-width: 600px) {
  .ad-grid .ad-card { padding: 13px; }
  .ad-ranking-table :is(th, td) { padding-inline: 6px; }
  .ad-ranking-entry, .ad-ranking-sort, .ad-ranking-pager button { min-height: 44px; }
  .ad-focus-hint { display: block; margin: -6px 0 8px; font-size: 11px; color: #596579; }
  .ad-focus-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: inherit;
    box-shadow: 1px 0 #e5e9ee;
  }
  .ad-focus-table thead th:first-child { background: #f4f6f9; }
  .ad-focus-table tbody tr:nth-child(odd) { background: #fff; }
  .ad-focus-table tbody tr:nth-child(odd):hover,
  .ad-focus-table tbody tr:nth-child(odd):focus-within { background: #f0f6fc; }
}

.text-danger{color:#DC2626!important}.text-warn{color:#B45309!important}
.ad-empty{padding:36px;text-align:center;color:#9CA3AF;font-size:12px}
.ad-alerts-page { gap: 12px; }
.ad-alerts-page :is(button,a):focus-visible { outline: 2px solid #285b89; outline-offset: 2px; }
.ad-alert-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; padding: 8px; border: 1px solid #dfe7e3; border-radius: 11px; background: #fff; }
.ad-stat-card { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; min-width: 0; min-height: 58px; padding: 9px 14px; border: 1px solid transparent; border-radius: 7px; background: #f4f7f5; color: #344c45; text-align: left; white-space: normal; }
.ad-stat-card span { font-size: 13px; font-weight: 650; }
.ad-stat-card strong { color: #214c3c; font-size: 26px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.ad-stat-card.critical { background: #fbefee; color: #8c3d38; }
.ad-stat-card.critical strong { color: #932d2a; }
.ad-stat-card.processing strong { color: #805014; }
.ad-stat-card:hover { border-color: #b8cbc1; }
.ad-stat-card[aria-pressed=true] { border-color: #4b7666; background: #e8f2ec; }
.ad-stat-card.critical[aria-pressed=true] { border-color: #be655b; background: #fae5e3; }
.ad-alerts-list { container: alert-list / inline-size; padding: 16px; border-color: #dfe7e3; }
.ad-alerts-list .ad-card-head { align-items: flex-start; flex-wrap: wrap; gap: 9px 14px; margin-bottom: 11px; }
.ad-alert-list-title { display: grid; gap: 3px; }
.ad-alert-list-title .ad-card-sub { margin: 0; color: #4c625b; }
.ad-alert-commands, .ad-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ad-alert-commands :is(button,a) { min-height: 36px; padding: 5px 10px; border-radius: 7px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.ad-push-open { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; border: 1px solid #215448; background: #215448; color: #fff; text-decoration: none; }
.ad-push-open:hover { background: #19473b; }
.ad-tabs { margin-bottom: 11px; }
.ad-tab { display: inline-flex; align-items: center; gap: 5px; min-height: 31px; padding: 4px 8px; border: 1px solid #dfe7e3; border-radius: 7px; background: #fff; color: #3f554f; font-size: 12px; }
.ad-tab:hover { border-color: #819e90; }
.ad-tab[aria-pressed=true] { border-color: #245347; background: #245347; color: #fff; font-weight: 650; }
.ad-tab-count { padding: 1px 4px; border-radius: 4px; background: #edf3ef; color: #35564b; font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ad-tab[aria-pressed=true] .ad-tab-count { background: #3d685b; color: #fff; }
#ad-alert-results { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 12px; }
#ad-alert-results > .ad-empty { grid-column: 1 / -1; }
.ad-alert-region-group { display: grid; grid-template-rows: auto minmax(0,1fr); min-width: 0; block-size: 459px; overflow: hidden; border: 1px solid #d9e5de; border-radius: 9px; }
.ad-alert-region-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 3px 12px; padding: 9px 13px; border-bottom: 1px solid #dce8e0; border-radius: 8px 8px 0 0; background: #edf5ef; color: #3d5c50; }
.ad-alert-region-head h4 { margin: 0; color: #234e40; font-size: 14px; }
.ad-alert-region-head span, .ad-alert-store-label span { font-size: 11px; font-variant-numeric: tabular-nums; }
.ad-alert-region-body { min-width: 0; overflow-y: auto; scrollbar-width: thin; }
.ad-alert-region-body:focus-visible { outline: 2px solid #285b89; outline-offset: -2px; }
@container alert-list (width < 760px) {
  #ad-alert-results { grid-template-columns: minmax(0,1fr); }
  .ad-alert-region-group { block-size: min(459px,72dvh); }
}
.ad-alert-store-group { display: grid; grid-template-columns: minmax(90px, 18%) minmax(0,1fr); }
.ad-alert-store-group + .ad-alert-store-group { border-top: 1px solid #e2ebe5; }
.ad-alert-store-label { display: flex; flex-wrap: wrap; align-content: flex-start; align-items: baseline; gap: 2px 8px; padding: 12px; background: #f8faf8; color: #4c625b; }
.ad-alert-store-label h5 { margin: 0; color: #253e34; font-size: 13px; overflow-wrap: anywhere; }
.ad-alert-store-group:last-child .ad-alert-store-label { border-bottom-left-radius: 8px; }
.ad-alert-items { min-width: 0; margin: 0; padding: 0; list-style: none; }
.ad-alert-items li + li { border-top: 1px solid #e9eeeb; }
.ad-alert-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto 14px; align-items: center; gap: 4px 10px; width: 100%; min-height: 44px; padding: 6px 11px; border: 0; border-left: 3px solid transparent; border-radius: 0; background: #fff; color: #20382f; text-align: left; white-space: normal; }
.ad-alert-store-group:last-child li:last-child .ad-alert-row { border-bottom-right-radius: 8px; }
.ad-alert-row.critical { border-left-color: #ca615b; }
.ad-alert-row.warning { border-left-color: #c38e45; }
.ad-alert-row.watch { border-left-color: #7093ba; }
.ad-alert-row:hover, .ad-alert-row:focus-visible { background: #f2f7f4; }
.ad-alerts-page .ad-alert-row:focus-visible { outline-offset: -2px; }
.ad-alert-main { display: grid; min-width: 0; gap: 2px; }
.ad-alert-main strong { font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.ad-alert-sub { color: #50645e; font-size: 11px; line-height: 1.4; }
.ad-alert-row .sev-critical { background: #fbeceb; color: #933534; }
.ad-alert-row .sev-warning { background: #fff2dd; color: #7c4b13; }
.ad-alert-row .sev-watch { background: #eaf0f8; color: #315880; }
.ad-row-status { padding: 2px 5px; border-radius: 4px; background: #eef2f2; color: #425751; font-size: 11px; font-weight: 600; white-space: nowrap; }
.ad-row-status.processing { background: #fff1dc; color: #754711; }
.ad-row-status.closed { background: #e6f3eb; color: #235d48; }
.ad-alert-row .ad-alert-arrow { color: #50685e; }
.ad-list-error { margin: 0 0 8px; color: #a32323; font-size: 12px; }
.ad-list-error:empty { display: none; }
.ad-alerts-list .ad-empty { margin: 0; padding: 32px 12px; color: #4c625b; background: #f5f8f6; border-radius: 8px; }
@media (max-width: 600px) {
  .ad-alert-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; padding: 6px; }
  .ad-stat-card { min-height: 49px; padding: 7px 9px; }
  .ad-stat-card span { font-size: 12px; }
  .ad-stat-card strong { font-size: 22px; }
  .ad-alerts-list { padding: 11px; }
  .ad-alert-list-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 10px; }
  .ad-alert-commands :is(button,a), .ad-tab { min-height: 44px; }
  .ad-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
  .ad-tab { justify-content: space-between; min-width: 0; gap: 3px; padding-inline: 4px; text-align: left; font-size: 11px; }
  .ad-tab > span { min-width: 0; white-space: normal; line-height: 1.25; }
  .ad-alert-region-head { padding: 7px 9px; }
  .ad-alert-store-group { grid-template-columns: minmax(0,1fr); }
  .ad-alert-store-label { padding: 5px 9px; border-bottom: 1px solid #e9eeeb; }
  .ad-alert-store-group:last-child .ad-alert-store-label { border-bottom-left-radius: 0; }
  .ad-alert-store-group:last-child li:last-child .ad-alert-row { border-bottom-left-radius: 8px; }
  .ad-alert-row { gap: 4px 7px; padding: 7px 7px 7px 6px; }
}
/* 企业微信群推送 */
.ad-wecom-dialog { width: min(690px, calc(100vw - 24px)); max-height: 90dvh; padding: 20px; overflow: auto; }
.ad-wecom-dialog [hidden] { display: none !important; }
.ad-wecom-header, .ad-wecom-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; }
.ad-wecom-header { border-bottom: 1px solid #e1eae5; padding-bottom: 12px; margin-bottom: 14px; }
.ad-wecom-header h2, .ad-wecom-preview h3 { margin: 0; color: #164a3c; font-size: 17px; }
.ad-wecom-header h2 { font-size: 20px; }
.ad-wecom-dialog :is(button,select,input:not([type=radio],[type=checkbox])) { min-height: 38px; }
.ad-wecom-header button { flex: none; }
.ad-wecom-select-group, .ad-wecom-content { min-inline-size: 0; padding: 0; border: 0; }
.ad-wecom-select-group { margin: 0; }
.ad-wecom-select-group legend, .ad-wecom-content legend { margin: 0 0 6px; padding: 0; color: #36534a; font-size: 13px; font-weight: 650; }
.ad-wecom-group-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 7px; }
.ad-wecom-group-count { margin-inline-end: auto; color: #36534a; font-size: 13px; font-weight: 650; }
.ad-wecom-group-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; max-height: 160px; overflow-y: auto; }
.ad-wecom-group-list > p { grid-column: 1 / -1; }
.ad-wecom-group-option { display: flex; align-items: center; flex-direction: row; gap: 8px; min-height: 34px; padding: 5px 8px; border: 1px solid #dce8e1; border-radius: 7px; color: #324e43; font-size: 13px; cursor: pointer; }
.ad-wecom-group-option input { flex: none; width: 15px; height: 15px; min-height: 0; margin: 0; padding: 0; accent-color: #326756; }
.ad-wecom-group-option span { min-width: 0; overflow-wrap: anywhere; }
.ad-wecom-group-option:has(input:checked) { border-color: #548579; background: #edf7f2; }
.ad-wecom-group-option:has(input:focus-visible) { outline: 2px solid #2d6655; outline-offset: -2px; }
.ad-wecom-add-group { display: grid; align-items: end; gap: 8px 12px; grid-template-columns: minmax(0,1fr) minmax(0,2fr) auto; margin-top: 10px; padding: 11px 12px; border: 1px solid #d9e8e0; border-radius: 8px; background: #f5faf7; }
.ad-wecom-add-group label, .ad-wecom-custom-form label { display: grid; min-width: 0; gap: 4px; color: #36534a; font-size: 13px; font-weight: 650; }
.ad-wecom-add-group input, .ad-wecom-custom-form :is(input,textarea) { width: 100%; min-width: 0; }
.ad-wecom-content { margin: 14px 0 8px; }
.ad-wecom-type-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.ad-wecom-type { display: flex; flex-direction: row; align-items: center; gap: 7px; min-width: 0; min-height: 58px; padding: 9px; border: 1px solid #dce8e1; border-radius: 8px; background: #fff; cursor: pointer; }
.ad-wecom-type:has(input:checked) { border-color: #548579; background: #edf7f2; }
.ad-wecom-type:has(input:focus-visible) { outline: 2px solid #2d6655; outline-offset: 2px; }
.ad-wecom-type:has(input:disabled) { opacity: .64; cursor: default; }
.ad-wecom-type input { flex: 0 0 auto; width: 15px; height: 15px; min-height: 0; margin: 0; padding: 0; accent-color: #326756; }
.ad-wecom-type strong { display: block; color: #253f36; font-size: 13px; }
.ad-wecom-type small { display: block; margin-top: 3px; color: #536e64; font-size: 11px; }
.ad-wecom-custom-form { display: grid; gap: 9px; margin: 10px 0 0; padding: 12px; border: 1px solid #dce8e1; border-radius: 8px; background: #f7faf8; }
.ad-wecom-custom-form textarea { padding: 9px 10px; border: 1px solid #dce3e8; border-radius: 7px; background: #fff; color: #253446; font: inherit; font-weight: 400; resize: vertical; }
.ad-wecom-custom-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; }
.ad-wecom-custom-limit { color: #526875; }
.ad-wecom-custom-limit.negative { color: #952d29; }
.ad-wecom-custom-preview { margin: 8px 0 0; color: #283a35; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ad-wecom-summary, .ad-wecom-date, .ad-wecom-status { margin: 5px 0 0; color: #516375; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.ad-wecom-status.negative { color: #952d29; }
.ad-wecom-login { color: #104c3c; font-weight: 650; text-decoration: underline; }
.ad-wecom-mode { display: block; margin: 10px 0 0; width: 100%; }
.ad-wecom-preview { max-height: min(42dvh,340px); overflow: auto; margin-top: 9px; padding: 12px 14px; border: 1px solid #dee9e3; border-radius: 8px; background: #f7faf8; }
.ad-wecom-edition-note { margin: 0 0 10px; color: #6d532c; font-size: 12px; line-height: 1.5; }
.ad-wecom-group { margin-top: 9px; padding: 8px; border: 1px solid #dee9e3; border-radius: 7px; background: #fff; }
.ad-wecom-group summary { color: #2c594b; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; cursor: pointer; }
.ad-wecom-group summary small { display: block; margin: 4px 0 0; color: #516375; font-weight: 400; }
.ad-wecom-group[open] > summary { margin-bottom: 8px; }
.ad-wecom-group ul { margin: 4px 0 0; padding-left: 20px; color: #344054; }
.ad-wecom-group li + li { margin-top: 3px; }
.ad-wecom-group ul + .ad-badge { margin-top: 7px; }
.ad-wecom-targets, .ad-wecom-receipts { display: grid; gap: 5px; margin: 8px 0 0; padding: 0; list-style: none; }
.ad-wecom-receipts:empty { display: none; }
.ad-wecom-targets li, .ad-wecom-receipts li { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,auto); gap: 3px 12px; padding: 6px 8px; border: 1px solid #dee9e3; border-radius: 6px; color: #516375; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.ad-wecom-targets strong, .ad-wecom-receipts strong { color: #324e43; }
.ad-wecom-targets .ad-wecom-edition-note { grid-column: 1 / -1; margin: 0; }
.ad-wecom-actions { flex-wrap: wrap; margin-top: 12px; justify-content: flex-end; }
.ad-wecom-status { flex: 1 1 200px; margin: 0; }
.ad-wecom-status:empty, .ad-wecom-summary:empty, .ad-wecom-actions:empty { display: none; }
.ad-wecom-history { margin-top: 12px; padding: 10px 12px; border: 1px solid #dce8e1; border-radius: 8px; }
.ad-wecom-history > summary { color: #28594a; font-weight: 650; cursor: pointer; }
.ad-wecom-history[open] > summary { margin-bottom: 10px; }
.ad-report-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.ad-report-form label { display: grid; gap: 4px; font-size: 13px; color: #475569; }
.ad-report-status { margin: 8px 0; color: #475569; font-size: 13px; line-height: 1.55; }
.ad-report-status.negative { color: #a32323; }
.ad-report-pages { display: grid; gap: 14px; }
.ad-report-pages figure { margin: 0; border: 1px solid #dce5e3; border-radius: 8px; overflow: hidden; }
.ad-report-pages figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #f4f8f5; }
.ad-report-pages figcaption strong { padding: 8px 12px; color: #31574a; font-size: 13px; }
.ad-report-download { padding: 9px 12px; color: #104c3c; font-size: 13px; font-weight: 650; }
.ad-report-pages img { display: block; width: 100%; height: auto; }
@media (max-width: 600px) {
  .ad-wecom-dialog { padding: 14px; }
  .ad-wecom-dialog :is(button,select,input:not([type=radio],[type=checkbox])) { min-height: 44px; }
  .ad-wecom-group-option { min-height: 44px; }
  .ad-wecom-targets li, .ad-wecom-receipts li { grid-template-columns: minmax(0,1fr); }
  .ad-wecom-type-options { grid-template-columns: minmax(0,1fr); gap: 5px; }
  .ad-wecom-type { min-height: 44px; padding: 7px 9px; }
  .ad-wecom-type span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 7px; }
  .ad-wecom-type small { margin: 0; }
  .ad-wecom-add-group { grid-template-columns: minmax(0,1fr); }
  .ad-wecom-add-group button { justify-self: end; }
  .ad-report-download { display: flex; align-items: center; min-height: 44px; }
}
.ad-overlay{position:fixed;inset:0;background:rgba(10,22,40,.4);z-index:100;display:flex;justify-content:flex-end}
.ad-drawer{width:480px;max-width:94vw;height:100%;background:#fff;overflow:auto;padding:24px;box-shadow:-8px 0 30px rgba(0,0,0,.12)}
.ad-drawer-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.ad-drawer-title small{font-size:10px;color:#9CA3AF;letter-spacing:.5px}
.ad-drawer-title h2{margin:4px 0 0;font-size:18px;color:#0A1628}
.ad-close{border:0;background:#F3F4F6;border-radius:6px;width:28px;height:28px;font-size:18px;color:#6B7280;cursor:pointer;line-height:1}
.ad-drawer-status{display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:8px;margin:16px 0;font-size:12px;color:#374151}
.ad-drawer-status.critical{background:#FEF2F2}.ad-drawer-status.warning{background:#FFFBEB}.ad-drawer-status.watch{background:#F3F6FB}
.ad-drawer-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:18px}
.ad-mini-metric{background:#F9FAFB;border-radius:8px;padding:10px;display:flex;flex-direction:column;gap:4px}
.ad-mini-metric small{font-size:10px;color:#9CA3AF}
.ad-mini-metric strong{font-size:12px;color:#0A1628}
.ad-drawer h4{font-size:13px;color:#0A1628;margin:18px 0 8px}
.ad-causes{background:#F9FAFB;border-radius:8px;padding:12px}
.ad-causes p{font-size:11px;color:#374151;margin:0 0 6px;line-height:1.6}
.ad-causes p:last-child{margin-bottom:0}
.ad-actions{display:flex;flex-direction:column;gap:6px}
.ad-action{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:8px;background:#F9FAFB}
.ad-action.done{background:#ECFDF5}.ad-action.doing{background:#FFFBEB}
.ad-checkbox{width:18px;height:18px;border:1.5px solid #D1D5DB;border-radius:5px;background:#fff;display:grid;place-items:center;font-size:12px;color:#fff;cursor:pointer;flex:none}
.ad-action.done .ad-checkbox{background:#10B981;border-color:#10B981}
.ad-action.doing .ad-checkbox{border-color:#F59E0B}
.ad-action-text{flex:1;font-size:11px;color:#374151}
.ad-action.done .ad-action-text{color:#9CA3AF;text-decoration:line-through}
.ad-action-state{font-size:10px;color:#9CA3AF}
.ad-info{display:flex;flex-direction:column;gap:8px}
.ad-info-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.ad-info-row label{font-size:11px;color:#9CA3AF;width:52px}
.ad-info-row input{flex:1;min-width:120px;border:1px solid #E5E7EB;border-radius:6px;padding:8px 10px;font-size:11px;min-height:34px}
.ad-btn-secondary{border:1px solid #D1D5DB;background:#fff;color:#374151;border-radius:7px;padding:8px 14px;font-size:11px;cursor:pointer;white-space:nowrap}
.ad-btn-secondary:hover{border-color:#014DB2;color:#014DB2}
.ad-logs{background:#F9FAFB;border-radius:8px;padding:10px 12px}
.ad-logs p{font-size:10px;color:#6B7280;margin:0 0 5px;line-height:1.5}
.ad-drawer-foot{display:flex;gap:8px;margin-top:24px;padding-top:16px;border-top:1px solid #EAEAEA;align-items:center}
.ad-drawer-foot input{flex:1;border:1px solid #E5E7EB;border-radius:6px;padding:9px 10px;font-size:11px;min-height:36px}
.ad-btn-primary{border:0;background:#10B981;color:#fff;border-radius:7px;padding:10px 16px;font-size:12px;font-weight:600;cursor:pointer;white-space:nowrap}
.ad-btn-primary:hover{background:#059669}
.ad-resolution{flex:1;font-size:11px;color:#6B7280}
@media(max-width:1100px){.ad-kpis{grid-template-columns:repeat(2,1fr)}.ad-grid{grid-template-columns:1fr}.ad-hero-stats{display:none}}

/* 快捷时间与经营范围 */
.filter-summary{display:flex;align-items:end;justify-content:space-between;column-gap:24px;row-gap:12px;flex-wrap:wrap}
.fs-quick{display:flex;align-items:center;gap:2px;background:#F1F3F6;border-radius:9px;padding:3px;max-width:100%}
.fs-quick button{border:0;background:transparent;color:#475569;font-size:12px;padding:7px 11px;min-height:34px;border-radius:6px;cursor:pointer;white-space:nowrap}
.fs-quick button:hover{color:#0A1628}
.fs-quick button.active{background:#2B3648;color:#fff;font-weight:600;box-shadow:0 1px 2px rgba(0,0,0,.12)}
.fs-controls{display:grid;grid-template-columns:repeat(2,minmax(112px,1fr)) minmax(140px,1.25fr);gap:10px;margin-left:auto;max-width:100%}
.filter-summary .fs-field{display:flex;min-width:0;flex-direction:column;align-items:stretch;gap:5px;color:#475569;font-size:11px;font-weight:600}
.filter-summary .fs-field > :is(select:not([hidden]),.fs-store-button){width:100%;height:40px;min-width:0;padding:0 9px;border:1px solid #DCE2E9;border-radius:8px;background:#fff;color:#26354A;font-size:12px;font-weight:500}
.fs-store-button{display:flex;align-items:center;justify-content:space-between;text-align:left;gap:7px}
.fs-store-button span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fs-store-button::after{content:'';width:6px;height:6px;flex:none;margin-right:3px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg)}
.fs-store-button:disabled{opacity:.55}
.filter-summary .fs-field > :is(select:not([hidden]),.fs-store-button):focus-visible,.fs-store-search input:focus-visible,.fs-store-option:focus-visible{outline:2px solid #1D6DB1;outline-offset:1px}
.fs-picked{flex:1 0 100%;min-width:0;padding-top:10px;border-top:1px solid #EDF0F3;color:#475569;font-size:12px;font-variant-numeric:tabular-nums;line-height:1.5}
.filter-panel:is([data-dine],[data-alerts]) { padding: 14px 18px 12px; }
.filter-panel:is([data-dine],[data-alerts]) .fs-quick { background: #edf2ef; }
.filter-panel:is([data-dine],[data-alerts]) .fs-quick button.active { background: #225448; }
.filter-panel:is([data-dine],[data-alerts]) .fs-picked { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.filter-panel:is([data-dine],[data-alerts]) select#fsCompare { background-color: #f1f6fa; border-color: #d5e1eb; }
.fs-period-chip { display: inline-flex; align-items: baseline; gap: 8px; padding: 5px 9px; border-radius: 6px; background: #edf5f0; color: #28584b; }
.fs-period-chip strong { color: #203f37; font-weight: 650; }
.fs-reference-chip { background: #edf2f8; color: #3f5876; }
.fs-reference-chip strong { color: #2f4560; }
.fs-custom-compare { min-height: 30px; padding: 2px 7px; border: 0; background: transparent; color: #355d83; font-size: 12px; font-weight: 600; }
.fs-custom-compare:hover { text-decoration: underline; }
.filter-panel[data-alerts] + #scopeNote { gap: 6px 12px; margin: 11px 0; color: #4d655d; }
.filter-panel[data-alerts] + #scopeNote strong { color: #2f4d43; font-weight: 650; }
.filter-panel[data-alerts] + #scopeNote .tag { color: #7b4b13; background: #fff2dc; }
.fs-store-menu{position:fixed;inset:auto;margin:0;padding:0;width:var(--store-menu-width);max-height:var(--store-menu-height);border:1px solid #DCE2E9;border-radius:11px;background:#fff;box-shadow:0 14px 34px rgba(15,23,42,.16)}
.fs-store-menu:popover-open{display:flex;flex-direction:column}
.fs-store-search{padding:9px;border-bottom:1px solid #EDF0F3}
.fs-store-search input{width:100%;height:36px;padding:0 9px;background:#F8FAFC;color:#26354A;border:1px solid #DCE2E9;border-radius:7px;font-size:13px}
.fs-store-results{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;margin:0;padding:5px;list-style:none}
.fs-store-option{display:flex;align-items:center;gap:8px;width:100%;min-height:34px;padding:6px 9px;border:0;border-radius:6px;background:transparent;color:#26354A;font-size:13px;text-align:left;overflow-wrap:anywhere}
.fs-store-option:hover{background:#F1F5F9}
.fs-store-option[aria-pressed=true]{background:#EAF3FC;color:#124977;font-weight:600}
.fs-store-option[aria-pressed=true]::after{content:'✓';margin-left:auto}
.fs-store-code{color:#64748B;font-size:11px;font-variant-numeric:tabular-nums}
.fs-store-empty{padding:14px 9px;color:#475569;font-size:13px;text-align:center}
.filter-panel:not(.expanded) .filter-grid,
.filter-panel:not(.expanded) .compare-fields,
.filter-panel:not(.expanded) .filter-actions{display:none}
.filter-panel.expanded .filter-summary{margin-bottom:16px;padding-bottom:14px;border-bottom:1px solid #F0F2F5}
@media(max-width:1100px){.fs-controls{margin-left:0}}
@media(max-width:600px){
  .filter-panel:is([data-dine],[data-alerts]) { padding: 10px 12px; }
  .fs-quick{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));flex:1 0 100%}
  .fs-quick button{padding:4px;min-height:36px}
  .fs-controls{flex:1 0 100%;grid-template-columns:repeat(2,minmax(0,1fr)) minmax(0,1.15fr);gap:8px}
  .filter-summary .fs-field > :is(select:not([hidden]),.fs-store-button){height:44px;padding:0 6px}
  .fs-store-search input{font-size:16px}
  .fs-store-option{min-height:44px}
  .filter-panel[data-alerts] .fs-quick { display: flex; gap: 1px; }
  .filter-panel[data-alerts] .fs-quick button { flex: 1 1 auto; padding-inline: 3px; font-size: 11px; }
  .filter-panel[data-alerts] .fs-picked { gap: 4px 6px; }
  .filter-panel[data-alerts] :is(.fs-period-chip,.fs-custom-compare) { padding-inline: 5px; font-size: 11px; }
}

#nav .nav-label-mobile, .mobile-overview-filter { display: none; }
@media (min-width: 601px) and (max-width: 800px) {
  .fs-controls { width: min(100%, 430px); grid-template-columns: repeat(2,minmax(0,1fr)) minmax(0,1.2fr); }
}

@media (max-width: 600px) {
  html {
    --mobile-nav-height: 62px;
    --mobile-nav-safe: env(safe-area-inset-bottom, 0px);
    scroll-padding-bottom: calc(var(--mobile-nav-height) + var(--mobile-nav-safe) + 12px);
  }
  body > aside {
    padding: calc(11px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right)) 11px max(14px, env(safe-area-inset-left));
  }
  aside .brand { padding: 0; font-size: 19px; }
  aside .brand span { margin-left: 8px; }
  #nav {
    position: fixed;
    z-index: 35;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(5,minmax(0,1fr));
    gap: 3px;
    min-height: calc(var(--mobile-nav-height) + var(--mobile-nav-safe));
    margin: 0;
    padding: 5px max(8px, env(safe-area-inset-right)) calc(5px + var(--mobile-nav-safe)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid #d9e6df;
    background: #fff;
    box-shadow: 0 -4px 18px rgba(27, 56, 43, .08);
    overflow: visible;
  }
  #nav button {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 48px;
    padding: 4px 0;
    color: #476059;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
    text-align: center;
    touch-action: manipulation;
  }
  #nav button.active { color: #14543e; background: #e8f4ed; font-weight: 750; }
  #nav button:focus-visible { outline: 2px solid #28725b; outline-offset: -2px; }
  #nav button .nav-icon { display: block; width: auto; margin: 0; color: inherit; font-size: 18px; line-height: 1; }
  #nav .nav-label-desktop { display: none; }
  #nav .nav-label-mobile { display: block; }
  body > main { padding: 16px 12px calc(var(--mobile-nav-height) + var(--mobile-nav-safe) + 18px); }
  body > main > header { margin-bottom: 12px; }
  body > main > header .breadcrumb { display: none; }
  #title { font-size: 23px; line-height: 1.25; }
  #filterPanel { padding: 10px; margin-bottom: 12px; }
  #filterPanel .filter-summary { gap: 8px; }
  #filterPanel .fs-quick { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
  #filterPanel .fs-quick button { padding: 4px 1px; font-size: 12px; }
  #filterPanel .fs-picked { padding-top: 7px; }
  #scopeNote { color: #496256; line-height: 1.5; }
  #filterPanel[data-overview] { padding: 0 11px; }
  #filterPanel[data-overview] .mobile-overview-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 60px;
    padding: 6px 0;
  }
  #mobileOverviewScope { min-width: 0; display: grid; gap: 2px; color: #4b6257; font-size: 12px; }
  #mobileOverviewDates { color: #23473a; font-size: 13px; font-variant-numeric: tabular-nums; }
  #mobileOverviewFilter { min-height: 44px; flex: none; padding: 6px 11px; border-color: #d7e8de; background: #edf5f0; color: #1e5741; font-weight: 650; }
  #mobileOverviewFilter:focus-visible { outline: 2px solid #28725b; outline-offset: 2px; }
  #filterPanel[data-overview] > .filter-summary { margin-top: 3px; padding: 8px 0; border-top: 1px solid #edf2ef; }
  #filterPanel[data-overview] #fsPicked:not(:has(.fs-nodata)) { display: none; }
  #filterPanel[data-overview]:not([data-mobile-filters-open]) > :is(.filter-summary,.filter-grid,.compare-fields,.filter-actions),
  #filterPanel[data-overview] + #scopeNote { display: none; }
  #content .panel { min-width: 0; }
  #content .kpis { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  #content :is(.kpi-label, .cell-sub) { color: #4a5f58; }
  #content .kpi strong { overflow-wrap: anywhere; }
  #content .table-scroll { max-width: 100%; }
  #content :is(.ingredient-table, .delivery-bill-table, .dine-ranking) { font-size: 13px; }
  #content .ingredient-kpis .kpi { padding: 12px; }
}

/* ===== 自定义日期 · 双月日历浮层 ===== */
.cal-overlay{position:fixed;z-index:200;top:var(--calendar-top,12px);left:var(--calendar-left,12px);font-family:-apple-system,BlinkMacSystemFont,'PingFang SC',sans-serif}
.cal-card{width:748px;max-width:calc(100vw - 24px);background:#fff;border:1px solid #E5E7EB;border-radius:12px;box-shadow:0 16px 44px rgba(15,23,42,.16);overflow:hidden}
.cal-body{display:grid;grid-template-columns:1fr 1fr;gap:0}
.cal-month{padding:16px 20px 12px}
.cal-month+.cal-month{border-left:1px solid #F0F2F5}
.cal-head{display:flex;align-items:center;justify-content:space-between;height:32px;margin-bottom:10px}
.cal-nav{display:flex;gap:2px;min-width:64px}
.cal-nav:last-child{justify-content:flex-end}
.cal-nav-btn{border:0;background:none;color:#6B7280;font-size:16px;line-height:1;width:24px;height:24px;cursor:pointer;border-radius:5px}
.cal-nav-btn:hover{background:#F3F4F6;color:#0A1628}
.cal-title{font-size:15px;font-weight:600;color:#0A1628;white-space:nowrap}
.cal-week{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:4px}
.cal-wd{text-align:center;font-size:11px;color:#9CA3AF;padding:6px 0}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);row-gap:2px}
.cal-cell{position:relative;border:0;background:transparent;color:#374151;font-size:13px;height:38px;cursor:pointer;border-radius:6px;font-variant-numeric:tabular-nums}
.cal-cell:hover:not(:disabled){background:#EAF1FB;color:#014DB2}
.cal-out{color:#D1D5DB}
.cal-disabled{color:#DDE1E6;cursor:default}
.cal-today::after{content:'';position:absolute;bottom:5px;left:50%;transform:translateX(-50%);width:4px;height:4px;border-radius:50%;background:#EF4444}
.cal-between{background:#EAF1FB;color:#014DB2;border-radius:0}
.cal-start,.cal-end,.cal-single{background:#014DB2;color:#fff;font-weight:600}
.cal-start{border-radius:6px 0 0 6px}.cal-end{border-radius:0 6px 6px 0}.cal-single{border-radius:6px}
.cal-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px;border-top:1px solid #F0F2F5;background:#FCFCFD}
.cal-picked{font-size:12px;color:#6B7280;font-variant-numeric:tabular-nums}
.cal-actions{display:flex;align-items:center;gap:8px}
.cal-link{border:0;background:none;color:#014DB2;font-size:11px;cursor:pointer;padding:6px 4px}
.cal-btn{border:1px solid #E5E7EB;background:#fff;color:#374151;border-radius:7px;padding:7px 16px;font-size:12px;cursor:pointer}
.cal-btn:hover{border-color:#014DB2;color:#014DB2}
.cal-ok{background:#F27C22;border-color:#F27C22;color:#fff;font-weight:600}
.cal-ok:hover{background:#DD6A17;color:#fff}
.cal-cell.cal-nodata{color:#D97706}
.cal-cell.cal-nodata::before{content:'';position:absolute;top:6px;right:7px;width:3px;height:3px;border-radius:50%;background:#F59E0B}
.fs-nodata{color:#AD5B09;font-weight:600}
.ad-empty-state{max-width:560px;margin:48px auto;padding:32px 36px;background:#fff;border:1px solid #E5E7EB;border-radius:14px;text-align:center;box-shadow:0 8px 28px rgba(15,23,42,.06)}
.ad-empty-title{font-size:17px;font-weight:700;color:#0A1628;margin-bottom:10px}
.ad-empty-desc{font-size:13px;color:#6B7280;line-height:1.7;margin:0 0 22px}
.ad-empty-actions{display:flex;justify-content:center;gap:12px;flex-wrap:wrap}
@media(max-width:800px){.cal-card{width:calc(100vw - 24px)}.cal-body{grid-template-columns:1fr}.cal-month+.cal-month{border-left:0;border-top:1px solid #F0F2F5}.cal-cell{height:34px}}
@media (max-width: 600px) {
  .cal-overlay { top: auto; left: 12px; right: 12px; bottom: calc(var(--mobile-nav-height) + var(--mobile-nav-safe) + 8px); }
  .cal-card { display: flex; flex-direction: column; max-height: calc(100dvh - var(--mobile-nav-height) - var(--mobile-nav-safe) - env(safe-area-inset-top,0px) - 20px); }
  .cal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .cal-foot { flex: none; flex-wrap: wrap; gap: 4px 10px; padding: 8px 12px; }
  .cal-actions { margin-left: auto; }
  .cal-actions button { min-height: 44px; }
}
/* Large totals sit above aligned breakdown cells. */
.revenue-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  color: #263141;
}
.rb-card {
  --rb-accent: #a7480e;
  --rb-tint: #fff1e4;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}
.rb-online { --rb-accent: #23568e; --rb-tint: #eaf3fc; }
.rb-costs { --rb-accent: #805a16; --rb-tint: #faf2df; }
.rb-profit { --rb-accent: #14684f; --rb-tint: #e8f6ef; }
.rb-loss { --rb-accent: #a83737; --rb-tint: #fceeee; }
.rb-headline {
  display: grid;
  align-content: start;
  grid-template-rows: auto auto minmax(17px, auto);
  gap: 4px;
  padding: 15px 16px 14px;
  min-height: 106px;
  border-top: 3px solid var(--rb-accent);
  background: var(--rb-tint);
}
.rb-headline h3 { margin: 0; font-size: 14px; color: var(--rb-accent); }
.rb-primary, .rb-detail-value { font-variant-numeric: tabular-nums; }
.rb-primary {
  font-size: clamp(23px, 2.3vw, 34px);
  font-weight: 700;
  line-height: 1.3;
  color: #202c3b;
  letter-spacing: -.55px;
  overflow-wrap: anywhere;
}
.rb-profit .rb-primary, .rb-loss .rb-primary { color: var(--rb-accent); }
.rb-context { grid-row: 3; font-size: 11px; color: #475467; }
.rb-headline .rb-comparison { grid-row: 4; }
.rb-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 1;
}
.rb-details-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rb-detail {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 11px 8px;
  text-align: center;
}
.rb-detail + .rb-detail { border-left: 1px solid #e9edf1; }
.rb-detail-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  color: #475467;
  font-size: 11px;
  line-height: 1.3;
}
.rb-detail-value {
  font-size: clamp(10px, 1vw, 14px);
  font-weight: 650;
  color: #263141;
  overflow-wrap: anywhere;
}
.rb-detail-note, .rb-footnote, .rb-comparison { font-size: 10px; color: #667085; }
.rb-footnote { margin: 0; padding: 7px 12px; border-top: 1px solid #edf0f3; }
.rb-comparison { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 5px; margin-top: 4px; font-size: 12px; }
.rb-comparison strong { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (min-width: 1550px) {
  .revenue-board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rb-details-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rb-details-four .rb-detail:nth-child(3) { border-left: 0; }
  .rb-details-four .rb-detail:nth-child(n + 3) { border-top: 1px solid #e9edf1; }
  .rb-detail { padding-inline: 5px; }
  .rb-detail-value { font-size: clamp(11px, .77vw, 14px); }
}
@media (max-width: 1150px) {
  .rb-details-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rb-details-four .rb-detail:nth-child(3) { border-left: 0; }
  .rb-details-four .rb-detail:nth-child(n + 3) { border-top: 1px solid #e9edf1; }
}
@media (max-width: 850px) {
  .revenue-board { grid-template-columns: 1fr; gap: 12px; }
  .rb-detail-value { font-size: 12px; }
}

.rb-comparison-period {
  grid-column: 1 / -1;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #dfe6ed;
  border-radius: 8px;
  background: #f8fafc;
  color: #475467;
  font-size: 12px;
}
.rb-detail .rb-comparison { justify-content: center; font-size: clamp(10px, 1.03vw, 12px); }
.rb-change-good { color: #087758; }
.rb-change-bad { color: #b83232; }

button.ingredient-link, button.rb-ingredient-link {
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: #176452;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
button.rb-ingredient-link {
  display: grid;
  gap: 3px;
  padding: 0;
  text-align: center;
  text-decoration: none;
}
.rb-ingredient-link .rb-detail-label { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
button.ingredient-link:hover, button.rb-ingredient-link:hover { color: #0d483b; }
button.ingredient-link::after { content: ' ↗'; }
.rb-ingredient-link .rb-detail-label::after { content: '↗'; margin-left: 3px; }
.ingredient-dialog { width: min(1020px, calc(100% - 24px)); max-height: 86dvh; }
.ingredient-dialog .dialog-head { gap: 12px; margin-bottom: 12px; }
.ingredient-dialog .dialog-head button { flex: none; min-height: 36px; }
.ingredient-dialog h2 { margin: 0; }
.ingredient-scope, .ingredient-status { margin: 6px 0; color: #475569; font-size: 13px; line-height: 1.55; }
.ingredient-status { margin-bottom: 12px; }
.ingredient-scroll { overflow: auto; border: 1px solid #dce5e3; border-radius: 8px; }
.ingredient-table { min-width: 720px; color: #263648; background: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
.ingredient-table thead th { background: #eef4f2; color: #374b4a; font-weight: 650; }
.ingredient-table :is(td, th) { padding: 10px 12px; }
.ingredient-table tbody tr:nth-child(even) { background: #f6f9f8; }
.ingredient-table tbody tr:hover { background: #eaf4ef; }
.ingredient-table tbody tr:last-child td { border-bottom: 0; }
.ingredient-price-panel .panel-head { flex-wrap: wrap; }
.ingredient-price-increases { border-color: #efcbbf; border-left: 4px solid #bd4f31; }
.ingredient-price-table { max-height: 330px; }
.ingredient-price-table .ingredient-table { min-width: 750px; }
.ingredient-price-table :is(th, td):nth-child(-n+5) { text-align: left; }
.ingredient-price-table :is(td:first-child, td:nth-child(2)) { min-width: 126px; white-space: normal; overflow-wrap: anywhere; }
.ingredient-price-up { color: #a63220; font-weight: 650; }
.ingredient-price-down { color: #176452; font-weight: 650; }
.ingredient-product-table { max-height: min(64vh, 570px); }
.ingredient-product-table :is(th, td):nth-child(-n + 3),
.ingredient-product-table :is(th, td):nth-child(5) { text-align: left; }
.ingredient-product-table td:first-child { min-width: 180px; white-space: normal; overflow-wrap: anywhere; font-weight: 650; }
.ingredient-product-table td:nth-child(3) { color: #526478; }
.ingredient-product-table td:last-child { font-weight: 700; color: #104c3c; }
.ingredient-supplier-table { max-height: min(62dvh, 560px); }
.ingredient-supplier-table .ingredient-table { min-width: 360px; }
.ingredient-supplier-table :is(th, td):nth-child(-n+2) { text-align: left; }
.ingredient-supplier-table td:nth-child(2) { white-space: normal; overflow-wrap: anywhere; }
.ingredient-supplier-table td:last-child { font-weight: 700; color: #104c3c; }
.ingredient-supplier-table td small { display: block; }
.ingredient-supplier-days { display: grid; gap: 6px; }
.ingredient-supplier-day { min-width: 0; border: 1px solid #dce5e3; border-radius: 8px; }
.ingredient-supplier-day > summary {
  display: grid;
  grid-template-columns: 12px max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
  color: #244b40;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.ingredient-supplier-day > summary::-webkit-details-marker { display: none; }
.ingredient-supplier-day > summary::after { content: none; }
.ingredient-supplier-day > summary::before {
  content: '';
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(-45deg);
}
.ingredient-supplier-day[open] > summary::before { transform: rotate(45deg); }
.ingredient-supplier-day > summary:hover { background: #edf5f1; border-radius: 7px; }
.ingredient-supplier-day[open] > summary { background: linear-gradient(105deg, #eaf5ed, #dceee4); border-radius: 7px 7px 0 0; }
.ingredient-supplier-day time { font-weight: 700; }
.ingredient-day-note { color: #475569; }
.ingredient-supplier-day-content { padding: 10px 12px; }
.ingredient-dialog.ingredient-dialog-supplier-days { width: min(1240px, calc(100% - 24px)); }
.ingredient-day-analysis {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}
.ingredient-day-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d7e5dd;
  border-radius: 10px;
  background: #fff;
  color: #244338;
}
.ingredient-day-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 10px;
  margin: 0;
  padding: 10px 12px;
  background: linear-gradient(105deg, #f0f8f3, #dbeee3);
  color: #183f34;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}
.ingredient-day-heading :is(h2, h3, h4, strong) { margin: 0; color: inherit; font-size: inherit; }
.ingredient-day-supplier-body, .ingredient-day-category-summary { display: grid; gap: 8px; min-width: 0; }
.ingredient-day-supplier-body { padding: 12px; }
.ingredient-day-supplier .ingredient-table { min-width: 290px; }
.ingredient-day-supplier .ingredient-table :is(th, td) { padding: 8px 10px; }
.ingredient-day-supplier .ingredient-table td:first-child { white-space: normal; overflow-wrap: anywhere; }
.ingredient-day-supplier .ingredient-pager { margin: 0; }
.ingredient-day-analysis :is(.ingredient-scroll, button):focus-visible { outline: 2px solid #28725b; outline-offset: -2px; }
.ingredient-day-distribution {
  display: grid;
  grid-template-columns: minmax(120px, .65fr) minmax(226px, 1.35fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  min-width: 0;
}
.ingredient-day-distribution:not(:has(.ingredient-day-chart)) { grid-template-columns: minmax(0, 1fr); }
.ingredient-day-chart {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  width: 100%;
  min-width: 0;
  margin: 0;
}
.ingredient-day-chart > * { grid-area: 1 / 1; }
.ingredient-day-ring {
  display: grid;
  place-items: center;
  width: min(100%, 184px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #e4eee7;
}
.ingredient-day-ring::after {
  content: '';
  width: 75%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
}
.ingredient-day-chart-label {
  position: relative;
  width: min(70%, 128px);
  color: #305c4c;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
}
.ingredient-day-chart-label strong { display: block; color: #194c39; font-size: clamp(12px, 1.25vw, 15px); }
.ingredient-day-category-table { min-width: 0; max-height: min(46dvh, 340px); overflow: auto; }
.ingredient-day-category-table .ingredient-table,
table.ingredient-day-category-table { min-width: 0; font-size: 12px; }
.ingredient-day-category-table :is(th, td) { padding: 7px 6px; }
.ingredient-day-category-table :is(th, td):first-child { white-space: normal; overflow-wrap: anywhere; }
.ingredient-day-category-label {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.ingredient-day-category-swatch {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ingredient-category-color, #3b8461);
}
.ingredient-day-share {
  display: grid;
  grid-template-columns: minmax(22px, 1fr) auto;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ingredient-day-progress {
  display: block;
  appearance: none;
  width: 100%;
  min-width: 0;
  height: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: #e8efe9;
  accent-color: var(--ingredient-category-color, #3b8461);
}
.ingredient-day-progress::-webkit-progress-bar { background: #e8efe9; }
.ingredient-day-progress::-webkit-progress-value { background: var(--ingredient-category-color, #3b8461); }
.ingredient-day-progress::-moz-progress-bar { background: var(--ingredient-category-color, #3b8461); }
.ingredient-day-analysis [data-category-color="0"] { --ingredient-category-color: #3b8461; }
.ingredient-day-analysis [data-category-color="1"] { --ingredient-category-color: #488496; }
.ingredient-day-analysis [data-category-color="2"] { --ingredient-category-color: #a87027; }
.ingredient-day-analysis [data-category-color="3"] { --ingredient-category-color: #84709b; }
.ingredient-day-analysis [data-category-color="4"] { --ingredient-category-color: #b26150; }
.ingredient-day-analysis [data-category-color="5"] { --ingredient-category-color: #6576a4; }
.ingredient-day-analysis [data-category-color="6"] { --ingredient-category-color: #758476; }
.ingredient-day-analysis [data-category-color="7"] { --ingredient-category-color: #a47a6f; }
.ingredient-day-total, .ingredient-day-total > :is(th, td) {
  border-top: 1px solid #d6e6da;
  background: #edf5ef;
  color: #154d37;
  font-weight: 700;
}
div.ingredient-day-total {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
  padding: 8px 10px;
  border-radius: 7px;
  font-variant-numeric: tabular-nums;
}
.ingredient-day-category-note {
  margin: 0;
  padding: 0 12px 10px;
  color: #516357;
  font-size: 12px;
  line-height: 1.5;
}
.ingredient-day-distribution > .ingredient-day-category-note { grid-column: 1 / -1; padding: 0; }
@media (max-width: 950px) {
  .ingredient-day-analysis { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .ingredient-supplier-day > summary { column-gap: 8px; row-gap: 2px; }
  .ingredient-day-note { grid-area: 2 / 2 / 3 / 5; }
  .ingredient-supplier-day summary strong { grid-area: 1 / 4; }
  .ingredient-supplier-day-content { padding: 8px; }
  .ingredient-day-supplier-body { padding: 10px; }
  .ingredient-day-distribution { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px; }
  .ingredient-day-ring { max-width: 144px; }
  .ingredient-day-chart-label { width: min(70%, 100px); }
}
.ingredient-missing { color: #64748b; font-weight: 400; }
.ingredient-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 12px; }
.ingredient-controls label { display: grid; gap: 4px; color: #374b4a; font-size: 12px; font-weight: 600; }
.ingredient-controls .ingredient-search-field { flex: 1 1 230px; max-width: 370px; }
.ingredient-controls :is(input, select, button) { min-height: 39px; }
.ingredient-coverage-link { color: #176452; text-decoration: underline; text-underline-offset: 3px; font-size: 12px; white-space: nowrap; }
.ingredient-result-count { font-variant-numeric: tabular-nums; }
.ingredient-pager { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 12px; }
.ingredient-pager button { min-height: 36px; }
.ingredient-page, .ingredient-results { display: grid; gap: 14px; }
.ingredient-page .panel { margin: 0; min-width: 0; }
.ingredient-page .panel-head { margin-bottom: 12px; }
.ingredient-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr)); gap: 12px; }
.ingredient-kpis .kpi { min-width: 0; padding: 16px; }
.ingredient-kpis .kpi strong { font-size: clamp(17px, 1.7vw, 25px); overflow-wrap: anywhere; }
.ingredient-kpis .sub { white-space: normal; }
.ingredient-fetch-failed { border-color: #f1c0bc; }
.ingredient-login { color: #176452; font-weight: 600; }
.ingredient-sync-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.ingredient-sync-form label { display: grid; gap: 5px; color: #475569; font-size: 13px; }
.ingredient-sync-form input { min-height: 36px; }
.ingredient-sync-form button { min-height: 36px; }
.ingredient-sync-form .ingredient-status { flex-basis: 100%; margin: 0; }
.ingredient-sync-form .ingredient-status:empty { display: none; }
.ingredient-gap-toggle { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.ingredient-gap-toggle input { min-width: auto; }
.ingredient-badge { display: inline-block; padding: 3px 7px; border-radius: 5px; background: #f1f5f9; color: #475569; }
.ingredient-badge[data-status='ready'] { background: #e8f5ec; color: #176452; }
.ingredient-badge[data-status='partial'], .ingredient-badge[data-status='empty'] { background: #fff5df; color: #854c0d; }
.ingredient-badge[data-status='failed'] { background: #feeceb; color: #a32323; }
.ingredient-coverage-table { max-height: 420px; }
.ingredient-coverage-table table { min-width: 510px; }
.ingredient-coverage-table :is(th, td):nth-child(2) { text-align: left; }
.ingredient-coverage-table :is(th, td):nth-child(4) { text-align: left; white-space: normal; }
.ingredient-filter-toggle, .filter-panel[data-ingredients] :is(.fs-controls, .compare-fields, #export),
.filter-panel[data-ingredients] .filter-grid > label:not(.period) { display: none; }
.filter-panel[data-ingredients] .ingredient-filter-toggle { display: block; }
@media (max-width: 600px) {
  .ingredient-dialog { padding: 14px; }
  .ingredient-dialog h2 { font-size: 18px; }
  .ingredient-dialog button { min-height: 44px; }
  .ingredient-page .panel-head { gap: 6px; }
  .ingredient-sync-form button { min-height: 44px; }
  .ingredient-controls .ingredient-search-field { flex-basis: 100%; max-width: none; }
  .ingredient-controls :is(input, select, button) { min-height: 44px; }
  .filter-panel[data-ingredients] #storePicker { position: relative; }
  .filter-panel[data-ingredients] #storeOptions { right: 0; }
}

/* 外卖账单 */
.delivery-platforms .panel-head { flex-wrap: wrap; gap: 6px 16px; }
.delivery-platform-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.delivery-platform { padding: 16px; min-width: 0; background: #f8fafc; border: 1px solid #e5eaf0; border-radius: 10px; }
.delivery-platform[data-platform=meituan] { background: #fff9ef; border-color: #f2dfbd; }
.delivery-platform[data-platform=eleme] { background: #f0f7ff; border-color: #d9e9fa; }
.delivery-platform[data-platform=jd] { background: #fff5f3; border-color: #f5ded9; }
.delivery-platform-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; }
.delivery-platform-head h4 { margin: 0; color: #263648; font-size: 14px; }
.delivery-badge { color: #475569; background: #e9edf3; border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.delivery-badge[data-ready] { color: #0e533e; background: #deefe7; }
.delivery-amount { display: block; margin: 12px 0 6px; color: #173148; font-size: clamp(18px, 2.1vw, 26px); line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.delivery-basis { display: block; margin-bottom: 4px; color: #3e5066; font-size: 12px; line-height: 1.45; }
.delivery-meta { margin: 0; color: #526376; font-size: 12px; line-height: 1.55; }
.delivery-period:empty, .delivery-feedback:empty { display: none; }
.delivery-period, .delivery-import { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; }
.delivery-period { color: #526376; font-size: 12px; }
.delivery-import label { display: flex; align-items: center; gap: 8px; color: #34465b; font-size: 12px; }
.delivery-import :is(select,input) { max-width: 100%; min-height: 38px; color: #334155; font-size: 12px; }
.delivery-import-hint { flex-basis: 100%; }
.delivery-import input::file-selector-button { padding: 6px 10px; margin-right: 8px; border: 1px solid #dce5e3; border-radius: 5px; background: #fff; color: #24394b; cursor: pointer; }
.delivery-import button { min-height: 38px; }
.delivery-platforms > a { display: inline-block; margin-top: 14px; }
.delivery-feedback { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #eef5f3; color: #183e35; font-size: 13px; line-height: 1.55; }
.delivery-feedback p { margin: 0; }
.delivery-feedback small { display: block; color: #445953; margin-top: 4px; }
.delivery-issues { margin-top: 6px; }
.delivery-issues summary, .delivery-unmapped summary, .delivery-erp summary { cursor: pointer; }
.delivery-issues ul { margin: 6px 0; }
:is(.delivery-unmapped,.delivery-undated) { margin-top: 12px; padding: 10px 12px; border: 1px solid #f2dfbd; border-radius: 8px; color: #694711; background: #fff9ef; font-size: 13px; }
:is(.delivery-unmapped,.delivery-undated) > p, .delivery-undated ul { margin: 6px 0; }
.delivery-unmapped-table .ingredient-table { min-width: 340px; }
.delivery-bill-table { margin-top: 10px; }
.delivery-bill-table :is(td, th):nth-child(-n+3) { text-align: left; }
.delivery-erp > summary { font-weight: 650; color: #253446; }
.delivery-erp[open] > summary { margin-bottom: 8px; }
.delivery-erp .kpis { margin-top: 12px; }
@media (max-width: 650px) {
  .delivery-platform-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .delivery-platform { padding: 12px; }
  .delivery-period button, .delivery-import :is(select,button) { min-height: 44px; }
}

/* 堂食数据 */
.filter-panel[data-dine] :is(.filter-grid label:has(> :is(#channel,#basis)),#export) { display: none; }
.filter-panel[data-dine] + #scopeNote { display: none; }
.dine-summary, .dine-payments { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.dine-summary { margin-bottom: 14px; }
.dine-metric { min-width: 0; color: #183128; font-variant-numeric: tabular-nums; }
.dine-summary .dine-metric { padding: 15px 16px 13px; border: 1px solid #d9e6df; border-radius: 12px; background: #fff; }
.dine-summary .dine-metric:first-child { background: #eaf4ee; border-color: #cfe3d8; }
.dine-metric-title { margin: 0 0 6px; color: #40584f; font-size: 13px; line-height: 1.35; font-weight: 650; }
.dine-metric-value { display: block; color: #17382e; font-size: clamp(23px,2.5vw,35px); line-height: 1.2; font-weight: 750; letter-spacing: -.02em; overflow-wrap: anywhere; }
.dine-metric-value small { color: #50635c; font-size: .46em; font-weight: 600; white-space: nowrap; }
.dine-metric-compare { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; margin-top: 10px; padding-top: 8px; border-top: 1px solid #dce8e2; font-size: 12px; }
.dine-metric-baseline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; color: #4a6173; }
.dine-metric-baseline b { color: #34495a; font-weight: 650; }
.dine-metric-delta { min-width: 0; }
.dine-change { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 2px 6px; padding: 2px 6px; border-radius: 5px; color: #455b69; background: #eff3f5; font-size: 11px; line-height: 1.5; font-weight: 650; }
.dine-change.up { color: #116044; background: #e6f3eb; }
.dine-change.down { color: #9e302d; background: #fbeceb; }
.dine-change b { font-weight: 750; }
.dine-missing { color: #566776; font-weight: 500; }
.dine-payment-panel { padding: 13px 16px; margin-bottom: 14px; }
.dine-payment-panel .panel-head { margin-bottom: 10px; }
.dine-payment-panel .panel-head:has(small:empty) small { display: none; }
.dine-payments { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; }
.dine-payments .dine-metric { padding: 0 13px; }
.dine-payments .dine-metric + .dine-metric { border-left: 1px solid #e1e9e5; }
.dine-payments .dine-metric:first-child { padding-left: 0; }
.dine-payments .dine-metric:last-child { padding-right: 0; }
.dine-payments .dine-metric-title { font-size: 12px; }
.dine-payments .dine-metric-value { font-size: clamp(19px,1.8vw,26px); }
.dine-payments .dine-metric-compare { flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 6px; padding-top: 0; border-top: 0; }
.dine-detail-summary { margin-bottom: 16px; }
.dine-ranking-scroll { max-height: 490px; border: 1px solid var(--border); border-radius: 8px; }
.dine-ranking-scroll:focus-visible { outline: 2px solid #536e93; outline-offset: 2px; }
.dine-ranking { min-width: 740px; font-size: 13px; color: #253446; }
.dine-ranking :is(th,td) { padding: 10px 13px; text-align: right; }
.dine-ranking :is(th,td):nth-child(2) { text-align: left; }
.dine-ranking th { background: #edf3ef; color: #3b554d; font-weight: 650; }
.dine-ranking :is(th,td):first-child { width: 60px; text-align: center; font-weight: 650; }
.dine-ranking td strong { display: block; font-size: 14px; }
.dine-ranking td > :is(.dine-change,.dine-missing):not(strong) { margin-top: 3px; }
.dine-ranking .table-link { color: #3d577b; font-weight: 650; }
.dine-ranking tr:is(:hover,:focus-within) { background: #eaf3ef; }
.dine-ranking tbody tr:last-child td { border-bottom: 0; }
.dine-traffic-periods .panel-head { flex-wrap: wrap; gap: 6px 16px; }
.dine-period-scroll { border: 1px solid var(--border); border-radius: 8px; }
.dine-period-scroll:focus-visible { outline: 2px solid #536e93; outline-offset: 2px; }
.dine-period-table { min-width: 525px; color: #253446; font-size: 13px; font-variant-numeric: tabular-nums; }
.dine-period-table :is(th,td) { padding: 12px 14px; }
.dine-period-table thead th { background: #edf3ef; color: #3b554d; font-weight: 650; }
.dine-period-table tbody th { position: static; color: #253446; font-weight: 650; background: inherit; }
.dine-period-table :is(th,td):nth-child(-n+2) { text-align: left; }
.dine-period-table tbody tr:hover { background: #eaf3ef; }
.dine-period-table tbody tr:last-child :is(th,td) { border-bottom: 0; }
.dine-period-hours, .dine-period-count small { display: block; margin-top: 4px; color: #546176; font-size: 11px; font-weight: 500; }
.dine-period-share { min-width: 120px; }
.dine-period-share-value { display: grid; grid-template-columns: minmax(55px,1fr) 48px; align-items: center; gap: 8px; }
.dine-period-share progress { appearance: none; display: block; width: 100%; height: 8px; overflow: hidden; border: 0; border-radius: 99px; background: #e2eaf6; color: #3b6ec5; }
.dine-period-share progress::-webkit-progress-bar { border-radius: 99px; background: #e2eaf6; }
.dine-period-share progress::-webkit-progress-value { border-radius: 99px; background: #3b6ec5; }
.dine-period-share progress::-moz-progress-bar { border-radius: 99px; background: #3b6ec5; }
.dine-period-count, .dine-period-delta { font-weight: 600; white-space: nowrap; }
.dine-period-note { margin: 12px 0 0; color: #526376; font-size: 12px; line-height: 1.55; }
.dine-sync { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 14px; padding: 10px 14px; margin: 14px 0; border-color: #dbe5e0; }
.dine-sync h3 { margin: 0 0 2px; color: #233e34; font-size: 13px; }
.dine-sync-source p, .dine-sync-control small { margin: 0; color: #506577; font-size: 11px; line-height: 1.5; }
.dine-sync-counts { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; gap: 5px; }
.dine-sync-pill { padding: 4px 7px; border-radius: 5px; color: #335c4f; background: #edf5ef; font-size: 11px; font-weight: 600; }
.dine-sync-warn { color: #845415; background: #fff4df; }
.dine-sync-control { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.dine-sync-button { min-height: 31px; padding: 4px 9px; color: #fff; border-color: #235448; background: #235448; font-size: 12px; font-weight: 650; }
.dine-sync-button:disabled { opacity: 1; color: #536675; border-color: #dce5e6; background: #f2f5f5; }
.dine-sync-status { flex-basis: 100%; margin: 0; color: #335c4f; font-size: 12px; }
.dine-sync-status:empty { display: none; }
.dine-store-panel .table-scroll { border: 1px solid var(--border); border-radius: 8px; }
.dine-cashier-values { display: grid; justify-items: end; gap: 3px; }
.dine-cashier-values .cell-sub { color: #506577; font-size: 10px; }
@media (max-width: 740px) {
  .dine-summary, .dine-payments { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dine-summary .dine-metric:first-child { grid-column: 1 / -1; }
  .dine-payments .dine-metric { padding: 8px; }
  .dine-payments .dine-metric:nth-child(odd) { border-left: 0; padding-left: 0; }
  .dine-payments .dine-metric:nth-child(n+3) { border-top: 1px solid #e1e9e5; }
  .dine-sync button { min-height: 40px; }
}
@media (max-width: 600px) {
  .dine-sync { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 6px 10px; }
  .dine-sync-counts, .dine-sync-status { grid-column: 1 / -1; }
  .dine-sync-counts { grid-row: 2; }
  .dine-sync-control { grid-column: 2; grid-row: 1; display: grid; justify-items: end; gap: 3px; }
  .dine-sync-control small { text-align: right; }
  .dine-summary { gap: 8px; }
  .dine-summary .dine-metric { padding: 12px; }
  .dine-period-table { min-width: 300px; font-size: 12px; white-space: normal; }
  .dine-period-table :is(th,td) { padding: 10px 8px; }
  .dine-period-table tbody th { width: 32%; }
  .dine-period-share { min-width: 68px; }
  .dine-period-share-value { grid-template-columns: 1fr; justify-items: end; gap: 4px; }
}

@media (max-width: 600px) {
  .ad-cockpit { gap: 12px; min-width: 0; }
  .ad-cockpit .ad-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    min-height: 0;
    padding: 14px;
  }
  .ad-cockpit .ad-hero-left { align-items: flex-start; gap: 9px; }
  .ad-cockpit .ad-hero-icon { width: 32px; height: 32px; margin-top: 3px; }
  .ad-cockpit .ad-hero-icon svg { width: 19px; height: 19px; }
  .ad-cockpit .ad-hero-text { flex: 1; }
  .ad-cockpit .ad-hero-kicker { color: #d2e1f7; }
  .ad-cockpit .ad-hero-text h2 { font-size: clamp(17px, 5vw, 22px); line-height: 1.35; text-wrap: balance; }
  .ad-cockpit .ad-hero-text p { color: #d5e4f7; line-height: 1.5; }
  .ad-cockpit .ad-hero-btn { justify-self: start; min-height: 44px; padding: 8px 13px; }

  .ad-cockpit .revenue-board { gap: 10px; margin-bottom: 0; }
  .ad-cockpit .rb-headline { grid-template-rows: none; min-height: 0; padding: 12px 13px; }
  .ad-cockpit .rb-headline :is(.rb-context, .rb-comparison) { grid-row: auto; }
  .ad-cockpit .rb-headline h3 { font-size: 15px; }
  .ad-cockpit .rb-primary { font-size: clamp(25px, 7vw, 31px); letter-spacing: -.3px; }
  .ad-cockpit .rb-context, .ad-cockpit .rb-footnote { font-size: 12px; line-height: 1.45; }
  .ad-cockpit .rb-comparison-period { line-height: 1.5; }
  .ad-cockpit .rb-details { grid-template-columns: minmax(0, 1fr); }
  .ad-cockpit .rb-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(80px, 1.05fr);
    align-items: center;
    gap: 3px 8px;
    padding: 7px 13px;
    text-align: left;
  }
  .ad-cockpit .rb-detail + .rb-detail {
    border-top: 1px solid #e9edf1;
    border-left: 0;
  }
  .ad-cockpit .rb-detail-label { justify-content: start; min-height: 0; font-size: 12px; }
  .ad-cockpit .rb-detail-value { justify-self: end; font-size: 14px; text-align: right; }
  .ad-cockpit .rb-detail :is(.rb-detail-note, .rb-comparison) {
    grid-column: 1 / -1;
    justify-content: end;
    margin-top: 0;
    font-size: 12px;
    text-align: right;
    line-height: 1.4;
  }
  .ad-cockpit .rb-comparison strong { white-space: normal; overflow-wrap: anywhere; }
  .ad-cockpit .rb-detail > .rb-ingredient-link {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(80px, 1.05fr);
    align-items: center;
    gap: 8px;
    min-height: 44px;
    text-align: left;
  }

  .ad-cockpit .ad-grid { gap: 12px; }
  .ad-cockpit .ad-grid .ad-card-head h3 { font-size: 15px; }
  .ad-cockpit .ad-priority-button { gap: 7px; padding-inline: 7px; }
  .ad-cockpit .ad-priority-content strong { font-size: 13px; }
  .ad-cockpit .ad-priority-content small { line-height: 1.4; overflow-wrap: anywhere; }
  .ad-cockpit .ad-list-card .ad-link-btn, .ad-cockpit .ad-store-link { min-height: 44px; }
  .ad-cockpit :is(.ad-region-axis, .ad-region-row) {
    grid-template-columns: minmax(64px, 1fr) minmax(72px, 1.8fr) minmax(58px, .8fr);
    gap: 7px;
  }
  .ad-cockpit .ad-region-value { white-space: normal; overflow-wrap: anywhere; }
  .ad-cockpit .ad-focus-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
  .ad-cockpit .ad-focus-table :is(th, td) { padding: 7px 9px; white-space: nowrap; }
}

@media (max-width: 600px) {
  .ad-mobile-cockpit { gap: 9px; }
  .ad-mobile-cockpit-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .ad-mobile-metric {
    position: relative;
    display: grid;
    align-content: center;
    gap: 5px;
    min-width: 0;
    padding: 12px;
    border: 1px solid #dce8e1;
    border-radius: 12px;
    background: #fff;
    color: #163b30;
    text-align: left;
  }
  .ad-mobile-metric > span { color: #47665b; font-size: 12px; font-weight: 650; }
  .ad-mobile-metric > strong {
    font-size: clamp(16px, 4.65vw, 22px);
    line-height: 1.14;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.3px;
    overflow-wrap: anywhere;
  }
  .ad-mobile-metric-primary {
    grid-column: 1 / -1;
    gap: 7px;
    padding: 14px;
    border-color: #174c3d;
    background: linear-gradient(110deg, #123c32, #24614b);
    color: #fff;
  }
  .ad-mobile-metric-primary > span { color: #d6f0e3; font-size: 13px; }
  .ad-mobile-metric-primary > strong { font-size: clamp(26px, 8.5vw, 40px); letter-spacing: -.6px; }
  .ad-mobile-metric .ad-mobile-loss { color: #aa382c; }
  .ad-mobile-metric-food { width: 100%; font-family: inherit; white-space: normal; cursor: pointer; }
  .ad-mobile-metric-food:hover, .ad-mobile-alert:hover { border-color: #89ae9b; color: #163b30; }
  .ad-mobile-metric-food::after {
    position: absolute;
    top: 16px;
    right: 13px;
    content: '';
    width: 6px;
    height: 6px;
    border: solid #557d6a;
    border-width: 2px 2px 0 0;
    transform: rotate(45deg);
  }
  .ad-mobile-coverage { margin: -2px 2px 0; color: #53675c; font-size: 11px; line-height: 1.5; }
  .ad-mobile-alert, .ad-mobile-details > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #dce8e1;
    border-radius: 10px;
    background: #fff;
    color: #24463b;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
  }
  .ad-mobile-alert strong {
    margin-inline-start: auto;
    color: #385d50;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
  }
  .ad-mobile-details > summary { list-style: none; }
  .ad-mobile-details > summary::-webkit-details-marker { display: none; }
  .ad-mobile-alert::after, .ad-mobile-details > summary::after {
    flex: none;
    content: '';
    width: 6px;
    height: 6px;
    margin-inline-end: 2px;
    border: solid #557d6a;
    border-width: 2px 2px 0 0;
    transform: rotate(45deg);
  }
  .ad-mobile-details > summary::after { margin-inline-start: auto; transform: rotate(135deg); }
  .ad-mobile-details[open] > summary::after { transform: rotate(-45deg); }
  .ad-mobile-cockpit :is(.ad-mobile-metric-food, .ad-mobile-alert, summary):focus-visible {
    outline: 2px solid #28725b;
    outline-offset: 2px;
  }
  .ad-mobile-details-body { display: grid; gap: 12px; min-width: 0; padding-top: 10px; }
}
