:root {
  --brand: #c45a11;
  --brand-dark: #8f3f0a;
  --border: #333;
  --muted: #666;
  --bg: #f3f4f6;
  --paper: #fff;
  --header-bg: #ececec;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
  background: var(--bg);
  color: #111;
  line-height: 1.4;
}

.legal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  padding: 18px 24px 28px;
  color: #766e69;
  font-size: 14px;
}

.legal-footer a {
  color: #9a4b1b;
  text-decoration: none;
}

.legal-footer a:hover,
.legal-footer a:focus-visible {
  text-decoration: underline;
}

body.mode-frontend {
  background:
    linear-gradient(180deg, #fff7ed 0, #fffaf5 180px, #f7f2ec 100%);
}

body.mode-admin {
  background: var(--bg);
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
}

.view.hidden {
  display: none;
}

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

.list-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

body.mode-frontend .list-header {
  margin: 0 0 22px;
  padding: 18px 20px;
  border: 1px solid #fed7aa;
  border-left: 6px solid var(--brand);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 24px rgba(196, 90, 17, 0.08);
}

body.mode-frontend .list-title {
  color: #9a3412;
}

body.mode-frontend .list-subtitle {
  color: #7c2d12;
}

.list-title {
  margin: 0 0 6px;
  font-size: 28px;
  color: var(--brand);
}

.list-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.auth-card {
  max-width: 420px;
  margin: 64px auto;
  background: var(--paper);
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

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

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
}

.auth-tab {
  border: 1px solid #ddd;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 9px 12px;
  cursor: pointer;
  font: inherit;
}

.auth-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}

.auth-form input,
.auth-form select {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px 12px;
}

.status-message {
  margin: 0;
  color: #b91c1c;
  font-size: 13px;
}

.status-message.success {
  color: #047857;
}

.auth-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.auth-oauth-description {
  margin: 10px 0 18px;
  color: #666;
  line-height: 1.7;
}

.setup-warning {
  margin: 18px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13px;
}

.connection-diagnostic {
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  color: #4b5563;
  font-size: 13px;
}

.connection-diagnostic.is-success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.connection-diagnostic.is-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.connection-diagnostic.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.connection-diagnostic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.connection-diagnostic p {
  margin: 7px 0 0;
  line-height: 1.5;
}

.connection-diagnostic-code {
  font-size: 12px;
  opacity: 0.8;
}

.connection-diagnostic-retry {
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  padding: 5px 10px;
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}

.connection-diagnostic-retry:disabled {
  cursor: wait;
  opacity: 0.6;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 13px;
  color: var(--muted);
}

.btn-create-form {
  background: var(--brand);
  color: #fff;
  border: 2px solid var(--brand);
  width: 100%;
  padding: 16px;
  font-weight: 700;
  font-size: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(196, 90, 17, 0.25);
}

.btn-create-form:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.form-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-hint {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
  background: var(--paper);
  border: 1px dashed #ccc;
  border-radius: 8px;
  margin: 0;
}

.form-card {
  background: var(--paper);
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
}

.form-card-title-wrap {
  display: block;
  margin-bottom: 8px;
}

.form-card-title-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.form-card-title,
.external-form-card-title {
  width: 100%;
  font-size: 18px;
  font-weight: 700;
  border: 1px solid #ccc !important;
  border-radius: 6px;
  padding: 8px 12px !important;
  background: #fff !important;
  color: var(--brand-dark);
}

.form-card-meta {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.form-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.form-card-actions .btn-primary {
  flex: 1;
  min-width: 120px;
}

.external-create-panel {
  background: var(--paper);
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 18px;
}

.external-create-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.external-create-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.external-create-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--brand-dark);
  font-weight: 700;
}

.external-create-fields input {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  color: #111;
}

