/* Authenticated shop workspace and quote-ledger layer. */
[hidden] { display: none !important; }

.auth-gate,
.organization-gate {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.auth-gate-copy {
  min-height: 410px;
  padding: clamp(30px, 5vw, 64px);
  color: #f7f8f2;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-gate-copy .eyebrow { color: #d3e7b5; }
.auth-gate-copy h3,
.organization-gate h3 {
  margin: 23px 0 16px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -.055em;
}
.auth-gate-copy p,
.organization-gate p {
  max-width: 440px;
  color: #c3ccc3;
  font-size: 15px;
  line-height: 1.8;
}
.auth-promise {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 38px;
  color: var(--lime);
  font-weight: 700;
}
.auth-promise small { color: #c3ccc3; font-size: 12px; font-weight: 400; }
.auth-gate-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(24px, 4vw, 52px);
  background: #fff;
}
.clerk-mount { width: 100%; min-height: 270px; margin-top: 18px; }
.clerk-mount > * { margin-inline: auto; }
.auth-gate-panel .status-message { margin-top: 12px; }

.workspace-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 20px;
  padding: 15px 18px 15px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.78);
}
.account-label { display: grid; gap: 4px; min-width: 0; }
.account-label strong { max-width: 45vw; overflow: hidden; color: var(--ink); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.account-controls { display: flex; align-items: center; gap: 12px; }
#organization-switcher { min-width: 230px; }
#user-button { display: flex; align-items: center; justify-content: center; min-width: 42px; min-height: 42px; }
.organization-gate {
  display: block;
  padding: clamp(28px, 4vw, 50px);
  margin-bottom: 22px;
  color: #f7f8f2;
  background: var(--ink);
}
.organization-gate p { margin-bottom: 0; }
.organization-gate .eyebrow { color: #d3e7b5; }

.quote-dashboard {
  margin: 0 0 28px;
  padding: clamp(22px, 3vw, 38px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 16px 50px rgba(20,30,25,.06);
}
.dashboard-header,
.quote-list-head,
.quote-list-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.dashboard-header h3 { margin: 12px 0 8px; color: var(--ink); font-size: clamp(24px, 3vw, 34px); letter-spacing: -.045em; }
.dashboard-header p { max-width: 640px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.dashboard-period { display: grid; gap: 7px; min-width: 165px; }
.dashboard-period select,
.quote-status-select,
.price-input select {
  min-height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background-color: #fff;
  font: 600 12px var(--sans);
}
.metrics-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: 10px;
  margin: 24px 0 32px;
}
.metric-card {
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcf8;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.metric-card > .mono { color: var(--muted); font-size: 9px; letter-spacing: .12em; }
.metric-card strong { margin-top: 13px; color: var(--ink); font-size: 29px; line-height: 1; letter-spacing: -.06em; }
.metric-card small { margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.metric-card-highlight { border-color: #d6eaa9; background: #f6faed; }
.metric-card-highlight strong { color: #31553a; }
.quote-list-head { align-items: center; margin-bottom: 12px; padding-top: 4px; }
.quote-list-head h4 { margin: 6px 0 0; color: var(--ink); font-size: 20px; letter-spacing: -.035em; }
.quote-list { display: grid; gap: 8px; }
.quote-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 22px;
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  transition: border-color .18s ease, transform .18s ease;
}
.quote-item:hover { border-color: #bdc9b7; transform: translateY(-1px); }
.quote-item-main { min-width: 0; }
.quote-date { color: var(--muted); font-size: 9px; letter-spacing: .1em; }
.quote-item-main h5 { margin: 5px 0 3px; overflow: hidden; color: var(--ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.quote-item-main p { margin: 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.quote-item-main small { display: block; margin-top: 5px; color: #667161; font-size: 10px; }
.quote-item-price { display: grid; gap: 5px; justify-items: end; white-space: nowrap; }
.quote-item-price .mono { color: var(--muted); font-size: 8px; letter-spacing: .09em; }
.quote-item-price strong { color: var(--ink); font-size: 14px; }
.quote-item-actions { display: flex; align-items: center; gap: 10px; }
.quote-status-select { min-width: 98px; min-height: 36px; font-size: 11px; }
.quote-delete-button {
  border: 0;
  padding: 8px 2px;
  color: #8b4d46;
  background: transparent;
  font: 600 11px var(--sans);
  cursor: pointer;
}
.quote-delete-button:hover { color: #612d28; text-decoration: underline; }
.quote-delete-button:disabled,
.quote-status-select:disabled { opacity: .55; cursor: wait; }
.quote-empty { margin: 0; padding: 24px 14px; border: 1px dashed #ccd2c4; border-radius: 12px; color: var(--muted); font-size: 13px; line-height: 1.7; text-align: center; }
.quote-list-footer { align-items: center; margin-top: 14px; }
.quote-list-footer .status-message { margin: 0; }
.quote-list-footer .button { min-height: 39px; padding: 0 15px; font-size: 11px; }

.price-input { display: grid; grid-template-columns: minmax(150px, .95fr) minmax(0, 1.4fr); gap: 8px; margin: 8px 0 16px; }
.price-input select { min-width: 0; width: 100%; padding-right: 24px; }
.price-input input {
  width: 100%; min-width: 0; min-height: 46px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff;
  font: 700 16px var(--sans); outline: none;
}
.price-input input:focus,
.price-input select:focus,
.dashboard-period select:focus,
.quote-status-select:focus { border-color: #70815e; box-shadow: 0 0 0 3px rgba(201,243,106,.25); }
.storage-consent { margin: 13px 0 12px; align-items: flex-start; }
.storage-consent > span:last-child { max-width: 520px; color: var(--muted); font-size: 10px; line-height: 1.6; }
#save-quote-btn:disabled,
#preview-quote-btn:disabled { opacity: .48; cursor: not-allowed; }
#save-status { min-height: 17px; margin: 9px 0 0; font-size: 10px; }
.quote-disclaimer { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.6; }

@media (max-width: 980px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-item { grid-template-columns: minmax(0, 1fr) auto; }
  .quote-item-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (max-width: 720px) {
  .auth-gate { grid-template-columns: 1fr; }
  .auth-gate-copy { min-height: 290px; padding: 30px; }
  .auth-gate-copy h3 { margin-top: 16px; font-size: 34px; }
  .auth-promise { margin-top: 23px; }
  .auth-gate-panel { padding: 24px 18px; }
  .workspace-account { align-items: flex-start; flex-direction: column; }
  .account-label strong { max-width: 82vw; }
  .account-controls { width: 100%; justify-content: space-between; }
  #organization-switcher { flex: 1; min-width: 0; }
  .dashboard-header,
  .quote-list-head { align-items: flex-start; flex-direction: column; }
  .dashboard-period { width: 100%; }
  .dashboard-period select { width: 100%; }
  .metrics-grid { gap: 8px; margin: 18px 0 25px; }
  .metric-card { min-height: 112px; padding: 14px; }
  .metric-card strong { font-size: 25px; }
  .quote-item { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .quote-item-price { justify-items: start; }
  .quote-item-actions { justify-content: space-between; }
  .quote-item-main h5 { white-space: normal; }
  .quote-list-footer { align-items: flex-start; flex-direction: column; }
  .price-input { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .quote-item { transition: none; }
}
