/* CafeDeck Console - deliberately looks different from the cafe POS: this is the software-business side. */
:root {
  --ink: #1b2036;
  --ink2: #3a4160;
  --muted: #7a819c;
  --line: #e3e6f0;
  --bg: #f4f5fa;
  --card: #fff;
  --nav: #1b2036;
  --nav2: #262d4c;
  --accent: #00a58e;
  --accent-d: #008572;
  --accent-l: #dcf6f1;
  --blue: #3e5bd6;
  --blue-l: #e6ebfc;
  --amber: #b9770e;
  --amber-l: #fdf0d2;
  --red: #d33a3a;
  --red-l: #fde5e5;
  --green: #1f9a55;
  --green-l: #dff5e8;
  --r: 12px;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font:
    14px/1.5 system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1 {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 16px;
  font-weight: 700;
}
h3 {
  font-size: 14px;
  font-weight: 700;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12.5px;
}
.mt {
  margin-top: 12px;
}
.mb {
  margin-bottom: 12px;
}
.right {
  text-align: right;
}
.nowrap {
  white-space: nowrap;
}
.mono {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
}
.hide {
  display: none !important;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.grow {
  flex: 1;
}
.between {
  justify-content: space-between;
}

/* shell */
.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.side {
  background: var(--nav);
  color: #cfd4ea;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 16px;
  color: #fff;
  font-weight: 750;
  font-size: 15px;
  line-height: 1.2;
}
.brand small {
  display: block;
  font-weight: 500;
  color: #8f97b8;
  font-size: 11.5px;
}
.brand i {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--nav2);
  display: grid;
  place-items: center;
  flex: none;
}
.brand svg {
  width: 20px;
  height: 20px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: #cfd4ea;
  font-weight: 550;
}
.nav a:hover {
  background: var(--nav2);
  text-decoration: none;
}
.nav a.on {
  background: var(--accent);
  color: #fff;
}
.nav svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.side .foot {
  margin-top: auto;
  padding: 10px 8px 0;
  border-top: 1px solid var(--nav2);
  font-size: 12px;
  color: #8f97b8;
}
.main {
  padding: 24px 28px 60px;
  min-width: 0;
  max-width: 1280px;
}
.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.head p {
  color: var(--muted);
}

/* controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  font-weight: 650;
  border: 1.5px solid var(--line);
  background: #fff;
  min-height: 36px;
}
.btn:hover {
  border-color: #c9cee2;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover {
  background: var(--accent-d);
}
.btn.dark {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.btn.danger {
  color: var(--red);
  border-color: #f0c2c2;
}
.btn.danger.solid {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn.sm {
  padding: 4px 10px;
  min-height: 30px;
  font-size: 12.5px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.field label {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink2);
}
.field small {
  color: var(--muted);
}
input,
select,
textarea {
  border: 1.5px solid var(--line);
  border-radius: 9px;
  padding: 8px 11px;
  background: #fff;
  width: 100%;
  min-width: 0;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: transparent;
}
textarea {
  resize: vertical;
  min-height: 70px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
}
.card + .card {
  margin-top: 14px;
}
.card > h2,
.card > .between > h2 {
  margin-bottom: 10px;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
}
.kpi small {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}
.kpi b {
  display: block;
  font-size: 24px;
  font-weight: 750;
  line-height: 1.2;
}
.kpi.bad b {
  color: var(--red);
}
.kpi.warn b {
  color: var(--amber);
}
.kpi.good b {
  color: var(--green);
}
.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
}
table {
  border-collapse: collapse;
  width: 100%;
}
th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 9px 12px;
  background: #fafbfe;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef0f7;
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
tr.click {
  cursor: pointer;
}
tr.click:hover td {
  background: #f8f9fd;
}
td.num,
th.num {
  text-align: right;
}
.pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 99px;
  white-space: nowrap;
}
.pill.good {
  background: var(--green-l);
  color: #14703b;
}
.pill.warn {
  background: var(--amber-l);
  color: #8a5806;
}
.pill.bad {
  background: var(--red-l);
  color: #a32727;
}
.pill.info {
  background: var(--blue-l);
  color: #2b43a6;
}
.pill.off {
  background: #e9ebf3;
  color: var(--muted);
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1.5px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
}
.tabs a {
  padding: 9px 14px;
  font-weight: 650;
  color: var(--muted);
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  white-space: nowrap;
}
.tabs a.on {
  color: var(--accent-d);
  border-color: var(--accent);
}
.tabs a:hover {
  text-decoration: none;
  color: var(--ink);
}
.banner {
  background: var(--amber-l);
  color: #6e4605;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.banner.info {
  background: var(--blue-l);
  color: #243a8f;
}
.banner.bad {
  background: var(--red-l);
  color: #8e2020;
}
.banner.good {
  background: var(--green-l);
  color: #14703b;
}
.kv {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 6px 14px;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  word-break: break-word;
}
.copy {
  display: flex;
  gap: 6px;
}
.copy input {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
}
.steps {
  margin: 6px 0 0 18px;
}
.steps li {
  margin: 4px 0;
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 34px;
}
.bars i {
  flex: 1;
  min-width: 3px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  opacity: 0.85;
}
.bars i.bad {
  background: var(--red);
}
.sw {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eef0f7;
}
.sw:last-child {
  border: 0;
}
.prog {
  height: 10px;
  background: #e9ebf3;
  border-radius: 99px;
  overflow: hidden;
  margin: 10px 0;
}
.prog i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s;
}
pre.stack {
  background: #f4f5fa;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11.5px;
  overflow-x: auto;
  white-space: pre-wrap;
  margin-top: 6px;
}
.empty {
  text-align: center;
  padding: 34px 10px;
  color: var(--muted);
}
details summary {
  cursor: pointer;
}

/* modal / toast */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 45, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 100;
}
.modal {
  background: #fff;
  border-radius: 16px;
  width: min(560px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 20px 22px;
  box-shadow: 0 24px 70px rgba(10, 12, 30, 0.4);
}
.modal.wide {
  width: min(760px, 100%);
}
.modal h2 {
  margin-bottom: 12px;
  font-size: 18px;
}
.modal .foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
  flex-wrap: wrap;
}
#toast-root {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  align-items: center;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  max-width: 90vw;
}
.toast.ok {
  background: var(--green);
}
.toast.err {
  background: var(--red);
}

