:root{
  --bg:#f6f8fb;
  --panel:#ffffff;
  --panel2:#f8fafc;
  --border:rgba(15,23,42,.10);
  --text:#0f172a;
  --muted:#64748b;
  --blue:#3b82f6;
  --blue2:#2563eb;
  --green:#10b981;
  --yellow:#f59e0b;
  --red:#ef4444;
  --radius:18px;
  --shadow:0 10px 30px rgba(15,23,42,.08);
}

*{box-sizing:border-box}

html,body{
  margin:0;
  background:linear-gradient(180deg,#f8fbff 0%,#f3f6fb 100%);
  color:var(--text);
  font-family:Inter,system-ui,sans-serif;
}

a{color:inherit}

.wrap{
  max-width:1280px;
  margin:0 auto;
  padding:24px 18px 42px;
}

.topbar{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  flex-wrap:wrap;
  margin-bottom:20px;
}

.brand h1{margin:0;font-size:clamp(1.5rem,2vw,2rem)}
.brand p{margin:6px 0 0;color:var(--muted)}

.nav{display:flex;gap:10px;flex-wrap:wrap}

.nav a,.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  text-decoration:none;
  cursor:pointer;
  color:var(--text);
}

.nav a.active{
  background:linear-gradient(180deg,var(--blue),var(--blue2));
  border-color:transparent;
  color:#fff;
}

.user{color:var(--muted);font-size:.92rem}

.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

.section{padding:18px}

.stats{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin-bottom:16px;
}

.stat{padding:18px}
.stat .label{color:var(--muted);font-size:.92rem;margin-bottom:8px}
.stat .value{font-size:1.4rem;font-weight:700}

.toolbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:space-between;
  align-items:center;
  margin-bottom:16px;
}

.toolbar .left,.toolbar .right{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

input,select,textarea,button{font:inherit}

input,select,textarea{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--panel2);
  color:var(--text);
}

button{cursor:pointer}

table{
  width:100%;
  border-collapse:collapse;
}

th,td{
  padding:14px 12px;
  border-top:1px solid var(--border);
  vertical-align:top;
  text-align:left;
}

th{color:var(--muted);font-size:.88rem}
.table-wrap{overflow:auto}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:.8rem;
  font-weight:700;
}

