/* Operations additions: customer directory, payment settings, and tracking details. */

/* Author display:grid/flex rules beat the UA [hidden] stylesheet without !important. */
[hidden] { display: none !important; }

.settings-card textarea {
  border: 1px solid var(--admin-line);
  background: #fff;
  padding: 12px;
  outline: 0;
  resize: vertical;
  font: inherit;
}

.settings-card textarea:focus { border-color: var(--admin-red); }

.settings-payment {
  min-width: 0;
  margin: 8px 0 0;
  padding: 20px;
  border: 1px solid var(--admin-line);
}

.settings-payment legend {
  padding: 0 8px;
  color: var(--admin-muted);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.payment-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}

.payment-settings-grid .wide { grid-column: 1 / -1; }
.payment-settings-grid textarea { min-height: 70px; }

.customer-summary {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--admin-line);
  background: #f7f3ec;
  font-size: 12px;
  line-height: 1.7;
}

.customer-summary .order-summary-head { margin-bottom: 8px; }
.customer-summary p { margin: 0; color: #5d554c; }
.customer-summary .order-items { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.customer-registration-cell strong,.customer-registration-cell small { display: block; }
.customer-registration-cell small { margin-top: 4px; color: var(--admin-muted); font-size: 10px; white-space: nowrap; }
.customer-registration-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin-top: 14px; }
.customer-registration-details span { min-width: 0; color: #5d554c; font-size: 11px; overflow-wrap: anywhere; }
.customer-registration-details b { display: block; margin-bottom: 3px; color: var(--admin-muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }

.account-page {
  width: min(1120px, calc(100% - 34px));
  margin: 54px auto 110px;
}

.account-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(330px, .9fr);
  gap: 24px;
}

.account-card {
  padding: 34px;
  border: 1px solid rgba(0, 0, 0, .1);
  background: #fff;
}

.account-card h1,
.account-card h2 { margin: 0; font-family: var(--serif); font-weight: 400; }
.account-card h1 { font-size: clamp(42px, 6vw, 70px); line-height: 1; }
.account-card h2 { font-size: 30px; }
.account-card .eyebrow { margin: 0 0 12px; }
.account-card p { color: #746d64; }
.account-tabs { display: flex; gap: 8px; margin: 28px 0; }
.account-tabs button { border: 1px solid #ddd; background: #fff; min-width: 120px; height: 42px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.account-tabs button.active { background: #201d19; border-color: #201d19; color: #fff; }
.account-form { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.account-form[hidden],
.account-shell[hidden] { display: none !important; }
.account-form label { display: flex; flex-direction: column; gap: 7px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.account-form .wide { grid-column: 1 / -1; }
.account-form input,.account-form textarea { min-height: 46px; padding: 11px; border: 1px solid #d9d4cd; background: #fff; font: inherit; }
.account-form textarea { resize: vertical; }
.account-form .check { flex-direction: row; align-items: center; text-transform: none; letter-spacing: 0; font-size: 12px; }
.account-form .check input { min-height: 18px; width: 18px; }
.account-form .button { grid-column: 1 / -1; width: 100%; }
.account-captcha {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 12px;
  align-items: end;
}
.account-captcha img {
  width: 180px;
  height: 56px;
  border: 1px solid #d9d4cd;
  background: #f7f4ef;
  object-fit: cover;
}
.account-captcha label { margin: 0; }
.account-captcha-refresh {
  height: 46px;
  padding: 0 14px;
  border: 1px solid #201d19;
  background: #fff;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}
@media (max-width: 700px) {
  .account-captcha { grid-template-columns: 1fr; }
  .account-captcha-refresh { width: 100%; }
}
.account-error { min-height: 18px; margin: 12px 0 0; color: #a22; font-size: 12px; }
.account-error.success { color: #39744d; }
.account-status { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 18px 0 25px; padding: 14px 0; border-top: 1px solid #eee; border-bottom: 1px solid #eee; font-size: 12px; }
.account-status strong { font-family: var(--serif); font-size: 18px; }
.account-logout { border: 0; background: none; color: #7f2921; text-decoration: underline; font-size: 11px; }
.account-orders { display: grid; gap: 12px; }
.account-order { display: grid; grid-template-columns: 1fr auto; gap: 18px; padding: 17px 0; border-bottom: 1px solid #eee; }
.account-order strong,.account-order small { display: block; }
.account-order small { margin-top: 4px; color: #746d64; }
.account-order a { display: inline-flex; align-items: center; justify-content: center; min-width: 112px; height: 38px; border: 1px solid #201d19; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.account-empty { padding: 30px 0; color: #746d64; }

.track-link { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; margin-top: 18px; padding: 0 16px; border: 1px solid #201d19; color: #201d19; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.track-events { margin-top: 25px; border-top: 1px solid rgba(0,0,0,.1); }
.track-event { position: relative; padding: 15px 0 15px 22px; border-bottom: 1px solid rgba(0,0,0,.08); }
.track-event:before { content: ''; position: absolute; left: 0; top: 21px; width: 8px; height: 8px; border-radius: 50%; background: #478460; }
.track-event strong,.track-event small { display: block; }
.track-event small { margin-top: 4px; color: #746d64; }
.track-payment-instructions { margin-top: 20px; padding: 15px; background: #f7f4ef; white-space: pre-line; font-size: 12px; line-height: 1.7; }

/* Customer conversations console. */
.admin-sidebar nav button { position: relative; }
.nav-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: #a2382f;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
}

.support-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: 560px; }
.support-list { border-right: 1px solid var(--admin-line); max-height: 620px; overflow-y: auto; }
.support-list-empty { margin: 0; padding: 30px 20px; color: var(--admin-muted); font-size: 12px; }
.support-list-item {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 15px 18px;
  border: 0;
  border-bottom: 1px solid var(--admin-line);
  border-left: 3px solid transparent;
  background: none;
  text-align: left;
}

.support-list-item:hover { background: #faf8f4; }
.support-list-item.active { background: #f6f1e8; border-left-color: var(--admin-gold, #c49a64); }
.support-list-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.support-list-top strong { font-size: 13px; }
.support-unread { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #a2382f; color: #fff; display: grid; place-items: center; font-size: 10px; font-style: normal; }
.support-list-preview { color: var(--admin-ink); font-size: 12px; line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.support-list-meta { color: var(--admin-muted); font-size: 10.5px; }

.support-thread { display: flex; flex-direction: column; min-height: 0; }
.support-thread-empty { margin: auto; padding: 40px; color: var(--admin-muted); font-size: 13px; }
.support-thread-body { display: flex; flex-direction: column; min-height: 0; height: 620px; }
.support-thread-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--admin-line); }
.support-thread-head strong { display: block; font-size: 14px; }
.support-thread-head small { display: block; margin-top: 3px; color: var(--admin-muted); font-size: 11px; }
.support-thread-log { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; background: #faf8f4; }

.thread-bubble { max-width: 72%; padding: 11px 14px; border-radius: 12px; }
.thread-bubble p { margin: 0; font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.thread-bubble small { display: block; margin-top: 6px; font-size: 10px; opacity: .62; }
.thread-bubble.from-customer { align-self: flex-start; background: #fff; border: 1px solid var(--admin-line); border-bottom-left-radius: 4px; }
.thread-bubble.from-admin { align-self: flex-end; background: #201c18; color: #f2ece1; border-bottom-right-radius: 4px; }

.support-reply { padding: 14px 20px 18px; border-top: 1px solid var(--admin-line); background: #fff; }
.support-reply textarea { width: 100%; border: 1px solid var(--admin-line); background: #fff; padding: 11px 13px; outline: 0; resize: vertical; font: inherit; font-size: 13px; }
.support-reply textarea:focus { border-color: var(--admin-red, #8a3a30); }
.support-reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 11px; }
.support-reply-actions .form-error { margin: 0; min-height: 0; }

@media (max-width: 1100px) {
  .support-layout { grid-template-columns: 1fr; }
  .support-list { max-height: 280px; border-right: 0; border-bottom: 1px solid var(--admin-line); }
  .support-thread-body { height: 520px; }
}

@media (max-width: 700px) {
  .payment-settings-grid,.account-shell,.account-form { grid-template-columns: 1fr; }
  .payment-settings-grid .wide,.account-form .wide { grid-column: auto; }
  .customer-registration-details { grid-template-columns: 1fr; }
  .account-page { margin-top: 30px; }
  .account-card { padding: 24px 18px; }
  .account-order { grid-template-columns: 1fr; }
}
