/* ====================================================
   LaudoImóvel — Design System
   ==================================================== */

:root {
  --primary:      #1a3a5c;
  --primary-dark: #122840;
  --primary-light:#e8f0fa;
  --accent:       #2d6a9f;
  --accent2:      #17b8a6;
  --success:      #27ae60;
  --warning:      #f39c12;
  --danger:       #e74c3c;
  --info:         #2980b9;
  --gray-50:      #f8fafc;
  --gray-100:     #f1f5f9;
  --gray-200:     #e2e8f0;
  --gray-300:     #cbd5e1;
  --gray-400:     #94a3b8;
  --gray-500:     #64748b;
  --gray-600:     #475569;
  --gray-700:     #334155;
  --gray-800:     #1e293b;
  --gray-900:     #0f172a;
  --white:        #ffffff;
  --sidebar-w:    260px;
  --topbar-h:     60px;
  --radius:       10px;
  --shadow-sm:    0 1px 3px rgba(15,23,42,.06);
  --shadow:       0 6px 18px rgba(15,23,42,.08);
  --shadow-lg:    0 20px 50px rgba(15,23,42,.18);
  --transition:   .18s ease;
  --font:         'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 14px;
  color: var(--gray-800); background: var(--gray-100);
  line-height: 1.55; -webkit-font-smoothing: antialiased; letter-spacing: .1px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }
::selection { background: var(--accent2); color: #fff; }

/* ── Layout ──────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: linear-gradient(190deg, var(--primary) 0%, var(--primary-dark) 100%); color: var(--white);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  transition: transform var(--transition);
  z-index: 1000;
  box-shadow: 2px 0 12px rgba(0,0,0,.2);
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1rem; border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo { display: flex; align-items: center; gap: .6rem; font-size: 1.2rem; font-weight: 800; }
.logo-icon { font-size: 1.5rem; }
.sidebar-toggle-close {
  display: none; background: none; border: none; color: var(--white);
  padding: 4px; border-radius: 4px; opacity: .7;
}
.sidebar-toggle-close:hover { opacity: 1; background: rgba(255,255,255,.1); }

.sidebar-user {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem; border-bottom: 1px solid rgba(255,255,255,.1);
}
.user-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; flex-shrink: 0;
}
.user-info { min-width: 0; }
.user-name { font-weight: 600; font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-creci, .user-cnai { font-size: .75rem; opacity: .7; }

.sidebar-nav { list-style: none; padding: .75rem 0; flex: 1; margin: 0; }
.nav-item { margin: 2px 0; }
.nav-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem; color: rgba(255,255,255,.8);
  border-radius: 6px; margin: 0 .5rem;
  transition: background var(--transition), color var(--transition);
  font-size: .875rem;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,.15); color: #fff; text-decoration: none;
}
.nav-link.active { background: rgba(255,255,255,.2); font-weight: 600; }

.sidebar-footer { padding: .75rem; border-top: 1px solid rgba(255,255,255,.1); }
.btn-logout {
  display: flex; align-items: center; gap: .6rem;
  width: 100%; padding: .6rem 1rem;
  color: rgba(255,255,255,.7); font-size: .875rem;
  border-radius: 6px; transition: background var(--transition), color var(--transition);
}
.btn-logout:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 999;
}

.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h); background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; padding: 0 1.25rem;
  gap: 1rem; z-index: 900; box-shadow: var(--shadow-sm);
}
.topbar-toggle { display: none; background: none; border: none; color: var(--gray-700); padding: 6px; border-radius: 6px; }
.topbar-toggle:hover { background: var(--gray-100); }
.topbar-title { flex: 1; font-size: 1rem; font-weight: 600; color: var(--gray-800); }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.topbar-user { font-size: .875rem; color: var(--gray-600); font-weight: 500; }

.main-content {
  margin-left: var(--sidebar-w); padding-top: var(--topbar-h);
  min-height: 100vh; padding: calc(var(--topbar-h) + 1.5rem) 1.5rem 2rem;
}

/* ── Cards ───────────────────────────────────────── */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200);
  margin-bottom: 1.25rem; overflow: hidden;
}
.card-highlight { border-top: 3px solid var(--primary); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .875rem 1.25rem; border-bottom: 1px solid var(--gray-100);
}
.card-title { font-size: .9375rem; font-weight: 700; color: var(--gray-800); margin: 0; }
.card-body { padding: 1.25rem; }
.card-body.p-0 { padding: 0; }

