/* ==========================================================================
   华京法务客户管理系统
   Editorial law-firm interface: ink navy, warm paper, antique gold.
   ========================================================================== */

:root {
  --navy-950: #0a1421;
  --navy-900: #0e1a2b;
  --navy-850: #122137;
  --navy-800: #172a44;
  --navy-700: #213a5a;
  --ink: #182334;
  --ink-soft: #354256;
  --muted: #7a766d;
  --muted-2: #9a958b;
  --paper: #fbfaf7;
  --paper-2: #f5f2eb;
  --paper-3: #eeeae1;
  --white: #ffffff;
  --line: #e5e0d6;
  --line-strong: #d7d0c3;
  --gold: #c8a45d;
  --gold-strong: #ad8740;
  --gold-soft: #ead9b3;
  --gold-wash: #f7f0df;
  --green: #34745a;
  --green-wash: #e7f1ec;
  --red: #a7443b;
  --red-wash: #f8eae7;
  --amber: #9b6b24;
  --amber-wash: #faf0dc;
  --blue: #2e5f8e;
  --blue-wash: #e8f0f8;
  --violet: #67508e;
  --violet-wash: #efeaf7;
  --gray-wash: #efeee9;
  --shadow-sm: 0 1px 2px rgba(18, 30, 45, .05), 0 6px 18px rgba(18, 30, 45, .035);
  --shadow-md: 0 18px 50px rgba(18, 30, 45, .10), 0 2px 8px rgba(18, 30, 45, .04);
  --shadow-lg: 0 30px 80px rgba(8, 17, 29, .22);
  --radius: 14px;
  --radius-lg: 20px;
  --sidebar: 258px;
  --serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(.22, .8, .24, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

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

h1, h2, h3, h4, p {
  margin: 0;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.no-script {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
}

[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Boot
   -------------------------------------------------------------------------- */
.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background:
    radial-gradient(circle at 50% 32%, rgba(200, 164, 93, .13), transparent 34%),
    var(--navy-900);
  color: var(--gold-soft);
}

.boot-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(200, 164, 93, .65);
  border-radius: 16px;
  font-family: var(--serif);
  font-size: 34px;
  color: var(--gold-soft);
  box-shadow: inset 0 0 0 5px rgba(200, 164, 93, .06);
  animation: bootPulse 2s var(--ease) infinite;
}

.boot-title {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: .32em;
  text-indent: .32em;
  color: #f2e7cd;
}

.boot-bar {
  width: 132px;
  height: 2px;
  margin-top: 8px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}

.boot-bar span {
  display: block;
  width: 45%;
  height: 100%;
  background: var(--gold);
  animation: bootSlide 1.2s ease-in-out infinite;
}

.boot-note {
  color: rgba(234, 217, 179, .55);
  font-size: 12px;
  letter-spacing: .08em;
}

@keyframes bootPulse {
  0%, 100% { transform: scale(1); opacity: .9; }
  50% { transform: scale(1.035); opacity: 1; }
}

@keyframes bootSlide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(340%); }
}

/* --------------------------------------------------------------------------
   Common primitives
   -------------------------------------------------------------------------- */
.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

.serif { font-family: var(--serif); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.text-danger { color: var(--red); }
.text-gold { color: var(--gold-strong); }
.text-green { color: var(--green); }

.btn {
  --btn-bg: transparent;
  --btn-color: var(--ink);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--btn-border);
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--btn-color);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  --btn-bg: var(--navy-850);
  --btn-color: #f8f5ee;
  --btn-border: var(--navy-850);
  box-shadow: 0 6px 18px rgba(18, 33, 55, .18);
}
.btn-primary:hover { --btn-bg: var(--navy-700); --btn-border: var(--navy-700); }

.btn-gold {
  --btn-bg: var(--gold);
  --btn-color: #172235;
  --btn-border: var(--gold);
  box-shadow: 0 6px 16px rgba(173, 135, 64, .22);
}
.btn-gold:hover { --btn-bg: #d4b36e; --btn-border: #d4b36e; }

.btn-outline {
  --btn-border: var(--line-strong);
  --btn-bg: var(--white);
  --btn-color: var(--ink-soft);
}
.btn-outline:hover {
  --btn-border: var(--gold);
  --btn-color: var(--ink);
  --btn-bg: #fffdf8;
}

.btn-ghost {
  --btn-color: var(--muted);
}
.btn-ghost:hover {
  --btn-bg: var(--paper-2);
  --btn-color: var(--ink);
}

.btn-danger {
  --btn-color: var(--red);
  --btn-border: #edd6d2;
  --btn-bg: #fffafa;
}
.btn-danger:hover { --btn-bg: var(--red-wash); --btn-border: #dfbbb6; }

.btn-sm {
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12.5px;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
}

.btn-block { width: 100%; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: none;
  padding: 0;
  color: var(--gold-strong);
  font-weight: 600;
  font-size: 12.5px;
}
.link-btn:hover { color: var(--ink); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 0;
}

.card-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .015em;
  color: var(--ink);
}

.card-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
}

.card-body { padding: 22px 24px 24px; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .75;
}

.status-neutral { background: var(--gray-wash); color: #656157; }
.status-blue { background: var(--blue-wash); color: var(--blue); }
.status-amber { background: var(--amber-wash); color: var(--amber); }
.status-violet { background: var(--violet-wash); color: var(--violet); }
.status-green { background: var(--green-wash); color: var(--green); }
.status-gray { background: #efeeea; color: #8b877f; }

.type-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.type-chip.annual {
  border-color: #e6d4ac;
  background: var(--gold-wash);
  color: #856420;
}
.type-chip.single {
  border-color: #dbe4ec;
  background: #f4f8fb;
  color: var(--blue);
}

.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--paper-3);
  border: 1px solid rgba(255, 255, 255, .5);
  color: var(--navy-800);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
}
.avatar.navy { background: var(--navy-800); color: var(--gold-soft); }
.avatar.gold { background: var(--gold-wash); color: var(--gold-strong); }
.avatar.blue { background: var(--blue-wash); color: var(--blue); }
.avatar.green { background: var(--green-wash); color: var(--green); }
.avatar.violet { background: var(--violet-wash); color: var(--violet); }
.gender-avatar { font-family: var(--sans); padding: 0; overflow: hidden; }
.gender-avatar .avatar-portrait { display: block; width: 100%; height: 100%; }
.avatar-photo { padding: 0; overflow: hidden; background: var(--paper-3); }
.avatar-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gender-avatar.male { background: #e8f0fa; border-color: #d8e5f4; color: #2f5d8a; }
.gender-avatar.female { background: #fae9e7; border-color: #f0d8d5; color: #a65353; }
.gender-avatar .icon { width: 19px; height: 19px; }
.sidebar-user .gender-avatar { border-color: rgba(255, 255, 255, .18); }
.entity-mark.company { background: #e8f0fa; border-color: #d6e4f3; color: #2f5d8a; }
.entity-mark.person { background: #faf0e5; border-color: #efdfca; color: #8d6038; }
.entity-mark .icon { width: 19px; height: 19px; }

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(440px, 1.05fr) minmax(420px, .95fr);
  background: var(--paper);
}

.login-brand {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 46px 58px 38px;
  overflow: hidden;
  color: #f7f1e4;
  background:
    radial-gradient(circle at 78% 28%, rgba(200, 164, 93, .20), transparent 26%),
    radial-gradient(circle at 15% 88%, rgba(72, 104, 143, .25), transparent 36%),
    linear-gradient(145deg, #14263d 0%, #0d1929 56%, #09121e 100%);
}

.login-brand::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 540px;
  height: 540px;
  right: -190px;
  top: 12%;
  border: 1px solid rgba(200, 164, 93, .16);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(200, 164, 93, .035), 0 0 0 140px rgba(200, 164, 93, .022);
}

.login-brand::after {
  content: "华";
  position: absolute;
  z-index: -1;
  right: 32px;
  bottom: -112px;
  font-family: var(--serif);
  font-size: 450px;
  line-height: 1;
  color: rgba(234, 217, 179, .028);
  pointer-events: none;
}

.login-brand .brand {
  position: relative;
  z-index: 1;
}

.login-copy {
  max-width: 560px;
  padding: 30px 0;
}

.login-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  color: var(--gold-soft);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
}

.login-kicker::before {
  content: "";
  width: 36px;
  height: 1px;
  background: var(--gold);
}

.login-copy h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 4.3vw, 62px);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: .035em;
  color: #f7f1e4;
}

.login-copy h1 em {
  font-style: normal;
  color: var(--gold-soft);
}

.login-copy p {
  max-width: 430px;
  margin-top: 24px;
  color: rgba(239, 231, 213, .62);
  font-size: 14px;
  line-height: 1.9;
}

.login-motto {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 34px;
  color: rgba(234, 217, 179, .72);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .16em;
}

.login-motto span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

.login-brand-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(234, 217, 179, .12);
  color: rgba(239, 231, 213, .4);
  font-size: 11px;
  letter-spacing: .08em;
}

.login-brand-footer strong {
  color: rgba(239, 231, 213, .72);
  font-weight: 500;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-seal {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(200, 164, 93, .6);
  border-radius: 11px;
  font-family: var(--serif);
  font-size: 25px;
  color: var(--gold-soft);
  box-shadow: inset 0 0 0 4px rgba(200, 164, 93, .05);
}

.brand-lockup .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-lockup .brand-text strong {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: .2em;
  color: #f7f1e4;
}

.brand-lockup .brand-text small {
  margin-top: 4px;
  color: rgba(239, 231, 213, .44);
  font-size: 9.5px;
  letter-spacing: .19em;
  text-transform: uppercase;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background:
    radial-gradient(circle at 100% 0%, rgba(200, 164, 93, .08), transparent 33%),
    var(--paper);
}

.login-card {
  width: 100%;
  max-width: 400px;
  animation: riseIn .6s var(--ease) both;
}

.login-card-head .eyebrow {
  margin-bottom: 10px;
  color: var(--gold-strong);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.login-card h2 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: .03em;
}

.login-card-head > p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}

.login-form {
  margin-top: 34px;
}

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

.field + .field { margin-top: 17px; }

.field label,
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.field label .req,
.field-label .req {
  color: var(--red);
  margin-left: 2px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap > .icon {
  position: absolute;
  left: 13px;
  color: var(--muted-2);
  pointer-events: none;
}

.input-wrap input {
  padding-left: 42px;
}

.input-wrap .input-action {
  position: absolute;
  right: 5px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.input-wrap .input-action:hover { background: var(--paper-2); color: var(--ink); }

.input-wrap.money-input input { padding-left: 30px; }
.money-prefix {
  position: absolute;
  left: 13px;
  color: var(--gold-strong);
  font-family: var(--serif);
  font-size: 14px;
  pointer-events: none;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--white);
  color: var(--ink);
  font-size: 13.5px;
  outline: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}

textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.75;
}

input::placeholder,
textarea::placeholder { color: #b4afa5; }

input:hover,
select:hover,
textarea:hover { border-color: #c8c1b4; }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 164, 93, .15);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #cf8982;
  box-shadow: 0 0 0 3px rgba(167, 68, 59, .08);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--paper-2);
  color: var(--muted);
  cursor: not-allowed;
}

select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237a766d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.field-hint {
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.5;
}

.field-error {
  min-height: 0;
  color: var(--red);
  font-size: 11.5px;
  line-height: 1.45;
}

.checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  appearance: none;
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--white);
  display: grid;
  place-content: center;
  padding: 0;
  cursor: pointer;
}

.checkbox input::after {
  content: "";
  width: 8px;
  height: 5px;
  border-left: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  transform: rotate(-45deg) scale(0);
  transition: transform .12s ease;
  margin-top: -2px;
}

.checkbox input:checked {
  background: var(--navy-850);
  border-color: var(--navy-850);
}

.checkbox input:checked::after { transform: rotate(-45deg) scale(1); }

.login-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 24px;
  border-radius: 10px;
  font-size: 14px;
  letter-spacing: .04em;
}

.login-error {
  display: none;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid #efd2ce;
  border-radius: 9px;
  background: var(--red-wash);
  color: var(--red);
  font-size: 12.5px;
  line-height: 1.5;
}
.login-error.show { display: flex; }

.login-note {
  display: flex;
  gap: 9px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.65;
}
.login-note .icon { margin-top: 1px; }

.login-demo {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: rgba(247, 240, 223, .34);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.8;
}
.login-demo strong { color: var(--ink-soft); }
.login-demo code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--white);
  color: var(--gold-strong);
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid var(--line);
}

.login-foot {
  margin-top: 32px;
  color: var(--muted-2);
  font-size: 10.5px;
  text-align: center;
  letter-spacing: .04em;
}

/* --------------------------------------------------------------------------
   App shell / sidebar
   -------------------------------------------------------------------------- */
.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 92% 4%, rgba(200, 164, 93, .055), transparent 25%),
    var(--paper-2);
}

.sidebar {
  position: fixed;
  z-index: 60;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 35% 8%, rgba(200, 164, 93, .10), transparent 30%),
    linear-gradient(180deg, var(--navy-850), var(--navy-950));
  color: #e7e1d3;
  border-right: 1px solid rgba(255, 255, 255, .04);
}

.sidebar::after {
  content: "";
  position: absolute;
  right: -130px;
  bottom: -140px;
  width: 380px;
  height: 380px;
  border: 1px solid rgba(200, 164, 93, .08);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(200, 164, 93, .018), 0 0 0 110px rgba(200, 164, 93, .012);
  pointer-events: none;
}

.sidebar-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 26px 18px 18px;
}

.sidebar .brand-lockup {
  padding: 0 8px;
}

.sidebar .brand-seal {
  width: 42px;
  height: 42px;
  font-size: 23px;
  border-radius: 10px;
}

.sidebar .brand-lockup .brand-text strong {
  font-size: 18px;
  letter-spacing: .18em;
}

.sidebar .brand-lockup .brand-text small {
  font-size: 8px;
  letter-spacing: .16em;
}

.sidebar-workspace {
  margin: 28px 8px 11px;
  color: rgba(234, 217, 179, .38);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 9px;
  color: rgba(231, 225, 211, .62);
  font-size: 13px;
  font-weight: 500;
  transition: background .18s var(--ease), color .18s var(--ease);
}

.nav-item .icon {
  color: rgba(234, 217, 179, .52);
  transition: color .18s var(--ease);
}

.nav-item:hover {
  background: rgba(255, 255, 255, .045);
  color: #f4ecdc;
}
.nav-item:hover .icon { color: var(--gold-soft); }

.nav-item.active {
  background: rgba(200, 164, 93, .11);
  color: #faf4e7;
}
.nav-item.active .icon { color: var(--gold-soft); }

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

.nav-item .nav-count {
  margin-left: auto;
  min-width: 21px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(200, 164, 93, .18);
  color: var(--gold-soft);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.sidebar-spacer { flex: 1; min-height: 30px; }

.sidebar-note {
  margin: 0 4px 15px;
  padding: 13px 14px;
  border: 1px solid rgba(200, 164, 93, .14);
  border-radius: 11px;
  background: rgba(200, 164, 93, .05);
}

.sidebar-note .note-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--gold-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.sidebar-note p {
  margin-top: 5px;
  color: rgba(231, 225, 211, .42);
  font-size: 10.5px;
  line-height: 1.6;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
}

.sidebar-user .avatar {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(200, 164, 93, .26);
  background: rgba(200, 164, 93, .13);
  color: var(--gold-soft);
  font-size: 14px;
}

.sidebar-user-meta {
  min-width: 0;
  flex: 1;
}

.sidebar-user-meta strong {
  display: block;
  overflow: hidden;
  color: #f0e9db;
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-meta span {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: rgba(231, 225, 211, .42);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-logout {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(231, 225, 211, .46);
}
.sidebar-logout:hover { background: rgba(255, 255, 255, .07); color: var(--gold-soft); }

.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding: 0 4px;
  color: rgba(231, 225, 211, .25);
  font-size: 9.5px;
  letter-spacing: .04em;
}

.main-shell {
  min-height: 100vh;
  margin-left: var(--sidebar);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 78px;
  padding: 13px 34px;
  border-bottom: 1px solid rgba(215, 208, 195, .7);
  background: rgba(251, 250, 247, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar-title {
  min-width: 0;
  flex: 1;
}

.topbar-title h1 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.35;
}

.topbar-title p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.net-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .65);
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.net-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #68a184;
  box-shadow: 0 0 0 3px rgba(104, 161, 132, .12);
}

.net-status.offline { color: var(--red); border-color: #edd6d2; background: var(--red-wash); }
.net-status.offline .dot { background: var(--red); box-shadow: 0 0 0 3px rgba(167, 68, 59, .12); }

.topbar-avatar {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 7px 5px 5px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
}
.topbar-avatar:hover { border-color: var(--line); background: var(--white); }
.topbar-avatar .avatar { width: 32px; height: 32px; font-size: 12px; }
.topbar-name {
  max-width: 112px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  color: var(--ink-soft);
}

.view {
  width: 100%;
  max-width: 1420px;
  margin: 0 auto;
  padding: 30px 34px 56px;
  animation: viewIn .34s var(--ease) both;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.offline-banner {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 11px 15px;
  border: 1px solid #edd6d2;
  border-radius: 11px;
  background: var(--red-wash);
  color: var(--red);
  font-size: 12.5px;
}
.offline-banner.show { display: flex; }

/* --------------------------------------------------------------------------
   Page header / toolbar
   -------------------------------------------------------------------------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-head h2 {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: .025em;
  line-height: 1.35;
}

.page-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12.5px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fffdf9;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.search-box {
  position: relative;
  flex: 1 1 260px;
  max-width: 430px;
}

.search-box .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}

.search-box input {
  padding-left: 40px;
  background: var(--white);
}

.toolbar-select {
  width: auto;
  min-width: 118px;
  min-height: 40px;
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 12.5px;
  background-color: var(--white);
}

.toolbar-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.filter-reset {
  border: 0;
  background: transparent;
  color: var(--gold-strong);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */
.dash-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  min-height: 160px;
  margin-bottom: 16px;
  padding: 23px 30px;
  border-radius: var(--radius-lg);
  color: #f5eee0;
  background:
    radial-gradient(circle at 82% 20%, rgba(200, 164, 93, .23), transparent 29%),
    linear-gradient(120deg, #1a304c 0%, #112139 54%, #0b1727 100%);
  box-shadow: 0 18px 44px rgba(15, 27, 44, .16);
}

.dash-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -70px;
  top: -130px;
  width: 400px;
  height: 400px;
  border: 1px solid rgba(200, 164, 93, .14);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(200, 164, 93, .025), 0 0 0 110px rgba(200, 164, 93, .016);
}

.dash-hero::after {
  content: "华";
  position: absolute;
  z-index: -1;
  right: 26%;
  bottom: -78px;
  font-family: var(--serif);
  font-size: 230px;
  line-height: 1;
  color: rgba(234, 217, 179, .035);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  max-width: 720px;
}

.hero-greeting { margin: 0; }

.hero-datetime {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 15px;
  margin-top: 8px;
  color: rgba(239, 231, 213, .62);
  font-size: 10.5px;
  letter-spacing: .03em;
}
.hero-datetime span { display: inline-flex; align-items: center; gap: 5px; }
.hero-datetime .icon { color: var(--gold-soft); opacity: .85; }
.hero-workspace { color: rgba(200, 164, 93, .72); font-size: 8.5px; font-weight: 600; letter-spacing: .2em; }

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--gold-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.hero-eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--gold);
}

.hero-eyebrow::after {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--gold);
}

