/* ═══════════════════════════════════════════════════
   Alpha Condominios — Theme inspired by uCondo
   Purple-based professional SaaS design
   ═══════════════════════════════════════════════════ */

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

:root {
  /* Primary palette — Purple */
  --primary: #7C3AED;
  --primary-hover: #6D28D9;
  --primary-dark: #5B21B6;
  --primary-light: #EDE9FE;
  --primary-lighter: #F5F3FF;
  --primary-alpha: rgba(124, 58, 237, .08);

  /* Surfaces & backgrounds */
  --bg: #F8F7FC;
  --surface: #FFFFFF;
  --surface-hover: #FAFAFF;
  --text: #1A1A2E;
  --text-secondary: #4A4A68;
  --text-muted: #8888A4;
  --border: #E8E6F0;
  --border-light: #F0EEF6;

  /* Semantic colors */
  --success: #10B981;
  --success-light: #D1FAE5;
  --success-dark: #059669;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --danger-dark: #DC2626;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --warning-dark: #D97706;
  --info: #3B82F6;
  --info-light: #DBEAFE;
  --info-dark: #2563EB;

  /* Sidebar */
  --sidebar-bg: #FFFFFF;
  --sidebar-text: #4A4A68;
  --sidebar-active-bg: var(--primary-light);
  --sidebar-active-text: var(--primary);
  --sidebar-hover: #F5F3FF;
  --sidebar-border: #F0EEF6;
  --sidebar-width: 250px;

  /* Dimensions */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow: 0 1px 3px rgba(26,26,46,.06), 0 1px 2px rgba(26,26,46,.04);
  --shadow-md: 0 4px 12px rgba(26,26,46,.08), 0 1px 3px rgba(26,26,46,.04);
  --shadow-lg: 0 10px 30px rgba(26,26,46,.1), 0 2px 8px rgba(26,26,46,.06);

  /* Transitions */
  --transition: all .2s cubic-bezier(.4,0,.2,1);
  --transition-fast: all .15s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & Base ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.5; font-size: 14px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ═══════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════ */
.login-card {
  max-width: 420px; margin: 12vh auto; padding: 48px 36px;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); text-align: center;
}
.logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-weight: 700; font-size: 24px; border-radius: 16px; margin-bottom: 16px;
}
.logo-sm { width: 36px; height: 36px; font-size: 14px; border-radius: 10px; }
.login-logo h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.login-logo p { color: var(--text-muted); margin-bottom: 32px; font-size: 15px; }

/* ═══════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: var(--transition-fast);
  white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(124,58,237,.3); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 2px 6px rgba(124,58,237,.35); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { background: var(--primary-lighter); border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--success-dark); }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: var(--warning-dark); }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { width: 100%; padding: 14px; font-size: 16px; font-weight: 600; border-radius: var(--radius); }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════ */
#main-app { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar-width); background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  border-right: 1px solid var(--sidebar-border);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  overflow-y: auto; overflow-x: hidden;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 16px 16px; position: sticky; top: 0;
  background: var(--sidebar-bg); z-index: 1;
}
.sidebar-title { font-weight: 700; font-size: 18px; color: var(--primary); }
.sidebar-toggle { display: none; background: none; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; margin-left: auto; }

.nav-list { list-style: none; flex: 1; padding: 0 8px 8px; }
.nav-section {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-muted); padding: 20px 12px 8px; font-weight: 600;
}
.nav-collapsible {
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  user-select: none; font-size: 12px; padding: 14px 12px 8px;
  color: var(--primary); font-weight: 600;
}
.nav-collapsible:hover { color: var(--primary-hover); }
.nav-arrow { margin-left: auto; font-size: 10px; transition: transform .2s; }
.nav-sub { padding-left: 8px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; color: var(--sidebar-text);
  text-decoration: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 450;
  transition: var(--transition-fast); margin-bottom: 2px;
}
.nav-link:hover { background: var(--sidebar-hover); color: var(--primary); }
.nav-link.active {
  background: var(--sidebar-active-bg); color: var(--sidebar-active-text);
  font-weight: 600;
}
.nav-icon { width: 20px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-icon svg { display: block; opacity: 0.7; }
.nav-link:hover .nav-icon svg, .nav-link.active .nav-icon svg { opacity: 1; }
.nav-section .nav-icon svg { opacity: 0.5; }
.nav-collapsible:hover .nav-icon svg { opacity: 0.8; }

.sidebar-footer {
  padding: 16px; border-top: 1px solid var(--sidebar-border);
  position: sticky; bottom: 0; background: var(--sidebar-bg);
}
.user-info { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.user-role { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Content ── */
#content { flex: 1; margin-left: var(--sidebar-width); min-width: 0; }

#topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 28px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
#page-title { font-size: 20px; font-weight: 600; flex: 1; color: var(--text); }
.menu-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text); }
#tenant-select {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; background: var(--surface); min-width: 160px;
  font-family: inherit; color: var(--text); cursor: pointer;
  transition: var(--transition-fast);
}
#tenant-select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-alpha); }
#page-content { padding: 28px; }

