/* ============================================================
   TRÍADE CLUBE DE BENEFÍCIOS — Estilos
   Paleta: Verde escuro + Dourado + Branco
   ============================================================ */

:root {
  --green-900: #0a3a2d;
  --green-800: #0d4f3c;
  --green-700: #125e48;
  --green-600: #186d55;
  --green-100: rgba(13, 79, 60, 0.08);
  --green-050: rgba(13, 79, 60, 0.04);

  --gold-500: #c9a34e;
  --gold-400: #d4b468;
  --gold-600: #a88638;
  --gold-100: rgba(201, 163, 78, 0.12);
  --gold-050: rgba(201, 163, 78, 0.06);

  --cream: #faf8f3;
  --white: #ffffff;
  --off-white: #f8f7f2;

  --text: #1a2a22;
  --text-muted: #5a6b62;
  --text-faded: #96a29a;
  --border: #e8e4d8;
  --border-light: #f0ece0;

  --danger: #b5352e;
  --danger-bg: #fbe9e7;
  --success: #0d6a48;
  --success-bg: #e0efe6;

  --shadow-sm: 0 1px 2px rgba(13, 79, 60, 0.04);
  --shadow-md: 0 4px 12px rgba(13, 79, 60, 0.08);
  --shadow-lg: 0 10px 30px rgba(13, 79, 60, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --sidebar-width: 240px;

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--cream);
}

#root {
  min-height: 100vh;
}

/* ============================================================
   LOGIN
   ============================================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 140%;
  background: radial-gradient(circle, rgba(201, 163, 78, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 50%;
  height: 100%;
  background: radial-gradient(circle, rgba(201, 163, 78, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.login-card {
  background: var(--white);
  width: 100%;
  max-width: 420px;
  padding: 48px 44px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  border: 1px solid rgba(201, 163, 78, 0.15);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

.login-logo img {
  width: 140px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.login-logo-name {
  font-family: var(--font-serif);
  font-size: 26px;
  letter-spacing: 6px;
  color: var(--green-800);
  font-weight: 500;
  margin-bottom: 4px;
}

.login-logo-sub {
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold-600);
  font-weight: 500;
}

.login-title-label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-600);
  font-weight: 500;
  margin-bottom: 6px;
}

.login-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 36px;
  font-weight: 500;
  color: var(--green-800);
  margin-bottom: 8px;
  line-height: 1;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 6px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-sans);
  background: var(--white);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px var(--gold-100);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: var(--font-sans);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold-500);
  color: var(--green-900);
  width: 100%;
  padding: 13px;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--gold-400);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201, 163, 78, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-dark {
  background: var(--green-800);
  color: var(--white);
}

.btn-dark:hover {
  background: var(--green-700);
}

.btn-outline {
  background: transparent;
  color: var(--green-800);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--gold-500);
  background: var(--gold-050);
}

.btn-gold-outline {
  background: transparent;
  color: var(--gold-600);
  border: 1px solid var(--gold-500);
}

.btn-gold-outline:hover {
  background: var(--gold-500);
  color: var(--green-900);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid transparent;
}

.btn-danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 12px;
}

.error-box {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid rgba(181, 53, 46, 0.2);
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-faded);
}

/* ============================================================
   LAYOUT APP
   ============================================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* === SIDEBAR === */

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--green-900) 0%, var(--green-800) 100%);
  color: var(--white);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  overflow-y: auto;
}

.sidebar-logo {
  text-align: center;
  padding: 4px 0 24px;
  border-bottom: 1px solid rgba(201, 163, 78, 0.18);
  margin-bottom: 24px;
}

.sidebar-logo img {
  width: 140px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.sidebar-logo-name {
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: 4px;
  color: var(--gold-500);
  font-weight: 500;
  line-height: 1;
}

.sidebar-logo-sub {
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(201, 163, 78, 0.7);
  margin-top: 4px;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.78);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
}

.nav-item:hover {
  background: rgba(201, 163, 78, 0.08);
  color: var(--gold-400);
}

.nav-item.active {
  background: var(--gold-500);
  color: var(--green-900);
  font-weight: 600;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.sidebar-user {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(201, 163, 78, 0.18);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(201, 163, 78, 0.08);
  margin-bottom: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold-500);
  color: var(--green-900);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  line-height: 1.2;
}

.user-role {
  font-size: 10px;
  color: var(--gold-400);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  width: 100%;
  font-family: var(--font-sans);
  transition: all 0.15s;
}

.sidebar-logout:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-logout svg {
  width: 15px;
  height: 15px;
}

