/* main.css — clic.IA
   Estilos do app (painel, consulta, pacientes).
   Tokens e botões vêm do design-system.css. */

@import './design-system.css';

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.patient-tag code {
  background: var(--primary-dim);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 13px;
}

.badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text-muted);
}

.badge-new {
  background: rgba(34,197,94,0.15);
  color: var(--success);
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.notas {
  margin: 8px 0 0 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.proxima {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

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

/* Records list */
.records-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.record-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.record-item:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

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

.record-template {
  font-size: 11px;
  background: var(--primary-dim);
  color: var(--primary);
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 6px;
}

.record-resumo {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Main panel */
.main-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

/* Record section */
.record-section { padding: 20px; }

.record-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

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

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

/* Recorder controls */
.recorder-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.timer {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-weight: 500;
}

.file-input {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
}

/* Buttons — definidos em design-system.css */

/* Processing bar */
.processing-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--primary-dim);
  border: 1px solid rgba(46,197,255,0.25);
  border-radius: var(--radius);
  color: var(--primary);
  font-size: 14px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(46,197,255,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* Prontuário */
.prontuario-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.prontuario-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  text-transform: capitalize;
  color: var(--text-muted);
  margin-bottom: 4px;
}

textarea, input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  resize: vertical;
  transition: border-color 0.15s;
}

textarea:focus, input[type="date"]:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.resumo-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.resumo-section label { font-size: 13px; }

/* Actions */
.actions {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: flex-end;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

/* Alert */
.alert-success {
  padding: 12px 18px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  color: var(--success);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
}
.table th {
  text-align: left;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface-2); }

/* Responsive */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .prontuario-grid { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .main-panel { order: 1; }
}
