:root {
  --yellow: #FFD23F;
  --yellow-soft: #FFF3D2;
  --blue: #5EC8E8;
  --coral: #F26B6B;
  --green: #8DC63F;
  --pink: #F49AC2;
  --ink: #3A2E1F;
  --ink-soft: #6b5d47;
  --bg: #FFFDF7;
  --card-bg: #ffffff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(58, 46, 31, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', 'Trebuchet MS', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

a { color: inherit; }

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Login/registro centralizado */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--yellow-soft) 0%, var(--bg) 100%);
  padding: 24px;
}

.auth-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.auth-card .logo {
  height: 48px;
  margin-bottom: 20px;
}

.auth-card h1 {
  font-size: 1.3rem;
  margin: 0 0 24px;
}

.field {
  text-align: left;
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input, .field select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #e0d8c3;
  font-size: 1rem;
  background: #fff;
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 12px;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-secondary {
  background: var(--yellow-soft);
  color: var(--ink);
}

/* Alertas / flash messages */
.alert {
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  text-align: left;
}

.alert-error { background: #FCE4E4; color: #A02525; }
.alert-success { background: #E6F4D7; color: #3B6B10; }
.alert-info { background: #E2F3FA; color: #1B5E76; }

/* Layout interno (admin/portal) */
.topbar {
  background: #fff;
  border-bottom: 1px solid rgba(58,46,31,0.08);
  padding: 14px 0;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar .logo { height: 36px; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
}

.topbar-user a {
  color: var(--ink-soft);
  text-decoration: underline;
}

.page {
  padding: 40px 0;
}

.page h1 {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.page .subtitle {
  color: var(--ink-soft);
  margin-bottom: 28px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 22px;
}

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

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
}

.stat-card .stat-label {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #f0e9d8;
  font-size: 0.92rem;
}

th {
  background: var(--yellow-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-admin { background: var(--coral); color: #fff; }
.badge-terapeuta { background: var(--blue); color: #fff; }
.badge-secretaria { background: var(--green); color: #fff; }
.badge-responsavel { background: var(--pink); color: #fff; }

.actions-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.btn-inline {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--ink-soft);
}
