/* ═══════════════════════════════════════════════════
   SAAS NEGÓCIOS — app.css
   Layout, componentes e utilitários
   ═══════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

/* ── Typography ── */
h1, h2, h3, h4, h5 { font-family: var(--font-display); line-height: var(--leading-tight); }
h1 { font-size: var(--text-3xl); font-weight: var(--weight-bold); }
h2 { font-size: var(--text-2xl); font-weight: var(--weight-semibold); }
h3 { font-size: var(--text-xl);  font-weight: var(--weight-semibold); }
h4 { font-size: var(--text-lg);  font-weight: var(--weight-medium); }

.mono { font-family: var(--font-mono); }
.display { font-family: var(--font-display); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

/* ─────────────────────────────────────────
   SCREENS
   ───────────────────────────────────────── */

/* Auth */
#screen-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 60% 50% at 20% 10%, rgba(79,142,247,0.10) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 90%, rgba(167,139,250,0.07) 0%, transparent 60%),
    var(--bg-base);
  padding: var(--space-4);
}

/* Setup empresa */
#screen-setup {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  padding: var(--space-4);
}

/* App shell */
#screen-app {
  display: none;
  height: 100vh;
  overflow: hidden;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ─────────────────────────────────────────
   SIDEBAR
   ───────────────────────────────────────── */
.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px; height: 100%;
  background: linear-gradient(to bottom,
    transparent,
    var(--border-subtle) 20%,
    var(--border-subtle) 80%,
    transparent
  );
  pointer-events: none;
}

.sidebar-header {
  padding: var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.logo-mark {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  position: relative;
}

.logo-mark::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15) inset;
}

.logo-text-primary {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.logo-text-secondary {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: var(--weight-normal);
  margin-top: 1px;
}

/* Empresa chip */
.empresa-chip {
  margin: var(--space-2) var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: var(--ease-fast);
  text-align: left;
  width: calc(100% - var(--space-6));
}

.empresa-chip:hover {
  background: var(--bg-active);
  border-color: var(--border-default);
}

.empresa-emoji { font-size: 18px; flex-shrink: 0; }
.empresa-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.empresa-role {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: 1px;
  text-transform: capitalize;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3) var(--space-2);
}

.nav-group { margin-bottom: var(--space-4); }

.nav-group-label {
  font-size: 10px;
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  padding: 0 var(--space-2) var(--space-1);
  display: block;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 7px var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  font-family: var(--font-body);
  cursor: pointer;
  transition: var(--ease-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}

.nav-item i { font-size: 16px; flex-shrink: 0; opacity: 0.7; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item:hover i { opacity: 1; }

.nav-item.active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: var(--weight-medium);
}

.nav-item.active i { opacity: 1; }

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 2px; height: 16px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

/* Sidebar footer */
.sidebar-footer {
  padding: var(--space-3) var(--space-2);
  border-top: 1px solid var(--border-subtle);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--ease-fast);
}

.user-menu:hover { background: var(--bg-hover); }

.avatar {
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: white;
  flex-shrink: 0;
  font-family: var(--font-display);
}

.user-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─────────────────────────────────────────
   MAIN CONTENT
   ───────────────────────────────────────── */
.main-content {
  overflow-y: auto;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 var(--space-8);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  backdrop-filter: blur(8px);
}

.topbar-left { display: flex; align-items: center; gap: var(--space-3); }
.topbar-title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.topbar-sub { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 1px; }

.topbar-actions { display: flex; align-items: center; gap: var(--space-2); }

/* Page content */
.page-content {
  padding: var(--space-6) var(--space-8);
  flex: 1;
}

/* Pages */
.page { display: none; }
.page.active { display: block; }

/* ─────────────────────────────────────────
   COMPONENTS
   ───────────────────────────────────────── */

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: var(--ease-normal);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-default), transparent);
}

.stat-card:hover { border-color: var(--border-default); }

.stat-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  margin-bottom: var(--space-3);
}

