#freestoreSystem .fs-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
}

#freestoreSystem .fs-head h2 {
  margin: 0 0 4px;
}

#freestoreSystem .fs-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

#freestoreSystem .fs-tab {
  align-items: center;
  background: #fff;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  gap: 6px;
  padding: 8px 12px;
}

#freestoreSystem .fs-tab-icon svg,
#freestoreSystem .fs-title-icon svg,
#freestoreSystem .fs-option-icon svg,
#freestoreSystem .fs-notice-icon svg,
#freestoreSystem .fs-notification-type-icon svg,
#freestoreSystem .fs-status-icon svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

#freestoreSystem .fs-tab.active {
  background: #eaf2ff;
  border-color: #2563eb;
  color: #1d4ed8;
}

#freestoreSystem .fs-panel {
  display: none;
}

#freestoreSystem .fs-panel.active {
  display: block;
}

#freestoreSystem .fs-subtitle {
  color: #0f172a;
  font-size: 16px;
  margin: 10px 0 12px;
}

#freestoreSystem .fs-title-with-icon {
  align-items: center;
  display: flex;
  gap: 8px;
}

#freestoreSystem .fs-title-icon {
  align-items: center;
  background: #eaf2ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1d4ed8;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  width: 32px;
}

#freestoreSystem .fs-auto-box {
  background: #f8fafc;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 12px;
}

#freestoreSystem .fs-auto-box p {
  margin: 4px 0 0;
}

#freestoreSystem .fs-notice-hero {
  align-items: center;
  display: flex;
  gap: 12px;
}

#freestoreSystem .fs-notification-toolbar {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

#freestoreSystem .fs-notification-toolbar p {
  margin: 4px 0 0;
}

#freestoreSystem .fs-notification-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

#freestoreSystem .fs-notification-card {
  background: #fff;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  color: #334155;
  cursor: pointer;
  min-height: 132px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

#freestoreSystem .fs-notification-card.has-new {
  background: #f0fdf4;
  border-color: #86efac;
}

#freestoreSystem .fs-notification-card-head {
  align-items: center;
  display: flex;
  gap: 8px;
}

#freestoreSystem .fs-notification-card-head strong {
  background: #0f766e;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  margin-left: auto;
  min-width: 28px;
  padding: 3px 8px;
  text-align: center;
}

#freestoreSystem .fs-notification-card-body {
  color: #334155;
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

#freestoreSystem .fs-notification-card-body small,
#freestoreSystem .fs-notification-card-body time {
  color: #64748b;
  font-size: 12px;
}

#freestoreSystem .fs-notification-type-icon {
  align-items: center;
  background: #eef6ff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  color: #2563eb;
  display: inline-flex;
  flex: 0 0 auto;
  height: 32px;
  justify-content: center;
  width: 32px;
}

#freestoreSystem .fs-notification-type-icon.order {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

#freestoreSystem .fs-notification-type-icon.order-status-changes {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

#freestoreSystem .fs-notification-type-icon.customer {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #6d28d9;
}

#freestoreSystem .fs-notification-type-icon.customer-modified {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

#freestoreSystem .fs-notice-icon {
  align-items: center;
  background: #0f766e;
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  height: 44px;
  justify-content: center;
  width: 44px;
}

#freestoreSystem .fs-notice-icon svg {
  height: 22px;
  width: 22px;
}

#freestoreSystem .fs-auto-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 12px 0;
}

#freestoreSystem .fs-auto-grid label {
  align-items: center;
  background: #fff;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  display: flex;
  font-weight: 800;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
}

#freestoreSystem .fs-auto-grid input {
  width: auto;
}

#freestoreSystem .fs-option-icon {
  align-items: center;
  background: #eef6ff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  color: #2563eb;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  width: 30px;
}

#freestoreSystem .fs-status-name {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  font-weight: 800;
}

#freestoreSystem .fs-status-icon {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  width: 28px;
}

#freestoreSystem .fs-status-icon.ok {
  background: #ecfdf5;
  color: #047857;
}

#freestoreSystem .fs-status-icon.warn {
  background: #fff7ed;
  color: #c2410c;
}

