/* Nexgen Stitches — app shell (login, dashboard, admin) */

:root {
  --app-bg: #f4f6f8;
  --app-surface: #ffffff;
  --app-text: #1a1d21;
  --app-muted: #5c6570;
  --app-brand: #0f3d2e;
  --app-brand-2: #1a6b52;
  --app-accent: #e85d2a;
  --app-border: #e2e6ea;
  --app-radius: 14px;
  --app-shadow: 0 8px 30px rgba(15, 61, 46, 0.08);
  --app-font: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.app-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--app-font);
  color: var(--app-text);
  background: var(--app-bg);
  -webkit-font-smoothing: antialiased;
}

/* ----- Auth (login) ----- */
.app-body--auth {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(15, 61, 46, 0.15), transparent),
    linear-gradient(160deg, #eef2f0 0%, #f4f6f8 40%, #e8ece9 100%);
}

.auth-wrap {
  width: 100%;
  max-width: 420px;
}

.signup-wrap--premium {
  max-width: 720px;
}

.signup-form--premium {
  gap: 1.15rem;
}

.signup-sub {
  margin-top: -0.35rem;
  margin-bottom: 1.35rem;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.signup-card--premium {
  position: relative;
  padding: 2.15rem 2.25rem 1.85rem;
  box-shadow:
    0 4px 6px rgba(15, 61, 46, 0.04),
    0 22px 50px rgba(15, 61, 46, 0.1);
  border: 1px solid rgba(226, 230, 234, 0.95);
}

.signup-card--premium::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--app-radius) var(--app-radius) 0 0;
  background: linear-gradient(90deg, var(--app-brand) 0%, var(--app-brand-2) 45%, var(--app-accent) 100%);
}

.field-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--app-muted);
  line-height: 1.4;
}

.field-error {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #b42318;
}

.signup-tel-hint {
  margin-top: 0.25rem;
}

.signup-tel-error:not([hidden]) {
  margin-top: 0.35rem;
}

.signup-tel-wrap {
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: #fafbfc;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  overflow: visible;
}

.signup-tel-wrap:focus-within {
  border-color: var(--app-brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 61, 46, 0.12);
}

.signup-tel-wrap .iti {
  width: 100%;
  display: block;
}

.signup-tel-wrap .iti input.iti__tel-input,
.signup-tel-wrap .iti input.iti__tel-input[type="tel"],
.signup-tel-wrap .iti input.iti__tel-input[type="text"] {
  width: 100%;
  border: none;
  background: transparent;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  padding-right: 0.75rem;
  font: inherit;
  font-size: 1rem;
  color: var(--app-text);
  border-radius: 10px;
}

.signup-tel-wrap .iti input.iti__tel-input::placeholder {
  color: rgba(92, 101, 112, 0.65);
}

.signup-tel-wrap .iti__selected-country {
  border-radius: 9px 0 0 9px;
}

