:root {
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #172026;
  --muted: #60717c;
  --line: #dce4e7;
  --accent: #126c61;
  --accent-2: #b44b32;
  --gold: #b48318;
  --blue: #246b95;
  --danger: #b62f3a;
  --ok: #1f7a4c;
  --shadow: 0 18px 45px rgba(20, 38, 48, 0.11);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 284px minmax(0, 1fr); }
[hidden] { display: none !important; }
.login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: #f8f6f2;
  gap: 16px;
}
@media (min-width: 700px) {
  .login-screen {
    flex-direction: row;
    align-items: flex-start;
    padding: 48px 32px;
    gap: 24px;
  }
}

/* === Mobile-first login card === */
.lm-card {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(20, 38, 48, 0.13);
}
.lm-top {
  background: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 24px 40px;
  color: white;
  border-radius: 0 0 28px 28px;
}
.lm-building { opacity: 0.9; }
.lm-condo {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.95;
}
.lm-body {
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.lm-wordmark { text-align: center; }
.lm-wordmark strong {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.lm-wordmark p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
#loginForm { display: flex; flex-direction: column; gap: 12px; }
.lm-field { position: relative; }
.lm-input {
  width: 100%;
  height: 56px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 0 16px;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.lm-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18,108,97,0.12);
}
.lm-pw { padding-right: 48px; }
.lm-eye {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
}
.lm-eye:hover { color: var(--ink); }
.lm-submit {
  width: 100%;
  height: 56px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity 0.15s, transform 0.1s;
}
.lm-submit:hover { opacity: 0.92; }
.lm-submit:active { opacity: 0.88; transform: scale(0.98); }
#loginError { color: var(--danger); font-size: 13px; min-height: 16px; text-align: center; }
.lm-footer { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lm-lang-row { display: flex; align-items: center; gap: 8px; }
.lm-lang-icon { font-size: 16px; }
.lm-lang-select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  outline: none;
}
.lm-lang-select:focus { border-color: var(--accent); }
.lm-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.lm-link:hover { text-decoration: underline; }
.lm-sep { width: 100%; border: none; border-top: 1px solid var(--line); margin: 0; }
.lm-remember-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.lm-cb-native {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.lm-cb-box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  background: #fff;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lm-cb-native:checked + .lm-cb-box {
  background: var(--accent);
  border-color: var(--accent);
}
.lm-cb-native:checked + .lm-cb-box::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}
.lm-hint { font-size: 11px; color: var(--muted); text-align: center; margin: 0; }
.lm-info-msg { font-size: 13px; color: var(--accent); text-align: center; margin: 0 0 8px; padding: 8px 12px; background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 8px; }
.lm-recovery-card { padding: 24px; margin-top: 12px; border-radius: 16px; overflow: visible; }
@media (min-width: 700px) {
  .lm-recovery-card { margin-top: 0; width: min(360px, 100%); align-self: flex-start; }
}

