﻿/* ============================================================
   Tamkin账本 · Ledger
   编辑部 / 暗房 / 胶片
   ============================================================ */

:root {
  --paper: #f4efe7;
  --paper-2: #ece4d8;
  --card: #fffcf7;
  --ink: #17181a;
  --ink-2: #3b3a37;
  --muted: #8c857b;
  --muted-2: #a9a199;
  --gold: #b08a5a;
  --gold-2: #c9a678;
  --gold-soft: #e7d7bf;
  --red: #b84a33;
  --green: #3e6b52;
  --blue: #4c6378;
  --violet: #6d5a7a;
  --line: rgba(23, 24, 26, .09);
  --line-2: rgba(23, 24, 26, .16);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --r: 20px;
  --shadow: 0 34px 70px -50px rgba(23, 24, 26, .48);
  --shadow-sm: 0 18px 40px -34px rgba(23, 24, 26, .4);
  --glow-1: rgba(176, 138, 90, .13);
  --glow-2: rgba(184, 74, 51, .06);
  --sidebar-bg: linear-gradient(180deg, rgba(255, 252, 247, .86), rgba(244, 239, 231, .72));
  --soft: var(--soft);
  --soft-strong: rgba(255, 252, 247, .92);
  --input-bg: #fffdf9;
  --input-focus: #fff;
  --topbar-bg: rgba(244, 239, 231, .82);
  --btn-fg: #fbf7f0;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  background:
    radial-gradient(1100px 560px at 102% -8%, var(--glow-1), transparent 62%),
    radial-gradient(900px 520px at -6% 104%, var(--glow-2), transparent 62%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--gold-soft); color: var(--ink); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.25;
}

p { margin: 0; }

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.ink-red { color: var(--red) !important; }
.ink-gold { color: var(--gold) !important; }
.muted { color: var(--muted) !important; }
.ta-r { text-align: right; }
.pad { padding: 14px 2px; }

.ic { width: 20px; height: 20px; flex: none; }
.ic.sm { width: 16px; height: 16px; }

.only-mobile { display: none !important; }

/* ----------------------------- shell ---------------------------------- */

.shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 236px;
  display: flex;
  flex-direction: column;
  padding: 30px 22px 22px;
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 0 4px 26px;
}
.brand .brand-mark { width: 50px; height: 50px; }
.brand-text b { max-width: 190px; font-size: 19px; }

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(176, 138, 90, .06);
}

.brand-mark .ic { width: 21px; height: 21px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-text b {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: .04em;
  font-weight: 600;
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-text em {
  margin-top: 5px;
  font-style: normal;
  font-size: 8px;
  letter-spacing: .2em;
  color: var(--muted);
}
.brand-mark { overflow: hidden; }
.brand-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.brand-emoji { font-size: 20px; line-height: 1; }

.nav { display: flex; flex-direction: column; gap: 3px; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 13.5px;
  letter-spacing: .02em;
  transition: .22s ease;
}

.nav-item .ic { width: 18px; height: 18px; opacity: .85; }

.nav-item:hover { color: var(--ink); background: rgba(23, 24, 26, .04); }

.nav-item.is-active {
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--gold);
  border-radius: 2px;
}

.nav-dot {
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(184, 74, 51, .12);
}

.sidebar-note {
  margin-top: auto;
  padding: 18px 6px;
  color: var(--muted-2);
}

.note-line { display: block; width: 26px; height: 1px; background: var(--gold); margin-bottom: 12px; }
.sidebar-note p { font-family: var(--serif); font-size: 12px; line-height: 1.9; letter-spacing: .06em; }

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 6px 0;
  border-top: 1px solid var(--line);
}

.avatar {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0;
}

.avatar.lg { width: 60px; height: 60px; font-size: 24px; }

.who { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.who strong { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: .2s;
}

.icon-btn:hover { background: rgba(23, 24, 26, .06); color: var(--ink); }
.icon-btn .ic { width: 17px; height: 17px; }

.main { margin-left: 236px; min-height: 100vh; display: flex; flex-direction: column; }
.content { flex: 1 0 auto; }

.topbar {
  height: 88px;
  padding: 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-date {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
}

.topbar-date i { width: 1px; height: 12px; background: var(--line-2); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.mobile-brand { display: none; }

.content { padding: 0 42px 90px; max-width: 1300px; }
.content.is-wide { max-width: 1500px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.page-head h1 {
  font-size: 34px;
  letter-spacing: -.02em;
}

.page-head p { margin-top: 6px; font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ----------------------------- buttons -------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  letter-spacing: .02em;
  cursor: pointer;
  white-space: nowrap;
  transition: .22s ease;
}

.btn .ic { width: 16px; height: 16px; }

.btn-primary { background: var(--ink); color: var(--btn-fg); border-color: var(--ink); }
.btn-primary:hover { background: var(--gold); border-color: var(--gold); color: #fff; transform: translateY(-1px); }

.btn-ghost { border-color: var(--line-2); color: var(--ink-2); background: var(--soft); }
.btn-ghost:hover { border-color: var(--ink); background: var(--card); }

.btn-sm { height: 34px; padding: 0 14px; font-size: 12px; }
.btn-xs { height: 28px; padding: 0 11px; font-size: 11px; border-radius: 999px; }
.btn-lg { height: 52px; font-size: 14.5px; }
.btn-block { width: 100%; }

.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ----------------------------- cards ---------------------------------- */

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-head h2 { font-size: 17px; letter-spacing: .01em; }
.card-head p { margin-top: 4px; font-size: 11.5px; color: var(--muted); }

.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .06em;
}

.card-tag .ic { width: 13px; height: 13px; }

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  transition: .2s;
}
.card-link:hover { color: var(--gold); }
.card-link .ic { width: 14px; height: 14px; }

/* ----------------------------- badges --------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--soft);
  font-size: 10.5px;
  color: var(--ink-2);
  white-space: nowrap;
}

.badge i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }
.tone-blue i { background: var(--blue); }
.tone-gold i { background: var(--gold); }
.tone-violet i { background: var(--violet); }
.tone-green i { background: var(--green); }
.tone-muted i { background: var(--muted-2); }

/* ----------------------------- forms ---------------------------------- */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}

.form-grid.compact { gap: 12px 14px; }
.span-2 { grid-column: span 2; }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }

.field-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  letter-spacing: .1em;
  color: var(--muted);
  text-transform: uppercase;
}

.req { color: var(--gold); font-weight: 400; }

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  outline: none;
  transition: .2s;
}

.field textarea { min-height: 78px; resize: vertical; line-height: 1.7; }

.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(176, 138, 90, .13);
  background: var(--input-focus);
}

.field select {
  appearance: none;
  padding-right: 34px;
  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 1.5 6 6.5l5-5' fill='none' stroke='%238C857B' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.field-hint { font-size: 10.5px; color: var(--muted); letter-spacing: .02em; }
.field-hint a { color: var(--gold); }

.field-check {
  flex-direction: row;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.check input { width: 15px; height: 15px; accent-color: var(--ink); }

.form-card { margin-bottom: 18px; padding: 28px; }

.form-section-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.step-no {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--gold);
  letter-spacing: .1em;
  padding-top: 6px;
}

.form-section-head h2 { font-size: 18px; }
.form-section-head p { margin-top: 3px; font-size: 11.5px; color: var(--muted); }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.form-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(184, 74, 51, .25);
  border-radius: 12px;
  background: rgba(184, 74, 51, .06);
  color: var(--red);
  font-size: 12.5px;
}
.form-error .ic { width: 17px; height: 17px; }

.form-footnote { margin-top: 12px; text-align: center; font-size: 11px; color: var(--muted); }

.readonly-box {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  background: rgba(244, 239, 231, .5);
  font-size: 13px;
}

.hidden { display: none !important; }
.new-customer { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }

.form-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ----------------------------- flash / toast -------------------------- */

.toast {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 32px);
  padding: 12px 14px 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #f9f4ec;
  font-size: 12.5px;
  box-shadow: 0 20px 50px -20px rgba(23, 24, 26, .6);
  animation: toast-in .35s cubic-bezier(.2, .8, .2, 1);
}

.toast .ic { width: 17px; height: 17px; color: var(--gold-2); }
.toast button { border: 0; background: transparent; color: rgba(255, 255, 255, .5); font-size: 17px; cursor: pointer; padding: 0 4px; }