.dash-hero h2 {
  font-family: var(--serif);
  font-size: clamp(25px, 2.4vw, 34px);
  font-weight: 600;
  letter-spacing: .035em;
  line-height: 1.4;
}

.dash-hero h2 em { font-style: normal; color: var(--gold-soft); }

.hero-sub {
  margin-top: 9px;
  color: rgba(239, 231, 213, .54);
  font-size: 12.5px;
}

.hero-actions {
  display: flex;
  gap: 9px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.hero-actions .btn-outline {
  --btn-bg: rgba(255, 255, 255, .055);
  --btn-border: rgba(234, 217, 179, .22);
  --btn-color: rgba(247, 241, 228, .8);
}
.hero-actions .btn-outline:hover {
  --btn-bg: rgba(255, 255, 255, .1);
  --btn-border: rgba(234, 217, 179, .42);
  --btn-color: #fff;
}

.hero-date {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  padding-left: 30px;
  border-left: 1px solid rgba(234, 217, 179, .16);
  text-align: center;
}

.hero-date .day {
  font-family: var(--serif);
  font-size: 58px;
  font-weight: 500;
  line-height: .95;
  color: var(--gold-soft);
}

.hero-date .month {
  margin-top: 9px;
  color: rgba(247, 241, 228, .7);
  font-size: 11px;
  letter-spacing: .18em;
}

.hero-date .week {
  margin-top: 5px;
  color: rgba(239, 231, 213, .38);
  font-size: 10.5px;
}

.hero-date .time {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(234, 217, 179, .14);
  color: var(--gold-soft);
  font-size: 12px;
  letter-spacing: .14em;
}

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

.kpi {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 19px 20px 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}

.kpi:hover {
  transform: translateY(-2px);
  border-color: #ddd4c2;
  box-shadow: 0 12px 30px rgba(18, 30, 45, .07);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kpi-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

.kpi-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--paper-2);
  color: var(--ink-soft);
}
.kpi-icon.gold { background: var(--gold-wash); color: var(--gold-strong); }
.kpi-icon.blue { background: var(--blue-wash); color: var(--blue); }
.kpi-icon.amber { background: var(--amber-wash); color: var(--amber); }
.kpi-icon.green { background: var(--green-wash); color: var(--green); }
.kpi-icon.red { background: var(--red-wash); color: var(--red); }

.kpi-value {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 13px;
  font-family: var(--serif);
  font-size: 35px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.01em;
}

.kpi-value small {
  color: var(--muted-2);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
}

.kpi-value.money {
  font-family: var(--serif);
  font-size: clamp(22px, 2vw, 31px);
  letter-spacing: -.015em;
  white-space: nowrap;
}

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.kpi-foot strong {
  color: var(--green);
  font-weight: 600;
}
.kpi-foot .warn { color: var(--amber); }
.kpi-foot .danger { color: var(--red); }

.kpi::after {
  content: "";
  position: absolute;
  right: -25px;
  bottom: -33px;
  width: 85px;
  height: 85px;
  border: 1px solid rgba(200, 164, 93, .11);
  border-radius: 50%;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(330px, .82fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dash-grid > .card {
  display: flex;
  flex-direction: column;
}

.dash-grid > .card > .split-card {
  flex: 1;
  align-items: center;
}

.dash-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.split-card {
  display: grid;
  grid-template-columns: minmax(150px, .72fr) minmax(0, 1.28fr);
  gap: 10px;
  padding: 22px 24px 24px;
}

.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.donut {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) 0 var(--p1), #26486e var(--p1) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
}

.donut::after {
  content: "";
  position: absolute;
  inset: 17px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 5px rgba(18, 30, 45, .05);
}

.donut-center {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-center strong {
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 600;
  line-height: 1;
}

.donut-center span {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.legend-dot.gold { background: var(--gold); }
.legend-dot.blue { background: #26486e; }

.legend-row strong {
  margin-left: auto;
  color: var(--ink);
  font-size: 12.5px;
}

.status-bars {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding-top: 4px;
}

.status-bar-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
}

.status-bar-label {
  color: var(--ink-soft);
  font-size: 11.5px;
  white-space: nowrap;
}

.bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--paper-3);
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--navy-800);
  transition: width .7s var(--ease);
}
.bar-fill.gold { background: var(--gold); }
.bar-fill.blue { background: var(--blue); }
.bar-fill.amber { background: #c4943f; }
.bar-fill.violet { background: var(--violet); }
.bar-fill.green { background: var(--green); }
.bar-fill.gray { background: #aaa69d; }
.bar-fill.neutral { background: #aaa69d; }

.status-bar-count {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  text-align: right;
}

.structure-foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.structure-foot div {
  min-width: 0;
}

.structure-foot span {
  display: block;
  color: var(--muted-2);
  font-size: 9.5px;
}

.structure-foot strong {
  display: block;
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

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

.renewal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid #f0ece4;
  cursor: pointer;
}
.renewal-row:first-child { border-top: 0; padding-top: 4px; }
.renewal-row:last-child { padding-bottom: 0; }

.date-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 46px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}
.date-tile strong {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1;
}
.date-tile span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
  text-transform: uppercase;
}
.date-tile.urgent { border-color: #edd0cb; background: var(--red-wash); }
.date-tile.urgent strong { color: var(--red); }

.renewal-main { min-width: 0; flex: 1; }
.renewal-main strong {
  display: block;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.renewal-main span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10.5px;
}

.days-pill {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}
.days-pill.urgent { background: var(--red-wash); color: var(--red); }
.days-pill.soon { background: var(--amber-wash); color: var(--amber); }

.dash-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(330px, .82fr);
  gap: 16px;
}

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

.quick-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid #f0ece4;
  cursor: pointer;
}
.quick-item:first-child { border-top: 0; padding-top: 2px; }
.quick-item:last-child { padding-bottom: 2px; }
.quick-item:hover .quick-title { color: var(--gold-strong); }

.quick-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--gold-wash);
  color: var(--gold-strong);
}

.quick-content { min-width: 0; flex: 1; }
.quick-title {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .18s var(--ease);
}
.quick-sub {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10.5px;
}

.quick-arrow { color: var(--muted-2); }

.stat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #f0ece4;
  font-size: 12px;
}
.stat-line:first-child { border-top: 0; padding-top: 0; }
.stat-line:last-child { padding-bottom: 0; }
.stat-line span { color: var(--muted); }
.stat-line strong { font-family: var(--mono); font-size: 12.5px; }

/* --------------------------------------------------------------------------
   Clients table
   -------------------------------------------------------------------------- */
.table-card {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.table-scroll { width: 100%; overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: #faf8f3;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1ede5;
  vertical-align: middle;
  font-size: 12.5px;
}

.data-table tbody tr {
  transition: background .16s var(--ease);
}

.data-table tbody tr:hover { background: #fdfbf6; }
.data-table tbody tr:last-child td { border-bottom: 0; }

.data-table tr.clickable { cursor: pointer; }

.data-table-clients {
  min-width: 1280px;
  table-layout: auto;
}
.data-table-clients th:nth-child(1) { width: 22%; }
.data-table-clients th:nth-child(2) { width: 9%; }
.data-table-clients th:nth-child(3) { width: 11%; }
.data-table-clients th:nth-child(4) { width: 12%; }
.data-table-clients th:nth-child(5) { width: 15%; }
.data-table-clients th:nth-child(6) { width: 11%; }
.data-table-clients th:nth-child(7) { width: 9%; }
.data-table-clients th:nth-child(8) { width: 15%; }
.data-table-clients .period-dates {
  gap: 3px;
  white-space: nowrap;
}
.data-table-clients .contact-cell span { white-space: nowrap; }
.data-table-clients .person-cell { min-width: 0; }
.data-table-clients .person-cell > div { min-width: 0; }
.data-table-clients .person-cell strong,
.data-table-clients .person-cell .assistant {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data-table-clients .client-meta strong { max-width: 100%; }
.data-table-clients .payment-cell { min-width: 0; }

.client-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 190px;
}

.client-mark {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(145deg, #fff, var(--paper-2));
  color: var(--navy-800);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
}

.client-meta { min-width: 0; }
.client-meta strong {
  display: block;
  max-width: 280px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12.8px;
  font-weight: 600;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
}

.contact-cell strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
}
.contact-cell span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 7px;
}
.person-cell .avatar { width: 26px; height: 26px; font-size: 10px; }
.person-cell strong { font-size: 11.5px; font-weight: 500; }
.person-cell .assistant {
  color: var(--muted);
  font-size: 10px;
}

.period-cell { min-width: 132px; }
.period-cell.remaining-only {
  min-width: 96px;
  padding-top: 1px;
}
.period-cell.remaining-only .period-meta { margin-top: 0; }
.period-cell.remaining-only .period-text { font-size: 10px; }
.period-dates {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
}
.period-dates .sep { color: var(--muted-2); }
.period-dates.end-only { gap: 6px; }
.period-end-label {
  color: var(--muted-2);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .03em;
}
.period-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.period-track {
  height: 4px;
  flex: 1;
  overflow: hidden;
  border-radius: 99px;
  background: var(--paper-3);
}
.period-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--navy-700);
}
.period-fill.urgent { background: var(--red); }
.period-fill.warn { background: #c4943f; }
.period-fill.done { background: #b9b4aa; }
.period-text {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 9px;
  white-space: nowrap;
}
.period-text.urgent { color: var(--red); font-weight: 600; }
.period-text.warn { color: var(--amber); }

.payment-cell {
  min-width: 118px;
}
.payment-total {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.payment-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}
.payment-track {
  height: 4px;
  flex: 1;
  overflow: hidden;
  border-radius: 99px;
  background: var(--paper-3);
}
.payment-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b6924e, var(--gold));
  transition: width .5s var(--ease);
}
.payment-fill.overdue { background: linear-gradient(90deg, #bb6b62, var(--red)); }
.payment-fill.paid { background: linear-gradient(90deg, #4d8f70, var(--green)); }
.payment-progress > span {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 8.5px;
}
.payment-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}
.payment-sub.overdue { color: var(--red); font-weight: 600; }
.payment-sub.paid { color: var(--green); }
.payment-cell.unset .payment-total { font-family: var(--sans); font-size: 10px; font-weight: 500; }
.payment-cell.unset .payment-sub { color: var(--muted-2); }

.payment-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.payment-badge.unpaid { background: var(--amber-wash); color: var(--amber); }
.payment-badge.partial { background: var(--blue-wash); color: var(--blue); }
.payment-badge.paid { background: var(--green-wash); color: var(--green); }
.payment-badge.unset { background: var(--gray-wash); color: #89857c; }
.payment-badge.overdue { background: var(--red-wash); color: var(--red); }

.row-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}
.row-action {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}
.row-action:hover {
  border-color: var(--line);
  background: var(--white);
  color: var(--ink);
}
.row-action.danger:hover { border-color: #edd6d2; background: var(--red-wash); color: var(--red); }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: #fffdf9;
}

.result-count {
  color: var(--muted);
  font-size: 11px;
}
.result-count strong { color: var(--ink); font-weight: 600; }

.pagination {
  display: flex;
  align-items: center;
  gap: 5px;
}

.page-btn {
  display: grid;
  place-items: center;
  min-width: 31px;
  height: 31px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  color: var(--muted);
  font-size: 11px;
}
.page-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--ink); }
.page-btn.active {
  border-color: var(--navy-850);
  background: var(--navy-850);
  color: #fff;
}
.page-btn:disabled { opacity: .35; cursor: not-allowed; }
.page-info {
  padding: 0 7px;
  color: var(--muted-2);
  font-size: 10.5px;
  white-space: nowrap;
}

.skeleton-row td { padding: 15px 16px; }
.skeleton {
  position: relative;
  overflow: hidden;
  height: 12px;
  border-radius: 5px;
  background: #f0ece4;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 270px;
  padding: 40px 20px;
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--muted-2);
}
.empty-state h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}
.empty-state p {
  max-width: 360px;
  margin: 6px 0 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Client detail
   -------------------------------------------------------------------------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 11.5px;
}
.breadcrumb button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: inherit;
  line-height: 1;
}
.breadcrumb button:hover { color: var(--ink); }
.breadcrumb .sep { color: var(--muted-2); }
.breadcrumb strong { color: var(--ink-soft); font-weight: 500; }

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

.detail-title-block { min-width: 0; }
.detail-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.detail-code {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .03em;
}
.detail-head h2 {
  max-width: 760px;
  font-family: var(--serif);
  font-size: clamp(25px, 2.7vw, 34px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .02em;
}
.detail-head .sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.detail-payment-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  padding: 11px 15px;
  border: 1px solid #efd9bd;
  border-radius: 11px;
  background: var(--amber-wash);
  color: var(--amber);
  font-size: 12px;
}
.detail-payment-banner.overdue {
  border-color: #edd0cb;
  background: var(--red-wash);
  color: var(--red);
}
.detail-payment-banner .link-btn { margin-left: auto; }
.detail-payment-banner strong { font-weight: 700; }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, .75fr);
  gap: 16px;
  align-items: start;
}

.detail-main,
.detail-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.info-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 82px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.info-cell:nth-child(odd) { border-right: 1px solid var(--line); }
.info-cell.full { grid-column: 1 / -1; border-right: 0; }

.info-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: .04em;
}
.info-value {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}
.info-value.serif { font-family: var(--serif); font-size: 15px; }
.info-value.mono { font-family: var(--mono); font-size: 12px; }
.info-value a:hover { color: var(--gold-strong); }

.expiry-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0ddc1;
  background: linear-gradient(90deg, #fbf3e4, #fdfaf3);
  color: var(--amber);
  font-size: 12px;
}
.expiry-banner .btn { margin-left: auto; }
.expiry-banner.expired {
  border-color: #efd7d3;
  background: var(--red-wash);
  color: var(--red);
}

.current-progress {
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  background: linear-gradient(140deg, #fdfbf6, #fff);
}

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

.current-progress-head h3 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
}

.current-progress p {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.progress-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted-2);
  font-size: 10.5px;
  flex-wrap: wrap;
}

.progress-timeline {
  padding: 2px 24px 6px;
}

.timeline {
  position: relative;
  padding: 16px 0 0;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 13px;
  padding-bottom: 21px;
}
.timeline-item:last-child { padding-bottom: 2px; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 16px;
  bottom: -2px;
  width: 1px;
  background: var(--line);
}
.timeline-item:last-child::before { display: none; }

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 15px;
  height: 15px;
  margin-top: 3px;
  border: 4px solid var(--white);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 1px var(--line);
}
.timeline-dot.green { background: var(--green); }
.timeline-dot.red { background: var(--red); }
.timeline-dot.blue { background: var(--blue); }
.timeline-dot.gray { background: #aaa69d; }

.timeline-content {
  min-width: 0;
  padding: 0 0 2px;
}
.timeline-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.timeline-head strong {
  font-size: 11.5px;
  font-weight: 600;
}
.timeline-head time {
  margin-left: auto;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
  white-space: nowrap;
}
.timeline-content p {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.timeline-author {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 9.5px;
}

/* Payment / receivables */
.payment-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.payment-clear-label {
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
}

.payment-alert {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 24px 0;
  padding: 10px 12px;
  border: 1px solid #efd9bd;
  border-radius: 9px;
  background: var(--amber-wash);
  color: var(--amber);
  font-size: 11.5px;
  line-height: 1.6;
}
.payment-alert.overdue {
  border-color: #edd0cb;
  background: var(--red-wash);
  color: var(--red);
}
.payment-alert .link-btn { margin-left: auto; flex: 0 0 auto; }
.payment-alert strong { font-weight: 700; }

.payment-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.payment-summary-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 15px 20px;
  border-left: 1px solid var(--line);
}
.payment-summary-item:first-child { border-left: 0; }
.payment-summary-item span {
  color: var(--muted-2);
  font-size: 9.5px;
}
.payment-summary-item strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}
.payment-summary-item strong small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 400;
}

.payment-progress-large { padding: 17px 24px 19px; }
.payment-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10.5px;
}
.payment-progress-label strong {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
}
.payment-track.large { height: 8px; }
.payment-progress-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.payment-history {
  padding: 2px 24px 22px;
}
.payment-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 8px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}
.payment-history-head span:last-child {
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 400;
}
.payment-records {
  display: flex;
  flex-direction: column;
}
.payment-record {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid #f2eee6;
}
.payment-record:first-child { border-top: 0; }
.payment-record-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid #d3e5dc;
  border-radius: 8px;
  background: var(--green-wash);
  color: var(--green);
}
.payment-record-main { min-width: 0; flex: 1; }
.payment-record-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.payment-record-title strong {
  color: var(--green);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
}
.payment-record-title span {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--muted);
  font-size: 8.5px;
}
.payment-record-main p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}
.payment-record-author {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 9px;
}
.payment-record .row-action { margin-left: auto; flex: 0 0 auto; }

.payment-modal-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(135deg, #fdfbf6, #f7f3ea);
  overflow: hidden;
}
.payment-modal-summary > div {
  padding: 12px 13px;
  border-left: 1px solid var(--line);
}
.payment-modal-summary > div:first-child { border-left: 0; }
.payment-modal-summary span {
  display: block;
  color: var(--muted-2);
  font-size: 9px;
}
.payment-modal-summary strong {
  display: block;
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}
.payment-fill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.payment-fill-row .field-hint { margin: 0; }

.receivable-box {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
  gap: 10px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #e8ddc4;
  border-radius: 12px;
  background:
    radial-gradient(circle at 100% 0%, rgba(200, 164, 93, .12), transparent 42%),
    linear-gradient(140deg, #fdfaf3, #f8f3e7);
}
.receivable-main span,
.receivable-overdue span {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
}
.receivable-main strong {
  display: block;
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
}
.receivable-main small,
.receivable-overdue small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9px;
}
.receivable-overdue {
  padding-left: 11px;
  border-left: 1px solid #e7dcc5;
}
.receivable-overdue strong {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}
.receivable-overdue.has-overdue strong { color: var(--red); }
.receivable-overdue.has-overdue small { color: var(--red); }

.payment-this-month {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
  padding: 7px 9px;
  border-radius: 7px;
  background: var(--green-wash);
  color: var(--green);
  font-size: 10px;
}
.payment-this-month strong { font-weight: 700; }

.payment-reminder-list {
  display: flex;
  flex-direction: column;
  max-height: none;
  overflow: visible;
}
.payment-reminder-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid #f0ece4;
  cursor: pointer;
}
.payment-reminder-row:first-child { border-top: 0; }
.payment-reminder-row:hover .payment-reminder-main strong { color: var(--gold-strong); }
.payment-reminder-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: var(--gold-wash);
  color: var(--gold-strong);
}
.payment-reminder-main { min-width: 0; flex: 1; }
.payment-reminder-main strong {
  display: block;
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .16s var(--ease);
}
.payment-reminder-main span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 9px;
}
.payment-reminder-side {
  flex: 0 0 auto;
  text-align: right;
}
.payment-reminder-side strong {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.payment-reminder-side span {
  display: block;
  color: var(--muted-2);
  font-size: 8.5px;
}
.payment-reminder-side span.overdue { color: var(--red); font-weight: 600; }
.payment-reminder-side span.soon { color: var(--amber); }

.side-note {
  padding: 17px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}
.side-note strong { color: var(--ink-soft); }

.contact-card {
  padding: 20px 22px;
}
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.contact-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.contact-row .icon {
  margin-top: 2px;
  color: var(--gold-strong);
}
.contact-row div { min-width: 0; }
.contact-row > div > span {
  display: block;
  color: var(--muted-2);
  font-size: 9.5px;
}
.contact-row > div > strong {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  font-weight: 500;
  word-break: break-word;
}
.contact-row a:hover { color: var(--gold-strong); }

/* --------------------------------------------------------------------------
   Users / settings
   -------------------------------------------------------------------------- */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.mini-stat {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
}
.mini-stat .kpi-icon { width: 36px; height: 36px; }
.mini-stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.1;
}
.mini-stat span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
}

