@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  --bg-root:       #060b18;
  --bg-surface:    #0d1525;
  --bg-card:       #111d35;
  --bg-card-hover: #162040;
  --bg-input:      #0a1120;
  --bg-modal:      #0e1830;

  --text-primary:   #f0f4ff;
  --text-secondary: #8fa3c4;
  --text-muted:     #4a6080;

  --border:        rgba(255,255,255,0.07);
  --border-focus:  rgba(255,255,255,0.18);

  --mercadinho:   #10b981;
  --milenar:      #3b82f6;
  --imobiliaria:  #f59e0b;
  --laserdent:    #f43f5e;
  --licitacao:    #8b5cf6;

  --accent:   #3b82f6;
  --accent-2: #2563eb;

  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #f43f5e;
  --info:    #38bdf8;

  --crm-sidebar-w: 240px;
  --crm-header-h:  60px;
  --radius:    12px;
  --radius-lg: 18px;
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.6);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-root);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  line-height: 1.6;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a3a5c; border-radius: 10px; }

/* ============================================================
   AUTH / LOGIN SCREEN
   ============================================================ */
.auth-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-root);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  overflow: hidden;
}

.auth-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: orb-float 8s ease-in-out infinite;
}
.auth-orb-1 { width: 500px; height: 500px; background: #3b82f6; top: -100px; left: -100px; animation-delay: 0s; }
.auth-orb-2 { width: 400px; height: 400px; background: #8b5cf6; bottom: -100px; right: -50px; animation-delay: -3s; }
.auth-orb-3 { width: 300px; height: 300px; background: #10b981; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -6s; }

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 30px) scale(0.95); }
}

.auth-card {
  position: relative;
  background: rgba(13,21,37,0.85);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-focus);
  border-radius: 24px;
  padding: 48px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.03);
  animation: card-in 0.5s cubic-bezier(0.4,0,0.2,1);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo-img { max-width: 220px; max-height: 80px; object-fit: contain; filter: brightness(1.1); }

.auth-divider {
  height: 1px;
  background: var(--border);
  margin: 0 -48px 28px;
}

.auth-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.6;
}

.auth-error {
  background: rgba(244,63,94,0.1);
  border: 1px solid rgba(244,63,94,0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--danger);
  margin-bottom: 16px;
  animation: shake 0.3s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

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

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
select.form-control { cursor: pointer; }

.auth-input { background: rgba(6,11,24,0.6); }

.auth-eye {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; font-size: 16px;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.auth-eye:hover { opacity: 1; }

.auth-submit {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(59,130,246,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(59,130,246,0.55); }
.auth-submit:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.auth-demo-hint {
  margin-top: 20px;
  background: rgba(59,130,246,0.07);
  border: 1px solid rgba(59,130,246,0.18);
  border-radius: 10px;
  padding: 14px 16px;
}

.auth-demo-hint-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--info);
  margin-bottom: 8px;
}

.auth-demo-hint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.auth-demo-hint-row code {
  background: rgba(0,0,0,0.3);
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.auth-footer-text {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
}

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ============================================================
   SELECT SCREEN
   ============================================================ */
.select-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-root);
  overflow-y: auto;
  z-index: 900;
}

.select-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 64px;
  background: rgba(6,11,24,0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.select-logo { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.select-logo-img { height: 36px; object-fit: contain; }

.select-header-right { display: flex; align-items: center; gap: 10px; }

.select-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.select-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.select-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 40px 80px;
}

.select-hero { text-align: center; margin-bottom: 56px; }

.select-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--info);
  background: rgba(56,189,248,0.1);
  border: 1px solid rgba(56,189,248,0.25);
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.select-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #f0f4ff 0%, #8fa3c4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.select-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
}

/* Module selection cards */
.select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 900px) { .select-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .select-grid { grid-template-columns: 1fr; } }