.signup-tel-wrap .iti__selected-dial-code {
  color: var(--app-muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.signup-tel-wrap .iti__dropdown-content {
  z-index: 30;
  border-radius: 10px;
  border-color: var(--app-border);
  box-shadow: 0 12px 40px rgba(15, 61, 46, 0.14);
}

.signup-tel-wrap .iti__country-list {
  border-radius: 0 0 10px 10px;
}

.signup-tel-wrap.signup-tel--invalid {
  border-color: #f04438;
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.15);
}

.auth-card {
  background: var(--app-surface);
  border-radius: var(--app-radius);
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: var(--app-shadow);
  border: 1px solid var(--app-border);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.auth-card[data-animate]:hover {
  box-shadow: 0 12px 40px rgba(15, 61, 46, 0.12);
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.auth-logo img {
  height: 44px;
  width: auto;
}

.auth-title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}

.auth-sub {
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  color: var(--app-muted);
  text-align: center;
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Must follow .auth-form: same specificity was losing to flex and forced a single column */
.auth-form.signup-form--grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  align-items: start;
}

.auth-form.signup-form--grid > .signup-field,
.auth-form.signup-form--grid > .signup-field--full {
  min-width: 0;
}

.auth-form.signup-form--grid > .signup-field--full {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .auth-form.signup-form--grid {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--app-muted);
}

.field__control {
  display: flex;
  align-items: center;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: #fafbfc;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field__control:focus-within {
  border-color: var(--app-brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 61, 46, 0.12);
}

.field__control--icon {
  padding-left: 0.65rem;
  gap: 0.5rem;
}

.field__control--icon > i {
  color: var(--app-muted);
  font-size: 0.95rem;
}

.field__control input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.85rem 0.75rem 0.85rem 0;
  font: inherit;
  font-size: 1rem;
  min-width: 0;
}

.field__control input:focus {
  outline: none;
}

.field__control--password input {
  padding-right: 0.25rem;
}

.pwd-toggle {
  border: none;
  background: transparent;
  color: var(--app-muted);
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.pwd-toggle:hover {
  color: var(--app-brand);
  background: rgba(15, 61, 46, 0.06);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s, background 0.2s;
}

.btn--primary {
  background: linear-gradient(135deg, var(--app-brand) 0%, var(--app-brand-2) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(15, 61, 46, 0.25);
  min-height: 48px;
  padding-inline: 1.15rem;
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(15, 61, 46, 0.3);
}

.btn--primary:focus-visible {
  outline: 3px solid rgba(15, 61, 46, 0.35);
  outline-offset: 2px;
}

.btn--primary.is-busy {
  pointer-events: none;
  opacity: 0.92;
}

.btn__spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* `hidden` must win over .btn__spinner’s display, or the spinner shows on load */
.btn__text[hidden],
.btn__spinner[hidden] {
  display: none !important;
}

.btn--block {
  width: 100%;
}

.btn--lg {
  padding: 0.95rem 1.25rem;
  font-size: 1.05rem;
  min-height: 52px;
}

.auth-footer {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.9rem;
}

.auth-footer a {
  color: var(--app-brand);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-hint {
  margin: 1.25rem 0 0;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--app-muted);
  text-align: center;
  background: rgba(15, 61, 46, 0.04);
  border-radius: 10px;
  border: 1px solid var(--app-border);
}

.auth-hint a {
  color: var(--app-brand);
  font-weight: 600;
  text-decoration: none;
}

.auth-hint a:hover {
  text-decoration: underline;
}

.auth-admin-switch {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--app-muted);
}

.auth-admin-switch a {
  color: var(--app-brand);
  font-weight: 600;
  text-decoration: none;
}

.auth-admin-switch a:hover {
  text-decoration: underline;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.alert--error {
  background: rgba(200, 50, 50, 0.1);
  color: #8b1c1c;
  border: 1px solid rgba(200, 50, 50, 0.2);
}

.alert--success {
  background: rgba(15, 61, 46, 0.1);
  color: #0f3d2e;
  border: 1px solid rgba(15, 61, 46, 0.2);
}

.alert--info {
  background: rgba(30, 90, 200, 0.08);
  color: #1a3d8a;
  border: 1px solid rgba(30, 90, 200, 0.15);
}

/* ----- Dashboard ----- */
.app-body--dash {
  margin: 0;
}

.dash-shell {
  display: flex;
  min-height: 100vh;
}

.dash-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0f3d2e 0%, #0a2a20 100%);
  color: #e8f0ec;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: transform 0.28s ease;
  z-index: 40;
}

.dash-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 1rem 1.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dash-brand img {
  height: 44px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: brightness(1.1);
}

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0.75rem;
  flex: 1;
}

.dash-nav__link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.dash-nav__link i {
  width: 1.1rem;
  opacity: 0.9;
}

.dash-nav__link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.dash-nav__link.is-active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.dash-nav__link--admin {
  margin-top: 0.5rem;
  border: 1px dashed rgba(255, 255, 255, 0.25);
}

.dash-sidebar__foot {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
}

.dash-user {
  display: block;
  opacity: 0.85;
  margin-bottom: 0.5rem;
  word-break: break-all;
}

.dash-logout {
  color: #ffb4a0;
  text-decoration: none;
  font-weight: 600;
}

.dash-logout:hover {
  text-decoration: underline;
}

.dash-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dash-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.dash-nav-toggle {
  display: none;
  border: 1px solid var(--app-border);
  background: #fff;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 1.1rem;
}

.dash-page-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.dash-content {
  padding: 1.25rem;
  flex: 1;
}

.dash-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  padding: 1.5rem 1.25rem;
  background: var(--app-surface);
  border-radius: var(--app-radius);
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow);
  margin-bottom: 1.25rem;
}

