:root {
  --bg:        #f8f5f0;
  --panel:     #ffffff;
  --line:      #e2d5c3;
  --gold:      #bf8127;
  --gold-dk:   #8b5a16;
  --text:      #1d160d;
  --muted:     #6f604e;
  --ok:        #1f7a3a;
  --danger:    #b3261e;
  --focus:     #1c64f2;
  --topbar-h:  60px;
  --tabbar-h:  42px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* ── Top bar ─────────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

.topbar-left { display: flex; align-items: baseline; gap: 10px; }

h1 { font-size: 18px; font-weight: 800; color: var(--gold-dk); white-space: nowrap; }

.version { font-size: 11px; color: var(--muted); white-space: nowrap; }

.store-select-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.store-select {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
.store-select:focus { outline: 2px solid var(--focus); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ais-username { font-size: 13px; color: var(--muted); }

.btn-logout {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.btn-logout:hover { color: var(--text); border-color: var(--text); }

/* ── Login overlay ──────────────────────────────────────────────────────── */
.login-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.82);
  display: flex; align-items: center; justify-content: center;
  z-index: 99999;
}
.login-overlay.hidden { display: none; }
.login-box {
  background: var(--surface);
  border-radius: 12px;
  padding: 40px 32px;
  width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  display: flex; flex-direction: column; gap: 14px;
}
.login-logo { font-size: 32px; font-weight: 900; color: var(--gold-dk); text-align: center; }
.login-subtitle { font-size: 12px; color: var(--muted); text-align: center; margin-top: -6px; }
.login-error { color: #e53e3e; font-size: 13px; min-height: 16px; text-align: center; }
.login-setup-note { font-size: 12px; color: #f6ad55; margin: 0; }
.login-field { display: flex; flex-direction: column; gap: 4px; }
.login-field label { font-size: 12px; color: var(--muted); }
.login-field input {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}
.btn-login {
  padding: 10px;
  background: var(--gold-dk);
  color: #000;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn-login:hover { filter: brightness(1.1); }
.hidden { display: none !important; }

.range-presets { display: flex; gap: 4px; }

.preset-btn {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.preset-btn[data-active] {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.preset-btn:hover:not([data-active]) { background: #f1e8d8; }

.range-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.range-inputs input[type="date"] {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
}
.range-inputs input[type="date"]:focus { outline: 2px solid var(--focus); }

.range-inputs span { color: var(--muted); font-weight: 700; }

.btn-primary {
  border: none;
  border-radius: 7px;
  background: var(--gold);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
}
.btn-primary:hover { background: var(--gold-dk); }

/* ── Tab bar ─────────────────────────────────────────────────────────────── */

.tabbar {
  display: flex;
  gap: 0;
  height: var(--tabbar-h);
  background: #f3eadb;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  position: sticky;
  top: var(--topbar-h);
  z-index: 90;
}

.tab-btn {
  border: none;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  padding: 0 18px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.tab-btn.active {
  color: var(--gold-dk);
  border-bottom-color: var(--gold);
}
.tab-btn:hover:not(.active) { color: var(--text); }

/* ── Tab content ─────────────────────────────────────────────────────────── */

.tab-content { display: none; padding: 14px 16px; }
.tab-content.active { display: block; }

.tab-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.tab-title { font-size: 15px; font-weight: 800; color: var(--gold-dk); }
.tab-desc  { font-size: 12px; color: var(--muted); }

.tab-range {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.btn-csv {
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: #fff;
  color: var(--gold-dk);
  font-weight: 800;
  font-size: 12px;
  padding: 5px 11px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-csv:hover { background: var(--gold); color: #fff; }

.filter-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.filter-label input { width: 16px; height: 16px; accent-color: var(--gold); }

.group-btns { display: flex; gap: 3px; }
.group-btn {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  cursor: pointer;
}
.group-btn.active { background: var(--gold); color: #fff; border-color: var(--gold); }

/* ── Table ───────────────────────────────────────────────────────────────── */

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - var(--topbar-h) - var(--tabbar-h) - 90px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(60,44,20,.06);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f0e6d6;
  border-bottom: 2px solid var(--line);
  padding: 8px 10px;
  text-align: right;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-dk);
}
thead th:first-child { text-align: left; }

tbody tr:nth-child(even) { background: #faf6f0; }
tbody tr:hover { background: #f5eddf; }

td {
  border-bottom: 1px solid #ede4d5;
  padding: 7px 10px;
  text-align: right;
  white-space: nowrap;
}
td:first-child { text-align: left; }

.col-date { min-width: 100px; text-align: left !important; }
.col-yen  { min-width: 90px; }
.col-n    { min-width: 60px; }

tfoot td {
  font-weight: 800;
  background: #f0e6d6;
  border-top: 2px solid var(--line);
  padding: 8px 10px;
  text-align: right;
  white-space: nowrap;
  position: sticky;
  bottom: 0;
}
tfoot td:first-child { text-align: left; }

.total-row td { background: #f0e6d6; font-weight: 800; }
.total-cell   { font-weight: 800; }

/* category separator row */
.cat-row td {
  background: #f7f0e6;
  padding: 6px 10px;
  color: var(--gold-dk);
  font-size: 12px;
  text-align: left !important;
  border-bottom: 1px solid var(--line);
}

.sponsor-cell { font-size: 11px; color: var(--muted); }

.badge.sponsor {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  background: #ffe0b2;
  color: #7a4500;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
}

.empty {
  text-align: center !important;
  color: var(--muted);
  padding: 32px 16px;
  font-size: 13px;
}

/* ── Status bar ──────────────────────────────────────────────────────────── */

.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,255,255,.9);
  border-top: 1px solid var(--line);
  min-height: 28px;
}
.status-bar.ok    { color: var(--ok); }
.status-bar.error { color: var(--danger); }

/* ── Realtime dashboard ──────────────────────────────────────────────────── */

.rt-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 4px 2px 60px;
}

.rt-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
  font-size: 13px;
}

.rt-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(60,44,20,.06);
}

.rt-card-main {
  background: linear-gradient(135deg, var(--gold-dk) 0%, var(--gold) 100%);
  border-color: var(--gold);
  color: #fff;
}
.rt-card-main .rt-label { color: rgba(255,255,255,.75); }
.rt-card-main .rt-big   { color: #fff; }
.rt-card-main .rt-sub   { color: rgba(255,255,255,.8); }

.rt-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .04em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.rt-big {
  font-size: 30px;
  font-weight: 800;
  color: var(--gold-dk);
  line-height: 1.1;
  margin-bottom: 4px;
}

.rt-unit {
  font-size: 16px;
  font-weight: 600;
  margin-left: 3px;
}

.rt-sub {
  font-size: 12px;
  color: var(--muted);
}

.rt-gender {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.rt-card-tax { grid-column: span 2; }

.rt-tax-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.rt-tax-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  min-width: 42px;
}

.rt-bar-track {
  flex: 1;
  height: 10px;
  background: #f0e6d6;
  border-radius: 5px;
  overflow: hidden;
}

.rt-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 5px;
  transition: width .4s ease;
}

.rt-tax-amt {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  min-width: 90px;
  text-align: right;
}

/* ── Analysis tab ────────────────────────────────────────────────────────── */

.analysis-chart-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 20px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(60,44,20,.06);
}

.analysis-chart-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--gold-dk);
  margin-bottom: 12px;
}

#chartBox { position: relative; max-height: 420px; }
#chartBox canvas { max-height: 400px; }

.analysis-tbl-outer { padding-bottom: 60px; }
.analysis-tbl .table-wrap { max-height: 340px; margin-bottom: 0; }

.analysis-print-header { display: none; }

/* ── Print ───────────────────────────────────────────────────────────────── */

@media print {
  body.printing-analysis .topbar,
  body.printing-analysis .tabbar,
  body.printing-analysis .status-bar,
  body.printing-analysis .tab-content:not(#tab-analysis),
  body.printing-analysis #tab-analysis .tab-head { display: none !important; }

  body.printing-analysis .analysis-print-header {
    display: flex !important;
    align-items: baseline;
    gap: 12px;
    padding: 0 0 10px;
    border-bottom: 2px solid var(--gold);
    margin-bottom: 16px;
    font-size: 14px;
  }

  body.printing-analysis #tab-analysis {
    display: block !important;
    padding: 16px;
  }

  body.printing-analysis .analysis-chart-wrap {
    border: none;
    box-shadow: none;
    page-break-inside: avoid;
  }

  body.printing-analysis .analysis-tbl-outer { padding-bottom: 0; }
  body.printing-analysis .table-wrap { max-height: none !important; overflow: visible !important; }

  @page { margin: 15mm; }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

/* ── Shopify tab ──────────────────────────────────────────────────────────── */

.shopify-cards {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px 4px;
}

.shopify-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 20px;
  min-width: 160px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shopify-card-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.shopify-card-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.shopify-card.accent .shopify-card-value { color: var(--ok); }
.shopify-card.danger .shopify-card-value { color: var(--danger); }

/* ── Shopify 購入者リスト ─────────────────────────────────────────────────── */

.shopify-section {
  margin-top: 28px;
  border-top: 2px solid var(--border);
  padding-top: 16px;
  padding-bottom: 8px;
}

#shopifyCustomerTable { table-layout: fixed; width: 100%; }
#shopifyCustomerTable th:nth-child(1),
#shopifyCustomerTable td:nth-child(1) { width: 90px; }
#shopifyCustomerTable th:nth-child(2),
#shopifyCustomerTable td:nth-child(2) { width: 100px; }
#shopifyCustomerTable th:nth-child(3),
#shopifyCustomerTable td:nth-child(3) { width: 120px; }
#shopifyCustomerTable th:nth-child(4),
#shopifyCustomerTable td:nth-child(4) { width: auto; }
#shopifyCustomerTable td { white-space: normal; word-break: break-all; vertical-align: top; }

/* ── 購入者検索 チェックボックスパネル ──────────────────────────────────── */

.variant-group {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  min-width: 200px;
  max-width: 320px;
}
.variant-group-title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}
.variant-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: .82rem;
  cursor: pointer;
  padding: 2px 0;
}
.variant-label { flex: 1; color: var(--text); }
.variant-count { font-size: .75rem; color: var(--muted); white-space: nowrap; }

#purchaseListTable { table-layout: fixed; width: 100%; }
#purchaseListTable th:nth-child(1),
#purchaseListTable td:nth-child(1) { width: 90px; }
#purchaseListTable th:nth-child(2),
#purchaseListTable td:nth-child(2) { width: 130px; }
#purchaseListTable th:nth-child(3),
#purchaseListTable td:nth-child(3) { width: 110px; }
#purchaseListTable th:nth-child(4),
#purchaseListTable td:nth-child(4) { width: auto; }
#purchaseListTable td { white-space: normal; word-break: break-word; vertical-align: top; }

/* ── PayPal section ───────────────────────────────────────────────────────── */

.paypal-section {
  margin-top: 28px;
  border-top: 2px solid #009cde33;
  padding-top: 16px;
  padding-bottom: 2.5rem;
}
.paypal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.paypal-logo {
  background: #003087;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.paypal-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.pp-card {
  background: var(--panel);
  border: 1px solid #009cde44;
  border-radius: 8px;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pp-card-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}
.pp-card-val {
  font-size: 18px;
  font-weight: 800;
  color: #003087;
}
.col-mono { font-family: monospace; font-size: 11px; }
.col-ref  { font-size: 11px; color: var(--muted); max-width: 120px; word-break: break-all; }
.muted-small { font-size: 11px; color: var(--muted); }
.pp-row-usd td { background: #fffbe6; color: #7a5500; }
.pp-foreign-note {
  font-size: 11px; color: #b35c00; align-self: center;
  background: #fff3cd; border: 1px solid #f5c07a;
  border-radius: 4px; padding: 3px 8px;
}

/* ── Journal overlay ──────────────────────────────────────────────────────── */

.daily-row { cursor: pointer; }
.daily-row:hover td { background: #fdf8ef; }

.journal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  display: flex; align-items: stretch; justify-content: flex-end;
}
.journal-overlay.hidden { display: none; }

.journal-panel {
  background: #fff;
  width: min(720px, 100vw);
  height: 100vh;
  display: flex; flex-direction: column;
  box-shadow: -4px 0 32px rgba(0,0,0,.18);
  overflow: hidden;
}

.journal-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 2px solid var(--gold);
  font-size: 15px; font-weight: 800; color: var(--gold-dk);
}
.journal-close-btn {
  border: none; background: none; font-size: 18px; cursor: pointer;
  color: var(--muted); padding: 0 4px; line-height: 1;
}
.journal-close-btn:hover { color: var(--text); }

.journal-body {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}
.journal-body > * + * { margin-top: 14px; }

.j-loading, .j-empty, .j-error { color: var(--muted); text-align: center; padding: 32px; }
.j-error { color: var(--danger); }

.j-payment {
  border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden;
}
.j-payment.voided {
  border: 2px solid var(--danger);
}
.j-payment.voided .j-pay-hd {
  background: #fee2e2;
}
.j-payment.voided .j-total {
  color: var(--danger);
  text-decoration: line-through;
}

.j-pay-hd {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.j-time    { font-weight: 700; font-size: 13px; color: var(--muted); }
.j-table   { font-weight: 700; font-size: 13px; }
.j-receipt { font-size: 12px; color: var(--gold-dk); font-weight: 700; }
.j-guests  { font-size: 13px; }
.j-method  { font-size: 12px; color: var(--muted); flex: 1; }
.j-total   { font-weight: 800; color: var(--gold-dk); }
.j-pay-sub { padding: 4px 12px; font-size: 12px; color: var(--muted); }

.j-badge {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 12px;
}
.j-badge.void { background: #fee2e2; color: #dc2626; }
.j-badge.corr { background: #fef9c3; color: #854d0e; }

.j-lines {
  width: 100%; border-collapse: collapse; font-size: 13px;
  margin: 0;
}
.j-lines th, .j-lines td {
  padding: 5px 10px; border-bottom: 1px solid var(--line);
  text-align: left;
}
.j-lines thead th { background: #fafafa; font-size: 11px; color: var(--muted); }
.j-lines tbody tr:last-child td { border-bottom: none; }

.j-corr-history {
  border-top: 1px solid var(--line);
  background: #fafaf5;
  padding: 8px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.j-corr-item {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
}
.j-corr-item.void .j-corr-type { color: var(--danger); }
.j-corr-type { font-weight: 700; font-size: 11px; color: var(--ok); }
.j-corr-note { font-style: italic; }
.j-corr-item ul { margin: 2px 0 0 12px; padding: 0; list-style: disc; width: 100%; }
.j-corr-item li { margin: 1px 0; }

.j-actions {
  display: flex; gap: 8px; padding: 8px 12px;
  border-top: 1px solid var(--line); background: #fff;
}
.btn-j-void {
  border: 1px solid var(--danger); border-radius: 6px;
  background: #fff; color: var(--danger);
  padding: 5px 14px; font-size: 13px; cursor: pointer; font-weight: 600;
}
.btn-j-void:hover { background: #fee2e2; }
.btn-j-corr {
  border: 1px solid var(--gold); border-radius: 6px;
  background: #fff; color: var(--gold-dk);
  padding: 5px 14px; font-size: 13px; cursor: pointer; font-weight: 600;
}
.btn-j-corr:hover { background: var(--bg); }
.btn-secondary {
  border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--muted);
  padding: 5px 14px; font-size: 13px; cursor: pointer;
}

.j-corr-form {
  border-top: 2px solid var(--gold); background: #fffdf5; padding: 12px;
}
.j-corr-form-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.j-corr-form-note { display: flex; gap: 8px; margin: 8px 0; }

.j-new-entry { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.btn-j-entry {
  background: var(--gold-dk); color: #fff;
  border: none; border-radius: 6px;
  padding: 6px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-j-entry:hover { background: var(--gold); }

.j-entry-form {
  border: 2px solid var(--gold-dk); border-radius: 8px;
  background: #fdf8ef; padding: 14px; margin-bottom: 14px;
}
.j-entry-total {
  display: flex; align-items: center; gap: 12px;
  margin: 10px 0; font-size: 14px; padding: 8px 12px;
  background: var(--bg); border-radius: 6px;
}
.j-entry-total strong { font-size: 18px; color: var(--gold-dk); }

.sku-dropdown {
  position: absolute; top: 100%; left: 0; z-index: 2000;
  background: #fff; border: 1px solid var(--line);
  border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.15);
  min-width: 280px; max-height: 220px; overflow-y: auto;
}
.sku-drop-item {
  display: flex; gap: 8px; padding: 6px 10px;
  cursor: pointer; align-items: baseline; font-size: 13px;
}
.sku-drop-item:hover { background: var(--bg); }
.sku-drop-code { color: var(--muted); font-size: 11px; min-width: 36px; font-weight: 700; }
.sku-drop-name { flex: 1; }
.sku-drop-price { color: var(--gold-dk); font-weight: 700; white-space: nowrap; }

@media (max-width: 800px) {
  .topbar { flex-direction: column; height: auto; padding: 8px 12px; gap: 8px; }
  .topbar-right { justify-content: flex-start; }
  .tab-btn { padding: 0 10px; font-size: 13px; }
  .table-wrap { max-height: calc(100vh - 180px); }
  .shopify-card { min-width: 140px; }
}

/* ── New entry tab ────────────────────────────────────────────────────────── */

.ne-form {
  padding: 16px;
  max-width: 920px;
}

.ne-form.hidden { display: none; }

.ne-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}

.ne-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-dk);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* ── New entry calendar ──────────────────────────────────────────────────── */

.ne-cal-outer {
  padding: 14px 16px 4px;
}

.ne-cal-wrap {
  display: inline-block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 260px;
}

.ne-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-dk);
}

.ne-cal-nav {
  background: none;
  border: 1px solid var(--line);
  border-radius: 5px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ne-cal-nav:hover { background: var(--bg); color: var(--gold-dk); }

.ne-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 34px);
  gap: 2px;
}

.ne-cal-dow {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  padding: 3px 0 5px;
}

.ne-cal-day {
  text-align: center;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border-radius: 50%;
  color: var(--line);
}

.ne-cal-day.has-close {
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
  border-radius: 50%;
}
.ne-cal-day.has-close:hover { background: var(--bg); }

.ne-cal-day.today.has-close  { color: var(--focus); }
.ne-cal-day.today.no-close   { color: var(--focus); opacity: .4; }

.ne-cal-day.selected {
  background: var(--gold-dk) !important;
  color: #fff !important;
}