.pending{background:rgba(245,158,11,.12);color:#b45309}
.done{background:rgba(16,185,129,.12);color:#047857}
.platform{background:rgba(59,130,246,.10);color:#1d4ed8}

.muted{color:var(--muted)}
.small{font-size:.88rem}

.actions-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.btn-blue{
  background:linear-gradient(180deg,var(--blue),var(--blue2));
  border:none;
  color:#fff;
}

.btn-red{
  background:linear-gradient(180deg,#f87171,#ef4444);
  border:none;
  color:#fff;
}

.btn-green{
  background:linear-gradient(180deg,#34d399,#10b981);
  border:none;
  color:#fff;
}

.btn-ghost{background:#fff}

.page-title{margin:0 0 8px}
.page-copy{margin:0;color:var(--muted)}
.stack{display:grid;gap:16px}

.account-box{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background:#f8fafc;
}

.grid-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

pre{
  margin:0;
  padding:14px;
  border-radius:14px;
  overflow:auto;
  background:#f8fafc;
  border:1px solid var(--border);
  white-space:pre-wrap;
}

.helper{font-size:.88rem;color:var(--muted)}

.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.28);
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:9999;
}

.modal-backdrop.open{display:flex}

.modal{
  width:min(860px,100%);
  max-height:90vh;
  overflow:auto;
  background:#fff;
  border:1px solid var(--border);
  border-radius:22px;
  box-shadow:0 24px 80px rgba(15,23,42,.18);
  padding:20px;
}

.modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
}

.icon-btn{
  width:42px;
  height:42px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  cursor:pointer;
}

.hidden{display:none}

.progress-track{
  width:100%;
  background:#e5e7eb;
  border-radius:999px;
  height:20px;
  overflow:hidden;
}

.progress-fill{
  width:0%;
  height:20px;
  border-radius:999px;
  background:linear-gradient(180deg,var(--blue),var(--blue2));
  transition:width .3s ease;
}

/* ================= LOGIN ================= */

.login-body{
  margin:0;
  min-height:100vh;
  display:grid;
  place-items:center;
  background:linear-gradient(180deg,#f8fbff 0%,#f3f6fb 100%);
  color:#0f172a;
  font-family:Inter,system-ui,sans-serif;
}

.login-card{
  width:min(92vw,430px);
  padding:24px;
  border-radius:18px;
  background:#ffffff;
  border:1px solid rgba(15,23,42,.10);
  box-shadow:0 10px 30px rgba(15,23,42,.08);
}

.login-card h1{margin:0 0 8px}
.login-card p{margin:0 0 16px;color:#64748b}

.login-card input,.login-card button{
  width:100%;
  padding:12px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.10);
  background:#f8fafc;
  color:#0f172a;
  font:inherit;
  box-sizing:border-box;
}

.login-card button{
  border:none;
  background:linear-gradient(180deg,#3b82f6,#2563eb);
  cursor:pointer;
  margin-top:4px;
  color:#fff;
}

.login-card button:disabled{opacity:.7;cursor:wait}

.turnstile-mount {
  margin: 12px 0;
  min-height: 65px;
}

.login-turnstile {
  display: flex;
  justify-content: center;
}

.err{margin-top:12px;color:#ef4444;font-size:.92rem;min-height:20px;white-space:pre-wrap}
.ok{color:#16a34a}

/* ================= HEADER ================= */

/* ================= HEADER ================= */

.ops-header{
  position:sticky;
  top:0;
  z-index:1000;
  background:rgba(255,255,255,0.94);
  backdrop-filter:blur(18px);
  border-bottom:1px solid #e5e7eb;
}

.ops-header-inner{
  max-width:1280px;
  margin:0 auto;
  padding:12px 18px;
  display:grid;
  grid-template-columns:auto 1fr auto auto;
  align-items:center;
  gap:14px;
}

.ops-brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  min-width:0;
}

.ops-brand-logo{
  width:52px;
  height:52px;
  object-fit:contain;
  display:block;
  flex:0 0 auto;
}

.ops-brand-copy{
  display:grid;
  gap:1px;
  min-width:0;
}

.ops-brand-title{
  font-size:17px;
  font-weight:950;
  letter-spacing:-0.03em;
  color:#0f172a;
  white-space:nowrap;
}

.ops-brand-ops{
  background:linear-gradient(135deg,#2563eb,#60a5fa);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
}

.ops-brand-subtitle{
  font-size:11px;
  color:#64748b;
  font-weight:800;
  white-space:nowrap;
}

.ops-mobile-toggle{
  display:none;
  width:42px;
  height:42px;
  border-radius:13px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:4px;
}

.ops-mobile-toggle span {
  width: 20px;
  height: 2px;            /* thinner */
  border-radius: 999px;
  background: #0f172a;
  display: block;
  transition: all 0.2s ease;
}

.ops-nav{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  overflow-x:auto;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}

.ops-nav::-webkit-scrollbar{
  display:none;
}

.ops-nav a{
  text-decoration:none;
  padding:9px 11px;
  border-radius:12px;
  color:var(--muted);
  font-weight:900;
  font-size:13px;
  white-space:nowrap;
  flex:0 0 auto;
}

.ops-nav a.active,
.ops-nav a:hover{
  background:#eff6ff;
  color:#2563eb;
}

.ops-header-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-width:150px;
  max-width:210px;
  padding:8px 11px;
  border:1px solid var(--border);
  border-radius:999px;
  background:#f8fafc;
  color:var(--muted);
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}

.ops-status-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background:#64748b;
  flex:0 0 auto;
}

.ops-header-status.processing .ops-status-dot{
  background:#f59e0b;
}

.ops-header-status.up-to-date .ops-status-dot{
  background:#22c55e;
}

.ops-header-status.error .ops-status-dot{
  background:#ef4444;
}

.ops-user{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:9px;
  min-width:0;
}

.ops-user-email{
  max-width:170px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}

.ops-logout{
  padding:8px 11px;
  border-radius:11px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  font-size:12px;
  font-weight:900;
}

/* iPad / half-screen */
@media (max-width:1120px){
  .ops-header-inner{
    grid-template-columns:auto 1fr auto;
    grid-template-areas:
      "brand nav user"
      "status status status";
    gap:8px 12px;
  }

  .ops-brand{grid-area:brand}
  .ops-nav{grid-area:nav}
  .ops-user{grid-area:user}
  .ops-header-status{
    grid-area:status;
    width:100%;
    max-width:none;
  }

  .ops-user-email{
    max-width:120px;
  }
}

/* compact tablet */
@media (max-width:860px){
  .ops-header-inner{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    padding:10px 12px;
  }

  .ops-brand{
    flex:1 1 auto;
  }

  .ops-brand-logo{
    width:46px;
    height:46px;
  }

  .ops-brand-title{
    font-size:16px;
  }

  .ops-brand-subtitle{
    display:none;
  }

  .ops-mobile-toggle{
    display:inline-flex;
    order:2;
  }

  .ops-nav{
    order:5;
    display:none;
    width:100%;
    flex-direction:column;
    overflow:visible;
    gap:7px;
    padding:8px 0 2px;
  }

  .ops-nav.open{
    display:flex;
  }

  .ops-nav a{
    width:100%;
    padding:12px 13px;
    background:#f8fafc;
    border:1px solid var(--border);
  }

  .ops-header-status{
    order:3;
    flex:1 1 100%;
    width:100%;
    max-width:none;
  }

  .ops-user{
    order:4;
    width:100%;
    justify-content:space-between;
    border-top:1px solid #e5e7eb;
    padding-top:8px;
  }

  .ops-user-email{
    max-width:65vw;
  }
}

/* small mobile */
@media (max-width:520px){
  .ops-header-inner{
    padding:9px 10px;
  }

  .ops-brand-logo{
    width:42px;
    height:42px;
  }

  .ops-brand-title{
    font-size:15px;
  }

  .ops-mobile-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px; /* ← THIS FIXES STACKING */
}

  .ops-header-status{
    font-size:11px;
    padding:8px 10px;
  }

  .ops-logout{
    padding:8px 10px;
  }
}
/* ================= RESPONSIVE ================= */

@media (max-width:900px){
  .stats{grid-template-columns:1fr 1fr}
  .grid-2{grid-template-columns:1fr}
}

@media (max-width:820px){
  .ops-header-inner{
    flex-wrap:wrap;
    gap:10px;
    padding:10px 12px;
  }

  .ops-brand-logo{
    width:48px;
    height:48px;
  }

  .ops-mobile-toggle{
    display:inline-flex;
  }

  .ops-nav{
    display:none;
    width:100%;
    flex-direction:column;
    padding-top:10px;
  }

  .ops-nav.open{
    display:flex;
  }

  .ops-nav a{
    width:100%;
    padding:12px;
    background:#f8fafc;
  }

  .ops-header-status{
    order:4;
    width:100%;
    max-width:none;
    justify-content:center;
    margin-left:0;
  }

  .ops-user{
    width:100%;
    justify-content:space-between;
    border-top:1px solid #e5e7eb;
    padding-top:8px;
  }
}

@media (max-width:640px){
  .stats{grid-template-columns:1fr}
}
/* QUEUE STATS ACCORDION */

.queue-stats-card {
  padding: 0;
  overflow: hidden;
  margin-bottom: 14px;
}

.queue-stats-toggle {
  list-style: none;
  cursor: pointer;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.queue-stats-toggle::-webkit-details-marker {
  display: none;
}

.queue-stats-left strong {
  display: block;
  font-size: 15px;
  color: #0f172a;
}

.queue-stats-left span {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
}

/* RIGHT SIDE BUTTON (same feel on desktop + mobile) */
.queue-stats-pill {
  font-size: 12px;
  font-weight: 800;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}

/* GRID */
.queue-stats-grid {
  padding: 0 16px 16px;
}

/* HOVER (desktop polish) */
@media (hover: hover) {
  .queue-stats-toggle:hover {
    background: #f8fafc;
  }
}
.client-actions-component {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.client-package-select {
  min-width: 160px;
  font-size: 13px;
  font-weight: 800;
  background: #f8fafc;
}

.client-action-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: 160ms ease;
  background: #fff;
}

.client-action-btn.copy {
  color: #2563eb;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.client-action-btn.copy:hover {
  transform: translateY(-1px);
  background: #dbeafe;
}

.client-action-btn.danger {
  color: #b42318;
  background: #fef3f2;
  border-color: #fecdca;
}

.client-action-btn.danger:hover {
  transform: translateY(-1px);
  background: #fee4e2;
}


/* ================= CLIENTS PAGE POLISH ================= */

.client-package-select {
  min-height: 38px;
  border-radius: 12px;
}

.client-actions-component {
  display: grid;
  gap: 8px;
  min-width: 120px;
}

.client-action-btn {
  min-height: 38px;
  border-radius: 12px;
}

.client-note-empty {
  font-size: 12px;
}

/* Cleaner auto-order panel */
.auto-order-box {
  gap: 12px;
  min-width: 300px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
}

.auto-order-box > .inline-check:first-child {
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.auto-order-grid {
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  gap: 8px;
}

.auto-order-grid label span {
  white-space: nowrap;
}

.auto-order-grid input {
  min-height: 36px;
  border-radius: 10px;
  text-align: center;
  font-weight: 750;
}

.auto-order-service-row {
  gap: 8px;
}

.auto-order-service-row .inline-check {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  background: #fff;
}

.auto-order-box .btn-small {
  min-height: 36px;
  border-radius: 12px;
}

/* Better clients table density on desktop */
@media (min-width: 821px) {
  #clientsBody td {
    vertical-align: top;
  }

  #clientsBody td[data-label="Client"] {
    min-width: 170px;
  }

  #clientsBody td[data-label="Accounts"] {
    min-width: 230px;
  }

  #clientsBody td[data-label="Auto Order"] {
    min-width: 335px;
  }
}

/* Mobile clients card view */
@media (max-width: 820px) {
  .ops-main {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero {
    padding: 20px 0 8px;
  }

  .hero h1 {
    font-size: clamp(34px, 11vw, 46px);
    letter-spacing: -0.06em;
  }

  .hero p {
    font-size: 14px;
    line-height: 1.45;
  }

  .card.section {
    padding: 14px;
    border-radius: 22px;
  }

  .toolbar {
    gap: 10px;
  }

  .toolbar .left {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .toolbar .right input,
  .toolbar .left .btn {
    min-height: 44px;
    border-radius: 14px;
  }

  .auto-order-kill-panel {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
  }

  .auto-order-kill-panel .btn {
    width: 100%;
  }

  #clientsBody tr {
    position: relative;
    display: grid;
    gap: 0;
    margin-bottom: 16px;
    padding: 0;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  }

  #clientsBody td {
    padding: 13px 14px;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
  }

  #clientsBody td:first-child {
    border-top: 0;
    padding: 16px 14px;
    background:
      radial-gradient(circle at 95% 0%, rgba(59, 130, 246, 0.12), transparent 36%),
      linear-gradient(180deg, #f8fafc, #ffffff);
  }

  #clientsBody td:first-child strong {
    display: block;
    font-size: 18px;
    letter-spacing: -0.035em;
    margin-bottom: 4px;
  }

  #clientsBody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 8px;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  #clientsBody td[data-label="Client"]::before {
    display: none;
  }

  #clientsBody td[data-label="Notes"] {
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
  }

  .mini-card {
    padding: 11px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid rgba(226, 232, 240, 0.95);
  }

  .mini-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
  }

  .chip {
    display: inline-flex;
    margin-top: 2px;
  }

  .client-package-select {
    width: 100%;
    min-height: 44px;
    border-radius: 14px;
    font-weight: 800;
  }

  .auto-order-box {
    width: 100%;
    min-width: 0;
    padding: 13px;
    border-radius: 18px;
    background: #f8fafc;
  }

  .auto-order-box > .inline-check:first-child {
    font-size: 14px;
  }

  .auto-order-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .auto-order-grid label {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .auto-order-grid input {
    min-height: 42px;
    font-size: 15px;
  }

  .auto-order-service-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .auto-order-service-row .inline-check {
    justify-content: center;
    width: 100%;
    padding: 9px 8px;
  }

  .auto-order-box .btn-small {
    width: 100%;
    min-height: 42px;
    font-size: 13px;
  }

  .client-actions-component {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .client-action-btn {
    width: 100%;
    min-height: 44px;
  }
}

@media (max-width: 420px) {
  .toolbar .left {
    grid-template-columns: 1fr;
  }

  .auto-order-service-row {
    grid-template-columns: 1fr;
  }

  .client-actions-component {
    grid-template-columns: 1fr;
  }
}



/* ================= CLIENTS AUTO-ORDER ACCORDION FIX ================= */

#clientsBody td[data-label="Auto Order"] {
  min-width: 300px;
}