#freestoreSystem .fs-status-icon.idle {
  background: #f1f5f9;
  color: #64748b;
}

#freestoreSystem .fs-advanced {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin: 10px 0 12px;
  padding: 10px;
}

#freestoreSystem .fs-advanced summary {
  color: #334155;
  cursor: pointer;
  font-weight: 800;
}

#freestoreSystem .fs-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 12px;
}

#freestoreSystem .fs-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#freestoreSystem .fs-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#freestoreSystem input,
#freestoreSystem select,
#freestoreSystem textarea {
  width: 100%;
}

#freestoreSystem .fs-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

#freestoreSystem .fs-actions .danger,
#freestoreSystem button.danger {
  background: #b91c1c;
  border-color: #991b1b;
  color: #fff;
}

#freestoreSystem .fs-result {
  background: #fafafa;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  margin-top: 10px;
  min-height: 80px;
  padding: 10px;
}

#freestoreSystem .fs-preview {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #475569;
  margin: 8px 0 12px;
  min-height: 48px;
  padding: 10px;
}

#freestoreSystem .fs-rejection {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
  margin-bottom: 10px;
  padding: 10px;
}

#freestoreSystem .fs-table {
  min-width: 980px;
  width: 100%;
}

#freestoreSystem .fs-table th,
#freestoreSystem .fs-table td {
  font-size: 13px;
  padding: 8px;
}

#freestoreSystem .fs-pill {
  background: #f1f5f9;
  border: 1px solid #d8e0ea;
  border-radius: 999px;
  color: #475569;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
}

#freestoreSystem .fs-pill.ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

#freestoreSystem .fs-pill.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

#freestoreSystem .fs-muted {
  color: #64748b;
  font-size: 13px;
}

#freestoreSystem .fs-json {
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
}

#freestoreSystem code {
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 900px) {
  #freestoreSystem .fs-head {
    display: block;
  }

  #freestoreSystem .fs-grid,
  #freestoreSystem .fs-grid.two,
  #freestoreSystem .fs-auto-grid,
  #freestoreSystem .fs-notification-grid {
    grid-template-columns: 1fr;
  }

  #freestoreSystem .fs-notification-toolbar {
    display: block;
  }

  #freestoreSystem .fs-actions button,
  #freestoreSystem .fs-actions select {
    width: 100%;
  }
}

/* Modern FreeStore workspace overrides */
#freestoreSystem {
  background: #f8fafc;
  border-color: #dfe7f0;
}

#freestoreSystem .fs-head {
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  margin: -2px 0 14px;
  padding: 0 0 12px;
}

#freestoreSystem .fs-head h2 {
  color: #0f172a;
  font-size: 24px;
  letter-spacing: 0;
}

#freestoreSystem .fs-head .muted {
  color: #64748b;
  margin: 2px 0 0;
}

#freestoreSystem > .stats {
  background: transparent;
  border: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 14px;
  padding: 0;
}

#freestoreSystem > .stats .stat {
  background: #fff;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-height: 70px;
  padding: 12px;
}

#freestoreSystem > .stats .label {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

#freestoreSystem > .stats .value {
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

#freestoreSystem > .stats .value.ok {
  color: #047857;
}

#freestoreSystem > .stats .value.warn {
  color: #b45309;
}

#freestoreSystem > .stats .value.muted {
  color: #64748b;
}

#freestoreSystem .fs-tabs {
  background: #eef2f7;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
}

#freestoreSystem .fs-tab {
  background: transparent;
  border-color: transparent;
  border-radius: 6px;
  color: #475569;
  min-height: 36px;
  padding: 8px 12px;
}

#freestoreSystem .fs-tab:hover {
  background: #fff;
  color: #0f172a;
}

#freestoreSystem .fs-tab.active {
  background: #fff;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  color: #0f766e;
}

#freestoreSystem .fs-panel.active {
  display: block;
  padding-top: 2px;
}

#freestoreSystem .fs-subtitle {
  align-items: center;
  border-left: 4px solid #0f766e;
  color: #0f172a;
  display: flex;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 16px 0 10px;
  min-height: 28px;
  padding-left: 10px;
}

