/* ============================================================
   CICATRIZA+ · Perfil do Paciente
   style.css
   ============================================================ */

/* ── Variáveis ───────────────────────────────────────────── */
:root {
  --teal:        #1a9e8f;
  --teal-light:  #e6f7f5;
  --teal-hover:  #15887b;
  --dark:        #1a2332;
  --text:        #2d3748;
  --text-muted:  #718096;
  --border:      #e2e8f0;
  --bg:          #f7f9fc;
  --white:       #ffffff;
  --sidebar-w:   200px;

  --red:         #e53e3e;
  --red-light:   #fff5f5;
  --yellow:      #d69e2e;
  --yellow-light:#fffff0;
  --green:       #38a169;
  --green-light: #f0fff4;
  --blue:        #3182ce;
  --blue-light:  #ebf8ff;
}

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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 10;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--teal);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
}

.logo-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-nav,
.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: var(--teal-light);
  color: var(--teal);
}

.nav-item.active {
  background: var(--teal-light);
  color: var(--teal);
  font-weight: 600;
}

.nav-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
}

/* ── Main Content ────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px 40px;
  max-width: 1100px;
}

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  color: var(--border);
  font-size: 16px;
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 600;
}

/* ── Patient Header ──────────────────────────────────────── */
.patient-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}

.patient-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

.patient-meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Status Badges ───────────────────────────────────────── */
.status-badge {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-critica {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid #feb2b2;
}

.status-cicatrizando {
  background: var(--yellow-light);
  color: var(--yellow);
  border: 1px solid #fefcbf;
}

.status-ativa {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid #c6f6d5;
}

/* ── Tabs ────────────────────────────────────────────────── */
.tabs-wrapper {
  border-bottom: 2px solid var(--border);
  margin-bottom: 28px;
}

.tabs {
  display: flex;
  gap: 0;
}

.tab {
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
  color: var(--teal);
}

.tab.active {
  color: var(--teal);
  font-weight: 600;
  border-bottom-color: var(--teal);
}

/* ── Tab Content ─────────────────────────────────────────── */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ── Form Cards ──────────────────────────────────────────── */
.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 18px;
}

/* ── Form Fields ─────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.field input,
.field select,
.field textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  outline: none;
  width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(26, 158, 143, 0.12);
}

.field textarea {
  resize: vertical;
  min-height: 90px;
}

/* ── Form Grids ──────────────────────────────────────────── */
.form-grid {
  display: grid;
  gap: 16px;
}

.two-col   { grid-template-columns: 1fr 1fr; }
.three-col { grid-template-columns: 1fr 1fr 1fr; }

/* ── Radio Grid ──────────────────────────────────────────── */
.radio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: background 0.15s, border-color 0.15s;
}

.radio-item:hover {
  background: var(--teal-light);
  border-color: var(--teal);
}

.radio-item input[type="radio"] {
  accent-color: var(--teal);
  width: 16px;
  height: 16px;
}

/* ── Form Actions ────────────────────────────────────────── */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.btn-primary {
  background: var(--teal);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover {
  background: var(--teal-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: var(--bg);
}

.btn-full  { width: 100%; }

/* ── Upload Zone ─────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--teal);
  border-radius: 12px;
  background: var(--teal-light);
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.upload-zone:hover {
  background: #d0f0ec;
}

.upload-icon { font-size: 32px; }

.upload-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--teal);
}

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

/* ── Photos Section ──────────────────────────────────────── */
.photos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.photos-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

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

.photo-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.photo-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.photo-date {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Relatório Layout ────────────────────────────────────── */
.relatorio-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}

.historico-card {
  position: sticky;
  top: 24px;
}

/* ── Timeline ────────────────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  gap: 14px;
  padding-bottom: 20px;
  position: relative;
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  border: 2px solid white;
  box-shadow: 0 0 0 2px currentColor;
}

.dot-critica  { background: var(--red);    color: var(--red); }
.dot-estavel  { background: var(--yellow); color: var(--yellow); }
.dot-melhora  { background: var(--green);  color: var(--green); }
.dot-inicial  { background: var(--blue);   color: var(--blue); }

.timeline-body { flex: 1; }

.timeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.timeline-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.status-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.tag-critica { background: var(--red-light);    color: var(--red); }
.tag-estavel { background: var(--yellow-light); color: var(--yellow); }
.tag-melhora { background: var(--green-light);  color: var(--green); }
.tag-inicial { background: var(--blue-light);   color: var(--blue); }

.timeline-body p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Utilidades ──────────────────────────────────────────── */
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