#clientsBody td[data-label="Auto Order"] .auto-order-box.auto-order-accordion {
  width: min(100%, 360px);
  min-width: 0;
  max-width: 360px;
  padding: 0;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.auto-order-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 11px 13px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  background:
    radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.10), transparent 35%),
    linear-gradient(180deg, #f8fafc, #ffffff);
}

.auto-order-summary::-webkit-details-marker {
  display: none;
}

.auto-order-summary strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: -0.025em;
}

.auto-order-summary em {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  line-height: 1;
  font-style: normal;
  font-weight: 750;
}

.auto-order-summary::after {
  content: "Edit";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #2563eb;
  background: rgba(59, 130, 246, 0.10);
  border: 1px solid rgba(59, 130, 246, 0.20);
  font-size: 12px;
  font-weight: 850;
}

.auto-order-accordion[open] .auto-order-summary {
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.auto-order-accordion[open] .auto-order-summary::after {
  content: "Close";
}

.auto-order-box .auto-order-master {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  margin: 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  font-size: 13px;
  font-weight: 800;
}

.auto-order-box .auto-order-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 13px 8px;
}

.auto-order-box .auto-order-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #334155;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.auto-order-box .auto-order-grid input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 7px;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 850;
}

.auto-order-box .auto-order-service-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding: 8px 13px;
  border-top: 1px solid rgba(226, 232, 240, 0.75);
}

