/*
 * KOrder styles · public/css/06d-admin-members-coupons.css
 * Admin: members, coupons, tablet language picker, marketing SMS, order filter / summary.
 *
 * public/css/*.css used to be one public/styles.css. The files are cut from it in order
 * and index.html loads them in that same order, which is the CSS cascade order: do not
 * reorder the <link> tags, and add a rule to the file that owns its screen.
 * Map: public/css/README.md
 */

.admin-member-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-member-list,
.admin-order-list,
.sms-history {
  display: grid;
  gap: 8px;
}

.admin-member-list {
  max-height: 560px;
  overflow: auto;
  padding-right: 2px;
}

.admin-member-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.admin-member-row > input {
  margin-top: 5px;
}

.admin-member-body {
  min-width: 0;
}

.admin-member-top,
.admin-order-main,
.admin-selected-box,
.sms-log-row > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.admin-member-top strong,
.admin-order-title strong {
  font-size: 17px;
}

.admin-member-meta,
.admin-member-stats,
.admin-order-detail,
.sms-log-row span {
  color: var(--muted);
  font-size: 13px;
}

.sms-log-row span.sms-log-warn {
  color: var(--coral);
  font-weight: 800;
}

.admin-member-meta {
  margin-top: 4px;
}

.admin-member-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.admin-member-stats span,
.admin-order-point {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f3f0e9;
  font-weight: 800;
}

/* Customers tab rows only (the shared rules above also serve orders / SMS rows):
   name + store badge together on the left, tier badge on the right; chips centred
   so text and buttons sit on one line; the button chips keep one width so the
   chips after them start at the same place on every row. */
.admin-member-row .admin-member-top {
  align-items: center;
  justify-content: flex-start;
}

.admin-member-row .admin-member-top > .status-pill:last-child {
  margin-left: auto;
}

.admin-member-row .admin-member-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}

.admin-member-row .admin-member-stats {
  align-items: center;
}

.admin-member-row .admin-member-stats span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-member-row .admin-member-stats span:nth-child(1):has(button) {
  min-width: 120px;
}

.admin-member-row .admin-member-stats span:nth-child(2):has(button) {
  min-width: 230px;
}

.admin-member-coupons {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.admin-coupon-form {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-radius: 12px;
  background: #f8f6f0;
}

.admin-coupon-form label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
}

/* Tablet language picker — only visible when a store uploaded another language. */
.tablet-lang {
  position: relative;
}

.tablet-lang-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.tablet-lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 2px;
  min-width: 160px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.tablet-lang-option {
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
}

.tablet-lang-option.active {
  background: var(--brand, #0c8278);
  color: #fff;
}

.coupon-report-row {
  display: block;
}

/* Coupon builder — office portal only. */
.coupon-template-row {
  grid-template-columns: minmax(0, 1fr);
  cursor: default;
}

.coupon-template-row.inactive {
  opacity: 0.62;
}

.admin-member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.admin-coupon-builder {
  margin: 4px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf7;
}

.admin-coupon-weekdays {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.admin-coupon-weekday-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-weight: 600;
}

.admin-coupon-weekday-row .inline-label {
  grid-auto-flow: column;
  align-items: center;
  gap: 6px;
}

/* Coupon build / edit form only (.inline-label is shared with other screens):
   checkbox + text on one line, one checkbox size, and the row as tall as the
   inputs beside it and aligned to their bottom so both columns line up. */
.admin-coupon-builder > .inline-label,
.coupon-issue-form > .inline-label,
.admin-coupon-weekday-row .inline-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  cursor: pointer;
}

/* Coupon issue form uses the same checkbox row (2026-11-17: it was left on the
   shared grid, so the box sat above its text). 42px = the select beside it. */
.admin-coupon-builder > .inline-label,
.coupon-issue-form > .inline-label {
  align-self: end;
  min-height: 40px;
}

.coupon-issue-form > .inline-label {
  min-height: 42px;
}

/* The hint line runs under the whole form, not squeezed into the last grid cell. */
.coupon-issue-form > .admin-hint {
  grid-column: 1 / -1;
}

.admin-coupon-builder .inline-label input[type="checkbox"],
.coupon-issue-form > .inline-label input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal);
}

.admin-coupon-weekday-row .inline-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.admin-coupon-builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.coupon-issue-form {
  margin-top: 12px;
}

.admin-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.crm-coupon-terms {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.75;
}

.crm-coupon-card button {
  margin-top: 10px;
  width: 100%;
}

.inline-label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
}

.admin-member-coupon-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #f8f6f0;
  font-size: 13px;
}

.admin-member-coupon-line.inactive {
  opacity: 0.55;
}

.crm-coupon-card.inactive {
  opacity: 0.55;
}

.admin-marketing-form {
  margin-bottom: 14px;
}

.admin-selected-box {
  padding: 11px 12px;
  border: 1px dashed rgba(8, 127, 117, 0.34);
  border-radius: var(--radius);
  background: rgba(8, 127, 117, 0.06);
}

.admin-selected-box > div {
  display: grid;
  gap: 3px;
}

.admin-selected-box span {
  color: var(--muted);
  font-size: 13px;
}

.sms-history h3 {
  margin: 0;
  font-size: 16px;
}

.sms-log-row {
  display: grid;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.sms-log-row p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.admin-order-filter {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 150px 150px 170px auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

/* Order change log: 2 dates + manager (the 6-column order filter left the first
   date 892px wide and the others 150px). */
@media (min-width: 981px) {
  .admin-order-filter.order-change-filter {
    grid-template-columns: minmax(150px, 200px) minmax(150px, 200px) minmax(200px, 320px);
  }
}

.admin-order-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.admin-order-summary div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.admin-order-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-order-summary strong {
  font-size: 20px;
}