/* ═══════════════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════════════ */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.stat-card {
  background: var(--surface); padding: 20px 22px; border-radius: var(--radius);
  box-shadow: var(--shadow); border-left: 4px solid var(--primary);
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; top: -20px; right: -20px;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--primary-alpha); opacity: .5;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card .label { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; text-transform: uppercase; letter-spacing: .3px; }
.stat-card .value { font-size: 28px; font-weight: 700; color: var(--text); }
.stat-card.success { border-left-color: var(--success); }
.stat-card.success::after { background: rgba(16,185,129,.08); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.warning::after { background: rgba(245,158,11,.08); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.danger::after { background: rgba(239,68,68,.08); }
.stat-card.info { border-left-color: var(--info); }
.stat-card.info::after { background: rgba(59,130,246,.08); }

/* ═══════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════ */
.table-wrap {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow-x: auto; margin-bottom: 24px;
  border: 1px solid var(--border-light);
}
.table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 12px;
}
.table-header h3 { font-size: 16px; font-weight: 600; color: var(--text); }

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; padding: 12px 18px; border-bottom: 2px solid var(--border);
  font-weight: 600; color: var(--text-muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: .6px; background: var(--bg);
  white-space: nowrap;
}
td {
  text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--border-light);
  font-size: 14px; color: var(--text-secondary);
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: var(--transition-fast); }
tbody tr:hover td { background: var(--primary-lighter); }
tbody tr:nth-child(even) td { background: var(--surface-hover); }
tbody tr:nth-child(even):hover td { background: var(--primary-lighter); }

/* ═══════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 99px; font-size: 12px; font-weight: 600;
  letter-spacing: .2px; white-space: nowrap;
}

/* Green: active, approved, completed, paid, picked_up, checked_out */
.badge-active, .badge-ACTIVE, .badge-approved, .badge-completed, .badge-paid,
.badge-picked_up, .badge-checked_out, .badge-resolved {
  background: var(--success-light); color: #065F46;
}

/* Gray: inactive, cancelled, closed, encerrada */
.badge-inactive, .badge-INACTIVE, .badge-cancelled, .badge-closed {
  background: #F1F5F9; color: #64748B;
}

/* Purple/Primary: open, pending, expected, received, draft, scheduled, new */
.badge-open, .badge-pending, .badge-expected, .badge-received,
.badge-draft, .badge-scheduled, .badge-new {
  background: var(--primary-light); color: var(--primary-dark);
}

/* Amber/Yellow: in_progress, notified, checked_in */
.badge-in_progress, .badge-notified, .badge-checked_in {
  background: var(--warning-light); color: #92400E;
}

/* Red: urgent, high, overdue, rejected */
.badge-urgent, .badge-high, .badge-overdue, .badge-rejected {
  background: var(--danger-light); color: #991B1B;
}

