/* My Kits: compact dashboard panels in both AncestralGenome themes. */
:root {
  --bg: #13181c;
  --bg3: #191e23;
  --surface-inset: #13181c;
  --text: #e9e9e9;
  --text-soft: #d4d7da;
  --text-muted: #bec3c7;
  --ord-2nd: #bec3c7;
  --text-dim: #a6adb3;
  --card-border: #0e1416;
  --accent: #4a9db5;
  --accent-hover: #3d8ca3;
  --accent-dim: #263d46;
  --accent-text: #83c6d7;
  --success: #7ac8a8;
  --warning: #e6bc79;
  --info: #8ac3e5;
  --danger: #ed8791;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { min-height: 100vh; color-scheme: dark; background: var(--bg); color: var(--text); font: 500 13px/1.5 'Montserrat', sans-serif; }
body.theme-light {
  color-scheme: light;
  --bg: #fbf9f9;
  --bg3: #fff;
  --surface-inset: #fbf9f9;
  --text: #2d2d2d;
  --text-soft: #42474b;
  --text-muted: #666;
  --ord-2nd: #666;
  --text-dim: #777;
  --card-border: #efefef;
  --accent-dim: #edf5f7;
  --accent-text: #34788a;
  --success: #228565;
  --warning: #906019;
  --info: #34708f;
  --danger: #b94c59;
}
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled, .disabled, .btn-disabled { opacity: .5; pointer-events: none; }

/* Flush top bar: full width, hairline underneath, active link underlined like the panel tabs. */
nav { position: sticky; top: 0; z-index: 200; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 60px; margin: 0; padding: 0 32px; color: var(--text); background: var(--bg3); border: 0; border-bottom: 1px solid var(--card-border); border-radius: 0; box-shadow: none; }
.nav-left, .nav-right { display: flex; align-items: center; gap: 22px; min-width: 0; }
.nav-logo { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; font: 800 18px/1.2 'Outfit', sans-serif; text-decoration: none; background: linear-gradient(120deg,#fff 0%,#4ecde0 50%,#d8c7a1 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav-logo::before { display: none; }
body.theme-light .nav-logo { background-image: linear-gradient(120deg,#20b4cc 0%,#4ecde0 50%,#bbae8d 100%); }
.nav-links { display: flex; align-items: stretch; align-self: stretch; gap: 0; padding-left: 28px; border: 0; }
.nav-links a { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--text-muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.nav-links a::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: var(--accent); opacity: 0; transition: opacity .15s; }
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current] { color: var(--text); }
.nav-links a[aria-current]::after { opacity: 1; }
.nav-links svg { display: none; }
.nav-user { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
/* Plain switch: track + sliding knob, no icons. Knob right = dark, left = light. */
.theme-toggle { position: relative; display: inline-flex; width: 46px; height: 26px; padding: 0; flex-shrink: 0; background: var(--accent); border: 0; border-radius: 999px; transition: background .18s; }
.theme-toggle::before { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transform: translateX(20px); transition: transform .18s; }
.theme-toggle svg { display: none; }
body.theme-light .theme-toggle { background: var(--card-border); }
body.theme-light .theme-toggle::before { transform: translateX(0); }
.btn-sm { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 6px 12px; color: var(--text-muted); background: transparent; border: 1px solid var(--card-border); border-radius: 8px; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn-sm:hover { color: var(--accent-text); border-color: var(--accent); }
#btn-dots { display: none; width: 32px; height: 32px; border: 0; border-radius: 8px; color: var(--text); background: transparent; font-size: 22px; }
#dots-menu { position: fixed; top: 68px; right: 20px; z-index: 500; width: min(280px,calc(100vw - 32px)); padding: 16px; border: 1px solid var(--card-border); border-radius: 12px; background: var(--bg3); box-shadow: 0 8px 24px #00000018; }
#dots-email { margin-bottom: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
#dots-menu .btn-sm { width: 100%; }

/* Two panels, kits wider than the store; flat panels with a single accent rule under the header. */
.page { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; gap: 22px; width: min(1220px,calc(100% - 64px)); margin: 32px auto 48px; }
.store-panel, .kits-panel { display: flex; flex-direction: column; min-width: 0; height: 500px; padding: 0; background: var(--bg3); border: 1px solid var(--card-border); border-radius: 12px; box-shadow: 0 1px 6px #00000008; overflow: hidden; }
body.theme-light .store-panel, body.theme-light .kits-panel { box-shadow: 0 0 5px #0000000d; }
.kits-head { flex-shrink: 0; padding: 20px 24px 0; }
.kits-head-col { display: flex; flex-direction: column; align-items: stretch; }
.panel-heading { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; margin-bottom: 14px; }
.panel-heading > svg { display: none; }
/* Tabs, top-bar links and column heads in Outfit (the brand display face); everything else stays Montserrat. */
.kits-tab, .nav-links a, .orders-table th { font-family: 'Outfit', 'Montserrat', sans-serif; }
.kits-title { position: relative; padding-left: 14px; font-size: 16px; font-weight: 700; line-height: 1.35; letter-spacing: 0; }
.kits-title::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: var(--accent); }
.panel-upload { margin-left: auto; }
.panel-upload svg { width: 18px; height: 18px; flex-shrink: 0; }
/* Underline tabs sitting on the header rule, subtitle to the right of them. */
.kits-tabs { display: flex; align-items: flex-end; gap: 4px; max-width: 100%; padding: 0; margin: 0; background: transparent; border-radius: 0; }
.kits-tab { position: relative; min-height: 36px; padding: 6px 4px 12px; margin-right: 18px; background: transparent; border: 0; border-radius: 0; color: var(--text-muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.45; transition: color .15s; }
.kits-tab::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 4px; border-radius: 999px; background: var(--accent); opacity: 0; transition: opacity .15s; }
.kits-tab:hover { color: var(--text); }
.kits-tab.active { color: var(--text); }
.kits-tab.active::after { opacity: 1; }
.kits-sub { order: 3; margin: 0; padding: 12px 24px 0; color: var(--text-dim); font-size: 12px; font-weight: 500; line-height: 1.5; text-align: left; }
.kits-head-col::after { content: ''; order: 2; display: block; height: 1px; margin: 0 -24px; background: var(--card-border); }
.kits-head-col .kits-sub { margin: 0 -24px; }
.kits-list, .store-list { flex: 1; min-height: 0; margin-top: 6px; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--card-border) transparent; border: 0; border-radius: 0; background: transparent; }
.kits-list { display: flex; flex-direction: column; }
.orders-table { width: 100%; table-layout: fixed; border-spacing: 0; border-collapse: separate; font-size: 13px; }
.orders-table th { position: sticky; top: 0; z-index: 2; padding: 10px 24px 8px; text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); background: var(--bg3); border-bottom: 1px solid var(--card-border); }
.orders-table td { padding: 15px 24px; vertical-align: middle; color: var(--text-soft); border-bottom: 1px solid var(--card-border); }
.orders-table tbody tr:hover td { background: var(--surface-inset); }
.orders-table tbody tr:last-child td { border-bottom: 0; }
.orders-table th:last-child, .orders-table td:last-child { width: 196px; }
.order-name { font-size: 13px; font-weight: 600; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.order-meta { margin-top: 3px; font-size: 12px; font-weight: 500; color: var(--ord-2nd); line-height: 1.5; overflow-wrap: anywhere; }
.order-id { white-space: nowrap; }
.order-context { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.order-date { color: var(--ord-2nd); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Status as a dot + label instead of a tinted pill. */
.status-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 0; border-radius: 0; font-size: 11px; font-weight: 600; line-height: 1.4; }
.status-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-pill.success { color: var(--success); }
.status-pill.warning { color: var(--warning); }
.status-pill.info { color: var(--info); }
.status-pill.pending { color: var(--text-muted); }
.tbl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tbl-actions:has(> .order-action) { flex-wrap: nowrap; gap: 8px; }
.store-cta, .btn, .tbl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; max-width: 100%; border: 1px solid var(--card-border); border-radius: 8px; color: var(--text-soft); background: transparent; font-weight: 600; text-decoration: none; line-height: 1.4; text-align: center; transition: background .15s,border-color .15s; }
.btn, .store-cta { min-height: 36px; padding: 8px 14px; font-size: 13px; }
.tbl-btn { min-height: 28px; padding: 4px 9px; font-size: 11.5px; white-space: normal; }
/* Same gradient button as the live login page (--auth-button-background in auth-layout.css). */
.btn-primary, .tbl-btn.primary, .store-cta { color: #fff; background: linear-gradient(135deg, #20b4cc 0%, #1fa8bf 55%, #c97a45 100%); border: 0; border-radius: 10px; box-shadow: none; transition: filter .2s ease; }
.btn-primary, .store-cta { padding: 9px 15px; }
.tbl-btn.primary { padding: 5px 10px; }
.btn-primary:hover, .tbl-btn.primary:hover, .store-cta:hover { background: linear-gradient(135deg, #20b4cc 0%, #1fa8bf 55%, #c97a45 100%); filter: brightness(.94); }
body.theme-light .btn-primary, body.theme-light .tbl-btn.primary, body.theme-light .store-cta { background: var(--accent); transition: background .2s ease; }
body.theme-light .btn-primary:hover, body.theme-light .tbl-btn.primary:hover, body.theme-light .store-cta:hover { background: var(--accent-hover); filter: none; }
.btn-ghost:hover, .tbl-btn:not(.primary):hover { color: var(--accent-text); background: var(--accent-dim); border-color: var(--accent); }
.tbl-btn.danger { color: var(--danger); border-color: color-mix(in srgb,var(--danger) 30%,transparent); }
.tbl-btn.order-action { flex: 0 0 66px; width: 66px; height: 32px; min-height: 32px; padding: 4px 6px; border-radius: 8px; font-size: 11.5px; line-height: 1.2; white-space: nowrap; }
/* Store as a list of rows (name + price left, CTA right) rather than boxed cards. */
.store-list { display: flex; flex-direction: column; gap: 0; padding: 0; }
.store-card { display: flex; flex-direction: row; align-items: center; gap: 16px; padding: 18px 24px; background: transparent; border: 0; border-bottom: 1px solid var(--card-border); border-radius: 0; }
.store-card:last-child { border-bottom: 0; }
.store-main { min-width: 0; flex: 1; }
.store-service { color: var(--text); font-size: 14px; font-weight: 700; line-height: 1.4; }
.store-price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.store-price { font-size: 18px; font-weight: 700; color: var(--accent-text); letter-spacing: -.01em; }
.store-old-price { font-size: 12px; font-weight: 500; color: var(--text-dim); text-decoration: line-through; }
.store-cta { flex-shrink: 0; width: 176px; height: 36px; padding: 0 15px; white-space: nowrap; }
.store-cta svg { width: 15px; height: 15px; flex-shrink: 0; }
#free-traits-prog { margin-top: 7px; color: var(--text-muted); font-size: 12px; font-weight: 500; line-height: 1.5; }
.kit-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.empty, .loading-state { display: flex; flex-direction: column; flex: 1; align-items: center; justify-content: center; min-height: 210px; padding: 28px 24px; text-align: center; color: var(--text-muted); }
.empty-title { margin-bottom: 18px; color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.5; }
.empty-sub { margin: 0 0 20px; max-width: 340px; font-size: 13px; font-weight: 500; line-height: 1.6; }
.empty-icon { margin-bottom: 12px; font-size: 24px; }
.loading-spinner { width: 28px; height: 28px; margin-bottom: 14px; border: 2px solid var(--accent-dim); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Reveal pickers float outside the scrolling list while remaining in their row. */
#reveal-list .orders-table th:nth-child(2), #reveal-list .orders-table td:nth-child(2) { width: 128px; }
#reveal-list .orders-table th:last-child, #reveal-list .orders-table td:last-child { width: 128px; }
.era-multi { position: relative; display: inline-block; max-width: 100%; text-align: left; }
.era-multi .mix-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; padding: 6px 8px; color: var(--text); background: var(--bg3); border: 1px solid var(--card-border); border-radius: 8px; font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.era-multi .mix-trigger:hover { border-color: var(--accent); }
.era-multi .chev { width: 10px; height: 6px; flex-shrink: 0; color: var(--text-muted); transition: transform .15s; }
.era-multi.open .chev { transform: rotate(180deg); }
.era-multi .mix-panel { display: none; position: fixed; width: 176px; z-index: 300; padding: 5px; background: var(--bg3); border: 1px solid var(--card-border); border-radius: 10px; box-shadow: 0 8px 24px #0000001f; }
.era-multi.open .mix-panel { display: block; }
.era-multi .mix-list { max-height: 240px; overflow-y: auto; }
.era-multi .mix-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; padding: 7px 8px; color: var(--text-soft); border-radius: 5px; font-size: 12px; font-weight: 500; cursor: pointer; }
.era-multi .mix-item:hover { background: var(--surface-inset); }
.era-multi .mix-item.sel { font-weight: 600; }
.era-multi .check { width: 14px; height: 14px; flex-shrink: 0; opacity: 0; color: var(--accent-text); }
.era-multi .sel .check { opacity: 1; }
@media (max-width: 1100px) {
  nav { gap: 16px; padding: 0 20px; }
  .nav-left, .nav-right { gap: 16px; }
  .nav-links { padding-left: 16px; }
  .nav-links a { padding: 0 10px; }
  .nav-links a::after { left: 10px; right: 10px; }
  .nav-user { max-width: 160px; }
  .page { width: calc(100% - 40px); gap: 20px; }
  .kits-head { padding: 18px 18px 0; }
  .kits-head-col .kits-sub { margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
  .orders-table td, .orders-table th { padding-right: 18px; padding-left: 18px; }
  .orders-table th:last-child, .orders-table td:last-child { width: 176px; }
  .store-card { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 1024px) {
  .page { grid-template-columns: minmax(0,1fr); width: min(700px,calc(100% - 40px)); margin-top: 24px; }
  .nav-links a:not([aria-current]) { display: none; }
  .store-panel, .kits-panel { height: 480px; }
}
@media (max-width: 720px) {
  nav { top: 0; min-height: 54px; margin: 0; padding: 0 14px; gap: 8px; border-radius: 0; }
  .nav-logo { font-size: 16px; gap: 6px; }
  .nav-logo::before { width: 23px; height: 23px; flex-basis: 23px; }
  .nav-links, .nav-user, #btn-signout { display: none; }
  .nav-right { gap: 10px; }
  #btn-dots { display: inline-flex; align-items: center; justify-content: center; }
  #dots-menu { top: 62px; right: 12px; }
  .page { width: calc(100% - 28px); gap: 20px; margin-top: 22px; margin-bottom: 32px; }
  .store-panel, .kits-panel { height: auto; border-radius: 12px; }
  .kits-head { padding: 16px 16px 0; }
  .kits-head-col .kits-sub { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .panel-heading { gap: 8px; }
  .kits-title { font-size: 15px; }
  .panel-upload { min-height: 34px; padding: 7px 10px; font-size: 12px; }
  .kits-tab { min-height: 36px; padding: 6px 2px 12px; margin-right: 14px; }
  .kits-list { max-height: 490px; min-height: 220px; }
  .store-list { max-height: none; }
  .store-card { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; }
  .store-cta { width: 100%; }
  .orders-table th { display: none; }
  .orders-table tbody tr { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-bottom: 1px solid var(--card-border); }
  .orders-table tbody tr:hover td { background: transparent; }
  .orders-table tbody tr:last-child { border-bottom: 0; }
  .orders-table tbody td, .orders-table tbody td:last-child { width: 100%; padding: 0; border: 0; }
  .tbl-btn { min-height: 32px; flex: 1 1 auto; padding: 6px 10px; font-size: 12px; }
  #reveal-list .orders-table tbody td:nth-child(2), #reveal-list .orders-table tbody td:last-child { width: 100%; }
  .empty, .loading-state { min-height: 220px; padding: 24px 14px; }
  .empty .kit-actions, .empty .btn { width: 100%; }
  .era-multi .mix-trigger { min-height: 36px; }
  .era-multi .mix-item { min-height: 40px; }
}
@media (max-width: 360px) {
  .nav-logo { font-size: 14px; }
  .nav-logo::before { width: 21px; height: 21px; flex-basis: 21px; }
  .nav-right { gap: 5px; }
  .theme-toggle { width: 42px; }
  .theme-toggle::before { transform: translateX(16px); }
  .kits-head { padding: 14px 14px 0; }
  .kits-head-col .kits-sub { margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
  .store-card, .orders-table tbody tr { padding-left: 14px; padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .loading-spinner { animation-duration: 2s; }
}