.auto-order-box .auto-order-service-row .inline-check {
  justify-content: center;
  min-height: 34px;
  padding: 7px 8px;
  margin: 0;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.24);
  font-size: 12px;
  font-weight: 800;
}

.auto-order-box .btn-small {
  width: calc(100% - 26px);
  min-height: 38px;
  margin: 2px 13px 13px;
  border-radius: 12px;
}

@media (min-width: 821px) {
  #clientsBody td[data-label="Auto Order"] {
    width: 380px;
  }

  #clientsBody td[data-label="Actions"] {
    width: 140px;
  }
}

@media (max-width: 820px) {
  #clientsBody td[data-label="Auto Order"] .auto-order-box.auto-order-accordion {
    width: 100%;
    max-width: none;
  }

  .auto-order-summary {
    min-height: 54px;
    padding: 13px 14px;
  }

  .auto-order-summary strong {
    font-size: 16px;
  }

  .auto-order-summary em {
    font-size: 12px;
  }

  .auto-order-box .auto-order-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 13px;
    gap: 10px;
  }

  .auto-order-box .auto-order-grid input {
    min-height: 42px;
    font-size: 16px;
  }

  .auto-order-box .auto-order-service-row {
    padding: 10px 13px;
    gap: 8px;
  }

  .auto-order-box .auto-order-service-row .inline-check {
    min-height: 42px;
    font-size: 14px;
  }

  .auto-order-box .btn-small {
    min-height: 44px;
    font-size: 14px;
  }
}