.dash-hero__icon {
  font-size: 3rem;
  color: var(--app-brand);
  line-height: 1;
}

.dash-welcome {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.dash-welcome__sub {
  margin: 0.25rem 0 0;
  color: var(--app-muted);
  font-size: 0.95rem;
}

.dash-hero .btn--pulse {
  margin-left: auto;
}

.btn--pulse {
  animation: pulseSoft 2.5s ease-in-out infinite;
}

@keyframes pulseSoft {
  0%,
  100% {
    box-shadow: 0 4px 14px rgba(232, 93, 42, 0.35);
  }
  50% {
    box-shadow: 0 6px 24px rgba(232, 93, 42, 0.45);
  }
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dash-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 1.35rem 1rem;
  border-radius: var(--app-radius);
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  text-align: center;
  min-height: 120px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.15);
}

.dash-tile__icon {
  font-size: 1.75rem;
  opacity: 0.95;
}

.dash-tile--green {
  background: linear-gradient(145deg, #2d8a5c, #1e6b45);
}

.dash-tile--orange {
  background: linear-gradient(145deg, #e85d2a, #c94a1f);
}

.dash-tile--blue {
  background: linear-gradient(145deg, #2a7cc8, #1f5fa0);
}

.dash-tile--muted {
  background: linear-gradient(145deg, #5c6570, #3d444c);
}

.dash-tile--teal {
  background: linear-gradient(145deg, #1a9e90, #0d6b62);
}

.dash-tile--indigo {
  background: linear-gradient(145deg, #5b4dc9, #3d2fa3);
}

.dash-tile__hint {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.92;
  line-height: 1.3;
  max-width: 12rem;
}

.dash-home__welcome {
  margin-bottom: 1.5rem;
}

.dash-home__title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.dash-home__sub {
  margin: 0;
  color: var(--app-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.dash-grid--home {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.dash-breadcrumb {
  font-size: 0.88rem;
  color: var(--app-muted);
  margin: 0 0 1rem;
}

.dash-breadcrumb a {
  color: var(--app-brand);
  font-weight: 600;
  text-decoration: none;
}

.dash-breadcrumb a:hover {
  text-decoration: underline;
}

.dash-breadcrumb__sep {
  margin: 0 0.35rem;
  opacity: 0.6;
}

.send-order {
  max-width: 720px;
}

.send-order__head {
  background: linear-gradient(135deg, #e85d2a 0%, #c94a1f 100%);
  color: #fff;
  padding: 1.25rem 1.5rem;
  border-radius: var(--app-radius) var(--app-radius) 0 0;
  margin: 0;
}

.send-order__title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.send-order__lead {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.95;
  line-height: 1.4;
}

.send-order__form {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-top: none;
  border-radius: 0 0 var(--app-radius) var(--app-radius);
  padding: 1.5rem;
  box-shadow: var(--app-shadow);
}

.send-order__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}

.so-field--full {
  grid-column: 1 / -1;
}

.so-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.so-field__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--app-muted);
}

.so-req {
  color: #c94a1f;
}

.so-input,
.so-textarea,
.so-file {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  font: inherit;
  font-size: 0.95rem;
  background: #fafbfc;
}

.so-input:focus,
.so-textarea:focus {
  outline: none;
  border-color: var(--app-brand);
  box-shadow: 0 0 0 3px rgba(15, 61, 46, 0.12);
  background: #fff;
}

.so-textarea {
  resize: vertical;
  min-height: 120px;
}

.so-hint {
  font-size: 0.82rem;
  color: var(--app-muted);
  line-height: 1.45;
  margin: 0;
}

.so-fieldset {
  border: 1px dashed var(--app-border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin: 0;
}

.so-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.so-radios label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  cursor: pointer;
}

.so-attachments .so-file-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.65rem;
}

.so-file-row__lbl {
  font-size: 0.78rem;
  color: var(--app-muted);
}

.so-attachments .so-file-row.so-file-row--keep {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--app-border);
}

.so-file-row--keep input[type="checkbox"] {
  width: auto;
  flex-shrink: 0;
}

.so-file-row__link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--app-brand);
  margin-left: auto;
}

.so-upload-note {
  font-size: 0.85rem;
  color: var(--app-muted);
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--app-border);
}

.so-upload-note a {
  color: var(--app-brand);
  font-weight: 600;
}

.send-order__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* Full-screen place order (logged-in) */
.dash-body--place-order .dash-main {
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dash-body--place-order .dash-content {
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.place-order-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: calc(100vh - 3.5rem);
  background: linear-gradient(165deg, #e8f0ec 0%, #f2f5f4 35%, #e5ebe8 100%);
}

.place-order-page__crumb {
  padding: 0.95rem clamp(1rem, 3vw, 2rem);
  margin: 0;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15, 61, 46, 0.1);
}

.send-order--full {
  flex: 1;
  max-width: none;
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.send-order--full .send-order__head {
  border-radius: 0;
  padding: clamp(1.35rem, 3vw, 2rem) clamp(1rem, 4vw, 3rem);
  box-shadow: 0 6px 28px rgba(201, 74, 31, 0.2);
}

.send-order--full .send-order__title {
  font-size: clamp(1.4rem, 2.8vw, 1.85rem);
  letter-spacing: -0.02em;
}

.send-order--full .send-order__lead {
  font-size: clamp(0.9rem, 1.5vw, 1.02rem);
  max-width: 52rem;
}

.send-order--full .send-order__form {
  flex: 1;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: clamp(1.35rem, 3.5vw, 2.25rem) clamp(1rem, 4vw, 3rem) clamp(2rem, 5vw, 3.5rem);
  max-width: min(1120px, 100%);
  margin: 0 auto;
  width: 100%;
  background: rgba(255, 255, 255, 0.97);
}

.send-order--full .send-order__grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.35rem 1.5rem;
}

.send-order--full .so-input,
.send-order--full .so-textarea,
.send-order--full .so-file {
  min-height: 48px;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.send-order--full .so-textarea {
  min-height: 150px;
}

.send-order--full .send-order__actions {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--app-border);
  gap: 1rem;
}

.send-order--full .btn--primary {
  min-width: 200px;
  padding-inline: 1.75rem;
}

.btn--ghost {
  background: #fff;
  color: #b02a2a;
  border: 2px solid #e8a0a0;
  box-shadow: none;
}

.btn--ghost:hover {
  background: #fff5f5;
  transform: translateY(-1px);
}

.app-panel--flush {
  padding-top: 0;
}

.app-panel {
  background: var(--app-surface);
  border-radius: var(--app-radius);
  border: 1px solid var(--app-border);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.app-heading {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.app-heading--sub {
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.app-lead {
  color: var(--app-muted);
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--app-border);
}

.data-table th {
  font-weight: 600;
  color: var(--app-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table__empty {
  text-align: center;
  color: var(--app-muted);
  padding: 1.5rem !important;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(15, 61, 46, 0.1);
  color: var(--app-brand);
}

/* Payment / invoice status — light, readable on white backgrounds */
.badge--paid {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge--unpaid {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid rgba(251, 191, 36, 0.45);
}

.badge--void {
  background: #f4f4f5;
  color: #71717a;
  border: 1px solid #e4e4e7;
}

/* Legacy: orange tint — prefer --paid / --unpaid in templates */
.badge--pay {
  background: rgba(232, 93, 42, 0.12);
  color: #b54a1a;
}

/* ----- Admin orders — inline status / payment selects ----- */
.admin-order-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.6rem;
  align-items: center;
  margin: 0;
}

.admin-order-inline-form__btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 61, 46, 0.1);
}

.admin-mini-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 0.42rem 1.85rem 0.42rem 0.65rem;
  margin: 0;
  border-radius: 8px;
  border: 1px solid var(--app-border);
  cursor: pointer;
  min-width: 6.75rem;
  max-width: 11rem;
  color: var(--app-text);
  background-color: #fafbfc;
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  background-size: 0.65rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.admin-mini-select:hover {
  filter: brightness(0.99);
}

.admin-mini-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(15, 61, 46, 0.2);
}

.admin-mini-select[data-admin-select="order-status"][data-theme="pending"] {
  background-color: #fffbeb;
  color: #a16207;
  border-color: rgba(251, 191, 36, 0.5);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a16207' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.admin-mini-select[data-admin-select="order-status"][data-theme="progress"] {
  background-color: #eff6ff;
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.45);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231d4ed8' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.admin-mini-select[data-admin-select="order-status"][data-theme="completed"] {
  background-color: #ecfdf5;
  color: #047857;
  border-color: rgba(16, 185, 129, 0.4);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23047857' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.admin-mini-select[data-admin-select="payment-status"][data-theme="unpaid"] {
  background-color: #fffbeb;
  color: #b45309;
  border-color: rgba(251, 191, 36, 0.45);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23b45309' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.admin-mini-select[data-admin-select="payment-status"][data-theme="paid"] {
  background-color: #ecfdf5;
  color: #047857;
  border-color: rgba(16, 185, 129, 0.35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23047857' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* ----- Admin sign-in (admin/login.php) ----- */
.app-body--auth-admin {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 100% 80% at 50% -30%, rgba(16, 185, 129, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 50%, rgba(251, 191, 36, 0.08), transparent),
    linear-gradient(165deg, #0c1222 0%, #141b2e 38%, #0f1f1a 72%, #0a1628 100%);
}

.app-body--auth-admin::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.auth-wrap--admin {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
}

.auth-card--admin {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 20px;
  padding: 2.25rem 2rem 2rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 48px rgba(0, 0, 0, 0.45),
    0 0 80px rgba(16, 185, 129, 0.06);
}

.auth-card--admin::before {
  content: "";
  display: block;
  height: 3px;
  margin: -2.25rem -2rem 1.75rem;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, #34d399, #10b981 40%, #fbbf24 100%);
}

.auth-admin-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 auto 1rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-admin-eyebrow i {
  color: #34d399;
  font-size: 0.85rem;
}

.app-body--auth-admin .auth-logo img {
  height: 48px;
  filter: brightness(1.15) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.app-body--auth-admin .auth-title {
  color: #f8fafc;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.app-body--auth-admin .auth-sub {
  color: rgba(226, 232, 240, 0.75);
  margin-bottom: 1.65rem;
}

.app-body--auth-admin .field__label {
  color: rgba(203, 213, 225, 0.9);
}

.app-body--auth-admin .field__control {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(255, 255, 255, 0.12);
}

.app-body--auth-admin .field__control:focus-within {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(15, 23, 42, 0.65);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.app-body--auth-admin .field__control--icon > i {
  color: rgba(148, 163, 184, 0.95);
}

.app-body--auth-admin .field__control input {
  color: #f1f5f9;
}

.app-body--auth-admin .field__control input::placeholder {
  color: rgba(148, 163, 184, 0.65);
}

.app-body--auth-admin .pwd-toggle {
  color: rgba(148, 163, 184, 0.95);
}

.app-body--auth-admin .pwd-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.app-body--auth-admin .btn--primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 45%, #0d9488 100%);
  box-shadow: 0 4px 24px rgba(16, 185, 129, 0.35);
}

.app-body--auth-admin .btn--primary:hover {
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.45);
}

.app-body--auth-admin .btn--primary:focus-visible {
  outline-color: rgba(52, 211, 153, 0.5);
}

.app-body--auth-admin .alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.app-body--auth-admin .alert--success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.35);
  color: #a7f3d0;
}

.app-body--auth-admin .auth-hint {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(203, 213, 225, 0.9);
}

.app-body--auth-admin .auth-hint a {
  color: #6ee7b7;
}

.app-body--auth-admin .auth-footer a {
  color: #94a3b8;
}

.app-body--auth-admin .auth-footer a:hover {
  color: #e2e8f0;
}

.app-body--auth-admin .auth-admin-switch {
  color: rgba(148, 163, 184, 0.95);
}

.app-body--auth-admin .auth-admin-switch a {
  color: #6ee7b7;
}

.app-body--auth-admin .auth-admin-switch a:hover {
  text-decoration: underline;
}

.stack-form .field {
  margin-bottom: 1rem;
}

.input {
  width: 100%;
  max-width: 400px;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  font: inherit;
}

.input:focus {
  outline: none;
  border-color: var(--app-brand);
  box-shadow: 0 0 0 3px rgba(15, 61, 46, 0.12);
}

/* Admin */
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.admin-toolbar form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.admin-user-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
  margin: 0;
}

.admin-user-form__id {
  font-weight: 700;
  color: var(--app-muted);
  font-size: 0.85rem;
  min-width: 2.5rem;
}

.admin-user-form label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--app-muted);
}

.admin-user-form .so-input,
.admin-user-form select.so-input {
  min-width: 0;
  font-size: 0.9rem;
}

.admin-user-form__email {
  flex: 1 1 12rem;
  min-width: 10rem;
}

.admin-user-form__name {
  flex: 1 1 8rem;
  min-width: 6rem;
}

.admin-user-form__phone {
  flex: 0 1 7rem;
}

.admin-user-form__role {
  flex: 0 1 7.5rem;
}

.admin-user-form__pass {
  flex: 0 1 8rem;
}

.admin-user-form__save {
  flex: 0 0 auto;
}

.admin-toolbar input[type="search"],
.admin-toolbar input[type="text"],
.admin-toolbar input[type="number"],
.admin-toolbar select {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  font: inherit;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-stat {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: 1rem 1.15rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.admin-stat__val {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--app-brand);
  letter-spacing: -0.03em;
}

.admin-stat__lbl {
  font-size: 0.82rem;
  color: var(--app-muted);
  margin-top: 0.25rem;
}

.admin-nav-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-nav-card {
  display: block;
  padding: 1.15rem;
  border-radius: var(--app-radius);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.admin-nav-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--app-shadow);
}

.admin-nav-card small {
  display: block;
  font-weight: 400;
  color: var(--app-muted);
  margin-top: 0.35rem;
  font-size: 0.85rem;
}

/* Mobile sidebar */
@media (max-width: 900px) {
  .dash-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }

  .dash-sidebar.is-open {
    transform: translateX(0);
  }

  .dash-nav-toggle {
    display: inline-flex;
  }

  .dash-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .dash-hero .btn--pulse {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }

  .send-order__grid {
    grid-template-columns: 1fr;
  }

  .send-order--full .send-order__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem 1.25rem;
  }

  .dash-content {
    padding: 1rem;
  }
}