/* === Product info (SEO content, visible to crawlers) === */
.lm-product {
  width: min(480px, 100%);
  padding: 28px 0 8px;
  color: var(--muted);
}
@media (min-width: 700px) {
  .lm-product {
    order: -1;
    padding: 4px 0;
    align-self: flex-start;
    max-width: 400px;
  }
}
.lm-product-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
  line-height: 1.3;
}
.lm-product-lead {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 20px;
}
.lm-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lm-features li {
  font-size: 13px;
  line-height: 1.55;
  padding-left: 14px;
  border-left: 2px solid var(--brand, #126c61);
}
.lm-features li strong {
  display: block;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 2px;
}
.lm-product-more { margin: 20px 0 0; }
.lm-product-link { font-size: 13px; color: var(--brand, #126c61); text-decoration: none; font-weight: 600; }
.lm-product-link:hover { text-decoration: underline; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  background: #12242a;
  color: white;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.brand-mark {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 8px; background: var(--accent); font-weight: 800;
}
.brand strong { display: block; font-size: 18px; }
.brand span { display: block; color: #b9c7cc; font-size: 13px; margin-top: 2px; }
.profile-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; margin-bottom: 18px; }
.segmented { border: 0; border-radius: 6px; padding: 9px 8px; color: #d8e5e8; background: transparent; }
.segmented.active { background: white; color: #12242a; font-weight: 700; }
.user-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin-bottom: 18px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
}
.user-box span { color: #b9c7cc; font-size: 13px; }
.user-box .secondary { padding: 8px 10px; }
.sidebar-lang-select {
  width: 100%;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: #d7e2e5;
  background: rgba(255,255,255,.08);
  cursor: pointer;
  outline: none;
}
.sidebar-lang-select:focus { border-color: rgba(255,255,255,.4); }
.sidebar-lang-select option { background: #1a3540; color: #d7e2e5; }
.nav { display: grid; gap: 4px; }
.nav button {
  width: 100%; display: flex; gap: 10px; align-items: center;
  border: 0; background: transparent; color: #d7e2e5; padding: 11px 10px; border-radius: 8px; text-align: left;
}
.nav button.active, .nav button:hover { background: rgba(255,255,255,.11); color: white; }
.main { min-width: 0; }
.topbar {
  min-height: 86px; padding: 18px 28px; display: flex; gap: 18px; justify-content: space-between; align-items: center;
  background: rgba(245,247,248,.92); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line);
}
.eyebrow { margin: 0 0 4px; color: var(--accent); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
h1 { margin: 0; font-size: 28px; letter-spacing: 0; }
h2 { margin: 0; font-size: 20px; }
h3 { margin: 0; font-size: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.search {
  display: flex; align-items: center; gap: 8px; background: white; border: 1px solid var(--line);
  border-radius: 8px; padding: 0 12px; min-width: min(420px, 42vw); height: 42px;
}
.search input { border: 0; outline: 0; min-width: 0; width: 100%; }
.icon-button {
  border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 8px;
  width: 42px; height: 42px; display: inline-grid; place-items: center; position: relative;
}
.icon-button span {
  position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--danger); border: 2px solid white; display: block;
}
.notice-strip { margin: 18px 28px 0; padding: 12px 14px; border: 1px solid #d8c58f; background: #fff8df; border-radius: 8px; color: #59440b; }
.view { padding: 22px 28px 40px; }
.grid { display: grid; gap: 16px; }
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card, .table-wrap, .form-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 1px 0 rgba(16,24,40,.02);
}
.card { padding: 18px; }
.kpi { min-height: 118px; display: flex; flex-direction: column; justify-content: space-between; }
.kpi p { margin: 0; color: var(--muted); font-size: 13px; }
.kpi strong { font-size: 28px; }
.kpi small { color: var(--ok); font-weight: 700; }
.two-col { grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr); }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.input, select, textarea {
  border: 1px solid var(--line); background: white; border-radius: 8px; padding: 10px 11px; min-height: 40px; color: var(--ink);
}
textarea { width: 100%; min-height: 112px; resize: vertical; }
.primary, .secondary, .danger {
  border-radius: 8px; border: 1px solid transparent; padding: 10px 13px; font-weight: 800;
}
.primary { background: var(--accent); color: white; }
.secondary { background: white; color: var(--ink); border-color: var(--line); }
.danger { background: #fff0f1; color: var(--danger); border-color: #f4c4c8; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
td { font-size: 14px; }
.table-wrap { overflow: auto; }
.status {
  display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 800; white-space: nowrap;
}
.paid, .resolved, .approved, .active { background: #eaf7ef; color: var(--ok); }
.pending, .analysis { background: #fff5dd; color: var(--gold); }
.late, .rejected, .blocked { background: #fff0f1; color: var(--danger); }
.validation, .progress { background: #e8f4fa; color: var(--blue); }
.chart { display: grid; gap: 12px; }
.bar { display: grid; grid-template-columns: 72px 1fr 72px; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.bar i { height: 12px; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #78b59f); display: block; }
.timeline { display: grid; gap: 12px; }
.timeline article { border-left: 3px solid var(--accent); padding-left: 12px; }
.timeline p { margin: 3px 0 0; color: var(--muted); }
.actions { display: flex; gap: 7px; flex-wrap: wrap; }
.quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick-actions button { min-height: 72px; text-align: left; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.full { grid-column: 1 / -1; }
.notify-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 340px; max-height: 480px; overflow-y: auto;
  background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 50;
}
.notify-panel-header { padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 800; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.notify-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: default; }
.notify-item:last-child { border-bottom: 0; }
.notify-item:hover { background: var(--bg); }
.notify-item-link { cursor: pointer; }
.notify-item-link:hover { background: var(--surface2, #f5f7fa); }
.notify-arrow { font-size: 18px; color: var(--muted); align-self: center; flex-shrink: 0; margin-left: auto; }
.notify-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.notify-dot.red { background: var(--danger); }
.notify-dot.yellow { background: var(--gold); }
.notify-dot.blue { background: var(--blue); }
.notify-dot.green { background: var(--ok); }
.notify-item-body { min-width: 0; }
.notify-item-body strong { display: block; font-size: 13px; line-height: 1.4; }
.notify-item-body span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.notify-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; }
dialog { border: 0; padding: 0; background: transparent; }
dialog::backdrop { background: rgba(8,16,20,.44); }
.modal-card { width: min(680px, calc(100vw - 26px)); background: white; border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.modal-card header, .modal-card footer { padding: 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.modal-card footer { border-top: 1px solid var(--line); border-bottom: 0; justify-content: flex-end; }
#modalBody { padding: 16px; }
.mobile-only { display: none; }
#sidebarBackdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 19;
  background: rgba(10, 20, 30, 0.45);
  cursor: pointer;
}
#sidebarBackdrop.active { display: block; }
@media (min-width: 981px) { #sidebarBackdrop { display: none !important; } }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 284px; transform: translateX(-105%); transition: .2s ease; z-index: 20; }
  .sidebar.open { transform: translateX(0); }
  .mobile-only { display: inline-grid; }
  .topbar { align-items: flex-start; padding: 14px 16px; }
  .topbar-actions { width: 100%; }
  .topbar { flex-wrap: wrap; }
  .search { min-width: 0; flex: 1; }
  .notice-strip { margin: 14px 16px 0; }
  .view { padding: 16px; }
  .kpi-grid, .two-col, .three-col, .quick-actions { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  h1 { font-size: 23px; }
  .form-grid { grid-template-columns: 1fr; }
  th, td { padding: 11px 10px; }
  .topbar-actions { align-items: stretch; }
}

/* ── Biometria (WebAuthn) ─────────────────────────── */
.lm-biometric {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  margin-top: 10px;
  border: 2px solid #126c61;
  border-radius: 10px;
  background: transparent;
  color: #126c61;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lm-biometric:hover:not(:disabled) {
  background: #126c61;
  color: white;
}
.lm-biometric:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.biometric-banner {
  background: linear-gradient(135deg, #126c61 0%, #0d5248 100%);
  color: white;
  border-radius: 12px;
  margin: 0 24px 16px;
  padding: 16px 20px;
}
.biometric-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
}
.biometric-banner-icon {
  flex-shrink: 0;
  opacity: 0.9;
}
.biometric-banner-text { flex: 1; }
.biometric-banner-text strong { display: block; font-size: 15px; margin-bottom: 3px; }
.biometric-banner-text p { margin: 0; font-size: 13px; opacity: 0.85; }
.biometric-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
.biometric-banner-actions .primary { background: white; color: #126c61; border: none; padding: 8px 18px; border-radius: 8px; font-weight: 600; }
.biometric-banner-actions .primary:hover { background: #edf7f5; }
.biometric-banner-actions .secondary { background: transparent; color: white; border: 1.5px solid rgba(255,255,255,0.45); padding: 8px 14px; border-radius: 8px; }
.biometric-banner-actions .secondary:hover { background: rgba(255,255,255,0.12); }
@media (max-width: 700px) {
  .biometric-banner { margin: 0 16px 16px; }
  .biometric-banner-content { flex-direction: column; align-items: flex-start; gap: 12px; }
  .biometric-banner-actions { width: 100%; }
  .biometric-banner-actions button { flex: 1; }
}

/* ===== PIN Screen ===== */
.pin-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: #f8f6f2;
}
.pin-card {
  width: min(380px, 100%);
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(20,38,48,0.13);
}
.pin-header {
  background: var(--accent);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 24px 28px;
  gap: 8px;
}
.pin-icon {
  width: 48px; height: 48px;
  opacity: 0.9;
}
.pin-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  text-align: center;
}
.pin-sub {
  font-size: 14px;
  opacity: 0.82;
  margin: 0;
  text-align: center;
  line-height: 1.4;
}
.pin-check {
  width: 56px; height: 56px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.pin-dots {
  display: flex;
  gap: 18px;
  justify-content: center;
  padding: 28px 24px 4px;
}
.pin-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: transparent;
  transition: all 0.15s ease;
}
.pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.1);
}
.pin-error {
  text-align: center;
  color: var(--danger);
  font-size: 13px;
  padding: 6px 24px 0;
  margin: 0;
  min-height: 24px;
}
.pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px 28px 12px;
}
.pin-key {
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
  min-height: 62px;
}
.pin-key:hover { background: #e5eaed; }
.pin-key:active { background: var(--accent); color: white; transform: scale(0.93); }
.pin-key.back { background: transparent; color: var(--muted); }
.pin-key.back:hover { background: var(--bg); }
.pin-bio-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 56px);
  margin: 4px 28px 4px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s;
}
.pin-bio-btn:hover { background: var(--bg); }
.pin-link {
  display: block;
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  padding: 10px 24px 24px;
  cursor: pointer;
  text-decoration: underline;
}
.pin-link:hover { color: var(--accent); }

/* ── Ticket list ─────────────────────────────── */
.ticket-list { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.ticket-item { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.ticket-item-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ticket-item-title { font-weight: 600; font-size: 14px; flex: 1; }
.ticket-item-meta { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.ticket-item-response { background: #edf7f0; border-left: 3px solid var(--ok); padding: 9px 12px; border-radius: 6px; font-size: 13px; line-height: 1.5; }
.ticket-item-response strong { font-size: 11px; text-transform: uppercase; color: var(--ok); display: block; margin-bottom: 3px; }
.ticket-item-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }

/* ── Sidebar copyright ───────────────────────── */
.sidebar-copyright { font-size: 11px; color: var(--muted); text-align: center; padding: 12px 16px; border-top: 1px solid var(--line); margin-top: auto; opacity: 0.7; }

/* ── "Fale connosco" link in login footer ────── */
.lm-contact-link {
  background: none; border: none; padding: 0;
  color: var(--muted); font-size: inherit;
  cursor: pointer; text-decoration: underline;
  font-family: inherit;
}
.lm-contact-link:hover { color: var(--accent); }

/* ── Contact form overlay / modal ──────────────── */
.contact-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(20,38,48,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.contact-overlay[hidden] { display: none !important; }
.contact-modal {
  background: #fff; border-radius: 20px;
  box-shadow: 0 24px 64px rgba(20,38,48,.18);
  width: min(480px, 100%);
  max-height: 90vh; overflow-y: auto;
  padding: 28px;
}
.contact-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.contact-modal-header h2 { margin: 0; font-size: 18px; }
.contact-form { display: flex; flex-direction: column; gap: 12px; }
.contact-label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--muted); }
.contact-label .input { margin-top: 0; }

/* ── Mailbox layout ────────────────────────────── */
.mailbox-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 480px;
  border-top: 1px solid var(--line);
}
@media (max-width: 800px) {
  .mailbox-layout { grid-template-columns: 1fr; }
}
.mailbox-list {
  border-right: 1px solid var(--line);
  overflow-y: auto;
  max-height: 600px;
}
.mailbox-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .1s;
  display: grid;
  gap: 3px;
}
.mailbox-row:hover { background: var(--bg); }
.mailbox-row-active { background: #eef7f5 !important; border-left: 3px solid var(--accent); }
.mailbox-row-unseen .mailbox-row-sender strong { color: var(--accent); }
.mailbox-row-sender { font-size: 13px; }
.mailbox-row-subject { font-size: 13px; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.mailbox-row-date { font-size: 11px; color: var(--muted); }
.mailbox-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.mailbox-detail-pane { overflow-y: auto; max-height: 600px; }
.mailbox-detail { display: flex; flex-direction: column; height: 100%; }
.mailbox-detail-header { padding: 20px 20px 14px; border-bottom: 1px solid var(--line); }
.mailbox-detail-body {
  padding: 20px; font-size: 14px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
  flex: 1; color: var(--ink);
  background: var(--bg);
}
.mailbox-reply-box {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.mailbox-attach-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.mailbox-attach-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--muted);
  transition: background 0.15s, border-color 0.15s;
}
.mailbox-attach-label:hover {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--accent);
}
