/* Journal Club DMV — visual limpo e funcional */
:root {
  --primary: #2c5282;
  --primary-light: #4299e1;
  --success: #38a169;
  --warning: #d69e2e;
  --danger: #e53e3e;
  --grand: #805ad5;
  --bg: #f7fafc;
  --border: #e2e8f0;
  --text: #2d3748;
  --text-light: #718096;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 2rem 1rem;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 2rem;
}

header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

h1 {
  color: var(--primary);
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--text-light);
  font-size: 0.9rem;
}

.actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.2s;
}

.btn:hover { opacity: 0.85; }

.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: white; color: var(--text); border: 1px solid var(--border); }

.status {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-left: auto;
}
.status.success { color: var(--success); }
.status.error { color: var(--danger); }

.legend {
  background: #edf2f7;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  color: var(--text-light);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}
.badge-grand { background: var(--grand); }
.badge-pdf { background: var(--success); }
.badge-pending { background: var(--warning); }
.badge-empty { background: var(--text-light); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: #edf2f7;
}

th {
  text-align: left;
  padding: 0.75rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  font-size: 0.85rem;
}

td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:hover {
  background: #f7fafc;
}

td[contenteditable="true"] {
  background: white;
  cursor: text;
  min-width: 80px;
  border-radius: 3px;
  padding: 0.5rem;
  transition: background 0.2s;
}

td[contenteditable="true"]:focus {
  outline: 2px solid var(--primary-light);
  background: #f0f9ff;
}

td[contenteditable="true"]:hover {
  background: #f0f9ff;
}

.col-data { width: 110px; }
.col-apresentador, .col-orientador { width: 160px; }
.col-tema { min-width: 250px; }
.col-pdf { width: 110px; text-align: center; }
.col-status { width: 140px; text-align: center; }
.col-actions { width: 130px; text-align: center; }

.pdf-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
}
.pdf-link:hover { text-decoration: underline; }

.row-grand td {
  background: #faf5ff;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
}

.modal h3 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.modal input[type="file"] {
  display: block;
  margin: 1rem 0;
  padding: 0.5rem;
  width: 100%;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-light);
}

@media (max-width: 768px) {
  .container { padding: 1rem; }
  table { font-size: 0.8rem; }
  th, td { padding: 0.4rem; }
}