/* ============================================================
   HOTSPOT SAAS — DESIGN SYSTEM GLOBAL
   Paleta: Branco + Azul Corporativo (estilo bancário limpo)
   Fonte display: Sora | Corpo: DM Sans
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── CSS VARIABLES ─────────────────────────────────────── */
:root {
  --primary:        #1a56db;
  --primary-dark:   #1145b5;
  --primary-light:  #ebf0ff;
  --accent:         #0ea5e9;
  --success:        #16a34a;
  --success-light:  #dcfce7;
  --warning:        #d97706;
  --warning-light:  #fef9c3;
  --danger:         #dc2626;
  --danger-light:   #fee2e2;
  --info:           #0891b2;
  --info-light:     #e0f2fe;

  --text-primary:   #111827;
  --text-secondary: #4b5563;
  --text-muted:     #9ca3af;

  --bg:             #f8fafc;
  --bg-card:        #ffffff;
  --bg-sidebar:     #0f172a;

  --border:         #e5e7eb;
  --border-focus:   #1a56db;

  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:     0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.12);

  --font-display: 'Sora', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --sidebar-w: 260px;
  --topbar-h:  64px;
  --transition: .2s ease;
}

/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

/* ── TYPOGRAPHY ─────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.25; color: var(--text-primary); }
h1 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.75rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p  { color: var(--text-secondary); }
small { font-size: .8125rem; color: var(--text-muted); }

/* ── LAYOUT ─────────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform var(--transition);
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.page-body { padding: 28px; flex: 1; }

/* ── SIDEBAR INTERNALS ──────────────────────────────────── */
.sidebar-brand {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .brand-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
}
.sidebar-brand .brand-sub {
  font-size: .72rem;
  color: rgba(255,255,255,.4);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-section-label {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.3);
  padding: 14px 20px 4px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.7);
  font-size: .875rem;
  font-weight: 500;
  border-radius: 0;
  transition: all var(--transition);
  position: relative;
}
.sidebar-link:hover, .sidebar-link.active {
  color: #fff;
  background: rgba(255,255,255,.07);
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.sidebar-link svg { width: 18px; height: 18px; opacity: .8; flex-shrink: 0; }
.sidebar-link.active svg { opacity: 1; }
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Stats card */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; color: var(--primary); }
.stat-body { flex: 1; }
.stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.stat-label { font-size: .8125rem; color: var(--text-muted); margin-top: 4px; }

/* ── GRID ───────────────────────────────────────────────── */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; box-shadow: 0 4px 12px rgba(26,86,219,.35); }
.btn-secondary { background: var(--bg); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.08); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-ghost     { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-light); }
.btn-sm        { padding: 6px 12px; font-size: .8125rem; }
.btn-lg        { padding: 13px 28px; font-size: 1rem; }
.btn-block     { width: 100%; justify-content: center; }
.btn:disabled  { opacity: .6; cursor: not-allowed; }

/* ── FORMS ──────────────────────────────────────────────── */
.form-group  { margin-bottom: 18px; }
.form-label  { display: block; font-size: .875rem; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  color: var(--text-primary);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ── TABLE ──────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: var(--bg-card); }
thead th {
  background: var(--bg);
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: .875rem; color: var(--text-primary); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--bg); }

/* ── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-success   { background: var(--success-light); color: var(--success); }
.badge-danger    { background: var(--danger-light);  color: var(--danger); }
.badge-warning   { background: var(--warning-light); color: var(--warning); }
.badge-info      { background: var(--info-light);    color: var(--info); }
.badge-secondary { background: var(--border);        color: var(--text-muted); }
.badge-dark      { background: #1f2937;              color: #e5e7eb; }
.badge-primary   { background: var(--primary-light); color: var(--primary); }

/* ── ALERTS ─────────────────────────────────────────────── */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  border-left: 4px solid;
  margin-bottom: 16px;
}
.alert-success { background: var(--success-light); border-color: var(--success); color: #14532d; }
.alert-danger  { background: var(--danger-light);  border-color: var(--danger);  color: #7f1d1d; }
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: #78350f; }
.alert-info    { background: var(--info-light);    border-color: var(--info);    color: #164e63; }

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: var(--text-primary); }
.page-subtitle { font-size: .875rem; color: var(--text-muted); margin-top: 2px; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1.4rem; line-height: 1; }
.modal-close:hover { color: var(--text-primary); }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state svg { width: 56px; height: 56px; color: var(--text-muted); margin: 0 auto 16px; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 6px; }
.empty-state p  { font-size: .875rem; color: var(--text-muted); max-width: 320px; margin: 0 auto 20px; }

/* ── LOADING ─────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(26,86,219,.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── PAGINATION ──────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; flex-wrap: wrap; }
.page-link {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: .875rem;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: all var(--transition);
  text-decoration: none;
}
.page-link:hover, .page-link.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── UTILS ───────────────────────────────────────────────── */
.text-primary   { color: var(--primary) !important; }
.text-success   { color: var(--success) !important; }
.text-danger    { color: var(--danger)  !important; }
.text-warning   { color: var(--warning) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-right     { text-align: right; }
.text-center    { text-align: center; }
.text-bold      { font-weight: 700; }
.mt-0{margin-top:0} .mt-1{margin-top:8px} .mt-2{margin-top:16px} .mt-3{margin-top:24px} .mt-4{margin-top:32px}
.mb-0{margin-bottom:0} .mb-1{margin-bottom:8px} .mb-2{margin-bottom:16px} .mb-3{margin-bottom:24px}
.d-flex{display:flex} .align-center{align-items:center} .justify-between{justify-content:space-between}
.gap-1{gap:8px} .gap-2{gap:16px} .gap-3{gap:24px}
.w-100{width:100%}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-body { padding: 16px; }
  .topbar { padding: 0 16px; }
  .form-row { grid-template-columns: 1fr; }
}