.external-create-form .btn-primary {
  align-self: flex-start;
  min-width: 140px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.btn-back {
  background: #e5e7eb;
  color: #111;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-back:hover {
  background: #d1d5db;
}

.form-title-wrap {
  flex: 1;
  min-width: 160px;
}

.form-title-input {
  width: 100%;
  font-size: 16px;
  font-weight: 700;
  border: 1px solid #ccc !important;
  border-radius: 6px;
  padding: 8px 12px !important;
  background: #fff !important;
  color: var(--brand-dark);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--paper);
  border: 1px solid #ddd;
  border-radius: 8px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.toolbar-title {
  font-weight: 700;
  color: var(--brand-dark);
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.save-status,
.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.save-status {
  background: #f3f4f6;
  color: var(--muted);
}

.save-status.error {
  background: #fee2e2;
  color: #b91c1c;
}

.status-badge {
  background: #ecfdf5;
  color: #047857;
  font-weight: 700;
}

.status-badge.locked,
.status-badge.admin_only,
.status-badge.frozen,
.status-badge.archived {
  background: #fee2e2;
  color: #b91c1c;
}

.btn {
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-secondary {
  background: #e5e7eb;
  color: #111;
}

.btn-secondary:hover {
  background: #d1d5db;
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-danger:hover {
  background: #fecaca;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-add {
  background: #fff;
  color: var(--brand-dark);
  border: 2px dashed var(--brand);
  width: 100%;
  padding: 14px 16px;
  font-weight: 700;
}

.btn-add:hover:not(:disabled) {
  background: #fff7f0;
}

.btn-add:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form-sheet {
  background: var(--paper);
  border: 1px solid var(--border);
  padding: 20px;
}

.sheet-header {
  display: grid;
  grid-template-columns: 160px 1fr 280px;
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}

.brand-title {
  margin: 0;
  font-size: 42px;
  color: var(--brand);
  letter-spacing: 0.08em;
}

.brand-subtitle {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.meta-block,
.customer-block {
  border: 1px solid var(--border);
  padding: 12px;
}

.customer-block {
  background: var(--header-bg);
}

.customer-title {
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.field-inline,
.field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.field-inline span:first-child,
.field-row span:first-child {
  min-width: 72px;
  white-space: nowrap;
}

.door-count-notice {
  margin: 4px 0 0 80px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.door-count-notice.hidden {
  display: none;
}

.door-count-notice.ok {
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.door-count-notice.warning,
.door-count-notice.mismatch {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fdba74;
}

.field-grow {
  flex: 1;
  min-width: 120px;
}

input[type="text"],
input[type="tel"],
input[type="number"],
textarea {
  border: none;
  border-bottom: 1px solid #999;
  background: transparent;
  padding: 4px 6px;
  font: inherit;
  min-width: 0;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
textarea:focus {
  outline: 2px solid rgba(196, 90, 17, 0.25);
  border-bottom-color: var(--brand);
}

select,
input[type="email"],
input[type="password"],
input[type="search"] {
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  font: inherit;
  min-width: 0;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  font-size: 13px;
  white-space: nowrap;
}

.table-section h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.section-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--muted);
}

.btn-add-site {
  background: var(--brand);
  color: #fff;
  border: 2px solid var(--brand);
  width: 100%;
  padding: 16px 16px;
  font-weight: 700;
  margin-top: 16px;
  font-size: 16px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(196, 90, 17, 0.25);
}

.btn-add-site:hover:not(:disabled) {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.btn-add-site:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.door-main-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
}

.door-measures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.door-direction-panel .field-group-label {
  margin-bottom: 8px;
}

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

.direction-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 6px 4px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}

.direction-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.direction-pick img {
  width: 100%;
  max-width: 110px;
  height: auto;
  display: block;
}

.direction-pick span {
  font-size: 11px;
  margin-top: 4px;
  text-align: center;
  line-height: 1.3;
  color: var(--muted);
}

.direction-pick:has(input:checked) {
  border-color: var(--brand);
  background: #fff7f0;
}

.direction-pick:has(input:checked) span {
  color: var(--brand-dark);
  font-weight: 700;
}

.door-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.site-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.site-card {
  border: 2px solid var(--brand);
  border-radius: 8px;
  padding: 0;
  background: #fffaf5;
  overflow: hidden;
}

.site-card.collapsed {
  background: #fff;
}

.site-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  padding: 12px 16px;
  border-bottom: 1px solid #ddd;
  flex-wrap: wrap;
}

.site-card.collapsed .site-card-header {
  border-bottom: none;
}

.site-reorder-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.site-reorder-controls.hidden {
  display: none;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 32px;
  color: #999;
  font-size: 14px;
  letter-spacing: -2px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  border-radius: 4px;
}

.drag-handle:hover {
  color: var(--brand);
  background: rgba(196, 90, 17, 0.08);
}

.drag-handle:active {
  cursor: grabbing;
}

.btn-move-site {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  font-family: inherit;
  border-radius: 4px;
}

.btn-move-site:hover:not(:disabled) {
  color: var(--brand-dark);
  background: rgba(196, 90, 17, 0.08);
}

.btn-move-site:disabled {
  opacity: 0.25;
  cursor: default;
}

.site-card.is-dragging {
  opacity: 0.45;
}

.site-card.drag-over-top {
  box-shadow: inset 0 3px 0 var(--brand);
}

.site-card.drag-over-bottom {
  box-shadow: inset 0 -3px 0 var(--brand);
}

.btn-toggle-site,
.btn-collapse-site,
.btn-toggle-door,
.btn-collapse-door {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: #fff;
  color: var(--brand-dark);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
  line-height: 1;
  flex-shrink: 0;
  font-family: inherit;
  font-weight: 600;
  white-space: nowrap;
}

.btn-toggle-site:hover,
.btn-collapse-site:hover,
.btn-toggle-door:hover,
.btn-collapse-door:hover {
  background: #fff7f0;
  border-color: var(--brand-dark);
}

.btn-collapse-site,
.btn-collapse-door {
  width: 100%;
  margin-top: 4px;
}

.toggle-icon {
  font-size: 11px;
}

.site-summary {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.site-card:not(.collapsed) .site-summary {
  display: none;
}

.site-card-body {
  padding: 16px;
}

.site-card.collapsed .site-card-body {
  display: none;
}

.site-name-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 200px;
}

.site-name-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-dark);
  white-space: nowrap;
}

.site-name-input {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  border: 1px solid #ccc !important;
  border-radius: 6px;
  padding: 8px 12px !important;
  background: #fff !important;
}

.btn-remove-site {
  border: none;
  background: transparent;
  color: #b91c1c;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
  white-space: nowrap;
}

.btn-remove-site.hidden {
  display: none;
}

.btn-remove-site:hover {
  text-decoration: underline;
}

.site-card .door-card {
  background: #fff;
  border-color: #ccc;
}

.site-card .btn-add-door,
.site-card .btn-add-aluminum-door {
  background: #fafafa;
  color: var(--muted);
  border: 1px dashed #bbb;
  width: 100%;
  padding: 10px 16px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}

.site-card .btn-add-door:hover:not(:disabled),
.site-card .btn-add-aluminum-door:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: #fff;
}

.site-card .btn-add-door:disabled,
.site-card .btn-add-aluminum-door:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.door-card {
  border: 1px solid var(--border);
  padding: 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.door-card.collapsed {
  background: #fafafa;
}

.door-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  padding: 12px 16px;
  border-bottom: 2px solid var(--brand);
  flex-wrap: wrap;
}

.door-card.collapsed .door-card-header {
  border-bottom: none;
}

.door-card-body {
  padding: 16px;
}

.door-card.collapsed .door-card-body {
  display: none;
}

.door-summary {
  flex: 1;
  min-width: 120px;
  font-size: 13px;
  color: var(--muted);
}

.door-card:not(.collapsed) .door-summary {
  display: none;
}

.door-number {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-dark);
  white-space: nowrap;
}

.btn-duplicate-door,
.btn-remove-door {
  border: none;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
}

.btn-duplicate-door {
  color: var(--brand-dark);
}

.btn-remove-door {
  color: #b91c1c;
}

.btn-duplicate-door:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-remove-door.hidden {
  display: none;
}

.btn-duplicate-door:hover:not(:disabled),
.btn-remove-door:hover {
  text-decoration: underline;
}

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

.field-block span {
  font-size: 13px;
  color: var(--muted);
}

.field-block input {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px 10px;
}

.field-group {
  margin-bottom: 12px;
}

.field-group-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.door-card-body .field-block > span:first-child,
.door-card-body .field-group-label {
  color: var(--brand-dark);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.door-card-body .field-group-label {
  width: fit-content;
  margin-bottom: 10px;
  padding: 3px 8px;
  border-left: 3px solid var(--brand);
  border-radius: 0 4px 4px 0;
  background: #fff7ed;
}

.door-card-body .measurement-detail-field > span:first-child {
  display: block;
  width: fit-content;
  padding: 3px 8px;
  border-left: 3px solid var(--brand);
  border-radius: 0 4px 4px 0;
  background: #fff7ed;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-chip {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.option-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-chip span {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid #ccc;
  border-radius: 999px;
  font-size: 14px;
  background: #fff;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.option-chip input:checked + span {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.option-chip-fixed {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  font-size: 14px;
  background: var(--brand);
  color: #fff;
  cursor: default;
  user-select: none;
}

.field-inline-compact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.field-inline-compact input {
  width: 64px;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 6px 8px;
  text-align: center;
}

.gap-formula span:first-child {
  font-weight: 600;
}

.base-row,
.gap-row,
.lock-down-row {
  align-items: center;
}

.lock-down-row .field-inline-compact input {
  width: 96px;
}

.remark-block {
  margin-top: 4px;
}

.door-price-input-wrap {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.door-price-input-wrap > span {
  color: var(--muted);
  font-weight: 600;
}

.door-price-input {
  width: 100%;
  min-width: 0;
}

.door-price-currency-grid {
  display: grid;
  gap: 8px;
}

.door-pricing-product-select {
  width: 100%;
  margin-top: 8px;
}

.door-price-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.door-price-result {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.door-price-final-result {
  margin-top: 8px;
}

.door-special-processing-fields {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e5c29b;
}

.door-special-processing-fields > select {
  width: 100%;
  min-width: 0;
}

.door-special-processing-money-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.door-special-processing-money-grid > span {
  display: grid;
  gap: 4px;
}

.door-special-processing-money-grid > span:first-child {
  grid-column: 1 / -1;
}

.door-special-processing-money-grid small {
  color: var(--brand-dark);
  font-weight: 700;
}

.door-special-processing-money-grid input[readonly] {
  background: #f8fafc;
  font-weight: 600;
}

.door-special-processing-formula {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.door-price-result > small {
  color: var(--brand-dark);
  font-weight: 700;
}

.door-price-result input[readonly] {
  background: #f8fafc;
  color: #111827;
  font-weight: 600;
}

.door-price-formula {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .door-price-result-grid {
    grid-template-columns: 1fr;
  }
}

.door-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.door-actions .btn-collapse-site {
  grid-column: 1 / -1;
}

.aluminum-door-card {
  border-color: #d8a66d;
  background: #fffaf5;
}

.aluminum-door-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.aluminum-door-field {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid #ead8c5;
  border-radius: 10px;
  background: #fff;
}

.aluminum-door-price-value {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.aluminum-door-pricing-selection-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.aluminum-door-pricing-selection-row select {
  min-width: 0;
}

.aluminum-door-panel-count-wrap {
  display: grid;
  grid-template-columns: 72px auto;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.aluminum-door-panel-count-wrap[hidden] {
  display: none;
}

.aluminum-door-panel-count {
  width: 72px;
}

.aluminum-door-price-input[readonly] {
  background: #fff7ed;
  color: var(--brand-dark);
  font-weight: 700;
}

.aluminum-door-price-card small {
  margin-top: 6px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .aluminum-door-field-grid {
    grid-template-columns: 1fr;
  }
}

.notes-section {
  margin-top: 16px;
}

.notes-section label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.notes-section textarea {
  width: 100%;
  border: 1px solid var(--border);
  padding: 10px;
  resize: vertical;
}

.admin-panel {
  background: var(--paper);
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.admin-tab {
  border: 1px solid #ddd;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 10px 18px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.admin-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.admin-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--brand-dark);
}

.admin-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px 140px 190px 190px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.project-list-filters {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.project-progress-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
}

.project-progress-filter {
  flex: 0 0 auto;
  padding: 7px 14px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #4b5563;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.project-progress-filter:hover,
.project-progress-filter:focus-visible {
  border-color: var(--brand);
  color: var(--brand-dark);
  outline: none;
}

.project-progress-filter.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.project-list-filters .field-block,
.project-list-filters input,
.project-list-filters select,
.project-list-filters #btn-admin-search {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.customer-guide-filters {
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(220px, 320px);
  gap: 12px 16px;
  align-items: end;
  margin-bottom: 16px;
}

.customer-guide-search,
.customer-guide-category-filter {
  min-width: 0;
}

.customer-guide-category-filter-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.customer-guide-category-manager-toggle {
  padding: 2px 10px;
  border: 1px solid #d8a47f;
  border-radius: 999px;
  background: #fff7ed;
  color: var(--brand-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.customer-guide-category-manager {
  margin: -4px 0 18px;
  padding: 16px;
  border: 1px solid #e5c2a6;
  border-radius: 12px;
  background: #fffaf5;
}

.customer-guide-category-manager-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.customer-guide-category-manager-head h3,
.customer-guide-category-manager-head p {
  margin: 0;
}

.customer-guide-category-manager-head p {
  margin-top: 5px;
  color: #666;
  font-size: 13px;
}

.customer-guide-category-manager-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.customer-guide-category-manager-item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.customer-guide-category-manager-item input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.customer-guide-form {
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
}

.customer-guide-form-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.customer-guide-form-head h3 {
  margin: 0;
  font-size: 18px;
}

.customer-guide-form-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.customer-guide-form-toggle {
  display: inline-flex;
  min-width: 62px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border: 1px solid #d8a47f;
  border-radius: 999px;
  background: #fff7ed;
  color: var(--brand-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.customer-guide-form-toggle:focus-visible {
  outline: 2px solid rgba(189, 93, 36, 0.3);
  outline-offset: 2px;
}

.customer-guide-form.mobile-collapsed {
  padding-top: 14px;
  padding-bottom: 14px;
}

.customer-guide-form.mobile-collapsed .customer-guide-form-head {
  margin-bottom: 0;
}

.customer-guide-form.mobile-collapsed .customer-guide-form-body {
  display: none;
}

.customer-guide-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px 16px;
}

.customer-guide-title-grid {
  grid-template-columns: minmax(0, 1fr);
}

.customer-guide-category-row {
  width: min(100%, 520px);
  margin-bottom: 12px;
}

.customer-guide-category-control {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.customer-guide-category-control select {
  flex: 1 1 auto;
  min-width: 0;
}

.customer-guide-add-category {
  flex: 0 0 46px;
  min-height: 44px;
  border: 1px dashed #d8a47f;
  border-radius: 8px;
  background: #fff7ed;
  color: var(--brand-dark);
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
}

.customer-guide-category-badge {
  display: inline-block;
  margin-bottom: 7px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff7ed;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
}

.customer-guide-form textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
}

#customer-guide-reply-input {
  width: min(100%, 420px);
  min-height: 180px;
  line-height: 1.7;
}

.customer-guide-form-actions {
  margin-top: 14px;
}

.customer-guide-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.customer-guide-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 18px 20px;
}

.customer-guide-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.customer-guide-card h3 {
  margin: 0;
  font-size: 18px;
}

.customer-guide-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.customer-guide-section {
  margin-top: 12px;
}

.customer-guide-section h4 {
  margin: 0 0 8px;
  color: var(--brand-dark);
  font-size: 14px;
}

.customer-guide-section ul {
  margin: 0;
  padding-left: 20px;
}

.customer-guide-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.customer-guide-keyword {
  padding: 5px 9px;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
}

.customer-guide-reply {
  width: min(100%, 420px);
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-create-project-form {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  background: #fff;
}

.admin-create-project-form h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--brand-dark);
}

.admin-create-project-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-create-project-form-toggle {
  display: none;
}

.admin-create-project-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}

.admin-create-project-fields .field-block > span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-dark);
}

.admin-create-project-fields input[type="text"],
.admin-create-project-fields input[type="tel"],
.admin-create-project-fields input[type="number"],
.admin-create-project-fields input[type="search"],
.admin-create-project-fields select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

.field-control-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  box-sizing: border-box;
}

.demolition-control-box {
  flex-wrap: wrap;
}

.optional-trade-control-box {
  min-height: 38px;
}

.demolition-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.demolition-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--brand);
}

.demolition-count-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 88px;
  min-width: 0;
  margin: 0;
}

.demolition-count-inline.hidden {
  display: none;
}

.demolition-count-label {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.demolition-count-inline input {
  width: 100%;
  min-width: 72px;
  padding: 5px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.field-block-demolition .field-control-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.1);
}

.field-block-submit {
  display: flex;
  flex-direction: column;
}

.field-block-submit-label {
  visibility: hidden;
  height: 19px;
  margin-bottom: 6px;
}

.btn-create-project-submit {
  width: 100%;
}

.admin-project-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 4px 0;
}

.profile-list,
.audit-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-project-card {
  border: 1px solid #b8c0cc;
  border-radius: 10px;
  padding: 14px 16px 16px;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 6px 16px rgba(15, 23, 42, 0.06);
}

.profile-card,
.audit-log-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.admin-project-card h3,
.profile-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--brand-dark);
}

.admin-project-title-mobile {
  display: none;
}

