/* JM's POS Cloud admin website — the Control Center look, plus what a website needs
   (sign-in, phones, live status). Loaded after the POS stylesheet. */

body.cc { --brand: #4f46e5; --brand-dark: #4338ca; --brand-deep: #3730a3; --brand-light: #e0e7ff; --brand-glow: rgba(79, 70, 229, .25); }
body.cc .brand-mark, body.cc .login-logo { background: linear-gradient(140deg, #818cf8, #4338ca); }
body.cc .nav-item.active { box-shadow: 0 4px 14px rgba(79, 70, 229, .34); }
body.cc .nav-item.active::before { background: #a5b4fc; }
body.web #shell { height: 100vh; height: 100dvh; }
a.btn { text-decoration: none; }  /* "Open shop" on a web shop's page is a link styled as a button */
body.web #login { background: linear-gradient(140deg, #3730a3 0%, #101a2b 58%, #1e1b4b 100%); }
body.web #login::before {
  background: radial-gradient(circle at 16% 20%, rgba(129, 140, 248, .28), transparent 44%),
              radial-gradient(circle at 84% 80%, rgba(45, 212, 191, .16), transparent 48%);
}
.login-error { margin: -2px 0 14px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--danger-light);
  color: #991b1b; font-size: 13px; line-height: 1.45; }
.login-error[hidden] { display: none; }
.login-hint code { font-family: var(--mono); font-size: 11px; word-break: break-all; }
.login-card { max-width: calc(100vw - 32px); }
label.field[hidden] { display: none; }

/* --- the Control Center pieces ----------------------------------------------------------- */
.cc-key { font-size: 11.5px; line-height: 1.45; color: #9fb0c8; padding: 4px 4px 8px; }
.cc-key b { color: #e2e8f0; font-weight: 600; }
.cc-key .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.cc-key .dot.ok { background: #22c55e; }
.cc-key .dot.bad { background: #f59e0b; }

.client-head {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs);
  position: sticky; top: -24px; z-index: 5;
}
.client-head h1 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.client-head .sub { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.client-head .ch-ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--brand-light); color: var(--brand-dark);
}
.client-head .ch-ico svg { width: 22px; height: 22px; }
.client-head .ch-title { flex: 1 1 260px; min-width: 220px; }
.client-head .ch-actions { flex: 1 1 auto; justify-content: flex-end; flex-wrap: wrap; min-width: 0; }

.ce-pair { display: grid; gap: 16px; align-items: start; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.ce-pair.bottom { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.ce-trio { display: grid; gap: 16px; align-items: start; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1280px) {
  .ce-pair, .ce-pair.bottom { grid-template-columns: minmax(0, 1fr); }
  .ce-trio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fc-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
input[type="date"] { min-width: 140px; }

.dirty-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); display: inline-block; margin-left: 8px; vertical-align: 3px; }
.dirty-dot[hidden] { display: none; }

.fc-toolbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fc-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 22px; }
.fc-group h4 {
  margin: 14px 0 4px; font-size: 11px; font-weight: 650; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-faint);
}
.fc-row {
  display: flex; gap: 10px; align-items: flex-start; padding: 8px 9px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent;
}
.fc-row:hover { background: var(--surface-2); border-color: var(--border); }
.fc-row input { margin: 2px 0 0; flex: none; width: 16px; height: 16px; accent-color: var(--brand); }
.fc-row b { display: block; font-size: 13px; font-weight: 600; }
.fc-row i { display: block; font-style: normal; font-size: 11.5px; color: var(--text-faint); margin-top: 2px; line-height: 1.4; }
.fc-row .pill { margin-left: 6px; vertical-align: 1px; font-size: 10px; }
.fc-row.locked { cursor: default; }
.fc-row.planned { opacity: .62; cursor: not-allowed; }
.fc-row input:not(:checked) ~ span b { color: var(--text-dim); font-weight: 500; }

.cl-row { display: flex; gap: 10px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--border); font-size: 13px; }
.cl-row:last-child { border-bottom: 0; }
.cl-row input { width: 16px; height: 16px; accent-color: var(--ok); flex: none; }
.cl-row .when { margin-left: auto; font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.cl-row.done span:first-of-type { color: var(--text-dim); text-decoration: line-through; text-decoration-color: var(--text-faint); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; background: var(--ok); border-radius: 3px; transition: width .3s var(--ease); }

.matrix td.c, .matrix th.c { text-align: center; width: 90px; }
.matrix .yes { color: var(--ok); }
.matrix .no { color: var(--text-faint); }

.keybox { font-family: var(--mono); font-size: 18px; font-weight: 650; letter-spacing: .06em; }
.path { font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); word-break: break-all; }
.mini-kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 12px; font-size: 13px; }
.mini-kv > span:nth-child(odd) { color: var(--text-dim); }
.warnbox { padding: 12px 14px; border-radius: var(--r); background: var(--warn-light); color: #78350f; font-size: 13px; line-height: 1.55; }
.warnbox p { margin: 0; }
.infobox { padding: 12px 14px; border-radius: var(--r); background: var(--info-light); color: #075985; font-size: 13px; line-height: 1.55; }
.infobox p { margin: 0; }
.dangerbox { padding: 12px 14px; border-radius: var(--r); background: var(--danger-light); color: #991b1b; font-size: 13px; line-height: 1.55; }

/* --- the online parts ------------------------------------------------------------------------- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--text-faint); }
.dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--danger); }
.dot.off { background: #cbd5e1; }
.status-cell { display: flex; align-items: center; gap: 9px; }

.codebox {
  font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: .08em; text-align: center;
  padding: 18px 10px; border-radius: var(--r-lg); background: var(--brand-light); color: var(--brand-deep);
  user-select: all; word-break: break-all;
}
.qr { display: grid; place-items: center; padding: 8px; background: #fff; border-radius: var(--r); border: 1px solid var(--border); }
.qr svg { width: 190px; height: 190px; }

.list-row { display: flex; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .grow span { display: block; font-size: 11.5px; color: var(--text-faint); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 20px; padding: 6px 13px;
  font: inherit; font-size: 12.5px; cursor: pointer; color: var(--text-dim); }
.chip-btn:hover { border-color: var(--brand); color: var(--text); }
.chip-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

#me-box .user-chip { margin-top: 2px; }
#me-box .user-chip .meta span { text-transform: none; }
.menu-btn { display: none; color: var(--text-dim); }
.menu-btn:hover { background: var(--surface-3) !important; color: var(--text) !important; }
.menu-btn svg { width: 22px; height: 22px; }
.scrim { display: none; }

/* --- phones and small tablets --------------------------------------------------------------- */
@media (max-width: 900px) {
  body.web #shell { grid-template-columns: minmax(0, 1fr); }
  body.web .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: 268px; z-index: 150;
    transform: translateX(-104%); transition: transform .2s var(--ease); box-shadow: var(--shadow-lg);
  }
  body.web.menu-open .sidebar { transform: none; }
  body.web.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 140; }
  .menu-btn { display: grid; }
  .topbar { padding: 0 12px; gap: 8px; height: auto; min-height: 56px; flex-wrap: wrap; }
  .topbar h2 { font-size: 16.5px; }
  #topbar-actions { flex-wrap: wrap; padding: 6px 0; }
  .view { padding: 14px; }
  .grid-2, .grid-3, .grid-4, .ce-trio { grid-template-columns: minmax(0, 1fr); }
  .fc-groups { grid-template-columns: minmax(0, 1fr); }
  .client-head { position: static; }
  .mini-kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .mini-kv > span:nth-child(even) { margin-bottom: 8px; }
  .toolbar .search { min-width: 0; }
  .toolbar .search input { padding-right: 12px; }
  .modal-backdrop { padding: 10px; }
  #toasts { left: 12px; right: 12px; top: 12px; }
  .toast { min-width: 0; max-width: none; }
  .codebox { font-size: 22px; }
}

/* --- business types ---------------------------------------------------------------------------- */
.type-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.type-card.off { opacity: .7; }
.type-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-light); color: var(--brand-dark); }
.type-ico svg { width: 21px; height: 21px; }
.type-name { font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.icon-chip { padding: 8px 10px; display: grid; place-items: center; }
.icon-chip svg { width: 18px; height: 18px; }
.modal .fc-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .modal .fc-groups { grid-template-columns: minmax(0, 1fr); } }

/* --- easier everyday work: find, menus, renewals, payments ------------------------------------ */
.find-btn {
  display: inline-flex; align-items: center; gap: 8px; margin-right: 10px; padding: 7px 10px 7px 12px; min-width: 230px;
  border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface-2); color: var(--text-faint);
  font: inherit; font-size: 13px; cursor: pointer; transition: border-color .14s, color .14s;
}
.find-btn:hover { border-color: var(--brand); color: var(--text); }
.find-btn svg { width: 16px; height: 16px; }
.find-btn .find-label { flex: 1; text-align: left; }
@media (max-width: 900px) { .find-btn { min-width: 0; } .find-btn .find-label, .find-btn .kbd { display: none; } }