@media (max-width: 420px) {
  .auto-order-box .auto-order-service-row {
    grid-template-columns: 1fr;
  }
}



/* ================= CLIENTS MOBILE + NAV FIX ================= */

/* Restore mobile hamburger / sandwich button */
.nav-toggle,
.menu-toggle,
.mobile-menu-toggle,
.hamburger,
button[aria-label="Menu"],
button[aria-label="Open menu"] {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  z-index: 120;
}

.nav-toggle svg,
.menu-toggle svg,
.mobile-menu-toggle svg,
.hamburger svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* Clients desktop sizing cleanup */
@media (min-width: 821px) {
  #clientsBody td[data-label="Auto Order"] {
    width: 360px;
    min-width: 360px;
    max-width: 380px;
  }

  #clientsBody td[data-label="Actions"] {
    width: 140px;
    min-width: 140px;
  }

  #clientsBody td[data-label="Accounts"] {
    min-width: 260px;
  }

  #clientsBody .auto-order-box.auto-order-accordion {
    width: 100%;
    max-width: 360px;
  }
}

/* Client page mobile cards */
@media (max-width: 820px) {
  body {
    overflow-x: hidden;
  }

  .ops-shell,
  .ops-main,
  main,
  .card,
  .table-wrap,
  .table-responsive {
    max-width: 100%;
  }

  .ops-main {
    padding-left: 12px;
    padding-right: 12px;
  }

  .card.section {
    padding: 12px;
    border-radius: 22px;
    overflow: visible;
  }

  .table-wrap,
  .table-responsive {
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    width: 100%;
  }

  /* Take the clients table out of CSS table layout so the
     display:grid/block rules below actually apply instead of being
     wrapped into a single anonymous table cell. */
  table.clients-table {
    display: block;
  }

  table.clients-table thead {
    display: none;
  }

  #clientsBody {
    display: grid;
    gap: 16px;
  }

  #clientsBody tr {
    display: grid;
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
  }

  #clientsBody td {
    display: block;
    width: 100%;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 13px 14px;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    overflow-wrap: anywhere;
  }

  #clientsBody td:first-child {
    border-top: 0;
    padding: 18px 14px;
    background:
      radial-gradient(circle at 95% 0%, rgba(59, 130, 246, 0.13), transparent 34%),
      linear-gradient(180deg, #f8fafc, #fff);
  }

  #clientsBody td[data-label="Client"] strong {
    display: block;
    font-size: 22px;
    line-height: 1.05;
    letter-spacing: -0.055em;
    margin-bottom: 8px;
  }

  #clientsBody td[data-label="Package"] select,
  #clientsBody td[data-label="Package"] .client-package-select {
    width: 100%;
    max-width: 100%;
    min-height: 46px;
  }

  #clientsBody td[data-label="Accounts"] {
    font-size: 15px;
    line-height: 1.3;
  }

  #clientsBody td[data-label="Accounts"] strong,
  #clientsBody td[data-label="Accounts"] b {
    font-size: 16px;
    line-height: 1.15;
  }

  #clientsBody td[data-label="Notes"] {
    font-size: 14px;
    color: #475569;
  }

  #clientsBody td[data-label="Auto Order"] {
    padding: 14px;
  }

  #clientsBody td[data-label="Actions"] {
    padding: 14px;
    background: #f8fafc;
  }

  .client-actions-component {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }

  .client-actions-component .btn,
  .client-action-btn {
    width: 100%;
    min-height: 46px;
    border-radius: 14px;
  }

  /* Auto-order accordion mobile sizing */
  #clientsBody .auto-order-box.auto-order-accordion {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: 18px;
    overflow: hidden;
  }

  .auto-order-summary {
    width: 100%;
    min-height: 58px;
    padding: 14px;
  }

  .auto-order-summary strong {
    font-size: 18px;
    line-height: 1.05;
  }

  .auto-order-summary em {
    font-size: 12px;
  }

  .auto-order-summary::after {
    min-width: 72px;
    min-height: 36px;
    font-size: 13px;
  }

  .auto-order-box .auto-order-master {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    font-size: 15px;
  }

  .auto-order-box .auto-order-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px;
  }

  .auto-order-box .auto-order-grid label {
    min-width: 0;
    font-size: 10px;
    letter-spacing: 0.065em;
  }

  .auto-order-box .auto-order-grid input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 8px;
    font-size: 16px;
    border-radius: 13px;
    text-align: center;
  }

  .auto-order-box .auto-order-service-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 14px;
  }

  .auto-order-box .auto-order-service-row .inline-check {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    justify-content: center;
    padding: 8px;
    border-radius: 999px;
    font-size: 14px;
  }

  .auto-order-box .btn-small {
    width: calc(100% - 28px);
    margin: 0 14px 14px;
    min-height: 46px;
    border-radius: 14px;
    font-size: 15px;
  }
}