#freestoreSystem .fs-panel > .fs-subtitle:first-child {
  margin-top: 4px;
}

#freestoreSystem hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 18px 0;
}

#freestoreSystem .fs-grid {
  background: #fff;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 12px;
  padding: 12px;
}

#freestoreSystem .fs-grid.two {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

#freestoreSystem .fs-grid label {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

#freestoreSystem .fs-grid .lbl {
  color: #475569;
  font-size: 12px;
}

#freestoreSystem input,
#freestoreSystem select,
#freestoreSystem textarea {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  min-height: 36px;
}

#freestoreSystem textarea {
  min-height: 92px;
}

#freestoreSystem .fs-actions {
  background: #fff;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
  gap: 8px;
  margin: 8px 0 12px;
  padding: 8px;
}

#freestoreSystem .fs-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 190px;
}

#freestoreSystem .fs-row-actions button {
  min-height: 30px;
  padding: 5px 8px;
  white-space: nowrap;
}

#freestoreSystem .fs-actions button,
#freestoreSystem .fs-actions select {
  min-height: 34px;
}

#freestoreSystem .fs-notification-toolbar {
  justify-content: flex-end;
  margin-bottom: 10px;
}

#freestoreSystem .fs-notification-toolbar .fs-actions {
  margin: 0;
}

#freestoreSystem .fs-notification-grid {
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

#freestoreSystem .fs-notification-card {
  border-color: #dfe7f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-height: 118px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

#freestoreSystem .fs-notification-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

#freestoreSystem .fs-notification-card.has-new {
  background: #f0fdfa;
  border-color: #5eead4;
}

#freestoreSystem .fs-auto-box {
  background: transparent;
  border: 0;
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0;
}

#freestoreSystem .table-wrap {
  background: #fff;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  margin: 10px 0 12px;
  overflow: auto;
}

#freestoreSystem .grid-excel.fs-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 900px;
}

#freestoreSystem .fs-panel[data-panel="notifications"] .grid-excel.fs-table {
  min-width: 680px;
}

#freestoreSystem .fs-table th {
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  position: sticky;
  top: 0;
  z-index: 1;
}

#freestoreSystem .fs-table td {
  background: #fff;
  color: #334155;
  vertical-align: middle;
}

#freestoreSystem .fs-table tr:hover td {
  background: #f8fafc;
}

#freestoreSystem .fs-preview {
  background: #fff;
  border-color: #cbd5e1;
  border-style: solid;
}

#freestoreSystem .fs-result {
  background: #fff;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
  margin-top: 16px;
  min-height: 0;
  padding: 0;
}

#freestoreSystem .fs-result summary {
  color: #334155;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
  padding: 10px 12px;
}

#freestoreSystem .fs-result summary::-webkit-details-marker {
  display: none;
}

#freestoreSystem .fs-result summary::after {
  color: #64748b;
  content: "展開";
  float: right;
  font-size: 12px;
  font-weight: 800;
}

#freestoreSystem .fs-result[open] summary {
  border-bottom: 1px solid #e2e8f0;
}

#freestoreSystem .fs-result[open] summary::after {
  content: "收合";
}

#freestoreSystem .fs-result-body {
  padding: 12px;
}

#freestoreSystem .fs-json {
  background: #0f172a;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  padding: 10px;
}

@media (max-width: 1100px) {
  #freestoreSystem > .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #freestoreSystem {
    padding-left: 10px;
    padding-right: 10px;
  }

  #freestoreSystem > .stats {
    grid-template-columns: 1fr;
  }

  #freestoreSystem .fs-tab {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
  }

  #freestoreSystem .fs-grid {
    grid-template-columns: 1fr;
  }
}

#freestoreSystem button[onclick="FreeStoreSystem.loadStoredOrders()"],
#freestoreSystem button[onclick="FreeStoreSystem.loadStoredCustomers()"] {
  display: none !important;
}

#freestoreSystem .fs-collapse-card {
  border: 1px solid var(--line, #d7dde8);
  border-radius: 14px;
  background: var(--panel, #fff);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .07);
  margin: 14px 0;
  overflow: hidden;
}

#freestoreSystem .fs-collapse-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  color: var(--text, #172033);
  background: linear-gradient(180deg, rgba(248, 250, 252, .95), rgba(255, 255, 255, .95));
  border-bottom: 1px solid transparent;
}