.user-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}
.user-identity strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}
.user-identity span {
  display: block;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
}

.user-self-tag {
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 8.5px;
  font-weight: 500;
  vertical-align: 1px;
}

.role-tag {
  display: inline-block;
  margin-left: 3px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 8.5px;
  font-weight: 500;
  line-height: 1.6;
  vertical-align: 1px;
}
.role-tag.admin {
  border-color: #e2d9f0;
  background: var(--violet-wash);
  color: var(--violet);
}

.position-chip {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.position-chip.director {
  border-color: #e6d4ac;
  background: var(--gold-wash);
  color: #80601f;
}
.position-chip.senior {
  border-color: #ded4ed;
  background: var(--violet-wash);
  color: var(--violet);
}
.position-chip.partner {
  border-color: #d7e2ee;
  background: var(--blue-wash);
  color: var(--blue);
}
.position-chip.lawyer {
  border-color: #d3e5dc;
  background: var(--green-wash);
  color: var(--green);
}
.position-chip.assistant {
  border-color: #e8e3d8;
  background: var(--paper-2);
  color: #777168;
}
.position-chip.unset {
  border-style: dashed;
  background: transparent;
  color: var(--muted-2);
  font-weight: 400;
}

.dept-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.dept-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.dept-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.dept-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color .16s var(--ease), background .16s var(--ease), color .16s var(--ease);
}
.dept-chip span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
}
.dept-chip:hover {
  border-color: #cdbd98;
  background: #fffdf8;
  color: var(--ink);
}
.dept-chip.active {
  border-color: var(--navy-800);
  background: var(--navy-850);
  color: #f7f1e4;
}
.dept-chip.active span { color: var(--gold-soft); }

.dept-filter-current {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--muted-2);
  font-size: 10.5px;
  white-space: nowrap;
}

.data-table tr.dept-group-row {
  background: #f8f5ee;
  cursor: default;
}
.data-table tr.dept-group-row:hover { background: #f8f5ee; }
.data-table tr.dept-group-row td {
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  border-top: 1px solid #efeae1;
}
.data-table tr.dept-group-row:first-child td { border-top: 0; }

.dept-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
}
.dept-group-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #e2d5b8;
  border-radius: 6px;
  background: var(--gold-wash);
  color: var(--gold-strong);
}
.dept-group-head.unassigned .dept-group-mark {
  border-color: var(--line);
  background: var(--paper-2);
  color: var(--muted);
}
.dept-group-head strong {
  font-family: var(--serif);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.dept-group-count {
  color: var(--muted-2);
  font-size: 9.5px;
  white-space: nowrap;
}
.dept-group-line {
  height: 1px;
  flex: 1;
  margin-left: 4px;
  background: #e9e2d5;
}

.dept-manage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 8px;
  color: var(--muted);
  font-size: 10.5px;
}
.dept-manage-head span:first-child {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.dept-manage-list {
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: var(--white);
}

.dept-manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-top: 1px solid #f0ece4;
}
.dept-manage-item:first-child { border-top: 0; }

.dept-manage-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.dept-manage-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  border: 1px solid #e5d8bc;
  border-radius: 8px;
  background: var(--gold-wash);
  color: var(--gold-strong);
}
.dept-manage-name strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}
.dept-manage-name span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 9.5px;
}
.dept-manage-actions {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}

.dept-add-form {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
}
.dept-add-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
}
.dept-add-row .btn { min-height: 43px; }
.dept-add-form .form-alert { margin-bottom: 10px; }

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 16px;
  align-items: start;
}

.profile-banner {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 88% 10%, rgba(200, 164, 93, .12), transparent 32%),
    linear-gradient(120deg, #fdfaf4, #fff);
}
.profile-banner .avatar { width: 54px; height: 54px; font-size: 21px; }
.profile-banner h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
}
.profile-banner p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}
.profile-banner .badge { margin-left: auto; }

.detail-list {
  display: flex;
  flex-direction: column;
}
.detail-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 24px;
  border-top: 1px solid #f2eee6;
  font-size: 12px;
}
.detail-row:first-child { border-top: 0; }
.detail-row span { color: var(--muted); }
.detail-row strong {
  max-width: 65%;
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

.network-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.network-url {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.network-url code {
  flex: 1;
  overflow: hidden;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.network-url .btn { min-height: 27px; padding: 2px 7px; }

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--green-wash);
  color: var(--green);
  font-size: 10px;
  font-weight: 600;
}
.online-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.security-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 0;
}
.security-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}
.security-item .icon { margin-top: 2px; color: var(--gold-strong); }

/* --------------------------------------------------------------------------
   Modal / forms
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: rgba(7, 15, 26, .52);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fadeIn .18s ease both;
}

.modal {
  width: 100%;
  max-width: 580px;
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  animation: modalIn .28s var(--ease) both;
}

.modal.modal-lg { max-width: 790px; }
.modal.modal-sm { max-width: 430px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 17px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, #fdfbf7, #faf7ef);
}
.modal-head h2 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .02em;
}
.modal-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}
.modal-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}
.modal-close:hover { border-color: var(--line); background: var(--white); color: var(--ink); }

.modal > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal-body {
  overflow-y: auto;
  padding: 21px 24px 24px;
}

.modal > form > .modal-body {
  flex: 1 1 auto;
  min-height: 0;
}

.modal > form > .modal-foot {
  flex: 0 0 auto;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: #f8f5ee;
}
.modal-foot .foot-note {
  margin-right: auto;
  color: var(--muted-2);
  font-size: 10.5px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 16px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-grid .field + .field { margin-top: 0; }

.form-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  grid-column: 1 / -1;
  margin: 3px 0 -2px;
  color: var(--gold-strong);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.form-section-title::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.form-section-title:not(:first-child) { margin-top: 7px; }

.member-field-hint {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 400;
}

.member-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  max-height: 174px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--white);
}

.member-check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.member-check:hover { border-color: var(--line); background: var(--paper); }
.member-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.member-check .avatar { width: 28px; height: 28px; font-size: 11px; }
.member-check-info { min-width: 0; flex: 1; }
.member-check-info strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-check-info span {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-check-mark {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--white);
  color: transparent;
}
.member-check-mark .icon { width: 11px; height: 11px; stroke-width: 2.5; }
.member-check input:checked ~ .member-check-mark {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--navy-900);
}
.member-check:has(input:checked) {
  border-color: #e6d4ac;
  background: var(--gold-wash);
}
.member-check.inactive { opacity: .55; cursor: not-allowed; }
.member-check input:focus-visible ~ .member-check-mark {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
}
.member-list-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.member-list-item .avatar { width: 27px; height: 27px; font-size: 10px; }
.member-list-item strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}
.member-list-item small {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.stage-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.category-picker {
  display: flex;
  gap: 8px;
}
.category-option {
  position: relative;
  cursor: pointer;
}
.category-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.category-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  min-height: 34px;
  padding: 6px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.category-option input:checked + span {
  border-color: var(--gold);
  background: var(--gold-wash);
  color: #7d5e1d;
  box-shadow: 0 0 0 2px rgba(200, 164, 93, .12);
}
.category-option input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.service-type-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.case-category-chip {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 7px;
  border: 1px solid #d7e2ee;
  border-radius: 6px;
  background: var(--blue-wash);
  color: var(--blue);
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}
.case-category-chip.criminal {
  border-color: #edd0cb;
  background: var(--red-wash);
  color: var(--red);
}
.stage-option {
  position: relative;
  cursor: pointer;
}
.stage-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.stage-option span {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.stage-option:hover span { border-color: var(--gold); color: var(--ink); }
.stage-option input:checked + span {
  border-color: var(--gold);
  background: var(--gold-wash);
  color: #7d5e1d;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(200, 164, 93, .18);
}
.stage-option input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.stages-cell { min-width: 105px; }
.stage-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.stage-chip {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 1px 7px;
  border: 1px solid #e6d4ac;
  border-radius: 5px;
  background: var(--gold-wash);
  color: #80601f;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}
.stage-empty {
  color: var(--muted-2);
  font-size: 9.5px;
}
.info-value .stages-cell { min-width: 0; }
.info-value .stage-chip { font-size: 10px; min-height: 23px; }

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

.segment {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--white);
  cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
}
.segment:hover { border-color: #c9b98f; }
.segment input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segment .segment-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--muted);
}
.segment .segment-text strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}
.segment .segment-text span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 9.5px;
}
.segment:has(input:checked) {
  border-color: var(--gold);
  background: var(--gold-wash);
  box-shadow: 0 0 0 2px rgba(200, 164, 93, .12);
}
.segment:has(input:checked) .segment-icon { background: var(--gold); color: var(--navy-900); }
.segment:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }

.form-alert {
  display: none;
  align-items: flex-start;
  gap: 8px;
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px solid #efd2ce;
  border-radius: 8px;
  background: var(--red-wash);
  color: var(--red);
  font-size: 12px;
  line-height: 1.55;
}
.form-alert.show { display: flex; }

.form-alert.success {
  border-color: #cfe3d8;
  background: var(--green-wash);
  color: var(--green);
}

.password-meter {
  display: flex;
  gap: 4px;
  margin-top: 5px;
}
.password-meter span {
  height: 3px;
  flex: 1;
  border-radius: 2px;
  background: var(--line);
  transition: background .2s ease;
}
.password-meter span.on { background: var(--green); }
.password-meter span.mid { background: var(--amber); }

.confirm-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 13px;
  border-radius: 12px;
  background: var(--red-wash);
  color: var(--red);
}
.confirm-text {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
}
.confirm-text strong { color: var(--ink); }

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  z-index: 300;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: min(370px, calc(100vw - 44px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--shadow-md);
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.55;
  pointer-events: auto;
  animation: toastIn .25s var(--ease) both;
}
.toast.leaving { animation: toastOut .2s ease both; }
.toast .icon { margin-top: 1px; color: var(--green); }
.toast.error { border-color: #edd6d2; background: #fffafa; }
.toast.error .icon { color: var(--red); }
.toast.info .icon { color: var(--blue); }
.toast strong { display: block; font-weight: 600; }
.toast p { margin-top: 1px; color: var(--muted); font-size: 11.5px; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(6px) scale(.98); }
}

/* --------------------------------------------------------------------------
   Misc
   -------------------------------------------------------------------------- */
.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

.inline-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.loading-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-outline .loading-spinner,
.btn-ghost .loading-spinner {
  border-color: rgba(24, 35, 52, .18);
  border-top-color: var(--ink);
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 330px;
  color: var(--muted);
  font-size: 12px;
}
.page-loading .loading-spinner {
  border-color: var(--line-strong);
  border-top-color: var(--gold);
}

.fade-in { animation: riseIn .35s var(--ease) both; }

.mobile-overlay {
  display: none;
  position: fixed;
  z-index: 55;
  inset: 0;
  background: rgba(7, 15, 26, .45);
  backdrop-filter: blur(2px);
}

.copy-feedback {
  color: var(--green) !important;
  border-color: #cfe3d8 !important;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  :root { --sidebar: 232px; }
  .view { padding: 26px 26px 50px; }
  .topbar { padding: 12px 26px; }
  .dash-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, .85fr); }
  .dash-bottom { grid-template-columns: minmax(0, 1fr) minmax(300px, .85fr); }
  .split-card { grid-template-columns: 1fr; }
  .donut-wrap { padding-bottom: 4px; }
  .legend { width: 100%; }
}