@media (max-width: 430px) {
  .ops-main {
    padding-left: 8px;
    padding-right: 8px;
  }

  .card.section {
    padding: 8px;
  }

  #clientsBody tr {
    border-radius: 20px;
  }

  #clientsBody td {
    padding-left: 12px;
    padding-right: 12px;
  }

  .auto-order-box .auto-order-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
  }

  .auto-order-box .auto-order-service-row {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .client-actions-component {
    grid-template-columns: 1fr;
  }
}


/* ================= PRICING / PAID FLOW ================= */

.paid-flow-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(59,130,246,.16), transparent 34%),
    radial-gradient(circle at top right, rgba(16,185,129,.10), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
  color: var(--text);
}

.paid-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 64px;
}

.paid-hero {
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: center;
}

.paid-eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  padding: 7px 12px;
  border: 1px solid rgba(59,130,246,.18);
  border-radius: 999px;
  background: rgba(59,130,246,.08);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.paid-hero h1 {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  line-height: .96;
  letter-spacing: -.06em;
}

.paid-hero p {
  max-width: 660px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  margin-top: 34px;
}

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100%;
  padding: 22px;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 24px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 18px 60px rgba(15,23,42,.08);
}

.pricing-card.featured {
  border-color: rgba(37,99,235,.42);
  box-shadow:
    0 22px 70px rgba(37,99,235,.16),
    0 0 0 1px rgba(37,99,235,.08) inset;
  transform: translateY(-8px);
}