.stat-icon.green { background: var(--green-subtle); color: var(--green); }
.stat-icon.red   { background: var(--red-subtle);   color: var(--red);   }
.stat-icon.blue  { background: var(--accent-subtle); color: var(--accent); }
.stat-icon.purple{ background: var(--purple-subtle); color: var(--purple); }
.stat-icon.teal  { background: var(--teal-subtle);   color: var(--teal);  }

.stat-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-1);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  line-height: 1;
}

.stat-value.green  { color: var(--green); }
.stat-value.red    { color: var(--red);   }
.stat-value.accent { color: var(--accent); }

.stat-delta {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: relative;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.card-action {
  font-size: var(--text-xs);
  color: var(--accent);
  cursor: pointer;
  font-weight: var(--weight-medium);
  transition: var(--ease-fast);
}

.card-action:hover { opacity: 0.75; }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-4); }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-4); }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: var(--space-4); }

.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }

/* ─────────────────────────────────────────
   TABLE
   ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

tbody td {
  padding: 11px var(--space-3);
  font-size: var(--text-base);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--text-primary);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: var(--ease-fast); }
tbody tr:hover td { background: rgba(255,255,255,0.02); }

/* ─────────────────────────────────────────
   FORM ELEMENTS
   ───────────────────────────────────────── */
.form-group { margin-bottom: var(--space-4); }

.form-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
  letter-spacing: 0.02em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px var(--space-3);
  font-size: var(--text-base);
  font-family: var(--font-body);
  outline: none;
  transition: var(--ease-fast);
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}

.form-input::placeholder { color: var(--text-tertiary); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { cursor: pointer; }

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

.input-group {
  display: flex;
  gap: var(--space-2);
}

.input-group .form-input { flex: 1; }

/* ─────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 8px var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-family: var(--font-body);
  border: none;
  cursor: pointer;
  transition: var(--ease-fast);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn i { font-size: 15px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-active);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--border-strong); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-default); }

.btn-danger {
  background: var(--red-subtle);
  color: var(--red);
  border: 1px solid var(--red-border);
}
.btn-danger:hover:not(:disabled) { background: var(--red); color: #fff; }

.btn-sm { padding: 5px var(--space-3); font-size: var(--text-xs); }
.btn-lg { padding: 11px var(--space-6); font-size: var(--text-md); }
.btn-full { width: 100%; }

.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ─────────────────────────────────────────
   BADGES / TAGS
   ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.badge-green  { background: var(--green-subtle);  color: var(--green);  border: 1px solid var(--green-border); }
.badge-red    { background: var(--red-subtle);    color: var(--red);    border: 1px solid var(--red-border); }
.badge-yellow { background: var(--yellow-subtle); color: var(--yellow); border: 1px solid var(--yellow-border); }
.badge-blue   { background: var(--accent-subtle); color: var(--accent); border: 1px solid var(--accent-border); }
.badge-purple { background: var(--purple-subtle); color: var(--purple); border: 1px solid var(--purple-border); }
.badge-teal   { background: var(--teal-subtle);   color: var(--teal);   border: 1px solid var(--teal-border); }
.badge-gray   { background: var(--bg-active);     color: var(--text-secondary); border: 1px solid var(--border-default); }

/* ─────────────────────────────────────────
   FILTER TABS
   ───────────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  width: fit-content;
}

.filter-tab {
  padding: 5px var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--ease-fast);
  border: none;
  background: none;
  font-family: var(--font-body);
}

.filter-tab:hover { color: var(--text-primary); }
.filter-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ─────────────────────────────────────────
   MODAL
   ───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-4);
  backdrop-filter: blur(4px);
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--ease-fast);
}

.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-footer {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

/* ─────────────────────────────────────────
   ALERTS
   ───────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-3);
}

.alert i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-error   { background: var(--red-subtle);    color: var(--red);    border: 1px solid var(--red-border); }
.alert-success { background: var(--green-subtle);  color: var(--green);  border: 1px solid var(--green-border); }
.alert-info    { background: var(--accent-subtle); color: var(--accent); border: 1px solid var(--accent-border); }
.alert-warning { background: var(--yellow-subtle); color: var(--yellow); border: 1px solid var(--yellow-border); }

/* ─────────────────────────────────────────
   PROGRESS
   ───────────────────────────────────────── */
.progress-bar {
  height: 5px;
  background: var(--bg-active);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─────────────────────────────────────────
   CHARTS (bar)
   ───────────────────────────────────────── */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  height: 88px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  height: 100%;
}

.bar-pair {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-label {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* ─────────────────────────────────────────
   DRE ROWS
   ───────────────────────────────────────── */
.dre-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-base);
  gap: var(--space-4);
}

.dre-row:last-child { border-bottom: none; }
.dre-row.indent { padding-left: var(--space-4); color: var(--text-secondary); font-size: var(--text-sm); }
.dre-row.total {
  font-weight: var(--weight-semibold);
  font-size: var(--text-md);
  border-top: 2px solid var(--border-default);
  border-bottom: none;
  margin-top: var(--space-2);
  padding-top: var(--space-3);
}

/* ─────────────────────────────────────────
   INVITE CODE
   ───────────────────────────────────────── */
.invite-code-block {
  background: var(--bg-hover);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  text-align: center;
  margin: var(--space-4) 0;
}

.invite-code-number {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: var(--weight-bold);
  letter-spacing: 10px;
  color: var(--accent);
  line-height: 1;
}

.invite-code-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-2);
}