.admin-project-mobile-header {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.admin-project-heading {
  display: flex;
  grid-column: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.admin-project-heading h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.project-progress-pill {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff7ed;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.admin-project-card.mobile-collapsed .admin-project-heading {
  display: block;
}

.admin-project-card.mobile-collapsed .project-progress-pill--heading {
  margin-top: 7px;
}

.project-progress-pill--completed {
  background: #ecfdf5;
  color: #047857;
}

.project-progress-pill--replenishing {
  background: #fff1f2;
  color: #be123c;
}

.admin-project-progress-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #ead4c3;
  border-radius: 9px;
  background: #fffaf6;
}

.admin-project-progress-control label {
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
}

.project-progress-select {
  min-width: 150px;
  max-width: 220px;
}

.project-progress-hint {
  color: #6b7280;
  font-size: 12px;
}

.admin-project-mobile-actions {
  display: flex;
  grid-column: 3;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.btn-admin-project-mobile-open,
.btn-admin-project-mobile-quotation {
  display: inline-flex;
  min-width: 70px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.btn-toggle-admin-project {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 62px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border: 1px solid #d8a47f;
  border-radius: 999px;
  background: #fff7ed;
  color: var(--brand-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-toggle-admin-project:focus-visible {
  outline: 2px solid rgba(189, 93, 36, 0.3);
  outline-offset: 2px;
}

.admin-project-card.mobile-collapsed .admin-project-collapsible-body {
  display: none;
}

.admin-project-card:not(.mobile-collapsed) .admin-project-collapsible-body {
  margin-top: 12px;
}

.admin-project-collapsed-trades {
  display: none;
  grid-column: 2;
}

.admin-project-card.mobile-collapsed .admin-project-collapsed-trades {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.admin-project-collapsed-trades .admin-card-trade-chips {
  flex-wrap: nowrap;
  justify-content: flex-start;
  width: 100%;
  min-width: 100%;
  gap: 4px;
  margin-bottom: 0;
  padding: 2px 0;
}

.admin-project-collapsed-trades .admin-trade-chip {
  flex: 0 0 calc((100% - 16px) / 5);
  width: calc((100% - 16px) / 5);
  max-width: calc((100% - 16px) / 5);
  min-width: 0;
  justify-content: center;
  padding-right: 5px;
  padding-left: 5px;
  white-space: nowrap;
}

.admin-project-card:not(.mobile-collapsed) .btn-admin-project-mobile-open,
.admin-project-card:not(.mobile-collapsed) .btn-admin-project-mobile-quotation {
  display: none;
}

.profile-email {
  margin-left: 8px;
  color: #b91c1c;
  font-size: 14px;
  font-weight: 700;
}

.admin-card-meta,
.audit-log-card {
  font-size: 13px;
  color: var(--muted);
}

.admin-project-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

.admin-project-detail {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.admin-project-detail-label {
  flex: 0 0 auto;
  color: #6b7280;
}

.admin-project-detail-label::after {
  content: "：";
}

.admin-project-detail-value {
  min-width: 0;
  color: #4b5563;
}

.admin-project-detail--countdown {
  flex-basis: 100%;
}

.admin-project-detail-break {
  flex: 0 0 100%;
  width: 100%;
  height: 0;
}

.admin-card-trade-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.admin-trade-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.35;
  border: 1px solid transparent;
}

.admin-trade-chip-label::after {
  content: "：";
}

.admin-trade-chip-label {
  font-weight: 700;
}

.admin-trade-chip-name {
  font-weight: 600;
}

.admin-trade-chip .btn-small {
  padding: 2px 8px;
  line-height: 1.3;
}

.admin-trade-chip .btn-cancel-project-assignment {
  display: inline-grid;
  width: 22px;
  height: 22px;
  padding: 0;
  place-items: center;
  border: 1px solid #dc2626;
  border-radius: 4px;
  background: #fff;
  color: #dc2626;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.admin-trade-chip .btn-cancel-project-assignment:hover {
  background: #fee2e2;
}

.admin-trade-chip .btn-cancel-project-assignment:disabled {
  cursor: wait;
  opacity: 0.55;
}

.admin-trade-chip--measure {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e40af;
}

.admin-trade-chip--logistics {
  background: #f7fee7;
  border-color: #86efac;
  color: #166534;
}

.admin-trade-chip--demolition {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}

.admin-trade-chip--disposal {
  background: #fdf2f8;
  border-color: #f9a8d4;
  color: #9d174d;
}

.admin-trade-chip--install {
  background: #f5f3ff;
  border-color: #c4b5fd;
  color: #5b21b6;
}

.admin-trade-chip--silicone {
  background: #ecfeff;
  border-color: #67e8f9;
  color: #0e7490;
}

.admin-trade-chip--internal_work {
  background: #fffbeb;
  border-color: #fbbf24;
  color: #92400e;
}

.admin-trade-chip--base_salary {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

.admin-trade-chip.unassigned {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #6b7280;
}

.admin-trade-chip.unassigned .admin-trade-chip-name {
  font-weight: 500;
  font-style: italic;
}

.account-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.account-status-filter,
.account-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.account-status-filter {
  background: #fff;
  cursor: pointer;
  font-family: inherit;
}

.account-status-filter.pending,
.account-status-pill.pending {
  background: #fef3c7;
  color: #92400e;
}

.account-status-filter.active-status,
.account-status-pill.active {
  background: #dcfce7;
  color: #047857;
}

.account-status-filter.disabled,
.account-status-pill.disabled {
  background: #fee2e2;
  color: #b91c1c;
}

.account-status-filter.active {
  border-color: currentColor;
  box-shadow: 0 0 0 2px rgba(196, 90, 17, 0.12);
}

.account-category-filters {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.account-category-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-category-label {
  flex: 0 0 76px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
}

.account-category-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.account-category-filter {
  padding: 6px 13px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #4b5563;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.account-category-filter:hover,
.account-category-filter:focus-visible {
  border-color: #c45a11;
  color: var(--brand-dark);
  outline: none;
}

.account-category-filter.active {
  border-color: #bd5d24;
  background: #bd5d24;
  color: #fff;
  font-weight: 700;
}

.account-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.admin-status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.admin-status-badge.draft {
  background: #047857;
}

.admin-status-badge.locked,
.admin-status-badge.admin_only {
  background: var(--brand);
}

.admin-status-badge.archived {
  background: #6b7280;
}

.admin-status-badge.frozen {
  background: #dc2626;
}

.admin-actions,
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

.profile-role-row,
.profile-engineering-row,
.profile-account-action-row {
  display: contents;
}

.profile-engineering-label {
  display: none;
}

.profile-role-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.profile-base-salary {
  color: var(--muted);
  font-size: 13px;
}

.profile-base-salary-input {
  width: 120px;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

.profile-service-areas,
.profile-service-areas-readonly {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #ddd;
}

.profile-service-areas-title {
  display: block;
  width: 100%;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}

.profile-service-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-service-area-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
}

.worker-service-areas-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #b45309;
  border-radius: 12px;
  background: rgba(255, 253, 250, 0.9);
  box-shadow: 0 8px 22px rgba(120, 53, 15, 0.06);
}

.worker-service-areas-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.worker-service-areas-heading h2 {
  margin: 0 0 4px;
  color: var(--brand-dark);
  font-size: 18px;
}

.worker-service-areas-heading .section-hint {
  margin: 0;
}

.worker-service-areas-toggle {
  display: none;
}

.worker-service-areas-body > .btn {
  display: block;
  margin: 0 0 12px auto;
}

.worker-service-area-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.worker-service-area-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.worker-service-area-option:has(input:checked) {
  border-color: #d46e30;
  background: #fff7ed;
  color: var(--brand-dark);
  font-weight: 700;
}

.worker-service-area-option input {
  flex: 0 0 auto;
}

.worker-service-areas-feedback {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.worker-service-areas-feedback.is-success {
  color: #166534;
}

.worker-service-areas-feedback.is-error {
  color: #b91c1c;
}

@media (max-width: 640px) {
  .worker-service-areas-heading {
    align-items: center;
    margin-bottom: 0;
  }

  .worker-service-areas-heading > div {
    min-width: 0;
  }

  .worker-service-areas-heading .section-hint {
    display: none;
  }

  .worker-service-areas-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .worker-service-areas-body {
    margin-top: 12px;
  }

  .worker-service-areas-panel.is-collapsed .worker-service-areas-body {
    display: none;
  }

  .worker-service-areas-body > .btn {
    width: 100%;
  }

  .worker-service-area-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dispatch-service-area-hint {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-actions select {
  min-width: 150px;
}

.readonly .form-sheet input,
.readonly .form-sheet textarea,
.readonly .form-title-input {
  color: #444;
  background: #f9fafb !important;
}

.hidden {
  display: none !important;
}

.scroll-top-button {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  display: grid;
  width: 54px;
  height: 54px;
  padding: 5px;
  place-content: center;
  border: 1px solid #a94e1d;
  border-radius: 50%;
  background: #bd5d24;
  color: #fff;
  box-shadow: 0 6px 18px rgba(94, 45, 18, 0.28);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  cursor: pointer;
}

.scroll-top-button span:first-child {
  margin-bottom: 2px;
  font-size: 18px;
}

.scroll-top-button:hover,
.scroll-top-button:focus-visible {
  background: #9f481b;
  outline: 3px solid rgba(189, 93, 36, 0.22);
  outline-offset: 2px;
}

/* ---- 日曆（安裝師傅 / 後台安裝管理） ---- */
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 12px;
}

.calendar-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.legend-empty { background: #fff; }
.legend-available { background: #f7fee7; border-color: #16a34a; }
.legend-rest { background: #fef2f2; border-color: #dc2626; }
.legend-scheduled { background: #eff6ff; border-color: #2563eb; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekday {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 0;
}

.calendar-cell {
  min-height: 92px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

body.mode-frontend .calendar-cell {
  border-color: #6b4a2d;
  background: rgba(255, 255, 255, 0.9);
}

body.mode-frontend .calendar-cell.selected {
  border-color: var(--brand);
  background: #fffaf5;
  box-shadow: 0 0 0 2px rgba(196, 90, 17, 0.3), 0 8px 18px rgba(196, 90, 17, 0.08);
}

.calendar-cell:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.calendar-cell.outside-month {
  opacity: 0.35;
  cursor: default;
}

.calendar-cell.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(196, 90, 17, 0.25);
}

.calendar-cell.status-available,
.calendar-cell.status-rest,
.calendar-cell.status-scheduled {
  background: #fff;
}

.calendar-cell.status-available .calendar-cell-label,
.calendar-cell.status-rest .calendar-cell-label,
.calendar-cell.status-scheduled .calendar-cell-label {
  display: inline-block;
  margin-top: 2px;
  padding: 3px 7px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid currentColor;
  line-height: 1.35;
}

.calendar-cell.status-available .calendar-cell-label {
  color: #14532d;
  border-color: #16a34a;
  background: #f7fee7;
}

.calendar-cell.status-rest .calendar-cell-label {
  color: #7f1d1d;
  border-color: #dc2626;
  background: #fef2f2;
}

.calendar-cell.status-scheduled .calendar-cell-label {
  color: #1e3a8a;
  border-color: #2563eb;
  background: #eff6ff;
}

.calendar-cell.batch-selected {
  border-color: var(--brand) !important;
  background: #fff7ed !important;
  box-shadow: inset 0 0 0 3px var(--brand);
  position: relative;
}

.calendar-cell.batch-selected .calendar-cell-day::after {
  content: "✓";
  display: inline-block;
  margin-left: 4px;
  color: var(--brand);
  font-weight: 700;
}

.calendar-cell-day {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.calendar-cell-label {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
}

.calendar-cell-label .admin-installer-chip:last-child {
  margin-bottom: 0;
}

.calendar-cell-assignments {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calendar-cell-assignment,
.calendar-assignment-link {
  font-size: 11px;
  line-height: 1.3;
  color: var(--brand);
  text-decoration: none;
  word-break: break-all;
}

.calendar-cell-assignment {
  color: #1d4ed8;
}

.admin-installer-chip {
  display: block;
  margin: 4px 0 0;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.admin-installer-chip.available {
  background: #f7fee7;
  border-color: #16a34a;
  color: #14532d;
}

.admin-installer-chip.rest {
  background: #fef2f2;
  border-color: #dc2626;
  color: #7f1d1d;
}

.admin-installer-chip.scheduled {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1e3a8a;
}

.calendar-cell-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.calendar-summary-item {
  display: block;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

.calendar-summary-available {
  background: #f7fee7;
  border: 1px solid #16a34a;
  color: #14532d;
}

.calendar-summary-scheduled {
  background: #eff6ff;
  border: 1px solid #2563eb;
  color: #1e3a8a;
}

.calendar-summary-empty {
  background: #f9fafb;
  border: 1px solid #d1d5db;
  color: #6b7280;
}

.day-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafafa;
}

body.mode-frontend .day-panel,
body.mode-frontend .install-batch-panel,
body.mode-frontend .earnings-panel {
  border-color: #b45309;
  background: rgba(255, 253, 250, 0.9);
  box-shadow: 0 8px 22px rgba(120, 53, 15, 0.06);
}

.day-panel h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.day-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.day-panel-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.dispatch-project-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid rgba(212, 110, 48, 0.35);
  border-radius: 10px;
  background: rgba(212, 110, 48, 0.08);
  color: #111;
}

.dispatch-project-context-hint {
  color: var(--muted);
}

.dispatch-locked-project {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafafa;
  color: #111;
  font-size: 13px;
}

.install-dispatch-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.install-dispatch-form label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.install-dispatch-form select {
  width: 100%;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.earnings-panel-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 4px;
}

.earnings-panel-top .earnings-title {
  margin-bottom: 0;
}

.btn-earnings-toggle {
  flex: 0 0 auto;
  font-size: 13px;
  padding: 6px 12px;
}

.earnings-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
}

.earnings-title {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--brand-dark);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.earnings-title-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--brand);
}

.earnings-title-count {
  margin-left: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.earnings-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.earnings-summary-total {
  font-size: 16px;
}

.earnings-summary-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.earnings-trade-total {
  font-size: 12px;
}

.earnings-table-wrap {
  overflow-x: auto;
}

.earnings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.earnings-table th,
.earnings-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.earnings-table th {
  background: #f9fafb;
  font-weight: 700;
  white-space: nowrap;
}

.earnings-amount {
  font-weight: 700;
  color: var(--brand-dark);
  white-space: nowrap;
}

.pricing-form {
  display: grid;
  gap: 16px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.pricing-card {
  margin: 0;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
}

.pricing-card legend {
  padding: 0 6px;
  font-weight: 700;
}

.pricing-card--measure { border-color: #93c5fd; background: #eff6ff; }
.pricing-card--logistics { border-color: #86efac; background: #f7fee7; }
.pricing-card--demolition { border-color: #fdba74; background: #fff7ed; }
.pricing-card--disposal { border-color: #f9a8d4; background: #fdf2f8; }
.pricing-card--install { border-color: #c4b5fd; background: #f5f3ff; }
.pricing-card--silicone { border-color: #67e8f9; background: #ecfeff; }

.pricing-card .field-block input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.pricing-commission-field {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 0, 0, 0.12);
}

.pricing-commission-note {
  margin-top: 4px;
}

.aluminum-frame-pricing-calculator {
  display: grid;
  gap: 16px;
  max-width: 1100px;
}

.aluminum-pricing-order-toolbar,
.aluminum-pricing-order-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.aluminum-pricing-order-toolbar {
  max-width: 1100px;
  justify-content: space-between;
}

.aluminum-pricing-order-toolbar .section-hint,
#aluminum-pricing-order-message {
  margin: 0;
}

.aluminum-pricing-tabs.is-reordering .aluminum-pricing-tab {
  cursor: grab;
  border: 2px dashed rgba(157, 72, 24, 0.42);
}

.aluminum-pricing-tabs.is-reordering .aluminum-pricing-tab.is-order-selected {
  outline: 3px solid rgba(198, 90, 18, 0.28);
  border-style: solid;
}

.aluminum-pricing-tabs.is-reordering .aluminum-pricing-tab.is-dragging {
  opacity: 0.45;
}

.aluminum-pricing-tabs {
  display: flex;
  gap: 10px;
  max-width: 1100px;
  margin: 16px 0 20px;
  padding-bottom: 6px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.aluminum-pricing-tab {
  flex: 1 0 230px;
  min-height: 54px;
  padding: 10px 14px;
  line-height: 1.45;
  white-space: nowrap;
  scroll-snap-align: start;
}

.aluminum-pricing-pane {
  max-width: 1100px;
}

.aluminum-frame-section-title {
  margin: 24px 0 6px;
  color: var(--brand-dark);
}

#admin-aluminum-frame-pricing-panel > .aluminum-frame-section-title:first-of-type {
  margin-top: 12px;
}

.aluminum-linked-pricing-section {
  max-width: 1100px;
  margin-top: 0;
}

.aluminum-linked-pricing-section .aluminum-frame-section-title {
  margin-top: 12px;
}

.aluminum-linked-input-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.aluminum-linked-input-grid input,
.aluminum-linked-input-grid select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 18px;
}

.aluminum-linked-breakdown .aluminum-frame-price-card strong {
  overflow-wrap: anywhere;
}

.aluminum-frame-input-card {
  padding: 18px;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  background: #fffaf5;
}

.aluminum-frame-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.aluminum-frame-formula-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.aluminum-frame-input-grid input,
.aluminum-frame-formula-settings input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 18px;
}

.aluminum-frame-formula {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px dashed #e6b58f;
  color: var(--muted);
  line-height: 1.6;
}

.aluminum-frame-breakdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.aluminum-frame-price-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.aluminum-frame-price-card--material {
  border-color: #fdba74;
  background: #fff7ed;
}

.aluminum-frame-price-card span {
  color: var(--brand-dark);
  font-weight: 700;
}

.aluminum-frame-price-field {
  display: grid;
  gap: 6px;
}

.aluminum-frame-price-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.aluminum-frame-price-input input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 22px;
  font-weight: 700;
}

.aluminum-frame-price-card strong {
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.2;
}

.aluminum-frame-price-card small,
.aluminum-frame-total-card small {
  color: var(--muted);
  line-height: 1.45;
}

.aluminum-frame-total-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 20px;
  padding: 20px;
  border-radius: 14px;
  background: var(--brand-dark);
  color: #fff;
}

.aluminum-frame-total-card > span {
  font-size: 18px;
  font-weight: 700;
}

.aluminum-frame-total-card output {
  grid-row: span 2;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.aluminum-frame-total-card small {
  color: rgba(255, 255, 255, 0.78);
}

.aluminum-frame-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.aluminum-frame-actions .form-message {
  flex: 1 1 auto;
  margin: 0;
}

.aluminum-frame-actions .btn {
  min-width: 240px;
}

.door-pricing-calculator {
  display: grid;
  gap: 16px;
  max-width: 1100px;
}

.door-calculator-tabs {
  display: flex;
  gap: 10px;
  max-width: 1100px;
  margin: 16px 0 20px;
  padding-bottom: 6px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.door-calculator-tab {
  flex: 1 0 230px;
  min-height: 54px;
  padding: 10px 14px;
  line-height: 1.45;
  white-space: nowrap;
  scroll-snap-align: start;
}

.door-calculator-title {
  margin: 0 0 -10px;
  color: var(--brand-dark);
  font-size: 22px;
}

.door-calculator-input-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.door-calculator-input-grid input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 18px;
}

.door-calculator-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.door-calculator-rules span {
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  background: #fffaf5;
  color: var(--brand-dark);
  font-size: 14px;
}

.door-calculator-service-total-card {
  background: #315f92;
}

.door-pricing-brand-bar,
.door-pricing-door-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background: #fffaf5;
}

.door-pricing-door-bar {
  margin-top: -4px;
  border-color: #e5e7eb;
  background: #f9fafb;
}

.door-pricing-brand-label,
.door-pricing-door-label {
  flex: 0 0 auto;
  color: var(--brand-dark);
  font-weight: 700;
}

.door-pricing-brand-tabs,
.door-pricing-door-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.door-pricing-door-tabs.door-pricing-door-tabs--custom {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.door-pricing-door-custom-row,
.door-pricing-door-custom-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.door-pricing-filter-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.door-pricing-filter-item[hidden] {
  display: none;
}

.door-pricing-brand-tab,
.door-pricing-brand-add,
.door-pricing-brand-edit,
.door-pricing-door-tab,
.door-pricing-door-add,
.door-pricing-door-edit {
  padding: 8px 16px;
  border: 1px solid #d7dce1;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.door-pricing-brand-tab:hover,
.door-pricing-brand-tab:focus-visible,
.door-pricing-brand-add:hover,
.door-pricing-brand-add:focus-visible,
.door-pricing-brand-edit:hover,
.door-pricing-brand-edit:focus-visible,
.door-pricing-door-tab:hover,
.door-pricing-door-tab:focus-visible,
.door-pricing-door-add:hover,
.door-pricing-door-add:focus-visible,
.door-pricing-door-edit:hover,
.door-pricing-door-edit:focus-visible {
  border-color: #d46e30;
  outline: none;
}

.door-pricing-brand-tab.active,
.door-pricing-door-tab.active {
  border-color: #bd5d24;
  background: #bd5d24;
  color: #fff;
}

.door-pricing-brand-add,
.door-pricing-door-add {
  border-style: dashed;
  color: var(--brand-dark);
}

.door-pricing-brand-edit,
.door-pricing-door-edit {
  color: var(--brand-dark);
  background: #fff7ed;
}

.door-pricing-filter-name-input {
  display: none;
  width: 170px;
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid #d46e30;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.door-pricing-tabs-editing .door-pricing-brand-tab,
.door-pricing-tabs-editing .door-pricing-door-tab {
  display: none;
}

.door-pricing-tabs-editing .door-pricing-filter-name-input {
  display: block;
}

.door-pricing-filter-copy,
.door-pricing-filter-delete {
  display: none;
}

.door-pricing-filter-copy {
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid #d7dce1;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.door-pricing-filter-delete {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 1px solid #efb1b1;
  border-radius: 50%;
  background: #fff2f2;
  color: #b91c1c;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.door-pricing-tabs-editing .door-pricing-filter-copy {
  display: inline-block;
}

.door-pricing-tabs-editing .door-pricing-filter-delete {
  display: inline-grid;
}

.door-pricing-filter-copy:hover,
.door-pricing-filter-copy:focus-visible {
  border-color: #d46e30;
  background: #fff7ed;
  outline: 2px solid rgba(212, 110, 48, 0.16);
  outline-offset: 1px;
}

.door-pricing-filter-delete:hover,
.door-pricing-filter-delete:focus-visible {
  border-color: #dc2626;
  background: #fee2e2;
  outline: 2px solid rgba(220, 38, 38, 0.16);
  outline-offset: 1px;
}

.door-pricing-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.door-pricing-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.door-pricing-color-column { width: 16%; }
.door-pricing-size-column { width: 11.8%; }
.door-pricing-action-column { width: 13%; }

.door-pricing-table th,
.door-pricing-table td {
  padding: 6px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}

.door-pricing-table tbody tr:last-child th,
.door-pricing-table tbody tr:last-child td {
  border-bottom: 0;
}

.door-pricing-table tbody tr[hidden] {
  display: none !important;
}

.door-pricing-table thead tr:first-child th:last-child,
.door-pricing-table tbody tr > :last-child,
.door-pricing-table:not(.door-pricing-table--editable) thead tr:nth-child(2) th:last-child {
  border-right: 0;
}

.door-pricing-table thead th {
  background: #fff7ed;
  color: var(--brand-dark);
  font-weight: 700;
  white-space: nowrap;
}

.door-pricing-table thead .door-pricing-size-heading {
  background: #D46E30;
  color: #fff;
  font-weight: 700;
}

.door-pricing-size-group-heading {
  letter-spacing: 0.04em;
}

.door-pricing-table tbody th {
  background: #f9fafb;
}

.door-pricing-table input {
  width: 100%;
  min-width: 0;
  padding: 7px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  text-align: center;
}

.door-pricing-currency-pair {
  display: grid;
  gap: 5px;
}

.door-pricing-currency-field {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
}

.door-pricing-currency-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.door-pricing-currency-field input {
  padding: 6px 4px;
}

.door-pricing-table .door-pricing-currency-field input,
.special-processing-table .door-pricing-currency-field input {
  font-weight: 700;
}

.door-pricing-currency-field input[data-door-price-tax-included-size] {
  background: #f1f8f3;
  border-color: #a8ceb2;
  color: #356b45;
}

.door-pricing-currency-field input[data-special-processing-price-tax-included] {
  background: #f1f8f3;
  border-color: #a8ceb2;
  color: #356b45;
}

.door-pricing-currency-field:has(
    input[data-door-price-tax-included-size],
    input[data-special-processing-price-tax-included]
  )
  .door-pricing-currency-label {
  color: #477a56;
}

.door-pricing-currency-field input[data-door-price-tax-included-size]:focus,
.door-pricing-currency-field input[data-special-processing-price-tax-included]:focus {
  background: #e8f4eb;
  border-color: #6fa27c;
  box-shadow: 0 0 0 2px rgba(80, 134, 94, 0.12);
}

.door-pricing-table .door-pricing-color-input {
  min-width: 0;
  font-weight: 700;
  text-align: left;
}

.door-pricing-color-control {
  min-width: 0;
}

.door-pricing-collapse-toggle {
  display: none;
}

.door-pricing-action-heading,
.door-pricing-action-cell {
  min-width: 0;
}

.pricing-row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.door-pricing-action-cell .btn {
  padding: 7px 8px;
  font-size: 13px;
  white-space: nowrap;
}

.pricing-drag-handle {
  display: inline-grid;
  flex: 0 0 30px;
  width: 30px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #6b7280;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.pricing-drag-handle:hover,
.pricing-drag-handle:focus-visible {
  border-color: #d1d5db;
  background: #f3f4f6;
  color: var(--brand-dark);
  outline: none;
}

.pricing-drag-handle:active,
.pricing-drag-handle[aria-grabbed="true"] {
  cursor: grabbing;
}

.pricing-sort-active .pricing-row-dragging {
  opacity: 0.55;
}

.door-pricing-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.door-pricing-actions .btn-primary {
  min-width: 220px;
}

.door-pricing-save-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.door-pricing-save-message {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.door-pricing-save-message.saving {
  color: var(--brand-dark);
}

.door-pricing-save-message.success {
  color: #287240;
}

.door-pricing-save-message.error {
  color: #b91c1c;
}

.special-processing-table-wrap {
  overflow: visible;
  border: 0;
  background: transparent;
}

.special-processing-table {
  display: block;
  width: 100%;
}

.special-processing-table colgroup,
.special-processing-table thead {
  display: none;
}

.special-processing-table tbody {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
  gap: 12px;
}

.special-processing-table tbody tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.special-processing-table tbody th,
.special-processing-table tbody td {
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.special-processing-name-cell::before,
.special-processing-price-cell::before {
  display: block;
  margin-bottom: 5px;
  color: var(--brand-dark);
  content: attr(data-mobile-label);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.special-processing-table input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  text-align: center;
}

.special-processing-table [data-special-processing-name] {
  font-weight: 700;
  text-align: left;
}

.special-processing-action-cell .btn {
  padding: 7px 10px;
  font-size: 13px;
  white-space: nowrap;
}

.special-processing-action-cell {
  align-self: end;
}

.special-processing-action-cell .pricing-row-actions {
  justify-content: flex-end;
}

.catalog-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.catalog-card {
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.catalog-card h3 {
  margin: 0 0 12px;
  font-size: 17px;
  color: var(--brand-dark);
}

.catalog-add-form {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #e5e7eb;
}

.catalog-add-fields {
  display: grid;
  gap: 10px;
}

.catalog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.catalog-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  background: #f8fafc;
}

.catalog-list-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.catalog-list-empty {
  padding: 10px 0;
  color: var(--muted);
  font-size: 14px;
}

.btn-small {
  padding: 4px 10px;
  font-size: 12px;
}

.admin-catalog-edit {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.admin-catalog-edit .project-container-select,
.admin-catalog-edit .project-supplier-select {
  min-width: 110px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}

.admin-optional-trades {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 10px 0 4px;
  padding: 10px 12px;
  border: 1px dashed #d8c8b8;
  border-radius: 8px;
  background: #faf7f3;
}

.admin-optional-trades-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-dark);
}

.admin-optional-trade-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.admin-optional-trade-toggle input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
}

.admin-optional-trades-hint {
  flex: 1 1 220px;
  font-size: 12px;
  color: #6b7280;
}

.admin-optional-demolition-count {
  flex: 0 0 auto;
  margin: 0;
}

.admin-optional-demolition-count input {
  width: 72px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}

.admin-card-remark {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e5e7eb;
}

.admin-card-remark--collapsed {
  display: none;
}

.admin-project-card.mobile-collapsed > .admin-card-remark--collapsed {
  display: block;
}

.admin-card-remark-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-dark);
}

.admin-card-remark-compose {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.project-admin-remark {
  display: block;
  width: 100%;
  min-height: 72px;
  padding: 10px 96px 44px 12px;
  border: none;
  border-radius: 0;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
  background: transparent;
  box-sizing: border-box;
}

.project-admin-remark:focus {
  outline: none;
}

.admin-card-remark-compose:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.12);
}

.btn-save-remark {
  position: absolute;
  right: 8px;
  bottom: 8px;
  white-space: nowrap;
  min-width: 80px;
  z-index: 1;
}

.btn-save-remark.is-saved {
  border-color: #15803d;
  background: #15803d;
}

.admin-remark-save-status {
  display: none;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.4;
}

.admin-remark-save-status.is-saving,
.admin-remark-save-status.is-success,
.admin-remark-save-status.is-error {
  display: block;
}

.admin-remark-save-status.is-saving {
  color: var(--muted);
}

.admin-remark-save-status.is-success {
  color: #15803d;
  font-weight: 700;
}

.admin-remark-save-status.is-error {
  color: #b91c1c;
  font-weight: 700;
}

.admin-project-card.mobile-collapsed .admin-card-remark {
  margin-top: 8px;
  padding-top: 8px;
}

.admin-project-card.mobile-collapsed .admin-card-remark-label {
  margin-bottom: 4px;
}

.admin-project-card.mobile-collapsed .project-admin-remark {
  height: 44px;
  min-height: 44px;
  padding: 10px 104px 10px 12px;
  resize: none;
}

.admin-project-card.mobile-collapsed .btn-save-remark {
  top: 6px;
  right: 8px;
  bottom: auto;
  min-height: 32px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.admin-card-remark--readonly {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.admin-card-remark--unavailable {
  padding: 10px 12px;
  border: 1px solid #f2c48d;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
}

.admin-card-remark--unavailable .admin-card-remark-label {
  margin-bottom: 3px;
}

.admin-card-remark--unavailable p {
  margin: 0;
  font-size: 13px;
}

.admin-container-edit {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.admin-container-edit .project-container-select {
  min-width: 110px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}

.accounting-summary-card {
  margin: 16px 0 20px;
  padding: 16px 18px;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
}

.accounting-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 8px;
}

.accounting-mode-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.accounting-product-profit-positive {
  color: #166534;
  font-weight: 700;
}

.accounting-product-profit-negative {
  color: #dc2626;
  font-weight: 700;
}

.accounting-product-project-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}

.accounting-revenue-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
}

.accounting-revenue-amount {
  color: var(--brand-dark);
  font-size: 20px;
  white-space: nowrap;
}

.accounting-revenue-source {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .accounting-revenue-actions {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .accounting-revenue-amount {
    font-size: 17px;
  }
}

.accounting-summary-main h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--muted);
}

.accounting-summary-amount {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  color: var(--brand-dark);
}

.accounting-workers-title {
  margin: 0 0 12px;
  font-size: 17px;
  color: var(--brand-dark);
}

.accounting-workers-list {
  display: grid;
  gap: 12px;
}

.accounting-worker-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.accounting-worker-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  padding: 12px 14px;
}

.accounting-worker-meta {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.accounting-worker-details {
  padding: 0 14px 14px;
}

.assignment-list {
  display: grid;
  gap: 8px;
}

.assignment-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.assignment-row-meta {
  font-size: 13px;
  color: var(--muted);
}

.internal-task-content-panel {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f9fafb;
  color: #374151;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.internal-task-form h4 {
  margin: 0 0 16px;
  font-size: 18px;
}

.engineering-internal-task-form {
  margin-top: 20px;
}

.internal-task-main-fields {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  align-items: start;
}

.internal-task-main-fields .internal-task-assignee-field {
  grid-column: 2 / span 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 12px;
  align-items: start;
}

.internal-task-main-fields .internal-task-assignee-field > span:first-child,
.internal-task-main-fields .internal-task-assignee-field .internal-task-picker,
.internal-task-main-fields .internal-task-assignee-field .field-help {
  grid-column: 1;
}

.internal-task-main-fields .internal-task-assignee-field .internal-task-assignees {
  grid-column: 2;
  grid-row: 2 / span 2;
  width: 100%;
  padding-top: 0;
}

.internal-task-main-fields .internal-task-assignee-field .internal-task-assignees .empty-hint {
  box-sizing: border-box;
  flex: 1 1 100%;
  width: 100%;
}

.internal-task-main-fields .internal-task-bonus-field {
  grid-column: 4;
  grid-row: 2;
}

.internal-task-content-field {
  margin-top: 14px;
}

.admin-create-project-fields textarea,
.internal-task-content-field textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  padding: 10px;
  font-size: 14px;
}

.internal-task-assignees {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 30px;
  padding-top: 8px;
}

.internal-task-assignee {
  margin: 0;
}

.internal-task-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.internal-task-picker .btn {
  min-width: 42px;
  padding-left: 0;
  padding-right: 0;
}

.internal-task-assignee-chip {
  align-items: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  color: var(--brand-dark);
  display: inline-flex;
  gap: 6px;
  padding: 6px 10px;
}

.btn-remove-internal-task-assignee {
  background: transparent;
  border: 0;
  color: var(--brand-dark);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.internal-task-submit-row {
  display: flex;
  justify-content: flex-start;
  margin-top: 12px;
}

.internal-task-submit-row .btn {
  min-width: 190px;
}

.engineering-day-trade-group {
  margin-bottom: 16px;
}

.engineering-day-trade-group:last-child {
  margin-bottom: 0;
}

.engineering-day-trade-title {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--brand-dark);
}

.profile-capabilities {
  color: var(--muted);
  font-size: 13px;
}

.install-batch-panel {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafafa;
}

.install-batch-title {
  margin: 0 0 10px;
  font-size: 16px;
}

.install-range-form,
.install-quick-actions,
.install-batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: end;
  margin-bottom: 10px;
}

.install-range-form .field-block {
  min-width: 150px;
}

.install-range-form input[type="date"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.install-batch-actions {
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.install-batch-actions #install-batch-count {
  align-self: center;
  font-size: 13px;
  color: var(--muted);
  margin-right: 4px;
}

#btn-install-batch-mode.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

@media (max-width: 960px) {
  .sheet-header {
    grid-template-columns: 1fr;
  }

  .admin-filters {
    grid-template-columns: 1fr;
  }

  .external-create-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .admin-project-mobile-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 8px;
  }

  .admin-project-heading {
    grid-column: 1;
    grid-row: 1;
  }

  .admin-project-mobile-actions {
    display: contents;
  }

  .admin-project-mobile-actions .btn-toggle-admin-project {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .btn-admin-project-mobile-open {
    grid-column: 1;
    grid-row: 2;
  }

  .btn-admin-project-mobile-quotation {
    grid-column: 2;
    grid-row: 2;
  }

  .btn-admin-project-mobile-open,
  .btn-admin-project-mobile-quotation {
    width: 100%;
  }

  .btn-admin-project-mobile-open:first-child:nth-last-child(2) {
    grid-column: 1 / -1;
  }

  .admin-project-collapsed-trades {
    display: none !important;
  }

  .profile-actions {
    align-items: stretch;
  }

  .profile-role-row {
    display: flex;
    flex: 0 0 100%;
    width: 100%;
  }

  .profile-role-row .profile-role-control {
    width: 100%;
  }

  .profile-role-row .profile-role-select {
    flex: 1 1 auto;
    min-width: 0;
  }

  .profile-engineering-row {
    display: grid;
    flex: 0 0 100%;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 6px;
    padding: 10px 0 2px;
    border-top: 1px solid #eee;
  }

  .profile-engineering-label {
    display: block;
    grid-column: 1 / -1;
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 700;
  }

  .profile-engineering-row .profile-role-control {
    min-width: 0;
    white-space: nowrap;
  }

  .profile-account-action-row {
    display: grid;
    flex: 0 0 100%;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
  }

  .profile-account-action-row .btn {
    width: 100%;
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
  }

  .scroll-top-button {
    right: 14px;
    bottom: 14px;
    width: 48px;
    height: 48px;
  }

  .admin-create-project-form {
    padding: 12px;
    margin-bottom: 16px;
  }

  .admin-create-project-form-head h2 {
    margin-bottom: 0;
  }

  .admin-create-project-form-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    min-width: 62px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border: 1px solid #d8a47f;
    border-radius: 999px;
    background: #fff7ed;
    color: var(--brand-dark);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
  }

  .admin-create-project-form-toggle:focus-visible {
    outline: 2px solid rgba(189, 93, 36, 0.3);
    outline-offset: 2px;
  }

  #admin-create-project-form.mobile-collapsed .admin-create-project-form-body {
    display: none;
  }

  .admin-create-project-form .section-hint {
    margin-top: 10px;
    margin-bottom: 8px;
    line-height: 1.55;
  }

  .admin-create-project-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 10px;
    margin-top: 8px;
  }

  .admin-create-project-fields .field-block {
    min-width: 0;
  }

  .admin-create-project-fields .field-block > span {
    margin-bottom: 4px;
    font-size: 12px;
  }

  .admin-create-project-fields input[type="text"],
  .admin-create-project-fields input[type="tel"],
  .admin-create-project-fields input[type="number"],
  .admin-create-project-fields input[type="search"],
  .admin-create-project-fields select {
    min-width: 0;
    min-height: 42px;
    padding: 7px 8px;
    font-size: 14px;
  }

  .admin-create-project-fields .field-control-box {
    min-width: 0;
    min-height: 42px;
    padding: 6px 8px;
    gap: 6px;
  }

  .admin-create-project-fields .demolition-toggle {
    min-width: 0;
    gap: 6px;
    font-size: 13px;
  }

  .admin-create-project-fields .demolition-count-inline {
    width: 100%;
  }

  .admin-create-project-fields .demolition-count-inline input {
    width: 100%;
  }

  .admin-create-project-fields .btn-create-project-submit {
    width: 100%;
    min-height: 42px;
  }

  .internal-task-main-fields .internal-task-assignee-field {
    grid-column: 2;
    grid-row: 3 / span 2;
    display: block;
  }

  .internal-task-main-fields .internal-task-assignee-field .internal-task-assignees {
    padding-top: 8px;
  }

  .internal-task-main-fields .internal-task-bonus-field {
    grid-column: 1;
    grid-row: 4;
    align-self: start;
  }

  .admin-project-list {
    gap: 14px;
  }

  .admin-project-card {
    padding: 14px;
    border-radius: 12px;
  }

  .admin-project-card h3 {
    flex: 1 1 auto;
    font-size: 18px;
  }

  .admin-project-title-desktop {
    display: none;
  }

  .admin-project-title-mobile {
    display: inline;
  }

  .admin-project-card.mobile-collapsed .admin-card-remark-compose {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .admin-project-card.mobile-collapsed .project-admin-remark {
    height: auto;
    min-height: 48px;
    padding: 10px 12px;
    overflow: hidden;
    resize: none;
  }

  .admin-project-card.mobile-collapsed .btn-save-remark {
    position: static;
    align-self: flex-end;
    margin: 0 8px 8px;
  }

  .admin-card-trade-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 10px;
  }

  .admin-trade-chip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 3px;
    width: 100%;
    min-height: 38px;
    padding: 5px 7px;
    box-sizing: border-box;
  }

  .admin-trade-chip-label,
  .admin-trade-chip-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-trade-chip .btn-small {
    padding: 3px 6px;
    white-space: nowrap;
  }

  .admin-trade-chip .btn-cancel-project-assignment {
    width: 28px;
    height: 28px;
  }

  .admin-optional-trades {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .admin-optional-trades-label,
  .admin-optional-trades-hint,
  .admin-optional-trades .btn-save-optional-trades {
    grid-column: 1 / -1;
  }

  .admin-optional-trades-label {
    font-size: 14px;
  }

  .admin-optional-trade-toggle {
    min-height: 38px;
    padding: 7px 8px;
    border: 1px solid #e5ddd4;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
  }

  .admin-optional-trade-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }

  .admin-optional-demolition-count {
    min-height: 38px;
    padding: 7px 8px;
    border: 1px solid #e5ddd4;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
  }

  .admin-optional-demolition-count input {
    width: 58px;
  }

  .admin-optional-trades .btn-save-optional-trades {
    width: 100%;
    min-height: 40px;
  }

  .admin-optional-trades-hint {
    order: 10;
    line-height: 1.5;
  }

  .admin-project-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  .admin-project-detail-break {
    display: none;
  }

  .admin-project-detail {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-height: 58px;
    padding: 8px 9px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    box-sizing: border-box;
  }

  .admin-project-detail-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--brand-dark);
  }

  .admin-project-detail-label::after {
    content: "";
  }

  .admin-project-detail-value {
    width: 100%;
    color: #374151;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .admin-project-detail--catalog,
  .admin-project-detail--countdown {
    grid-column: 1 / -1;
  }

  .admin-project-detail--catalog {
    min-height: 0;
  }

  .admin-project-detail--catalog .admin-catalog-edit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .admin-project-detail--catalog .admin-catalog-edit select {
    width: 100%;
    min-width: 0;
    min-height: 40px;
  }

  .admin-project-detail--catalog .admin-catalog-edit .btn {
    min-height: 40px;
    white-space: nowrap;
  }

  .admin-project-detail--countdown {
    min-height: 0;
    border-color: #fed7aa;
    background: #fff7ed;
  }

  .admin-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  .admin-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 9px 8px;
  }

  .admin-actions .btn-admin-open,
  .admin-actions .btn-generate-quotation,
  .admin-actions .btn-admin-delete-project {
    grid-column: 1 / -1;
  }

  .admin-card-remark {
    margin-top: 14px;
  }

  .admin-project-card:not(.mobile-collapsed) .project-admin-remark {
    min-height: 118px;
  }

  .project-list-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
  }

  .project-list-filters .field-block {
    min-width: 0;
  }

  .project-list-filters .field-block > span {
    min-height: 34px;
    display: flex;
    align-items: flex-end;
    line-height: 1.35;
  }

  .project-list-filters input,
  .project-list-filters select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .project-list-filters #btn-admin-search {
    grid-column: 1 / -1;
    width: 100%;
  }

  .project-progress-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-right: -8px;
    margin-left: -8px;
    padding-right: 8px;
    padding-left: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .admin-project-progress-control {
    align-items: stretch;
  }

  .admin-project-progress-control label,
  .admin-project-progress-control .project-progress-hint {
    flex: 1 0 100%;
  }

  .project-progress-select {
    flex: 1 1 150px;
    max-width: none;
  }

  @media (max-width: 420px) {
    .admin-card-trade-chips {
      grid-template-columns: 1fr;
    }
  }

  .admin-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -8px 14px;
    padding: 0 8px 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .admin-tab {
    flex: 0 0 auto;
    padding: 9px 14px;
    scroll-snap-align: start;
  }

  .account-category-filters {
    padding: 10px;
  }

  .account-category-row {
    display: block;
  }

  .account-category-label {
    display: block;
    margin-bottom: 7px;
  }

  .account-category-options {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
    -webkit-overflow-scrolling: touch;
  }

  .account-category-filter {
    flex: 0 0 auto;
  }

  #admin-aluminum-frame-pricing-panel {
    padding: 14px 10px;
  }

  .aluminum-pricing-tabs {
    gap: 7px;
    margin: 12px 0 16px;
    padding-bottom: 6px;
  }

  .aluminum-pricing-order-toolbar {
    align-items: flex-start;
  }

  .aluminum-pricing-tab {
    flex-basis: 210px;
    min-height: 46px;
    padding: 9px 10px;
    font-size: 14px;
  }

  .aluminum-frame-input-card {
    padding: 14px;
  }

  .aluminum-frame-input-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .aluminum-linked-pricing-section {
    margin-top: 28px;
  }

  .aluminum-linked-input-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .aluminum-linked-input-grid .field-block {
    min-width: 0;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
  }

  .aluminum-linked-input-grid .field-block:last-child {
    grid-column: 1 / -1;
  }

  .aluminum-linked-input-grid input,
  .aluminum-linked-input-grid select {
    min-width: 0;
    min-height: 42px;
    padding: 8px 6px;
    font-size: 16px;
  }

  .aluminum-frame-input-grid .field-block {
    min-width: 0;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
  }

  .aluminum-frame-input-grid input {
    min-width: 0;
    min-height: 42px;
    padding: 8px 6px;
    font-size: 16px;
  }

  .aluminum-frame-formula-settings {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .aluminum-frame-formula-settings .field-block {
    min-width: 0;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
  }

  .aluminum-frame-formula-settings .field-block > span {
    min-height: 34px;
    font-size: 12px;
    line-height: 1.35;
  }

  .aluminum-frame-formula-settings input {
    min-width: 0;
    min-height: 42px;
    padding: 8px 6px;
    font-size: 16px;
  }

  .aluminum-frame-formula {
    font-size: 13px;
  }

  .aluminum-frame-breakdown {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .aluminum-frame-price-card {
    grid-template-columns: 1fr;
    gap: 6px;
    min-width: 0;
    padding: 8px;
  }

  .aluminum-frame-price-card--material {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 12px;
  }

  .aluminum-frame-price-card--material strong {
    text-align: right;
  }

  .aluminum-frame-price-card small {
    grid-column: 1 / -1;
  }

  .aluminum-frame-price-field {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 6px;
  }

  .aluminum-frame-price-field > span:first-child {
    min-height: 34px;
    font-size: 12px;
    line-height: 1.35;
  }

  .aluminum-frame-price-input {
    gap: 3px;
  }

  .aluminum-frame-price-input > span {
    font-size: 11px;
  }

  .aluminum-frame-price-input input {
    padding: 7px 5px;
    font-size: 16px;
  }

  .aluminum-frame-total-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .aluminum-frame-total-card output {
    grid-row: auto;
    margin: 6px 0;
  }

  .aluminum-frame-actions {
    display: grid;
    justify-content: stretch;
  }

  .aluminum-frame-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 46px;
  }

  .door-calculator-tabs {
    gap: 7px;
    margin: 12px 0 16px;
  }

  .door-calculator-tab {
    flex: 0 0 min(72vw, 260px);
    min-height: 46px;
    padding: 9px 10px;
  }

  .door-calculator-input-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .door-calculator-input-grid .field-block {
    min-width: 0;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
  }

  .door-calculator-input-grid input {
    min-height: 42px;
    padding: 8px 6px;
    font-size: 16px;
  }

  .door-calculator-breakdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .door-calculator-rules {
    grid-template-columns: 1fr;
  }

  #admin-door-pricing-panel {
    padding: 14px 10px;
  }

  .door-pricing-brand-bar,
  .door-pricing-door-bar {
    display: block;
    padding: 10px;
  }

  .door-pricing-brand-label,
  .door-pricing-door-label {
    display: block;
    margin-bottom: 8px;
  }

  .door-pricing-brand-tabs,
  .door-pricing-door-tabs {
    min-width: 0;
    max-width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .door-pricing-door-tabs {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .door-pricing-door-tabs.door-pricing-door-tabs--custom {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
  }

  .door-pricing-door-custom-row,
  .door-pricing-door-custom-actions {
    display: contents;
  }

  .door-pricing-brand-tab,
  .door-pricing-brand-add,
  .door-pricing-brand-edit,
  .door-pricing-door-tab,
  .door-pricing-door-add,
  .door-pricing-door-edit {
    flex: 0 0 auto;
  }

  .door-pricing-filter-name-input {
    flex: 0 0 150px;
    width: 150px;
  }

  .door-pricing-filter-item {
    flex: 0 0 auto;
    max-width: 100%;
  }

  .door-pricing-door-tab {
    max-width: 100%;
    white-space: nowrap;
    text-align: left;
  }

  .door-pricing-door-bar {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .door-pricing-table-wrap,
  .door-pricing-table,
  .door-pricing-table tbody,
  .door-pricing-table tbody tr,
  .door-pricing-color-control {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .door-pricing-table-wrap,
  .special-processing-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .door-pricing-table,
  .door-pricing-table tbody,
  .special-processing-table,
  .special-processing-table tbody {
    display: block;
    width: 100%;
  }

  .door-pricing-table colgroup,
  .door-pricing-table thead,
  .special-processing-table colgroup,
  .special-processing-table thead {
    display: none;
  }

  .door-pricing-table tbody {
    display: grid;
    gap: 14px;
  }

  .door-pricing-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
  }

  .door-pricing-table tbody th,
  .door-pricing-table tbody td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
  }

  .door-pricing-mobile-field::before,
  .door-pricing-size-cell::before,
  .special-processing-name-cell::before,
  .special-processing-price-cell::before {
    display: block;
    margin-bottom: 5px;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
  }

  .door-pricing-mobile-field::before {
    content: attr(data-mobile-label);
  }

  .door-pricing-mobile-field:has(.door-pricing-color-input) {
    grid-column: 1 / -1;
  }

  .door-pricing-color-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 8px;
  }

  .door-pricing-collapse-toggle {
    display: inline-flex;
    min-width: 62px;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8a47f;
    border-radius: 8px;
    background: #fff7ed;
    color: var(--brand-dark);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
  }

  .door-pricing-collapse-toggle:focus-visible {
    outline: 2px solid rgba(189, 93, 36, 0.3);
    outline-offset: 2px;
  }

  .door-pricing-row-collapsed .door-pricing-size-cell,
  .door-pricing-row-collapsed .door-pricing-action-cell {
    display: none !important;
  }

  .door-pricing-size-cell {
    padding: 8px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 10px;
    background: #fafafa !important;
  }

  .door-pricing-size-cell::before {
    content: attr(data-size-label);
    margin: -8px -8px 8px;
    padding: 6px 8px;
    border-radius: 9px 9px 0 0;
    background: #D46E30;
    color: #fff;
    text-align: center;
  }

  .door-pricing-table input {
    min-height: 42px;
    font-size: 16px;
  }

  .door-pricing-currency-field {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 3px;
  }

  .door-pricing-currency-label {
    font-size: 10px;
  }

  .door-pricing-action-cell {
    grid-column: 1 / -1;
    padding-top: 2px !important;
  }

  .door-pricing-action-cell .pricing-row-actions {
    justify-content: flex-end;
  }

  .door-pricing-action-cell .btn,
  .special-processing-action-cell .btn,
  .pricing-drag-handle {
    min-height: 42px;
  }

  .pricing-drag-handle {
    width: 42px;
    flex-basis: 42px;
  }

  .door-pricing-actions {
    display: grid;
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
    margin-top: 12px;
  }

  .door-pricing-actions .btn,
  .door-pricing-actions .btn-primary {
    width: 100%;
    min-width: 0;
    min-height: 46px;
  }

  .door-pricing-save-group {
    display: grid;
    gap: 6px;
  }

  .door-pricing-save-message {
    text-align: center;
  }

  .special-processing-table tbody {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 12px;
  }

  .special-processing-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
  }

  .special-processing-table tbody th,
  .special-processing-table tbody td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
  }

  .special-processing-name-cell {
    grid-column: auto;
  }

  .special-processing-name-cell::before,
  .special-processing-price-cell::before {
    content: attr(data-mobile-label);
  }

  .special-processing-table input {
    min-height: 42px;
    font-size: 16px;
  }

  .special-processing-action-cell {
    align-self: end;
  }

  .special-processing-action-cell .pricing-row-actions {
    justify-content: flex-end;
  }

  .external-create-fields {
    grid-template-columns: 1fr;
  }

  .external-create-form .btn-primary {
    width: 100%;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 10px;
    padding: 10px 12px;
    align-items: center;
  }

  .toolbar-left {
    display: contents;
  }

  .btn-back {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    padding: 10px 12px;
  }

  .toolbar-actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    flex-wrap: nowrap;
  }

  .toolbar-actions .btn {
    padding: 10px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .form-title-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    width: 100%;
  }

  .door-measures {
    grid-template-columns: 1fr;
  }

  .direction-pick img {
    max-width: 140px;
  }

  .page {
    padding: 8px;
  }

  .form-sheet {
    padding: 12px;
  }

  .calendar-toolbar {
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 8px;
  }

  .calendar-toolbar .btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 8px;
    font-size: 13px;
  }

  .calendar-title {
    flex: 1 1 100%;
    order: -1;
    font-size: 18px;
    margin-bottom: 4px;
  }

  .calendar-legend {
    gap: 8px 12px;
    font-size: 12px;
  }

  .calendar-mobile-hint {
    display: block;
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45;
  }

  .install-batch-panel summary.install-batch-title {
    cursor: pointer;
    padding: 2px 0 8px;
    list-style: none;
  }

  .install-batch-panel summary.install-batch-title::-webkit-details-marker {
    display: none;
  }

  .install-batch-panel summary.install-batch-title::before {
    content: "▸ ";
    color: var(--brand);
  }

  .install-batch-panel[open] summary.install-batch-title::before {
    content: "▾ ";
  }

  .install-range-form,
  .install-quick-actions,
  .install-batch-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .install-range-form .field-block,
  .install-range-form .btn,
  .install-quick-actions .btn,
  .install-batch-actions .btn {
    width: 100%;
  }

  .calendar-scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 0 4px 6px;
  }

  .calendar-grid {
    min-width: 100%;
    gap: 4px;
  }

  .calendar-weekday {
    font-size: 11px;
    padding: 4px 0;
  }

  .calendar-cell {
    min-height: 0;
    aspect-ratio: 1;
    padding: 4px 2px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .calendar-cell-day {
    font-size: 14px;
    margin-bottom: 0;
    text-align: center;
    line-height: 1.2;
    font-weight: 700;
  }

  .calendar-cell-label,
  .calendar-cell-assignment,
  .calendar-assignment-link {
    display: none !important;
  }

  .calendar-cell-summary {
    display: flex !important;
    gap: 2px;
    margin-top: 2px;
  }

  .calendar-summary-item {
    font-size: 9px;
    padding: 2px 3px;
    line-height: 1.25;
  }

  .calendar-cell-assignments {
    display: none !important;
  }

  .calendar-cell[data-status="available"] {
    background: #f0fdf4 !important;
    border-color: #86efac;
  }

  .calendar-cell[data-status="rest"] {
    background: #fef2f2 !important;
    border-color: #fca5a5;
  }

  .calendar-cell[data-status="scheduled"] {
    background: #eff6ff !important;
    border-color: #93c5fd;
  }

  .calendar-cell[data-status="empty"] {
    background: #fff !important;
  }

  .calendar-cell.batch-selected {
    box-shadow: inset 0 0 0 3px var(--brand);
  }

  .calendar-cell.batch-selected .calendar-cell-day::after {
    content: " ✓";
    display: inline;
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
  }

  .day-panel {
    padding: 12px;
  }

  .day-panel h3 {
    font-size: 16px;
  }

  .assignment-row {
    flex-direction: column;
    align-items: stretch;
  }

  .assignment-row .btn {
    width: 100%;
  }

  .list-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  #admin-customer-service-panel {
    min-width: 0;
    padding: 14px 12px;
  }

  .customer-guide-filters {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .customer-guide-search,
  .customer-guide-category-filter {
    width: 100%;
    max-width: none;
  }

  .customer-guide-category-manager {
    padding: 14px 12px;
  }

  .customer-guide-category-manager-head {
    align-items: center;
  }

  .customer-guide-category-manager-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .customer-guide-category-manager-item .btn-save-customer-guide-category {
    grid-column: 1;
  }

  .customer-guide-category-manager-item .btn-delete-customer-guide-category {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .customer-guide-form {
    min-width: 0;
    padding: 16px 14px;
  }

  .customer-guide-form-head {
    align-items: center;
  }

  .customer-guide-form-head-actions {
    flex: 0 0 auto;
  }

  .customer-guide-form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .customer-guide-form .field-block {
    min-width: 0;
  }

  .customer-guide-form input,
  .customer-guide-form textarea,
  #customer-guide-reply-input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  #customer-guide-reply-input {
    min-height: 150px;
  }

  .customer-guide-form-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  .customer-guide-card {
    padding: 16px 14px;
  }

  .customer-guide-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .customer-guide-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .customer-guide-reply {
    width: 100%;
    box-sizing: border-box;
  }

  .user-bar {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

.calendar-mobile-hint {
  display: none;
}

@media (min-width: 641px) {
  .install-batch-panel summary.install-batch-title {
    pointer-events: none;
    cursor: default;
  }

  .install-batch-panel summary.install-batch-title::before {
    content: none;
  }
}

@media screen and (min-width: 641px) {
  .door-detail-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 12px;
  }

  .door-detail-card-grid > .door-detail-card {
    min-width: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid #e2e5e9;
    border-radius: 10px;
    background: #fafafa;
  }

  .door-detail-card-grid > .measurement-detail-field {
    justify-content: flex-start;
  }

  .door-detail-card-grid > .door-detail-card-wide {
    grid-column: span 2;
  }

  .door-detail-card .field-group-label,
  .door-detail-card.measurement-detail-field > span:first-child {
    margin-bottom: 8px;
  }

  .door-detail-card .option-row {
    align-content: flex-start;
  }

  .door-detail-card.measurement-detail-field input {
    min-width: 0;
  }

  .door-detail-card.remark-block {
    margin-top: 0;
  }
}

@media screen and (min-width: 1051px) {
  .door-detail-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media print {
  body {
    background: #fff;
  }

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

  .page {
    max-width: none;
    padding: 0;
  }

  .form-sheet {
    border: none;
    padding: 0;
  }

  .toolbar {
    display: none;
  }

  .btn-remove-door,
  .btn-duplicate-door,
  .btn-remove-site,
  .btn-add-site,
  .btn-toggle-site,
  .btn-toggle-door,
  .btn-collapse-door,
  .site-reorder-controls,
  .section-hint,
  .door-actions {
    display: none !important;
  }

  .site-card.collapsed .site-card-body {
    display: block !important;
  }

  .door-card.collapsed .door-card-body {
    display: block !important;
  }

  .site-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  input,
  textarea {
    border-bottom: none !important;
  }
}

.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.confirm-dialog.hidden {
  display: none;
}

.confirm-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.confirm-dialog-panel {
  position: relative;
  width: min(100%, 420px);
  padding: 20px 22px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.confirm-dialog-title {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.4;
}

.confirm-dialog-message {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  white-space: pre-line;
}

.confirm-dialog-ack {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

.confirm-dialog-ack.hidden {
  display: none;
}

.confirm-dialog-ack input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}

.text-input-dialog-field {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
}

.text-input-dialog-field input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #b7bcc3;
  border-radius: 8px;
  background: #fff;
  color: #222;
  font: inherit;
  font-weight: 400;
}

.text-input-dialog-field input:focus {
  border-color: #bf6425;
  outline: 2px solid rgba(191, 100, 37, 0.18);
  outline-offset: 1px;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.confirm-dialog-actions .btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.quotation-workspace {
  max-width: 1480px;
  margin: 0 auto;
  padding: 22px 26px 48px;
}

.quotation-page-title { margin: 0; color: #944313; font-size: 21px; }
.quotation-page-subtitle { margin-top: 4px; color: #6b7280; font-size: 14px; }
.quotation-tabs { display: flex; gap: 8px; margin-bottom: 14px; border-bottom: 1px solid #e5e7eb; }
.quotation-tab { padding: 12px 18px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #6b7280; font: inherit; cursor: pointer; }
.quotation-tab.active { border-bottom-color: #bf6425; color: #9a4617; font-weight: 700; }
.quotation-version-notice { margin-bottom: 16px; padding: 12px 14px; border: 1px solid #ead7c8; border-radius: 10px; background: #fffaf6; color: #724326; }
.quotation-version-notice.is-detached { border-color: #f0b4b4; background: #fff5f5; color: #9b2c2c; }
.measurement-order-workspace {
  padding: 18px 20px 48px;
  overflow-x: hidden;
  background: #eef0f3;
}
.measurement-order-tabs {
  display: flex;
  gap: 8px;
  box-sizing: border-box;
  width: min(1403px, 100%);
  margin: 0 auto 14px;
  border-bottom: 1px solid #d7dce2;
}
.measurement-order-tab {
  padding: 12px 18px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #6b7280;
  font: inherit;
  cursor: pointer;
}
.measurement-order-tab.active {
  border-bottom-color: #bf6425;
  color: #9a4617;
  font-weight: 700;
}
.measurement-order-help {
  box-sizing: border-box;
  width: min(1403px, 100%);
  margin: 0 auto 14px;
  padding: 11px 14px;
  border: 1px solid #ead7c8;
  border-radius: 9px;
  background: #fffaf6;
  color: #724326;
}
.measurement-order-help.is-detached {
  border-color: #f0b4b4;
  background: #fff5f5;
  color: #9b2c2c;
}
#measurement-order-editor {
  width: 100%;
  max-width: 1403px;
  margin: 0 auto;
}
#measurement-order-editor .measurement-excel-print-sheet {
  box-shadow: 0 3px 14px rgba(15, 23, 42, .14);
}
.measurement-jpg-staging {
  position: fixed;
  left: 0;
  top: 0;
  width: 1403px;
  height: 992px;
  overflow: hidden;
  pointer-events: none;
  z-index: -2147483647;
  background: #fff;
}
.measurement-excel-print-sheet {
  box-sizing: border-box;
  width: 1403px;
  height: 992px;
  padding: 90px 104px 0 84px;
  overflow: hidden;
  background: #fff;
  color: #111;
  font-family: "Microsoft JhengHei", "Noto Sans TC", sans-serif;
}
.measurement-excel-print-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.2;
}
.measurement-excel-print-table th,
.measurement-excel-print-table td {
  box-sizing: border-box;
  padding: 0 4px;
  border: 1px solid #d9d9d9;
  text-align: center;
  vertical-align: middle;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.measurement-excel-print-table .measurement-excel-title th {
  height: 32px;
  border-color: #d46e30;
  background: #d46e30;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.measurement-excel-info { height: 32px; }
.measurement-excel-info th,
.measurement-excel-columns th,
.measurement-excel-record th { font-weight: 700; }
.measurement-excel-info td { text-align: left; }
.measurement-excel-info td:last-child { text-align: left; }
.measurement-excel-logo { text-align: center !important; }
.measurement-excel-logo img {
  display: block;
  width: auto;
  max-width: 105px;
  max-height: 60px;
  margin: 0 auto;
  object-fit: contain;
}
.measurement-excel-columns { height: 22px; }
.measurement-excel-door-row { height: 32px; }
.measurement-excel-separator td { height: 15px; }
.measurement-excel-record th,
.measurement-excel-record td { height: 17px; }
.measurement-excel-record td { text-align: left; }
.measurement-order-editable-sheet {
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 24px;
  overflow: visible;
}
.measurement-order-editable-sheet .measurement-excel-print-table {
  font-size: clamp(11px, .9vw, 14px);
}
.measurement-order-editable-sheet .measurement-excel-title th { height: 40px; font-size: 18px; }
.measurement-order-editable-sheet .measurement-excel-info { height: 42px; }
.measurement-order-editable-sheet .measurement-excel-columns { height: 34px; }
.measurement-order-editable-sheet .measurement-excel-door-row { height: 42px; }
.measurement-order-editable-sheet .measurement-excel-record th,
.measurement-order-editable-sheet .measurement-excel-record td { height: 40px; }
.measurement-order-cell-editor {
  display: flex;
  min-width: 0;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  outline: none;
  white-space: pre-wrap;
}
.measurement-order-cell-editor.is-left { justify-content: flex-start; text-align: left; }
.measurement-order-editable-sheet .measurement-order-cell-editor[contenteditable]:hover {
  background: #fff7ed;
  box-shadow: inset 0 0 0 1px #e5a36e;
}
.measurement-order-editable-sheet .measurement-order-cell-editor[contenteditable]:focus {
  background: #fffaf5;
  box-shadow: inset 0 0 0 2px #c45a11;
}

@media (max-width: 720px) {
  .measurement-order-workspace { padding: 12px 10px 36px; }
  .measurement-order-tab { flex: 1; padding: 10px 6px; }
}
.quotation-sheet { padding: 22px; border: 1px solid #d7dce2; border-radius: 14px; background: #fff; box-shadow: 0 2px 8px rgba(30, 41, 59, .06); }
.quotation-customer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.quotation-field { display: flex; flex-direction: column; gap: 6px; color: #6b7280; font-size: 13px; }
.quotation-field-wide { grid-column: 1 / -1; }
.quotation-field input { width: 100%; padding: 10px 12px; border: 1px solid #cfd4da; border-radius: 8px; font: inherit; color: #111827; background: #fff; }
.quotation-field input:disabled { border-color: #e5e7eb; background: #f8fafc; color: #374151; }
.quotation-table-wrap { overflow-x: auto; }
.quotation-table { width: 100%; border-collapse: collapse; min-width: 880px; }
.quotation-table th, .quotation-table td { padding: 9px 8px; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: middle; }
.quotation-table th { background: #faf7f4; color: #7c3e18; }
.quotation-table input { width: 100%; min-width: 70px; padding: 8px; border: 1px solid #d5d9de; border-radius: 6px; font: inherit; }
.quotation-table .quotation-number { text-align: right; white-space: nowrap; }
.quotation-table .quotation-remove-item { color: #c43c3c; background: transparent; border: 0; cursor: pointer; }
.quotation-add-row { margin-top: 14px; }
.quotation-summary { display: flex; justify-content: flex-end; margin-top: 18px; }
.quotation-summary-box { width: min(100%, 360px); }
.quotation-summary-line { display: flex; justify-content: space-between; padding: 7px 0; }
.quotation-summary-line.total { margin-top: 5px; padding-top: 12px; border-top: 1px solid #d7dce2; color: #9a4617; font-size: 18px; font-weight: 700; }

@media (max-width: 720px) {
  .quotation-workspace { padding: 14px 10px 36px; }
  .quotation-customer-grid { grid-template-columns: 1fr; }
  .quotation-field-wide { grid-column: auto; }
  .quotation-tabs { overflow-x: auto; }
  .quotation-tab { flex: 0 0 auto; padding: 11px 12px; }
}

/* 專案報價單：畫面即為 Excel / PDF 報價單版面 */
.quotation-workspace {
  max-width: none;
  background: #eef0f3;
}

#quotation-editor {
  overflow-x: auto;
  padding: 4px 0 24px;
}

.quotation-document {
  position: relative;
  box-sizing: border-box;
  width: min(100%, 1180px);
  min-width: 920px;
  margin: 0 auto;
  padding: 46px 48px 36px;
  border: 1px solid #d7d7d7;
  background: #fff;
  color: #222;
  box-shadow: 0 5px 18px rgba(31, 41, 55, .12);
  font-family: "Microsoft JhengHei", "Noto Sans TC", sans-serif;
}

.quotation-document-title,
.quotation-section-title {
  color: #fff;
  font-weight: 700;
}

.quotation-document-title {
  padding: 8px 12px;
  background: #d56f2f;
  text-align: center;
  font-size: 24px;
  letter-spacing: .08em;
}

.quotation-document-section {
  margin-top: 20px;
}

.quotation-section-title {
  padding: 6px 8px;
  text-align: left;
  font-size: 16px;
}

.quotation-section-title.orange {
  background: #d56f2f;
  text-align: center;
}

.quotation-section-title.blue {
  background: #2f5f94;
}

.quotation-document table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.quotation-document table th,
.quotation-document table td {
  box-sizing: border-box;
  border: 1px solid #b8b8b8;
  background: #fff;
  color: #222;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
  vertical-align: middle;
}

.quotation-document table th {
  padding: 5px 7px;
  white-space: nowrap;
}

.quotation-document input,
.quotation-document textarea {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  outline: none;
  background: transparent;
  color: #222;
  font: inherit;
}

.quotation-document input {
  min-height: 31px;
  padding: 4px 6px;
}

.quotation-document textarea {
  display: block;
  min-height: 42px;
  padding: 7px 6px;
  resize: vertical;
  overflow: hidden;
}

.quotation-document input:disabled,
.quotation-document textarea:disabled {
  opacity: 1;
  -webkit-text-fill-color: #222;
}

.quotation-document.is-editable input:hover,
.quotation-document.is-editable textarea:hover {
  border-color: #e4b48e;
  background: #fffaf5;
}

.quotation-document.is-editable input:focus,
.quotation-document.is-editable textarea:focus {
  border-color: #c46526;
  background: #fff8ef;
  box-shadow: 0 0 0 2px rgba(196, 101, 38, .14);
}

.quotation-info-table th {
  width: 105px;
  text-align: left;
}

.quotation-info-table td {
  padding: 0 2px;
}

.quotation-document .quotation-table-wrap {
  overflow: visible;
}

.quotation-document .quotation-table {
  min-width: 0;
}

.quotation-document .quotation-table th,
.quotation-document .quotation-table td {
  padding: 0 3px;
  text-align: center;
}

.quotation-document .quotation-table thead th {
  padding: 7px 5px;
  background: #fff;
  color: #222;
  font-weight: 400;
}

.quotation-document-detail th:nth-child(1) { width: 7%; }
.quotation-document-detail th:nth-child(2) { width: 26%; text-align: left; }
.quotation-document-detail th:nth-child(3) { width: 7%; }
.quotation-document-detail th:nth-child(4) { width: 7%; }
.quotation-document-detail th:nth-child(5) { width: 10%; }
.quotation-document-detail th:nth-child(6) { width: 11%; }
.quotation-document-detail th:nth-child(7) { width: 32%; text-align: left; }
.quotation-document-detail .quotation-action-column { width: 40px; }
.quotation-document-detail td:nth-child(2),
.quotation-document-detail td:nth-child(7) { text-align: left; }
.quotation-document-detail td:nth-child(2) input,
.quotation-document-detail td:nth-child(7) input { text-align: left; }
.quotation-document-detail input { text-align: center; }
.quotation-document .quotation-number { padding: 4px 5px; text-align: center; }
.quotation-item-number { padding: 5px !important; }

.quotation-document .quotation-remove-item {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #b42318;
  font-size: 20px;
  line-height: 1;
}

.quotation-document .quotation-add-row {
  margin-top: 8px;
  text-align: center;
}

.quotation-summary-table td,
.quotation-summary-table th {
  height: 29px;
}

.quotation-summary-table td:first-child { width: 40%; }
.quotation-summary-table th { width: 20%; text-align: left; }
.quotation-summary-table td:nth-child(3) { width: 18%; padding: 4px 8px; text-align: center; }
.quotation-summary-table tr:last-child th,
.quotation-summary-table tr:last-child td:nth-child(3) { font-weight: 700; }

.quotation-payment-table th {
  width: 95px;
  text-align: left;
  font-weight: 700 !important;
}

.quotation-payment-table .quotation-payment-label-col { width: 95px; }
.quotation-payment-table .quotation-payment-account-label-col { width: 75px; }
.quotation-payment-table td { padding: 0 2px; }
.quotation-payment-table [data-quotation-payment-field="accountNumber"] {
  font-weight: 700;
  letter-spacing: .02em;
}

.quotation-notes-table th {
  width: 78px;
  text-align: center;
}

.quotation-notes-table td { padding: 0 2px; }

.quotation-confirm-copy {
  padding: 7px 8px;
  border: solid #b8b8b8;
  border-width: 0 1px 1px;
  font-size: 15px;
}

.quotation-signature-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 95px;
  border: solid #b8b8b8;
  border-width: 0 1px 1px;
}

.quotation-signature-grid > div {
  display: flex;
  align-items: center;
  padding: 12px 8px;
}

.quotation-signature-grid > div + div {
  border-left: 1px solid #b8b8b8;
}

.quotation-company-stamp {
  position: absolute;
  right: 8px;
  bottom: 3px;
  width: 220px;
  max-height: 104px;
  object-fit: contain;
  opacity: .52;
  transform: rotate(-6deg);
  pointer-events: none;
}

.quotation-document-reference {
  margin-top: 8px;
  color: #8b8b8b;
  text-align: right;
  font-size: 12px;
}

.quotation-pdf-staging {
  position: fixed;
  top: 0;
  left: 0;
  box-sizing: border-box;
  width: 794px;
  overflow: hidden;
  background: #fff;
  pointer-events: none;
  z-index: -2147483647;
}

.quotation-document.is-pdf-export {
  width: 756px;
  min-width: 0;
  max-width: none;
  margin: 0 auto;
  padding: 7mm 8mm 6mm;
  border: 0;
  box-shadow: none;
  transform: none;
}

.quotation-document.is-pdf-export .quotation-document-title {
  padding: 5px 8px;
  font-size: 17px;
}

.quotation-document.is-pdf-export .quotation-document-section {
  margin-top: 4mm;
  break-inside: avoid;
  page-break-inside: avoid;
}

.quotation-document.is-pdf-export .quotation-section-title {
  padding: 3px 5px;
  font-size: 11px;
}

.quotation-document.is-pdf-export table th,
.quotation-document.is-pdf-export table td,
.quotation-document.is-pdf-export .quotation-confirm-copy {
  padding: 2px 4px;
  font-size: 9px;
  line-height: 1.25;
}

.quotation-pdf-value,
.quotation-pdf-textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 2px 4px;
  color: #222;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.quotation-document.is-pdf-export .quotation-pdf-textarea {
  min-height: 0;
  padding: 3px 4px;
}

.quotation-document.is-pdf-export .quotation-notes-table th {
  width: 9mm;
}

.quotation-document.is-pdf-export .quotation-signature-grid {
  min-height: 21mm;
  font-size: 9px;
}

.quotation-document.is-pdf-export .quotation-company-stamp {
  width: 43mm;
  max-height: 22mm;
}

@media (max-width: 720px) {
  .quotation-document {
    padding: 28px 28px 24px;
  }
}
.google-calendar-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 18px 0;
  padding: 18px 20px;
  border: 1px solid #f0c59f;
  border-radius: 14px;
  background: #fffaf5;
}

.google-calendar-copy h2 {
  margin: 0 0 6px;
  color: #914518;
  font-size: 20px;
}

.google-calendar-copy p {
  margin: 0;
}

.google-calendar-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .google-calendar-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .google-calendar-actions .btn {
    width: 100%;
  }
}
