/* Underwood The Jewellers — Bookings */
@font-face { font-family: "Jost"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/jost-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/jost-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/jost-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap; src: url("/fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2"); }
:root {
  --ivory: #f6f1e8;
  --paper: #fffdf9;
  --ink: #1c1a18;
  --ink-2: #4a4540;
  --ink-3: #8a837a;
  --line: #e7dfd2;
  --line-2: #d9cfbf;
  --gold: #b48a4a;
  --gold-2: #d6bc8c;
  --gold-soft: #f3e7cf;
  --danger: #a5402f;
  --danger-soft: #f8e3df;
  --ok: #3b6b46;
  --ok-soft: #e1eee2;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(60, 45, 20, .05), 0 6px 20px -8px rgba(60, 45, 20, .14);
  --shadow-lg: 0 20px 50px -18px rgba(40, 30, 10, .35);
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Jost", "Segoe UI", system-ui, -apple-system, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-variant-numeric: lining-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(246, 241, 232, .88);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 22px;
  padding: 12px 24px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; flex-shrink: 0; }
.brand img { height: 40px; width: auto; }
.brand .sub {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3);
  border-left: 1px solid var(--line-2); padding-left: 14px; line-height: 1.2;
}
.nav { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.nav a {
  text-decoration: none; padding: 10px 16px; border-radius: 999px;
  color: var(--ink-2); font-weight: 500; display: inline-flex; gap: 8px; align-items: center;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(180, 138, 74, .1); }
.nav a.active { background: var(--ink); color: var(--ivory); }
.nav a.cta { background: var(--gold); color: #fff; }
.nav a.cta:hover { background: #a07a3f; }
.nav a svg { width: 18px; height: 18px; }
.staff-chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2);
  background: var(--paper); border-radius: 999px; padding: 6px 12px 6px 8px; cursor: pointer;
  font-size: 14px; color: var(--ink-2);
}
.staff-chip .dot {
  width: 26px; height: 26px; border-radius: 50%; background: var(--gold-soft); color: var(--gold);
  display: grid; place-items: center; font-weight: 600; font-size: 12px; letter-spacing: .02em;
}

main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 24px 120px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: .005em; }
h1 { font-size: 40px; line-height: 1.05; }
h2 { font-size: 26px; }
h3 { font-size: 21px; }
.eyebrow { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 6px; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }

.nav a, .staff-chip { white-space: nowrap; }
@media (max-width: 980px) {
  .brand .sub { display: none; }
  .staff-chip > span:last-child { display: none; }
  .staff-chip { padding: 6px; }
  .nav a { padding: 10px 13px; }
}

/* Bottom nav for phones / narrow tablets */
.bottomnav { display: none; }

@media (max-width: 760px) {
  .topbar-inner { padding: 10px 16px; }
  .brand img { height: 32px; }
  .brand .sub { display: none; }
  .nav { display: none; }
  .staff-chip { margin-left: auto; }
  main { padding: 20px 16px 120px; }
  h1 { font-size: 32px; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(3, 1fr);
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 40;
    background: var(--ink); border-radius: 22px; padding: 6px; box-shadow: var(--shadow-lg);
  }
  .bottomnav a {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px;
    color: #cfc6b8; text-decoration: none; font-size: 12px; border-radius: 16px;
  }
  .bottomnav a svg { width: 22px; height: 22px; }
  .bottomnav a.active { background: rgba(255,255,255,.1); color: #fff; }
  .bottomnav a.cta { color: var(--gold-2); }
}

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--paper); color: var(--ink); font-weight: 500; cursor: pointer; text-decoration: none;
  transition: transform .08s, background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--ivory); }
