:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef4ff;
  --text: #172033;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #e5eaf1;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf1ff;
  --teal: #0f766e;
  --teal-soft: #e6f7f4;
  --green: #15803d;
  --green-soft: #eaf8ef;
  --amber: #b45309;
  --amber-soft: #fff7e8;
  --red: #b42318;
  --red-soft: #fff0ee;
  --purple: #7c3aed;
  --purple-soft: #f3ecff;
  --shadow: 0 12px 36px rgba(24, 39, 75, .08);
  --shadow-sm: 0 4px 14px rgba(24, 39, 75, .06);
  --radius: 16px;
  --radius-sm: 11px;
  --sidebar: 248px;
  --topbar: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  color: #eaf0ff;
  background: linear-gradient(180deg, #17233b 0%, #101827 100%);
  border-right: 1px solid rgba(255,255,255,.06);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 24px; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 12px; font-weight: 800; letter-spacing: -.04em;
  background: linear-gradient(135deg, #3b82f6, #14b8a6);
  box-shadow: 0 8px 18px rgba(37,99,235,.28);
}
.brand strong { display: block; font-size: 17px; letter-spacing: -.02em; }
.brand span { display: block; color: #9eacc4; font-size: 11px; margin-top: 1px; }
.sidebar-nav { overflow-y: auto; padding-right: 2px; flex: 1; }
.nav-section-label {
  margin: 14px 11px 7px; color: #66758f; font-size: 10px; font-weight: 800;
  letter-spacing: .11em; text-transform: uppercase;
}
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 11px; border: 0;
  padding: 10px 11px; margin: 2px 0; border-radius: 10px; cursor: pointer;
  background: transparent; color: #aebbd0; text-align: left; transition: .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #fff; background: rgba(59,130,246,.18); box-shadow: inset 3px 0 #60a5fa; }
.nav-icon { width: 20px; text-align: center; font-size: 16px; opacity: .95; }
.nav-badge {
  margin-left: auto; min-width: 22px; padding: 2px 6px; border-radius: 999px;
  font-size: 10px; text-align: center; color: #dbeafe; background: rgba(59,130,246,.25);
}
.sidebar-footer { padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.profile-card {
  display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px;
  width: 100%; border: 0; border-radius: 12px; padding: 9px; cursor: pointer;
  color: #e5edf9; background: rgba(255,255,255,.04); text-align: left;
}
.profile-card:hover { background: rgba(255,255,255,.08); }
.avatar {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%;
  color: #17233b; background: #dbeafe; font-size: 12px; font-weight: 800;
}
.profile-copy { min-width: 0; }
.profile-copy strong, .profile-copy small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-copy strong { font-size: 12px; }
.profile-copy small { color: #8492aa; font-size: 10px; margin-top: 2px; }

.main-area { margin-left: var(--sidebar); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar); display: flex; align-items: center;
  justify-content: space-between; gap: 18px; padding: 0 28px; background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
}
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 14px; }
.topbar h1 { margin: 0; font-size: 21px; line-height: 1.15; letter-spacing: -.03em; }
.breadcrumb { margin: 0 0 2px; color: var(--muted); font-size: 11px; }
.icon-button {
  position: relative; width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer;
}
.icon-button:hover { border-color: #cdd5df; background: #f9fafb; }
.notification-dot {
  position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%;
  background: #ef4444; box-shadow: 0 0 0 2px #fff;
}
.mobile-menu { display: none; }
.global-search {
  width: min(340px, 31vw); height: 40px; display: flex; align-items: center; gap: 9px;
  padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafc;
}
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); }
.global-search input::placeholder { color: #98a2b3; }
kbd { border: 1px solid #dce2ea; border-bottom-width: 2px; border-radius: 6px; padding: 2px 6px; color: #98a2b3; background: #fff; font-size: 10px; }
.primary-button, .secondary-button, .ghost-button, .danger-button {
  border-radius: 10px; padding: 9px 14px; font-weight: 700; cursor: pointer; transition: .16s ease;
}
.primary-button { border: 1px solid var(--primary); color: #fff; background: var(--primary); box-shadow: 0 4px 12px rgba(37,99,235,.16); }
.primary-button:hover { background: var(--primary-dark); transform: translateY(-1px); }
.secondary-button { border: 1px solid #ccd5e3; color: #344054; background: #fff; }
.secondary-button:hover { background: #f8fafc; }
.ghost-button { border: 1px solid transparent; color: var(--primary); background: transparent; }
.ghost-button:hover { background: var(--primary-soft); }
.danger-button { border: 1px solid #fecaca; color: var(--red); background: #fff5f5; }
.small-button { padding: 6px 10px; border-radius: 8px; font-size: 12px; }

.content { padding: 24px 28px 96px; max-width: 1700px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.grid { display: grid; gap: 16px; }
.grid-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-main { grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); margin-top: 16px; }

.card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px 13px; }
.card-head h3 { margin: 0; font-size: 14px; letter-spacing: -.01em; }
.card-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 0 18px 18px; }
.kpi-card { position: relative; min-height: 126px; padding: 17px; }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 650; }
.kpi-value { margin-top: 9px; font-size: 25px; font-weight: 800; letter-spacing: -.04em; }
.kpi-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; font-size: 17px; }
.kpi-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.trend-up { color: var(--green); font-weight: 700; }
.trend-down { color: var(--red); font-weight: 700; }
.tone-blue { color: var(--primary); background: var(--primary-soft); }
.tone-green { color: var(--green); background: var(--green-soft); }
.tone-amber { color: var(--amber); background: var(--amber-soft); }
.tone-purple { color: var(--purple); background: var(--purple-soft); }
.tone-teal { color: var(--teal); background: var(--teal-soft); }
.tone-red { color: var(--red); background: var(--red-soft); }

.chart-wrap { height: 240px; padding-top: 6px; }
.bar-chart { height: 100%; display: flex; align-items: stretch; gap: 13px; }
.y-axis { width: 34px; display: flex; flex-direction: column; justify-content: space-between; color: var(--muted-2); font-size: 10px; padding-bottom: 22px; }
.bar-area {
  position: relative; flex: 1; display: flex; align-items: end; justify-content: space-around; gap: 8px;
  border-bottom: 1px solid var(--line); padding: 0 5px 22px;
  background-image: linear-gradient(to bottom, transparent calc(25% - 1px), #edf1f5 25%, transparent calc(25% + 1px), transparent calc(50% - 1px), #edf1f5 50%, transparent calc(50% + 1px), transparent calc(75% - 1px), #edf1f5 75%, transparent calc(75% + 1px));
}
.bar-column { height: 100%; flex: 1; min-width: 18px; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 7px; }
.bar-stack { width: 70%; max-width: 42px; min-width: 18px; display: flex; align-items: end; gap: 3px; height: calc(100% - 22px); }
.bar { flex: 1; border-radius: 5px 5px 2px 2px; min-height: 5px; background: linear-gradient(180deg, #4f8df7, #2563eb); }
.bar.alt { background: linear-gradient(180deg, #39b6a8, #0f766e); }
.bar-label { position: absolute; bottom: 3px; color: var(--muted); font-size: 10px; }
.chart-legend { display: flex; gap: 16px; margin-top: 12px; color: var(--muted); font-size: 11px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 5px; background: var(--primary); }
.legend-dot.alt { background: var(--teal); }

.donut-layout { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 12px; min-height: 210px; }
.donut {
  width: 145px; aspect-ratio: 1; margin: auto; border-radius: 50%;
  background: conic-gradient(#2563eb 0 34%, #0f766e 34% 59%, #f59e0b 59% 77%, #7c3aed 77% 90%, #d0d5dd 90% 100%);
  position: relative;
}
.donut::after { content: ""; position: absolute; inset: 30px; border-radius: 50%; background: #fff; }
.donut-center { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; text-align: center; }
.donut-center strong { font-size: 23px; letter-spacing: -.04em; }
.donut-center span { color: var(--muted); font-size: 10px; }
.legend-list { display: grid; gap: 10px; }
.legend-row { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; }
.legend-swatch { width: 9px; height: 9px; border-radius: 3px; }
.legend-row span { color: var(--muted); font-size: 11px; }
.legend-row strong { font-size: 11px; }

.alert-list, .activity-list { display: grid; }
.alert-item, .activity-item {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: start; gap: 10px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.alert-item:first-child, .activity-item:first-child { border-top: 0; }
.alert-icon, .activity-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; font-size: 14px; }
.alert-copy strong, .activity-copy strong { display: block; font-size: 12px; }
.alert-copy span, .activity-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.alert-time, .activity-time { color: var(--muted-2); font-size: 10px; white-space: nowrap; }

.toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  margin-bottom: 14px; padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: #fff;
}
.toolbar-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.search-input, .filter-select, .input, .textarea {
  border: 1px solid #d9e0e9; border-radius: 9px; background: #fff; color: var(--text); outline: 0;
}
.search-input { width: 260px; padding: 9px 11px; }
.filter-select { min-width: 128px; padding: 8px 30px 8px 10px; }
.input { width: 100%; padding: 10px 11px; }
.textarea { width: 100%; min-height: 90px; resize: vertical; padding: 10px 11px; }
.search-input:focus, .filter-select:focus, .input:focus, .textarea:focus { border-color: #8db6ff; box-shadow: 0 0 0 3px rgba(37,99,235,.09); }
.view-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; }
.view-switch button { border: 0; border-radius: 7px; padding: 5px 8px; color: var(--muted); background: transparent; cursor: pointer; }
.view-switch button.active { color: var(--primary); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.07); }

.table-card { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 840px; }
th { padding: 11px 14px; color: #667085; background: #f8fafc; font-size: 10px; text-transform: uppercase; letter-spacing: .055em; text-align: left; border-bottom: 1px solid var(--line); }
td { padding: 13px 14px; border-bottom: 1px solid #edf1f5; vertical-align: middle; }
tbody tr:hover { background: #fbfcfe; }
tbody tr:last-child td { border-bottom: 0; }
.cell-main { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.cell-avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; font-size: 11px; font-weight: 800; color: #1e3a8a; background: #dbeafe; }
.cell-copy strong, .cell-copy span { display: block; }
.cell-copy strong { font-size: 12px; }
.cell-copy span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.text-right { text-align: right; }
.text-success { color: var(--green); }
.text-danger { color: var(--red); }
.font-strong { font-weight: 750; }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; }
.row-actions button { border: 0; padding: 6px 8px; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.row-actions button:hover { color: var(--primary); background: var(--primary-soft); }
.row-actions .danger-action, .danger-action { color: #b42318; border: 1px solid #fecdca; background: #fff5f4; }
.row-actions .danger-action:hover, .danger-action:hover { color: #912018; border-color: #fda29b; background: #fee4e2; }
.danger-action.compact { width: 28px; height: 28px; display: inline-grid; place-items: center; padding: 0; border-radius: 8px; cursor: pointer; }
.danger-button { padding: 10px 15px; border: 1px solid #b42318; border-radius: 9px; color: #fff; background: #b42318; font-weight: 750; cursor: pointer; }
.danger-button:hover { background: #912018; }
.delete-warning { padding: 16px; border: 1px solid #fecdca; border-radius: 12px; background: #fff5f4; }
.delete-warning strong { display: block; color: #912018; font-size: 14px; }
.delete-warning p { margin: 6px 0 0; color: #667085; font-size: 11px; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge-blue { color: #1d4ed8; background: #eaf1ff; }
.badge-green { color: #15803d; background: #eaf8ef; }
.badge-amber { color: #b45309; background: #fff7e8; }
.badge-red { color: #b42318; background: #fff0ee; }
.badge-purple { color: #7c3aed; background: #f3ecff; }
.badge-gray { color: #667085; background: #f2f4f7; }
.badge-teal { color: #0f766e; background: #e6f7f4; }
.tag { display: inline-flex; padding: 3px 7px; margin: 2px; border-radius: 6px; color: #475467; background: #f2f4f7; font-size: 9px; }

.kanban-wrap { overflow-x: auto; padding-bottom: 9px; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 310px); gap: 13px; align-items: start; }
.kanban-column { border: 1px solid var(--line); border-radius: 14px; background: #edf2f8; min-height: 540px; }
.kanban-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px; }
.kanban-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; }
.kanban-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.kanban-count { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; color: var(--muted); background: #fff; font-size: 10px; }
.kanban-total { padding: 0 13px 11px; color: var(--muted); font-size: 10px; }
.kanban-body { min-height: 450px; padding: 0 9px 10px; }
.deal-card { margin-bottom: 9px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; box-shadow: 0 3px 10px rgba(24,39,75,.05); cursor: grab; }
.deal-card:active { cursor: grabbing; }
.deal-card.dragging { opacity: .45; transform: rotate(1deg); }
.kanban-body.drag-over { outline: 2px dashed #93b4f8; outline-offset: -4px; border-radius: 10px; background: rgba(219,234,254,.45); }
.deal-top { display: flex; justify-content: space-between; gap: 8px; }
.deal-name { font-weight: 750; font-size: 12px; }
.deal-value { margin: 8px 0; font-weight: 800; font-size: 14px; letter-spacing: -.02em; }
.deal-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.deal-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line); }
.probability { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.probability-bar { width: 40px; height: 5px; overflow: hidden; border-radius: 99px; background: #edf1f5; }
.probability-bar span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }

.property-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.property-card { position: relative; overflow: hidden; }
.property-photo { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #e7edf5; }
.property-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.property-card:hover .property-photo img { transform: scale(1.035); }
.property-status { position: absolute; top: 11px; left: 11px; }
.property-code { position: absolute; right: 11px; bottom: 9px; padding: 3px 7px; border-radius: 7px; color: #fff; background: rgba(15,23,42,.7); backdrop-filter: blur(5px); font-size: 9px; }
.property-body { padding: 14px; }
.property-price { color: var(--primary); font-size: 17px; font-weight: 850; letter-spacing: -.03em; }
.property-title { margin-top: 5px; font-size: 13px; font-weight: 750; }
.property-location { margin-top: 4px; color: var(--muted); font-size: 10px; }
.property-features { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; color: #475467; font-size: 10px; }
.property-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); }
.completeness { width: 92px; }
.completeness-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.progress { height: 5px; margin-top: 4px; overflow: hidden; border-radius: 99px; background: #edf1f5; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }

.calendar-layout { grid-template-columns: minmax(0, 1.6fr) minmax(290px, .7fr); }
.calendar-card { padding: 16px; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.calendar-head h3 { margin: 0; font-size: 15px; }
.calendar-controls { display: flex; gap: 5px; }
.calendar-controls button { border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; background: #fff; cursor: pointer; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.calendar-weekday { padding: 8px 4px; color: var(--muted); background: #f8fafc; text-align: center; font-size: 9px; font-weight: 800; text-transform: uppercase; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calendar-day { min-height: 94px; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.calendar-day.outside { background: #fafbfc; color: #b8c0cc; }
.calendar-day.today { box-shadow: inset 0 0 0 2px #8db6ff; }
.day-number { display: block; width: 23px; height: 23px; line-height: 23px; text-align: center; border-radius: 7px; font-size: 10px; }
.today .day-number { color: #fff; background: var(--primary); font-weight: 800; }
.calendar-event { display: block; margin-top: 4px; padding: 3px 5px; overflow: hidden; border-radius: 5px; text-overflow: ellipsis; white-space: nowrap; color: #1d4ed8; background: #eaf1ff; font-size: 8px; }
.calendar-event.visit { color: #0f766e; background: #e6f7f4; }
.calendar-event.follow { color: #b45309; background: #fff7e8; }
.task-list { display: grid; gap: 9px; }
.task-item { display: grid; grid-template-columns: 18px 1fr auto; gap: 9px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.task-check { width: 17px; height: 17px; border: 1.5px solid #c7d0dc; border-radius: 5px; background: #fff; cursor: pointer; }
.task-check.done { display: grid; place-items: center; border-color: var(--green); color: #fff; background: var(--green); }
.task-copy strong { display: block; font-size: 11px; }
.task-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.task-time { color: var(--muted); font-size: 9px; }

.finance-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.finance-card { padding: 17px; }
.finance-card span { color: var(--muted); font-size: 11px; }
.finance-card strong { display: block; margin-top: 7px; font-size: 20px; letter-spacing: -.03em; }
.finance-card small { display: block; margin-top: 4px; color: var(--muted); }

.report-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.report-card { padding: 17px; cursor: pointer; transition: .16s ease; }
.report-card:hover { transform: translateY(-2px); border-color: #cdd9ec; box-shadow: var(--shadow); }
.report-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; margin-bottom: 12px; }
.report-card h3 { margin: 0; font-size: 13px; }
.report-card p { min-height: 35px; margin: 5px 0 14px; color: var(--muted); font-size: 10px; }
.report-card span { color: var(--primary); font-size: 10px; font-weight: 750; }

.empty-state { display: grid; place-items: center; min-height: 320px; padding: 40px; text-align: center; }
.empty-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; color: var(--primary); background: var(--primary-soft); font-size: 23px; }
.empty-state h3 { margin: 14px 0 5px; font-size: 15px; }
.empty-state p { max-width: 430px; margin: 0 0 15px; color: var(--muted); }

.settings-layout { grid-template-columns: 240px 1fr; }
.settings-menu { padding: 8px; height: fit-content; }
.settings-menu button { width: 100%; border: 0; border-radius: 9px; padding: 10px; color: var(--muted); background: transparent; text-align: left; cursor: pointer; }
.settings-menu button.active, .settings-menu button:hover { color: var(--primary); background: var(--primary-soft); }
.form-section { padding: 20px; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.form-section h3 { margin: 0 0 4px; font-size: 14px; }
.form-section > p { margin: 0 0 15px; color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.field { display: grid; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #475467; font-size: 10px; font-weight: 750; }
.field-hint { color: var(--muted); font-size: 9px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row strong { display: block; font-size: 11px; }
.toggle-row span { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.toggle { position: relative; width: 40px; height: 22px; border-radius: 99px; border: 0; background: #cdd5df; cursor: pointer; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle.on { background: var(--primary); }
.toggle.on::after { transform: translateX(18px); }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px;
  background: rgba(15,23,42,.48); backdrop-filter: blur(3px); animation: fadeIn .15s ease;
}
.modal-open { overflow: hidden; }
.modal { width: min(620px, 100%); max-height: min(88vh, 820px); overflow: auto; border-radius: 18px; background: #fff; box-shadow: 0 24px 80px rgba(15,23,42,.25); animation: rise .18s ease; }
.modal.sm { width: min(470px, 100%); }
.modal.lg { width: min(880px, 100%); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; background: #fff; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.modal-close { width: 32px; height: 32px; border: 0; border-radius: 9px; background: #f2f4f7; cursor: pointer; }
.modal-body { padding: 20px; }
.modal-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; background: #fff; border-top: 1px solid var(--line); }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-option { border: 1px solid var(--line); border-radius: 13px; padding: 14px; text-align: left; background: #fff; cursor: pointer; }
.quick-option:hover { border-color: #a9c4f7; background: #f8fbff; transform: translateY(-1px); }
.quick-option span { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 10px; border-radius: 10px; }
.quick-option strong { display: block; font-size: 11px; }
.quick-option small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }

.detail-hero { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 14px; margin-bottom: 18px; }
.detail-avatar { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; color: #1d4ed8; background: #dbeafe; font-size: 20px; font-weight: 850; }
.detail-hero h2 { margin: 0; }
.detail-hero p { margin: 4px 0 0; color: var(--muted); }
.detail-actions { display: flex; gap: 6px; }
.detail-grid { grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); }
.info-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.info-item span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.info-item strong { display: block; margin-top: 3px; font-size: 11px; }
.timeline { position: relative; margin-left: 6px; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; top: 6px; bottom: 6px; left: 5px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding: 0 0 16px; }
.timeline-item::before { content: ""; position: absolute; left: -19px; top: 4px; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 1px #bcd0f9; }
.timeline-item strong { display: block; font-size: 11px; }
.timeline-item span { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }

.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 9px; }
.toast { min-width: 280px; max-width: 380px; display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); animation: slideIn .2s ease; }
.toast-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: var(--green); background: var(--green-soft); }
.toast strong { display: block; font-size: 11px; }
.toast span { display: block; color: var(--muted); font-size: 9px; }
.toast button { border: 0; background: transparent; cursor: pointer; color: var(--muted); }

.mobile-nav, .fab { display: none; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.99); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } }

@media (max-width: 1180px) {
  .grid-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .property-grid, .report-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-4, .finance-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 900px) {
  :root { --topbar: 68px; }
  .sidebar { transform: translateX(-102%); transition: transform .22s ease; box-shadow: 20px 0 50px rgba(15,23,42,.18); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .mobile-menu { display: grid; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 100px; }
  .dashboard-main, .calendar-layout, .detail-grid { grid-template-columns: 1fr; }
  .global-search { width: min(300px, 41vw); }
  .desktop-only { display: none !important; }
  .mobile-nav {
    position: fixed; inset: auto 0 0 0; z-index: 25; display: grid; grid-template-columns: repeat(5, 1fr);
    min-height: 68px; padding: 5px 6px calc(5px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96);
    backdrop-filter: blur(16px); border-top: 1px solid var(--line);
  }
  .mobile-nav button { display: grid; place-items: center; gap: 2px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 9px; cursor: pointer; }
  .mobile-nav button span:first-child { font-size: 17px; }
  .mobile-nav button.active { color: var(--primary); background: var(--primary-soft); }
  .fab {
    position: fixed; right: 18px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 28;
    width: 52px; height: 52px; display: grid; place-items: center; border: 0; border-radius: 17px;
    color: #fff; background: var(--primary); box-shadow: 0 12px 28px rgba(37,99,235,.32); font-size: 26px; cursor: pointer;
  }
}

@media (max-width: 680px) {
  .topbar-actions { gap: 7px; }
  .notification-button { display: none; }
  .global-search { width: 38px; padding: 0; justify-content: center; background: #fff; }
  .global-search input, .global-search kbd { display: none; }
  .content { padding-left: 12px; padding-right: 12px; }
  .grid-kpis, .grid-2, .grid-3, .grid-4, .property-grid, .report-grid, .finance-summary { grid-template-columns: 1fr; }
  .kpi-card { min-height: 110px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions > * { flex: 1; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-group { width: 100%; }
  .search-input { width: 100%; }
  .filter-select { flex: 1; min-width: 0; }
  .donut-layout { grid-template-columns: 1fr; }
  .donut { width: 130px; }
  .legend-list { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .info-list { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-menu { display: flex; overflow-x: auto; }
  .settings-menu button { width: auto; white-space: nowrap; }
  .calendar-day { min-height: 68px; padding: 4px; }
  .calendar-event { display: none; }
  .detail-hero { grid-template-columns: 52px 1fr; }
  .detail-avatar { width: 52px; height: 52px; border-radius: 15px; font-size: 17px; }
  .detail-actions { grid-column: 1 / -1; }
  .detail-actions button { flex: 1; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal, .modal.sm, .modal.lg { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .toast-root { left: 12px; right: 12px; bottom: 84px; }
  .toast { min-width: 0; max-width: none; }
}

.ghost-row {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.ghost-row:hover strong { color: var(--primary); }


/* Autenticação e sincronização online */
.auth-root:empty { display: none; }
.auth-root {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 10%, rgba(37, 99, 235, .18), transparent 34%),
    radial-gradient(circle at 85% 90%, rgba(20, 184, 166, .14), transparent 35%),
    #f4f7fb;
}
.auth-card {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid #e4e9f2;
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(16, 24, 40, .14);
  padding: 30px;
}
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.auth-brand .brand-mark { flex: 0 0 auto; }
.auth-card h1 { font-size: 26px; margin: 0 0 8px; }
.auth-card > p { margin: 0 0 24px; color: #667085; line-height: 1.55; }
.auth-card .field { margin-bottom: 15px; }
.auth-card .primary-button { width: 100%; justify-content: center; margin-top: 4px; min-height: 46px; }
.auth-message { padding: 12px 14px; border-radius: 10px; margin: 0 0 16px; font-size: 14px; }
.auth-message.error { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }
.auth-message.info { background: #eff8ff; color: #175cd3; border: 1px solid #b2ddff; }
.auth-help { font-size: 12px; color: #98a2b3; margin-top: 18px; text-align: center; }
.sync-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #667085; }
.sync-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 3px rgba(18,183,106,.12); }
.setup-code { background:#101828; color:#f2f4f7; padding:12px; border-radius:10px; overflow:auto; font-size:12px; }
