:root {
  --ink: #171717;
  --muted: #77736e;
  --line: #e8e5e1;
  --paper: #ffffff;
  --canvas: #f7f6f4;
  --forest: #e77c06;
  --forest-2: #c96500;
  --mint: #fff0dc;
  --mint-2: #fff7ed;
  --gold: #e77c06;
  --gold-soft: #fff0dc;
  --danger: #ad4b48;
  --danger-soft: #fbe9e7;
  --warning: #ad6d24;
  --warning-soft: #fff0dc;
  --blue: #486b8b;
  --blue-soft: #e8f0f6;
  --shadow: 0 16px 38px rgba(28, 24, 20, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
}

body.mobile-nav-open,
body.camera-open { overflow: hidden; }

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

body.login-mode .sidebar,
body.login-mode .topbar { display: none; }
body.login-mode .main-shell { width: 100%; margin-left: 0; }
body.login-mode .content { min-height: 100vh; padding: 0; }

.app-shell { min-height: 100vh; display: flex; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 232px;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 16px;
  color: #ecf5f1;
  background:
    radial-gradient(circle at 15% 0%, rgba(119, 174, 151, .18), transparent 30%),
    linear-gradient(180deg, #173f39 0%, #102f2a 100%);
  transition: transform .25s ease;
}

.brand { display: flex; gap: 13px; align-items: center; padding: 0 8px 25px; }
.brand-logo-shell {
  flex: 0 0 auto; width: 48px; height: 48px; overflow: hidden; padding: 0;
  border: 1px solid rgba(212,180,113,.7); border-radius: 50%; background: #fff;
  box-shadow: 0 8px 22px rgba(0,0,0,.18), 0 0 0 3px rgba(255,255,255,.06);
}
.brand-logo-shell img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; transform: scale(1.14); transform-origin: center; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 18px; letter-spacing: 1.8px; }
.brand span { margin-top: 4px; color: #a9c0b9; font-size: 10px; letter-spacing: .6px; }

.nav { display: grid; gap: 5px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; color: #bcd0ca; text-decoration: none;
  border-radius: 10px; transition: .18s ease;
}
.nav a:hover { color: white; background: rgba(255,255,255,.07); }
.nav a.active { color: white; background: rgba(255,255,255,.12); box-shadow: inset 3px 0 #d8b47a; }
.nav-icon {
  width: 25px; height: 25px; display: grid; place-items: center;
  color: #d6e3df; border: 1px solid rgba(255,255,255,.16); border-radius: 7px; font-size: 12px;
}

.sidebar-footer {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding: 15px 8px 2px; border-top: 1px solid rgba(255,255,255,.1);
}
.user-avatar, .avatar {
  flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%;
  color: white; background: linear-gradient(135deg, #c19a65, #8c6639);
}
.user-avatar { width: 34px; height: 34px; }
.sidebar-user { min-width: 0; flex: 1; }
.sidebar-user strong, .sidebar-user span { display: block; }
.sidebar-user strong { font-size: 13px; }
.sidebar-user span { margin-top: 2px; color: #92aaa4; font-size: 11px; }

.main-shell { width: calc(100% - 232px); margin-left: 232px; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 76px;
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(16px);
  box-shadow: 0 5px 20px rgba(35,45,41,.035);
}
.mobile-menu { display: none; border: 0; background: transparent; font-size: 22px; }
.topbar-title { min-width: 176px; display: grid; gap: 3px; padding-left: 12px; border-left: 3px solid var(--gold); }
.topbar-title strong { color: var(--ink); font-family: Georgia, "Songti SC", serif; font-size: 17px; letter-spacing: 1px; white-space: nowrap; }
.topbar-title span { color: var(--muted); font-size: 10px; letter-spacing: .8px; white-space: nowrap; }
.global-search {
  position: relative; flex: 1 1 360px; width: auto; max-width: 520px; min-width: 210px; height: 42px;
  display: flex; align-items: center; gap: 9px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); transition: .18s ease;
}
.global-search:focus-within { border-color: #c8a563; background: #fff; box-shadow: 0 0 0 3px rgba(231,124,6,.08); }
.global-search > span { color: var(--forest); font-size: 19px; }
.global-search input { width: 100%; padding: 9px 58px 9px 0; border: 0; outline: none; color: var(--ink); background: transparent; }
kbd { position: absolute; right: 10px; padding: 3px 7px; color: #87928f; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 10px; }
.search-results {
  position: absolute; top: 44px; left: 0; right: 0; display: none; overflow: hidden;
  border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow);
}
.search-results.show { display: block; }
.search-result { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid #f0f2f1; cursor: pointer; }
.search-result:hover { background: var(--mint-2); }
.search-result small { color: var(--muted); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.workspace-tabs { display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); }
.workspace-tabs a { padding: 7px 9px; border-radius: 6px; color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.workspace-tabs a:hover { color: var(--forest-2); background: #fff; }
.workspace-tabs a.active { color: #fff; background: var(--forest); box-shadow: 0 3px 9px rgba(201,101,0,.18); }
.sync-status { min-height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 11px; white-space: nowrap; }
.sync-status i { width: 7px; height: 7px; border-radius: 50%; background: #9aa4a1; }
.sync-status.online i { background: #4d8b72; box-shadow: 0 0 0 3px #e8f3ee; }
.sync-status.syncing i { background: #c18a43; animation: pulse 1s infinite; }
.sync-status.error i { background: #bd5550; }
@keyframes pulse { 50% { opacity: .35; } }

.icon-button { position: relative; border: 0; color: inherit; background: transparent; }
.top-actions .icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; }
.top-actions > .primary-button { min-height: 40px; border-radius: 8px; white-space: nowrap; }
.notification-button span { position: absolute; top: 7px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: #c75a55; }
.primary-button, .secondary-button, .ghost-button, .danger-button {
  min-height: 38px; padding: 0 15px; border-radius: 10px; font-weight: 600; transition: .18s ease;
}
.primary-button { color: white; border: 1px solid var(--forest); background: var(--forest); box-shadow: 0 5px 14px rgba(23,63,57,.16); }
.primary-button:hover { background: var(--forest-2); transform: translateY(-1px); }
.secondary-button { color: var(--forest); border: 1px solid #b7cdc6; background: white; }
.secondary-button:hover { background: var(--mint-2); }
.ghost-button { color: var(--muted); border: 1px solid var(--line); background: #fff; }
.danger-button { color: var(--danger); border: 1px solid #e7c3bf; background: var(--danger-soft); }
.small-button { min-height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12px; }

.content { padding: 29px 30px 54px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-title h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 27px; font-weight: 600; letter-spacing: .5px; }
.page-title p { margin: 7px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 18px; }
.metric-card {
  position: relative; overflow: hidden; min-height: 128px; padding: 19px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 3px 16px rgba(45,66,60,.035);
}
.metric-card::after { content: ""; position: absolute; width: 72px; height: 72px; right: -20px; bottom: -24px; border-radius: 50%; background: var(--mint-2); }
.metric-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.metric-label i { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; background: var(--mint-2); font-style: normal; }
.metric-value { margin-top: 14px; font-family: Georgia, serif; font-size: 30px; font-weight: 600; }
.metric-foot { margin-top: 6px; color: var(--muted); font-size: 12px; }
.metric-foot strong { color: var(--forest-2); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 18px; }
.stack { display: grid; gap: 18px; align-content: start; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 4px 18px rgba(45,66,60,.035); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 15px; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.panel-body { padding: 17px 19px; }
.panel-link { color: var(--forest-2); text-decoration: none; font-size: 12px; font-weight: 600; }

.timeline { display: grid; }
.timeline-item { position: relative; display: grid; grid-template-columns: 58px 16px 1fr; gap: 10px; min-height: 64px; }
.timeline-item:not(:last-child)::after { content: ""; position: absolute; left: 65px; top: 24px; bottom: -4px; width: 1px; background: var(--line); }
.timeline-time { color: var(--muted); font-size: 12px; }
.timeline-dot { z-index: 1; width: 10px; height: 10px; margin-top: 3px; border: 2px solid white; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px #e5d1b4; }
.timeline-content strong { display: block; font-size: 13px; }
.timeline-content span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }

.task-list { display: grid; gap: 2px; }
.task-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f0f2f1; }
.task-item:last-child { border: 0; }
.milestone-list { display: grid; gap: 8px; }
.milestone-item { width: 100%; display: grid; grid-template-columns: 58px minmax(0,1fr) 30px; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; text-align: left; }
.milestone-item.today { border-color: #d7ad70; background: #fff8ed; box-shadow: 0 0 0 2px rgba(198,151,82,.08); }
.milestone-date strong, .milestone-date small, .milestone-copy strong, .milestone-copy small { display: block; }
.milestone-date strong { color: var(--forest); font-family: Georgia,serif; font-size: 14px; }
.milestone-date small { margin-top: 3px; color: var(--gold); font-size: 9px; }
.milestone-copy { min-width: 0; }
.milestone-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.milestone-copy small { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.milestone-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--forest); background: var(--mint-2); font-size: 11px; font-weight: 700; }
.milestone-empty { padding: 22px 8px; text-align: center; font-size: 11px; }
.birthday-missing-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 10px 12px; border: 1px dashed #d3b47f; border-radius: 8px; color: #735c34; background: #fffaf1; font-size: 10px; }
.birthday-missing-list { display: grid; gap: 5px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.birthday-missing-list > strong { margin-bottom: 3px; color: #745c33; font-size: 11px; }
.birthday-missing-list button { display: flex; align-items: center; justify-content: space-between; padding: 7px 8px; border: 0; border-radius: 6px; color: var(--ink); background: #fffaf1; font-size: 11px; text-align: left; }
.birthday-missing-list button span { color: var(--gold); font-size: 10px; }
.customer-date-alert { margin-bottom: 10px; }
.customer-birthday-missing { margin: 0 0 12px; }
.customer-important-dates { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.task-check { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; border: 1px solid #b9c7c3; border-radius: 5px; background: white; }
.task-check.done { color: white; border-color: var(--forest); background: var(--forest); }
.task-copy { flex: 1; }
.task-copy strong { display: block; font-size: 13px; font-weight: 500; }
.task-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.priority { flex: 0 0 auto; padding: 3px 7px; border-radius: 20px; font-size: 10px; }
.priority.high { color: var(--danger); background: var(--danger-soft); }
.priority.medium { color: var(--warning); background: var(--warning-soft); }
.priority.low { color: var(--blue); background: var(--blue-soft); }

.progress-row { display: grid; grid-template-columns: 82px 1fr 36px; align-items: center; gap: 10px; margin: 13px 0; }
.progress-row span { color: var(--muted); font-size: 12px; }
.progress-track { height: 7px; overflow: hidden; border-radius: 99px; background: #edf0ee; }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--forest-2), #76a58f); }
.progress-row strong { text-align: right; font-size: 12px; }
#expense-category-summary .progress-row { grid-template-columns: 82px 1fr 82px; }
#expense-category-summary .progress-row strong { white-space: nowrap; }

.quote-line-list { display: grid; gap: 14px; }
.quote-line-card { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfa; }
.quote-line-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.quote-line-head strong { font-size: 13px; }
.quote-line-total { margin-left: auto; color: var(--forest); font-family: Georgia, serif; font-size: 16px; }
.quote-line-actions { display: flex; align-items: center; gap: 6px; }
.quote-add-product { width: 100%; min-height: 44px; margin-top: 11px; color: var(--forest); border: 1px dashed #8eafa4; border-radius: 10px; background: var(--mint-2); font-weight: 600; }
.quote-add-product:hover { border-style: solid; background: var(--mint); }
.quote-option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.quote-option { position: relative; display: block; cursor: pointer; }
.quote-option input { position: absolute; opacity: 0; pointer-events: none; }
.quote-option span { min-height: 52px; display: flex; flex-direction: column; justify-content: center; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: white; transition: .16s ease; }
.quote-option input:checked + span { border-color: #5c8a7c; background: var(--mint-2); box-shadow: inset 0 0 0 1px #5c8a7c; }
.quote-option strong, .quote-option small { display: block; }
.quote-option strong { font-size: 11px; }
.quote-option small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.quote-calculation { margin-top: 18px; overflow: hidden; border: 1px solid #c7d8d2; border-radius: 13px; background: var(--mint-2); }
.quote-calc-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px; border-bottom: 1px solid #d5e4df; }
.quote-calc-head span, .quote-grand-total small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.quote-grand-total { text-align: right; }
.quote-grand-total strong { display: block; margin-top: 2px; color: var(--forest); font-family: Georgia, serif; font-size: 24px; }
.quote-calc-rows { padding: 10px 15px 13px; }
.quote-calc-rows > div { display: flex; justify-content: space-between; gap: 15px; padding: 5px 0; font-size: 11px; }
.quote-calc-rows span { color: var(--muted); }
.quote-calc-rows .discount { color: var(--danger); }
.quote-service-wrap { margin-top: 16px; }

@media (max-width: 560px) {
  .quote-option-grid { grid-template-columns: 1fr; }
  .quote-calc-head { align-items: flex-start; }
  .modal-footer .primary-button { flex: 1; }
  .expense-receipt-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .expense-receipt-gallery { grid-template-columns: 1fr; }
}

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar-search { min-width: 250px; flex: 1; position: relative; }
.toolbar-search input, .filter-select {
  width: 100%; height: 39px; padding: 0 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; outline: none; background: white;
}
.toolbar-search input:focus, .filter-select:focus, .form-control:focus { border-color: #8cad9f; box-shadow: 0 0 0 3px rgba(79,126,112,.1); }
.filter-select { width: auto; min-width: 126px; }
.segmented { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.segmented button { padding: 6px 10px; color: var(--muted); border: 0; border-radius: 7px; background: transparent; font-size: 12px; }
.segmented button.active { color: var(--forest); background: var(--mint-2); font-weight: 600; }

.data-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th { padding: 12px 15px; color: var(--muted); border-bottom: 1px solid var(--line); background: #fafbf9; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .4px; }
.data-table td { padding: 14px 15px; border-bottom: 1px solid #eef0ef; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: #fbfcfa; }
.clickable-row { cursor: pointer; }
.customer-cell { display: flex; align-items: center; gap: 10px; }
.avatar { width: 35px; height: 35px; font-size: 13px; }
.avatar.green { background: linear-gradient(135deg, #477e70, #1f5047); }
.avatar.blue { background: linear-gradient(135deg, #668aa7, #3f627f); }
.avatar.rose { background: linear-gradient(135deg, #b87976, #86504e); }
.avatar.gold { background: linear-gradient(135deg, #c19a65, #8c6639); }
.customer-cell strong, .customer-cell span { display: block; }
.customer-cell span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.tag-list { display: flex; gap: 5px; }
.tag { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 99px; color: var(--forest-2); background: var(--mint-2); font-size: 10px; }
.referrer-name { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.referral-fields[hidden], .referral-controls input[hidden] { display: none; }
.referral-controls { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 10px; }
.customer-anniversary-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.customer-anniversary-head label, .customer-anniversary-head small { display: block; }
.customer-anniversary-head label { margin-bottom: 3px; }
.customer-anniversary-head small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.customer-anniversary-list { display: grid; gap: 10px; }
.customer-anniversary-row { display: grid; grid-template-columns: minmax(130px,.8fr) 150px minmax(180px,1fr) auto; align-items: end; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); }
.customer-anniversary-row .form-group { min-width: 0; }
.anniversary-remove-button { height: 40px; padding: 0 10px; border: 1px solid #e3c0bb; border-radius: 7px; color: var(--danger); background: #fff7f6; font-size: 11px; }
.anniversary-empty { padding: 15px; border: 1px dashed var(--line); border-radius: 8px; text-align: center; font-size: 11px; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 99px; font-size: 11px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.green { color: #34705e; background: #e6f3ed; }
.status.orange { color: #a56720; background: #fff0dc; }
.status.red { color: #a94946; background: #fbe9e7; }
.status.blue { color: #456c8b; background: #e8f0f6; }
.status.gray { color: #707b78; background: #edf0ef; }
.money { font-family: Georgia, serif; font-weight: 600; }
.muted { color: var(--muted); }
.table-action { padding: 5px 8px; color: var(--forest-2); border: 0; background: transparent; font-weight: 600; font-size: 12px; }
.receipt-count { min-width: 46px; min-height: 28px; padding: 0 9px; color: var(--blue); border: 1px solid #cbdce7; border-radius: 7px; background: var(--blue-soft); font-size: 11px; font-weight: 600; }
.receipt-supplement { color: var(--forest-2); border-color: #bcd2ca; background: #edf7f3; }

.expense-upload { position: relative; }
.expense-upload > input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.expense-upload-button { width: fit-content; min-height: 38px; display: inline-flex !important; align-items: center; padding: 0 13px; color: var(--forest-2) !important; border: 1px solid #d8b47a; border-radius: 8px; background: var(--gold-soft); cursor: pointer; font-weight: 600; }
.expense-receipt-preview { min-height: 76px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; padding: 10px; border: 1px dashed #d6d2ca; border-radius: 8px; background: var(--canvas); }
.expense-receipt-preview > .muted { grid-column: 1 / -1; align-self: center; text-align: center; }
.expense-receipt-preview figure, .expense-receipt-gallery figure { position: relative; min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.expense-receipt-preview img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; }
.expense-receipt-preview button { position: absolute; top: 5px; right: 5px; width: 25px; height: 25px; border: 0; border-radius: 50%; color: #fff; background: rgba(23,23,23,.72); font-size: 17px; line-height: 1; }
.expense-receipt-preview figcaption, .expense-receipt-gallery figcaption { overflow: hidden; padding: 7px 8px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.expense-detail-grid { margin-bottom: 20px; }
.expense-detail-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.expense-detail-section h3 { margin: 0 0 10px; font-size: 13px; }
.expense-detail-section p { margin: 5px 0; color: var(--muted); line-height: 1.6; }
.expense-detail-section p strong { color: var(--ink); }
.expense-receipt-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.expense-receipt-gallery img { width: 100%; max-height: 420px; display: block; object-fit: contain; background: #f4f3f1; }
.expense-review-field { margin-top: 20px; }
.expense-supplement-summary { margin-bottom: 14px; padding: 14px 15px; border: 1px solid #cbdcd5; border-radius: 8px; background: #f4faf7; }
.expense-supplement-summary strong, .expense-supplement-summary span { display: block; }
.expense-supplement-summary strong { font-size: 14px; }
.expense-supplement-summary span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.expense-supplement-upload { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.expense-supplement-history { display: grid; gap: 6px; margin-top: 18px; padding: 13px 14px; border-radius: 8px; background: var(--canvas); }
.expense-supplement-history strong { margin-bottom: 2px; font-size: 12px; }
.expense-supplement-history span { color: var(--muted); font-size: 10px; line-height: 1.45; }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(235px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kanban-column { min-height: 480px; padding: 11px; border: 1px solid var(--line); border-radius: 14px; background: #f0f2ef; }
.kanban-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 12px; }
.kanban-head strong { font-size: 13px; }
.kanban-count { min-width: 22px; padding: 3px 7px; text-align: center; border-radius: 99px; background: white; font-size: 11px; }
.kanban-list { display: grid; gap: 9px; }
.production-card { padding: 13px; border: 1px solid #e2e7e4; border-radius: 12px; background: white; box-shadow: 0 3px 10px rgba(38,58,53,.04); }
.production-card .card-top { display: flex; justify-content: space-between; gap: 10px; }
.production-card .order-no { color: var(--muted); font-size: 10px; }
.production-card h3 { margin: 8px 0 4px; font-size: 14px; }
.production-card p { margin: 0; color: var(--muted); font-size: 11px; }
.production-card .deadline { display: flex; justify-content: space-between; margin-top: 13px; padding-top: 11px; border-top: 1px solid #eef0ef; color: var(--muted); font-size: 11px; }
.production-card.overdue { border-color: #e5b9b5; }

.customer-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; }
.profile-hero { display: flex; align-items: center; gap: 15px; padding: 20px; }
.profile-avatar { width: 58px; height: 58px; display: grid; place-items: center; color: white; border-radius: 18px; background: linear-gradient(135deg, #467d6f, #193f39); font-size: 21px; }
.profile-main { flex: 1; }
.profile-main h2 { margin: 0 0 5px; font-size: 20px; }
.profile-main p { margin: 0; color: var(--muted); }
.profile-meta { display: flex; gap: 22px; margin-top: 13px; flex-wrap: wrap; }
.profile-meta div span, .profile-meta div strong { display: block; }
.profile-meta span { color: var(--muted); font-size: 10px; }
.profile-meta strong { margin-top: 3px; font-size: 13px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; padding: 0 18px; border-bottom: 1px solid var(--line); }
.tabs button { padding: 13px 12px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: transparent; white-space: nowrap; }
.tabs button.active { color: var(--forest); border-color: var(--forest); font-weight: 600; }
.tab-content { padding: 19px; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.info-item span, .info-item strong { display: block; }
.info-item span { color: var(--muted); font-size: 11px; }
.info-item strong { margin-top: 5px; font-size: 13px; }
.measurement-card { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.measurement-card[hidden] { display: none; }
.measurement-head { display: flex; justify-content: space-between; padding: 13px 15px; background: var(--mint-2); }
.measurement-head-tags { display: flex; align-items: flex-start; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.measurement-section-title { padding: 13px 15px 0; color: var(--ink); font-size: 12px; font-weight: 700; }
.measurement-values { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; padding: 15px; }
.measurement-value span, .measurement-value strong { display: block; }
.measurement-value span { color: var(--muted); font-size: 10px; }
.measurement-value strong { margin-top: 4px; font-family: Georgia, serif; font-size: 15px; }
.measurement-body-types { margin: 0 15px 15px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfa; }
.measurement-body-types > strong { display: block; margin-bottom: 10px; font-size: 12px; }
.measurement-body-types .tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.measurement-notes { margin: 0 15px 15px; }
.measurement-photo-missing { margin: 12px 15px 15px; padding: 12px 14px; border: 1px dashed #d7a760; border-radius: 8px; color: #7a5b2e; background: #fff9ef; font-size: 11px; line-height: 1.6; }
.measurement-photo-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 12px 15px 16px; }
.measurement-photo-strip button { min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; text-align: left; }
.measurement-photo-strip img { width: 100%; aspect-ratio: 3 / 4; display: block; object-fit: cover; background: #f2f4f3; }
.measurement-photo-strip span { display: block; padding: 8px 9px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.measurement-coverage-note { margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.measurement-customer-select-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
.measurement-add-customer-button { min-width: 104px; padding: 0 13px; border: 1px solid var(--forest); border-radius: 7px; color: var(--forest); background: #f7fbf9; font-size: 12px; font-weight: 700; white-space: nowrap; }
.measurement-inline-customer { grid-column: 1 / -1; padding: 15px; border: 1px solid #bdd2ca; border-radius: 8px; background: #f5faf8; box-shadow: inset 0 0 0 1px rgba(255,255,255,.7); }
.measurement-inline-customer[hidden] { display: none; }
.measurement-inline-customer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding-bottom: 11px; border-bottom: 1px solid #d7e4df; }
.measurement-inline-customer-head strong, .measurement-inline-customer-head span { display: block; }
.measurement-inline-customer-head strong { color: var(--forest); font-size: 13px; }
.measurement-inline-customer-head span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.measurement-inline-customer-head button { padding: 4px 8px; border: 0; color: var(--muted); background: transparent; font-size: 11px; }
.measurement-inline-customer-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.measurement-inline-customer-actions .primary-button { min-width: 180px; }
.garment-measurement-section { margin-top: 2px; padding: 15px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fbfcfb; }
.garment-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.garment-section-head strong, .garment-section-head span { display: block; }
.garment-section-head strong { font-size: 13px; }
.garment-section-head > div > span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.garment-section-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.garment-record-table { margin: 0; border-radius: 8px; }
.garment-record-table .data-table { min-width: 720px; }
.garment-record-table th, .garment-record-table td { padding: 10px 11px; }
.garment-exception-note { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--gold); color: #71572f; background: var(--gold-soft); font-size: 11px; line-height: 1.6; }
.garment-rule-note { margin-bottom: 16px; padding: 14px 15px; border: 1px solid #d8c5a1; border-radius: 8px; background: #fffaf1; }
.garment-rule-note > strong { color: #624a24; font-size: 13px; }
.garment-rule-note p { margin: 6px 0 0; color: #705d3d; font-size: 11px; line-height: 1.65; }
.garment-context-grid { margin-bottom: 18px; }
.garment-form-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 4px 0 12px; }
.garment-form-toolbar strong, .garment-form-toolbar span { display: block; }
.garment-form-toolbar strong { font-size: 13px; }
.garment-form-toolbar span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.garment-input-table { border-radius: 8px; }
.garment-input-table .data-table { min-width: 780px; }
.garment-input-table th, .garment-input-table td { padding: 10px; }
.garment-input-table td:first-child strong, .garment-input-table td:first-child small, .garment-input-table td:nth-child(5) strong, .garment-input-table td:nth-child(5) small { display: block; }
.garment-input-table td:first-child small, .garment-input-table td:nth-child(5) small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.garment-size-input { min-width: 105px; }
.garment-warning-row td { background: #fff8f6; }
.garment-warning-summary { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; padding: 12px 14px; border-radius: 8px; font-size: 11px; line-height: 1.55; }
.garment-warning-summary strong, .garment-warning-summary span { display: block; }
.garment-warning-summary.has-warning { color: #8e423d; background: #fbe9e7; }
.garment-warning-summary.is-ok { color: #2f6757; background: #e8f3ee; }
.garment-exception-field { margin-top: 14px; }
.modal:has(#garment-measurement-form) { width: min(940px, 100%); }
.measurement-form-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.measurement-form-heading h3 { margin-bottom: 3px; }
.measurement-form-heading p { margin: 0 0 10px; color: var(--muted); font-size: 11px; }
.measurement-required-note { margin-bottom: 14px; }
.measurement-photo-instructions { margin-bottom: 14px; padding: 15px; border: 1px solid #dfc89e; border-radius: 8px; background: #fffaf2; }
.measurement-photo-instructions > strong { font-size: 13px; }
.measurement-photo-instructions p { margin: 7px 0 12px; color: #705b38; font-size: 11px; line-height: 1.7; }
.measurement-photo-instructions label { display: flex; align-items: flex-start; gap: 9px; color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.5; }
.measurement-photo-instructions input { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; accent-color: var(--forest); }
.measurement-photo-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.measurement-photo-slot { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfa; }
.measurement-photo-slot > div:first-child { min-height: 48px; }
.measurement-photo-slot strong, .measurement-photo-slot span { display: block; }
.measurement-photo-slot strong { font-size: 12px; }
.measurement-photo-slot > div:first-child span { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.measurement-photo-actions { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 8px; margin: 12px 0; }
.measurement-photo-button, .measurement-photo-native, .measurement-photo-album { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border: 1px solid #e1d6c8; border-radius: 10px; color: #6c5a43; background: white; font-size: 11px; font-weight: 700; cursor: pointer; text-align: center; transition: .18s ease; }
.measurement-photo-button b, .measurement-photo-native b, .measurement-photo-album b { font-size: 17px; font-weight: 500; }
.measurement-photo-button { color: white; border-color: var(--forest); background: linear-gradient(135deg, #f09220, var(--forest-2)); box-shadow: 0 7px 16px rgba(201,101,0,.18); }
.measurement-photo-native:hover, .measurement-photo-album:hover { color: var(--forest-2); border-color: #d7ad74; background: #fffaf3; }
.measurement-photo-slot > input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.measurement-photo-preview { min-height: 120px; display: grid; place-items: center; border: 1px dashed #cfd8d5; border-radius: 7px; background: white; overflow: hidden; }
.measurement-photo-preview:has(figure) { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 7px; padding: 7px; }
.measurement-photo-preview figure { position: relative; min-width: 0; margin: 0; overflow: hidden; border-radius: 6px; background: #f1f3f2; }
.measurement-photo-preview img { width: 100%; aspect-ratio: 3 / 4; display: block; object-fit: cover; }
.measurement-photo-preview button { position: absolute; top: 5px; right: 5px; width: 27px; height: 27px; border: 0; border-radius: 50%; color: white; background: rgba(30,37,35,.78); font-size: 17px; line-height: 1; }
.measurement-photo-preview figcaption { padding: 6px; font-size: 10px; text-align: center; }
.measurement-photo-full { display: grid; place-items: center; min-height: 60vh; background: #f2f3f2; }
.measurement-photo-full img { width: 100%; max-height: 76vh; display: block; object-fit: contain; }

.camera-root { position: fixed; inset: 0; z-index: 120; width: 100dvw; height: 100dvh; display: none; overflow: hidden; overscroll-behavior: none; color: white; background: #050706; }
.camera-root.open { display: block; }
.measurement-camera { width: 100%; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; overflow: hidden; background: radial-gradient(circle at 50% 38%, #14211d, #050706 68%); }
.measurement-camera > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 16px 11px; border-bottom: 1px solid rgba(255,255,255,.08); background: rgba(9,20,17,.96); }
.measurement-camera > header strong, .measurement-camera > header span { display: block; }
.measurement-camera > header strong { margin-top: 3px; font-size: 17px; letter-spacing: .3px; }
.measurement-camera > header span { margin-top: 4px; color: #b9c9c3; font-size: 10px; line-height: 1.45; }
.measurement-camera > header .camera-step { margin: 0; color: #e8b565; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.measurement-camera > header button { flex: 0 0 auto; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; color: white; background: rgba(255,255,255,.1); font-size: 23px; }
.measurement-camera-stage { position: relative; min-height: 0; display: grid; place-items: center; overflow: hidden; padding: 8px; background: #000; }
.measurement-camera-viewport { position: relative; width: min(100%, calc((100dvh - 210px) * 3 / 4)); max-height: 100%; aspect-ratio: 3 / 4; overflow: hidden; border: 1px solid rgba(232,181,101,.45); border-radius: 5px; background: #020303; box-shadow: 0 0 0 1px rgba(0,0,0,.7), 0 16px 42px rgba(0,0,0,.38); }
.measurement-camera-viewport video { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }
.measurement-camera-placeholder { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; gap: 7px; padding: 28px; color: #d8e2de; background: radial-gradient(circle at center, #16241f, #060908 72%); text-align: center; }
.measurement-camera-placeholder[hidden] { display: none; }
.measurement-camera-placeholder span { font-size: 13px; font-weight: 700; }
.measurement-camera-placeholder small { color: #91a39d; font-size: 10px; }
.measurement-camera-grid { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(to right, transparent 33.18%, rgba(255,255,255,.58) 33.2%, rgba(255,255,255,.58) 33.5%, transparent 33.52%, transparent 66.48%, rgba(255,255,255,.58) 66.5%, rgba(255,255,255,.58) 66.8%, transparent 66.82%), linear-gradient(to bottom, transparent 33.18%, rgba(255,255,255,.58) 33.2%, rgba(255,255,255,.58) 33.5%, transparent 33.52%, transparent 66.48%, rgba(255,255,255,.58) 66.5%, rgba(255,255,255,.58) 66.8%, transparent 66.82%); text-shadow: 0 1px 4px #000; }
.measurement-camera-grid > i { position: absolute; width: 26px; height: 26px; border-color: #f2c97e; border-style: solid; filter: drop-shadow(0 1px 2px #000); }
.measurement-camera-grid > i:nth-child(1) { top: 7%; left: 7%; border-width: 2px 0 0 2px; }
.measurement-camera-grid > i:nth-child(2) { top: 7%; right: 7%; border-width: 2px 2px 0 0; }
.measurement-camera-grid > i:nth-child(3) { bottom: 6%; left: 7%; border-width: 0 0 2px 2px; }
.measurement-camera-grid > i:nth-child(4) { right: 7%; bottom: 6%; border-width: 0 2px 2px 0; }
.measurement-camera-body-guide { position: absolute; top: 8%; bottom: 7%; left: 50%; width: 55%; transform: translateX(-50%); border: 1px dashed rgba(242,211,137,.88); border-radius: 46% 46% 34% 34% / 13% 13% 9% 9%; }
.measurement-camera[data-view="side"] .measurement-camera-body-guide { width: 36%; }
.measurement-camera[data-view="extra"] .measurement-camera-body-guide { width: 62%; border-radius: 22px; }
.measurement-camera-body-guide b { position: absolute; top: -1px; bottom: -1px; left: 50%; border-left: 1px dashed rgba(242,211,137,.72); }
.measurement-camera-body-guide span { position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); padding: 4px 8px; border-radius: 12px; background: rgba(0,0,0,.62); color: #ffe6aa; font-size: 9px; white-space: nowrap; }
.measurement-camera-grid > em { position: absolute; left: 50%; transform: translateX(-50%); padding: 4px 8px; border-radius: 12px; background: rgba(0,0,0,.62); color: white; font-size: 9px; font-style: normal; white-space: nowrap; }
.camera-top-tip { top: 1.5%; }
.camera-bottom-tip { bottom: 1.2%; }
.measurement-camera-feedback { background: rgba(9,20,17,.98); }
#measurement-camera-status { min-height: 34px; margin: 0; padding: 8px 14px; color: #c8d5d1; font-size: 10px; line-height: 1.45; text-align: center; }
#measurement-camera-status.error { color: #ffd0c7; }
.measurement-camera-fallback { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 12px 10px; }
.measurement-camera-fallback[hidden] { display: none; }
.measurement-camera-fallback button { min-height: 38px; border: 1px solid rgba(232,181,101,.42); border-radius: 10px; color: #ffe1ad; background: rgba(232,181,101,.09); font-size: 11px; font-weight: 700; }
.measurement-camera-fallback .camera-retry { grid-column: 1 / -1; }
.measurement-camera > footer { display: grid; grid-template-columns: 1fr 1fr 1.3fr; align-items: center; gap: 9px; padding: 10px 12px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.08); background: rgba(9,20,17,.98); }
.camera-secondary { min-height: 42px; padding: 8px; border: 1px solid rgba(255,255,255,.18); border-radius: 11px; color: white; background: rgba(255,255,255,.07); font-size: 10px; }
.camera-secondary:disabled { opacity: .38; cursor: not-allowed; }
.camera-shutter { min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 30px; color: #102f2a; background: white; font-size: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.24); }
.camera-shutter span { width: 34px; height: 34px; border: 4px solid #173f39; border-radius: 50%; background: #e7a844; box-shadow: inset 0 0 0 3px white; }
.camera-shutter:disabled { opacity: .4; cursor: not-allowed; }
.modal:has(#measurement-form) { width: min(820px, 100%); }
.note { padding: 12px 14px; border-left: 3px solid var(--gold); border-radius: 0 9px 9px 0; color: #6e5a3d; background: var(--gold-soft); font-size: 12px; line-height: 1.6; }

.empty-state { display: grid; place-items: center; min-height: 260px; padding: 30px; text-align: center; }
.empty-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 17px; color: var(--forest); background: var(--mint-2); font-size: 24px; }
.empty-state h3 { margin: 14px 0 6px; }
.empty-state p { max-width: 360px; margin: 0 0 16px; color: var(--muted); line-height: 1.6; }

.chart { height: 220px; display: flex; align-items: flex-end; gap: 12px; padding-top: 24px; }
.bar-group { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; }
.bar { width: min(32px, 70%); min-height: 5px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, #4f8577, #1d5148); transition: height .4s ease; }
.bar-group span { color: var(--muted); font-size: 10px; }
.donut-wrap { display: flex; align-items: center; gap: 28px; min-height: 200px; }
.donut { width: 145px; height: 145px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--forest-2) 0 44%, #c5a26d 44% 70%, #668aa7 70% 87%, #d8dedb 87% 100%); }
.donut::after { content: "¥86.4万"; width: 88px; height: 88px; display: grid; place-items: center; border-radius: 50%; background: white; font-family: Georgia, serif; font-weight: 600; }
.legend { display: grid; gap: 11px; }
.legend div { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; }

.modal-root { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.modal-root.open { pointer-events: auto; }
.modal {
  position: absolute; top: 0; right: 0; width: min(620px, 100%); height: 100%; overflow-y: auto;
  transform: translateX(105%); background: white; box-shadow: -14px 0 50px rgba(20,40,35,.18); transition: transform .28s ease;
}
.modal { display: flex; flex-direction: column; overflow: hidden; }
.modal-root.open .modal { transform: translateX(0); }
.modal-header { position: relative; flex: 0 0 auto; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 24px 17px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.modal-header h2 { margin: 0; font-size: 20px; }
.modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.close-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; font-size: 17px; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px 24px 30px; }
.modal-footer { position: relative; flex: 0 0 auto; z-index: 3; width: 100%; display: flex; justify-content: flex-end; gap: 9px; padding: 14px 24px; border-top: 1px solid var(--line); background: white; box-shadow: 0 -8px 24px rgba(30,53,47,.06); }
.form-section { margin-bottom: 24px; }
.form-section h3 { margin: 0 0 13px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { display: block; margin-bottom: 6px; color: #4d5956; font-size: 12px; }
.field-hint { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.required::after { content: " *"; color: var(--danger); }
.form-control { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: white; }
textarea.form-control { min-height: 82px; resize: vertical; }
.nav-scrim, .scrim { position: fixed; inset: 0; opacity: 0; visibility: hidden; background: rgba(12,27,23,.42); transition: .25s ease; }
.nav-scrim { z-index: 40; }
.scrim { z-index: 50; }
.nav-scrim.show,
.scrim.show { opacity: 1; visibility: visible; }

.quick-menu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick-option { padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: white; text-align: left; transition: .18s ease; }
.quick-option:hover { border-color: #9ab7ad; background: var(--mint-2); transform: translateY(-2px); }
.quick-option i { width: 35px; height: 35px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 10px; color: var(--forest); background: var(--mint); font-style: normal; }
.quick-option strong, .quick-option span { display: block; }
.quick-option span { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.toast-container { position: fixed; z-index: 80; right: 22px; bottom: 22px; display: grid; gap: 9px; }
.toast { min-width: 260px; padding: 13px 15px; color: white; border-radius: 11px; background: #183e38; box-shadow: var(--shadow); animation: toast-in .25s ease; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

.login-screen {
  min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .9fr) minmax(440px, 1.1fr);
  background: #f5f6f3;
}
.login-brand {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 100vh; padding: 54px; color: white;
  background: radial-gradient(circle at 20% 10%, rgba(203,178,130,.24), transparent 28%), linear-gradient(145deg, #245d53, #102f2a 76%);
}
.login-brand::after { content: ""; position: absolute; width: 480px; height: 480px; right: -210px; bottom: -220px; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.018); }
.login-logo { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.login-logo .brand-logo-shell { width: 58px; height: 58px; }
.login-logo strong { display: block; font-size: 21px; letter-spacing: 2px; }
.login-logo span { display: block; margin-top: 4px; color: #b9d0c9; font-size: 11px; }
.login-copy { position: relative; z-index: 1; max-width: 520px; }
.login-copy .eyebrow { color: #d8b47a; font-size: 11px; letter-spacing: 2px; }
.login-copy h1 { margin: 16px 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(34px, 4.4vw, 58px); font-weight: 500; line-height: 1.17; }
.login-copy p { max-width: 440px; color: #bed0cb; font-size: 14px; line-height: 1.9; }
.login-features { position: relative; z-index: 1; display: flex; gap: 20px; color: #aec5be; font-size: 11px; flex-wrap: wrap; }
.login-features span::before { content: "✓"; margin-right: 6px; color: #d8b47a; }
.login-form-side { display: grid; place-items: center; padding: 40px; }
.login-card { width: min(410px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow); }
.login-card h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 25px; }
.login-card > p { margin: 8px 0 25px; color: var(--muted); }
.login-card .form-group { margin-bottom: 16px; }
.login-card .form-control { min-height: 46px; }
.login-card .primary-button { width: 100%; min-height: 45px; margin-top: 4px; }
.login-hint { margin-top: 18px; padding: 11px 12px; border-radius: 9px; color: #6e5a3d; background: var(--gold-soft); font-size: 11px; line-height: 1.6; }
.login-error { margin-bottom: 14px; padding: 10px 12px; border-radius: 9px; color: var(--danger); background: var(--danger-soft); font-size: 12px; }
.settings-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; }
.audit-detail { max-width: 300px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.pricing-rule-note { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.pricing-rule-note span { margin-left: auto; color: var(--muted); font-size: 11px; }
.pricing-grid { display: grid; gap: 18px; }
.pricing-panel { overflow: hidden; }
.pricing-table-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.pricing-input { width: 125px; min-height: 36px; }
.pricing-service-name { min-width: 210px; }
.pricing-category-name { min-width: 150px; }

.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.permission-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); cursor: pointer; }
.permission-option:has(input:checked) { border-color: rgba(15, 78, 66, .38); background: rgba(15, 78, 66, .07); }
.permission-option input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--forest); flex: 0 0 auto; }
.permission-option span { display: grid; gap: 3px; }
.permission-option strong { font-size: 13px; color: var(--ink); }
.permission-option small { font-size: 10px; line-height: 1.45; color: var(--muted); }
.permission-cell { min-width: 240px; white-space: normal !important; line-height: 1.9; }
.permission-summary { margin-top: 18px; padding: 14px; border-radius: 8px; background: var(--canvas); }
.permission-summary > span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 9px; }
.permission-summary div { display: flex; flex-wrap: wrap; gap: 7px; }
.permission-summary em { font-style: normal; font-size: 11px; padding: 5px 9px; border-radius: 999px; background: var(--gold-soft); color: var(--forest-2); }
.single-settings { grid-template-columns: minmax(0, 720px); }

@media (max-width: 640px) {
  .permission-grid { grid-template-columns: 1fr; }
}
.pricing-service-type { min-width: 160px; }
.danger-text { color: var(--danger); }
.pricing-save-bar { position: sticky; z-index: 8; bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 14px 16px; border: 1px solid #cfdcd7; border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: 0 10px 32px rgba(27,56,48,.12); backdrop-filter: blur(12px); }
.pricing-save-bar strong, .pricing-save-bar span { display: block; }
.pricing-save-bar span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.quote-service-section { margin-bottom: 12px; padding-top: 4px; }

@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .customer-layout { grid-template-columns: 1fr; }
  .customer-layout > aside { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .measurement-values { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1380px) {
  .topbar-title { display: none; }
}

@media (max-width: 1180px) {
  .workspace-tabs { display: none; }
  .global-search { max-width: none; }
}

@media (max-width: 760px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { min-height: 250px; padding: 30px 24px; }
  .login-copy h1 { margin: 12px 0 8px; font-size: 31px; }
  .login-copy p { margin-bottom: 0; }
  .login-features { display: none; }
  .login-form-side { padding: 24px 16px 40px; }
  .login-card { padding: 25px 21px; }
  .sidebar { transform: translateX(-100%); width: 245px; }
  .sidebar.open { z-index: 70; transform: translateX(0); }
  .main-shell { width: 100%; margin-left: 0; }
  .mobile-menu { display: block; }
  .topbar { height: 64px; padding: 0 12px; gap: 9px; }
  .global-search { width: auto; min-width: 0; height: 40px; flex: 1; padding-left: 10px; }
  .global-search kbd { display: none; }
  .top-actions .notification-button { display: none; }
  .sync-status { display: none; }
  .primary-button { padding: 0 11px; }
  .top-actions .primary-button { font-size: 0; }
  .top-actions .primary-button span { font-size: 20px; }
  .content { padding: 21px 15px 40px; }
  .page-header { align-items: stretch; flex-direction: column; gap: 14px; }
  .page-title h1 { font-size: 23px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 112px; padding: 15px; }
  .metric-value { font-size: 25px; }
  .toolbar { align-items: stretch; }
  .toolbar-search { min-width: 100%; }
  .filter-select { flex: 1; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .customer-layout > aside { display: grid; grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: auto; }
  .referral-controls { grid-template-columns: 1fr; }
  .customer-anniversary-head { align-items: stretch; flex-direction: column; }
  .customer-anniversary-head .secondary-button { width: 100%; }
  .customer-anniversary-row { grid-template-columns: 1fr; align-items: stretch; }
  .anniversary-remove-button { width: 100%; }
  .quick-menu { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .expense-receipt-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .expense-receipt-gallery { grid-template-columns: 1fr; }
  .measurement-photo-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .measurement-photo-slots { grid-template-columns: 1fr; }
  .measurement-photo-slot > div:first-child { min-height: 0; }
  .measurement-customer-select-row { grid-template-columns: 1fr; }
  .measurement-add-customer-button { min-height: 40px; }
  .measurement-inline-customer { padding: 13px; }
  .measurement-inline-customer-actions .primary-button { width: 100%; }
  .garment-section-head, .garment-form-toolbar { align-items: stretch; flex-direction: column; }
  .garment-section-actions { justify-content: flex-start; }
  .garment-form-toolbar .secondary-button { width: 100%; }
  .modal-footer { flex-wrap: wrap; }
  .pricing-save-bar { bottom: 8px; align-items: stretch; flex-direction: column; }
  .pricing-save-bar .primary-button { width: 100%; }
}

@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
  .profile-hero { align-items: flex-start; flex-wrap: wrap; }
  .profile-meta { gap: 15px; }
  .measurement-values { grid-template-columns: repeat(2, 1fr); }
  .measurement-head { align-items: flex-start; gap: 10px; }
  .measurement-photo-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .donut-wrap { flex-direction: column; }
}

/* 全系统视觉升级 */
:root {
  --ink: #201d19;
  --muted: #79736b;
  --line: #e8e0d6;
  --paper: #fffefc;
  --canvas: #f5f2ed;
  --forest: #d67912;
  --forest-2: #b85e05;
  --mint: #fff0dc;
  --mint-2: #fff8ef;
  --gold: #c99749;
  --gold-soft: #fff4df;
  --shadow: 0 18px 46px rgba(54, 43, 29, .09);
  --shadow-soft: 0 8px 24px rgba(54, 43, 29, .06);
  --radius: 17px;
}

html { background: #f5f2ed; }
body {
  min-width: 320px;
  background:
    radial-gradient(circle at 88% 2%, rgba(218,168,91,.11), transparent 24%),
    radial-gradient(circle at 16% 92%, rgba(36,91,80,.07), transparent 26%),
    var(--canvas);
  -webkit-font-smoothing: antialiased;
}
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(214,121,18,.2); outline-offset: 2px; }
::selection { color: #fff; background: #c9781d; }

.sidebar {
  border-right: 1px solid rgba(255,255,255,.06);
  background:
    radial-gradient(circle at 10% -5%, rgba(224,181,111,.23), transparent 27%),
    radial-gradient(circle at 100% 85%, rgba(73,132,116,.18), transparent 34%),
    linear-gradient(180deg, #18473f 0%, #102f2a 58%, #0b2622 100%);
  box-shadow: 12px 0 34px rgba(17,48,42,.12);
}
.brand { margin: -4px 0 13px; padding: 4px 8px 21px; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand-logo-shell { box-shadow: 0 9px 26px rgba(0,0,0,.24), 0 0 0 4px rgba(255,255,255,.055); }
.brand strong { font-family: Georgia, "Songti SC", serif; font-size: 19px; }
.nav { overflow-y: auto; padding-right: 2px; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { min-height: 45px; border: 1px solid transparent; border-radius: 12px; }
.nav a:hover { border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.065); }
.nav a.active { border-color: rgba(224,181,111,.18); background: linear-gradient(90deg, rgba(224,181,111,.21), rgba(255,255,255,.08)); box-shadow: inset 3px 0 #e0b56f, 0 8px 20px rgba(0,0,0,.08); }
.nav-icon { border-color: rgba(255,255,255,.19); background: rgba(255,255,255,.045); }
.sidebar-footer { margin-top: 14px; padding-top: 16px; }

.topbar {
  height: 72px;
  border-bottom-color: rgba(226,217,205,.9);
  background: rgba(255,254,252,.9);
  box-shadow: 0 8px 30px rgba(57,45,31,.055);
}
.mobile-menu { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; color: #17463e; background: #fff; }
.global-search { border-radius: 13px; background: #f8f5f0; }
.global-search:focus-within { border-color: #d7a65f; box-shadow: 0 0 0 4px rgba(214,121,18,.09); }
.workspace-tabs, .sync-status, .top-actions .icon-button { border-radius: 11px; }
.workspace-tabs a { border-radius: 8px; }
.workspace-tabs a.active { background: linear-gradient(135deg, #e18a21, #bd6307); }

.content { width: 100%; max-width: 1720px; margin: 0 auto; padding: 30px 32px 60px; }
.dashboard-grid > *, .settings-grid > *, .customer-layout > *, .stack > *, .panel, .toolbar, .data-table-wrap { min-width: 0; }
.data-table-wrap, .toolbar { max-width: 100%; }
.page-header {
  position: relative;
  overflow: hidden;
  align-items: center;
  min-height: 104px;
  padding: 22px 24px;
  border: 1px solid rgba(226,216,203,.95);
  border-radius: 20px;
  background: linear-gradient(120deg, rgba(255,255,255,.98), rgba(255,249,239,.92));
  box-shadow: var(--shadow-soft);
}
.page-header::after { content: ""; position: absolute; width: 190px; height: 190px; right: -70px; top: -112px; border: 1px solid rgba(201,151,73,.18); border-radius: 50%; box-shadow: 0 0 0 26px rgba(201,151,73,.04), 0 0 0 52px rgba(201,151,73,.025); pointer-events: none; }
.page-title, .page-actions { position: relative; z-index: 1; }
.page-title h1 { color: #25211d; font-size: 28px; font-weight: 650; letter-spacing: .8px; }
.page-title p { max-width: 760px; margin-top: 8px; line-height: 1.65; }
.page-actions { justify-content: flex-end; }

.primary-button, .secondary-button, .ghost-button, .danger-button { min-height: 41px; border-radius: 12px; }
.primary-button { border-color: #cb6e0b; background: linear-gradient(135deg, #e99125, #bd5f04); box-shadow: 0 8px 19px rgba(190,96,5,.2); }
.primary-button:hover { background: linear-gradient(135deg, #d97e15, #a95002); box-shadow: 0 11px 22px rgba(190,96,5,.24); }
.secondary-button { color: #7b531d; border-color: #ddc7a6; background: #fffdfa; box-shadow: 0 4px 12px rgba(71,51,28,.04); }
.secondary-button:hover { color: #b15b04; border-color: #d6a65e; background: #fff8ed; }
.ghost-button { background: #faf8f4; }
.icon-button { transition: transform .18s ease, background .18s ease; }
.icon-button:hover { transform: translateY(-1px); }

.metric-grid { gap: 17px; margin-bottom: 20px; }
.metric-card {
  min-height: 136px;
  padding: 20px;
  border-color: rgba(229,219,206,.95);
  background: linear-gradient(145deg, #fff, #fffcf7);
  box-shadow: var(--shadow-soft);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.metric-card:hover { transform: translateY(-3px); border-color: #ddc49e; box-shadow: 0 17px 34px rgba(62,47,28,.1); }
.metric-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(180deg, #e3a144, #c66b0c); }
.metric-card::after { width: 90px; height: 90px; right: -31px; bottom: -35px; background: radial-gradient(circle, rgba(224,166,81,.15), rgba(224,166,81,.035)); }
.metric-label i { color: #b86309; background: #fff0dc; }
.metric-value { color: #25201b; }

.panel, .data-table-wrap, .measurement-card, .pricing-panel, .quote-line-card, .quote-calculation, .quick-option, .profile-card, .garment-measurement-section {
  border-color: rgba(229,219,206,.95);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}
.panel { overflow: hidden; }
.panel-header { padding: 18px 20px; background: linear-gradient(180deg, #fff, #fffdf9); }
.panel-header h2 { color: #29241e; font-size: 16px; }
.panel-body { padding: 19px 20px; }
.panel-link { color: #b75d05; }
.measurement-card { border-radius: 18px; }
.quote-line-card { border-radius: 15px; background: linear-gradient(145deg, #fff, #fffcf7); }
.quote-calculation { border-color: #dfc59f; background: linear-gradient(135deg, #fff9ef, #fff4df); }

.toolbar {
  margin-bottom: 16px;
  padding: 13px;
  border: 1px solid rgba(229,219,206,.95);
  border-radius: 16px;
  background: rgba(255,254,252,.9);
  box-shadow: 0 6px 18px rgba(57,44,29,.045);
}
.toolbar-search input, .filter-select { height: 42px; border-radius: 11px; background: #fff; }
.toolbar-search input:focus, .filter-select:focus, .form-control:focus { border-color: #d5a157; box-shadow: 0 0 0 4px rgba(214,121,18,.085); }
.segmented { border-radius: 12px; background: #faf7f2; }
.segmented button.active { color: #a65303; background: #fff0dc; }

.data-table-wrap { border-radius: 17px; -webkit-overflow-scrolling: touch; }
.data-table th { height: 44px; padding: 12px 16px; color: #6f675e; background: linear-gradient(180deg, #fbf9f6, #f6f2ec); font-size: 10px; text-transform: none; }
.data-table td { padding: 15px 16px; border-bottom-color: #f0ebe4; }
.data-table tbody tr:nth-child(even) { background: rgba(249,246,241,.42); }
.data-table tbody tr:hover { background: #fff7ea; }
.table-action { border-radius: 8px; }
.tag { padding: 4px 9px; color: #9f5609; background: #fff0dc; }
.status { padding: 5px 10px; font-weight: 600; }

.modal { border-left: 1px solid rgba(224,214,201,.9); border-radius: 22px 0 0 22px; box-shadow: -22px 0 70px rgba(26,35,31,.22); }
.modal-header { padding: 23px 25px 18px; background: linear-gradient(130deg, rgba(255,255,255,.98), rgba(255,248,237,.96)); }
.modal-header h2 { color: #28221c; font-family: Georgia, "Songti SC", serif; font-size: 21px; }
.modal-body { padding: 23px 25px 32px; background: #fffefc; }
.modal-footer { padding: 15px 25px; background: rgba(255,254,252,.98); }
.close-button { border-radius: 11px; box-shadow: 0 4px 12px rgba(54,42,27,.055); }
.form-section { margin-bottom: 20px; padding: 17px; border: 1px solid #ede5db; border-radius: 15px; background: linear-gradient(145deg, #fff, #fdfaf6); }
.form-section h3 { margin-bottom: 15px; padding-bottom: 10px; color: #3a3128; border-bottom-color: #eee5d9; font-size: 14px; }
.form-group label { color: #5f564d; font-weight: 600; }
.form-control { min-height: 43px; border-color: #dfd7cc; border-radius: 11px; background: #fff; transition: border .18s ease, box-shadow .18s ease, background .18s ease; }
.form-control:hover { border-color: #d1c3b2; }
textarea.form-control { min-height: 94px; }
.field-hint { margin-top: 7px; }
.note { border-left-color: #d18a2d; border-radius: 0 11px 11px 0; background: #fff6e7; }

.measurement-photo-slot { border-color: #e8ddcf; border-radius: 13px; background: linear-gradient(145deg, #fff, #fcf8f2); }
.measurement-photo-preview { border-color: #dacdbd; border-radius: 10px; background: #fffdf9; }
.measurement-photo-instructions { border-radius: 13px; }
.permission-option { border-radius: 12px; background: #faf7f2; }
.permission-option:has(input:checked) { border-color: #d29a4d; background: #fff3df; }
.pricing-save-bar { border-color: #dfc9a8; border-radius: 16px; background: rgba(255,254,252,.96); }
.quick-option { border-radius: 16px; }
.quick-option:hover { border-color: #d4ad70; background: #fff8ed; }
.quick-option i { color: #a95a09; background: #fff0dc; }
.empty-state { border: 1px dashed #dacbb8; border-radius: 18px; background: rgba(255,254,252,.64); }
.empty-icon { color: #b86309; background: #fff0dc; }
.toast { border: 1px solid rgba(255,255,255,.12); border-radius: 13px; background: linear-gradient(135deg, #1e5047, #153a34); }

.customer-import-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.customer-import-actions > input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.customer-import-actions label.primary-button { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.customer-import-text { min-height: 170px; margin-bottom: 12px; font-family: Consolas, "Microsoft YaHei", monospace; font-size: 12px; line-height: 1.65; }
.customer-import-parse { width: 100%; }
.customer-import-summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin: 0 0 14px; }
.customer-import-summary span { padding: 13px; border: 1px solid #e6dbcd; border-radius: 12px; color: var(--muted); background: #fffaf3; text-align: center; font-size: 11px; }
.customer-import-summary strong { display: block; margin-bottom: 4px; color: #9f5609; font-family: Georgia, serif; font-size: 22px; }
.customer-import-table { max-height: 430px; overflow: auto; }
.customer-import-table .data-table th { position: sticky; top: 0; z-index: 1; }
.customer-import-table td:last-child { min-width: 170px; white-space: normal; }
.customer-import-table .status { line-height: 1.45; }
.customer-import-empty { min-height: 150px; display: grid; place-content: center; gap: 7px; padding: 24px; border: 1px dashed #d7c7b3; border-radius: 15px; color: var(--muted); background: #fffdf9; text-align: center; }
.customer-import-empty strong { color: var(--ink); font-size: 14px; }
.primary-button:disabled, .secondary-button:disabled, .ghost-button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.login-screen { background: radial-gradient(circle at 84% 10%, rgba(218,168,91,.13), transparent 26%), #f4f1ec; }
.login-brand { background: radial-gradient(circle at 20% 10%, rgba(218,179,109,.28), transparent 28%), linear-gradient(145deg, #245d53, #0d2b27 78%); }
.login-card { border-color: #e4d9ca; border-radius: 24px; box-shadow: 0 24px 64px rgba(55,42,27,.13); }

@media (max-width: 760px) {
  .topbar { height: 62px; background: rgba(255,254,252,.95); }
  .content { padding: 17px 13px 38px; }
  .page-header { min-height: 0; margin-bottom: 16px; padding: 18px 16px; border-radius: 17px; }
  .page-header::after { width: 130px; height: 130px; right: -60px; top: -78px; }
  .page-title h1 { font-size: 22px; }
  .page-title p { font-size: 12px; }
  .page-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); width: 100%; }
  .page-actions > * { width: 100%; }
  .toolbar { padding: 11px; border-radius: 14px; }
  .metric-card { min-height: 116px; border-radius: 15px; }
  .metric-value { margin-top: 11px; }
  .panel, .data-table-wrap, .measurement-card { border-radius: 15px; }
  .modal { border-radius: 0; }
  .modal-header { padding: 18px 17px 14px; }
  .modal-body { padding: 17px 15px 26px; }
  .modal-footer { padding: 12px 15px max(12px, env(safe-area-inset-bottom)); }
  .form-section { padding: 14px 12px; border-radius: 13px; }
  .measurement-photo-actions { grid-template-columns: 1fr 1fr; }
  .measurement-photo-button { grid-column: 1 / -1; }
  .measurement-photo-native, .measurement-photo-album { min-height: 44px; }
  .customer-import-actions { display: grid; grid-template-columns: 1fr; }
  .customer-import-actions > * { width: 100%; }
  .customer-import-summary { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .page-actions { grid-template-columns: 1fr; }
  .toolbar .filter-select { width: 100%; }
  .metric-grid { gap: 11px; }
  .metric-card { padding: 17px; }
  .measurement-camera > header strong { font-size: 15px; }
  .measurement-camera > header span { font-size: 9px; }
}