.select-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.select-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--c1,#3b82f6) 0%, var(--c2,#8b5cf6) 100%);
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: inherit;
}

.select-card::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--c1,#3b82f6), var(--c2,#8b5cf6));
  border-radius: 4px 0 0 4px;
  transition: width 0.3s;
}

.select-card:hover {
  transform: translateY(-6px);
  border-color: var(--c1, #3b82f6);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px var(--c1,#3b82f6);
}

.select-card:hover::before { opacity: 0.04; }
.select-card:hover::after { width: 6px; }

.select-card > * { position: relative; z-index: 1; }

.select-card-icon {
  font-size: 40px;
  margin-bottom: 16px;
  display: block;
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.15));
}

.select-card-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.select-card-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.select-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 24px;
}

.select-card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.select-feature-pill {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.select-card-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid var(--c1, #3b82f6);
  background: transparent;
  color: var(--c1, #3b82f6);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.select-card:hover .select-card-btn {
  background: var(--c1, #3b82f6);
  color: #fff;
}

/* ============================================================
   CRM SHELL (full-screen module experience)
   ============================================================ */
.crm-shell {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  background: var(--bg-root);
  z-index: 800;
}

.crm-shell.active { display: flex; }

/* CRM Header */
.crm-header {
  height: var(--crm-header-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(6,11,24,0.98);
  flex-shrink: 0;
  gap: 12px;
  position: relative;
  z-index: 10;
}

.crm-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--crm-color, #3b82f6) 0%, transparent 60%);
}

.crm-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.crm-back-btn:hover { background: var(--bg-card); color: var(--text-primary); border-color: var(--border-focus); }

.crm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crm-brand-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.crm-brand-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.crm-brand-type {
  font-size: 11px;
  color: var(--text-muted);
}

.crm-header-sep { flex: 1; }

.crm-header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  width: 220px;
}

.crm-header-search input {
  background: none;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text-primary);
  width: 100%;
}

.crm-header-search input::placeholder { color: var(--text-muted); }

.crm-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-icon-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
  position: relative;
}
.crm-icon-btn:hover { background: var(--bg-card); color: var(--text-primary); }

.crm-notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 1px solid var(--bg-root);
}

.crm-user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s;
}
.crm-user-pill:hover { border-color: var(--border-focus); }

.crm-user-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.crm-user-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }

/* CRM Body */
.crm-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* CRM Sidebar */
.crm-sidebar {
  width: var(--crm-sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

.crm-sidebar-section { padding: 20px 12px 8px; }

.crm-sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 8px;
  margin-bottom: 6px;
}

.crm-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.crm-nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.crm-nav-item.active {
  background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(139,92,246,0.1));
  color: var(--crm-color, #3b82f6);
  font-weight: 600;
  border: 1px solid rgba(59,130,246,0.15);
}

.crm-nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

.crm-sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.crm-sandbox-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: rgba(16,185,129,0.07);
  border: 1px solid rgba(16,185,129,0.18);
  border-radius: 10px;
}

.crm-sandbox-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
  50% { box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}

.crm-sandbox-text { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }
.crm-sandbox-text strong { color: var(--success); }

/* CRM Content */
.crm-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  background: var(--bg-root);
}

/* CRM Panels */
.crm-panel { display: none; animation: fadeInUp 0.25s ease; }
.crm-panel.active { display: block; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.stat-card:hover { border-color: var(--border-focus); transform: translateY(-2px); }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-change {
  font-size: 11px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }
.stat-change.neutral { color: var(--text-muted); }
.stat-icon { position: absolute; top: 16px; right: 16px; font-size: 22px; opacity: 0.4; }

/* ============================================================
   TABLE
   ============================================================ */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.table-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-count {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 500;
}

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

.search-wrap { position: relative; }
.search-wrap::before {
  content: '🔍';
  position: absolute;
  left: 8px; top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  pointer-events: none;
}

.search-input {
  padding: 7px 12px 7px 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  width: 200px;
  transition: all 0.2s;
}
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }

table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--bg-surface); }
th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: var(--bg-card-hover); }
tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-danger  { background: rgba(244,63,94,0.15);  color: var(--danger); }
.badge-info    { background: rgba(56,189,248,0.15);  color: var(--info); }
.badge-muted   { background: rgba(255,255,255,0.06); color: var(--text-secondary); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.btn-primary { background: var(--accent, #3b82f6); color: #fff; }
.btn-primary:hover { filter: brightness(1.15); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59,130,246,0.4); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); }
.btn-danger-ghost { background: transparent; color: var(--danger); border: 1px solid rgba(244,63,94,0.3); font-size: 12px; padding: 5px 10px; }
.btn-danger-ghost:hover { background: rgba(244,63,94,0.1); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-logout:hover { background: rgba(244,63,94,0.1); border-color: var(--danger); color: var(--danger); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-family: 'Space Grotesk', sans-serif; font-size: 17px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--bg-card); color: var(--text-primary); }
.modal-body { padding: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   KANBAN
   ============================================================ */
.kanban-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; }

.kanban-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  min-width: 220px;
  max-width: 260px;
  flex-shrink: 0;
}
.kanban-col-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.kanban-col-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.kanban-count { font-size: 11px; padding: 2px 7px; border-radius: 12px; font-weight: 600; }
.kanban-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.kanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px;
  cursor: pointer;
  transition: all 0.2s;
}
.kanban-card:hover { border-color: var(--crm-color, #3b82f6); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.kanban-card-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.kanban-card-meta { font-size: 11px; color: var(--text-muted); display: flex; flex-direction: column; gap: 2px; }

/* ============================================================
   SCHEDULE
   ============================================================ */
.schedule-list { display: flex; flex-direction: column; gap: 10px; }
.schedule-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: all 0.2s;
}
.schedule-item:hover { border-color: var(--border-focus); transform: translateX(2px); }
.schedule-time { font-family: 'Space Grotesk', sans-serif; font-size: 14px; font-weight: 700; color: var(--crm-color, #3b82f6); min-width: 52px; text-align: center; }
.schedule-bar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--crm-color, #3b82f6); opacity: 0.4; }
.schedule-info { flex: 1; }
.schedule-title { font-size: 14px; font-weight: 600; }
.schedule-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   PROPERTY CARDS
   ============================================================ */
.properties-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.property-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s;
}
.property-card:hover { transform: translateY(-4px); border-color: var(--crm-color, #f59e0b); box-shadow: var(--shadow-md); }
.property-img { height: 150px; display: flex; align-items: center; justify-content: center; font-size: 48px; position: relative; overflow: hidden; }
.property-type-badge { position: absolute; top: 10px; left: 10px; font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 12px; }
.property-status-badge { position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 12px; }
.property-body { padding: 14px; }
.property-price { font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.property-address { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }
.property-features { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); }
.property-feature { display: flex; align-items: center; gap: 4px; }

/* ============================================================
   BAR CHART
   ============================================================ */
.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-item { display: grid; grid-template-columns: 110px 1fr 60px; align-items: center; gap: 12px; }
.bar-label { font-size: 12px; color: var(--text-secondary); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: var(--bg-surface); border-radius: 4px; height: 7px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }
.bar-value { font-size: 12px; font-weight: 600; color: var(--text-primary); }

/* ============================================================
   SECTION TITLE
   ============================================================ */
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); margin-left: 8px; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 20px; text-align: center; color: var(--text-muted);
}
.empty-state-icon { font-size: 44px; margin-bottom: 12px; opacity: 0.5; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state-desc { font-size: 13px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 99999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  color: var(--text-primary);
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  min-width: 250px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--info); }

@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; pointer-events: none; } }

/* ============================================================
   UTILITY
   ============================================================ */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-info    { color: var(--info); }
.text-muted   { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