/* ─────────────────────────────────────────
   SÓCIO CARD
   ───────────────────────────────────────── */
.socio-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  transition: var(--ease-fast);
}

.socio-card:hover { border-color: var(--border-default); }

.socio-avatar {
  width: 42px; height: 42px;
  border-radius: var(--radius-full);
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.socio-info { flex: 1; overflow: hidden; }
.socio-name { font-size: var(--text-md); font-weight: var(--weight-medium); }
.socio-meta { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 3px; display: flex; align-items: center; gap: var(--space-2); }

.socio-pct {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--accent);
  flex-shrink: 0;
}

/* ─────────────────────────────────────────
   META CARD
   ───────────────────────────────────────── */
.meta-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: var(--ease-fast);
}

.meta-card:hover { border-color: var(--border-default); }

.meta-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.meta-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────
   EMPTY STATE
   ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  color: var(--text-tertiary);
}

.empty-state i { font-size: 36px; margin-bottom: var(--space-3); display: block; opacity: 0.35; }
.empty-state p { font-size: var(--text-sm); }

/* ─────────────────────────────────────────
   TOAST
   ───────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 340px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#toast.show { transform: translateY(0); opacity: 1; }

/* ─────────────────────────────────────────
   SPINNER
   ───────────────────────────────────────── */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.55s linear infinite;
  flex-shrink: 0;
}

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

/* ─────────────────────────────────────────
   OR DIVIDER
   ───────────────────────────────────────── */
.or-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.or-divider hr {
  flex: 1;
  border: none;
  border-top: 1px solid var(--border-subtle);
}

.or-divider span { font-size: var(--text-xs); color: var(--text-tertiary); }

/* ─────────────────────────────────────────
   AUTH BOX
   ───────────────────────────────────────── */
.auth-container { width: 100%; max-width: 400px; }

.auth-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}

.auth-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-1);
}

.auth-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
}

.auth-switch {
  text-align: center;
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.auth-switch a {
  color: var(--accent);
  cursor: pointer;
  font-weight: var(--weight-medium);
  text-decoration: none;
}

/* ─────────────────────────────────────────
   THEME TOGGLE
   ───────────────────────────────────────── */
.theme-toggle {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-tertiary);
  transition: var(--ease-fast);
  border: none;
  background: none;
  font-size: 17px;
}

.theme-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ─────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────── */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .page-content { padding: var(--space-4); }
  .topbar { padding: 0 var(--space-4); }
}
