:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --vacant: #64748b;
  --occupied: #22c55e;
  --reserved: #f59e0b;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: #ffffff;
  color: var(--text);
  line-height: 1.5;
}

.is-file-protocol .file-protocol-warning {
  display: block;
}

.file-protocol-warning {
  display: none;
  margin: 0;
  padding: 1rem 1.25rem;
  background: #7f1d1d;
  color: #fecaca;
  border-bottom: 2px solid #ef4444;
  font-size: 0.92rem;
  line-height: 1.55;
}

.file-protocol-warning strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #fff;
  font-size: 1rem;
}

.file-protocol-warning p {
  margin: 0 0 0.5rem;
}

.file-protocol-warning ol {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.file-protocol-warning code {
  background: rgba(0, 0, 0, 0.25);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
}

.file-protocol-warning a {
  color: #fde68a;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  font-size: 2rem;
}

.brand-home-link {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  line-height: 1;
}

.brand-home-link:hover {
  opacity: 0.85;
}

.brand-home-link:focus-visible {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: 2px;
}

.brand h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.export-dropdown {
  position: relative;
}

.import-dropdown {
  position: relative;
}

.import-file-option {
  cursor: pointer;
  display: block;
}

.export-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.35rem;
  z-index: 200;
}

.export-menu.hidden {
  display: none;
}

.export-option {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.export-option:hover {
  background: var(--surface-hover);
}

.export-menu-divider {
  height: 1px;
  margin: 0.35rem 0.25rem;
  background: var(--border);
}

.export-option-google {
  color: #4285f4;
  font-weight: 500;
}

.google-account-btn {
  max-width: 220px;
  gap: 0.45rem;
}

.google-account-btn.signed-in .google-dot {
  background: #4285f4;
}

.google-account-btn .google-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.google-account-btn #googleAccountLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.google-account-dropdown {
  position: relative;
}

.room-contract-actions {
  padding-top: 0.25rem;
  border-top: 1px dashed var(--border);
}