/* Misc */
.badge-medium { background: #FEF3C7; color: #92400E; }
.badge-low { background: #F1F5F9; color: #64748B; }
.badge-general { background: var(--primary-light); color: var(--primary-dark); }
.badge-maintenance { background: #FEF3C7; color: #92400E; }
.badge-meeting { background: var(--info-light); color: var(--info-dark); }
.badge-emergency { background: var(--danger-light); color: #991B1B; }
.badge-revenue { background: var(--success-light); color: #065F46; }
.badge-expense { background: var(--danger-light); color: #991B1B; }
.badge-preventive { background: var(--info-light); color: var(--info-dark); }
.badge-corrective { background: var(--warning-light); color: #92400E; }

/* ═══════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 6px; color: var(--text-secondary);
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--text);
  background: var(--surface);
  transition: var(--transition-fast);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary); outline: none;
  box-shadow: 0 0 0 3px var(--primary-alpha);
}
.form-group input::placeholder { color: var(--text-muted); }
.form-group textarea { min-height: 90px; resize: vertical; }
.form-group select { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ═══════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(26,26,46,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; backdrop-filter: blur(4px);
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 90%; max-width: 540px; max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 18px; font-weight: 600; }
.modal-close {
  background: none; border: none; font-size: 20px; cursor: pointer;
  color: var(--text-muted); width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition-fast);
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px; border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 14px 22px; background: var(--text); color: #fff;
  border-radius: var(--radius); font-size: 14px; font-weight: 500;
  transform: translateY(100px); opacity: 0;
  transition: all .35s cubic-bezier(.4,0,.2,1);
  z-index: 300; box-shadow: var(--shadow-lg);
  max-width: 400px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: var(--danger); }

/* ═══════════════════════════════════════════════════
   LOADING & EMPTY STATES
   ═══════════════════════════════════════════════════ */
.loading {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.loading::after {
  content: ''; display: block; width: 32px; height: 32px;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; margin: 16px auto 0;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty h3 { margin-bottom: 8px; color: var(--text-secondary); }
.empty p { font-size: 15px; }

/* ═══════════════════════════════════════════════════
   DETAIL CARDS
   ═══════════════════════════════════════════════════ */
.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.detail-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; border: 1px solid var(--border-light);
}
.detail-card h4 {
  font-size: 13px; color: var(--text-muted); margin-bottom: 14px;
  text-transform: uppercase; letter-spacing: .6px; font-weight: 600;
}
.detail-row {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid var(--border-light); font-size: 14px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); }
.detail-value { font-weight: 600; color: var(--text); }

/* ═══════════════════════════════════════════════════
   QUICK ACTIONS (Dashboard)
   ═══════════════════════════════════════════════════ */
.quick-actions {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-bottom: 28px;
}
.quick-action {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow);
  cursor: pointer; border: 1.5px solid transparent;
  transition: var(--transition); text-decoration: none; color: var(--text);
}
.quick-action:hover {
  border-color: var(--primary); box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.quick-action .qa-icon {
  font-size: 22px; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light); border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.quick-action .qa-label { font-size: 14px; font-weight: 600; color: var(--text); }
.quick-action .qa-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ═══════════════════════════════════════════════════
   DASHBOARD — Activity Chart Area
   ═══════════════════════════════════════════════════ */
.dashboard-grid {
  display: grid; grid-template-columns: 1fr 340px;
  gap: 24px; margin-bottom: 24px;
}
.activity-chart {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px;
  border: 1px solid var(--border-light);
}
.activity-chart h3 {
  font-size: 16px; font-weight: 600; margin-bottom: 20px;
  color: var(--text);
}
.chart-placeholder {
  height: 200px; background: linear-gradient(180deg, var(--primary-lighter) 0%, var(--surface) 100%);
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 14px;
}

/* ── Latest Updates Feed ── */
.updates-feed {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border-light);
}
.updates-feed-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.updates-feed-header h3 { font-size: 16px; font-weight: 600; }
.updates-feed-header p { font-size: 12px; color: var(--text-muted); }

.feed-list { list-style: none; max-height: 420px; overflow-y: auto; }
.feed-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--border-light);
  transition: var(--transition-fast);
}
.feed-item:last-child { border-bottom: none; }
.feed-item:hover { background: var(--surface-hover); }

.feed-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; font-weight: 600;
}
.feed-icon.maintenance { background: #FEE2E2; color: #DC2626; }
.feed-icon.finance { background: #DBEAFE; color: #2563EB; }
.feed-icon.ticket { background: #FEF3C7; color: #D97706; }
.feed-icon.announcement { background: #EDE9FE; color: #7C3AED; }
.feed-icon.visitor { background: #D1FAE5; color: #059669; }
.feed-icon.reservation { background: #CCFBF1; color: #0D9488; }

.feed-content { flex: 1; min-width: 0; }
.feed-title { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.4; }
.feed-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.feed-date { font-size: 12px; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }

/* ═══════════════════════════════════════════════════
   FILTER BAR (for list pages)
   ═══════════════════════════════════════════════════ */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; background: var(--surface-hover);
}
.filter-bar input, .filter-bar select {
  padding: 7px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; font-family: inherit;
  background: var(--surface); color: var(--text);
  transition: var(--transition-fast);
}
.filter-bar input:focus, .filter-bar select:focus {
  border-color: var(--primary); outline: none;
  box-shadow: 0 0 0 3px var(--primary-alpha);
}
.filter-bar input[type="text"],
.filter-bar input[type="search"] { min-width: 200px; }
.filter-bar label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; }

/* ═══════════════════════════════════════════════════
   USER AVATAR (header)
   ═══════════════════════════════════════════════════ */
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; flex-shrink: 0;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 280px; }
  #sidebar { transform: translateX(-100%); box-shadow: none; }
  #sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-toggle { display: block; }
  .menu-toggle { display: block; }
  #content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  #topbar { padding: 12px 16px; }
  #page-content { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .filter-bar { gap: 8px; }
  .filter-bar input[type="text"],
  .filter-bar input[type="search"] { min-width: 100%; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .modal { width: 95%; border-radius: var(--radius); }
  .login-card { margin: 6vh 16px; padding: 32px 24px; }
  .table-header { padding: 14px 16px; }
  th, td { padding: 10px 12px; }
}

/* ═══════════════════════════════════════════════════
   DOCUMENTS PAGE
   ═══════════════════════════════════════════════════ */
.docs-page { position: relative; }
.docs-actions { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.docs-actions .btn svg { vertical-align: -3px; margin-right: 4px; }
.docs-breadcrumb {
  display: flex; align-items: center; gap: 8px; font-size: 14px;
  color: var(--text-secondary); margin-bottom: 20px; font-weight: 500;
}
.docs-breadcrumb svg { opacity: 0.6; }
.docs-section-title { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin: 24px 0 12px; }

/* Folder cards */
.docs-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.folder-card {
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: var(--transition-fast);
  display: flex; flex-direction: column; gap: 8px;
}
.folder-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.folder-card-icon { display: flex; align-items: center; }
.folder-card-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-card-count { font-size: 12px; color: var(--text-muted); }

/* Document cards grid */
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.doc-card {
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius);
  overflow: hidden; transition: var(--transition-fast);
}
.doc-card:hover { box-shadow: var(--shadow); border-color: var(--border); }
.doc-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 0;
}
.doc-card-title { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; margin-right: 8px; }
.doc-card-body { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.doc-file-icon {
  width: 44px; height: 44px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.doc-file-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.doc-file-name { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-file-meta { font-size: 12px; color: var(--text-muted); }
.doc-card-footer {
  display: flex; justify-content: space-between; padding: 8px 14px;
  border-top: 1px solid var(--border-light); font-size: 11px; color: var(--text-muted);
}
.btn-icon {
  background: none; border: none; cursor: pointer; padding: 4px; border-radius: 4px;
  color: var(--text-muted); display: flex; align-items: center; transition: var(--transition-fast);
}
.btn-icon:hover { background: var(--hover-bg); color: var(--text); }

/* Side panel for adding documents */
.doc-side-panel {
  position: fixed; top: 0; right: 0; width: 420px; height: 100vh;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,.1); z-index: 200;
  display: flex; flex-direction: column;
}
.doc-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border-light);
}
.doc-panel-header h3 { margin: 0; font-size: 18px; }
.doc-panel-body { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.doc-panel-footer {
  display: flex; justify-content: flex-end; gap: 12px;
  padding: 16px 24px; border-top: 1px solid var(--border-light);
}

/* Upload drop zone */
.doc-upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 32px 24px; text-align: center; cursor: pointer;
  transition: var(--transition-fast); background: var(--bg);
}
.doc-upload-zone:hover, .doc-upload-zone.drag-over { border-color: var(--primary); background: rgba(124,58,237,.04); }
.doc-upload-zone p { margin: 12px 0 4px; font-size: 14px; color: var(--text-secondary); }
.doc-upload-zone strong { color: var(--primary); }
.doc-upload-hint { font-size: 12px; color: var(--text-muted); }

/* File preview in panel */
.doc-file-preview {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border-light);
}
.doc-file-preview .doc-remove-file { margin-left: auto; }

.char-count { font-size: 11px; color: var(--text-muted); text-align: right; display: block; margin-top: 4px; }

@media (max-width: 640px) {
  .doc-side-panel { width: 100%; }
  .docs-grid { grid-template-columns: 1fr; }
  .docs-folders { grid-template-columns: 1fr 1fr; }
}

/* Ações rápidas do Início */
.quick-shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.quick-shortcut { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border, #e5e7eb); border-radius: 12px; background: var(--surface, #fff); cursor: pointer; text-align: left; font: inherit; color: inherit; }
.quick-shortcut:hover { border-color: #7C3AED; }
.quick-shortcut .qa-icon { width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.quick-shortcut .qa-label { display: block; font-weight: 600; }
.quick-shortcut .qa-desc { display: block; font-size: 12px; opacity: .7; }
/* Selo "Em breve" */
.nav-soon { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 600; background: rgba(124, 58, 237, .12); color: #7C3AED; vertical-align: middle; }
.nav-soon-lg { font-size: 12px; padding: 3px 10px; margin: 0 0 8px; }
.soon-card { padding: 48px 24px; }

/* Login pelo Google (17/11/2026) */
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn-google svg { background: #fff; border-radius: 50%; padding: 2px; }
.login-error { margin-top: 12px; color: #b91c1c; font-size: 14px; }

/* Logo BayitCon (17/11/2026) */
.login-brand { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto 28px; }
.sidebar-brand { display: block; height: 40px; width: auto; max-width: 170px; object-fit: contain; }
