.shop-data-workspace { padding: 0 22px 24px; background: #f4f7fb; }
.shop-data-workspace .workspace-toolbar { margin: 0 -22px 20px; }
.shop-data-workspace .workspace-toolbar { gap: 12px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.shop-data-workspace .workspace-toolbar>div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.shop-data-workspace .workspace-toolbar span { font-size: 12px; color: #8492a6; }
.shop-data-workspace #sdCreate { padding: 9px 13px; border: 0; border-radius: 6px; background: #2878ff; color: #fff; cursor: pointer; }
.shop-data-workspace #sdPermissions { padding: 8px 13px; border: 1px solid #cbdcf2; border-radius: 6px; background: #fff; color: #2878ff; cursor: pointer; }
.sd-permission-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e7edf4; }
.sd-permission-row label { display: flex; align-items: center; gap: 10px; overflow-wrap: anywhere; font-size: 13px; }
.sd-permission-row input { flex: 0 0 auto; accent-color: #2878ff; }.sd-permission-row button { flex: 0 0 auto; }
.sd-permission-card { border-bottom: 1px solid #e7edf4; padding-bottom: 8px; }
.sd-permission-card .sd-permission-row { border-bottom: 0; }
.sd-entry-scope { margin: 0 0 6px; padding: 10px; min-width: 0; border: 1px solid #e0e8f2; border-radius: 7px; font-size: 13px; }
.sd-entry-scope legend { color: #52647b; padding: 0 4px; }
.sd-entry-scope label { display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.sd-entry-scope input { width: auto; min-width: 0; flex: 0 0 auto; accent-color: #2878ff; }
.sd-scope-choices { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 10px 0; }
.ledger-access-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ledger-access-picker { display: flex; flex-direction: column; flex: 1 1 100%; gap: 6px; min-width: 0; }
.ledger-user-search { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
#finUsers .ledger-user-search input,#sdPermissionsList .ledger-user-search input { flex: 1 1 120px; width: 0; min-width: 0; padding: 7px; border: 1px solid #d8e3f0; border-radius: 6px; font: inherit; }
.ledger-user-results { display: grid; gap: 6px; min-width: 0; }
.ledger-user-result { text-align: left; overflow-wrap: anywhere; }
.ledger-user-result[aria-pressed=true] { border-color: #2878ff; background: #eff5ff; color: #246fd8; }
.ledger-search-status { margin: 0; font-size: 13px; color: #52647b; overflow-wrap: anywhere; }
.ledger-search-status:empty { display: none; }
.ledger-admin-label { font-size: 12px; color: #8190a6; flex-shrink: 0; }
#finUsers .sd-permission-row,#sdPermissionsList .sd-permission-row { gap: 8px; }#finUsers .sd-permission-row label,#sdPermissionsList .sd-permission-row label { flex: 1; min-width: 0; }#finUsers select,#sdPermissionsList select { flex: 0 0 auto; max-width: 105px; padding: 7px 5px; font-size: 12px; }
.sd-panel { padding: 20px; margin-bottom: 18px; background: #fff; border: 1px solid #e0e8f2; border-radius: 12px; box-shadow: 0 5px 20px #213c5d05; min-width: 0; }
.sd-controls,.sd-section-heading,.sd-ranges,.sd-date-range { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.sd-overview-shop { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; min-width: 0; }
.sd-overview-shop label,.sd-date-range label { display: flex; align-items: center; gap: 8px; color: #52647b; }
.sd-overview-shop select { max-width: 300px; min-width: 160px; }
.sd-overview-shop #sdShopInfo { flex: 1; color: #8190a6; overflow-wrap: anywhere; font-size: 12px; }
.sd-panel button,.sd-dialog button { min-height: 34px; padding: 7px 13px; border: 1px solid #d8e3f0; background: #fff; border-radius: 6px; color: #4c607a; cursor: pointer; }
.sd-panel button.primary,.sd-dialog button.primary,.sd-ranges button.active { background: #2878ff; border-color: #2878ff; color: #fff; }
.sd-panel button:disabled { opacity: .5; cursor: default; }
.sd-panel input,.sd-panel select,.sd-dialog input,.sd-dialog select { min-width: 0; padding: 8px 10px; border: 1px solid #d8e3f0; border-radius: 6px; font: inherit; color: #31445f; background: #fff; }
.sd-section-heading { justify-content: space-between; margin-bottom: 14px; }
.sd-section-heading h2 { margin: 0; font-size: 17px; color: #273c56; }
.sd-overview-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.sd-view-switch { display: flex; gap: 4px; padding: 3px; border: 1px solid #e0e8f2; border-radius: 8px; background: #f5f8fc; }
.sd-view-switch button { border-color: transparent; background: transparent; }.sd-view-switch button.active { color: #fff; background: #2878ff; border-color: #2878ff; }
.sd-section-heading>span,.sd-date-range>span { color: #8492a6; font-size: 12px; }
.sd-date-range { margin-bottom: 18px; }
.sd-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; border-top: 1px solid #e4eaf2; border-left: 1px solid #e4eaf2; }
.sd-metric { position: relative; min-width: 0; display: grid; gap: 9px; padding: 17px 14px; border-right: 1px solid #e4eaf2; border-bottom: 1px solid #e4eaf2; cursor: pointer; background: #fff; }
.sd-metric.selected { background: #f1f7ff; box-shadow: inset 0 0 0 1px #76aaff; }
.sd-metric input { position: absolute; top: 13px; right: 12px; width: 13px; height: 13px; accent-color: #2878ff; }
.sd-metric>span:first-of-type { font-size: 12px; color: #718096; padding-right: 24px; line-height: 1.6; }
.sd-metric strong { color: #293e58; font-size: clamp(18px,1.6vw,27px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sd-metric .sd-delta { font-size: 12px; color: #8d9aad; }
.sd-metric strong.sd-profit-gain,.sd-table .sd-profit-gain { color: #dc4c56; }
.sd-metric strong.sd-profit-loss,.sd-table .sd-profit-loss { color: #10a777; }
.sd-metric .sd-delta.up { color: #dc4c56; }.sd-metric .sd-delta.down { color: #10a777; }
.sd-rate-settings { display: flex; align-items: center; gap: 8px; max-width: 100%; margin: 0; }
.sd-rate-settings label { flex-shrink: 0; white-space: nowrap; color: #52647b; font-size: 13px; }
.sd-rate-settings input { width: calc(3ch + 18px); min-width: 0; flex: 0 0 auto; box-sizing: border-box; padding: 7px 6px; border: 1px solid #d8e3f0; border-radius: 6px; color: #31445f; background: #fff; font: inherit; appearance: textfield; -moz-appearance: textfield; }
.sd-rate-settings input::-webkit-inner-spin-button,.sd-rate-settings input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sd-rate-settings button { flex-shrink: 0; padding: 8px 13px; border: 1px solid #2878ff; border-radius: 6px; background: #2878ff; color: #fff; cursor: pointer; }
.sd-rate-settings button:disabled { opacity: .5; cursor: default; }
.sd-explanation { margin: 13px 0 22px; color: #8a98ac; font-size: 12px; line-height: 1.8; }
.sd-charts { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,420px),1fr)); gap: 14px; }
.sd-chart { min-width: 0; padding: 12px; background: #fbfcfe; border: 1px solid #e9eef5; border-radius: 8px; }
.sd-chart h3 { margin: 0 0 8px; font-size: 14px; }.sd-chart svg { display: block; width: 100%; height: auto; }
.sd-bar-scroll { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }.sd-bar-scroll rect:focus { outline: 2px solid #203d67; outline-offset: 2px; }
.sd-empty { padding: 36px 10px; text-align: center; color: #92a0b3; grid-column: 1/-1; }
.sd-table-scroll { overflow-x: auto; }.sd-table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.sd-table th { padding: 13px 10px; color: #718298; background: #f7f9fc; text-align: right; font-weight: 500; }
.sd-table td { border-bottom: 1px solid #eef2f7; padding: 13px 10px; text-align: right; font-variant-numeric: tabular-nums; }
.sd-table th:first-child,.sd-table td:first-child { text-align: left; }.sd-table button { margin-left: 6px; }
#sdDailyPanel .sd-table { table-layout: auto; white-space: normal; }
#sdDailyPanel .sd-table th,#sdDailyPanel .sd-table td { border: 1px solid #d8e3f0; padding: 8px 6px; line-height: 1.5; overflow-wrap: anywhere; vertical-align: middle; }
#sdDailyPanel .sd-table td { white-space: nowrap; overflow-wrap: normal; }
#sdDailyPanel .sd-table th:first-child { width: 1%; white-space: nowrap; }
#sdDailyPanel .sd-table tr>:nth-child(2),#sdDailyPanel .sd-table tr>:nth-child(3) { width: var(--sd-count-width,2.5em); min-width: var(--sd-count-width,2.5em); white-space: nowrap; }
#sdDailyPanel .sd-overview-currency { display: inline-block; white-space: nowrap; overflow-wrap: normal; word-break: normal; }
#sdDailyPanel .sd-by-shop .sd-overview-name { display: block; width: max-content; min-width: 2em; max-width: 7em; white-space: normal; overflow-wrap: anywhere; }
#sdDailyPanel .sd-overview-value { display: block; min-width: 0; white-space: nowrap; }
#sdDailyFoot { font-weight: 600; background: #eef5ff; }
.sd-day-nav { display: flex; gap: 6px; }.sd-day-nav button { padding: 6px 10px; }
.sd-error { padding: 12px; background: #fff0f0; border: 1px solid #f6c8ce; border-radius: 7px; color: #b23d4b; }
.sd-dialog { width: min(640px,calc(100vw - 24px)); max-height: calc(100dvh - 40px); overflow: auto; border: 1px solid #d8e3f0; border-radius: 12px; padding: 22px; color: #31445f; box-shadow: 0 15px 60px #20334b40; }
.sd-dialog::backdrop { background: #1a2b4266; }.sd-dialog h2 { margin: 0 0 18px; font-size: 20px; }
.sd-dialog form>label,.sd-fields label { display: grid; gap: 6px; margin-bottom: 14px; font-size: 13px; }
.sd-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 16px; margin-top: 18px; }
.sd-cost-field { min-width: 0; display: grid; gap: 6px; margin-bottom: 14px; font-size: 13px; }
.sd-fields .sd-cost-field>label { display: block; margin: 0; }
.sd-cost-input { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sd-cost-input input { width: 0; flex: 1; }
.sd-cost-input button { white-space: nowrap; flex: 0 0 auto; }
.sd-dialog footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 14px; border-top: 1px solid #e7edf4; }
.sd-shop-fieldset { margin: 0 0 16px; padding: 12px; border: 1px solid #d8e3f0; border-radius: 7px; min-width: 0; }
.sd-shop-fieldset legend { font-size: 13px; padding: 0 6px; }.sd-shop-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.sd-shop-buttons button { max-width: 100%; overflow-wrap: anywhere; }.sd-shop-buttons button.active { background: #2878ff; border-color: #2878ff; color: #fff; }
.sd-shop-buttons button:disabled:not(.active) { opacity: .45; }
@media(min-width:681px) {
  #sdDailyPanel { width: fit-content; max-width: 100%; }
  #sdDailyPanel .sd-table { width: max-content; max-width: 100%; font-size: 28px; }
  #sdDailyPanel .sd-table th,#sdDailyPanel .sd-table td { padding: 8px 12px; }
  #sdDailyPanel .sd-table thead th:nth-child(n+4) { min-width: 128px; white-space: nowrap; }
}
@media(max-width:680px) { .sd-overview-shop #sdShopInfo { flex-basis: 100%; }.sd-overview-shop label { width: 100%; }.sd-overview-shop select { flex: 1; min-width: 0; max-width: none; } }
@media(max-width:680px) {
  #sdDailyPanel>.sd-section-heading h2 { font-size: 13px; }
  #sdDailyPanel>.sd-section-heading { gap: 6px; }
  .sd-day-nav { gap: 4px; }.sd-day-nav button { min-height: 30px; padding: 5px 4px; font-size: 11px; }
  #sdDailyPanel .sd-table { font-size: 11px; }
  #sdDailyPanel .sd-table th,#sdDailyPanel .sd-table td { padding: 5px 2px; line-height: 1.4; }
  .sd-cost-field { grid-column: 1 / -1; }
}
@media(max-width:1000px) { .sd-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media(max-width:680px) { .shop-data-workspace { padding: 0 10px 16px; }.shop-data-workspace .workspace-toolbar { margin: 0 -10px 12px; }.sd-panel { padding: 14px; }.sd-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }.sd-date-range { align-items: stretch; }.sd-date-range label { flex: 1 1 130px; flex-direction: column; align-items: stretch; }.sd-ranges button { padding: 7px 10px; }.sd-controls label { width: 100%; }.sd-controls select { flex: 1; max-width: none; }.sd-fields { gap: 0 10px; }.sd-dialog { padding: 16px; }.sd-metric { padding: 14px 10px; } }