.btn-contract {
  width: 100%;
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.btn-contract:hover {
  background: rgba(59, 130, 246, 0.08);
}

.room-contract-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.room-contract-buttons .btn-contract {
  width: auto;
  flex: 1;
  min-width: 140px;
}

.room-contract-feedback {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
}

.room-contract-feedback-error {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

.profile-section-title {
  margin: 1.25rem 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.profile-section-title:first-of-type {
  margin-top: 0;
}

.business-profile-body {
  max-height: 70vh;
  overflow-y: auto;
}

.contract-template-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.contract-template-preset-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.contract-template-preset-chip {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface, #fff);
}

.contract-template-preset-btn {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: none;
  border-radius: 0;
}

.contract-template-preset-delete {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  padding: 0 0.35rem;
  border: none;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--muted, #888);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.contract-template-preset-delete:hover {
  background: rgba(220, 53, 69, 0.08);
  color: #c0392b;
}

.add-room-count-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.signature-pad-wrap {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  background: #fff;
}

.signature-pad {
  display: block;
  width: 100%;
  height: 140px;
  touch-action: none;
  cursor: crosshair;
  background: #fff;
  border-radius: 6px;
}

.contract-admin-preview iframe {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.contract-view-lock {
  margin: 0.75rem 0 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt, #f8fafc);
}

.contract-view-lock-action {
  display: flex;
  align-items: flex-end;
  padding-bottom: 0.15rem;
}

.contract-view-lock-error {
  color: #dc2626;
  margin-top: 0.5rem;
}

.contract-admin-preview.contract-preview-locked iframe {
  min-height: 120px;
  opacity: 0.35;
  pointer-events: none;
  filter: blur(2px);
}

.sign-link-copy-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.sign-link-copy-row .field-input {
  flex: 1;
  min-width: 0;
}

.sign-link-copy-row .btn {
  flex-shrink: 0;
}

.sign-link-sms-row {
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.sign-link-tenant-phone {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.sign-link-sms-row .btn {
  width: 100%;
}

.sign-link-sms-row .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.contract-status-badge {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}

.contract-status-waiting {
  background: rgba(234, 179, 8, 0.12);
  color: #a16207;
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.contract-status-tenant-done {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.contract-status-completed {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.contract-status-rejected {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.contract-admin-action-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.contract-admin-action-section .profile-section-title {
  margin-top: 0;
}

.contract-admin-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.contract-admin-status {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.contract-admin-status-tenant-done {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.contract-admin-status-completed {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.contract-completed-panel {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.contract-completed-message {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1d4ed8;
}

.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-occupied .stat-value { color: var(--occupied); }
.stat-vacant .stat-value { color: var(--vacant); }
.stat-revenue .stat-value { color: var(--primary); font-size: 1.2rem; }
.stat-deposit .stat-value { color: var(--warning); font-size: 1.2rem; }
.stat-unpaid .stat-value { color: var(--danger); }

.room-card.unpaid {
  border-color: rgba(239, 68, 68, 0.55);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2);
}

.room-card.rent-paid {
  border: 2px solid #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.rent-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-weight: 600;
  margin-top: 0.35rem;
  display: inline-block;
}

.rent-badge.paid {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.rent-badge.unpaid {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.rent-badge.na {
  background: rgba(100, 116, 139, 0.2);
  color: var(--vacant);
}

.room-card.has-arrears {
  border-color: rgba(245, 158, 11, 0.55);
}

.room-unpaid-manual {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--warning);
  margin-top: 0.35rem;
  line-height: 1.3;
}

.col-unpaid {
  font-size: 0.85rem;
  color: var(--warning);
  white-space: nowrap;
}

.form-hint-block {
  margin: -0.5rem 0 0.25rem;
  padding-left: 0.1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
}

.checkbox-label input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--primary);
}

.form-hint {
  margin: 0.35rem 0 0 1.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rent-paid-row.hidden {
  display: none;
}

.rent-paid-toggle {
  display: block;
  cursor: pointer;
  margin: 0;
}

.rent-paid-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.rent-paid-toggle-face {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.85rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.rent-paid-toggle-face:hover {
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
  background: color-mix(in srgb, var(--success) 4%, var(--surface));
}

.rent-paid-toggle-input:focus-visible + .rent-paid-toggle-face {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.rent-paid-toggle-input:checked + .rent-paid-toggle-face {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, var(--surface));
  color: color-mix(in srgb, var(--success) 85%, var(--text));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--success) 20%, transparent);
}

.rent-paid-toggle-check {
  flex: 0 0 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid currentColor;
  border-radius: 6px;
  position: relative;
  opacity: 0.55;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s;
}

.rent-paid-toggle-check::after {
  content: "";
  position: absolute;
  left: 0.32rem;
  top: 0.12rem;
  width: 0.45rem;
  height: 0.75rem;
  border: solid transparent;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.15s;
}

.rent-paid-toggle-input:checked + .rent-paid-toggle-face .rent-paid-toggle-check {
  opacity: 1;
  background: var(--success);
  border-color: var(--success);
}

.rent-paid-toggle-input:checked + .rent-paid-toggle-face .rent-paid-toggle-check::after {
  border-color: #fff;
  opacity: 1;
}

.rent-paid-hint {
  margin-left: 0;
  text-align: center;
}

.hidden {
  display: none !important;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab-board-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 10rem;
  min-width: 0;
  max-width: 100%;
}

.board-notice-ticker {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  cursor: pointer;
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  padding: 0.2rem 0.45rem;
  height: 2rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow: hidden;
}

.board-notice-ticker:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}

.board-notice-marquee {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 1.35rem;
  line-height: 1.35rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.84rem;
  color: var(--text);
  vertical-align: middle;
  overflow: hidden;
}

.board-notice-ticker-badge {
  flex-shrink: 0;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
}

@media (max-width: 720px) {
  .tab-board-group {
    flex: 1 1 100%;
    width: 100%;
  }

  .board-notice-ticker {
    flex: 1 1 auto;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .board-notice-marquee {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.tab {
  padding: 0.65rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.panel.hidden {
  display: none !important;
}

main > .panel {
  display: none !important;
}

main > .panel.active {
  display: block !important;
}

#panelBoard:not(.active) {
  display: none !important;
}

.room-order {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.col-order {
  color: var(--text-muted);
  font-weight: 600;
  width: 3rem;
}

.modal-footer-split {
  justify-content: space-between;
  align-items: center;
}

.modal-footer-left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.modal-footer-actions {
  display: flex;
  gap: 0.5rem;
}

.finance-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.month-picker-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.month-picker-label input {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.finance-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.finance-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.finance-card h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.finance-card.income h3 { color: var(--success); }
.finance-card.expense h3 { color: var(--danger); }
.finance-card.net h3 { color: var(--primary); }

.finance-card dl {
  margin: 0;
}

.finance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(45, 58, 79, 0.5);
}

.finance-row:last-child {
  border-bottom: none;
}

.finance-row dt {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.finance-row dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.finance-row.editable dd {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.finance-row.editable input {
  width: 120px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  text-align: right;
}

.finance-row.total {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  border-bottom: none;
}

.finance-row.total dt,
.finance-row.total dd {
  font-size: 1rem;
  color: var(--text);
  font-weight: 700;
}

.tag-auto {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.2);
  color: var(--primary);
  font-weight: 600;
  vertical-align: middle;
}

.unit {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.net-label {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.net-value {
  margin: 0.35rem 0;
  font-size: 2rem;
  font-weight: 800;
  color: var(--success);
  letter-spacing: -0.02em;
}

.net-value.negative {
  color: var(--danger);
}

.net-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.finance-card-memo {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(45, 58, 79, 0.5);
}

.finance-card-memo label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.finance-card-memo textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 3.5rem;
}

.finance-recurring-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(45, 58, 79, 0.5);
}

.finance-recurring-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.finance-recurring-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.finance-recurring-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.finance-recurring-hint {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.finance-recurring-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.finance-recurring-empty {
  margin: 0;
  padding: 0.5rem 0;
}

.finance-recurring-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 140px) auto;
  gap: 0.5rem;
  align-items: center;
}

.finance-recurring-name {
  min-width: 0;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  line-height: 1.3;
}

.finance-recurring-amount-wrap {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.finance-recurring-amount {
  width: 100%;
  min-width: 0;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  text-align: right;
}

.finance-recurring-remove {
  min-width: 1.75rem;
  padding: 0.25rem 0.4rem;
  font-size: 1rem;
  line-height: 1;
}

.finance-save-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem 1rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: sticky;
  bottom: 0.75rem;
  z-index: 6;
}

.finance-save-bar .btn-primary {
  min-width: 9rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
}

.finance-save-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.finance-memo-row {
  margin-bottom: 1.5rem;
}

.finance-memo-row label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.finance-memo-row textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  resize: vertical;
}

.finance-paid-list h3 {
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
  color: var(--text-muted);
}

.paid-rooms-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 280px;
  overflow-y: auto;
}

.paid-room-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.paid-room-item:last-child {
  border-bottom: none;
}

.paid-room-order {
  color: var(--text-muted);
  font-weight: 600;
  min-width: 3rem;
}

.paid-room-name {
  flex: 1;
}

.paid-room-fee {
  font-weight: 600;
  color: var(--success);
}

.empty-inline {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  margin: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.search-wrap {
  flex: 1;
  min-width: 200px;
}

.search-wrap input {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.filters {
  display: flex;
  gap: 0.5rem;
}

.filters select {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.view-btn {
  padding: 0.55rem 0.85rem;
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.15s, color 0.15s;
}

.view-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

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

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.room-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  text-align: left;
  font-family: inherit;
  color: inherit;
  width: 100%;
  contain: layout style paint;
}

.room-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.room-card.rent-paid:hover {
  transform: translateY(-2px);
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}

.room-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.room-number {
  font-size: 1.1rem;
  font-weight: 700;
}

.status-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-vacant {
  background: rgba(100, 116, 139, 0.25);
  color: #94a3b8;
}

.status-occupied {
  background: rgba(34, 197, 94, 0.2);
  color: var(--occupied);
}

.status-reserved {
  background: rgba(245, 158, 11, 0.2);
  color: var(--reserved);
}

.status-emergency {
  background: rgba(239, 68, 68, 0.22);
  color: #f87171;
}

.room-fee {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.room-preview {
  margin: 0.35rem 0 0.25rem;
  min-height: 2.25rem;
}

.room-tenant-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-tenant-name .no-tenant {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.room-tenant-phone {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-payment-day {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 0.35rem;
}

.room-payment-day--sort-focus {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px dashed rgba(59, 130, 246, 0.35);
}

.room-payment-day--sort-focus .room-payment-day-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.room-payment-day--sort-focus .room-payment-day-value {
  font-size: 2.15rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
  letter-spacing: -0.03em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.room-payment-day--sort-focus .room-payment-day-value small {
  font-size: 0.48em;
  font-weight: 700;
  margin-left: 0.05em;
}

.room-card--movein-sort .room-preview {
  min-height: 3.5rem;
}

.room-card--movein-sort .room-tenant-name,
.room-card--movein-sort .room-tenant-phone {
  opacity: 0.88;
}

.room-move-out-day {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f59e0b;
  margin-top: 0.25rem;
}

.panel-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.panel-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.departed-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.departed-link-btn {
  font-size: 0.82rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.departed-link-btn:hover {
  border-color: rgba(245, 158, 11, 0.45);
  color: #f59e0b;
}

.departed-link-count {
  font-weight: 700;
  color: #f59e0b;
}

.subpage-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.subpage-nav-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.departed-page-desc {
  margin: 0 0 1rem;
}

.departed-page .departed-table-wrap {
  max-height: none;
}

.departed-embed {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.departed-embed-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: none;
  background: rgba(245, 158, 11, 0.06);
  color: inherit;
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
}

.departed-embed-toggle:hover {
  background: rgba(245, 158, 11, 0.1);
}

.departed-embed-title {
  font-weight: 600;
  color: var(--text-muted);
}

.departed-embed-chevron {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.departed-embed.is-open .departed-embed-chevron {
  transform: rotate(180deg);
}

.departed-embed-body {
  padding: 0 0.85rem 0.85rem;
  border-top: 1px solid var(--border);
}

.departed-embed-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.65rem 0 0.5rem;
}

.departed-search-wrap {
  flex: 1;
  min-width: 140px;
}

.departed-search-wrap input {
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
}

.departed-embed-toolbar select {
  font-size: 0.82rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}

.departed-table-wrap--embed {
  max-height: 220px;
  overflow: auto;
}

.departed-table-wrap--embed .room-table {
  font-size: 0.8rem;
}

.departed-table-wrap--embed .room-table th,
.departed-table-wrap--embed .room-table td {
  padding: 0.4rem 0.5rem;
}

.departed-count {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.departed-toolbar {
  margin-bottom: 1rem;
}

.departed-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.col-actions {
  white-space: nowrap;
}

.col-actions .btn + .btn {
  margin-left: 0.35rem;
}

.btn-move-out {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.btn-move-out:hover {
  background: rgba(245, 158, 11, 0.25);
}

.modal-wide {
  max-width: 560px;
}

.modal-wide .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

.room-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.room-table-wrap.hidden {
  display: none;
}

.room-grid.hidden {
  display: none;
}

.room-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.room-table th,
.room-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.room-table th {
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.room-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

.room-table tbody tr:hover {
  background: var(--surface-hover);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

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

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

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface-hover);
}

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.15);
}

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

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

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

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.file-label {
  cursor: pointer;
}

.cloud-sync-status {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.15);
  white-space: nowrap;
}

.cloud-sync-status.cloud-synced {
  color: #34a853;
  border-color: rgba(52, 168, 83, 0.45);
  background: rgba(52, 168, 83, 0.12);
}

.cloud-sync-status.cloud-syncing,
.cloud-sync-status.cloud-saving {
  color: var(--primary);
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.12);
}

.cloud-sync-status.cloud-offline {
  color: var(--text-muted);
}

.cloud-sync-status.cloud-error {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
}

.modal {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  max-width: 480px;
  width: calc(100% - 2rem);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.modal-footer.modal-footer-split {
  flex-wrap: wrap;
}

.form-row label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.date-segments {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  width: 100%;
}

.date-segments input {
  padding: 0.65rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  min-height: 2.75rem;
  box-sizing: border-box;
}

.date-segments input:focus {
  outline: none;
  border-color: var(--primary);
}

.date-segments .date-year {
  flex: 1.6 1 0;
  min-width: 4.5rem;
}

.date-segments .date-month,
.date-segments .date-day {
  flex: 1 0 0;
  width: 3.5rem;
  min-width: 3.25rem;
  max-width: 4.25rem;
}

.date-sep {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 1rem;
  user-select: none;
  flex: 0 0 auto;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 200;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.saving-block-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.saving-block-overlay.hidden {
  display: none !important;
}

.saving-block-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 22rem;
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  text-align: center;
}

.saving-block-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: saving-block-spin 0.8s linear infinite;
}

.saving-block-message {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

@keyframes saving-block-spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.field-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.field-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.field-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.contract-token-hint {
  list-style: none;
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-hover);
  display: grid;
  gap: 0.35rem;
  font-size: 0.8rem;
}

.contract-token-hint li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.contract-token-name {
  min-width: 5.5rem;
  font-weight: 600;
  color: var(--text);
}

.contract-token-hint code {
  font-size: 0.78rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
  max-height: 280px;
  overflow-y: auto;
}

.backup-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.backup-list-item:hover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
}

.backup-list-item input[type="radio"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.backup-list-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.backup-list-item-name {
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.backup-list-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.backup-delete-confirm-message {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

.feedback-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.feedback-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.feedback-form textarea {
  width: 100%;
  min-height: 120px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
}

.feedback-form-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.feedback-list-section {
  margin-top: 0.5rem;
}

.feedback-list-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.feedback-count {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feedback-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}

.feedback-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.feedback-item-id {
  font-weight: 600;
  color: var(--primary);
}

.feedback-item-content {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  color: var(--text);
}

.feedback-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}

.feedback-empty.hidden,
.feedback-list:empty {
  display: none;
}

.feedback-admin-badge {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}

.feedback-reply {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.feedback-reply-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.feedback-reply-content {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  color: var(--text);
}

.feedback-reply-form {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
}

.feedback-reply-form textarea {
  width: 100%;
  min-height: 88px;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
}

.feedback-reply-form-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.board-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.board-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.board-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
}

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

.board-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.board-form textarea {
  width: 100%;
  min-height: 120px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
}

.board-form-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.board-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.board-admin-badge {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--primary);
}

.board-list-section {
  margin-top: 0.5rem;
}

.board-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: stretch;
}

.board-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.board-column.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.board-column.active .board-column-header {
  background: color-mix(in srgb, var(--primary) 8%, var(--bg));
}

.board-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.board-column-title {
  display: block;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.board-column-header .board-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 12%, var(--surface));
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}

.board-column.active .board-column-header .board-count {
  background: var(--primary);
  color: #fff;
}

.board-column-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.55rem;
  flex: 1;
}

.board-column-empty {
  margin: 0;
  padding: 1.25rem 0.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.board-column-more {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}

.board-column-more:hover {
  background: color-mix(in srgb, var(--primary) 8%, var(--bg));
}

.board-expanded-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.board-expanded-bar.hidden {
  display: none;
}

.board-expanded-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.board-list-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.board-count {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.board-list-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(110px, auto);
  gap: 0.85rem;
}

.board-preview-card--compact {
  min-height: 0;
}

.board-preview-card--compact .board-preview-body {
  padding: 0.65rem 0.7rem 0.7rem;
  gap: 0.25rem;
}

.board-preview-card--compact .board-preview-title {
  font-size: 0.82rem;
  -webkit-line-clamp: 1;
}

.board-preview-card--compact .board-preview-text {
  font-size: 0.76rem;
  -webkit-line-clamp: 2;
}

.board-preview-card--compact .board-preview-footer {
  font-size: 0.72rem;
  margin-top: 0.05rem;
}

.board-preview-card--compact .board-preview-badges {
  gap: 0.25rem;
}

.board-preview-card--compact .board-badge {
  font-size: 0.68rem;
  padding: 0.1rem 0.35rem;
}

.board-preview-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 132px;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.board-preview-card:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
  transform: translateY(-1px);
}

.board-preview-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.board-preview-thumb {
  height: 88px;
  background: var(--bg) center / cover no-repeat;
  border-bottom: 1px solid var(--border);
}

.board-preview-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 0.95rem 0.9rem;
}

.board-preview-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.board-preview-text {
  flex: 1;
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.board-preview-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.board-preview-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.board-badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.board-badge-reply {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.board-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.board-pagination.hidden {
  display: none;
}

.board-pagination-info {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.board-detail-close-form {
  display: none;
}

.board-detail-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal.board-detail-modal {
  max-width: calc(100vw - 2rem);
}

.board-detail-modal:not([open]) {
  display: none !important;
}

.board-detail-modal[open] {
  display: flex;
  flex-direction: column;
  width: min(36rem, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  min-width: min(18rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  margin: auto;
  border: none;
  padding: 0;
}

.board-detail-modal[open].board-detail-modal--compact {
  width: min(26rem, calc(100vw - 2rem));
}

.board-detail-modal[open].board-detail-modal--wide {
  width: min(48rem, calc(100vw - 2rem));
}

.board-detail-modal .modal-body {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1.25rem 1.75rem;
}

.board-detail-header {
  align-items: flex-start;
  gap: 0.75rem;
}

.board-detail-header h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.45;
  word-break: break-word;
}

.board-detail-header .modal-close {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.board-detail-modal .modal-footer {
  flex-shrink: 0;
}

.board-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.board-detail-article {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.35rem 1.5rem;
}

.board-detail-content {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.75;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--text);
  max-width: 42em;
  margin: 0 auto;
}

.board-detail-body .board-attachments {
  margin-top: 0;
  padding: 1rem 1.1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.board-detail-body .board-attachment-thumb {
  max-width: 100%;
  max-height: 280px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.board-detail-body .board-attachments-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.board-detail-body .board-reply {
  margin-top: 0;
}

.board-detail-body .board-item-actions {
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .board-detail-modal[open],
  .board-detail-modal[open].board-detail-modal--compact,
  .board-detail-modal[open].board-detail-modal--wide {
    width: calc(100vw - 1.25rem) !important;
    min-width: 0;
  }

  .board-detail-modal .modal-body {
    padding: 1rem 1.15rem;
  }

  .board-detail-article {
    padding: 1rem 1.1rem;
  }
}

.board-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.board-edit-textarea {
  width: 100%;
  min-height: 180px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  resize: vertical;
}

.board-form textarea,
.board-reply-form textarea {
  white-space: pre-wrap;
}

.board-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.15rem;
}

.board-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.board-item-title {
  width: 100%;
  font-size: 1rem;
  color: var(--text);
}

.board-item-id {
  font-weight: 600;
}

.board-item-content {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.95rem;
}

.board-attachments {
  margin-top: 0.85rem;
}

.board-attachments-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.board-attachments-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.board-attachments-list a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
}

.board-attachment-thumb {
  display: block;
  max-width: 240px;
  max-height: 180px;
  margin-bottom: 0.35rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.board-pending-files {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.board-pending-file {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.board-reply {
  margin-top: 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.board-reply-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.board-reply-content {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 0.92rem;
}

.board-reply-form {
  margin-top: 0.85rem;
}

.board-reply-form textarea {
  width: 100%;
  min-height: 80px;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
}

.board-item-actions {
  margin-top: 0.65rem;
  display: flex;
  justify-content: flex-end;
}

.board-empty {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.board-empty.hidden {
  display: none;
}

@media (max-width: 900px) {
  .board-tab {
    min-height: 2.35rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 1100px) {
  .board-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .board-header {
    flex-direction: column;
    align-items: stretch;
  }

  .board-header .btn {
    align-self: flex-end;
  }

  #panelBoard .panel-desc {
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .board-tabs {
    display: none;
  }

  .board-column {
    border-radius: 10px;
  }

  .board-column-header {
    padding: 0.85rem 1rem;
  }

  .board-column-title {
    font-size: 1rem;
  }

  .board-expanded-bar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .board-expanded-title {
    flex: 1 1 100%;
    font-size: 0.95rem;
    line-height: 1.35;
  }

  .board-preview-card--compact .board-preview-title {
    font-size: 0.88rem;
    line-height: 1.35;
    -webkit-line-clamp: 2;
  }

  .board-columns {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .board-list-grid {
    grid-template-columns: 1fr;
  }

  .form-row-2 {
    grid-template-columns: 1fr;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn,
  .header-actions .file-label {
    flex: 1;
    font-size: 0.8rem;
  }
}