#freestoreSystem .fs-collapse-card > summary::-webkit-details-marker {
  display: none;
}

#freestoreSystem .fs-collapse-card > summary::before {
  content: '+';
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 999px;
  color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, .10);
  font-weight: 900;
}

#freestoreSystem .fs-collapse-card[open] > summary {
  border-bottom-color: var(--line, #d7dde8);
}

#freestoreSystem .fs-collapse-card[open] > summary::before {
  content: '-';
}

#freestoreSystem .fs-collapse-card .fs-collapse-hint {
  margin-left: auto;
  color: var(--muted, #6b7280);
  font-size: 12px;
  font-weight: 700;
}

#freestoreSystem .fs-collapse-card[open] .fs-collapse-hint {
  color: var(--primary, #2563eb);
}

#freestoreSystem .fs-collapse-body {
  padding: 16px;
}

#freestoreSystem .fs-collapse-body > .fs-actions:first-child,
#freestoreSystem .fs-collapse-body > .fs-grid:first-child {
  margin-top: 0;
}

@media (max-width: 720px) {
  #freestoreSystem .fs-collapse-card > summary {
    padding: 13px 14px;
  }

  #freestoreSystem .fs-collapse-body {
    padding: 12px;
  }
}

#freestoreSystem #fsResult {
  display: none !important;
}

#freestoreSystem .fs-inline-details {
  border: 1px solid var(--line, #d7dde8);
  border-radius: 12px;
  background: #fff;
  margin: 14px 0;
  overflow: hidden;
}

#freestoreSystem .fs-inline-details > summary {
  min-height: 48px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
  background: #f8fafc;
}

#freestoreSystem .fs-inline-details > summary::-webkit-details-marker {
  display: none;
}

#freestoreSystem .fs-inline-details > summary::before {
  content: '+';
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 999px;
  color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, .10);
  font-weight: 900;
}

#freestoreSystem .fs-inline-details[open] > summary::before {
  content: '-';
}

#freestoreSystem .fs-inline-details > .fs-grid,
#freestoreSystem .fs-inline-details > .fs-actions,
#freestoreSystem .fs-inline-details > .table-wrap,
#freestoreSystem .fs-inline-details > .fs-minor-title {
  margin-left: 14px;
  margin-right: 14px;
}

#freestoreSystem .fs-minor-title {
  margin: 16px 14px 8px;
  color: var(--text, #172033);
  font-size: 14px;
  font-weight: 850;
}

#freestoreSystem .fs-compact-table input {
  width: 100%;
  min-width: 120px;
}

#freestoreSystem .fs-summary-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

#freestoreSystem .fs-summary-list > div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line, #d7dde8);
  border-radius: 10px;
  background: #fff;
}

#freestoreSystem .fs-summary-list span {
  color: var(--muted, #6b7280);
  font-size: 12px;
  font-weight: 700;
}

#freestoreSystem .fs-summary-list strong {
  color: var(--text, #172033);
  font-size: 14px;
  font-weight: 850;
}

#freestoreSystem .fs-inline-note {
  margin: 8px 0 0;
}

#freestoreSystem .fs-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .45);
}

#freestoreSystem .fs-modal.hidden {
  display: none !important;
}

#freestoreSystem .fs-modal-panel {
  width: min(920px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  border: 1px solid var(--line, #d7dde8);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, .24);
}

#freestoreSystem .fs-modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line, #d7dde8);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
}

#freestoreSystem .fs-modal-head h3 {
  margin: 0;
  font-size: 18px;
}

#freestoreSystem .fs-modal-panel > .fs-grid,
#freestoreSystem .fs-modal-panel > .fs-actions {
  margin: 16px;
}

@media (max-width: 720px) {
  #freestoreSystem .fs-modal {
    align-items: end;
    padding: 0;
  }

  #freestoreSystem .fs-modal-panel {
    width: 100%;
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
  }

  #freestoreSystem .fs-modal-head {
    padding: 14px;
  }
}