/* === CONTEÚDO PRINCIPAL === */

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 40px 48px;
  min-height: 100vh;
  background: var(--cream);
}

.page-header {
  margin-bottom: 32px;
}

.page-label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-600);
  font-weight: 500;
  margin-bottom: 8px;
}

.page-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 44px;
  font-weight: 500;
  color: var(--green-800);
  margin-bottom: 10px;
  line-height: 1;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 600px;
}

.page-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.page-search {
  flex: 1;
  min-width: 240px;
}

/* === CARDS === */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 18px;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--green-800);
  margin-bottom: 3px;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.card-link {
  font-size: 12px;
  color: var(--gold-600);
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
}

.card-link:hover {
  color: var(--gold-500);
}

/* === STATS GRID (Dashboard) === */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  border-color: var(--gold-500);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-400));
  opacity: 0;
  transition: opacity 0.2s;
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  width: 40px;
  height: 40px;
  background: var(--green-800);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-500);
  margin-bottom: 14px;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 500;
  color: var(--green-800);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.stat-sublabel {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

/* === DASHBOARD GRID === */

.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-faded);
  font-size: 13px;
}

.empty-state-icon {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--gold-500);
}

/* === LISTAS === */

.item-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}

.list-item:hover {
  border-color: var(--gold-500);
  box-shadow: var(--shadow-md);
}

.list-item-main {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--green-800);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.list-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.icon-btn:hover {
  color: var(--green-800);
  background: var(--gold-050);
  border-color: var(--border);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn.danger:hover {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: var(--danger);
}

/* === BADGES === */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.badge-green {
  background: var(--green-100);
  color: var(--green-800);
}

.badge-gold {
  background: var(--gold-100);
  color: var(--gold-600);
}

.badge-neutral {
  background: var(--border-light);
  color: var(--text-muted);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

/* === KANBAN (Tarefas) === */

.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.kanban-column {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  min-height: 400px;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.kanban-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.kanban-dot.todo { background: var(--text-faded); }
.kanban-dot.doing { background: var(--gold-500); }
.kanban-dot.done { background: var(--success); }

.kanban-column-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--green-800);
  text-transform: uppercase;
  letter-spacing: 1px;
  flex: 1;
}

.kanban-count {
  background: var(--border-light);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kanban-card {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s;
  border-left: 3px solid var(--border);
}

.kanban-card.priority-high { border-left-color: var(--danger); }
.kanban-card.priority-medium { border-left-color: var(--gold-500); }
.kanban-card.priority-low { border-left-color: var(--text-faded); }

.kanban-card:hover {
  border-color: var(--gold-500);
  background: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.kanban-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--green-800);
  margin-bottom: 6px;
  line-height: 1.3;
}

.kanban-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.kanban-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  gap: 6px;
}

/* === CALENDÁRIO === */

.calendar-wrapper {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.calendar-month {
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--green-800);
  font-weight: 500;
  font-style: italic;
  text-transform: capitalize;
}

.calendar-nav {
  display: flex;
  gap: 6px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-daylabel {
  text-align: center;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px 0;
}

.calendar-day {
  aspect-ratio: 1;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--white);
  min-height: 80px;
}

.calendar-day:hover {
  border-color: var(--gold-500);
}

.calendar-day.empty {
  background: var(--off-white);
  cursor: default;
  border-color: transparent;
}

.calendar-day.today {
  background: var(--gold-050);
  border-color: var(--gold-500);
}

.calendar-day.today .calendar-daynum {
  color: var(--gold-600);
  font-weight: 700;
}

.calendar-daynum {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.calendar-event {
  background: var(--green-800);
  color: var(--white);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-event.type-financial { background: var(--gold-600); }
.calendar-event.type-deadline { background: var(--danger); }
.calendar-event.type-other { background: var(--text-muted); }

/* === CONTATOS (CRM) === */

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.contact-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}

.contact-card:hover {
  border-color: var(--gold-500);
  box-shadow: var(--shadow-md);
}

.contact-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.contact-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green-800);
  color: var(--gold-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.contact-info {
  flex: 1;
  min-width: 0;
}

.contact-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--green-800);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-company {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-details {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.contact-detail-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.contact-detail-row svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--gold-600);
}

.contact-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

/* === MODAL === */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 58, 45, 0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid rgba(201, 163, 78, 0.2);
}

.modal-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 26px;
  font-weight: 500;
  color: var(--green-800);
  line-height: 1.1;
}

.modal-body {
  padding: 24px 28px;
}

.modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border-light);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* === UTILITÁRIOS === */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }
.text-muted { color: var(--text-muted); }
.text-small { font-size: 12px; }

/* === LOADING === */

.loading-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  flex-direction: column;
  gap: 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--gold-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.fade-in {
  animation: fadeIn 0.3s ease;
}

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

/* === PWA BANNER === */

.pwa-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 440px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--gold-500);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 90;
  animation: slideUpBanner 0.4s ease;
}

@keyframes slideUpBanner {
  from { transform: translateY(120%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pwa-banner-icon img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: block;
}

.pwa-banner-text {
  flex: 1;
  min-width: 0;
}

.pwa-banner-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--green-800);
  margin-bottom: 2px;
}

.pwa-banner-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pwa-banner-actions .btn {
  padding: 8px 14px;
  width: auto;
  white-space: nowrap;
}

/* === RESPONSIVO === */

@media (max-width: 900px) {
  :root { --sidebar-width: 0px; }

  /* Sidebar vira bottom nav no mobile */
  .sidebar {
    width: 100%;
    height: auto;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    flex-direction: row;
    padding: 0;
    border-top: 1px solid rgba(201, 163, 78, 0.2);
    z-index: 50;
    overflow: visible;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .sidebar-logo { display: none; }

  .sidebar-nav {
    flex-direction: row;
    flex: 1;
    gap: 0;
    padding: 0;
    justify-content: space-around;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-nav::-webkit-scrollbar { display: none; }

  .nav-item {
    flex-direction: column;
    gap: 3px;
    padding: 8px 6px 6px;
    min-width: 56px;
    border-radius: 0;
    font-size: 10px;
    flex: 1;
    max-width: 90px;
  }

  .nav-item:hover { background: transparent; }

  .nav-item.active {
    background: transparent;
    color: var(--gold-500);
    position: relative;
  }

  .nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--gold-500);
  }

  .nav-item svg { width: 20px; height: 20px; }

  .nav-item span.nav-label {
    font-size: 9.5px;
    letter-spacing: 0.2px;
    font-weight: 500;
  }

  /* Esconde user card no bottom nav */
  .sidebar-user { display: none; }

  /* Header do app (substitui o card do usuário) */
  .main-content {
    margin-left: 0;
    margin-bottom: 72px;
    padding: 20px 18px 24px;
    padding-top: calc(env(safe-area-inset-top, 0) + 20px);
  }

  .page-title { font-size: 32px; }
  .page-header { margin-bottom: 22px; }
  .page-actions { gap: 8px; }
  .page-search { min-width: 140px; }
  .dashboard-row { grid-template-columns: 1fr; gap: 14px; }
  .kanban-board { grid-template-columns: 1fr; gap: 14px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-number { font-size: 32px; }

  .login-card {
    padding: 32px 24px;
    border-radius: var(--radius-md);
  }

  .login-title { font-size: 30px; }

  .modal-backdrop { padding: 12px; align-items: flex-end; }
  .modal {
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .pwa-banner {
    bottom: 88px;
    border-radius: var(--radius-md);
  }

  /* Mobile header opcional — mostra nome do usuário no topo */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    margin: -20px -18px 18px;
    padding-top: calc(env(safe-area-inset-top, 0) + 12px);
  }

  .mobile-topbar-logo img { height: 28px; width: auto; }

  .mobile-topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-topbar-user .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .mobile-topbar-logout {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
  }

  .mobile-topbar-logout:active { color: var(--danger); }
}

@media (min-width: 901px) {
  .mobile-topbar { display: none; }
}

@media (max-width: 500px) {
  .main-content { padding: 16px 14px 24px; }
  .page-title { font-size: 26px; }
  .page-subtitle { font-size: 13px; }
  .contacts-grid { grid-template-columns: 1fr; }
  .calendar-day { min-height: 52px; padding: 4px 5px; font-size: 11px; }
  .calendar-daynum { font-size: 11px; }
  .calendar-event { font-size: 8.5px; padding: 1px 4px; }
  .calendar-month { font-size: 20px; }
  .calendar-daylabel { font-size: 9px; padding: 6px 0; }
  .list-item { padding: 12px 14px; flex-wrap: wrap; gap: 10px; }
  .list-item-actions { width: 100%; justify-content: flex-end; }
}

/* Ajustes quando instalado como PWA */
@media (display-mode: standalone) {
  body {
    /* Respeita safe areas do iOS (notch) */
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: var(--green-900);
  }

  .login-page {
    padding-top: calc(env(safe-area-inset-top, 0) + 24px);
  }
}