.modal.find-modal { align-self: flex-start; margin-top: 10vh; }
.qf-list { margin-top: 10px; max-height: 52vh; overflow-y: auto; }
.qf-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px;
  background: none; font: inherit; text-align: left; cursor: pointer; color: var(--text);
}
.qf-item.on { background: var(--brand-light); }
.qf-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--brand-dark); }
.qf-item.on .qf-ico { background: var(--surface); }
.qf-ico svg { width: 17px; height: 17px; }
.qf-text { flex: 1; min-width: 0; }
.qf-text b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qf-text i { display: block; font-style: normal; font-size: 11.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qf-kind { font-size: 11px; color: var(--text-faint); }
.qf-empty { padding: 18px 10px; color: var(--text-faint); font-size: 13px; text-align: center; }
.qf-foot { margin-top: 10px; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }

.menu-wrap { position: relative; display: inline-flex; }
.menu-wrap .caret svg { width: 14px; height: 14px; margin-left: -2px; opacity: .7; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
}
.menu-list[hidden] { display: none; }
.menu-item {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; font: inherit; text-align: left; cursor: pointer; color: var(--text);
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.mi-ico { color: var(--brand-dark); flex: none; margin-top: 1px; }
.mi-ico svg { width: 16px; height: 16px; }
.mi-text b { display: block; font-weight: 600; font-size: 13px; }
.mi-text i { display: block; font-style: normal; font-size: 11.5px; color: var(--text-faint); margin-top: 1px; }

.field-block { margin-bottom: 14px; }
.field-block > span { display: block; font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
input.big-num { font-size: 17px; font-weight: 650; letter-spacing: .01em; }
.renew-summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 4px; padding: 12px 14px;
  border-radius: var(--r-sm); background: var(--brand-light);
}
.renew-summary span { display: block; font-size: 11px; color: var(--brand-deep); opacity: .8; text-transform: uppercase; letter-spacing: .04em; }
.renew-summary b { display: block; font-size: 13px; color: var(--brand-deep); margin-top: 2px; }
.renew-summary b.good { color: var(--ok); }
@media (max-width: 700px) { .renew-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.done-mark { width: 54px; height: 54px; border-radius: 50%; background: var(--ok-light); color: var(--ok); display: grid; place-items: center; margin: 4px auto 12px; }
.done-mark svg { width: 26px; height: 26px; }

.pay-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--ok-light); color: var(--ok); }
.pay-ico svg { width: 16px; height: 16px; }
.ce-pair.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1280px) { .ce-pair.even { grid-template-columns: minmax(0, 1fr); } }
.stats-small .stat .value { font-size: 20px; }
td.clickable { cursor: pointer; }
@media (max-width: 640px) {
  body.cc .view .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.cc .view .grid-4 .stat { padding: 12px 13px; }
  body.cc .view .grid-4 .stat .value { font-size: 19px; margin: 5px 0 2px; }
  body.cc .view .grid-4 .stat .sub { font-size: 11px; }
}

/* --- access words, the owner app, installing ------------------------------------------------- */
.client-head .ch-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.renew-summary.one { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.owner-qr { display: flex; gap: 14px; align-items: center; }
.owner-qr .qr { width: 132px; height: 132px; flex: none; padding: 6px; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.owner-qr .qr svg { width: 100%; height: 100%; display: block; }
.install-side {
  display: flex; align-items: center; gap: 9px; width: 100%; margin: 0 0 8px; padding: 9px 11px; border-radius: 10px;
  border: 1px dashed rgba(165, 180, 252, .45); background: rgba(99, 102, 241, .12); color: #c7d2fe;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left;
}
.install-side:hover { background: rgba(99, 102, 241, .22); color: #fff; }
.install-side svg { width: 16px; height: 16px; }
.install-side[hidden] { display: none; }