.popular-pill {
  width: max-content;
  margin-bottom: 14px;
  padding: 7px 11px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--blue), var(--blue2));
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pricing-name {
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 900;
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 12px;
  color: #0f172a;
  font-size: 2.35rem;
  font-weight: 950;
  letter-spacing: -.05em;
}

.pricing-price span {
  color: var(--muted);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: 0;
}

.pricing-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.pricing-card ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pricing-card li {
  position: relative;
  padding-left: 22px;
  color: #334155;
  font-size: .95rem;
  line-height: 1.45;
}

.pricing-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
}

.pricing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--blue), var(--blue2));
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(37,99,235,.22);
}

.pricing-btn:hover {
  filter: brightness(.98);
  transform: translateY(-1px);
}

.paid-note-card {
  max-width: 820px;
  margin: 22px auto 0;
  padding: 20px 22px;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 22px;
  background: rgba(255,255,255,.84);
  box-shadow: 0 14px 46px rgba(15,23,42,.06);
}

.paid-note-card strong {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
  font-size: 1rem;
}

.paid-note-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 1080px) {
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pricing-card.featured {
    transform: none;
  }
}

@media (max-width: 640px) {
  .paid-shell {
    width: min(100% - 24px, 1180px);
    padding: 34px 0 44px;
  }

  .paid-hero {
    text-align: left;
  }

  .paid-hero h1 {
    font-size: clamp(2.1rem, 13vw, 3.25rem);
  }

  .paid-hero p {
    font-size: 1rem;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .pricing-card {
    padding: 20px;
    border-radius: 22px;
  }

  .pricing-price {
    font-size: 2.1rem;
  }
}