.btn.primary:hover { background: #33302c; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.gold:hover { background: #a07a3f; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.04); }
.btn.danger { color: var(--danger); border-color: #e8c4bc; background: var(--paper); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ai {
  background: linear-gradient(135deg, #2a2622, #4a3a24); color: #f3e3c3; border: none;
  box-shadow: 0 6px 16px -8px rgba(74, 58, 36, .8);
}
.btn.ai:hover { background: linear-gradient(135deg, #3a342e, #5a4628); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.lg { min-height: 56px; padding: 0 28px; font-size: 17px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.icon { width: 46px; padding: 0; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-2); letter-spacing: .02em; }
.field > span em { font-style: normal; color: var(--ink-3); font-weight: 400; }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--paper); outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(180, 138, 74, .15); }
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238a837a' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px;
}
.money { position: relative; }
.money::before { content: "£"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.money .input { padding-left: 32px; }

.search {
  position: relative; flex: 1; min-width: 220px;
}
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); }
.search .input { padding-left: 46px; border-radius: 999px; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .g2, .g3 { grid-template-columns: 1fr; } }
.span2 { grid-column: span 2; }
@media (max-width: 760px) { .span2 { grid-column: auto; } }

/* ---------- Cards ---------- */
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-num {
  width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--ivory);
  display: inline-grid; place-items: center; font-family: var(--sans); font-size: 14px; font-weight: 600; margin-right: 10px; flex-shrink: 0;
}
.card-title { display: flex; align-items: center; }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat {
  border-radius: var(--radius); padding: 18px 20px; cursor: pointer; border: 2px solid transparent;
  text-align: left; background: var(--paper); box-shadow: var(--shadow); transition: transform .1s, border-color .15s;
  display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden;
}
.stat:hover { transform: translateY(-1px); }
.stat .n { font-family: var(--serif); font-size: 44px; line-height: 1; font-weight: 600; }
.stat .l { font-size: 14px; font-weight: 500; }
.stat svg { position: absolute; right: 14px; top: 14px; width: 26px; height: 26px; opacity: .55; }
.stat.overdue { background: #f8e3df; color: #7d2f22; }
.stat.week { background: #f3ecd9; color: #6b561c; }
.stat.ready { background: #e1eee2; color: #2f5a39; }
.stat.open { background: #ebe6f3; color: #4c3e74; }
.stat.on { border-color: currentColor; }

/* ---------- Toolbar & chips ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; border: 1px solid var(--line-2); background: var(--paper); border-radius: 999px;
  padding: 8px 14px; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-2); transition: background .15s;
}
.chip svg { width: 16px; height: 16px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--ivory); }
.seg { display: inline-flex; background: #ece5d8; border-radius: 999px; padding: 4px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
}
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ---------- Category & status colours ---------- */
.cat { --bg: #ece9e4; --fg: #5b5550; }
.cat-alteration  { --bg: #ece6f5; --fg: #5b4a86; }
.cat-cleaning    { --bg: #e1eef5; --fg: #2f6680; }
.cat-resize      { --bg: #f6e4e1; --fg: #93463b; }
.cat-jrepair     { --bg: #f7e9da; --fg: #8a5a24; }
.cat-watch       { --bg: #e2eee4; --fg: #3b6b46; }
.cat-battery     { --bg: #e3f0ec; --fg: #2f6b5e; }
.cat-clock       { --bg: #f3ecd9; --fg: #7a6322; }
.cat-engraving   { --bg: #ebe8e3; --fg: #5b5550; }
.cat-bespoke     { --bg: #f3e7cf; --fg: #8a6a2b; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--bg); color: var(--fg); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.tag svg { width: 15px; height: 15px; }

.status { --bg: #ebe8e3; --fg: #5b5550; }
.st-booked     { --bg: #ebe8e3; --fg: #4a4540; }
.st-progress   { --bg: #e1eef5; --fg: #2f6680; }
.st-workshop   { --bg: #ece6f5; --fg: #5b4a86; }
.st-parts      { --bg: #f3ecd9; --fg: #7a6322; }
.st-approval   { --bg: #f7e9da; --fg: #8a5a24; }
.st-ready      { --bg: #3b6b46; --fg: #fff; }
.st-collected  { --bg: #f1eee9; --fg: #8a837a; }
.st-cancelled  { --bg: #f8e3df; --fg: #a5402f; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: var(--bg); color: var(--fg); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }

/* ---------- Job list ---------- */
.jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
@media (max-width: 760px) { .jobs { grid-template-columns: 1fr; } }
.job {
  display: grid; grid-template-columns: 92px 1fr; gap: 16px; padding: 14px; border-radius: var(--radius);
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer;
  text-decoration: none; color: inherit; transition: transform .1s, box-shadow .15s; position: relative;
}
.job:hover { transform: translateY(-2px); box-shadow: var(--shadow), 0 14px 28px -16px rgba(60,45,20,.35); }
.job .thumb {
  width: 92px; height: 92px; border-radius: 14px; background: var(--bg); color: var(--fg);
  display: grid; place-items: center; overflow: hidden;
}
.job .thumb img { width: 100%; height: 100%; object-fit: cover; }
.job .thumb svg { width: 38px; height: 38px; opacity: .8; }
.job .body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.job .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.job .ref { font-size: 12px; letter-spacing: .14em; color: var(--ink-3); font-weight: 600; }
.job .name { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job .desc { font-size: 14px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.job .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.due { font-size: 13px; font-weight: 500; color: var(--ink-2); display: inline-flex; gap: 5px; align-items: center; }
.due svg { width: 15px; height: 15px; }
.due.late { color: var(--danger); }
.due.soon { color: #8a6a2b; }
.job .price { font-weight: 600; font-size: 15px; margin-left: auto; }
.job.urgent::after {
  content: "Urgent"; position: absolute; top: -8px; right: 14px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
}

.empty {
  text-align: center; padding: 60px 20px; border: 2px dashed var(--line-2); border-radius: var(--radius);
  color: var(--ink-3);
}
.empty img { width: 70px; margin: 0 auto 14px; opacity: .25; }
.empty h3 { color: var(--ink-2); margin-bottom: 6px; }

/* ---------- New booking ---------- */
.booking { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
@media (max-width: 1050px) { .booking { grid-template-columns: 1fr; } }
.summary { position: sticky; top: 88px; }
.summary .card { background: var(--ink); color: #efe8db; border: none; }
.summary h3 { color: #fff; }
.summary dl { margin: 14px 0 18px; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; }
.summary dt { color: #a99f90; }
.summary dd { margin: 0; text-align: right; color: #fff; }
.summary .total { border-top: 1px solid #3a3530; padding-top: 14px; display: flex; justify-content: space-between; align-items: baseline; }
.summary .total b { font-family: var(--serif); font-size: 34px; color: var(--gold-2); }

.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.type {
  border: 2px solid transparent; background: var(--bg); color: var(--fg); border-radius: 16px;
  padding: 16px 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  cursor: pointer; text-align: left; font-weight: 500; min-height: 96px; transition: transform .1s, border-color .15s;
}
.type svg { width: 30px; height: 30px; }
.type:hover { transform: translateY(-1px); }
.type.on { border-color: var(--fg); box-shadow: 0 0 0 3px var(--paper) inset; }

.cust-results { margin-top: 10px; display: grid; gap: 8px; }
.cust-opt {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: #fbf8f2; cursor: pointer; text-align: left; width: 100%;
}
.cust-opt:hover { border-color: var(--gold); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--gold-soft); color: var(--gold);
  display: grid; place-items: center; font-weight: 600; flex-shrink: 0; font-size: 15px;
}
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.picked {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px;
  background: var(--gold-soft); border: 1px solid #e8d6b0;
}
.picked .who { flex: 1; min-width: 0; }
.picked .who b { font-family: var(--serif); font-size: 22px; display: block; line-height: 1.1; }

/* Photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo {
  position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #efe9de; cursor: zoom-in;
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .x {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: rgba(28,26,24,.7); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.photo .x svg { width: 14px; height: 14px; }
.photo.uploading::after {
  content: ""; position: absolute; inset: 0; background: rgba(255,253,249,.6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='20' fill='none' stroke='%23b48a4a' stroke-width='4' stroke-dasharray='90 40'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='0.9s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center no-repeat;
}
.add-photo {
  aspect-ratio: 1; border-radius: 14px; border: 2px dashed var(--line-2); background: #fbf8f2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--ink-2); cursor: pointer; font-size: 14px; font-weight: 500; text-align: center; padding: 8px;
}
.add-photo:hover { border-color: var(--gold); color: var(--gold); }
.add-photo svg { width: 30px; height: 30px; }

.ai-box {
  margin-top: 14px; border-radius: 16px; padding: 16px; background: linear-gradient(135deg, #faf5ea, #f3e7cf);
  border: 1px solid #e8d6b0;
}
.ai-box .head { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.ai-box .head b { display: flex; align-items: center; gap: 8px; font-weight: 600; color: #6e5320; }
.ai-box .head svg { width: 18px; height: 18px; }
.ai-thinking { display: inline-flex; gap: 4px; }
.ai-thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: blink 1.2s infinite; }
.ai-thinking i:nth-child(2) { animation-delay: .2s; } .ai-thinking i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.quick button {
  border: 1px solid var(--line-2); background: #fbf8f2; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.quick button:hover { border-color: var(--gold); }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 500; }
.toggle input { display: none; }
.toggle .sw { width: 46px; height: 28px; border-radius: 999px; background: #ddd4c5; position: relative; transition: background .15s; }
.toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle input:checked + .sw { background: var(--danger); }
.toggle input:checked + .sw::after { transform: translateX(18px); }

/* ---------- Quick-pick tags ---------- */
.tagpick { margin-top: 18px; border-radius: 16px; background: #fbf8f2; border: 1px solid var(--line); padding: 16px; display: grid; gap: 14px; }
.tp-head { display: flex; align-items: center; gap: 12px; }
.tp-head b { font-weight: 600; }
.tp-head .btn { margin-left: auto; min-height: 30px; }
.tp-group { --bg: #ece9e4; --fg: #4a4540; }
.g-item  { --bg: #ece6f5; --fg: #5b4a86; }
.g-metal { --bg: #f3e7cf; --fg: #7a5a1f; }
.g-stone { --bg: #e1eef5; --fg: #2f6680; }
.g-mark  { --bg: #ebe8e3; --fg: #4a4540; }
.g-cond  { --bg: #f6e4e1; --fg: #93463b; }
.tp-label { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--fg); margin-bottom: 8px; }
.tp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--paper); color: var(--ink-2); font-size: 14px; cursor: pointer;
  transition: background .12s, border-color .12s, transform .08s;
}
.tp-chip:hover { border-color: var(--fg); }
.tp-chip:active { transform: scale(.97); }
.tp-chip.on { background: var(--bg); border-color: var(--fg); color: var(--fg); font-weight: 600; }
.tp-chip svg { width: 15px; height: 15px; }
.tp-chip.off { opacity: .35; text-decoration: line-through; cursor: not-allowed; }
.tp-grades { margin-bottom: 12px; }
.tp-grades .tp-chip { min-width: 120px; justify-content: center; }
.tp-sub { display: block; font-size: 12px; font-weight: 600; color: var(--fg); margin-bottom: 8px; opacity: .85; }
.tp-sub em { font-style: normal; font-weight: 400; color: var(--ink-3); }
.other-field { margin-top: 14px; padding: 14px; border-radius: 14px; background: #f1efeb; }

/* ---------- Ring size picker ---------- */
.ringpick { margin-top: 14px; border-radius: 16px; background: #fbf3f1; border: 1px solid #efd6d0; padding: 16px; --fg: #93463b; --bg: #f6e4e1; }
.rp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.rp-head b { display: flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 600; }
.rp-head svg { width: 18px; height: 18px; }
.rp-change { background: var(--fg); color: #fff; font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.rp-slots { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.rp-arrow svg { width: 22px; height: 22px; color: var(--fg); opacity: .6; }
.rp-slot {
  flex: 1; max-width: 180px; display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 10px 16px;
  border-radius: 14px; border: 2px solid transparent; background: var(--paper); cursor: pointer; text-align: left;
}
.rp-slot small { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.rp-slot b { font-family: var(--serif); font-size: 36px; line-height: 1.05; font-weight: 600; color: var(--ink); }
.rp-slot.empty { border: 2px dashed #e2bfb7; background: transparent; }
.rp-slot.empty b { font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--fg); padding: 10px 0 6px; }
.rp-slot.on { border-color: var(--fg); box-shadow: 0 4px 14px -8px rgba(147, 70, 59, .6); }
.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.rp-l {
  min-height: 46px; border-radius: 12px; border: 1px solid #ead2cc; background: var(--paper); cursor: pointer;
  font-weight: 600; font-size: 16px; color: var(--ink-2); transition: background .1s, transform .08s;
}
.rp-l:active { transform: scale(.95); }
.rp-l:hover { border-color: var(--fg); }
.rp-l.on { background: var(--fg); border-color: var(--fg); color: #fff; }
.rp-l.wide { font-size: 14px; }
.rp-l.half, .rp-l.clear { grid-column: span 2; font-size: 14px; }
.rp-l.half.on { background: var(--bg); color: var(--fg); }
.rp-l[disabled] { opacity: .4; pointer-events: none; }
.tag.ring-tag { --bg: #f6e4e1; --fg: #93463b; }

/* ---------- Job detail ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
@media (max-width: 1050px) { .detail { grid-template-columns: 1fr; } }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); text-decoration: none; font-size: 14px; margin-bottom: 10px; }
.back svg { width: 16px; height: 16px; }
.statuses { display: flex; flex-wrap: wrap; gap: 8px; }
.statuses button {
  border: 1px solid var(--line-2); background: var(--paper); border-radius: 999px; padding: 9px 14px; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
}
.statuses button.on { background: var(--bg); color: var(--fg); border-color: transparent; font-weight: 600; }
.kv { display: grid; grid-template-columns: 1fr; gap: 2px; }
.kv .k { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.kv .v { font-size: 16px; white-space: pre-wrap; }
.contact-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.timeline li { display: grid; grid-template-columns: 12px 1fr; gap: 12px; font-size: 14px; }
.timeline li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--gold-2); margin-top: 5px; }
.timeline .when { color: var(--ink-3); font-size: 12px; }
.money-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.money-row:last-child { border-bottom: 0; }
.money-row b { font-weight: 600; }
.money-row.big b { font-family: var(--serif); font-size: 28px; color: var(--gold); }
.savebar {
  position: sticky; bottom: calc(16px + var(--safe-b)); z-index: 20; margin-top: 18px;
  display: flex; gap: 10px; justify-content: flex-end; align-items: center;
  background: var(--ink); color: #efe8db; padding: 10px 10px 10px 20px; border-radius: 999px; box-shadow: var(--shadow-lg);
}
.savebar span { margin-right: auto; font-size: 14px; }
@media (max-width: 760px) { .savebar { bottom: calc(96px + var(--safe-b)); } }

/* ---------- Customers ---------- */
.custs { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.cust {
  display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--radius); background: var(--paper);
  border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: transform .1s;
}
.cust:hover { transform: translateY(-2px); }
.cust b { font-family: var(--serif); font-size: 21px; display: block; line-height: 1.15; }
.cust .counts { margin-left: auto; text-align: right; font-size: 13px; color: var(--ink-3); flex-shrink: 0; }
.cust .counts .open { color: var(--gold); font-weight: 600; }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 600px at 10% -10%, #efe3cb 0, transparent 60%),
    radial-gradient(900px 500px at 110% 110%, #eadfcf 0, transparent 60%),
    var(--ivory);
}
.login-card { width: min(440px, 100%); background: var(--paper); border-radius: 28px; padding: 40px 36px; box-shadow: var(--shadow-lg); text-align: center; border: 1px solid var(--line); }
.login-card img { width: 260px; margin: 0 auto 8px; }
.login-card .eyebrow { margin: 18px 0 24px; }
.login-card form { display: grid; gap: 14px; }
.login-card .err { color: var(--danger); font-size: 14px; min-height: 20px; }
.demo-cta { margin-top: 8px; display: grid; gap: 10px; }
.demo-cta .or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.demo-cta .or::before, .demo-cta .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-cta .btn { background: var(--gold-soft); border-color: #e8d6b0; color: #6e5320; }
.demo-cta .btn:hover { background: #efdfbf; }
.demo-cta p { margin: 0; }
.demo-ribbon {
  position: fixed; left: 16px; bottom: calc(16px + var(--safe-b)); z-index: 90; display: flex; align-items: center; gap: 10px;
  background: var(--gold); color: #fff; font: 600 12px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  padding: 6px 6px 6px 14px; border-radius: 999px; box-shadow: 0 8px 20px -8px rgba(0,0,0,.4);
}
.demo-ribbon span { display: inline-flex; align-items: center; gap: 6px; }
.demo-ribbon button {
  border: 0; background: rgba(255,255,255,.22); color: #fff; font: inherit; letter-spacing: .08em; text-transform: uppercase;
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
}
.demo-ribbon button:hover { background: rgba(255,255,255,.35); }
@media (max-width: 760px) { .demo-ribbon { bottom: auto; top: 62px; left: auto; right: 12px; } }

/* ---------- Modal / lightbox ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 60; background: rgba(28, 26, 24, .55); display: grid; place-items: center; padding: 20px;
  animation: fade .15s ease;
}
.modal { background: var(--paper); border-radius: 24px; padding: 26px; width: min(480px, 100%); box-shadow: var(--shadow-lg); }
.modal h3 { margin-bottom: 8px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(15, 14, 12, .92); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 12px; }
.lightbox .close { position: absolute; top: 16px; right: 16px; }
.lightbox .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox .prev { left: 16px; } .lightbox .next { right: 16px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

#toast {
  position: fixed; left: 50%; bottom: calc(28px + var(--safe-b)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 15px; z-index: 80;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 8px;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); }
@media (max-width: 760px) { #toast { bottom: calc(100px + var(--safe-b)); } }

.success {
  text-align: center; max-width: 560px; margin: 30px auto; padding: 40px 30px; background: var(--paper);
  border-radius: 28px; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.success .tick { width: 74px; height: 74px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 18px; }
.success .tick svg { width: 36px; height: 36px; }
.success .bigref { font-family: var(--serif); font-size: 54px; font-weight: 600; letter-spacing: .04em; margin: 6px 0; }
.success .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

.spinner { width: 28px; height: 28px; border: 3px solid var(--line-2); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Print ticket ---------- */
#print-area { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; color: #000; font-family: var(--sans); font-variant-numeric: lining-nums; }
}
.ticket { border: 1.5px solid #000; border-radius: 10px; padding: 16px 20px; margin-bottom: 10mm; page-break-inside: avoid; }
.ticket .t-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 1px solid #000; padding-bottom: 10px; margin-bottom: 10px; }
.ticket .t-head img { height: 46px; }
.ticket .t-ref { text-align: right; }
.ticket .t-ref b { font-family: var(--serif); font-size: 34px; display: block; line-height: 1; letter-spacing: .04em; }
.ticket .t-ref small { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; }
.ticket table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ticket td { padding: 4px 0; vertical-align: top; }
.ticket td:first-child { width: 130px; font-weight: 600; }
.ticket .t-money { display: flex; gap: 24px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed #000; font-size: 13px; }
.ticket .t-money b { font-size: 16px; }
.ticket .t-foot { margin-top: 10px; font-size: 10px; line-height: 1.4; color: #333; }
.ticket .t-sign { display: flex; gap: 30px; margin-top: 14px; font-size: 11px; }
.ticket .t-sign div { flex: 1; border-top: 1px solid #000; padding-top: 4px; }
.ticket .t-label { font-size: 10px; letter-spacing: .25em; text-transform: uppercase; font-weight: 600; margin-bottom: 6px; }
.ticket .t-photos { display: flex; gap: 6px; margin-top: 8px; }
.ticket .t-photos img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid #ccc; }
.tag-ticket { display: inline-block; width: 70mm; border: 1.5px dashed #000; border-radius: 10px; padding: 10px 14px; margin-right: 6mm; vertical-align: top; }
.tag-ticket b { font-family: var(--serif); font-size: 30px; display: block; letter-spacing: .04em; }
.tag-ticket div { font-size: 12px; }