/* ── Forms ───────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: .8125rem; font-weight: 600; color: var(--gray-700); margin-bottom: .375rem; }
.form-control {
  width: 100%; padding: .5rem .75rem; border: 1px solid var(--gray-300);
  border-radius: 6px; font-size: .875rem; color: var(--gray-800);
  background: var(--white); transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,58,92,.15); }
.form-control:read-only { background: var(--gray-50); color: var(--gray-500); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .625rem center; padding-right: 2rem; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: .75rem; color: var(--gray-400); margin-top: .25rem; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem 1rem; border-radius: 6px; font-size: .875rem;
  font-weight: 500; border: none; cursor: pointer;
  text-decoration: none; transition: all var(--transition);
  white-space: nowrap; line-height: 1;
}
.btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.btn-primary   { background: linear-gradient(135deg, var(--accent), var(--primary)); color: #fff; box-shadow: 0 4px 14px rgba(18,49,86,.25); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(18,49,86,.35); transform: translateY(-1px); text-decoration: none; color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #219a52; color: #fff; text-decoration: none; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; color: #fff; text-decoration: none; }
.btn-outline   { background: transparent; border: 1px solid var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { background: var(--gray-100); text-decoration: none; border-color: var(--gray-400); }
.btn-secondary { background: var(--gray-200); color: var(--gray-600); }
.btn-block     { width: 100%; justify-content: center; }
.btn-sm        { padding: .3rem .7rem; font-size: .8rem; }
.btn-link      { background: none; border: none; color: var(--primary); padding: 0; font-size: inherit; text-decoration: underline; }
.btn-icon      { background: none; border: none; padding: 4px; font-size: 1.1rem; color: var(--gray-500); border-radius: 4px; }
.btn-icon:hover { background: var(--gray-100); }
.btn-icon-danger:hover { background: #fee; color: var(--danger); }
.btn[disabled] { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* ── Alerts ──────────────────────────────────────── */
.alert {
  padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem;
  font-size: .875rem; position: relative;
  display: flex; align-items: flex-start; gap: .5rem; justify-content: space-between;
}
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-danger  { background: #fff5f5; border: 1px solid #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-close   { background: none; border: none; font-size: 1.2rem; line-height: 1; padding: 0 .25rem; opacity: .7; cursor: pointer; color: inherit; flex-shrink: 0; }
.alert-dismissible { padding-right: 2.5rem; }

/* ── Badges ──────────────────────────────────────── */
.badge {
  display: inline-block; padding: .2rem .6rem;
  border-radius: 20px; font-size: .75rem; font-weight: 600;
}
.badge-success  { background: #dcfce7; color: #15803d; }
.badge-warning  { background: #fef9c3; color: #854d0e; }
.badge-danger   { background: #fee2e2; color: #b91c1c; }
.badge-secondary{ background: var(--gray-200); color: var(--gray-600); }

/* ── Table ───────────────────────────────────────── */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th { padding: .75rem 1rem; background: var(--gray-50); font-weight: 600; text-align: left; color: var(--gray-700); border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.table td { padding: .75rem 1rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.table-hover tbody tr:hover { background: var(--gray-50); }
.text-muted { color: var(--gray-400); font-size: .8rem; }
.laudo-num { font-family: monospace; font-size: .8rem; background: var(--gray-100); padding: 2px 6px; border-radius: 4px; }

/* ── Page header ─────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap;
}
.page-title { font-size: 1.375rem; font-weight: 800; color: var(--gray-900); margin: 0; display: flex; align-items: center; gap: .6rem; }
.page-subtitle { font-size: .875rem; color: var(--gray-500); margin: .25rem 0 0; }

/* ── Stats Grid ──────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 1.25rem; border: 1px solid var(--gray-200); display: flex; align-items: center; gap: 1rem; box-shadow: var(--shadow-sm); }
.stat-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon-blue   { background: #dbeafe; color: #1d4ed8; }
.stat-icon-green  { background: #dcfce7; color: #15803d; }
.stat-icon-yellow { background: #fef9c3; color: #a16207; }
.stat-icon-purple { background: #ede9fe; color: #6d28d9; }
.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); line-height: 1; }
.stat-label { font-size: .8125rem; color: var(--gray-500); margin-top: .25rem; }

/* ── Credentials ─────────────────────────────────── */
.credentials-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.credential-item { display: flex; align-items: center; gap: .75rem; padding: .75rem; background: var(--gray-50); border-radius: 6px; }
.credential-label { font-size: .75rem; font-weight: 600; color: var(--gray-500); min-width: 40px; }
.credential-value { flex: 1; font-size: .9rem; font-weight: 600; color: var(--gray-800); }

/* ── Filter ──────────────────────────────────────── */
.filter-card { padding: 1rem 1.25rem; }
.filter-form .filter-row { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.filter-form .form-group { margin: 0; }
.flex-1 { flex: 1; min-width: 200px; }

/* ── Pagination ──────────────────────────────────── */
.pagination { display: flex; gap: .35rem; justify-content: center; margin-top: 1.5rem; }
.page-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 6px; border: 1px solid var(--gray-300); background: var(--white); color: var(--gray-700); font-size: .875rem; text-decoration: none; }
.page-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }

/* ── Empty state ─────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { color: var(--gray-500); margin-bottom: 1.25rem; }

/* ── Action buttons ──────────────────────────────── */
.action-buttons { display: flex; gap: .4rem; align-items: center; }

/* ── Tabs ────────────────────────────────────────── */
.tab-nav {
  display: flex; overflow-x: auto; gap: 2px; margin-bottom: 1.25rem;
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--gray-200); padding: .35rem;
  box-shadow: var(--shadow-sm);
}
.tab-btn {
  flex-shrink: 0; padding: .5rem 1rem; border-radius: 6px; border: none;
  background: transparent; font-size: .8125rem; font-weight: 600;
  color: var(--gray-500); cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.tab-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.tab-btn.active { background: var(--primary); color: var(--white); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: .75rem; }

/* ── Comparativos ────────────────────────────────── */
.comparativo-item {
  border: 1px solid var(--gray-200); border-radius: 6px; padding: 1rem;
  margin-bottom: 1rem; background: var(--gray-50);
}
.comparativo-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }

/* ── Upload / Fotos ──────────────────────────────── */
.upload-area {
  border: 2px dashed var(--gray-300); border-radius: var(--radius);
  padding: 2rem; text-align: center; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-area.drag-over { border-color: var(--primary); background: var(--primary-light); }
.upload-icon { font-size: 2rem; margin-bottom: .5rem; }
.upload-text { color: var(--gray-600); font-size: .9rem; }
.upload-hint { font-size: .8rem; color: var(--gray-400); margin-top: .25rem; }
.fotos-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem; margin-top: 1rem; }
.fotos-preview .foto-thumb { position: relative; border-radius: 6px; overflow: hidden; aspect-ratio: 4/3; background: var(--gray-200); }
.fotos-preview .foto-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fotos-preview .foto-remove { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.6); color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; font-size: .9rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ── Checkbox grid ───────────────────────────────── */
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .5rem; }
.checkbox-item { display: flex; align-items: center; gap: .5rem; font-size: .875rem; cursor: pointer; padding: .4rem .6rem; border-radius: 6px; border: 1px solid var(--gray-200); background: var(--gray-50); }
.checkbox-item input { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; }
.checkbox-item:hover { background: var(--primary-light); border-color: var(--primary); }

/* ── Form actions final ──────────────────────────── */
.form-actions-final {
  display: flex; justify-content: flex-end; gap: .75rem;
  padding: 1.25rem; background: var(--white);
  border-radius: var(--radius); border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm); position: sticky; bottom: 0; z-index: 100;
  flex-wrap: wrap;
}

/* ── Login ───────────────────────────────────────── */
.login-body {
  background:
    radial-gradient(circle at 15% 20%, rgba(23,184,166,.25), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(45,106,159,.3), transparent 50%),
    linear-gradient(150deg, var(--primary-dark) 0%, var(--primary) 60%, var(--accent) 130%);
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.login-wrapper { width: 100%; max-width: 440px; }
.login-card { background: var(--white); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 2.25rem 2rem; }
.login-header { text-align: center; margin-bottom: 1.75rem; }
.login-logo {
  font-size: 2.1rem; width: 64px; height: 64px; line-height: 64px; margin: 0 auto;
  background: linear-gradient(135deg, var(--accent2), var(--accent)); border-radius: 16px;
  box-shadow: 0 8px 20px rgba(23,184,166,.35);
}
.login-title { font-size: 1.6rem; font-weight: 800; color: var(--primary); margin: 1rem 0 .2rem; letter-spacing: -.01em; }
.login-subtitle { color: var(--gray-500); font-size: .875rem; }
.login-form { display: flex; flex-direction: column; gap: .25rem; }
.login-form .btn { margin-top: .75rem; }
.btn-loading .spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-info { font-size: .8125rem; color: var(--gray-500); margin-top: 1.5rem; padding: .875rem; background: var(--gray-50); border-radius: 6px; line-height: 1.6; display: flex; gap: .5rem; align-items: flex-start; }
.login-info svg { flex-shrink: 0; margin-top: .15rem; }
.form-section-title { font-size: .8125rem; font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--gray-200); }

/* ── Visualizar Laudo ────────────────────────────── */
.laudo-view { display: flex; flex-direction: column; gap: 1rem; }
.status-bar { display: flex; align-items: center; gap: 1rem; padding: .75rem 1.25rem; background: var(--white); border-radius: var(--radius); border: 1px solid var(--gray-200); margin-bottom: 1rem; font-size: .875rem; color: var(--gray-600); }
.imovel-endereco-full { font-size: 1rem; font-weight: 600; color: var(--gray-800); background: var(--gray-50); padding: .75rem 1rem; border-radius: 6px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.info-item { display: flex; flex-direction: column; gap: .15rem; }
.info-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--gray-400); }
.info-value { font-size: .9rem; color: var(--gray-800); }
.section-subtitle { font-size: .8125rem; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; margin-bottom: .75rem; margin-top: .5rem; }
.valor-destaque { text-align: center; padding: 1.5rem; }
.valor-label { font-size: .8125rem; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-500); }
.valor-numero { font-size: 2.25rem; font-weight: 900; color: var(--primary); margin: .25rem 0; }
.valor-unitario { font-size: .875rem; color: var(--gray-400); }
.fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.foto-item img { width: 100%; height: 160px; object-fit: cover; border-radius: 6px; cursor: pointer; transition: transform var(--transition); }
.foto-item img:hover { transform: scale(1.02); }
.foto-desc { font-size: .75rem; color: var(--gray-500); text-align: center; margin-top: .35rem; }
.assinatura-block { text-align: center; padding: 1.5rem; }
.assinatura-linha { border-top: 1px solid var(--gray-400); width: 220px; margin: 0 auto 8px; }
.assinatura-nome { font-weight: 700; font-size: 1rem; }
.assinatura-creci, .assinatura-cnai { font-size: .875rem; color: var(--gray-500); }