@media (max-width: 1020px) {
  .login-page { grid-template-columns: 1fr 1fr; }
  .login-brand { padding: 38px 36px 30px; }
  .login-copy h1 { font-size: 42px; }
  .login-panel { padding: 36px; }
  .detail-grid { grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid > .card:nth-child(2) { order: -1; }
  .dash-bottom { grid-template-columns: 1fr; }
  .split-card { grid-template-columns: minmax(160px, .6fr) minmax(0, 1.4fr); }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  :root { --sidebar: 258px; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .28s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .mobile-overlay { display: block; }
  .main-shell { margin-left: 0; }
  .menu-toggle { display: grid; place-items: center; }
  .topbar { padding: 11px 20px; min-height: 70px; }
  .view { padding: 22px 20px 46px; }
  .login-page { grid-template-columns: 1fr; }
  .login-brand {
    min-height: auto;
    padding: 28px 28px 30px;
  }
  .login-copy { padding: 26px 0 8px; }
  .login-copy h1 { font-size: 38px; }
  .login-copy p { margin-top: 14px; }
  .login-motto { margin-top: 20px; }
  .login-brand-footer { display: none; }
  .login-panel { padding: 36px 24px 44px; }
  .login-card { max-width: 460px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { order: -1; }
  .detail-head { flex-direction: column; gap: 14px; }
  .stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-title h1 { font-size: 19px; }
  .topbar-title p { display: none; }
}

@media (max-width: 700px) {
  .dash-hero { padding: 24px 22px; min-height: auto; }
  .hero-date { display: none; }
  .hero-actions { margin-top: 17px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { min-height: 120px; padding: 15px; }
  .kpi-value { font-size: 31px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 13px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .toolbar { padding: 12px; }
  .search-box { max-width: none; flex-basis: 100%; }
  .toolbar-select { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .toolbar-meta { width: 100%; margin-left: 0; }
  .split-card { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .info-cell:nth-child(odd) { border-right: 0; }
  .info-cell { min-height: 0; padding: 13px 17px; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal {
    max-width: none;
    max-height: 94vh;
    border-radius: 18px 18px 0 0;
    animation: modalUp .28s var(--ease) both;
  }
  .modal-body { padding: 18px 18px 22px; }
  .modal-head { padding: 18px; }
  .modal-foot { padding: 12px 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .segmented { grid-template-columns: 1fr; }
  .member-picker { grid-template-columns: 1fr; max-height: 220px; }
  .toast-stack { right: 12px; bottom: 12px; }
  .toast { width: calc(100vw - 24px); }
  .table-footer { flex-direction: column; align-items: flex-start; padding: 12px 14px; }
  .pagination { align-self: flex-end; }
  .stats-strip { gap: 8px; }
  .mini-stat { padding: 12px; gap: 10px; }
  .mini-stat strong { font-size: 21px; }
  .mini-stat .kpi-icon { width: 31px; height: 31px; }
  .client-meta strong { max-width: 200px; }
  .expiry-banner { align-items: flex-start; flex-wrap: wrap; }
  .expiry-banner .btn { margin-left: 0; }
  .login-brand::after { font-size: 300px; }
  .topbar-name { display: none; }
}

@media (max-width: 760px) {
  .data-table-sales { min-width: 0; table-layout: auto; width: 100%; }
  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }
  .data-table thead { display: none; }
  .data-table-clients { min-width: 0; table-layout: auto; }
  .data-table tbody { padding: 8px 12px 4px; }
  .data-table tbody tr {
    position: relative;
    margin: 8px 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 2px 8px rgba(18, 30, 45, .025);
  }
  .data-table tbody tr:hover { background: #fdfbf6; }
  .data-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 6px 0;
    border: 0;
    text-align: right;
  }
  .data-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted-2);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .03em;
    padding-top: 2px;
    text-align: left;
  }
  .data-table td:first-child {
    display: block;
    padding: 0 0 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid #f1ede5;
    text-align: left;
  }
  .data-table td:first-child::before { display: none; }
  .data-table td:last-child {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid #f1ede5;
    align-items: center;
  }
  .data-table td:last-child::before { display: none; }
  .data-table td[colspan] { display: block; padding: 0; text-align: left; }
  .data-table td[colspan]::before { display: none; }
  .data-table .client-identity { min-width: 0; }
  .data-table .client-meta strong { max-width: 62vw; }
  .data-table .period-cell { min-width: 0; width: 100%; }
  .data-table .row-actions { width: 100%; justify-content: flex-end; }
  .data-table .contact-cell { text-align: right; }
  .data-table .person-cell { justify-content: flex-end; text-align: right; }
  .data-table .person-cell > div { text-align: right; }
  .data-table .type-chip,
  .data-table .status-badge { margin-top: 1px; }
  .data-table tbody tr.dept-group-row {
    margin: 14px 0 2px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .data-table tbody tr.dept-group-row:first-child { margin-top: 0; }
  .data-table tbody tr.dept-group-row:hover { background: transparent; }
  .data-table tr.dept-group-row td {
    display: block;
    padding: 0 2px 8px;
    border: 0;
    text-align: left;
  }
  .data-table tr.dept-group-row td::before { display: none; }
  .dept-filter-bar { gap: 8px; padding: 10px 12px; }
  .dept-filter-label { width: 100%; }
  .dept-chips { width: 100%; }
  .dept-filter-current { width: 100%; margin-left: 0; }
  .dept-manage-item { align-items: flex-start; flex-direction: column; }
  .dept-manage-actions { width: 100%; justify-content: flex-end; }
  .dept-add-row { align-items: stretch; flex-direction: column; }
  .dept-add-row .btn { width: 100%; }
  .data-table .payment-cell { width: 100%; min-width: 0; text-align: right; }
  .payment-head-actions { flex-wrap: wrap; justify-content: flex-end; }
  .payment-summary-grid { grid-template-columns: 1fr 1fr; }
  .payment-summary-item:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .payment-summary-item:nth-child(4) { border-top: 1px solid var(--line); }
  .payment-summary-item { padding: 12px 14px; }
  .payment-summary-item strong { font-size: 16px; }
  .payment-alert { align-items: flex-start; flex-wrap: wrap; margin: 12px 14px 0; }
  .payment-alert .link-btn { margin-left: 0; }
  .detail-payment-banner { align-items: flex-start; flex-wrap: wrap; padding: 10px 12px; }
  .detail-payment-banner .link-btn { margin-left: 0; }
  .payment-progress-large { padding: 15px 14px; }
  .payment-history { padding: 2px 14px 16px; }
  .payment-modal-summary { grid-template-columns: 1fr 1fr; }
  .payment-modal-summary > div:nth-child(3) {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .payment-fill-row { align-items: flex-start; flex-wrap: wrap; }
  .receivable-box { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
  .payment-reminder-list { max-height: none; overflow: visible; }
}


@keyframes modalUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .topbar { gap: 10px; padding: 10px 14px; }
  .view { padding: 18px 14px 40px; }
  .net-status { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-label { font-size: 10.5px; }
  .kpi-icon { width: 28px; height: 28px; }
  .kpi-value { font-size: 28px; }
  .dash-hero h2 { font-size: 24px; }
  .hero-actions .btn { flex: 1; }
  .detail-head h2 { font-size: 25px; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1; }
  .page-head h2 { font-size: 23px; }
  .login-brand { padding: 22px 20px 26px; }
  .login-copy h1 { font-size: 33px; }
  .login-panel { padding: 30px 20px 38px; }
  .login-card h2 { font-size: 28px; }
  .login-brand .brand-lockup .brand-text small { display: none; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .modal-head h2 { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .sidebar, .topbar, .page-actions, .detail-actions, .toolbar, .table-footer, .toast-stack { display: none !important; }
  .main-shell { margin-left: 0; }
  body { background: #fff; }
  .view { max-width: none; padding: 0; }
  .card, .table-card { box-shadow: none; border-color: #ddd; }
}

/* ---------------------------------------------------------------- sales */
.sales-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.sales-stat {
  padding: 17px 19px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: var(--shadow-xs);
}
.sales-stat-label { display: block; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .04em; }
.sales-stat strong { display: block; margin-top: 7px; color: var(--ink); font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1; }
.sales-stat-foot { display: block; margin-top: 8px; color: var(--muted-2); font-size: 9px; }
.sales-stat.signed { border-color: #d6e7da; background: linear-gradient(135deg, #fbfdf9, #f2f8f1); }
.sales-stat.signed strong { color: #3d6b4e; }
.sales-card { overflow: hidden; }
.sales-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.sales-toolbar .search-box { flex: 1 1 280px; max-width: 390px; }
.sales-toolbar .toolbar-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
}
.sales-toolbar .toolbar-filters select {
  width: auto;
  min-width: 118px;
  min-height: 38px;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 11.5px;
  background-color: var(--white);
}
.sales-toolbar .result-count { margin-left: auto; white-space: nowrap; font-size: 10px; color: var(--muted); }
.data-table-sales {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
.sales-name-cell { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.sales-name-cell > div { min-width: 0; }
.sales-name-cell strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}
.sales-code { margin-top: 3px; color: var(--muted-2); font-family: var(--mono); font-size: 8.5px; letter-spacing: .02em; }
.source-pill { display: inline-flex; padding: 4px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.contact-mini strong { display: block; color: var(--ink); font-size: 11px; font-weight: 600; }
.contact-mini span { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; white-space: nowrap; }
.sales-progress-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
.sales-note {
  display: block;
  max-width: 100%;
  overflow: visible;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}
.owner-chip { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; background: var(--gray-wash); color: var(--muted); font-size: 9.5px; white-space: nowrap; }
.data-table-sales .row-actions { justify-content: flex-start; gap: 5px; flex-wrap: wrap; }
.data-table-sales .row-actions .link-btn { font-size: 10px; white-space: normal; }

.segment-group { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segment-group .segment { position: relative; display: block; cursor: pointer; }
.segment-group .segment input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.segment-group .segment span {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 7px 12px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--white); color: var(--muted); font-size: 11px; font-weight: 500;
}
.segment-group .segment input:checked + span { border-color: var(--gold); background: var(--gold-wash); color: #7d5e1d; font-weight: 600; }
.segment-group .segment input:disabled + span { cursor: default; opacity: .85; }

@media (max-width: 900px) {
  .sales-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .sales-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .sales-stat { padding: 13px 14px; }
  .sales-stat strong { font-size: 25px; }
  .sales-toolbar .search-box { flex-basis: 100%; }
  .sales-toolbar .toolbar-filters { flex-wrap: wrap; }
  .segment-group { grid-template-columns: 1fr; }
}

/* Keep input icons clear of typed text and placeholders. */
.input-wrap input[type="text"],
.input-wrap input[type="password"],
.input-wrap input[type="email"],
.input-wrap input[type="tel"],
.input-wrap input[type="search"],
.input-wrap input[type="date"],
.input-wrap input[type="number"] {
  padding-left: 42px;
}
.input-wrap input[type="password"] { padding-right: 46px; }
.input-wrap.money-input input[type="text"],
.input-wrap.money-input input[type="number"] { padding-left: 30px; }

/* First-login password setup */
.setup-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 12%, rgba(200, 164, 93, .12), transparent 28%),
    radial-gradient(circle at 82% 88%, rgba(28, 50, 78, .08), transparent 32%),
    var(--paper);
}
.setup-card {
  width: min(460px, 100%);
  padding: 32px 34px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 24px 70px rgba(20, 32, 48, .12);
}
.setup-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.setup-brand .brand-seal {
  width: 42px;
  height: 42px;
  font-size: 23px;
  color: var(--navy-800);
  border-color: var(--gold);
}
.setup-brand div { display: flex; flex-direction: column; }
.setup-brand strong {
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: .16em;
  color: var(--ink);
}
.setup-brand span:not(.brand-seal) {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: .14em;
}
.setup-card h1 {
  margin: 8px 0 8px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
}
.setup-sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.setup-sub strong { color: var(--ink); }
.setup-card form { display: flex; flex-direction: column; gap: 15px; }
.setup-logout { align-self: center; margin-top: 18px; color: var(--muted); }
@media (max-width: 560px) {
  .setup-card { padding: 26px 22px 22px; }
  .setup-card h1 { font-size: 26px; }
}

/* System notifications */
.notice-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.notice-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.notice-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fdfbf7;
  cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.notice-row:hover { border-color: #d8c79c; background: var(--gold-wash); }
.notice-mark {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--gold-wash);
  color: var(--gold-strong);
}
.notice-copy { min-width: 0; flex: 1; }
.notice-title-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.notice-title-line strong { color: var(--ink); font-size: 11px; font-weight: 600; }
.notice-scope {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--gray-wash);
  color: var(--muted);
  font-size: 8.5px;
  white-space: nowrap;
}
.notice-scope.all { background: var(--blue-wash); color: var(--blue); }
.notice-scope.individual { background: var(--violet-wash); color: var(--violet); }
.notice-copy p {
  display: -webkit-box;
  margin: 4px 0 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.notice-meta { color: var(--muted-2); font-size: 8.5px; }
.notice-page { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.notice-card-item {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: var(--shadow-xs);
}
.notice-item-head { display: flex; align-items: center; gap: 9px; }
.notice-item-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; }
.notice-item-title strong { color: var(--ink); font-size: 13px; }
.notice-time { margin-left: auto; color: var(--muted-2); font-size: 9px; white-space: nowrap; }
.notice-card-item > p { margin: 12px 0 14px; color: var(--muted); font-size: 11.5px; line-height: 1.85; white-space: pre-wrap; }
.notice-item-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--muted-2); font-size: 9px; }
.notice-item-foot span { display: inline-flex; align-items: center; gap: 4px; }
.notice-item-foot span:last-child { margin-left: auto; }
.permission-checks { display: flex; flex-wrap: wrap; gap: 10px 22px; min-height: 34px; align-items: center; }
.permission-check { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; cursor: pointer; }
.permission-check input { width: 16px; height: 16px; accent-color: var(--gold); }
@media (max-width: 900px) {
  .notice-list, .notice-page { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .notice-head-actions { width: 100%; justify-content: flex-end; }
  .notice-item-foot span:last-child { margin-left: 0; }
}

/* Avatar upload and review */
.avatar-setup-card { width: min(520px, 100%); }
.avatar-review-alert {
  display: flex; align-items: flex-start; gap: 9px;
  margin: 0 0 20px; padding: 12px 13px;
  border: 1px solid #ead8b4; border-radius: 10px;
  background: #fdf8ed; color: #8a6a26;
  font-size: 10.5px; line-height: 1.65;
}
.avatar-review-alert.rejected { border-color: #efd0cc; background: #fdf1ef; color: #a0524c; }
.avatar-review-alert .icon { flex: 0 0 auto; margin-top: 1px; }
.avatar-review-alert strong { display: block; margin-bottom: 2px; font-size: 11px; }
.avatar-upload-zone {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 16px; padding: 15px;
  border: 1px dashed var(--line-strong); border-radius: 12px;
  background: #fdfbf7;
}
.avatar-upload-preview {
  display: grid; place-items: center;
  width: 104px; height: 104px; flex: 0 0 auto;
  overflow: hidden; border: 1px solid var(--line); border-radius: 50%;
  background: var(--paper-2);
}
.avatar-upload-preview svg { width: 100%; height: 100%; display: block; }
.avatar-upload-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-upload-copy { min-width: 0; }
.avatar-upload-copy strong { display: block; color: var(--ink); font-size: 12px; }
.avatar-upload-copy p { margin: 4px 0 10px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.avatar-file-button { display: inline-flex; width: auto; cursor: pointer; }
.avatar-upload-copy .field-hint { display: block; margin-top: 7px; }
.avatar-review-image {
  display: grid; place-items: center; min-height: 210px; margin-bottom: 14px;
  overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2);
}
.avatar-review-image img { max-width: 100%; max-height: 360px; object-fit: contain; }
.avatar-pending-tag {
  display: inline-flex; margin-left: 6px; padding: 2px 6px; border-radius: 4px;
  background: var(--amber-wash); color: var(--amber); font-size: 8px; font-weight: 600;
}
.avatar-review-note { margin: 10px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.7; }
@media (max-width: 560px) {
  .avatar-upload-zone { align-items: flex-start; flex-direction: column; }
  .avatar-upload-preview { width: 88px; height: 88px; }
}
.btn-outline.danger { border-color: #ecc9c5; color: var(--red); }
.btn-outline.danger:hover { background: var(--red-wash); border-color: #e3b5af; }

.notice-card { margin-bottom: 18px; }
.notice-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted-2); font-size: 8.5px; }
.notice-read-btn {
  flex: 0 0 auto; padding: 3px 8px; border: 1px solid #e6d8bb; border-radius: 5px;
  background: #fffdf8; color: var(--gold-strong); font-size: 9px; cursor: pointer;
}
.notice-read-btn:hover { border-color: var(--gold); background: var(--gold-wash); }
.notice-read-state { padding: 2px 6px; border-radius: 4px; font-size: 8px; font-weight: 600; }
.notice-read-state.unread { background: var(--amber-wash); color: var(--amber); }
.notice-read-state.read { background: var(--gray-wash); color: var(--muted); }
.notice-reads { margin: 0 0 10px; padding: 7px 9px; border-radius: 6px; background: #f7f4ec; color: var(--muted); font-size: 9px; line-height: 1.6; }
.login-first-hint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: -4px;
  padding: 9px 11px;
  border: 1px solid #e5d7b8;
  border-radius: 8px;
  background: #fdf8ed;
  color: #866922;
  font-size: 10px;
  line-height: 1.6;
}
.login-first-hint .icon { flex: 0 0 auto; margin-top: 1px; }
.row-action.success:hover { border-color: #cfe4d5; background: var(--green-wash); color: var(--green); }

/* Notification title list and detail */
.notice-line-page { display: flex; flex-direction: column; gap: 8px; }
.notice-line-row {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 15px 17px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink); text-align: left; cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.notice-line-row:hover { border-color: #d9c9a8; background: #fffdf8; transform: translateY(-1px); }
.notice-line-row:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.notice-line-mark {
  display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto;
  border: 1px solid #e5d7b8; border-radius: 7px; background: var(--gold-wash); color: var(--gold-strong);
}
.notice-line-title { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.notice-line-sender { min-width: 0; align-self: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9.5px; }
.notice-line-arrow { flex: 0 0 auto; color: var(--muted-2); }
.notice-line-arrow .icon { width: 15px; height: 15px; }
.notice-detail-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 15px; }
.notice-detail-target { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 9.5px; }
.notice-detail-content {
  padding: 16px 17px; border: 1px solid var(--line); border-radius: 10px;
  background: #fdfbf7; color: var(--ink-soft); font-size: 11.5px; line-height: 1.9;
  white-space: pre-wrap; word-break: break-word;
}
.notice-detail-readers { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.notice-detail-label { display: block; margin-bottom: 7px; color: var(--muted-2); font-size: 9px; font-weight: 600; letter-spacing: .05em; }
.notice-reader-chip {
  display: inline-flex; margin: 0 5px 5px 0; padding: 3px 8px; border-radius: 5px;
  background: var(--paper-2); color: var(--ink-soft); font-size: 9.5px;
}
.notice-detail-empty { color: var(--muted-2); font-size: 9.5px; }
@media (max-width: 640px) {
  .notice-line-row { padding: 13px 14px; }
  .notice-line-title { font-size: 11px; }
}

/* Notification multimedia */
.notice-media-field, .notice-chart-field { padding-top: 2px; }
.notice-media-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 9px; }
.notice-media-button {
  display: inline-flex; align-items: center; gap: 6px; width: auto;
  padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 7px;
  background: var(--paper); color: var(--ink-soft); font-size: 10px; cursor: pointer;
}
.notice-media-button:hover { border-color: var(--gold); background: var(--gold-wash); color: var(--gold-strong); }
.notice-media-list { display: flex; flex-wrap: wrap; gap: 7px; }
.notice-media-chip {
  display: flex; align-items: center; gap: 7px; max-width: 100%;
  padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; background: #fdfbf7;
  font-size: 9.5px; color: var(--ink-soft);
}
.notice-media-chip.image img { width: 34px; height: 34px; object-fit: cover; border-radius: 5px; }
.notice-media-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-media-chip.file > span:nth-child(2) { display: flex; flex-direction: column; gap: 1px; }
.notice-media-chip strong { font-size: 9.5px; font-weight: 600; }
.notice-media-chip small { color: var(--muted-2); font-size: 8.5px; }
.notice-media-chip button {
  display: grid; place-items: center; width: 20px; height: 20px; margin-left: 2px;
  border: 0; border-radius: 4px; background: transparent; color: var(--muted-2); cursor: pointer;
}
.notice-media-chip button:hover { background: var(--red-wash); color: var(--red); }
.notice-chart-builder { padding: 11px 12px; border: 1px dashed var(--line-strong); border-radius: 9px; background: #fdfbf7; }
.notice-chart-builder .form-grid { margin-bottom: 8px; }
.notice-chart-list { display: grid; gap: 9px; margin-top: 10px; }
.notice-chart-preview { position: relative; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: #fffdf8; }
.notice-chart-remove {
  position: absolute; top: 7px; right: 7px; display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper);
  color: var(--muted); font-size: 8.5px; cursor: pointer;
}
.notice-chart-remove:hover { border-color: #e5c4bf; color: var(--red); background: var(--red-wash); }
.notice-chart { margin: 0; padding: 10px 11px 7px; border: 1px solid var(--line); border-radius: 9px; background: #fffdf8; }
.notice-chart figcaption { margin-bottom: 7px; color: var(--ink); font-size: 10.5px; font-weight: 600; }
.notice-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.notice-chart .chart-grid { stroke: #e9e2d4; stroke-width: 1; }
.notice-chart .chart-bar { fill: #b08a45; opacity: .9; }
.notice-chart .chart-line { fill: none; stroke: #31506f; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.notice-chart .chart-dot { fill: #fffdf8; stroke: #31506f; stroke-width: 2.5; }
.notice-chart .chart-label { fill: #8d887c; font-size: 9px; }
.notice-chart .chart-value { fill: #5d5a52; font-size: 9px; font-weight: 600; }
.notice-chart-pie-wrap { display: flex; align-items: center; gap: 16px; }
.notice-chart-pie { width: 140px; height: 140px; flex: 0 0 auto; border-radius: 50%; box-shadow: inset 0 0 0 12px #fffdf8; }
.notice-chart-legend { display: grid; gap: 5px; min-width: 0; }
.notice-chart-legend span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.notice-chart-legend i { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }
.notice-chart-legend b { margin-left: auto; color: var(--ink-soft); font-weight: 600; }
.notice-detail-section { margin-top: 14px; }
.notice-image-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 7px; }
.notice-image-gallery a { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-2); }
.notice-image-gallery img { display: block; width: 100%; height: 100px; object-fit: cover; transition: transform .18s ease; }
.notice-image-gallery a:hover img { transform: scale(1.03); }
.notice-file-list { display: grid; gap: 7px; }
.notice-file-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fdfbf7; text-decoration: none;
}
.notice-file-item:hover { border-color: var(--gold); background: var(--gold-wash); }
.notice-file-icon { display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 auto; border-radius: 6px; background: var(--paper-2); color: var(--gold-strong); }
.notice-file-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.notice-file-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 9.5px; }
.notice-file-copy small { color: var(--muted-2); font-size: 8.5px; }
.notice-file-download { color: var(--muted-2); }
@media (max-width: 640px) {
  .notice-chart-pie-wrap { align-items: flex-start; flex-direction: column; }
  .notice-chart-pie { width: 112px; height: 112px; }
}

/* Notification multi-recipient picker */
.recipient-toolbar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 7px;
  color: var(--muted); font-size: 9.5px;
}
.recipient-toolbar #notice-recipient-count { margin-right: auto; font-weight: 600; color: var(--ink-soft); }
.recipient-picker {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
  max-height: 220px; overflow-y: auto; padding: 7px;
  border: 1px solid var(--line); border-radius: 9px; background: #fdfbf7;
}
.recipient-option {
  display: flex; align-items: center; gap: 7px; min-width: 0;
  padding: 7px 8px; border: 1px solid transparent; border-radius: 7px;
  background: var(--paper); cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.recipient-option:hover { border-color: #e4d4b5; background: #fffdf8; }
.recipient-option.selected { border-color: #d7c294; background: var(--gold-wash); }
.recipient-option input { position: absolute; opacity: 0; pointer-events: none; }
.recipient-avatar .avatar { width: 27px; height: 27px; }
.recipient-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.recipient-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 9.5px; }
.recipient-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-2); font-size: 8.5px; }
.recipient-check {
  display: grid; place-items: center; width: 17px; height: 17px; flex: 0 0 auto;
  border: 1px solid var(--line-strong); border-radius: 4px; background: var(--paper); color: transparent;
}
.recipient-option.selected .recipient-check { border-color: var(--gold); background: var(--gold); color: #fff; }
.recipient-check .icon { width: 11px; height: 11px; stroke-width: 2.6; }
@media (max-width: 640px) {
  .recipient-picker { grid-template-columns: 1fr; }
}

/* Signed sales clients */
.signed-clients-card { margin-bottom: 16px; }
.signed-clients-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.signed-client-card {
  display: block; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fffdf8; color: var(--ink); text-decoration: none;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.signed-client-card:hover { border-color: #d8c398; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(31, 39, 51, .06); }
.signed-client-head { display: flex; align-items: center; gap: 9px; }
.signed-client-head .client-mark { width: 34px; height: 34px; flex: 0 0 auto; }
.signed-client-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.signed-client-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); font-size: 13px; }
.signed-client-title span { color: var(--muted-2); font-size: 8.5px; }
.signed-badge { display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; padding: 3px 7px; border-radius: 5px; background: var(--green-wash); color: var(--green); font-size: 8.5px; font-weight: 600; }
.signed-client-meta { display: flex; flex-wrap: wrap; gap: 6px 13px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 9px; }
.signed-client-meta span { display: inline-flex; align-items: center; gap: 4px; }
.signed-client-money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.signed-client-money div { display: flex; flex-direction: column; gap: 2px; }
.signed-client-money span { color: var(--muted-2); font-size: 8px; }
.signed-client-money strong { color: var(--ink-soft); font-size: 10.5px; font-weight: 600; }
.signed-progress { height: 4px; margin-top: 9px; overflow: hidden; border-radius: 99px; background: var(--paper-2); }
.signed-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), #c9a45d); }
.signed-client-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; color: var(--muted-2); font-size: 8.5px; }
.signed-client-foot span:last-child { display: inline-flex; align-items: center; gap: 3px; color: var(--gold-strong); }
@media (max-width: 900px) { .signed-clients-grid { grid-template-columns: 1fr; } }

/* Review management */
.review-stats { margin-bottom: 16px; }
.review-tabs { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.review-tab {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--muted);
  font-size: 9.5px; font-weight: 600; cursor: pointer;
}
.review-tab span { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 3px; border-radius: 4px; background: var(--paper-2); color: var(--muted-2); font-size: 8px; }
.review-tab:hover { border-color: #d9c9a8; color: var(--gold-strong); }
.review-tab.active { border-color: var(--gold); background: var(--gold-wash); color: var(--gold-strong); }
.review-tab.active span { background: #fffdf8; color: var(--gold-strong); }
.review-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.review-info-grid > div { display: flex; flex-direction: column; gap: 3px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 7px; background: #fdfbf7; }
.review-info-grid > div.full { grid-column: 1 / -1; }
.review-info-grid span { color: var(--muted-2); font-size: 8.5px; }
.review-info-grid strong { color: var(--ink-soft); font-size: 10px; font-weight: 500; line-height: 1.6; }
.review-reject-reason { margin-top: 13px; padding: 10px 12px; border: 1px solid #efd0cc; border-radius: 8px; background: #fdf1ef; }
.review-reject-reason strong { color: #a0524c; font-size: 9.5px; }
.review-reject-reason p { margin: 4px 0 0; color: #8c514b; font-size: 10px; line-height: 1.7; }
.review-table td { vertical-align: middle; }
@media (max-width: 640px) {
  .review-info-grid { grid-template-columns: 1fr; }
  .review-info-grid > div.full { grid-column: auto; }
}
.signed-client-card.pending-review { cursor: default; }
.signed-review-badge { flex: 0 0 auto; padding: 3px 6px; border-radius: 5px; font-size: 8px; font-weight: 600; }
.signed-review-badge.pending { background: var(--amber-wash); color: var(--amber); }
.signed-review-badge.approved { background: var(--green-wash); color: var(--green); }
.signed-review-badge.rejected { background: var(--red-wash); color: var(--red); }
.signed-review-note { margin-top: 7px; padding-top: 6px; border-top: 1px dashed #efd0cc; color: #a0524c; font-size: 8.5px; line-height: 1.6; }

/* Human resources */
.hr-stats { margin-bottom: 16px; }
.hr-phone-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.hr-phone-chips span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 5px; background: var(--paper-2); color: var(--ink-soft); font-size: 8.5px; }
.hr-phone-chips small { color: var(--muted-2); font-size: 8px; }
.hr-date { color: var(--ink-soft); font-size: 9.5px; }
.hr-salary { color: var(--gold-strong); font-size: 9.5px; font-weight: 600; }
.hr-alt-phone-list { display: grid; gap: 7px; margin-bottom: 8px; }
.hr-alt-phone-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 30px; gap: 7px; align-items: center; }
.hr-alt-phone-row input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font-size: 10px; }
.hr-alt-phone-row input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-wash); }
.hr-modal .form-section-title { margin-top: 18px; }
.hr-modal .hr-alt-phone-list + .btn { margin-bottom: 5px; }
.hr-table td { vertical-align: middle; }
@media (max-width: 640px) {
  .hr-alt-phone-row { grid-template-columns: 1fr 30px; }
  .hr-alt-phone-row .hr-alt-label { grid-column: 1 / -1; }
}

/* Client opponents */
.opponent-list { display: grid; gap: 9px; margin-bottom: 8px; }
.opponent-row { padding: 10px 11px; border: 1px dashed var(--line-strong); border-radius: 9px; background: #fdfbf7; }
.opponent-row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.opponent-row-head strong { color: var(--ink-soft); font-size: 9.5px; }
.opponent-row .form-grid { margin: 0; }
.opponent-row .field { margin: 0; }
.opponent-row .field label { font-size: 9px; margin-bottom: 4px; }
.opponent-row .field input { padding: 7px 9px; font-size: 10px; }
.opponent-add { margin-bottom: 4px; }
.opponent-section { margin-top: 18px; padding: 18px 18px 6px; border-top: 1px solid var(--line-soft); }
.opponent-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.opponent-section-head h3 { margin: 0; font-family: var(--serif); font-size: 16px; font-weight: 700; }
.opponent-section-head span { color: var(--muted-2); font-size: 11px; }
.opponent-detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.opponent-detail { padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 7px; background: #fdfbf7; }
.opponent-detail strong { display: block; margin-bottom: 4px; color: var(--ink-soft); font-size: 10px; }
.opponent-detail div { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 8.5px; }
.opponent-detail p { margin: 4px 0 0; color: var(--muted-2); font-size: 8.5px; line-height: 1.6; }
@media (max-width: 640px) { .opponent-detail-list { grid-template-columns: 1fr; } .opponent-row .form-grid { grid-template-columns: 1fr; } }

/* Hearing calendar */
.hearing-card { margin-bottom: 18px; }
.hearing-month-nav { display: flex; align-items: center; gap: 7px; }
.hearing-month-nav strong { min-width: 88px; text-align: center; color: var(--ink); font-family: var(--serif); font-size: 12px; }
.hearing-month-nav .page-btn { width: 26px; height: 26px; }
.hearing-month-nav .link-btn { margin-left: 3px; }
.hearing-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .9fr); gap: 20px; padding: 16px 18px 18px; }
.hearing-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 5px; }
.hearing-weekdays span { padding: 3px 0; color: var(--muted-2); font-size: 8.5px; text-align: center; }
.hearing-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.hearing-day {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 54px; gap: 2px; padding: 5px 3px; border: 1px solid transparent; border-radius: 7px;
  background: var(--paper-2); color: var(--ink-soft); cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.hearing-day.blank { background: transparent; cursor: default; }
.hearing-day:not(.blank):hover { border-color: #d9c9a8; background: #fffdf8; }
.hearing-day.today { border-color: #d9c9a8; }
.hearing-day.selected { border-color: var(--gold); background: var(--gold-wash); color: var(--gold-strong); }
.hearing-day span { font-size: 10.5px; font-weight: 600; }
.hearing-day span.hearing-day-number { font-size: 12px; font-weight: 700; line-height: 1; }
.hearing-day span.hearing-day-lunar { font-size: 7.5px; font-weight: 400; line-height: 1; color: var(--muted-2); }
.hearing-day.weekend span.hearing-day-number { color: #31506f; }
.hearing-day.weekend span.hearing-day-lunar { color: #31506f; }
.hearing-day.weekend span.hearing-day-weekend-label { font-size: 7.5px; font-weight: 700; line-height: 1.2; color: #31506f; }
.hearing-day.holiday span.hearing-day-number { color: #c0392b; }
.hearing-day span.hearing-day-holiday-label { font-size: 7.5px; font-weight: 700; line-height: 1.2; color: #c0392b; }
.hearing-day i {
  position: absolute; top: 4px; right: 4px; display: grid; place-items: center;
  min-width: 14px; height: 14px; padding: 0 3px; border-radius: 4px;
  background: var(--gold); color: #fff; font-size: 7.5px; font-style: normal;
}
.hearing-agenda { min-width: 0; border-left: 1px solid var(--line-soft); padding-left: 18px; }
.hearing-agenda-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.hearing-agenda-head strong { font-family: var(--serif); font-size: 12px; color: var(--ink); }
.hearing-agenda-head span { color: var(--muted-2); font-size: 8.5px; }
.hearing-agenda-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 8px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: 8px; background: #fffdf8; text-decoration: none;
}
.hearing-agenda-item:hover { border-color: var(--gold); background: var(--gold-wash); }
.hearing-date-badge { display: flex; flex-direction: column; align-items: center; width: 34px; flex: 0 0 auto; padding: 3px 0; border-radius: 5px; background: var(--paper-2); color: var(--gold-strong); }
.hearing-date-badge strong { font-size: 12px; line-height: 1.1; }
.hearing-date-badge small { color: var(--muted-2); font-size: 7.5px; }
.hearing-agenda-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.hearing-agenda-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 9.5px; }
.hearing-agenda-copy span { color: var(--muted-2); font-size: 8.5px; }
.hearing-status { flex: 0 0 auto; color: var(--muted); font-size: 8px; }
@media (max-width: 900px) {
  .hearing-layout { grid-template-columns: 1fr; }
  .hearing-agenda { border-left: 0; border-top: 1px solid var(--line-soft); padding: 13px 0 0; }
}

.hr-emergency-list { display: grid; gap: 7px; margin-bottom: 8px; }
.hr-emergency-row { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, .8fr) minmax(0, 1.2fr) 30px; gap: 7px; align-items: center; }
.hr-emergency-row input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font-size: 10px; }
.hr-emergency-row input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-wash); }
.hr-emergency-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.hr-emergency-chips span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 5px; background: var(--paper-2); color: var(--ink-soft); font-size: 8.5px; }
.hr-emergency-chips small { color: var(--muted-2); font-size: 8px; }
@media (max-width: 640px) { .hr-emergency-row { grid-template-columns: 1fr 30px; } .hr-emergency-row .hr-emergency-relationship, .hr-emergency-row .hr-emergency-phone { grid-column: 1 / -1; } }

.notification-stats { margin-bottom: 16px; }
.notification-stat { width: 100%; text-align: left; cursor: pointer; font: inherit; }
.notification-stat:hover { border-color: #d9c9a8; }
.notification-stat.active { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold-wash); background: #fffdf8; }
.notification-stat.active .sales-stat-label { color: var(--gold-strong); }

.selected-service-type {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border: 1px solid #d9c9a8; border-radius: 10px; background: var(--gold-wash);
}
.selected-service-icon {
  display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 8px; background: #fffdf8; color: var(--gold-strong);
}
.selected-service-type > span:last-of-type { display: flex; flex-direction: column; gap: 2px; }
.selected-service-type strong { color: var(--ink); font-family: var(--serif); font-size: 12px; }
.selected-service-type small { color: var(--muted); font-size: 9px; }

.hearing-note { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.6; }

.hearing-agenda-note { display: flex; align-items: flex-start; gap: 3px; margin-top: 2px; color: var(--gold-strong); font-size: 8.5px; line-height: 1.5; }
.hearing-agenda-note .icon { flex: 0 0 auto; margin-top: 1px; }

.stat-clickable { width: 100%; text-align: left; cursor: pointer; font: inherit; }
.stat-clickable:hover { border-color: #d9c9a8; }
.stat-clickable.active { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold-wash); background: #fffdf8; }
.stat-clickable.active .sales-stat-label { color: var(--gold-strong); }

/* Dashboard topbar greeting and compact overview */
.topbar-title h1 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.topbar-title h1.dashboard-heading { gap: 15px; }
.topbar-title h1.dashboard-heading .topbar-greeting { color: var(--ink); font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: .02em; }
.topbar-title h1.dashboard-heading .topbar-date { padding-left: 15px; border-left: 1px solid var(--line); color: var(--ink-soft); font-family: var(--sans); font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.topbar-greeting { color: var(--gold-strong); font-family: var(--sans); font-size: 10px; font-weight: 500; letter-spacing: .03em; }
.topbar-date { padding-left: 10px; border-left: 1px solid var(--line); color: var(--muted); font-family: var(--sans); font-size: 9.5px; font-weight: 400; letter-spacing: .02em; }
.dash-hero.compact { min-height: 0; padding: 21px 28px; }
.dash-hero.compact .hero-copy { justify-content: center; }
.dash-hero.compact .hero-eyebrow { margin-bottom: 7px; font-size: 11.5px; font-weight: 600; letter-spacing: .22em; }
.dash-hero.compact .hero-sub { margin-top: 0; max-width: 1000px; color: rgba(245, 238, 224, .8); font-size: 15px; line-height: 1.75; }
@media (max-width: 760px) {
  .topbar-title h1.dashboard-heading .topbar-greeting { display: inline; font-size: 17px; }
  .topbar-title h1.dashboard-heading .topbar-date { display: none; }
}

.notice-line-mark.all { border-color: #d6e4f3; background: #eef5fc; color: #31506f; }
.notice-line-mark.individual { border-color: #d7e6d9; background: #f1f8f2; color: #4f7d5a; }
.notification-footer { margin-top: 14px; padding: 12px 2px 0; border-top: 1px solid var(--line); }

.notice-reply-badge { padding: 2px 6px; border-radius: 4px; background: #eef5fc; color: #31506f; font-size: 8px; font-weight: 600; }
.notice-reply-box { margin-top: 15px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fdfbf7; }
.notice-reply-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.notice-reply-head strong { color: var(--ink-soft); font-size: 10px; }
.notice-reply-head span { color: var(--muted-2); font-size: 8.5px; }
.notice-reply-box textarea { width: 100%; min-height: 76px; resize: vertical; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 10px; line-height: 1.7; }
.notice-reply-box textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-wash); }
.notice-reply-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 7px; }
.notice-reply-actions .field-error { flex: 1; }

/* Notification table matches sales management */
.notification-table { margin-top: 0; }
.notification-list-head {
  display: grid; grid-template-columns: minmax(0, 1fr) 180px 80px 60px 56px; gap: 12px;
  padding: 11px 17px; border-bottom: 1px solid var(--line); background: #faf8f3;
  color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .04em;
}
.notification-list-head span:last-child { text-align: right; }
.notification-table .notice-line-page { gap: 0; }
.notification-table .notice-line-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 180px 80px 60px 56px; gap: 12px;
  padding: 12px 17px; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; background: transparent; transform: none;
}
.notification-table .notice-line-row:last-child { border-bottom: 0; }
.notification-table .notice-line-row:hover { background: #fdfbf7; transform: none; }
.notification-line-main, .notice-line-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.notice-line-scope { color: var(--muted); font-size: 9.5px; }
.notification-table .notice-line-arrow { justify-self: end; }
@media (max-width: 640px) {
  .notification-list-head { display: none; }
  .notification-table .notice-line-row { grid-template-columns: minmax(0, 1fr) 22px; gap: 8px; padding: 12px 14px; }
  .notification-table .notice-line-scope, .notification-table .notice-line-sender, .notification-table .notice-line-state { display: none; }
}

/* Collapse hearing calendar when the month has no court hearings */
.hearing-card.is-collapsed { padding: 14px 18px; }
.hearing-card.is-collapsed .card-head { margin-bottom: 0; align-items: center; }
.hearing-card.is-collapsed .hearing-layout { display: none; }
.hearing-card.is-collapsed .card-title { font-size: 15px; }

.notification-table .notice-line-avatar { display: inline-grid; place-items: center; flex: 0 0 auto; }
.notification-table .notice-line-avatar .avatar { width: 30px; height: 30px; border-color: rgba(223, 213, 190, .8); font-size: 11px; }
.notification-table .notice-line-avatar .avatar-portrait { width: 100%; height: 100%; border-radius: 50%; }

.notice-reply-media { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
.notice-reply-media .field-hint { margin-left: 2px; }
.notice-reply-box .notice-media-list { margin-top: 6px; }

.notification-toolbar { margin: 14px 0; }
.notification-toolbar .search-box { max-width: 480px; }

.notice-folder-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.notice-folder-tabs button {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--white); color: var(--muted); font-size: 11px; cursor: pointer;
}
.notice-folder-tabs button:hover { border-color: #d9c9a8; color: var(--ink); }
.notice-folder-tabs button.active { border-color: var(--gold); background: var(--gold-wash); color: var(--gold-strong); font-weight: 600; }

.app-footer { padding: 14px 24px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 9.5px; text-align: center; }
.app-footer span { display: inline-block; }

.notice-line-state { align-self: center; font-size: 9px; font-weight: 600; }
.notice-line-state.unread { color: #b56b1f; }
.notice-line-state.read { color: var(--muted-2); }

.suggestion-list { display: flex; flex-direction: column; gap: 12px; }
.suggestion-card { padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf9; }
.suggestion-card.open { border-left: 3px solid var(--gold); }
.suggestion-card.replied { border-left: 3px solid var(--green); }
.suggestion-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.suggestion-user { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.suggestion-user .avatar { width: 26px; height: 26px; font-size: 10px; }
.suggestion-user strong { color: var(--ink); font-size: 11.5px; }
.suggestion-user small { color: var(--muted-2); font-size: 9px; }
.suggestion-state { font-size: 9px; font-weight: 600; padding: 2px 7px; border-radius: 4px; }
.suggestion-card.open .suggestion-state { color: #b56b1f; background: #fdf1e3; }
.suggestion-card.replied .suggestion-state { color: var(--green); background: var(--green-wash); }
.suggestion-content { color: var(--ink-soft); font-size: 11.5px; line-height: 1.8; white-space: pre-wrap; }
.suggestion-meta { margin-top: 6px; color: var(--muted-2); font-size: 9px; }
.suggestion-reply { margin-top: 10px; padding: 10px 11px; border-radius: 8px; background: #f3f7f3; }
.suggestion-reply-label { color: var(--green); font-size: 9px; font-weight: 700; margin-bottom: 3px; }
.suggestion-reply p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.7; white-space: pre-wrap; }
.suggestion-reply-form { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.suggestion-reply-form textarea { flex: 1; min-height: 44px; resize: vertical; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 10px; }
.suggestion-reply-form textarea:focus { outline: none; border-color: var(--gold); }

.service-team-lines { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.service-team-line { min-width: 0; color: var(--ink); font-size: 11px; font-weight: 600; line-height: 1.5; word-break: break-word; }
.service-team-item { min-width: 0; color: var(--ink); font-size: 11px; font-weight: 600; line-height: 1.5; word-break: break-word; }

.data-table-finance .finance-row { cursor: pointer; }
.data-table-finance .finance-row:hover { background: #fdfbf7; }
.finance-party { color: var(--ink); font-size: 11px; font-weight: 600; }
.finance-outstanding { color: #c0392b; font-weight: 600; }

.perm-function-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.perm-function-option { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 10px; cursor: pointer; }
.perm-function-option input { margin: 0; }
.permission-grant-list { display: flex; flex-direction: column; gap: 8px; }
.permission-grant-row { display: flex; align-items: center; gap: 12px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; }
.permission-grant-row > div { flex: 1; min-width: 0; }
.permission-grant-row strong { display: block; color: var(--ink); font-size: 11px; }
.permission-grant-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.permission-grant-target { flex: 0 0 auto; color: var(--muted); font-size: 9.5px; }

.permission-module-cell { white-space: nowrap; }

.kpi-foot .kpi-red { color: #c0392b; }
.kpi-foot .trend-up { color: #c0392b; font-weight: 700; }
.kpi-foot .trend-down { color: #137a3f; font-weight: 700; }

.status-rose { background: #fbe9e7; color: #c0392b; }

.settings-grid-single { grid-template-columns: 1fr; }
.dash-col.account-cols { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .dash-col.account-cols { grid-template-columns: 1fr; } }

.review-tabs-top { margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }

.notice-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.notice-folder-tabs.inline { margin: 0; }

.avatar-edit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 4px; border-bottom: 1px solid var(--line); }
.avatar-edit-row > span { color: var(--muted); font-size: 13px; }

.profile-banner-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.avatar-method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.avatar-method-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fff; cursor: pointer; text-align: center; }
.avatar-method-card.active { border-color: var(--gold); background: var(--gold-wash); }
.avatar-method-card strong { display: block; margin-bottom: 4px; }
.avatar-method-card span { color: var(--muted); font-size: 12px; }
.avatar-qr-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; }
.avatar-qr-box svg { width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.avatar-qr-url { font-size: 12px; color: var(--muted); word-break: break-all; text-align: center; }
.mobile-avatar-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #f6f3ec; }
.mobile-avatar-card { width: 100%; max-width: 380px; background: #fff; border-radius: 18px; padding: 28px 22px; box-shadow: 0 18px 40px rgba(24, 33, 46, .12); text-align: center; }
.mobile-avatar-card .brand-seal { margin: 0 auto 14px; }
.mobile-avatar-card h1 { font: 600 22px/1.3 var(--serif); margin: 0 0 8px; }
.mobile-avatar-sub { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0 0 18px; }
.mobile-avatar-picker { display: grid; place-items: center; width: 180px; height: 180px; margin: 0 auto 16px; border: 1px dashed #d8c9aa; border-radius: 50%; overflow: hidden; color: var(--muted); font-size: 13px; cursor: pointer; background: #fbf8f1; }
.mobile-avatar-picker img { width: 100%; height: 100%; object-fit: cover; }
.mobile-avatar-card .btn { width: 100%; }
.mobile-avatar-status { min-height: 20px; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.mobile-avatar-status.error { color: #c0392b; }
.mobile-avatar-status.success { color: #137a3f; }

.mobile-sign-page { margin: 0; min-height: 100vh; background: #f6f3ec; font-family: var(--sans); color: var(--ink); }
.sign-stage { display: none; flex-direction: column; gap: 12px; padding: 18px 22px 22px; min-height: 100vh; box-sizing: border-box; }
.sign-stage.landscape { display: flex; }
.sign-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.sign-head h1 { margin: 2px 0 0; font: 600 22px/1.2 var(--serif); }
.sign-hint { color: var(--muted); font-size: 12px; }
.sign-name-field { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.sign-name-field input { flex: 1; max-width: 260px; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; font-size: 15px; }
.sign-pad-wrap { position: relative; flex: 1; min-height: 200px; border: 1px dashed #cdbb99; border-radius: 14px; background: #fff; overflow: hidden; }
#sign-pad { width: 100%; height: 100%; min-height: 220px; touch-action: none; display: block; }
.sign-pad-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #b7ad9c; font-size: 15px; pointer-events: none; }
.sign-actions { display: flex; justify-content: flex-end; gap: 10px; }
.sign-rotate-hint { position: fixed; inset: 0; z-index: 20; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: #1b2430; color: #fff; text-align: center; padding: 30px; }
.sign-rotate-hint.show { display: flex; }
.sign-rotate-icon { font-size: 54px; transform: rotate(90deg); }
.sign-rotate-hint strong { font-size: 20px; }
.sign-rotate-hint span { color: #cfc7b8; font-size: 13px; }

.avatar-warning { color: #c0392b; font-weight: 700; }

.avatar-warning { color: #c0392b; font-weight: 700; font-size: 1.18em; line-height: 1.6; }

.manual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.manual-module { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.manual-module summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; cursor: pointer; font-weight: 600; list-style: none; }
.manual-module summary::-webkit-details-marker { display: none; }
.manual-module summary small { color: var(--muted); font-weight: 400; }
.manual-module[open] summary { border-bottom: 1px solid var(--line); background: var(--gold-wash); }
.manual-body { padding: 12px 14px 16px; }
.manual-body img { width: 100%; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
.manual-body p { margin: 0 0 8px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.manual-body ul { margin: 0; padding-left: 18px; color: var(--ink); font-size: 13px; line-height: 1.8; }
@media (max-width: 900px) { .manual-grid { grid-template-columns: 1fr; } }

.contract-view { width: 100%; max-width: 760px; background: #fff; border-radius: 16px; padding: 26px 24px 30px; box-shadow: 0 18px 40px rgba(24,33,46,.12); box-sizing: border-box; margin: 0 auto; }
.contract-head h1 { margin: 4px 0 18px; font: 600 24px/1.3 var(--serif); text-align: center; letter-spacing: 2px; }
.contract-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; }
.contract-parties span { color: var(--muted); margin-right: 8px; }
.contract-body { padding: 18px 0; font-size: 14px; line-height: 2; color: #2d323a; }
.contract-body p { margin: 0 0 10px; text-indent: 2em; }
.contract-signatures { display: flex; justify-content: space-between; gap: 18px; margin: 12px 0 22px; }
.contract-sign-block { flex: 1; position: relative; min-height: 120px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; color: var(--muted); }
.contract-sign-block strong { display: block; color: var(--ink); margin-top: 6px; font-size: 14px; }
.contract-sign-block #contract-party-b-sign { color: #c0392b; }
.contract-seal { position: absolute; right: 10px; top: 26px; width: 96px; height: 96px; border: 3px solid #c0392b; border-radius: 50%; display: grid; place-items: center; text-align: center; color: #c0392b; font-size: 10px; font-weight: 700; line-height: 1.3; padding: 8px; box-sizing: border-box; transform: rotate(-12deg); opacity: .9; }
.contract-sign-btn { width: 100%; }

.contract-parties { grid-template-columns: 1fr; gap: 6px; }
.contract-parties > div { display: flex; align-items: baseline; gap: 8px; }
.contract-signatures { flex-direction: column; gap: 18px; }
.contract-sign-block { width: 100%; min-height: 110px; }

.mobile-sign-page.signing { height: 100dvh; overflow: hidden; }
.sign-stage { height: 100dvh; min-height: 0; padding: 10px 18px 12px; gap: 8px; overflow: hidden; }
.sign-head h1 { font-size: 18px; }
.sign-pad-wrap { flex: 1 1 auto; min-height: 0; }
.sign-actions { flex: 0 0 auto; }
.sign-actions .btn { min-height: 42px; }

.sign-success-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(20,26,34,.55); padding: 20px; }
.sign-success-modal[hidden] { display: none; }
.sign-success-card { width: min(420px, 100%); background: #fff; border-radius: 16px; padding: 28px 24px; text-align: center; box-shadow: 0 22px 50px rgba(0,0,0,.25); }
.sign-success-icon { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 50%; background: #e8f5ee; color: #1f7a4d; display: grid; place-items: center; font-size: 26px; font-weight: 700; }
.sign-success-card h2 { margin: 0 0 8px; font: 600 21px/1.3 var(--serif); }
.sign-success-card p { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.sign-success-card .btn { width: 100%; }

.avatar-result-card { text-align: center; padding: 40px 26px; }
.avatar-result-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: #e8f5ee; color: #1f7a4d; display: grid; place-items: center; font-size: 30px; font-weight: 700; }
.avatar-result-icon.error { background: #fdecea; color: #c0392b; }
.avatar-result-card h1 { margin: 0 0 10px; font: 600 22px/1.3 var(--serif); }
.avatar-result-card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }

.wechat-qr-card { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.wechat-qr-preview { width: 168px; height: 168px; border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; overflow: hidden; background: #faf8f3; color: var(--muted); font-size: 12px; text-align: center; padding: 10px; box-sizing: border-box; }
.wechat-qr-preview img { width: 100%; height: 100%; object-fit: contain; }
.wechat-qr-copy { flex: 1; min-width: 220px; }
.wechat-qr-copy p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }

.contract-modal { width: min(820px, 94vw); }
.contract-modal .modal-body { max-height: 72vh; overflow: auto; }

.sidebar-copyright { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: 0; }

.manual-card { display: block; width: 100%; text-align: left; padding: 0; cursor: pointer; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; color: var(--ink); font: inherit; }
.manual-card:hover { border-color: #c9b58d; box-shadow: 0 8px 20px rgba(24,33,46,.08); }
.manual-card-title { display: block; padding: 12px 14px 2px; font-weight: 600; font-size: 14px; }
.manual-card small { display: block; padding: 0 14px 10px; color: var(--muted); font-size: 12px; }
.manual-card img { display: block; width: 100%; height: 120px; object-fit: cover; object-position: top center; border-top: 1px solid var(--line); }
.manual-modal { width: min(880px, 94vw); }
.manual-modal .modal-body { max-height: 72vh; overflow: auto; }
.manual-modal-image { width: 100%; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; }
.manual-modal-subtitle { margin: 0 0 8px; font-size: 15px; }
.manual-modal-list { margin: 0; padding-left: 20px; line-height: 1.9; font-size: 14px; }

.dash-col.account-cols .wechat-qr-section { grid-column: 1; }

.dash-col.account-cols .wechat-qr-section { grid-column: 2; }
.dash-col.account-cols .password-card { grid-column: 2; }

.dash-col.account-cols { display: flex; flex-direction: column; gap: 16px; }
.dash-col.account-cols > .card { width: 100%; }
.modal-backdrop-full { padding: 0 !important; align-items: stretch !important; justify-content: stretch !important; }
.modal-backdrop-full .modal { width: 100vw !important; max-width: 100vw !important; height: 100dvh !important; max-height: 100dvh !important; border-radius: 0 !important; margin: 0 !important; display: flex; flex-direction: column; }
.modal-backdrop-full .modal .modal-body { flex: 1 1 auto; max-height: none; overflow: auto; }

.account-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; width: 100%; }
.account-row .wechat-qr-section { margin-top: 0 !important; }
@media (max-width: 1100px) { .account-row { grid-template-columns: 1fr; } }

.account-row > .wechat-qr-section,
.account-row > .password-card { grid-column: auto !important; }

.account-row { align-items: stretch; }
.account-row > .wechat-qr-section,
.account-row > .password-card { height: 100%; }

.hr-view-modal { width: min(760px, 94vw); }
.hr-view-modal .modal-body { max-height: 72vh; overflow: auto; }

.confirm-list { margin: 12px 0 0; padding-left: 18px; color: var(--ink); font-size: 13px; line-height: 1.9; text-align: left; }
.confirm-text .muted { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.contract-history-list { display: flex; flex-direction: column; gap: 8px; }
.contract-history-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; color: var(--ink); text-align: left; }
.contract-history-item:hover { border-color: #c9b58d; background: var(--gold-wash); }
.contract-history-item small { color: var(--muted); }

.contract-history-main { display: flex; flex-direction: column; gap: 4px; }
.contract-history-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.contract-field-picks { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.check-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; }
.check-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; }
.contract-custom-row { display: flex; gap: 8px; }
.contract-custom-row input { flex: 1; }
.contract-custom-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.contract-field-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.contract-field-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.btn-danger-text { color: #b03a2e; border-color: #e3b7b0; }

.side-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(200,164,93,.35) transparent; }
.side-nav::-webkit-scrollbar { width: 5px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(200,164,93,.35); border-radius: 4px; }
.side-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-spacer { flex: 0 0 auto; min-height: 10px; }
.sidebar-note, .sidebar-user, .sidebar-foot { flex-shrink: 0; }
@media (max-height: 840px) { .sidebar-note { display: none; } }
@media (max-height: 700px) { .sidebar-foot { display: none; } .sidebar-inner { padding-top: 16px; } }

.contract-editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: #f8f5ee; flex: 0 0 auto; }
.contract-editor-toolbar button { min-width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; font-size: 12px; padding: 0 8px; }
.contract-editor-toolbar button:hover { border-color: #c9b58d; background: var(--gold-wash); }
.contract-editor-toolbar select { height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.editor-divider { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.editor-color { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.editor-color input { width: 28px; height: 26px; padding: 0; border: 1px solid var(--line); background: #fff; }
.contract-editor-body { flex: 1 1 auto; overflow: auto; background: #e8e4da; padding: 18px; }
.contract-rich-editor { max-width: 860px; min-height: calc(100dvh - 210px); margin: 0 auto; background: #fff; padding: 46px 52px; box-shadow: 0 8px 24px rgba(24,33,46,.12); outline: none; font-family: "Songti SC", "SimSun", serif; font-size: 14pt; line-height: 1.9; color: #1b2430; }
.contract-rich-editor:focus { box-shadow: 0 8px 24px rgba(24,33,46,.18); }
.contract-rich-preview p { margin: 0 0 8px; }

.contract-benefits { margin: 14px 0 0; border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; line-height: 1.9; color: #2d323a; }
.contract-benefits ol { margin: 6px 0 0; padding-left: 22px; }
.contract-term { margin-top: 12px; font-size: 13px; color: #2d323a; }
.contract-signed-date { text-align: right; margin-top: 14px; font-size: 13px; color: var(--muted); }

.contract-sign-block { position: relative; }
.contract-seal { left: 0; right: auto; top: 20px; width: 100px; height: 100px; z-index: 2; background: rgba(255,255,255,.55); }

.contract-seal { left: 50%; right: auto; top: 18px; transform: translateX(-50%) rotate(-12deg); }

.contract-seal { display: block; padding: 0; background: rgba(255,255,255,.55); }
.contract-seal > svg { display: block; width: 100%; height: 100%; }
.seal-company-text { fill: #c0392b; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.seal-star { fill: #c0392b; }
.seal-bottom { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); width: 84px; text-align: center; color: #c0392b; font-size: 6.5px; font-weight: 700; line-height: 1.15; }

.sign-stage.forced-landscape { position: fixed; top: 0; left: 100vw; width: 100vh; height: 100vw; transform: rotate(90deg); transform-origin: top left; z-index: 50; padding: 10px 18px 12px; box-sizing: border-box; overflow: hidden; }
body.forced-orientation { overflow: hidden !important; height: 100dvh; }

.interview-time-picker { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; margin-top: 6px; min-width: 0; }
.interview-time-picker input[type="date"], .interview-time-picker select { height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; font-size: 14px; color: var(--ink); }
.interview-time-picker input[type="date"] { flex: 1 1 138px; min-width: 0; max-width: 188px; padding: 0 4px; font-size: 13px; }
.interview-time-picker select { flex: 0 0 48px; width: 48px; min-width: 0; padding: 0 2px; font-size: 13px; }
.interview-time-colon { font-weight: 700; color: var(--muted); }
.interview-time-summary { margin-top: 8px; font-size: 13px; color: var(--muted); }
.interview-time-summary.confirmed { color: #1f7a4d; font-weight: 600; }

.table-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-actions .btn { white-space: nowrap; }

#view:focus, #view:focus-visible { outline: none; box-shadow: none; }

.chat-widget { position: fixed; right: 22px; bottom: 22px; z-index: 70; }
.chat-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border: 0; border-radius: 999px; background: var(--navy-900); color: #f4ecdc; box-shadow: 0 12px 28px rgba(16,29,47,.28); cursor: pointer; font-size: 14px; }
.chat-toggle .icon { color: var(--gold-soft); }
.chat-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #c0392b; color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.chat-widget.flash .chat-toggle { animation: chat-flash .55s ease-in-out 4; }
@keyframes chat-flash { 0%,100% { background: var(--navy-900); } 50% { background: #c0392b; } }
.chat-panel { position: absolute; right: 0; bottom: 58px; width: min(370px, calc(100vw - 28px)); height: min(560px, calc(100vh - 110px)); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 22px 54px rgba(16,29,47,.24); display: flex; flex-direction: column; overflow: hidden; }
.chat-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #faf8f3; }
.chat-panel-head strong { display: block; font-size: 15px; }
.chat-panel-head span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.chat-head-actions { display: flex; align-items: center; gap: 6px; }
.chat-head-actions select { height: 30px; max-width: 110px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 12px; }
.chat-close { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; }
.chat-body { flex: 1; min-height: 0; overflow-y: auto; }
.chat-empty { padding: 28px 18px; text-align: center; color: var(--muted); font-size: 13px; }
.chat-contact { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 0; border-bottom: 1px solid #f1ede4; background: #fff; text-align: left; cursor: pointer; }
.chat-contact:hover { background: #faf8f3; }
.chat-contact .avatar { width: 36px; height: 36px; flex: 0 0 auto; }
.chat-contact-copy { flex: 1; min-width: 0; }
.chat-contact-copy strong { display: block; font-size: 13px; }
.chat-contact-copy small { display: block; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-contact-status { font-size: 10px; color: var(--muted); flex: 0 0 auto; }
.chat-contact-status.online { color: #1f7a4d; }
.chat-contact-status.offline { max-width: 104px; text-align: right; }
.chat-unread { min-width: 18px; height: 18px; border-radius: 999px; background: #c0392b; color: #fff; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.chat-thread-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.chat-back { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; }
.chat-messages { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-bubble-row { display: flex; flex-direction: column; align-items: flex-start; max-width: 85%; }
.chat-bubble-row.mine { align-self: flex-end; align-items: flex-end; }
.chat-bubble { padding: 9px 12px; border-radius: 12px; background: #f2eee6; font-size: 13px; line-height: 1.5; word-break: break-word; }
.chat-bubble-row.mine .chat-bubble { background: var(--navy-900); color: #f7f1e3; }
.chat-bubble-row small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.chat-send-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: #faf8f3; }
.chat-send-form input { flex: 1; min-width: 0; height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; font-size: 13px; }
@media (max-width: 640px) { .chat-widget { right: 12px; bottom: 12px; } .chat-panel { height: min(70vh, 520px); } }

.chat-new { border: 0; background: none; color: var(--navy-800); font-size: 11px; cursor: pointer; padding: 4px 2px; white-space: nowrap; }
.chat-new:hover { color: var(--gold); }

.chat-send-form { display: block; }
.chat-compose-tools { display: flex; align-items: center; gap: 6px; padding: 0 0 8px; }
.chat-tool { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0; border-radius: 7px; background: #f1ece2; color: var(--navy-800); cursor: pointer; font-size: 16px; }
.chat-tool:hover { background: #e7dfd0; }
.chat-upload-status { font-size: 11px; color: var(--muted); margin-left: 4px; }
.chat-compose-row { display: flex; gap: 8px; }
.chat-compose-row input { flex: 1; min-width: 0; height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; font-size: 13px; }
.chat-emoji-palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 150px; overflow-y: auto; padding: 6px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.chat-emoji-palette button { border: 0; background: none; font-size: 20px; padding: 4px; cursor: pointer; border-radius: 6px; }
.chat-emoji-palette button:hover { background: #f2eee6; }
.chat-bubble img.chat-image { max-width: 100%; border-radius: 8px; display: block; }
.chat-image-link img { max-width: 100%; max-height: 220px; border-radius: 8px; display: block; }
.chat-video { max-width: 100%; max-height: 220px; border-radius: 8px; display: block; background: #000; }
.chat-file { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,.18); }
.chat-file strong { display: block; font-size: 12px; word-break: break-all; }
.chat-file small { display: block; font-size: 10px; opacity: .7; }
.chat-caption { margin-top: 5px; font-size: 12px; }

.chat-widget .chat-panel { position: fixed; left: 50%; top: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); width: min(1100px, 94vw); height: min(800px, 90vh); border-radius: 18px; z-index: 72; }
.chat-panel[hidden], .chat-overlay[hidden] { display: none; }
.chat-overlay { position: fixed; inset: 0; background: rgba(10, 20, 32, .48); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 71; }
.chat-layout { display: flex; flex: 1; min-height: 0; }
.chat-sidebar { width: 330px; flex: 0 0 330px; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #fcfaf6; }
.chat-sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.chat-sidebar-head strong { font-size: 14px; }
.chat-sidebar > select { margin: 0 14px 10px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 12px; }
.chat-contacts { flex: 1; overflow-y: auto; min-height: 0; }
.chat-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.chat-main .chat-messages { flex: 1; overflow-y: auto; min-height: 0; }
.chat-main .chat-send-form { flex: 0 0 auto; }
.chat-main .chat-thread-head { flex: 0 0 auto; }
.chat-contact.active { background: #f4ead6; }
.chat-contact.active .chat-contact-copy strong { color: var(--navy-900); }
@media (max-width: 760px) { .chat-widget .chat-panel { width: 96vw; height: 92vh; } .chat-sidebar { width: 42%; flex-basis: 42%; } }

.chat-rail { width: 58px; flex: 0 0 58px; border-right: 1px solid var(--line); background: #f7f3ea; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; }
.chat-rail-btn { width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--navy-800); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.chat-rail-btn:hover { background: #eae1cf; }
.chat-rail-btn.active { background: var(--navy-900); color: #f4ecdc; }
.chat-rail-divider { width: 28px; height: 1px; background: var(--line); margin: 4px 0; }
.chat-fav-btn { border: 0; background: transparent; color: #b9a98c; padding: 2px; cursor: pointer; line-height: 0; }
.chat-fav-btn .icon { width: 15px; height: 15px; fill: none; }
.chat-fav-btn.favorited { color: #c9962c; }
.chat-fav-btn.favorited .icon { fill: #e0ac3f; stroke: #c9962c; }
.chat-media-count { margin-left: auto; color: var(--muted); font-size: 12px; }
.chat-media-grid { flex: 1; overflow-y: auto; padding: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-content: start; }
.chat-media-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; min-width: 0; }
.chat-media-preview { height: 130px; background: #f4f0e7; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.chat-media-preview img, .chat-media-preview video { width: 100%; height: 100%; object-fit: cover; }
.chat-media-preview .media-file { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; color: var(--navy-800); text-decoration: none; font-size: 12px; text-align: center; word-break: break-all; }
.chat-media-meta { display: flex; align-items: center; gap: 6px; padding: 7px 8px; font-size: 11px; }
.chat-media-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-media-meta small { color: var(--muted); margin-left: auto; white-space: nowrap; }
@media (max-width: 760px) { .chat-rail { width: 48px; flex-basis: 48px; } .chat-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.chat-audio { max-width: 240px; width: 100%; }
.chat-media-preview audio { width: 90%; }

.chat-sidebar-head .chat-search { width: 118px; height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; font-size: 12px; background: #fff; }
.chat-sidebar > select { width: 118px; margin: 0 14px 10px; }

.chat-compose-row textarea { flex: 1; min-width: 0; height: 76px; resize: none; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 13px; line-height: 1.5; font-family: inherit; }
.chat-compose-row textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-wash); }
.chat-compose-row .btn { align-self: flex-end; }

.chat-sidebar-head { justify-content: flex-start; gap: 6px; }
.chat-sidebar-head strong { flex: 0 0 auto; font-size: 13px; }
.chat-sidebar-head select { width: 88px; flex: 0 0 88px; height: 30px; margin: 0; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 11px; padding: 0 4px; }
.chat-sidebar-head .chat-search { width: auto; flex: 1; min-width: 0; }

.chat-favorite-text { padding: 12px; font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; max-height: 130px; overflow-y: auto; }
.chat-thread-head #new-favorite { margin-left: auto; margin-right: 10px; }

.chat-media-list { flex: 1; overflow-y: auto; min-height: 0; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.chat-media-row { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.chat-media-thumb { width: 96px; height: 64px; flex: 0 0 96px; border-radius: 7px; overflow: hidden; background: #f4f0e7; display: flex; align-items: center; justify-content: center; }
.chat-media-thumb img, .chat-media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.chat-media-thumb .media-file { color: var(--navy-800); display: flex; }
.media-text-mark { font-size: 22px; font-weight: 700; color: #b08a3e; }
.media-audio-mark { color: var(--navy-800); display: flex; }
.chat-media-info { flex: 1; min-width: 0; }
.chat-media-info strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-media-info small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.chat-media-info p { margin: 4px 0 0; font-size: 12px; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chat-media-action { flex: 0 0 auto; }
.chat-media-pager { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.chat-media-pager .page-btn { height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 12px; cursor: pointer; }
.chat-media-pager .page-btn:disabled { opacity: .45; cursor: default; }

.admin-chat-list { display: flex; flex-direction: column; gap: 10px; max-height: 62vh; overflow-y: auto; padding: 4px; }
.admin-chat-row { display: flex; }
.admin-chat-row.right { justify-content: flex-end; }
.admin-chat-row > div { max-width: 78%; }
.admin-chat-row strong { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.admin-chat-bubble { display: block; padding: 8px 11px; border-radius: 10px; background: #f2eee6; font-size: 13px; line-height: 1.5; word-break: break-word; }
.admin-chat-row.right .admin-chat-bubble { background: var(--navy-900); color: #f7f1e3; }
.admin-chat-row small { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); }

.manual-steps { display: flex; flex-direction: column; gap: 18px; margin-bottom: 18px; }
.manual-step { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.manual-step img { display: block; width: 100%; max-height: 330px; object-fit: cover; object-position: top center; border-bottom: 1px solid var(--line); background: #f6f2e9; }
.manual-step figcaption { display: flex; gap: 12px; padding: 12px 14px 14px; }
.manual-step-index { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; background: var(--navy-900); color: #f4ecdc; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.manual-step h4 { margin: 0 0 5px; font-size: 14px; color: var(--navy-900); }
.manual-step p { margin: 0; font-size: 13px; line-height: 1.75; color: #4d5a68; }

.manual-modal { width: min(920px, 94vw); max-width: min(920px, 94vw); }

.topbar-notice { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; color: var(--navy-800); background: rgba(255,255,255,.55); border: 1px solid var(--line); text-decoration: none; }
.topbar-notice:hover { background: #fff; }
.topbar-notice .icon { width: 19px; height: 19px; }
.topbar-notice-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #c0392b; color: #fff; font-size: 10px; line-height: 18px; text-align: center; border: 2px solid #f6f1e7; box-sizing: content-box; }
.topbar-notice.flash { animation: topbar-notice-flash .55s ease-in-out 4; }
@keyframes topbar-notice-flash { 0%,100% { background: rgba(255,255,255,.55); color: var(--navy-800); } 50% { background: #c0392b; color: #fff; } }

.perm-target-picker { max-height: 230px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; padding: 8px; background: #fff; }
.perm-target-group { margin-bottom: 8px; }
.perm-target-group strong { display: block; font-size: 11px; color: var(--muted); margin: 4px 2px 6px; }
.perm-target-option { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.perm-target-option:hover { background: #f7f3ea; }
.perm-target-option input { width: 16px; height: 16px; accent-color: var(--navy-800); }

.departure-notice-modal .modal-body { text-align: center; }
.departure-notice-icon { width: 54px; height: 54px; margin: 4px auto 14px; border-radius: 50%; background: #f5ead2; color: #a8752c; display: flex; align-items: center; justify-content: center; }
.departure-notice-icon .icon { width: 26px; height: 26px; }
.departure-notice-text { margin: 0 0 10px; font-size: 14px; line-height: 1.7; color: var(--ink); }
.departure-notice-text:last-child { color: var(--muted); font-size: 13px; }

.mobile-resume-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; margin: 12px 0; }
.mobile-resume-thumb { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #f4f0e7; aspect-ratio: 3 / 4; }
.mobile-resume-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mobile-resume-thumb button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(16,29,47,.72); color: #fff; font-size: 14px; line-height: 22px; padding: 0; cursor: pointer; }

.hr-resume-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hr-resume-item { display: block; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; text-decoration: none; color: var(--ink); }
.hr-resume-item img { width: 100%; height: 190px; object-fit: cover; display: block; background: #f4f0e7; }
.hr-resume-item span { display: block; padding: 6px 8px; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .hr-resume-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.wallet-balance { display: inline-flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: 12px; margin-right: 10px; }
.wallet-balance strong { color: var(--navy-900); font-size: 20px; }

.wallet-qr-preview { display: flex; justify-content: center; margin: 4px 0 10px; }
.wallet-qr-preview img { max-width: 240px; max-height: 260px; border-radius: 10px; border: 1px solid var(--line); }

.wallet-user-cell { display: flex; align-items: center; gap: 10px; }
.wallet-user-cell .avatar { flex-shrink: 0; }

.wallet-period-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.wallet-period-tab { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 9px 18px; font-size: 13px; cursor: pointer; transition: all .18s ease; }
.wallet-period-tab:hover { border-color: var(--gold); }
.wallet-period-tab.active { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.wallet-period-total { margin-left: 14px; font-weight: 600; }

.switch-line { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; padding-top: 6px; }
.switch-line input { width: 16px; height: 16px; accent-color: var(--navy-900); }

.field input.input-readonly { background: #eef0f2; color: #7a828c; cursor: not-allowed; }

.toolbar-date { border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 12px; padding: 8px 10px; min-height: 36px; width: 142px; flex: 0 0 142px; }
.toolbar-date-sep { color: var(--muted); font-size: 12px; }

.material-user-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.material-user-option { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.material-user-option.selected { border-color: var(--gold); background: #fbf6ea; }
.material-user-option input { accent-color: var(--navy-900); }
.material-user-option span { display: flex; flex-direction: column; gap: 2px; }
.material-user-option small { color: var(--muted); font-size: 11px; }
.material-user-option em { margin-left: auto; font-style: normal; font-size: 12px; color: #1f7a4d; }

.case-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.case-image-card { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fbf8f1; }
.case-image-card img { display: block; width: 100%; height: 180px; object-fit: contain; background: #f3eee4; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.case-image-card figcaption { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; }
.case-image-card figcaption strong { font-size: 13px; color: var(--ink); }
.case-image-card figcaption span { font-size: 12px; color: var(--muted); }
.case-image-card figcaption small { font-size: 11px; color: #9a917f; }

.contract-extra-details { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.contract-extra-details p { text-indent: 0; margin: 0 0 8px; }
.mobile-sign-page:not(.signing) { height: auto; min-height: 100vh; overflow-y: auto; }

.contract-modal .modal-body { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

.case-copy-warning { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border: 1px solid #e5b7a8; border-radius: 12px; background: #fdf1ec; color: #9d3b2c; margin-bottom: 14px; }
.case-copy-warning svg { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 1px; }
.case-copy-warning div { display: flex; flex-direction: column; gap: 4px; }
.case-copy-warning strong { font-size: 15px; letter-spacing: .2px; }
.case-copy-warning span { font-size: 12px; color: #a65a4b; }

.wechat-qr-preview { width: min(168px, 100%); height: auto; aspect-ratio: 1 / 1; }
.wechat-qr-preview img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 640px) {
  .wechat-qr-card { flex-direction: column; align-items: stretch; gap: 14px; }
  .wechat-qr-preview { width: 100%; max-width: 320px; margin: 0 auto; height: auto; aspect-ratio: 1 / 1; }
  .wechat-qr-copy { min-width: 0; }
}

.chat-bubble-row.recalled .chat-bubble { background: #f1eee8 !important; color: #948b7c !important; font-size: 12px; }
.chat-recalled-text { font-style: italic; }
.chat-recall-btn { margin-left: 8px; border: 0; background: transparent; color: #b23a2f; font-size: 11px; cursor: pointer; padding: 0; }
.chat-recall-btn:hover { text-decoration: underline; }

.mobile-avatar-preview { width: 100%; max-width: 320px; min-height: 110px; margin: 0 auto 16px; padding: 12px; box-sizing: border-box; border: 1px dashed #d8c9aa; border-radius: 14px; background: #fbf8f1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.mobile-avatar-preview img { display: block; width: 100%; height: auto; max-height: 42vh; object-fit: contain; border-radius: 10px; }

.hr-resume-item.hr-resume-doc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 150px; padding: 18px; text-align: center; color: var(--ink); text-decoration: none; }
.hr-resume-item.hr-resume-doc strong { font-size: 13px; word-break: break-all; }
.hr-resume-item.hr-resume-doc span { color: var(--muted); font-size: 11px; }

.topbar-back { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer; }
.topbar-back:hover { border-color: var(--gold); color: var(--gold); }
@media (max-width: 720px) { .topbar-back { width: 34px; height: 34px; } }

.suggestion-image { display: block; max-width: 100%; max-height: 320px; margin: 12px 0 4px; border-radius: 10px; border: 1px solid var(--line); object-fit: contain; background: #faf8f3; }

.ai-lawyer-card { margin-bottom: 16px; border: 1px solid #d9c9a8; background: linear-gradient(180deg,#fffdf8,#fbf7ee); }
.ai-chat { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 2px 12px; }
.ai-empty { text-align: center; color: var(--muted); padding: 26px 14px; }
.ai-empty strong { display: block; color: var(--ink); font-size: 15px; margin: 8px 0 6px; }
.ai-empty p { margin: 0; font-size: 12px; line-height: 1.8; }
.ai-message { display: flex; align-items: flex-start; gap: 9px; max-width: 92%; }
.ai-message.user { margin-left: auto; flex-direction: row-reverse; }
.ai-avatar { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #1f2937; color: #e9d7ae; font-size: 11px; font-weight: 700; }
.ai-message.user .ai-avatar { background: var(--gold); color: #fff; }
.ai-bubble { padding: 10px 13px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-size: 13px; line-height: 1.8; color: var(--ink); white-space: normal; word-break: break-word; }
.ai-message.user .ai-bubble { background: #fbf3e2; border-color: #e6d4ae; }
.ai-ask-form { display: flex; gap: 10px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 14px; }
.ai-ask-form textarea { flex: 1; min-height: 88px; border: 1px solid #d9d1c2; border-radius: 10px; padding: 10px 12px; font: inherit; resize: vertical; background: #fff; }
.ai-disclaimer { margin-top: 10px; font-size: 11px; color: #9a917f; line-height: 1.6; }
@media (max-width: 640px) { .ai-ask-form { flex-direction: column; align-items: stretch; } .ai-ask-form .btn { width: 100%; } }

.interview-time-picker .btn { flex: 0 0 auto; white-space: nowrap; }

.interview-time-actions { display: flex; justify-content: flex-end; margin-top: 8px; }

.field input[readonly] { background: #f5f1e8; color: #6f6758; cursor: not-allowed; }

.interview-time-picker .btn { height: 40px; padding: 0 9px; flex: 0 0 auto; font-size: 12px; white-space: nowrap; }

.contract-seal { position: absolute; }
.contract-seal .seal-company { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); width: 82px; text-align: center; color: #c0392b; font-size: 6.5px; font-weight: 700; line-height: 1.2; letter-spacing: .3px; }
.contract-seal > svg { position: absolute; inset: 0; width: 100%; height: 100%; padding: 20px 18px; box-sizing: border-box; }

.account-profile-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr) minmax(225px, .62fr); gap: 16px; align-items: stretch; }
.account-profile-layout > .card { height: 100%; }
.account-side-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; height: 100%; }
.account-side-stack > .card { margin-top: 0 !important; }
.account-side-stack > .card:last-child { flex: 1 1 auto; }
@media (max-width: 980px) {
  .account-profile-layout { grid-template-columns: 1fr; }
  .account-side-stack { height: auto; }
}

.account-wechat-card { height: 100%; display: flex; flex-direction: column; }
.account-wechat-card .card-body { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: flex-start; }
.account-wechat-card .wechat-qr-card { flex-direction: column; align-items: center; justify-content: flex-start; gap: 14px; }
.account-wechat-card .wechat-qr-preview { width: min(180px, 100%); margin: 0 auto; }
.account-wechat-card .wechat-qr-copy { min-width: 0; text-align: center; }
@media (max-width: 1200px) {
  .account-profile-layout { grid-template-columns: 1fr !important; }
}

.account-profile-layout.account-profile-layout-admin { display: block; }
.account-profile-layout.account-profile-layout-admin .account-side-stack { margin-top: 16px; }

.account-profile-layout > .wechat-qr-section { grid-column: 3 !important; grid-row: 1; }
@media (max-width: 1200px) {
  .account-profile-layout > .wechat-qr-section { grid-column: 1 !important; grid-row: auto; }
}

.account-profile-layout > .card:first-child { overflow: hidden; }
.account-profile-layout .profile-banner { border-radius: 18px 18px 0 0; }

.seal-preview { width: 128px; height: 128px; border: 1px dashed var(--line); border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: #faf8f3; color: var(--muted); font-size: 12px; text-align: center; }
.seal-preview img { width: 100%; height: 100%; object-fit: contain; }
.contract-seal.contract-seal-uploaded { border: 0; background: transparent; padding: 0; }
.contract-seal.contract-seal-uploaded img { width: 100%; height: 100%; object-fit: contain; }

.contract-seal.contract-seal-uploaded { width: min(130px, 26%); min-width: 72px; height: auto; aspect-ratio: 1 / 1; padding: 0; background: transparent; border: 0; opacity: 1; }
.contract-seal.contract-seal-uploaded img { width: 100%; height: 100%; object-fit: contain; display: block; }

.settings-grid.admin-settings { display: block; }
.admin-top-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); gap: 16px; align-items: stretch; margin-bottom: 16px; }
.admin-top-grid > .card { height: 100%; margin-top: 0 !important; }
.admin-modules-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.admin-modules-grid > .card { height: 100%; margin-top: 0 !important; }
@media (max-width: 1200px) {
  .admin-top-grid { grid-template-columns: 1fr; }
  .admin-modules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .admin-modules-grid { grid-template-columns: 1fr; }
}

.settings-grid.user-settings { display: block; }
.user-top-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 16px; align-items: stretch; margin-bottom: 16px; }
.user-top-grid.user-top-grid-single { grid-template-columns: 1fr; }
.user-top-grid > .card { height: 100%; margin-top: 0 !important; }
.user-modules-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.user-modules-grid > .card { height: 100%; margin-top: 0 !important; }
@media (max-width: 1200px) {
  .user-top-grid { grid-template-columns: 1fr; }
  .user-modules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .user-modules-grid { grid-template-columns: 1fr; }
}

.ai-attach-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.ai-attach-button { cursor: pointer; }
.ai-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ai-attachments:empty { display: none; }
.ai-attachment-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fbf8f1; font-size: 12px; color: var(--ink); word-break: break-all; }
.ai-attachment-chip button { border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; padding: 0; cursor: pointer; }

.ai-fee-highlight { padding: 12px 14px; border-radius: 10px; background: #1f2937; color: #e9d7ae; font-size: 14px; font-weight: 700; text-align: center; margin-bottom: 14px; }
.ai-fee-lines { display: grid; gap: 8px; margin-bottom: 12px; }
.ai-fee-lines > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.ai-fee-lines strong { color: var(--ink); }
.ai-fee-example { font-size: 13px; line-height: 1.8; color: var(--ink); background: #fbf8f1; border-radius: 10px; padding: 12px; margin: 0 0 10px; }
.ai-recharge-text { font-size: 13px; line-height: 1.9; color: var(--ink); margin: 0; }

.case-image-card { cursor: zoom-in; }
body.case-preview-open { overflow: hidden; }
.case-image-lightbox { position: fixed; inset: 0; z-index: 1200; background: rgba(15, 20, 28, .86); display: flex; align-items: center; justify-content: center; padding: 28px; }
.case-image-lightbox-panel { position: relative; max-width: 94vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.case-image-lightbox-panel img { display: block; max-width: 92vw; max-height: 84vh; object-fit: contain; border-radius: 8px; box-shadow: 0 18px 60px rgba(0,0,0,.45); background: #fff; }
.case-image-lightbox-close { position: absolute; top: -14px; right: -14px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.5); background: rgba(20,24,32,.85); color: #fff; display: grid; place-items: center; cursor: pointer; z-index: 2; }
.case-image-lightbox-name { color: #f2eee5; font-size: 12px; text-align: center; word-break: break-all; }

.address-region-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 640px) { .address-region-grid { grid-template-columns: 1fr; } }

.data-table-sales { table-layout: fixed; width: 100%; }
.data-table-sales th, .data-table-sales td { white-space: normal; word-break: break-word; padding: 10px 8px; }
.data-table-sales .row-actions { flex-wrap: nowrap; gap: 5px; justify-content: flex-end; }
.data-table-sales .btn-sm { font-size: 11px; padding: 5px 8px; }

.member-search { margin-bottom: 8px; }
.member-search input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; background: #fff; }
.payment-plan-list { display: flex; flex-direction: column; gap: 10px; }
.payment-plan-row, .payment-plan-final-ratio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 72px; gap: 8px; align-items: end; }
.payment-plan-row { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbf8f1; }
.payment-plan-row .field, .payment-plan-final-ratio .field { min-width: 0; max-width: none; }
.payment-plan-ratio-spacer { display: block; width: 72px; }
.payment-plan-row .field { min-width: 0; }
.payment-plan-row input { width: 100%; }
@media (max-width: 640px) { .payment-plan-row, .payment-plan-final-ratio { grid-template-columns: 1fr; } .payment-plan-ratio-spacer { display: none; } }

.segment.active { border-color: var(--gold); background: var(--gold-wash); box-shadow: 0 0 0 2px rgba(200,164,93,.12); }
.segment.active .segment-icon { background: var(--gold); color: var(--navy-900); }

.payment-plan-final-ratio { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbf8f1; }

.payment-select-list { display: flex; flex-direction: column; gap: 8px; }
.payment-select-item { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; background: #fffdf9; }
.payment-select-item input { margin-top: 4px; }
.payment-select-item strong { display: block; font-size: 14px; }
.payment-select-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.payment-qr-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.payment-qr-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; background: #fffdf9; }
.payment-qr-code svg { width: 180px; height: 180px; display: block; margin: 0 auto; }
.payment-qr-box p { margin: 8px 0 2px; font-size: 12px; font-weight: 600; }
.payment-qr-box small { color: var(--muted); font-size: 10px; }
.payment-upload-zone { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 110px; border: 1px dashed #c9bda8; border-radius: 10px; background: #fbf8f1; color: var(--gold); font-size: 12px; cursor: pointer; }
.payment-upload-zone:hover { border-color: var(--gold); }
.payment-proof-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.payment-proof-grid img { width: 74px; height: 74px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
@media (max-width: 640px) { .payment-qr-layout { grid-template-columns: 1fr; } }

.client-contract-sign-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.client-contract-preview { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fffdf9; }
.client-contract-preview > strong { display: block; margin-bottom: 8px; }
.client-contract-lines { max-height: 320px; overflow-y: auto; color: var(--muted); font-size: 12px; line-height: 1.8; }
.client-contract-lines p { margin: 0 0 6px; }
@media (max-width: 640px) { .client-contract-sign-layout { grid-template-columns: 1fr; } }

.client-contract-qr-only { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.client-contract-qr-only .payment-qr-box { width: 260px; }

.payment-upload-zone-content { display: inline-flex; align-items: center; gap: 6px; }
.payment-upload-zone { justify-content: flex-start; padding: 0 16px; min-height: 54px; gap: 0; }

.contract-client-signature { display: block; max-width: 150px; max-height: 70px; margin-top: 6px; object-fit: contain; }
.contract-client-signature[hidden] { display: none; }

.btn-overdue { background: var(--red); border-color: var(--red); color: #fff; }
.btn-overdue:hover { background: #a93328; border-color: #a93328; color: #fff; }

.payment-select-copy { flex: 1; min-width: 0; }
.payment-select-main { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.payment-select-main strong { font-size: 14px; }
.payment-select-main span { color: var(--muted); font-size: 12px; }
.payment-tail-summary { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 9px; background: #fbf8f1; font-size: 12px; }
.payment-tail-summary strong { color: var(--ink); }
.payment-tail-summary span { color: var(--muted); }
.payment-record-list { display: flex; flex-direction: column; gap: 6px; }
.payment-record-item { display: flex; justify-content: space-between; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 12px; }
.payment-record-item span { color: var(--muted); }
.payment-record-item.rejected { background: #fff8f7; flex-wrap: wrap; }

.payment-tail-summary { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf9; cursor: pointer; }
.payment-tail-summary .payment-select-main { justify-content: space-between; width: 100%; }
.payment-tail-summary .payment-select-copy { width: 100%; }

.payment-review-proofs { display: flex; flex-wrap: wrap; gap: 10px; }
.payment-review-proofs img { width: 140px; height: 140px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #fff; }

.payment-review-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; margin-bottom: 12px; }
.payment-review-layout .field { min-width: 0; display: flex; flex-direction: column; }
.payment-review-layout textarea { width: 100%; flex: 1 1 auto; min-height: 160px; resize: none; }
@media (max-width: 640px) { .payment-review-layout { grid-template-columns: 1fr; } }

.payment-review-layout .field > label { display: block; margin: 0 0 8px; min-height: 18px; line-height: 18px; font-size: 12px; font-weight: 600; color: var(--ink); }
.payment-review-layout .payment-review-proofs { margin-top: 0; }

.payment-review-layout .field + .field { margin-top: 0; }

.payment-select-item.is-locked { background: #f7f4ee; cursor: not-allowed; }
.payment-select-main .status-badge { flex: 0 0 auto; white-space: nowrap; }

.payment-select-item.no-checkbox { padding-left: 14px; }

.payment-tail-amount { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf9; }
.payment-tail-amount label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; }
.payment-tail-amount input { width: 100%; }

.payment-record-item.rejected { display: flex; flex-direction: column; gap: 6px; }
.payment-record-main { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.payment-record-main span { color: var(--muted); font-size: 12px; }
.payment-record-reason { color: #9d342c; font-size: 12px; line-height: 1.6; }

.payment-group-list { display: flex; flex-direction: column; gap: 8px; }
.payment-group-record { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fffdf9; }
.payment-group-main { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.payment-group-main span { color: var(--muted); font-size: 12px; }


.opponent-warning-name { color: #000; font-weight: 800; }

.sales-stat.is-disabled { cursor: default; opacity: .72; }

.review-owner-lines { display: flex; flex-direction: column; gap: 4px; }
.review-payment-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.review-payment-block .field-label { display: block; margin-bottom: 10px; font-weight: 600; }
.review-payment-plans { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.review-payment-plan { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf9; font-size: 12px; }
.review-payment-plan span { color: var(--muted); margin-left: auto; text-align: right; }

.review-contract-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.review-contract-block .field-label { display: block; margin-bottom: 10px; font-weight: 600; }
.review-contract-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf9; margin-bottom: 8px; }
.review-contract-row span { color: var(--muted); font-size: 12px; }
.review-contract-row .btn { margin-left: 0; }
.review-contract-row .btn:first-of-type { margin-left: auto; }

.hearing-status.payment { color: var(--gold); background: var(--gold-wash); }

/* ------------------------------------------------------------ public website */
.public-site {
  min-height: 100vh;
  background: #f6f2ea;
  color: #17202b;
  font-family: inherit;
}
.public-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 20px 56px;
  background: rgba(247, 244, 237, .94);
  border-bottom: 1px solid rgba(176, 161, 128, .26);
  backdrop-filter: blur(14px);
}
.public-brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; flex: 0 0 auto; }
.public-brand .brand-seal { width: 42px; height: 42px; border: 1px solid #a88c54; border-radius: 11px; display: grid; place-items: center; color: #8b6b34; font-family: "Songti SC", "SimSun", serif; font-size: 24px; }
.public-brand strong { display: block; font-size: 18px; letter-spacing: .14em; color: #17202b; }
.public-brand small { display: block; margin-top: 3px; font-size: 9px; letter-spacing: .22em; color: #887b64; }
.public-nav { display: flex; align-items: center; gap: 28px; margin-left: 18px; }
.public-nav a { color: #3d4752; font-size: 13px; text-decoration: none; letter-spacing: .05em; padding: 8px 0; position: relative; }
.public-nav a:hover { color: #9b773d; }
.public-nav a::after { content: ''; position: absolute; left: 0; right: 100%; bottom: 2px; height: 1px; background: #b08b4e; transition: right .25s ease; }
.public-nav a:hover::after { right: 0; }
.public-actions { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.public-hotline { display: inline-flex; align-items: center; gap: 6px; color: #746a58; font-size: 12px; }
.public-login { display: inline-flex; align-items: center; justify-content: center; min-width: 88px; padding: 10px 22px; border-radius: 6px; background: #17202b; color: #f5efe3; font-size: 13px; letter-spacing: .08em; text-decoration: none; transition: background .2s ease; }
.public-login:hover { background: #9b773d; }
.public-hero { background: #17202b; color: #f4eee2; overflow: hidden; }
.public-hero-inner { max-width: 1240px; margin: 0 auto; padding: 96px 56px 76px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 70px; align-items: center; }
.public-eyebrow { display: block; color: #b08b4e; font-size: 10px; letter-spacing: .24em; font-weight: 700; }
.public-hero-copy h1 { margin: 24px 0 22px; font-family: "Songti SC", "SimSun", serif; font-size: clamp(42px, 5vw, 68px); line-height: 1.25; font-weight: 600; letter-spacing: .06em; }
.public-hero-copy h1 em { font-style: normal; color: #c8a563; }
.public-hero-copy p { max-width: 580px; margin: 0; color: rgba(242, 235, 222, .68); line-height: 2; font-size: 14px; }
.public-hero-actions { display: flex; gap: 14px; margin-top: 36px; flex-wrap: wrap; }
.public-btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 24px; border-radius: 6px; font-size: 13px; text-decoration: none; letter-spacing: .04em; transition: all .2s ease; }
.public-btn.primary { background: #c8a563; color: #17202b; }
.public-btn.primary:hover { background: #ddbd7e; }
.public-btn.ghost { border: 1px solid rgba(244, 238, 226, .28); color: #f4eee2; }
.public-btn.ghost:hover { border-color: #c8a563; color: #c8a563; }
.public-btn.dark { background: #17202b; color: #f4eee2; }
.public-btn.dark:hover { background: #9b773d; }
.public-hero-aside { position: relative; height: 360px; border-left: 1px solid rgba(200, 165, 99, .45); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.public-seal-large { width: 126px; height: 126px; border: 1px solid #c8a563; border-radius: 50%; display: grid; place-items: center; color: #c8a563; font-family: "Songti SC", "SimSun", serif; font-size: 76px; opacity: .9; }
.public-hero-line { width: 1px; height: 42px; background: rgba(200, 165, 99, .45); margin: 26px 0; }
.public-hero-values { display: flex; gap: 16px; color: #c8a563; font-size: 12px; letter-spacing: .28em; }
.public-hero-note { margin-top: 54px; color: rgba(200, 165, 99, .5); font-size: 9px; letter-spacing: .24em; line-height: 1.8; text-align: center; }
.public-hero-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(200, 165, 99, .18); background: #141c25; }
.public-hero-strip > div { padding: 28px 42px; border-right: 1px solid rgba(200, 165, 99, .14); }
.public-hero-strip > div:last-child { border-right: 0; }
.public-hero-strip strong { display: block; color: #c8a563; font-family: "Songti SC", "SimSun", serif; font-size: 28px; font-weight: 500; }
.public-hero-strip span { display: block; margin-top: 7px; color: rgba(244, 238, 226, .52); font-size: 11px; letter-spacing: .08em; }
.public-section { max-width: 1240px; margin: 0 auto; padding: 92px 56px; }
.public-section-head { display: flex; justify-content: space-between; gap: 60px; align-items: flex-end; margin-bottom: 42px; }
.public-section-head h2 { margin: 14px 0 0; font-family: "Songti SC", "SimSun", serif; font-size: 34px; font-weight: 600; letter-spacing: .06em; }
.public-section-head p { max-width: 430px; margin: 0; color: #756d5e; font-size: 13px; line-height: 2; }
.public-service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.public-service-card { position: relative; padding: 30px 28px 28px; background: #fffdf8; border: 1px solid #e3dacb; border-radius: 4px; transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.public-service-card:hover { transform: translateY(-4px); border-color: #c2a875; box-shadow: 0 18px 38px rgba(44, 34, 18, .08); }
.public-service-index { position: absolute; right: 24px; top: 22px; color: #e4d9c6; font-family: Georgia, serif; font-size: 26px; }
.public-service-icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #d8c6a5; border-radius: 50%; color: #9b773d; }
.public-service-card h3 { margin: 22px 0 10px; font-size: 17px; font-weight: 600; letter-spacing: .06em; }
.public-service-card p { min-height: 52px; margin: 0; color: #7a7162; font-size: 12px; line-height: 1.9; }
.public-service-card a { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; color: #9b773d; font-size: 11px; text-decoration: none; }
.public-about { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: #ece5d8; }
.public-about-visual { min-height: 540px; display: flex; align-items: center; justify-content: center; background: #e3d9c7; position: relative; overflow: hidden; }
.public-about-visual::before { content: ''; position: absolute; inset: 34px; border: 1px solid rgba(155, 119, 61, .28); }
.public-about-frame { width: 220px; height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #17202b; color: #c8a563; position: relative; z-index: 1; box-shadow: 18px 18px 0 rgba(155, 119, 61, .18); }
.public-about-frame span { font-family: "Songti SC", "SimSun", serif; font-size: 58px; letter-spacing: .1em; }
.public-about-frame small { margin-top: 18px; font-size: 8px; letter-spacing: .24em; opacity: .6; }
.public-about-mark { position: absolute; bottom: 66px; color: rgba(71, 57, 35, .55); font-size: 11px; letter-spacing: .3em; }
.public-about-copy { padding: 86px 70px; }
.public-about-copy h2 { margin: 18px 0 24px; font-family: "Songti SC", "SimSun", serif; font-size: 38px; line-height: 1.45; font-weight: 600; letter-spacing: .05em; }
.public-about-copy > p { color: #6f6657; font-size: 13px; line-height: 2.1; }
.public-value-list { margin: 30px 0 34px; border-top: 1px solid #d7cab5; }
.public-value-list > div { display: flex; gap: 26px; padding: 16px 0; border-bottom: 1px solid #d7cab5; }
.public-value-list strong { min-width: 88px; font-size: 13px; color: #4e4537; }
.public-value-list span { color: #837968; font-size: 12px; }
.public-contact { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 80px; width: 100%; max-width: none; margin: 0; padding: 92px max(56px, calc((100vw - 1240px) / 2)); background: #17202b; color: #f4eee2; }
.public-contact-copy h2 { margin: 18px 0 20px; font-family: "Songti SC", "SimSun", serif; font-size: 38px; line-height: 1.5; font-weight: 600; }
.public-contact-copy > p { max-width: 520px; color: rgba(244, 238, 226, .55); font-size: 13px; line-height: 2; }
.public-contact-list { margin-top: 34px; display: flex; flex-direction: column; gap: 16px; }
.public-contact-list > div { display: grid; grid-template-columns: 22px 80px 1fr; gap: 10px; align-items: center; color: rgba(244, 238, 226, .8); font-size: 12px; }
.public-contact-list span { color: rgba(244, 238, 226, .4); }
.public-contact-list strong { font-weight: 500; color: #e9dfcc; }
.public-contact-card { padding: 38px 32px; border: 1px solid rgba(200, 165, 99, .35); background: rgba(255, 255, 255, .035); text-align: center; align-self: center; }
.public-contact-seal { width: 74px; height: 74px; margin: 0 auto 20px; border: 1px solid #c8a563; border-radius: 50%; display: grid; place-items: center; color: #c8a563; font-family: "Songti SC", "SimSun", serif; font-size: 42px; }
.public-contact-card h3 { margin: 0 0 8px; font-size: 17px; letter-spacing: .1em; }
.public-contact-card p { color: rgba(244, 238, 226, .5); font-size: 11px; }
.public-contact-card .public-btn { margin-top: 22px; width: 100%; justify-content: center; }
.public-contact-card small { display: block; margin-top: 16px; color: rgba(244, 238, 226, .3); font-size: 9px; letter-spacing: .08em; }
.public-footer { display: flex; justify-content: space-between; gap: 20px; padding: 22px 56px; background: #111820; color: rgba(244, 238, 226, .38); font-size: 10px; letter-spacing: .08em; }
.public-login-back { display: inline-flex; margin-bottom: 22px; color: #8d7c60; font-size: 11px; text-decoration: none; letter-spacing: .08em; }
.public-login-back:hover { color: #9b773d; }
@media (max-width: 980px) {
  .public-header { padding: 16px 22px; gap: 16px; flex-wrap: wrap; }
  .public-nav { order: 3; width: 100%; gap: 18px; overflow-x: auto; padding-top: 4px; }
  .public-hotline { display: none; }
  .public-hero-inner { grid-template-columns: 1fr; padding: 64px 24px 48px; gap: 30px; }
  .public-hero-aside { display: none; }
  .public-hero-strip { grid-template-columns: repeat(2, 1fr); }
  .public-hero-strip > div { padding: 20px 24px; }
  .public-section { padding: 58px 24px; }
  .public-section-head { display: block; }
  .public-section-head p { margin-top: 16px; }
  .public-service-grid { grid-template-columns: 1fr; }
  .public-about { grid-template-columns: 1fr; }
  .public-about-visual { min-height: 300px; }
  .public-about-copy { padding: 48px 24px; }
  .public-contact { grid-template-columns: 1fr; padding: 58px 24px; gap: 40px; }
  .public-footer { padding: 20px 24px; flex-direction: column; }
}

.login-page { position: relative; }
.login-home-link { position: absolute; top: 24px; right: 30px; z-index: 5; display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border: 1px solid rgba(155, 119, 61, .35); border-radius: 6px; background: rgba(255, 253, 248, .82); color: #7d6540; font-size: 12px; text-decoration: none; backdrop-filter: blur(8px); }
.login-home-link:hover { border-color: #9b773d; color: #9b773d; }
@media (max-width: 760px) { .login-home-link { top: 16px; right: 16px; padding: 7px 12px; } }

.detail-main > .card { overflow: hidden; }
.detail-main > .card > .info-grid:last-child { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }

.opponent-detail-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.opponent-detail { padding: 13px 14px; border-radius: 9px; background: #fffdf8; }
.opponent-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.opponent-detail-head strong { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.opponent-detail-head span { color: var(--muted-2); font-size: 9px; letter-spacing: .06em; }
.opponent-fields { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--ink-soft); font-size: 12.5px; }
.opponent-fields span { display: inline-flex; align-items: center; gap: 5px; }
.opponent-fields em { color: var(--muted-2); font-style: normal; font-size: 9px; }
.opponent-detail p { display: flex; align-items: flex-start; gap: 5px; margin: 10px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.7; }
@media (max-width: 900px) { .opponent-detail-list { grid-template-columns: 1fr; } }

.client-files-list { display: flex; flex-direction: column; gap: 8px; }
.client-file-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fffdf8; color: var(--ink-soft); text-decoration: none; }
.client-file-row > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.client-file-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.client-file-row small { color: var(--muted-2); font-size: 10px; }
.client-file-row > svg:last-child { margin-left: auto; color: var(--muted-2); }

.client-file-guide { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid #ecd9b8; border-radius: 9px; background: #fff8eb; color: #7a6038; font-size: 12px; }
.client-file-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.client-file-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 108px; padding: 14px; border: 1px dashed #cdb995; border-radius: 10px; background: #fffdf8; cursor: pointer; text-align: center; }
.client-file-slot:hover { border-color: #9b773d; background: #fffaf0; }
.client-file-slot-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #f3ead9; color: #9b773d; }
.client-file-slot strong { font-size: 12px; color: var(--ink-soft); }
.client-file-slot > span:last-of-type { color: var(--muted-2); font-size: 10px; }
@media (max-width: 640px) { .client-file-slots { grid-template-columns: 1fr; } }

.client-file-slots.single { grid-template-columns: 1fr; }

.client-files-card { padding: 0 0 16px; }
.client-files-card > .card-head { padding: 20px 20px 14px; }
.client-file-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 0 20px; }
.client-file-group { min-width: 0; padding: 13px; border: 1px solid var(--line-soft); border-radius: 10px; background: #fffdf8; }
.client-file-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.client-file-group-head strong { font-size: 13px; color: var(--ink); }
.client-file-group-head span { color: var(--muted-2); font-size: 10px; }
.client-file-group .inline-note { margin: 0; }
@media (max-width: 980px) { .client-file-groups { grid-template-columns: 1fr; } }