/* sign-in */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at 30% 20%, #262d4c, #151a2e);
}
.login .box {
  background: #fff;
  border-radius: 18px;
  padding: 28px;
  width: min(380px, 100%);
}
.login h1 {
  margin: 6px 0 4px;
}
.login .brand {
  color: var(--ink);
  padding: 0 0 8px;
}
.login .brand i {
  background: var(--ink);
}
.err-text {
  color: var(--red);
  min-height: 20px;
  font-size: 13px;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .side {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px;
  }
  .brand {
    padding: 0 8px 0 0;
  }
  .nav {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
  }
  .side .foot {
    display: none;
  }
  .main {
    padding: 16px 14px 50px;
  }
  .grid2,
  .grid3 {
    grid-template-columns: 1fr;
  }
  .kv {
    grid-template-columns: 1fr;
  }
}
.grid2 > .card,
.grid2 > div > .card:first-child {
  margin-top: 0;
}

/* v1.8 */
.attn {
  margin-bottom: 16px;
  border-left: 4px solid #f0a52b;
}
.attn.good {
  border-left-color: var(--accent);
}
.attn-list {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}
.attn-row {
  display: grid;
  grid-template-columns: 64px minmax(120px, 200px) 1fr;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid #eef0f7;
  color: var(--ink);
}
.attn-row:hover {
  background: #f8f9fd;
  text-decoration: none;
}
.attn-row .pill {
  justify-self: start;
}
@media (max-width: 700px) {
  .attn-row {
    grid-template-columns: 60px 1fr;
  }
  .attn-row span:last-child {
    grid-column: 1 / -1;
  }
}
.qrbox {
  width: 180px;
  max-width: 100%;
  margin: 10px 0;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.qrbox svg {
  width: 100%;
  height: auto;
  display: block;
}
input[type='search'] {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  width: 100%;
}
#cl-f,
#cl-s {
  width: auto;
  min-width: 150px;
}

/* maintenance preview (what the cafe sees) */
textarea {
  resize: vertical;
}
#m-prev {
  background: #5f0b0b;
  background-image: radial-gradient(circle at 20% 15%, rgba(217, 0, 0, 0.35), transparent 50%);
  border-radius: 14px;
  padding: 18px;
  display: grid;
  place-items: center;
}
.mp-card {
  background: #fff8e6;
  border-radius: 20px;
  padding: 20px 22px;
  max-width: 330px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  color: #27160f;
}
.mp-pill {
  background: #fff0c7;
  color: #7a4d00;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 99px;
}
.mp-h {
  font-size: 20px;
  color: #5f0b0b;
}
.mp-card p {
  font-size: 13.5px;
  line-height: 1.5;
  color: #4b352b;
  white-space: pre-line;
  overflow-wrap: anywhere;
  margin: 0;
}
.mp-eta {
  background: #fff0c2;
  border: 1px solid #ebddba;
  border-radius: 12px;
  padding: 7px 18px;
  display: flex;
  flex-direction: column;
}
.mp-eta small,
.mp-note {
  color: #8a7565;
  font-size: 11.5px;
  font-weight: 600;
}
.mp-eta b {
  font-size: 17px;
  color: #5f0b0b;
}
.btn.sm {
  padding: 4px 10px;
  font-size: 12.5px;
}