/* ── Lightbox ────────────────────────────────────── */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 9999; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox img { max-width: 90vw; max-height: 88vh; border-radius: 4px; object-fit: contain; cursor: default; box-shadow: 0 8px 32px rgba(0,0,0,.5); }
.lightbox-close { position: absolute; top: 16px; right: 20px; background: rgba(255,255,255,.15); border: none; color: #fff; font-size: 2rem; line-height: 1; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s; z-index: 1; }
.lightbox-close:hover { background: rgba(255,255,255,.3); }

/* ── Modal ───────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); }
.modal-dialog { background: var(--white); border-radius: var(--radius); width: 90%; max-width: 440px; position: relative; z-index: 1; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--gray-200); }
.modal-header h4 { margin: 0; font-size: 1rem; }
.modal-body { padding: 1.25rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: .75rem; padding: 1rem 1.25rem; border-top: 1px solid var(--gray-200); }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle-close { display: flex; }
  .sidebar-overlay.open { display: block; }
  .topbar { left: 0; }
  .topbar-toggle { display: flex; }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row-2, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
  .credentials-grid { grid-template-columns: 1fr; }
  .filter-form .filter-row { flex-direction: column; }
  .flex-1 { width: 100%; }
  .tab-nav { flex-wrap: nowrap; }
  .form-actions-final { flex-direction: column; }
  .form-actions-final .btn { width: 100%; justify-content: center; }
  .page-header { flex-direction: column; gap: .75rem; }
  .action-buttons { flex-wrap: wrap; }
  .info-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .main-content { padding: calc(var(--topbar-h) + 1rem) .75rem 1.5rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .card-body { padding: .875rem; }
  .login-card { padding: 1.5rem; }
  .info-grid { grid-template-columns: 1fr; }
  .fotos-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Spin animation ──────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .8s linear infinite; }

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