.toast-err { background: #6d2b1e; }
.toast-err .ic { color: #f3c8b8; }

@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ----------------------------- hero ----------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 34px 38px 30px;
  background:
    radial-gradient(120% 160% at 88% 4%, rgba(176, 138, 90, .5), transparent 52%),
    radial-gradient(90% 130% at 4% 100%, rgba(184, 74, 51, .22), transparent 56%),
    #17181a;
  color: #f7f1e7;
  box-shadow: 0 40px 80px -50px rgba(23, 24, 26, .7);
}

.grain { position: relative; }
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.hero > * { position: relative; z-index: 1; }

.hero-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.eyebrow { font-size: 9.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.hero .eyebrow { color: rgba(247, 241, 231, .55); }

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: rgba(247, 241, 231, .62);
  letter-spacing: .04em;
}
.hero-chip .ic { width: 14px; height: 14px; color: var(--gold-2); }

.hero-amount {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hero-amount .currency { font-size: .42em; vertical-align: .55em; margin-right: 8px; color: var(--gold-2); }

.hero-sub { margin-top: 12px; font-size: 11.5px; color: rgba(247, 241, 231, .58); }
.hero-sub .up { color: #c9d8b8; font-weight: 500; }
.hero-sub .down { color: #e3a28e; font-weight: 500; }
.dot-sep { margin: 0 8px; opacity: .45; }

.hero-rule { height: 1px; margin: 26px 0 20px; background: rgba(247, 241, 231, .16); }

.hero-grid { display: flex; gap: 48px; flex-wrap: wrap; }
.hero-grid > div { display: flex; flex-direction: column; gap: 5px; }
.hero-grid span { font-size: 10px; letter-spacing: .1em; color: rgba(247, 241, 231, .48); }
.hero-grid b { font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .01em; }

/* ----------------------------- stats ---------------------------------- */

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

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.stat-label { display: block; font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.stat-value { display: block; margin-top: 9px; font-family: var(--serif); font-size: 25px; font-weight: 500; letter-spacing: -.02em; }
.stat-value.is-small { font-size: 18px; }
.stat-value small { font-family: var(--sans); font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.stat-hint { display: block; margin-top: 5px; font-size: 10.5px; color: var(--muted); }

/* ----------------------------- dashboard ------------------------------ */

.dash-2col {
  display: grid;
  grid-template-columns: 1.25fr .95fr;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 190px;
  padding-top: 10px;
}

.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; }
.bar-val { font-family: var(--mono); font-size: 9.5px; color: var(--muted); height: 13px; }
.bar-track { flex: 1; width: 100%; max-width: 34px; display: flex; align-items: flex-end; justify-content: center; }
.bar {
  display: block;
  width: 100%;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold-soft));
  transition: .3s;
  min-height: 4px;
}
.bar.is-current { background: linear-gradient(180deg, #3b3c3e, #17181a); }
.bar-label { font-size: 10px; color: var(--muted); }
.bar-label.is-current { color: var(--ink); font-weight: 600; }

.todo-list { display: flex; flex-direction: column; }

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.list-row:first-child { border-top: 0; padding-top: 0; }
.list-row:last-child { padding-bottom: 0; }
.list-main { display: flex; flex-direction: column; min-width: 0; }
.list-main b { font-size: 13px; font-weight: 600; }
.list-main span { font-size: 11px; color: var(--muted); margin-top: 2px; }
.list-actions { display: flex; gap: 6px; flex: none; }
.pending-label { font-size: 10px; color: var(--gold); border: 1px solid rgba(176, 138, 90, .28); border-radius: 999px; padding: 3px 9px; flex: none; }
.list-arrow { color: var(--muted-2); }
.list-arrow .ic { width: 15px; height: 15px; }
.list-row.is-link { border-radius: 10px; padding-left: 2px; }
.list-row.is-link:hover .list-arrow { color: var(--gold); }

.todo-empty {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.todo-empty .ic { width: 16px; height: 16px; color: var(--green); }

.today-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: rgba(176, 138, 90, .08);
  font-size: 11.5px;
}
.today-strip > span { font-size: 9px; letter-spacing: .12em; color: var(--gold); }
.today-strip a { color: var(--ink-2); }
.today-strip a:hover { color: var(--gold); }

.schedule-list { display: flex; flex-direction: column; }
.schedule-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.schedule-row:first-child { border-top: 0; }
.date-block {
  width: 42px;
  height: 46px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  line-height: 1.05;
}
.date-block b { font-family: var(--serif); font-size: 17px; font-weight: 500; }
.date-block em { font-style: normal; font-size: 8px; color: var(--muted); letter-spacing: .05em; }
.schedule-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.schedule-main b { font-size: 12.5px; font-weight: 600; }
.schedule-main em { font-style: normal; font-size: 10.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pay-list { display: flex; flex-direction: column; }
.pay-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-top: 1px solid var(--line); }
.pay-row:first-child { border-top: 0; }
.pay-icon {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(62, 107, 82, .09);
  color: var(--green);
}
.pay-icon .ic { width: 14px; height: 14px; }
.pay-icon.is-pending { background: rgba(176, 138, 90, .12); color: var(--gold); }
.pay-icon.is-out { background: rgba(184, 74, 51, .08); color: var(--red); }
.pay-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pay-main b { font-size: 12.5px; font-weight: 600; }
.pay-main em { font-style: normal; font-size: 10.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-amount { font-family: var(--mono); font-size: 12.5px; color: var(--green); white-space: nowrap; }
.pay-amount.is-out { color: var(--red); }

/* ----------------------------- summary / filters ---------------------- */

.summary-strip {
  display: flex;
  align-items: center;
  gap: 38px;
  flex-wrap: wrap;
  padding: 16px 22px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}
.summary-strip > div { display: flex; flex-direction: column; gap: 3px; }
.summary-strip span { font-size: 9.5px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.summary-strip b { font-size: 16px; font-weight: 500; letter-spacing: -.01em; }

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  min-width: 240px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--soft);
}
.search-box .ic { width: 16px; height: 16px; color: var(--muted); }
.search-box input { border: 0; background: transparent; outline: none; font: inherit; font-size: 12.5px; width: 100%; color: var(--ink); }

.filter-bar select {
  height: 40px;
  padding: 0 32px 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background-color: var(--soft);
  font: inherit;
  font-size: 12px;
  color: var(--ink-2);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238C857B' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  outline: none;
}
.filter-bar select:focus { border-color: var(--gold); }
.filter-clear { font-size: 11px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.filter-clear:hover { color: var(--red); }

/* ----------------------------- order table ---------------------------- */

.order-table {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.order-thead, .order-row {
  display: grid;
  grid-template-columns: 1.7fr .78fr .76fr .72fr .86fr .86fr .86fr .98fr;
  gap: 12px;
  align-items: center;
  padding: 13px 20px;
}

.order-thead > span:nth-child(5),
.order-thead > span:nth-child(6),
.order-thead > span:nth-child(7) { text-align: right; }
.order-thead > span:nth-child(8) { padding-left: 4px; }
.order-row > .badge { justify-self: start; }

.order-thead {
  font-size: 9px;
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 239, 231, .45);
}

.order-row {
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  transition: .2s;
}
.order-row:last-child { border-bottom: 0; }
.order-row:hover { background: rgba(176, 138, 90, .055); }

.oc-main { display: flex; flex-direction: column; min-width: 0; }
.oc-main b { font-size: 13px; font-weight: 600; }
.oc-main em { font-style: normal; font-size: 10px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-type, .oc-date, .oc-owner { font-size: 11.5px; color: var(--ink-2); }
.oc-owner { color: var(--muted); }
.order-row .num { font-size: 12px; }
.order-row .ta-r { text-align: right; }

.order-table.compact .order-thead,
.order-table.compact .order-row {
  grid-template-columns: 1.4fr .8fr .8fr .7fr .85fr .8fr .75fr;
}

/* ----------------------------- detail --------------------------------- */

.detail-grid {
  display: grid;
  grid-template-columns: 1.55fr .85fr;
  gap: 16px;
  align-items: start;
}
.detail-main, .detail-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.finance-card { padding: 26px; }

.finance-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.finance-due {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.finance-due .currency { font-size: .4em; vertical-align: .6em; margin-right: 6px; color: var(--gold); }
.finance-pct { font-size: 10.5px; color: var(--muted); letter-spacing: .06em; }

.progress {
  display: block;
  height: 5px;
  margin: 18px 0 20px;
  border-radius: 99px;
  background: rgba(23, 24, 26, .07);
  overflow: hidden;
}
.progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }

.finance-rows {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.finance-rows > div { display: flex; flex-direction: column; gap: 4px; }
.finance-rows span { font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.finance-rows b { font-size: 14px; font-weight: 500; }

.pending-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(176, 138, 90, .09);
  font-size: 11px;
  color: #7d603a;
}
.pending-note .ic { width: 14px; height: 14px; }

.settle-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px dashed rgba(62, 107, 82, .35);
  border-radius: 12px;
  font-size: 11.5px;
  color: var(--green);
}

.payment-form { border-top: 1px solid var(--line); padding-top: 18px; }

.payment-list { display: flex; flex-direction: column; }

.payment-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.payment-item:first-child { border-top: 0; padding-top: 0; }
.payment-item:last-child { padding-bottom: 0; }
.payment-item.is-pending { background: linear-gradient(90deg, rgba(176, 138, 90, .06), transparent 65%); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; }

.payment-body { flex: 1; min-width: 0; }
.payment-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.payment-line b { font-size: 12.5px; font-weight: 600; }
.payment-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 3px; font-size: 10.5px; color: var(--muted); }
.payment-meta i { width: 2px; height: 2px; border-radius: 50%; background: var(--muted-2); }
.payment-note { margin-top: 5px; font-size: 11px; color: var(--ink-2); }
.payment-actions { display: flex; gap: 7px; margin-top: 9px; }
.payment-side { flex: none; display: flex; align-items: flex-start; }

.detail-list { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; }
.detail-list.two-col { grid-template-columns: 1fr 1fr; gap: 0 26px; }
.detail-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line); }
.detail-list > div:first-child, .detail-list > div:nth-child(2) { border-top: 0; }
.detail-list .two-col > div:nth-child(2) { border-top: 0; }
.detail-list dt { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.detail-list dd { margin: 0; font-size: 12.5px; text-align: right; }

.note-box { margin-top: 14px; padding: 14px; border-radius: 12px; background: rgba(244, 239, 231, .6); }
.note-box span { font-size: 9.5px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.note-box p { margin-top: 5px; font-size: 12px; line-height: 1.8; white-space: pre-wrap; color: var(--ink-2); }

.customer-mini { display: flex; flex-direction: column; gap: 4px; }
.customer-mini > b { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.customer-mini > span { font-size: 12px; color: var(--muted); }
.customer-mini-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.side-note { font-size: 11.5px; line-height: 1.9; color: var(--muted); }
.side-buttons { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.status-form select {
  height: 38px;
  padding: 0 32px 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background-color: transparent;
  font: inherit;
  font-size: 12px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238C857B' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  outline: none;
}

/* ----------------------------- customers ------------------------------ */

.customer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.customer-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: .22s;
}
.customer-card:hover { transform: translateY(-2px); border-color: var(--gold-soft); box-shadow: 0 26px 50px -40px rgba(23, 24, 26, .5); }

.customer-card-top { display: flex; align-items: center; gap: 11px; }
.customer-card-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.customer-card-name b { font-size: 14.5px; font-weight: 600; }
.customer-card-name span { font-size: 11px; color: var(--muted); }
.due-flag { font-size: 10px; color: var(--red); background: rgba(184, 74, 51, .07); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.customer-card-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); }

.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-row.pad { padding: 14px 0 0; }
.tag { font-size: 9.5px; color: #7d603a; background: rgba(176, 138, 90, .1); padding: 2px 8px; border-radius: 999px; }

/* ----------------------------- quick ---------------------------------- */

.quick-wrap { max-width: 680px; }
.quick-note {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 17px;
  margin-bottom: 16px;
  border: 1px solid rgba(176, 138, 90, .22);
  border-radius: 14px;
  background: rgba(176, 138, 90, .06);
  font-size: 11.5px;
  color: #6f5634;
}
.quick-note .ic { width: 17px; height: 17px; color: var(--gold); }
.quick-note b { font-family: var(--serif); font-size: 15px; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 34px 0 12px; }
.section-title h2 { font-size: 18px; }
.section-title a { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.section-title a .ic { width: 14px; height: 14px; }

.mini-order-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.mini-order { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mini-date { font-family: var(--mono); font-size: 10px; color: var(--muted); width: 62px; flex: none; }
.mini-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-main b { font-size: 12.5px; }
.mini-main em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.mini-amount { font-size: 12px; }

/* ----------------------------- calendar -------------------------------- */

.calendar-card { padding: 18px; }

.cal-weekhead { display: grid; grid-template-columns: repeat(7, 1fr); padding: 4px 2px 12px; }
.cal-weekhead span { font-size: 9px; letter-spacing: .14em; color: var(--muted); text-align: center; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }

.cal-cell {
  min-height: 112px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--soft);
  overflow: hidden;
}
.cal-cell.is-blank { background: rgba(244, 239, 231, .35); }
.cal-cell.is-today { background: rgba(176, 138, 90, .075); box-shadow: inset 0 0 0 1px rgba(176, 138, 90, .35); }
.cal-cell.has-orders { background: var(--card); }

.cal-day { display: flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.cal-day i { font-style: normal; font-size: 8px; color: var(--gold); border: 1px solid var(--gold-soft); border-radius: 999px; padding: 0 5px; }
.cal-cell.is-today .cal-day { color: var(--gold); }

.cal-items { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }

.cal-chip {
  display: flex;
  flex-direction: column;
  padding: 3px 6px;
  border-radius: 5px;
  border-left: 2px solid var(--muted-2);
  background: rgba(244, 239, 231, .7);
  line-height: 1.25;
}
.cal-chip b { font-size: 9.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip em { font-style: normal; font-size: 8px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.tone-blue { border-left-color: var(--blue); background: rgba(76, 99, 120, .07); }
.cal-chip.tone-gold { border-left-color: var(--gold); background: rgba(176, 138, 90, .09); }
.cal-chip.tone-violet { border-left-color: var(--violet); background: rgba(109, 90, 122, .07); }
.cal-chip.tone-green { border-left-color: var(--green); background: rgba(62, 107, 82, .07); }
.cal-more { font-size: 8.5px; color: var(--muted); padding-left: 2px; }

.cal-mobile-day { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cal-mobile-date { width: 58px; flex: none; display: flex; flex-direction: column; }
.cal-mobile-date b { font-family: var(--serif); font-size: 24px; line-height: 1; font-weight: 500; }
.cal-mobile-date span { font-size: 9px; color: var(--muted); margin-top: 3px; }
.cal-mobile-items { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.cal-mobile-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.cmi-main { display: flex; flex-direction: column; min-width: 0; }
.cmi-main b { font-size: 12px; }
.cmi-main em { font-style: normal; font-size: 10px; color: var(--muted); }
.cmi-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.cmi-side b { font-size: 11px; }

.unscheduled-list { display: flex; flex-direction: column; }
.unscheduled-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.unscheduled-item:first-child { border-top: 0; padding-top: 0; }
.unscheduled-item > span { display: flex; flex-direction: column; }
.unscheduled-item b { font-size: 12.5px; }
.unscheduled-item em { font-style: normal; font-size: 10.5px; color: var(--muted); }

/* ----------------------------- receivables ---------------------------- */

.due-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 34px;
  flex-wrap: wrap;
  padding: 28px 32px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.due-total { margin: 6px 0 4px; font-family: var(--serif); font-size: 48px; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.due-total .currency { font-size: .38em; vertical-align: .65em; color: var(--gold); margin-right: 6px; }
.due-hero p { font-size: 11px; color: var(--muted); }

.due-buckets { display: flex; gap: 28px; flex-wrap: wrap; }
.due-buckets > div { display: flex; flex-direction: column; gap: 4px; }
.due-buckets span { font-size: 9.5px; color: var(--muted); letter-spacing: .08em; }
.due-buckets b { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.due-buckets .is-danger b { color: var(--red); }

.due-note { display: flex; align-items: center; gap: 8px; margin: 14px 2px; font-size: 11px; color: var(--muted); }
.due-note .ic { width: 15px; height: 15px; color: var(--gold); }

.due-list { display: flex; flex-direction: column; gap: 10px; }

.due-item {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-2);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.due-item.tone-warm { border-left-color: var(--gold); }
.due-item.tone-warn { border-left-color: #c07a3e; }
.due-item.tone-danger { border-left-color: var(--red); background: linear-gradient(90deg, rgba(184, 74, 51, .035), var(--card) 45%); }

.due-main { flex: 1; min-width: 0; }
.due-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.due-title b { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.age-tag { font-family: var(--mono); font-size: 9.5px; color: var(--red); background: rgba(184, 74, 51, .07); padding: 2px 7px; border-radius: 999px; }
.age-tag.is-fresh { color: var(--muted); background: rgba(23, 24, 26, .05); }
.due-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; font-size: 10.5px; color: var(--muted); }

.due-amounts { display: flex; gap: 26px; flex: none; }
.due-amounts > div { display: flex; flex-direction: column; gap: 3px; }
.due-amounts span { font-size: 9px; color: var(--muted); letter-spacing: .08em; }
.due-amounts b { font-size: 13px; }
.due-actions { display: flex; gap: 8px; flex: none; }

/* ----------------------------- settings ------------------------------- */

.settings-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  width: fit-content;
  max-width: 100%;
}
.settings-nav a { padding: 7px 14px; border-radius: 999px; font-size: 11.5px; color: var(--muted); }
.settings-nav a:hover { background: var(--card); color: var(--ink); }

.settings-card { margin-bottom: 16px; padding: 26px; scroll-margin-top: 20px; }

.user-table { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.user-head {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.user-row {
  display: grid;
  grid-template-columns: 36px 1.35fr .6fr 1.15fr .7fr .5fr .95fr .85fr;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.user-main { display: flex; flex-direction: column; min-width: 0; }
.user-main b { font-size: 12.5px; }
.user-main span { font-size: 10px; color: var(--muted); }
.user-role { font-size: 10.5px; }
.role-admin { color: var(--gold); }
.role-finance { color: var(--blue); }
.user-scope, .user-device, .user-login { font-size: 10.5px; color: var(--muted); }
.user-status { font-size: 10.5px; }
.user-status.is-on { color: var(--green); }
.user-status.is-off { color: var(--red); }
.user-actions { display: flex; gap: 5px; justify-content: flex-end; }

.add-panel { margin-top: 16px; border-top: 1px dashed var(--line-2); padding-top: 14px; }
.add-panel summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  font-size: 12px;
  color: var(--gold);
  cursor: pointer;
  list-style: none;
}
.add-panel summary::-webkit-details-marker { display: none; }
.add-panel summary .ic { width: 14px; height: 14px; }
.add-panel[open] summary { margin-bottom: 14px; }

.settings-hint { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; font-size: 10.5px; line-height: 1.8; color: var(--muted); }
.settings-hint .ic { width: 15px; height: 15px; color: var(--gold); margin-top: 1px; }

.product-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.product-row { display: flex; align-items: center; gap: 18px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.product-row.is-off { opacity: .45; }
.product-main { flex: 1; display: flex; flex-direction: column; }
.product-main b { font-size: 12.5px; }
.product-main span { font-size: 10px; color: var(--muted); }

.audit-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); max-height: 460px; overflow: auto; }
.audit-row { display: grid; grid-template-columns: 110px 80px 90px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 10.5px; }
.audit-time { font-family: var(--mono); color: var(--muted); }
.audit-user { color: var(--ink-2); }
.audit-action { color: var(--gold); }
.audit-detail { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.backup-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.backup-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.backup-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: rgba(176, 138, 90, .09); color: var(--gold); }
.backup-icon .ic { width: 14px; height: 14px; }
.backup-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.backup-main b { font-size: 11.5px; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; }
.backup-main span { font-size: 10px; color: var(--muted); }

/* ----------------------------- profile -------------------------------- */

.profile-card {
  border-radius: 24px;
  padding: 28px 30px;
  background:
    radial-gradient(110% 140% at 92% 0%, rgba(176, 138, 90, .32), transparent 55%),
    #202123;
  color: #f7f1e7;
  box-shadow: 0 34px 70px -50px rgba(23, 24, 26, .65);
  margin-bottom: 16px;
}
.profile-card .avatar { background: rgba(255, 255, 255, .12); color: #f7f1e7; }
.profile-top { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.profile-main { flex: 1; }
.profile-main h2 { font-size: 26px; font-weight: 500; }
.profile-main p { margin-top: 2px; font-size: 11.5px; color: rgba(247, 241, 231, .55); }
.profile-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: rgba(247, 241, 231, .6); border: 1px solid rgba(247, 241, 231, .18); border-radius: 999px; padding: 4px 10px; }
.profile-badge .ic { width: 12px; height: 12px; color: var(--gold-2); }
.profile-meta { display: flex; gap: 40px; flex-wrap: wrap; margin-top: 24px; padding-top: 18px; border-top: 1px solid rgba(247, 241, 231, .14); position: relative; z-index: 1; }
.profile-meta > div { display: flex; flex-direction: column; gap: 3px; }
.profile-meta span { font-size: 9px; letter-spacing: .1em; color: rgba(247, 241, 231, .45); }
.profile-meta b { font-size: 12px; font-weight: 500; }
.profile-actions { display: flex; gap: 8px; margin-top: 22px; position: relative; z-index: 1; }
.profile-actions .btn-ghost { border-color: rgba(247, 241, 231, .2); color: rgba(247, 241, 231, .8); background: transparent; }
.profile-actions .btn-ghost:hover { border-color: var(--gold); color: #fff; }

.demo-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 11px 16px;
  border: 1px solid rgba(176, 138, 90, .28);
  border-radius: 12px;
  background: rgba(176, 138, 90, .07);
  font-size: 11px;
  color: #6f5634;
}
.demo-banner .ic { width: 15px; height: 15px; color: var(--gold); }
.demo-banner a { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--gold); white-space: nowrap; }
.demo-banner a .ic { width: 13px; height: 13px; }

.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #9c3a25; border-color: #9c3a25; color: #fff; }

.danger-card { border-color: rgba(184, 74, 51, .22); }
.danger-text { font-size: 11.5px; line-height: 1.9; color: var(--muted); }
.danger-form { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.danger-form input {
  flex: 1;
  min-width: 180px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(184, 74, 51, .3);
  border-radius: 12px;
  background: #fffdf9;
  font: inherit;
  font-size: 12.5px;
  outline: none;
}
.danger-form input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(184, 74, 51, .1); }

.install-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.install-steps > div { padding: 14px 16px; border-radius: 12px; background: rgba(244, 239, 231, .55); }
.install-steps b { font-size: 11px; letter-spacing: .06em; color: var(--gold); }
.install-steps p { margin-top: 4px; font-size: 11.5px; line-height: 1.8; color: var(--ink-2); }

/* ----------------------------- empty ---------------------------------- */

.empty { padding: 60px 20px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--soft); }
.empty-mark { width: 52px; height: 52px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--gold-soft); color: var(--gold); }
.empty h3 { font-size: 19px; font-weight: 500; }
.empty p { margin: 6px auto 18px; max-width: 340px; font-size: 11.5px; color: var(--muted); }

/* ----------------------------- auth ----------------------------------- */

.auth-body { background: #111214; }

.auth-shell { display: grid; grid-template-columns: 1.08fr .92fr; min-height: 100vh; }

.auth-art {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 52px;
  background:
    radial-gradient(95% 110% at 82% 8%, rgba(176, 138, 90, .52), transparent 54%),
    radial-gradient(80% 100% at 0% 100%, rgba(184, 74, 51, .24), transparent 58%),
    #141517;
  color: #f4ede2;
}

.auth-art > * { position: relative; z-index: 1; }

.auth-art-top { display: flex; align-items: center; gap: 12px; }
.auth-logo { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(201, 166, 120, .6); border-radius: 50%; color: var(--gold-2); }
.auth-logo .ic { width: 20px; height: 20px; }
.auth-wordmark { font-family: var(--serif); font-size: 19px; letter-spacing: .18em; }

.auth-art-copy { max-width: 460px; }
.auth-art-copy .eyebrow { color: rgba(244, 237, 226, .4); }
.auth-art-copy h1 {
  margin-top: 22px;
  font-family: var(--serif);
  font-size: clamp(42px, 5vw, 66px);
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: -.02em;
}
.auth-art-copy h1 em { font-style: italic; color: var(--gold-2); }
.auth-art-sub { margin-top: 26px; font-size: 12px; line-height: 2.1; color: rgba(244, 237, 226, .5); letter-spacing: .04em; }

.auth-art-foot { display: flex; flex-direction: column; gap: 12px; }
.auth-art-foot .rule { display: block; width: 46px; height: 1px; background: rgba(201, 166, 120, .5); }
.auth-art-foot p { font-size: 8.5px; letter-spacing: .22em; color: rgba(244, 237, 226, .3); }

.auth-panel { display: grid; place-items: center; padding: 40px; background: var(--paper); }

.auth-box { width: 100%; max-width: 360px; }
.auth-box h2 { font-size: 32px; font-weight: 500; }
.auth-sub { margin-top: 6px; margin-bottom: 28px; font-size: 11.5px; color: var(--muted); }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form .btn { margin-top: 6px; }

.auth-error { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 18px; padding: 11px 13px; border: 1px solid rgba(184, 74, 51, .25); border-radius: 10px; background: rgba(184, 74, 51, .06); color: var(--red); font-size: 11.5px; line-height: 1.6; }
.auth-error .ic { width: 16px; height: 16px; margin-top: 1px; }

.auth-foot { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.auth-note { font-size: 10.5px; color: var(--muted); line-height: 1.8; }
.auth-note a { color: var(--gold); }

/* ----------------------------- receipt -------------------------------- */

.receipt-body { background: #e9e2d7; padding: 30px 20px 60px; }

.receipt-toolbar {
  max-width: 760px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.receipt {
  position: relative;
  overflow: hidden;
  max-width: 760px;
  margin: 0 auto;
  padding: 52px 56px 46px;
  background: #fffdf8;
  border: 1px solid rgba(23, 24, 26, .08);
  box-shadow: 0 40px 80px -50px rgba(23, 24, 26, .45);
}

.receipt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.receipt-brand { display: flex; align-items: center; gap: 13px; }
.receipt-mark { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); }
.receipt-mark .ic { width: 22px; height: 22px; }
.receipt-brand h1 { font-size: 21px; font-weight: 600; letter-spacing: .1em; }
.receipt-brand p { margin-top: 2px; font-size: 9.5px; color: var(--muted); letter-spacing: .1em; }
.receipt-title { text-align: right; }
.receipt-title span { font-size: 8px; letter-spacing: .3em; color: var(--gold); }
.receipt-title h2 { margin-top: 3px; font-size: 22px; font-weight: 500; letter-spacing: .08em; }

.receipt-rule { height: 1px; margin: 28px 0 24px; background: var(--line-2); }

.receipt-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 30px; }
.receipt-meta > div, .receipt-detail > div { display: flex; flex-direction: column; gap: 2px; }
.receipt-meta span, .receipt-detail span { font-size: 9px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.receipt-meta b, .receipt-detail b { font-size: 12px; font-weight: 500; }

.receipt-amount { margin: 30px 0 28px; padding: 22px 26px; border-radius: 4px; background: rgba(244, 239, 231, .55); border-left: 2px solid var(--gold); }
.receipt-label { font-size: 9px; letter-spacing: .14em; color: var(--muted); }
.receipt-number { margin: 6px 0 4px; font-family: var(--serif); font-size: 44px; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.receipt-number span { font-size: .4em; vertical-align: .65em; color: var(--gold); margin-right: 5px; }
.receipt-upper { font-size: 11px; color: var(--ink-2); letter-spacing: .04em; }

.receipt-detail { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.receipt-detail > div.span-2 { grid-column: span 3; }

.receipt-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 26px; margin-top: 46px; }
.receipt-thanks p { font-family: var(--serif); font-size: 12px; color: var(--ink-2); }
.receipt-thanks span { display: block; margin-top: 6px; font-size: 9px; color: var(--muted); letter-spacing: .06em; }

.receipt-stamp {
  width: 92px;
  height: 92px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1.5px solid rgba(184, 74, 51, .55);
  border-radius: 50%;
  color: rgba(184, 74, 51, .72);
  transform: rotate(-8deg);
  font-family: var(--serif);
}
.receipt-stamp span { font-size: 9px; letter-spacing: .04em; }
.receipt-stamp em { font-style: normal; font-size: 13px; letter-spacing: .14em; }

.receipt-watermark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 100px;
  color: rgba(184, 74, 51, .08);
  transform: rotate(-24deg);
  pointer-events: none;
}

.receipt-tip { max-width: 760px; margin: 18px auto 0; text-align: center; font-size: 10px; color: var(--muted); }

/* ----------------------------- tabbar --------------------------------- */

.tabbar { display: none; }

/* ----------------------------- animations ----------------------------- */

.rise { animation: rise .65s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--d, 0) * 55ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ----------------------------- responsive ----------------------------- */

@media (max-width: 1180px) {
  .customer-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .dash-2col { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1.4fr .9fr; }
  .user-row { grid-template-columns: 36px 1.4fr .7fr 1.2fr .8fr 1fr; }
  .user-device, .user-login { display: none; }
}

@media (max-width: 960px) {
  .only-desktop { display: none !important; }
  .only-mobile { display: initial !important; }
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar { height: 64px; padding: 0 18px; border-bottom: 1px solid var(--line); background: var(--topbar-bg); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 20; }
  .topbar-date { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 9px; }
  .mobile-brand .brand-mark { width: 32px; height: 32px; }
  .mobile-brand .brand-mark .ic { width: 16px; height: 16px; }
  .mobile-brand b {
    font-family: var(--serif); font-size: 17px; letter-spacing: .03em; font-weight: 600;
    max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .avatar-link { display: block; }
  .avatar-link .avatar { width: 32px; height: 32px; font-size: 13px; }
  .content { padding: 18px 18px 30px; }
  .app-foot { padding: 18px 18px calc(84px + env(safe-area-inset-bottom)); }
  .page-head { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 20px; }
  .page-head h1 { font-size: 27px; }
  .page-head p { font-size: 11.5px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .hero { padding: 24px 22px; border-radius: 20px; }
  .hero-amount { font-size: 46px; }
  .hero-grid { gap: 24px; }
  .hero-grid b { font-size: 14px; }
  .hero-chip { display: none; }
  .stats-row { gap: 10px; margin-top: 12px; }
  .stat { padding: 14px 16px; }
  .stat-value { font-size: 22px; }
  .dash-2col { gap: 12px; margin-top: 12px; }
  .card { padding: 18px; border-radius: 16px; }
  .order-thead { display: none; }
  .order-row {
    grid-template-columns: 1fr auto auto;
    gap: 5px 12px;
    padding: 14px 16px;
    font-size: 11.5px;
  }
  .order-row .oc-main { grid-column: 1 / -1; }
  .order-row .oc-type, .order-row .oc-date, .order-row .oc-owner, .order-row > .num:nth-child(6) { display: none; }
  .order-row .ta-r { text-align: left; }
  .order-row .badge { justify-self: end; }
  .order-table.compact .order-row { grid-template-columns: 1fr auto auto; }
  .order-table.compact .oc-type, .order-table.compact .oc-owner, .order-table.compact .oc-date { display: none; }

  .detail-grid { grid-template-columns: 1fr; }
  .finance-due { font-size: 36px; }
  .finance-rows { grid-template-columns: 1fr 1fr; }
  .customer-grid { grid-template-columns: 1fr; }
  .quick-wrap { max-width: none; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .form-card { padding: 20px; }
  .form-row.two { grid-template-columns: 1fr; }
  .filter-bar { gap: 8px; }
  .search-box { min-width: 0; width: 100%; }
  .filter-bar select { flex: 1; }
  .summary-strip { gap: 22px; padding: 14px 18px; }
  .summary-strip b { font-size: 14px; }
  .due-hero { padding: 22px; gap: 20px; }
  .due-total { font-size: 38px; }
  .due-buckets { gap: 18px; }
  .due-item { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; }
  .due-amounts { justify-content: space-between; gap: 10px; }
  .due-actions { justify-content: flex-end; }
  .settings-nav { border-radius: 16px; width: 100%; }
  .settings-nav a { flex: 1; text-align: center; padding: 7px 6px; }
  .user-head { display: none; }
  .user-row { grid-template-columns: 32px 1fr auto; gap: 8px; padding: 12px 0; }
  .user-role, .user-scope, .user-device, .user-login, .user-status { display: none; }
  .user-actions { grid-column: 3; }
  .product-row { gap: 10px; }
  .audit-row { grid-template-columns: 92px 62px 1fr; }
  .audit-detail { display: none; }
  .install-steps { grid-template-columns: 1fr; }
  .profile-meta { gap: 20px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { min-height: 100vh; padding: 28px; background: var(--paper); }
  .auth-box::before {
    content: "Tamkin账本";
    display: block;
    margin-bottom: 28px;
    font-family: var(--serif);
    font-size: 15px;
    letter-spacing: .22em;
    color: var(--gold);
  }
  .tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    height: calc(64px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--soft-strong);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--line);
  }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 9px; color: var(--muted); }
  .tab .ic { width: 20px; height: 20px; }
  .tab.is-active { color: var(--ink); }
  .tab.is-active .ic { color: var(--gold); }
  .tab-fab { position: relative; }
  .tab-fab .fab {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ink);
    color: var(--gold-2);
    box-shadow: 0 12px 26px -10px rgba(23, 24, 26, .55);
  }
  .tab-fab .fab .ic { width: 22px; height: 22px; }
  .tab-fab em { position: absolute; bottom: 7px; font-style: normal; font-size: 8.5px; color: var(--muted); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .receipt-body { padding: 16px 10px 50px; }
  .receipt { padding: 30px 22px; }
  .receipt-meta { grid-template-columns: 1fr; gap: 8px; }
  .receipt-detail { grid-template-columns: 1fr 1fr; }
  .receipt-detail > div.span-2 { grid-column: span 2; }
  .receipt-number { font-size: 34px; }
  .receipt-foot { margin-top: 30px; }
  .calendar-card.only-desktop { display: none !important; }
}

@media (max-width: 520px) {
  .hero-grid { gap: 18px 26px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 19px; }
  .page-head h1 { font-size: 24px; }
  .hero-amount { font-size: 40px; }
  .bar-chart { height: 160px; }
  .bar-val { display: none; }
  .finance-rows { grid-template-columns: 1fr 1fr; }
  .due-amounts { gap: 8px; }
  .due-amounts b { font-size: 12px; }
  .settings-card { padding: 18px; }
  .form-section-head h2 { font-size: 16px; }
  .auth-box h2 { font-size: 27px; }
  .receipt-title h2 { font-size: 18px; }
  .receipt-brand h1 { font-size: 17px; }
}

/* ----------------------------- print ---------------------------------- */

@media print {
  @page { size: A5 portrait; margin: 10mm; }

  body.receipt-body {
    background: #fff;
    padding: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .no-print { display: none !important; }

  .receipt {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 8mm 10mm;
    border: 0;
    box-shadow: none;
  }

  .receipt-amount { background: #f7f3ec !important; }
  .receipt-rule { background: #bbb; }
  .receipt-stamp { border-color: #b84a33; color: #b84a33; }
}

/* ============================================================
   P2 · 客户查单 / 报表 / 结算 / 押金 / 回收站
   ============================================================ */

/* ----------------------------- client page ---------------------------- */

.client-body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 100% -6%, rgba(176, 138, 90, .16), transparent 60%),
    var(--paper);
  padding: 34px 18px 60px;
}

.client-shell {
  max-width: 780px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 40px 90px -55px rgba(23, 24, 26, .5);
}

.client-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 34px;
  background:
    radial-gradient(100% 140% at 88% 0%, rgba(176, 138, 90, .38), transparent 55%),
    #1a1b1d;
  color: #f7f1e7;
}

.client-brand { display: flex; align-items: center; gap: 12px; }
.client-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid rgba(201, 166, 120, .6); border-radius: 50%; color: var(--gold-2);
}
.client-mark .ic { width: 21px; height: 21px; }
.client-brand b { display: block; font-family: var(--serif); font-size: 18px; letter-spacing: .12em; font-weight: 600; }
.client-brand span { display: block; margin-top: 2px; font-size: 9px; letter-spacing: .12em; color: rgba(247, 241, 231, .5); }
.client-eyebrow { font-size: 8.5px; letter-spacing: .2em; color: rgba(247, 241, 231, .45); }

.client-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 34px 34px 26px;
}

.client-label { font-size: 9.5px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.client-hero h1 { margin-top: 7px; font-size: clamp(24px, 3.4vw, 34px); font-weight: 500; letter-spacing: -.02em; }
.client-sub { margin-top: 8px; font-size: 11.5px; color: var(--muted); line-height: 1.8; }

.client-status {
  flex: none;
  margin-top: 6px;
  padding: 5px 12px;
  border: 1px solid rgba(62, 107, 82, .25);
  border-radius: 999px;
  background: rgba(62, 107, 82, .07);
  color: var(--green);
  font-size: 10.5px;
}
.client-status.is-cancelled { border-color: rgba(184, 74, 51, .25); background: rgba(184, 74, 51, .06); color: var(--red); }

.client-progress {
  display: flex;
  gap: 0;
  padding: 0 34px 30px;
}

.client-step { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.client-step::before {
  content: "";
  position: absolute;
  top: 13px; left: 0; right: 50%;
  height: 1px;
  background: var(--line-2);
}
.client-step:first-child::before { display: none; }
.client-step.is-done::before, .client-step.is-current::before { background: var(--gold); }
.client-dot {
  position: relative; z-index: 1;
  width: 27px; height: 27px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--card);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}
.client-dot .ic { width: 12px; height: 12px; }
.client-step.is-done .client-dot { background: var(--ink); border-color: var(--ink); color: var(--gold-2); }
.client-step.is-current .client-dot { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 0 4px rgba(176, 138, 90, .12); }
.client-step em { font-style: normal; font-size: 9px; color: var(--muted); }
.client-step.is-current em { color: var(--ink); }
.client-step.is-done em { color: var(--ink-2); }

.client-money {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin: 0 34px;
  padding: 24px 26px;
  border-radius: 16px;
  background:
    radial-gradient(110% 150% at 90% 10%, rgba(176, 138, 90, .22), transparent 55%),
    #1b1c1e;
  color: #f7f1e7;
}
.client-money-main { min-width: 0; }
.client-money .client-label { color: rgba(247, 241, 231, .5); }
.client-amount {
  display: block;
  margin: 6px 0 4px;
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.client-amount i { font-style: normal; font-size: .42em; vertical-align: .62em; margin-right: 5px; color: var(--gold-2); }
.client-money-main p { font-size: 10.5px; color: rgba(247, 241, 231, .55); }
.client-money-side { display: flex; gap: 26px; flex-wrap: wrap; align-items: center; }
.client-money-side > div { display: flex; flex-direction: column; gap: 3px; }
.client-money-side span { font-size: 9px; letter-spacing: .08em; color: rgba(247, 241, 231, .45); }
.client-money-side b { font-family: var(--mono); font-size: 12.5px; font-weight: 500; }

.client-section { padding: 30px 34px 6px; }
.client-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.client-section-head h2 { font-size: 16px; }
.client-section-head span { font-size: 9px; color: var(--muted); letter-spacing: .1em; }

.client-payments { border-top: 1px solid var(--line); }
.client-pay { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.client-pay-icon {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center;
  border-radius: 50%; background: rgba(62, 107, 82, .08); color: var(--green);
}
.client-pay-icon .ic { width: 13px; height: 13px; }
.client-pay-main { flex: 1; display: flex; flex-direction: column; }
.client-pay-main b { font-size: 12px; }
.client-pay-main em { font-style: normal; font-size: 10px; color: var(--muted); }
.client-pay-amount { font-family: var(--mono); font-size: 12px; color: var(--green); }
.client-pay-amount.is-out { color: var(--red); }
.client-empty { padding: 14px 0; font-size: 11px; color: var(--muted); }

.client-contact {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 28px 34px 0;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.client-contact h2 { margin-top: 4px; font-size: 17px; }
.client-contact-lines { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 11px; color: var(--ink-2); }
.client-contact-lines a, .client-contact-lines span { display: inline-flex; align-items: center; gap: 5px; }
.client-contact-lines .ic { width: 13px; height: 13px; color: var(--gold); }

.client-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 34px 24px;
  font-size: 9.5px;
  color: var(--muted);
}
.client-cancel { margin: 0 34px 24px; padding: 12px 14px; border-radius: 10px; background: rgba(184, 74, 51, .06); color: var(--red); font-size: 11.5px; }

@media (max-width: 640px) {
  .client-body { padding: 12px 10px 40px; }
  .client-head { padding: 20px 20px; }
  .client-hero { padding: 24px 20px 20px; flex-direction: column; gap: 8px; }
  .client-status { margin-top: 0; }
  .client-progress { padding: 0 14px 24px; }
  .client-step em { font-size: 8px; }
  .client-money { margin: 0 20px; padding: 20px; flex-direction: column; gap: 16px; }
  .client-money-side { justify-content: space-between; gap: 12px; }
  .client-amount { font-size: 34px; }
  .client-section { padding: 24px 20px 4px; }
  .client-contact { margin: 22px 20px 0; flex-direction: column; align-items: flex-start; }
  .client-contact-lines { align-items: flex-start; }
  .client-foot { padding: 14px 20px 20px; flex-direction: column; align-items: flex-start; }
}

/* ----------------------------- reports -------------------------------- */

.report-range { font-size: 10.5px; color: var(--muted); letter-spacing: .06em; }

.report-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  padding: 28px 32px;
  border-radius: 22px;
  background:
    radial-gradient(110% 150% at 88% 0%, rgba(176, 138, 90, .36), transparent 56%),
    #1a1b1d;
  color: #f7f1e7;
  box-shadow: 0 34px 70px -52px rgba(23, 24, 26, .65);
}
.report-hero .eyebrow { color: rgba(247, 241, 231, .45); }
.report-profit {
  margin: 8px 0 4px;
  font-family: var(--serif);
  font-size: clamp(38px, 4.5vw, 54px);
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.report-hero-main p { font-size: 10.5px; color: rgba(247, 241, 231, .5); }
.report-hero-side { display: flex; gap: 30px; flex-wrap: wrap; }
.report-hero-side > div { display: flex; flex-direction: column; gap: 3px; }
.report-hero-side span { font-size: 9px; letter-spacing: .09em; color: rgba(247, 241, 231, .45); }
.report-hero-side b { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.report-hero-side b.ink-red { color: #e3a28e !important; }

.report-week {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 16px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}
.report-week-head { display: flex; flex-direction: column; gap: 3px; }
.report-week-head .eyebrow { color: var(--gold); }
.report-week-head b { font-size: 11.5px; font-weight: 500; }
.report-week-grid { display: flex; gap: 30px; flex-wrap: wrap; }
.report-week-grid > div { display: flex; flex-direction: column; gap: 2px; }
.report-week-grid span { font-size: 9px; color: var(--muted); }
.report-week-grid b { font-size: 14px; font-weight: 500; }

.report-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; align-items: start; }

.report-table { border-top: 1px solid var(--line); }
.report-thead, .report-row {
  display: grid;
  grid-template-columns: 1.3fr .55fr .9fr .9fr .9fr;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
}
.report-thead { font-size: 8.5px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--line); }
.report-row { border-bottom: 1px solid var(--line); font-size: 11.5px; }
.report-row:last-child { border-bottom: 0; }
.report-row .num { font-size: 11px; }

.report-due { border-top: 1px solid var(--line); }
.report-due-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.report-due-row:last-child { border-bottom: 0; }
.report-due-row > span { display: flex; flex-direction: column; }
.report-due-row b { font-size: 12px; }
.report-due-row em { font-style: normal; font-size: 10px; color: var(--muted); }

/* ----------------------------- settlements ----------------------------- */

.settle-person { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
.settle-person .avatar { width: 28px; height: 28px; font-size: 12px; }

.settlement-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  padding: 26px 30px;
  border-radius: 20px;
  background:
    radial-gradient(100% 140% at 92% 0%, rgba(176, 138, 90, .28), transparent 55%),
    #1b1c1e;
  color: #f7f1e7;
  margin-bottom: 16px;
}
.settlement-hero .eyebrow { color: rgba(247, 241, 231, .45); }
.settlement-amount {
  margin: 7px 0 3px;
  font-family: var(--serif);
  font-size: 44px;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.settlement-amount span { font-size: .42em; vertical-align: .6em; margin-right: 5px; color: var(--gold-2); }
.settlement-hero-main p { font-size: 10.5px; color: rgba(247, 241, 231, .5); }
.settlement-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.settlement-stats > div { display: flex; flex-direction: column; gap: 3px; }
.settlement-stats span { font-size: 9px; letter-spacing: .08em; color: rgba(247, 241, 231, .45); }
.settlement-stats b { font-family: var(--mono); font-size: 12.5px; font-weight: 500; }
.settlement-stats b.ink-gold { color: var(--gold-2) !important; }

.settle-table { border-top: 1px solid var(--line); }
.settle-thead, .settle-row {
  display: grid;
  grid-template-columns: 1.7fr .8fr .8fr .8fr .8fr .8fr;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
}
.settle-thead { font-size: 8.5px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--line); }
.settle-row { border-bottom: 1px solid var(--line); font-size: 11.5px; transition: .2s; }
.settle-row:last-child { border-bottom: 0; }
a.settle-row:hover { background: rgba(176, 138, 90, .05); }
.settle-main { display: flex; flex-direction: column; min-width: 0; }
.settle-main b { font-size: 12px; }
.settle-main em { font-style: normal; font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.settle-form { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.settle-form .form-actions { margin-top: 14px; padding-top: 0; border-top: 0; }

.settle-list { border-top: 1px solid var(--line); }
.settle-history { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.settle-history-main { flex: 1; display: flex; flex-direction: column; }
.settle-history-main b { font-size: 12.5px; }
.settle-history-main em { font-style: normal; font-size: 10px; color: var(--muted); }
.settle-history .num { font-size: 12px; }
.settle-status {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid rgba(176, 138, 90, .3);
  background: rgba(176, 138, 90, .07);
  color: var(--gold);
  font-size: 9.5px;
  white-space: nowrap;
}
.settle-status.is-paid { border-color: rgba(62, 107, 82, .28); background: rgba(62, 107, 82, .07); color: var(--green); }

.settle-sheet { padding: 34px 38px; }
.settle-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.settle-sheet-head h2 { margin-top: 6px; font-size: 24px; font-weight: 500; }
.settle-sheet-head p { margin-top: 5px; font-size: 10.5px; color: var(--muted); }
.settle-sheet-total { padding: 22px 0; border-bottom: 1px solid var(--line); }
.settle-sheet-total > span { font-size: 9px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.settle-sheet-total strong { display: block; margin: 5px 0 3px; font-family: var(--serif); font-size: 40px; line-height: 1; font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.settle-sheet-total p { font-size: 10.5px; color: var(--muted); }
.settle-sheet-foot { display: flex; gap: 30px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.settle-sheet-foot > div { display: flex; flex-direction: column; gap: 2px; }
.settle-sheet-foot span { font-size: 9px; color: var(--muted); }
.settle-sheet-foot b { font-family: var(--mono); font-size: 12px; font-weight: 500; }
.settle-sheet-actions { display: flex; align-items: center; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px dashed var(--line-2); flex-wrap: wrap; }
.settle-paid-note { font-size: 10.5px; color: var(--green); }

/* ----------------------------- hold / trash ---------------------------- */

.hold-card { margin: 16px 0; padding: 20px 24px; border: 1px solid rgba(176, 138, 90, .24); border-radius: 16px; background: rgba(176, 138, 90, .05); }
.hold-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.hold-head h2 { font-size: 16px; }
.hold-head p { margin-top: 3px; font-size: 10.5px; color: var(--muted); }
.hold-head > span { font-size: 10px; color: var(--gold); }
.hold-list { display: flex; flex-direction: column; }
.hold-row { display: flex; align-items: center; gap: 16px; padding: 9px 0; border-top: 1px solid rgba(176, 138, 90, .16); }
.hold-row:first-child { border-top: 0; }
.hold-main { flex: 1; display: flex; flex-direction: column; }
.hold-main b { font-size: 12px; }
.hold-main em { font-style: normal; font-size: 9.5px; color: var(--muted); }
.hold-amount { font-size: 12px; color: var(--gold); }
.hold-due { font-size: 9.5px; color: var(--muted); width: 118px; text-align: right; }
.hold-due.is-overdue { color: var(--red); }
.hold-due.is-soon { color: var(--gold); }

.trash-list { border-top: 1px solid var(--line); }
.trash-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.trash-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.trash-main b { font-size: 12.5px; }
.trash-main span { font-size: 10px; color: var(--muted); }
.trash-row .num { font-size: 12px; }

.share-box { display: flex; gap: 8px; }
.share-box input {
  flex: 1; min-width: 0; height: 34px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: 8px;
  background: rgba(244, 239, 231, .5);
  font-family: var(--mono); font-size: 9.5px; color: var(--ink-2); outline: none;
}
.share-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; }
.link-danger { border: 0; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.link-danger:hover { color: var(--red); }
.danger-btn { color: var(--red) !important; }
.danger-btn:hover { border-color: var(--red) !important; }

@media (max-width: 960px) {
  .report-2col { grid-template-columns: 1fr; }
  .report-hero { flex-direction: column; align-items: flex-start; gap: 20px; }
  .report-hero-side { justify-content: space-between; width: 100%; gap: 12px; }
  .report-week { gap: 14px; }
  .report-week-grid { gap: 18px; }
  .settlement-hero { flex-direction: column; align-items: flex-start; gap: 18px; }
  .settlement-stats { justify-content: space-between; width: 100%; gap: 12px; }
  .settle-thead, .settle-row { grid-template-columns: 1.5fr .8fr .8fr .9fr; }
  .settle-thead > span:nth-child(4), .settle-thead > span:nth-child(5),
  .settle-row > span:nth-child(4), .settle-row > span:nth-child(5) { display: none; }
  .settle-sheet { padding: 22px 20px; }
  .settle-sheet-head h2 { font-size: 20px; }
  .settle-sheet-total strong { font-size: 32px; }
  .hold-row { flex-wrap: wrap; gap: 6px 12px; }
  .hold-main { flex-basis: 100%; }
  .hold-due { width: auto; text-align: left; }
  .report-table .report-thead, .report-table .report-row { grid-template-columns: 1.1fr .5fr .9fr .9fr; }
  .report-table .report-thead > span:nth-child(4), .report-table .report-row > span:nth-child(4) { display: none; }
}

@media print {
  .client-body { background: #fff; padding: 0; }
  .client-shell { box-shadow: none; border: 0; max-width: none; border-radius: 0; }
  .client-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .client-money { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .settle-sheet { border: 0; box-shadow: none; }
}

/* ----------------------------- bill import ----------------------------- */

.import-summary {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(244, 239, 231, .55);
}
.import-summary > div { display: flex; flex-direction: column; gap: 2px; }
.import-summary span { font-size: 9px; letter-spacing: .08em; color: var(--muted); }
.import-summary b { font-size: 14px; font-weight: 500; }

.import-table { border-top: 1px solid var(--line); }

.import-thead, .import-row {
  display: grid;
  grid-template-columns: 82px 1.55fr .75fr 1.45fr .55fr;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
}

.import-thead {
  font-size: 8.5px;
  letter-spacing: .1em;
  color: var(--muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.import-row { border-bottom: 1px solid var(--line); font-size: 11px; }
.import-row:last-child { border-bottom: 0; }
.import-row.is-imported { opacity: .48; }
.import-main { display: flex; flex-direction: column; min-width: 0; }
.import-main b { font-size: 11.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.import-main em { font-style: normal; font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.import-row select {
  width: 100%;
  height: 34px;
  padding: 0 26px 0 9px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #fffdf9;
  font: inherit;
  font-size: 10px;
  color: var(--ink-2);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238C857B' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  outline: none;
}

.import-conf {
  justify-self: end;
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.import-conf.green { color: var(--green); border-color: rgba(62, 107, 82, .25); background: rgba(62, 107, 82, .06); }
.import-conf.gold { color: var(--gold); border-color: rgba(176, 138, 90, .25); background: rgba(176, 138, 90, .06); }
.import-conf.red { color: var(--red); border-color: rgba(184, 74, 51, .25); background: rgba(184, 74, 51, .06); }

@media (max-width: 960px) {
  .import-thead, .import-row { grid-template-columns: 1fr .7fr .55fr; }
  .import-thead > span:nth-child(2), .import-row > span:nth-child(2) { display: none; }
  .import-thead > span:nth-child(4), .import-row > span:nth-child(4) { grid-column: 1 / -1; }
  .import-row select { width: 100%; }
}

/* permission-aware tables */
.report-table.no-profit .report-thead,
.report-table.no-profit .report-row { grid-template-columns: 1.3fr .55fr .9fr .9fr; }
.report-table.no-profit .report-thead > span:nth-child(5),
.report-table.no-profit .report-row > span:nth-child(5) { display: none; }

.settle-table.no-cost .settle-thead,
.settle-table.no-cost .settle-row { grid-template-columns: 1.7fr .8fr .8fr .8fr .8fr; }

@media (max-width: 960px) {
  .settle-table.no-cost .settle-thead,
  .settle-table.no-cost .settle-row { grid-template-columns: 1.5fr .8fr .8fr .9fr; }
  .settle-table.no-cost .settle-thead > span:nth-child(4),
  .settle-table.no-cost .settle-row > span:nth-child(4) { display: none; }
  .settle-table.no-cost .settle-thead > span:nth-child(5),
  .settle-table.no-cost .settle-row > span:nth-child(5) { display: block; }
}

/* short screens */
@media (max-height: 820px) {
  .sidebar-note { display: none; }
  .sidebar { overflow-y: auto; }
  .profile-actions { flex-wrap: wrap; }
}
.profile-actions { flex-wrap: wrap; }

.existing-settlement {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 13px 16px;
  border: 1px solid rgba(62, 107, 82, .22);
  border-radius: 12px;
  background: rgba(62, 107, 82, .055);
  font-size: 11.5px;
  color: var(--green);
}
.existing-settlement .ic { width: 15px; height: 15px; }
.existing-settlement a { margin-left: auto; color: var(--ink); }

/* ----------------------------- attachments ----------------------------- */

.attach-form {
  padding: 16px;
  margin-bottom: 18px;
  border: 1px dashed var(--line-2);
  border-radius: 14px;
  background: rgba(244, 239, 231, .35);
}
.attach-form-row { display: grid; grid-template-columns: 1.3fr .7fr; gap: 12px; margin-bottom: 12px; align-items: end; }
.attach-form-row:last-of-type { grid-template-columns: 1fr auto; }
.attach-form .form-actions { margin-top: 12px; padding-top: 0; border-top: 0; }
.attach-public { min-height: 44px; }
.attach-file input[type="file"] { padding: 9px 12px; font-size: 11.5px; }
.field input[type="file"]::file-selector-button {
  height: 28px;
  margin-right: 10px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--card);
  font: inherit;
  font-size: 10.5px;
  color: var(--ink-2);
  cursor: pointer;
}

.attachment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.attachment-item {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--soft);
}
.attachment-item.is-portfolio { border-color: rgba(176, 138, 90, .3); }

.attachment-preview {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: rgba(23, 24, 26, .05);
}
.attachment-preview img { width: 100%; height: 100%; object-fit: cover; display: block; transition: .3s; }
.attachment-preview:hover img { transform: scale(1.03); }
.attachment-file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 100%; color: var(--muted); }
.attachment-file .ic { width: 26px; height: 26px; }
.attachment-file b { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; }

.attachment-meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.attachment-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag-public { color: var(--green); background: rgba(62, 107, 82, .09); }
.attachment-meta b { font-size: 11.5px; font-weight: 500; line-height: 1.5; }
.attachment-meta em { font-style: normal; font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.attachment-actions { display: flex; gap: 4px; padding: 0 8px 8px; flex-wrap: wrap; }
.attach-empty { display: flex; align-items: center; gap: 9px; padding: 18px 4px; color: var(--muted); font-size: 11.5px; }
.attach-empty .ic { width: 18px; height: 18px; color: var(--gold); }

/* ----------------------------- portfolio ------------------------------- */

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.portfolio-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: .25s;
}
.portfolio-card:hover { transform: translateY(-2px); border-color: var(--gold-soft); box-shadow: 0 26px 50px -40px rgba(23, 24, 26, .5); }

.portfolio-image { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: rgba(23, 24, 26, .06); }
.portfolio-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: .4s; }
.portfolio-card:hover .portfolio-image img { transform: scale(1.03); }

.portfolio-public {
  position: absolute;
  top: 9px; right: 9px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(23, 24, 26, .72);
  color: #f7f1e7;
  font-size: 8.5px;
  letter-spacing: .06em;
  backdrop-filter: blur(6px);
}

.portfolio-card figcaption { padding: 12px 14px 14px; }
.portfolio-main { display: flex; flex-direction: column; }
.portfolio-main b { font-size: 12.5px; }
.portfolio-main em { font-style: normal; font-size: 9.5px; color: var(--muted); }
.portfolio-card figcaption p { margin-top: 6px; font-size: 10.5px; color: var(--ink-2); line-height: 1.6; }
.portfolio-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; }

.client-gallery { padding: 28px 34px 0; }
.client-gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.client-gallery-grid a { position: relative; display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: rgba(23, 24, 26, .05); }
.client-gallery-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.client-gallery-grid span {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 9px 7px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .55));
  color: #fff; font-size: 9px;
}

@media (max-width: 1180px) {
  .portfolio-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 960px) {
  .attachment-grid { grid-template-columns: repeat(2, 1fr); }
  .attach-form-row, .attach-form-row:last-of-type { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .client-gallery { padding: 22px 20px 0; }
}

@media (max-width: 520px) {
  .attachment-grid { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .client-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ------------------------------ equipment ------------------------------ */

.equipment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.equipment-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.equipment-card.is-rented { border-color: rgba(176, 138, 90, .28); }

.equipment-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.equipment-icon {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--gold-soft); border-radius: 10px; color: var(--gold);
  background: rgba(176, 138, 90, .06);
}
.equipment-icon .ic { width: 19px; height: 19px; }

.eq-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 9.5px; color: var(--muted); white-space: nowrap;
}
.eq-status i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted-2); }
.eq-status.tone-green { color: var(--green); border-color: rgba(62, 107, 82, .22); background: rgba(62, 107, 82, .05); }
.eq-status.tone-green i { background: var(--green); }
.eq-status.tone-gold { color: var(--gold); border-color: rgba(176, 138, 90, .25); background: rgba(176, 138, 90, .06); }
.eq-status.tone-gold i { background: var(--gold); }
.eq-status.tone-red { color: var(--red); border-color: rgba(184, 74, 51, .22); background: rgba(184, 74, 51, .05); }
.eq-status.tone-red i { background: var(--red); }

.equipment-name h2 { font-size: 17px; font-weight: 600; }
.equipment-name p { margin-top: 3px; font-size: 10px; color: var(--muted); }
.equipment-money { display: flex; gap: 24px; }
.equipment-money > div { display: flex; flex-direction: column; gap: 2px; }
.equipment-money span { font-size: 9px; letter-spacing: .06em; color: var(--muted); }
.equipment-money b { font-family: var(--mono); font-size: 12px; font-weight: 500; }

.equipment-rental {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(176, 138, 90, .07);
  font-size: 9.5px; color: #7d603a;
}
.equipment-rental b { font-weight: 500; white-space: nowrap; }
.equipment-rental.is-overdue { background: rgba(184, 74, 51, .07); color: var(--red); }
.equipment-rental.is-free { background: rgba(62, 107, 82, .05); color: var(--green); }

.equipment-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }

.current-rental { display: flex; flex-direction: column; gap: 5px; }
.current-rental.is-overdue { color: var(--red); }
.current-rental-label { font-size: 9px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.current-rental b { font-family: var(--serif); font-size: 22px; font-weight: 500; }
.current-rental p { font-size: 11px; color: var(--muted); }
.current-rental-money { display: flex; gap: 16px; margin: 6px 0 12px; font-size: 10.5px; color: var(--ink-2); }

.rental-table { border-top: 1px solid var(--line); overflow-x: auto; }
.rental-thead, .rental-row {
  display: grid;
  grid-template-columns: 1.5fr .7fr .7fr .7fr .7fr .7fr .7fr;
  gap: 8px; align-items: center; padding: 9px 0;
}
.rental-thead { font-size: 8.5px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--line); }
.rental-row { border-bottom: 1px solid var(--line); font-size: 10.5px; }
.rental-row:last-child { border-bottom: 0; }
.rental-row.is-overdue { background: rgba(184, 74, 51, .035); }
.rental-main { display: flex; flex-direction: column; min-width: 0; }
.rental-main b { font-size: 11.5px; }
.rental-main em { font-style: normal; font-size: 9px; color: var(--muted); }

@media (max-width: 1180px) {
  .equipment-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .equipment-grid { grid-template-columns: 1fr; }
  .rental-thead > span:nth-child(3), .rental-row > span:nth-child(3),
  .rental-thead > span:nth-child(4), .rental-row > span:nth-child(4),
  .rental-thead > span:nth-child(6), .rental-row > span:nth-child(6) { display: none; }
  .rental-thead, .rental-row { grid-template-columns: 1.4fr .8fr .8fr .7fr; }
}

/* ------------------------- registration / recovery --------------------- */

.auth-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  font-size: 11.5px;
  color: var(--muted);
}
.auth-links a { color: var(--ink-2); transition: .2s; }
.auth-links a:hover { color: var(--gold); }
.auth-links i { width: 1px; height: 10px; background: var(--line-2); }

.auth-success {
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 16px; padding: 11px 13px;
  border: 1px solid rgba(62, 107, 82, .22);
  border-radius: 10px;
  background: rgba(62, 107, 82, .06);
  color: var(--green);
  font-size: 11.5px; line-height: 1.6;
}
.auth-success .ic { width: 16px; height: 16px; margin-top: 1px; }

.auth-notice {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; margin-bottom: 2px;
  border: 1px solid rgba(176, 138, 90, .24);
  border-radius: 10px;
  background: rgba(176, 138, 90, .06);
  color: #7d603a;
  font-size: 10.5px; line-height: 1.7;
}
.auth-notice .ic { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--gold); }

.auth-closed { text-align: center; padding: 10px 0; }
.auth-closed .ic { width: 28px; height: 28px; color: var(--gold); margin-bottom: 10px; }
.auth-closed h3 { font-size: 20px; margin-bottom: 8px; }
.auth-closed p { font-size: 11.5px; line-height: 1.9; color: var(--muted); margin-bottom: 14px; }
.auth-closed code {
  display: block; margin: 0 0 16px; padding: 10px 12px;
  border-radius: 8px; background: rgba(23, 24, 26, .05);
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-2);
  word-break: break-all;
}
.auth-closed .btn { margin-top: 4px; }

.keys-card { max-width: 880px; margin: 0 auto; padding: 38px 40px; }
.keys-intro { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.keys-intro > .ic { width: 26px; height: 26px; color: var(--gold); flex: none; margin-top: 2px; }
.keys-intro h2 { font-size: 22px; }
.keys-intro p { margin-top: 5px; font-size: 11.5px; line-height: 1.9; color: var(--muted); }

.keys-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.key-box {
  padding: 18px 20px;
  border: 1px solid rgba(176, 138, 90, .28);
  border-radius: 14px;
  background: rgba(176, 138, 90, .045);
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
.key-box.is-single { max-width: 520px; }
.key-label { font-size: 9px; letter-spacing: .12em; color: var(--gold); text-transform: uppercase; }
.key-value {
  font-family: var(--mono);
  font-size: clamp(16px, 2.2vw, 22px);
  letter-spacing: .05em;
  color: var(--ink);
  cursor: copy;
  word-break: break-all;
  user-select: all;
}
.key-box p { font-size: 10.5px; line-height: 1.8; color: var(--muted); }
.key-box .btn { margin-top: 2px; }

.keys-warn {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 20px; padding: 12px 14px;
  border-radius: 10px;
  background: rgba(184, 74, 51, .06);
  color: var(--red);
  font-size: 11px; line-height: 1.8;
}
.keys-warn .ic { width: 16px; height: 16px; flex: none; margin-top: 1px; }

.security-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.security-item {
  display: flex; flex-direction: column; gap: 9px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(244, 239, 231, .35);
}
.security-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.security-item-head b { font-size: 13px; }
.security-state { font-size: 9px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.security-state.is-on { color: var(--green); border-color: rgba(62, 107, 82, .25); background: rgba(62, 107, 82, .06); }
.security-item p { font-size: 11px; line-height: 1.8; color: var(--muted); }
.security-item small { font-size: 9.5px; color: var(--muted-2); }
.security-item form { margin-top: 2px; }

.security-banner { border-color: rgba(184, 74, 51, .2); background: rgba(184, 74, 51, .05); color: #7d3b2c; }
.security-banner .ic { color: var(--red); }

@media (max-width: 960px) {
  .keys-card { padding: 24px 20px; }
  .keys-grid, .security-grid { grid-template-columns: 1fr; }
}

/* ------------------------------ brand / footer ------------------------- */

.app-foot {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 18px 42px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.app-foot span {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--muted);
  text-transform: none;
}
.app-foot em { font-style: normal; }

.brand-settings {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 24px;
  align-items: start;
}
.brand-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(244, 239, 231, .38);
}
.brand-mark-lg {
  width: 66px;
  height: 66px;
  flex: none;
  border-width: 1px;
}
.brand-mark-lg .ic { width: 30px; height: 30px; }
.brand-mark-lg .brand-emoji { font-size: 31px; }
.brand-preview b {
  display: block;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .02em;
}
.brand-preview small {
  display: block;
  margin-top: 4px;
  font-size: 8px;
  letter-spacing: .2em;
  color: var(--muted);
}

.brand-form { min-width: 0; }
.brand-form .form-actions { align-items: center; justify-content: space-between; flex-wrap: wrap; }
.brand-hint { font-size: 9.5px; color: var(--muted); }

.emoji-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 10px;
  color: var(--muted);
}
.emoji-presets button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  font-size: 15px;
  cursor: pointer;
  transition: .2s;
}
.emoji-presets button:hover { border-color: var(--gold); background: rgba(176, 138, 90, .07); transform: translateY(-1px); }

.receipt-mark .brand-img, .client-mark .brand-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.receipt-mark .brand-emoji { font-size: 22px; }
.client-mark .brand-emoji { font-size: 21px; }

@media (max-width: 960px) {
  .app-foot { padding: 16px 18px calc(84px + env(safe-area-inset-bottom)); }
  .brand-settings { grid-template-columns: 1fr; }
}

/* ------------------------------ avatars / crop ------------------------- */

.avatar { overflow: hidden; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

.user-avatar-card { display: flex; flex-direction: column; gap: 14px; padding: 24px; margin-bottom: 18px; }
.user-avatar-preview { display: flex; align-items: center; gap: 16px; }
.user-avatar-preview h2 { font-size: 19px; }
.user-avatar-preview p { margin-top: 4px; font-size: 11px; line-height: 1.8; color: var(--muted); }
.avatar-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.avatar-form .field { flex: 1; min-width: 220px; }

.crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 21, 23, .72);
  backdrop-filter: blur(7px);
}
.crop-modal {
  width: min(380px, 100%);
  padding: 18px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .6);
}
.crop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.crop-head h3 { font-size: 17px; }
.crop-close {
  width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: rgba(23, 24, 26, .05); color: var(--muted);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.crop-close:hover { background: rgba(23, 24, 26, .09); color: var(--ink); }
.crop-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  background: #111214;
  touch-action: none;
}
.crop-stage canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.crop-stage canvas:active { cursor: grabbing; }
.crop-grid { position: absolute; inset: 0; pointer-events: none; border: 1px solid rgba(255, 255, 255, .28); }
.crop-grid::before, .crop-grid::after { content: ""; position: absolute; background: rgba(255, 255, 255, .18); }
.crop-grid::before { left: 33.33%; right: 33.33%; top: 0; bottom: 0; border-left: 1px solid rgba(255, 255, 255, .18); border-right: 1px solid rgba(255, 255, 255, .18); background: transparent; }
.crop-grid::after { top: 33.33%; bottom: 33.33%; left: 0; right: 0; border-top: 1px solid rgba(255, 255, 255, .18); border-bottom: 1px solid rgba(255, 255, 255, .18); background: transparent; }
.crop-hint { margin: 10px 0 6px; text-align: center; font-size: 10px; color: var(--muted); }
.crop-zoom { width: 100%; accent-color: var(--gold); }
.crop-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* product actions */
.product-main em { font-style: normal; margin-top: 3px; font-size: 10px; color: var(--muted); line-height: 1.5; }
.product-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
  .product-row { align-items: flex-start; flex-wrap: wrap; }
  .product-main { flex-basis: 100%; }
  .product-actions { flex-basis: 100%; justify-content: flex-start; }
}

/* ---------------------------- platform console ------------------------- */

.master-body { background: var(--paper); min-height: 100vh; display: flex; flex-direction: column; }
.master-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 16px 34px;
  background:
    radial-gradient(100% 180% at 88% 0%, rgba(176, 138, 90, .3), transparent 55%),
    #17181a;
  color: #f7f1e7;
}
.master-brand { display: flex; align-items: center; gap: 12px; }
.master-brand .brand-mark { border-color: rgba(201, 166, 120, .6); color: var(--gold-2); }
.master-brand b { display: block; font-family: var(--serif); font-size: 18px; letter-spacing: .08em; }
.master-brand span { display: block; margin-top: 2px; font-size: 8px; letter-spacing: .18em; color: rgba(247, 241, 231, .45); }
.master-user { display: flex; align-items: center; gap: 10px; }
.master-user .avatar { width: 32px; height: 32px; font-size: 13px; background: rgba(255, 255, 255, .12); }
.master-user b { display: block; font-size: 11.5px; font-weight: 500; }
.master-user span { display: block; font-size: 9px; color: rgba(247, 241, 231, .45); }
.master-user .btn-ghost { border-color: rgba(247, 241, 231, .22); color: rgba(247, 241, 231, .8); }

.master-main { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: 28px 34px 60px; }

.master-hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 30px;
  padding: 34px 36px; border-radius: 24px;
  background:
    radial-gradient(110% 160% at 88% 4%, rgba(176, 138, 90, .45), transparent 55%),
    radial-gradient(90% 120% at 0% 100%, rgba(184, 74, 51, .18), transparent 55%),
    #1a1b1d;
  color: #f7f1e7;
}
.master-hero .eyebrow { color: rgba(247, 241, 231, .45); }
.master-hero h1 { margin-top: 12px; font-size: clamp(30px, 4vw, 46px); font-weight: 400; line-height: 1.2; }
.master-hero h1 em { font-style: italic; color: var(--gold-2); }
.master-hero p { margin-top: 14px; max-width: 460px; font-size: 11px; line-height: 1.9; color: rgba(247, 241, 231, .52); }
.master-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 34px; }
.master-stats > div { display: flex; flex-direction: column; gap: 3px; }
.master-stats span { font-size: 9px; letter-spacing: .1em; color: rgba(247, 241, 231, .45); }
.master-stats b { font-family: var(--serif); font-size: 30px; font-weight: 500; line-height: 1; }

.master-card { margin-top: 18px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: var(--shadow-sm); }
.master-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.master-card-head h2 { font-size: 18px; }
.master-card-head p { margin-top: 4px; font-size: 10.5px; color: var(--muted); }
.master-card-head > span { font-size: 10px; color: var(--muted); }

.shop-table { border-top: 1px solid var(--line); }
.shop-thead, .shop-row {
  display: grid;
  grid-template-columns: 1.7fr .7fr .5fr .5fr .5fr .7fr .8fr 1.1fr;
  gap: 10px; align-items: center; padding: 11px 0;
}
.shop-thead { font-size: 8.5px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--line); }
.shop-row { border-bottom: 1px solid var(--line); font-size: 11px; }
.shop-row:last-child { border-bottom: 0; }
.shop-row.is-off { opacity: .55; }
.shop-main { display: flex; flex-direction: column; min-width: 0; }
.shop-main b { font-size: 12.5px; }
.shop-main span { font-size: 9.5px; color: var(--muted); }
.shop-status { display: inline-flex; align-items: center; gap: 5px; font-size: 9.5px; white-space: nowrap; }
.shop-status i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted-2); }
.shop-status.is-on { color: var(--green); }
.shop-status.is-on i { background: var(--green); }
.shop-status.is-off { color: var(--red); }
.shop-status.is-off i { background: var(--red); }
.shop-created { font-family: var(--mono); font-size: 9.5px; color: var(--muted); }
.shop-actions { display: flex; gap: 5px; justify-content: flex-end; flex-wrap: wrap; }
.shop-empty { padding: 28px 0; text-align: center; font-size: 11px; color: var(--muted); }

.master-logs { border-top: 1px solid var(--line); }
.master-log-row { display: grid; grid-template-columns: 110px 80px 110px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 10px; align-items: baseline; }
.master-log-row span { font-family: var(--mono); color: var(--muted); }
.master-log-row b { font-weight: 500; }
.master-log-row em { font-style: normal; color: var(--gold); }
.master-log-row p { margin: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toast-inline { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; padding: 11px 14px; border-radius: 10px; font-size: 11.5px; }
.toast-inline.is-ok { border: 1px solid rgba(62, 107, 82, .22); background: rgba(62, 107, 82, .06); color: var(--green); }
.toast-inline.is-err { border: 1px solid rgba(184, 74, 51, .22); background: rgba(184, 74, 51, .06); color: var(--red); }

.master-foot { margin: 0; }

@media (max-width: 960px) {
  .master-top { padding: 12px 16px; }
  .master-main { padding: 18px 16px 90px; }
  .master-hero { flex-direction: column; align-items: flex-start; gap: 22px; padding: 26px 22px; }
  .master-stats { width: 100%; grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .master-stats b { font-size: 22px; }
  .master-card { padding: 18px; }
  .shop-thead { display: none; }
  .shop-row { grid-template-columns: 1fr auto; gap: 7px 12px; padding: 14px 0; }
  .shop-main { grid-column: 1 / -1; }
  .shop-row > .ta-r { display: none; }
  .shop-created { display: none; }
  .shop-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .master-log-row { grid-template-columns: 90px 70px 1fr; }
  .master-log-row p { display: none; }
}

/* ---------------------------- disabled shop / disable form -------------- */

.disabled-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 18px;
  background:
    radial-gradient(1000px 600px at 100% 0%, rgba(176, 138, 90, .15), transparent 60%),
    radial-gradient(800px 500px at 0% 100%, rgba(184, 74, 51, .06), transparent 60%),
    var(--paper);
}
.disabled-card {
  width: min(480px, 100%);
  padding: 36px 34px 30px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 40px 90px -55px rgba(23, 24, 26, .45);
}
.disabled-eyebrow { font-size: 8.5px; letter-spacing: .22em; color: var(--gold); }
.disabled-card h1 { margin-top: 12px; font-size: clamp(24px, 5vw, 32px); font-weight: 500; }
.disabled-lead { margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.disabled-reason {
  display: inline-block;
  margin-top: 16px;
  padding: 8px 14px;
  border: 1px solid rgba(184, 74, 51, .2);
  border-radius: 999px;
  background: rgba(184, 74, 51, .055);
  color: var(--red);
  font-size: 11.5px;
}
.disabled-note { margin-top: 12px; font-size: 11px; line-height: 1.9; color: var(--muted); white-space: pre-wrap; }
.disabled-help { margin-top: 26px; font-size: 11px; letter-spacing: .06em; color: var(--muted); }
.disabled-qr-wrap {
  width: min(280px, 80%);
  margin: 14px auto 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 40px -30px rgba(23, 24, 26, .35);
}
.disabled-qr { display: block; width: 100%; height: auto; border-radius: 8px; }
.disabled-hint { margin-top: 10px; font-size: 10px; color: var(--muted); }
.disabled-code { margin-top: 18px; font-family: var(--mono); font-size: 9px; color: var(--muted-2); letter-spacing: .08em; }
.disabled-foot { margin-top: 26px; font-family: var(--serif); font-size: 12px; letter-spacing: .12em; color: var(--muted-2); }

.disable-card { max-width: 760px; margin: 0 auto; }
.disable-shop {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; margin-bottom: 18px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(244, 239, 231, .4);
}
.disable-shop b { display: block; font-size: 14px; }
.disable-shop span { display: block; margin-top: 2px; font-size: 10px; color: var(--muted); }
.disable-warning {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 16px; padding: 12px 14px;
  border-radius: 10px;
  background: rgba(184, 74, 51, .06);
  color: var(--red);
  font-size: 11px; line-height: 1.8;
}
.disable-warning .ic { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.disable-form .form-actions { justify-content: flex-end; }

/* ---------------------------- client confirm / messages ---------------- */

.client-flash {
  display: flex; align-items: center; gap: 8px;
  margin: 0 34px 18px; padding: 11px 14px;
  border-radius: 10px; font-size: 11px;
}
.client-flash.is-ok { border: 1px solid rgba(62, 107, 82, .22); background: rgba(62, 107, 82, .06); color: var(--green); }
.client-flash.is-err { border: 1px solid rgba(184, 74, 51, .22); background: rgba(184, 74, 51, .06); color: var(--red); }
.client-flash .ic { width: 15px; height: 15px; }

.client-confirm {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin: 22px 34px 0; padding: 18px 20px;
  border: 1px solid rgba(62, 107, 82, .2);
  border-radius: 14px;
  background: rgba(62, 107, 82, .045);
}
.client-confirm h2 { font-size: 16px; }
.client-confirm p { margin-top: 4px; font-size: 10.5px; color: var(--muted); }
.client-confirmed { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--green); white-space: nowrap; }
.client-confirmed .ic { width: 14px; height: 14px; }

.client-message-form textarea {
  width: 100%; min-height: 88px; resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: 12px;
  background: #fffdf9; font: inherit; font-size: 12px; line-height: 1.7;
  outline: none;
}
.client-message-form textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176, 138, 90, .12); }
.client-message-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 9.5px; color: var(--muted); }
.client-message-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.messages-card .message-list { border-top: 1px solid var(--line); }
.message-item { padding: 11px 0; border-bottom: 1px solid var(--line); }
.message-item:last-child { border-bottom: 0; padding-bottom: 0; }
.message-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.message-head b { font-size: 12px; }
.message-head span { font-family: var(--mono); font-size: 9px; color: var(--muted); }
.message-item p { margin-top: 4px; font-size: 11.5px; line-height: 1.8; color: var(--ink-2); white-space: pre-wrap; }

.share-confirm {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; padding: 8px 10px;
  border-radius: 8px;
  background: rgba(23, 24, 26, .04);
  font-size: 10px; color: var(--muted);
}
.share-confirm .ic { width: 13px; height: 13px; }
.share-confirm.is-on { background: rgba(62, 107, 82, .06); color: var(--green); }

@media (max-width: 640px) {
  .client-flash { margin: 0 20px 16px; }
  .client-confirm { margin: 18px 20px 0; flex-direction: column; align-items: flex-start; }
  .client-message-section { padding-top: 22px; }
}

/* ------------------------------- weekly report ------------------------- */

.weekly-banner { border-color: rgba(176, 138, 90, .3); background: rgba(176, 138, 90, .08); color: #6f5634; }
.weekly-banner .ic { color: var(--gold); }

.weekly-compare {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.weekly-compare > div {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.weekly-compare span { display: block; font-size: 9px; letter-spacing: .1em; color: var(--muted); }
.weekly-compare b { display: block; margin-top: 5px; font-family: var(--serif); font-size: 22px; font-weight: 500; }
.weekly-compare em { display: block; margin-top: 4px; font-style: normal; font-size: 9.5px; color: var(--muted); }
.weekly-compare em.up { color: var(--green); }
.weekly-compare em.down { color: var(--red); }

.weekly-bars .bar-label small { display: block; margin-top: 2px; font-size: 8px; color: var(--muted-2); }

.weekly-table .report-thead,
.weekly-table .report-row { grid-template-columns: 1.6fr .7fr .7fr .8fr .8fr .8fr .7fr; }
.weekly-order-main { display: flex; flex-direction: column; min-width: 0; }
.weekly-order-main b { font-size: 11.5px; }
.weekly-order-main em { font-style: normal; font-size: 9px; color: var(--muted); }

.weekly-todo { border-top: 1px solid var(--line); }
.weekly-todo > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.weekly-todo > div:last-child { border-bottom: 0; }
.weekly-todo span { font-size: 10.5px; color: var(--muted); }
.weekly-todo b { font-family: var(--mono); font-size: 12px; font-weight: 500; }

@media (max-width: 960px) {
  .weekly-compare { grid-template-columns: 1fr 1fr; }
  .weekly-table .report-thead,
  .weekly-table .report-row { grid-template-columns: 1.5fr .8fr .8fr .8fr .7fr; }
  .weekly-table .report-thead > span:nth-child(2),
  .weekly-table .report-row > span:nth-child(2),
  .weekly-table .report-thead > span:nth-child(3),
  .weekly-table .report-row > span:nth-child(3) { display: none; }
}

/* ------------------------- equipment maintenance ----------------------- */

.equipment-service {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-radius: 8px;
  background: rgba(176, 138, 90, .06);
  font-size: 9.5px; color: #7d603a;
}
.equipment-service.is-soon { color: var(--gold); background: rgba(176, 138, 90, .09); }
.equipment-service.is-overdue { color: var(--red); background: rgba(184, 74, 51, .07); }

.asset-note {
  display: flex; align-items: center; gap: 7px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 10px; color: var(--muted);
}
.asset-note .ic { width: 14px; height: 14px; color: var(--gold); }

.maintenance-form { border-top: 1px dashed var(--line-2); padding-top: 16px; margin-bottom: 18px; }
.maintenance-form .form-actions { margin-top: 12px; padding-top: 0; border-top: 0; }

.maintenance-table { border-top: 1px solid var(--line); overflow-x: auto; }
.maintenance-thead, .maintenance-row {
  display: grid;
  grid-template-columns: .8fr 1.6fr .7fr .8fr .8fr .5fr;
  gap: 8px; align-items: center; padding: 9px 0;
}
.maintenance-thead { font-size: 8.5px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--line); }
.maintenance-row { border-bottom: 1px solid var(--line); font-size: 10.5px; }
.maintenance-row:last-child { border-bottom: 0; }
.maintenance-row.is-overdue { background: rgba(184, 74, 51, .035); }
.maintenance-title { display: flex; flex-direction: column; min-width: 0; }
.maintenance-title b { font-size: 11.5px; }
.maintenance-title em { font-style: normal; font-size: 9.5px; color: var(--muted); margin-top: 2px; }
.maintenance-title small { font-size: 8.5px; color: var(--muted-2); margin-top: 2px; }

.maintenance-due {
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 9.5px; color: var(--muted); white-space: nowrap;
}
.maintenance-due.is-soon { color: var(--gold); border-color: rgba(176, 138, 90, .25); background: rgba(176, 138, 90, .06); }
.maintenance-due.is-overdue { color: var(--red); border-color: rgba(184, 74, 51, .25); background: rgba(184, 74, 51, .06); }

.maintenance-next {
  display: flex; flex-direction: column; gap: 3px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
}
.maintenance-next span { font-size: 9px; letter-spacing: .08em; color: var(--muted); }
.maintenance-next b { font-family: var(--serif); font-size: 16px; font-weight: 500; }
.maintenance-next em { font-style: normal; font-size: 9.5px; color: var(--muted); }
.maintenance-next.is-soon b { color: var(--gold); }
.maintenance-next.is-overdue b { color: var(--red); }

@media (max-width: 640px) {
  .maintenance-thead, .maintenance-row { grid-template-columns: .8fr 1.6fr .8fr .8fr; }
  .maintenance-thead > span:nth-child(3), .maintenance-row > span:nth-child(3),
  .maintenance-thead > span:nth-child(5), .maintenance-row > span:nth-child(5) { display: none; }
}

/* --------------------------- platform account -------------------------- */

.account-profile { display: flex; align-items: center; gap: 18px; }
.account-profile .avatar.lg { width: 62px; height: 62px; font-size: 24px; background: var(--ink); color: var(--paper); }
.account-profile h1 { margin-top: 4px; font-size: 26px; font-weight: 500; }
.account-profile p { margin-top: 4px; font-size: 11px; color: var(--muted); }
.account-form { max-width: 760px; }

.platform-admin-list { border-top: 1px solid var(--line); }
.platform-admin-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.platform-admin-row:last-child { border-bottom: 0; }
.platform-admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.platform-admin-main b { font-size: 12.5px; }
.platform-admin-main span { font-size: 10px; color: var(--muted); }

@media (max-width: 960px) {
  .master-user { flex-wrap: wrap; justify-content: flex-end; }
  .master-user > div { display: none; }
  .account-profile { align-items: flex-start; }
  .account-profile h1 { font-size: 22px; }
}

/* ------------------------------ stores -------------------------------- */

.store-switch select {
  height: 34px;
  max-width: 190px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background-color: var(--soft);
  color: var(--ink-2);
  font: inherit;
  font-size: 11px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238C857B' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  outline: none;
}

.store-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.store-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.store-row:last-child { border-bottom: 0; }
.store-row.is-off { opacity: .55; }
.store-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; }
.store-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.store-main b { font-size: 12.5px; }
.store-main span { font-size: 10px; color: var(--muted); }
.store-main .tag { font-size: 8px; padding: 1px 6px; margin-left: 4px; }
.store-state { font-size: 9.5px; color: var(--muted); }
.store-state.is-on { color: var(--green); }
.store-actions { display: flex; gap: 5px; flex-wrap: wrap; }

@media (max-width: 960px) {
  .store-switch select { max-width: 120px; font-size: 10px; padding-left: 10px; }
}

/* --------------------------- weekly push ------------------------------- */

.push-test-form {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--line-2);
  font-size: 10px; color: var(--muted);
}

/* ------------------------- client payment / claims --------------------- */

.client-pay {
  margin: 20px 34px 0;
  padding: 20px;
  border: 1px solid rgba(176, 138, 90, .22);
  border-radius: 16px;
  background: rgba(176, 138, 90, .035);
}
.client-qr-grid { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.client-qr-grid figure {
  width: 190px; margin: 0; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: center;
}
.client-qr-grid img { width: 100%; height: auto; display: block; border-radius: 6px; aspect-ratio: 1; object-fit: contain; }
.client-qr-grid figcaption { margin-top: 6px; font-size: 9px; color: var(--muted); }
.client-pay-note { margin-top: 10px; font-size: 10.5px; line-height: 1.8; color: var(--muted); white-space: pre-wrap; }
.client-pay-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 14px; }
.client-pay-form .btn { grid-column: 1 / -1; justify-self: start; }
.client-pay-hint { margin-top: 8px; font-size: 9.5px; color: var(--muted); }

.payment-qr-preview { display: flex; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.payment-qr-preview figure { width: 160px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: center; }
.payment-qr-preview img { width: 100%; height: auto; display: block; aspect-ratio: 1; object-fit: contain; }
.payment-qr-preview figcaption { margin-top: 5px; font-size: 9px; color: var(--muted); }

.claims-card .claim-list { border-top: 1px solid var(--line); }
.claim-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.claim-item:last-child { border-bottom: 0; }
.claim-item.is-pending { background: linear-gradient(90deg, rgba(176, 138, 90, .06), transparent 65%); }
.claim-main { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 3px; }
.claim-main > b { font-family: var(--mono); font-size: 14px; font-weight: 500; }
.claim-method { font-family: var(--sans); font-size: 9px; color: var(--muted); margin-left: 4px; }
.claim-main em { font-style: normal; font-size: 9.5px; color: var(--muted); }
.claim-receipt { display: inline-flex; align-items: center; gap: 4px; font-size: 9px; color: var(--gold); }
.claim-receipt .ic { width: 12px; height: 12px; }
.claim-status { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); font-size: 9.5px; color: var(--muted); }
.claim-status.is-pending { color: var(--gold); border-color: rgba(176, 138, 90, .28); background: rgba(176, 138, 90, .06); }
.claim-status.is-confirmed { color: var(--green); border-color: rgba(62, 107, 82, .25); background: rgba(62, 107, 82, .05); }
.claim-status.is-rejected { color: var(--red); border-color: rgba(184, 74, 51, .25); background: rgba(184, 74, 51, .05); }
.claim-actions { display: flex; gap: 6px; flex: none; }

@media (max-width: 640px) {
  .client-pay { margin: 18px 20px 0; }
  .client-pay-form { grid-template-columns: 1fr; }
  .client-qr-grid figure { width: calc(50% - 7px); }
}

/* --------------------------- announcements ----------------------------- */

.shop-announcement {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 12px;
  background: rgba(176, 138, 90, .045);
  color: var(--ink-2);
}
.shop-announcement.is-warning {
  border-left-color: var(--red);
  background: rgba(184, 74, 51, .045);
}
.shop-announcement.is-success {
  border-left-color: var(--green);
  background: rgba(62, 107, 82, .05);
}
.announcement-label {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  font-size: 8.5px;
  letter-spacing: .12em;
}
.shop-announcement.is-warning .announcement-label { background: var(--red); }
.shop-announcement.is-success .announcement-label { background: var(--green); }
.shop-announcement > div { flex: 1; min-width: 0; }
.shop-announcement b { display: block; font-size: 12px; font-weight: 600; }
.shop-announcement p {
  margin: 3px 0 0;
  font-size: 10.5px;
  line-height: 1.75;
  color: var(--muted);
  white-space: pre-wrap;
}
.announcement-close {
  flex: none;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.announcement-close:hover { background: rgba(0, 0, 0, .05); color: var(--ink); }

.announcement-admin-list { border-top: 1px solid var(--line); }
.announcement-admin-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.announcement-admin-row.is-off { opacity: .55; }
.announcement-level {
  flex: none;
  margin-top: 2px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(176, 138, 90, .1);
  color: var(--gold);
  font-size: 8.5px;
}
.announcement-level.is-warning { background: rgba(184, 74, 51, .08); color: var(--red); }
.announcement-level.is-success { background: rgba(62, 107, 82, .08); color: var(--green); }
.announcement-admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.announcement-admin-main b { font-size: 12.5px; }
.announcement-admin-main em { font-style: normal; font-size: 10px; color: var(--muted); }
.announcement-admin-main small { font-size: 9px; color: var(--muted); }
.announcement-admin-actions { display: flex; gap: 5px; flex-wrap: wrap; flex: none; }
.danger-btn { color: var(--red) !important; }

@media (max-width: 640px) {
  .shop-announcement { margin-bottom: 16px; padding: 12px 13px; }
  .announcement-admin-row { flex-wrap: wrap; }
  .announcement-admin-actions { width: 100%; padding-left: 0; }
}

/* --------------------------- membership --------------------------------- */

.membership-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 12px;
  background: var(--soft);
  font-size: 10.5px;
}
.membership-banner > .ic { flex: none; width: 17px; height: 17px; }
.membership-banner > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.membership-banner b { font-size: 11.5px; font-weight: 600; }
.membership-banner span { color: var(--muted); }
.membership-banner a { flex: none; display: inline-flex; align-items: center; gap: 4px; color: var(--gold); font-size: 10px; }
.membership-banner a .ic { width: 12px; height: 12px; }
.membership-banner.is-warn { border-left-color: var(--red); background: rgba(184, 74, 51, .045); }
.membership-banner.is-danger { border-left-color: var(--red); background: rgba(184, 74, 51, .07); color: var(--red); }
.membership-banner.is-trial { border-left-color: var(--blue); background: rgba(76, 99, 120, .05); }
.membership-banner.is-info { border-left-color: var(--gold); }

.membership-hero {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 22px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.membership-hero.is-danger { border-color: rgba(184, 74, 51, .25); }
.membership-hero.is-warn { border-color: rgba(184, 74, 51, .18); }
.membership-hero-main h2 { margin-top: 8px; font-size: clamp(24px, 4vw, 34px); font-weight: 500; }
.membership-state {
  display: inline-block; vertical-align: middle; margin-left: 8px; padding: 3px 10px;
  border: 1px solid var(--line-2); border-radius: 999px; font-family: var(--sans);
  font-size: 9px; font-weight: 400; color: var(--muted); letter-spacing: .04em;
}
.membership-hero-main p { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.membership-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; align-content: center; }
.membership-meta > div { display: flex; flex-direction: column; gap: 3px; padding-left: 12px; border-left: 1px solid var(--line); }
.membership-meta span { font-size: 8.5px; letter-spacing: .1em; color: var(--muted); }
.membership-meta b { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.membership-note { grid-column: 1 / -1; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 10.5px; color: var(--muted); white-space: pre-wrap; }
.membership-alert {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-radius: 10px; background: rgba(184, 74, 51, .07); color: var(--red); font-size: 10.5px;
}
.membership-alert .ic { width: 15px; height: 15px; flex: none; }
.membership-alert.is-warn { background: rgba(184, 74, 51, .05); color: var(--red); }
.membership-alert.is-trial { background: rgba(76, 99, 120, .06); color: var(--blue); }

.membership-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 28px 0 12px; }
.membership-section-head h2 { font-size: 19px; }
.membership-section-head p { margin-top: 4px; font-size: 10px; color: var(--muted); }
.membership-section-head > span { font-size: 9.5px; color: var(--muted); }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plan-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--shadow-sm);
}
.plan-card.is-featured { border-color: rgba(176, 138, 90, .45); }
.plan-card.is-current { box-shadow: 0 0 0 2px rgba(176, 138, 90, .12), var(--shadow-sm); }
.plan-tag { display: inline-block; padding: 3px 8px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); font-size: 8px; color: var(--gold); letter-spacing: .08em; }
.plan-top h3 { margin-top: 10px; font-size: 20px; }
.plan-top p { margin-top: 4px; font-size: 9.5px; color: var(--muted); }
.plan-price { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.plan-price b { font-family: var(--mono); font-size: 25px; font-weight: 500; letter-spacing: -.03em; }
.plan-price em { font-style: normal; font-size: 10px; color: var(--muted); }
.plan-price small { flex-basis: 100%; font-size: 9px; color: var(--muted); }
.plan-features { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 12px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); list-style: none; }
.plan-features li { display: flex; align-items: flex-start; gap: 6px; font-size: 10px; line-height: 1.65; color: var(--ink-2); }
.plan-features .ic { width: 12px; height: 12px; margin-top: 2px; color: var(--gold); flex: none; }
.plan-limit { font-size: 9px; color: var(--muted); }

.membership-contact {
  display: grid; grid-template-columns: 1fr auto; gap: 26px; align-items: center;
  margin-top: 18px; padding: 26px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--card); box-shadow: var(--shadow-sm);
}
.membership-contact h2 { margin-top: 8px; font-size: 24px; font-weight: 500; }
.membership-contact p { margin-top: 7px; font-size: 11px; line-height: 1.8; color: var(--muted); }
.membership-contact-list { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 16px; }
.membership-contact-list div { display: flex; flex-direction: column; gap: 2px; }
.membership-contact-list span { font-size: 8.5px; letter-spacing: .1em; color: var(--muted); }
.membership-contact-list b { font-size: 10px; font-weight: 500; }
.membership-qr { width: 132px; margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: center; }
.membership-qr img { width: 100%; display: block; border-radius: 5px; }
.membership-qr figcaption { margin-top: 5px; font-size: 8px; color: var(--muted); }

.membership-history { border-top: 1px solid var(--line); }
.membership-history-row {
  display: grid; grid-template-columns: 140px 90px 80px 1fr 80px 1.2fr;
  gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line);
  font-size: 9.5px;
}
.membership-history-row span { color: var(--muted); }
.membership-history-row b { font-weight: 500; }
.membership-history-row em { font-style: normal; color: var(--gold); }
.membership-history-row strong { font-family: var(--mono); font-weight: 400; text-align: right; }
.membership-history-row small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------ master billing / plans ------------------------ */

.shop-membership { font-size: 8.5px !important; color: var(--muted) !important; }
.shop-membership.is-trial { color: var(--blue) !important; }
.shop-membership.is-grace { color: var(--red) !important; }
.shop-membership.is-expired { color: var(--red) !important; }
.plan-admin-list { border-top: 1px solid var(--line); }
.plan-admin-row { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.plan-admin-row.is-off { opacity: .55; }
.plan-admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.plan-admin-main b { font-size: 12.5px; }
.plan-admin-main b small { font-family: var(--mono); font-size: 8px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.plan-admin-main span { font-size: 9.5px; color: var(--ink-2); }
.plan-admin-main em { font-style: normal; font-size: 9px; color: var(--muted); }
.plan-admin-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.membership-current { display: flex; align-items: center; gap: 8px; }
.membership-current b { font-size: 12px; }
.membership-current span { padding: 2px 8px; border-radius: 999px; font-size: 8.5px; background: var(--soft); color: var(--muted); }
.membership-current.is-active span { color: var(--green); background: rgba(62, 107, 82, .06); }
.membership-current.is-trial span { color: var(--blue); background: rgba(76, 99, 120, .06); }
.membership-current.is-grace span, .membership-current.is-expired span { color: var(--red); background: rgba(184, 74, 51, .06); }
.membership-admin-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.membership-admin-meta div { display: flex; flex-direction: column; gap: 3px; }
.membership-admin-meta span { font-size: 8.5px; letter-spacing: .1em; color: var(--muted); }
.membership-admin-meta b { font-family: var(--mono); font-size: 12px; font-weight: 500; }
.membership-admin-note { margin-top: 12px; font-size: 10px; color: var(--muted); white-space: pre-wrap; }
.membership-admin-form { margin-top: 18px; }

@media (max-width: 900px) {
  .plan-grid { grid-template-columns: 1fr; }
  .membership-hero { grid-template-columns: 1fr; padding: 20px; }
  .membership-meta { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .membership-banner { align-items: flex-start; }
  .membership-banner a { margin-left: auto; }
  .membership-hero { padding: 18px; }
  .membership-contact { grid-template-columns: 1fr; padding: 20px; }
  .membership-qr { width: 120px; }
  .membership-history-row { grid-template-columns: 1fr 1fr; gap: 5px 10px; }
  .membership-history-row strong { text-align: left; }
  .membership-history-row small { display: none; }
  .membership-admin-meta { grid-template-columns: 1fr 1fr; }
  .membership-admin-form .form-grid { grid-template-columns: 1fr; }
  .plan-admin-row { flex-wrap: wrap; }
  .plan-admin-actions { width: 100%; }
}

/* --------------------------- settings sections -------------------------- */

.settings-panel { display: none; }
.settings-panel.is-active { display: block; }
.settings-nav a.is-active {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.settings-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 4px;
  padding: 14px 0 0;
  border-top: 1px dashed var(--line);
  font-size: 9.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.settings-pager > div { display: flex; gap: 8px; flex-wrap: wrap; }
.settings-pager .ic { width: 13px; height: 13px; }

@media (max-width: 640px) {
  .settings-pager { align-items: flex-start; }
  .settings-pager > div { width: 100%; }
  .settings-pager .btn { flex: 1; justify-content: center; }
}

/* --------------------------- excel import ----------------------------- */

.excel-guide {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.excel-guide > div {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}
.excel-guide b { display: block; font-size: 10px; color: var(--gold); margin-bottom: 4px; }
.excel-guide p { font-size: 10px; line-height: 1.75; color: var(--muted); }
.excel-upload-form {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px dashed var(--line-2);
}
.excel-upload-form .field { flex: 1; min-width: 240px; margin: 0; }
.excel-errors, .excel-warnings {
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid rgba(184, 74, 51, .25);
  border-radius: 12px;
  background: rgba(184, 74, 51, .045);
  font-size: 10px;
}
.excel-warnings { border-color: var(--line-2); background: var(--soft); }
.excel-errors h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 12px; color: var(--red); }
.excel-errors h3 .ic { width: 14px; height: 14px; }
.excel-errors > div, .excel-warnings > div { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.excel-errors > div:last-child, .excel-warnings > div:last-child { border-bottom: 0; }
.excel-errors span, .excel-warnings span { flex: none; min-width: 74px; color: var(--muted); }
.excel-errors b, .excel-warnings b { font-weight: 400; color: var(--ink-2); }
.excel-warnings summary { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--gold); }
.excel-warnings summary .ic { width: 14px; height: 14px; }
.excel-apply-form {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin-top: 16px; padding: 14px 16px;
  border: 1px solid rgba(62, 107, 82, .22);
  border-radius: 12px;
  background: rgba(62, 107, 82, .045);
}
.excel-apply-form > div { display: flex; flex-direction: column; gap: 2px; }
.excel-apply-form b { font-size: 11.5px; }
.excel-apply-form span { font-size: 9.5px; color: var(--muted); }
.excel-result-card { margin-top: 14px; }
.excel-table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.excel-table { width: 100%; border-collapse: collapse; font-size: 10px; min-width: 600px; }
.excel-table th {
  padding: 8px 10px; text-align: left; font-size: 8.5px; letter-spacing: .08em;
  color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.excel-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.excel-table tr:last-child td { border-bottom: 0; }
.excel-table td small { display: block; color: var(--muted); font-size: 8.5px; }
.excel-status { display: inline-block; padding: 2px 7px; border-radius: 999px; font-size: 8.5px; }
.excel-status.is-new { color: var(--green); background: rgba(62, 107, 82, .06); }
.excel-status.is-existing { color: var(--muted); background: var(--soft); }
.card-tag.is-danger { color: var(--red); border-color: rgba(184, 74, 51, .25); }

@media (max-width: 700px) {
  .excel-guide { grid-template-columns: 1fr; }
  .excel-upload-form { align-items: stretch; }
  .excel-upload-form .btn { width: 100%; }
  .excel-apply-form { align-items: stretch; flex-direction: column; }
  .excel-apply-form .btn { width: 100%; }
  .excel-errors > div, .excel-warnings > div { flex-direction: column; gap: 2px; }
}

.import-summary small { font-size: 8px; color: var(--muted); }

/* ------------------------------ QR lightbox ----------------------------- */

.client-qr-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.client-qr-open img { transition: transform .2s ease; }
.client-qr-open:hover img { transform: scale(1.02); }

.qr-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(10, 10, 12, .86);
  backdrop-filter: blur(8px);
}
.qr-lightbox[hidden] { display: none; }
.qr-lightbox-card {
  width: min(92vw, 480px);
  padding: 18px 18px 14px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7);
  text-align: center;
}
.qr-lightbox-card img {
  width: 100%;
  max-width: 420px;
  height: auto;
  display: block;
  margin: 0 auto;
}
.qr-lightbox-card p {
  margin: 12px 6px 2px;
  font-size: 10px;
  line-height: 1.7;
  color: #777;
}
.qr-lightbox-close {
  position: fixed;
  top: 18px;
  right: 20px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
@media (max-width: 640px) {
  .qr-lightbox { padding: 14px; }
  .qr-lightbox-card { width: 94vw; padding: 12px 12px 10px; }
  .qr-lightbox-card img { max-width: 100%; }
}

/* ------------------------------- ICP footer ----------------------------- */

.icp-link {
  font-size: 9px;
  color: var(--muted-2);
  letter-spacing: .02em;
  transition: color .2s;
}
.icp-link:hover { color: var(--gold); }
.app-foot .icp-link { margin-left: auto; }
.auth-icp { margin: 14px 0 0; font-size: 8.5px; text-align: center; }
.auth-icp a { color: rgba(244, 239, 231, .42); }
.client-foot .icp-link { width: 100%; margin-top: 6px; }
