/* =============================================================
   AGENDA DO ESCRITÓRIO — estilos compartilhados
   ============================================================= */

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: #f7f6f3;
  color: #1a1a1a;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: #185fa5; text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 0.5px solid rgba(0,0,0,0.18);
  background: #fff;
  color: #1a1a1a;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}
button:hover { background: #efeee9; }
button:active { transform: scale(0.98); }
button.primary {
  background: #1a1a1a; color: #fff; border-color: #1a1a1a;
}
button.primary:hover { background: #333; }
button.danger {
  background: #fff; color: #a32d2d; border-color: rgba(163,45,45,0.35);
}
button.danger:hover { background: #fcebeb; }

input[type="text"], input[type="password"], input[type="number"], input[type="date"], textarea, select {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 0.5px solid rgba(0,0,0,0.2);
  background: #fff;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: #1a1a1a;
  box-shadow: 0 0 0 2px rgba(26,26,26,0.08);
}
label { font-size: 13px; color: #666; display: block; margin-bottom: 4px; }

/* Layout principal */
.container { max-width: 960px; margin: 0 auto; padding: 24px; }
.header {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding-bottom: 16px; margin-bottom: 24px;
  border-bottom: 0.5px solid rgba(0,0,0,0.12);
}
.header h1 { font-size: 22px; font-weight: 500; margin: 0; }
.header .meta { font-size: 13px; color: #666; margin-bottom: 4px; }
.header .actions { display: flex; gap: 8px; align-items: center; }
.header .actions .updated { font-size: 12px; color: #888; }

/* Cards de métrica */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
@media (max-width: 720px) { .metrics { grid-template-columns: repeat(2, 1fr); } }
.metric {
  background: #efeee9;
  border-radius: 8px;
  padding: 14px 16px;
}
.metric .label { font-size: 13px; color: #666; margin-bottom: 6px; }
.metric .value { font-size: 24px; font-weight: 500; }
.metric.warning .value { color: #854f0b; }
.metric.danger .value { color: #a32d2d; }

/* Seções */
.section { margin-bottom: 28px; }
.section .title-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px;
}
.section h2 { font-size: 16px; font-weight: 500; margin: 0; }
.section .hint { font-size: 12px; color: #666; }

/* Lista de itens */
.list {
  background: #fff;
  border-radius: 12px;
  border: 0.5px solid rgba(0,0,0,0.12);
  overflow: hidden;
}
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 0.5px solid rgba(0,0,0,0.08);
}
.list-item:last-child { border-bottom: none; }
.list-item .main { flex: 1; min-width: 0; }
.list-item .title { font-size: 14px; font-weight: 500; margin: 0; }
.list-item .sub { font-size: 13px; color: #666; margin: 2px 0 0; }
.list-item .time {
  font-size: 13px; font-weight: 500; color: #666; min-width: 48px;
}
.list-item input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; flex-shrink: 0;
  background: #e6f1fb; color: #0c447c;
}
.avatar.warning { background: #faeeda; color: #854f0b; }

.badge {
  font-size: 11px; padding: 2px 8px; border-radius: 8px;
  white-space: nowrap;
}
.badge.warning { background: #faeeda; color: #854f0b; }
.badge.info    { background: #e6f1fb; color: #0c447c; }
.badge.success { background: #e1f5ee; color: #085041; }
.badge.danger  { background: #fcebeb; color: #791f1f; }
.badge.muted   { background: #efeee9; color: #555; }

/* Empty state */
.empty {
  padding: 24px; text-align: center;
  color: #888; font-size: 14px;
  background: #fff;
  border: 0.5px dashed rgba(0,0,0,0.15);
  border-radius: 12px;
}

/* Tela de login */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  background: #fff; border-radius: 12px;
  border: 0.5px solid rgba(0,0,0,0.12);
  padding: 32px; max-width: 380px; width: 100%;
}
.login-card h1 { font-size: 22px; font-weight: 500; margin: 0 0 4px; }
.login-card .lead { color: #666; font-size: 14px; margin: 0 0 24px; }
.login-card .form-group { margin-bottom: 16px; }
.login-card .footer-link { text-align: center; margin-top: 16px; font-size: 13px; }
.login-card button { width: 100%; }

.error-msg {
  background: #fcebeb; color: #791f1f;
  border-radius: 8px; padding: 10px 12px;
  font-size: 13px; margin-bottom: 16px;
}
.success-msg {
  background: #e1f5ee; color: #085041;
  border-radius: 8px; padding: 10px 12px;
  font-size: 13px; margin-bottom: 16px;
}

/* Modal admin */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 50;
}
.modal {
  background: #fff; border-radius: 12px;
  padding: 24px; max-width: 480px; width: 100%;
  max-height: 90vh; overflow-y: auto;
}
.modal h2 { margin: 0 0 16px; font-size: 18px; font-weight: 500; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* Admin tabs */
.tabs {
  display: flex; gap: 4px; border-bottom: 0.5px solid rgba(0,0,0,0.12);
  margin-bottom: 24px;
}
.tabs button {
  border: none; border-radius: 0; background: transparent;
  padding: 10px 16px; font-size: 14px; color: #666;
  border-bottom: 2px solid transparent;
}
.tabs button.active { color: #1a1a1a; border-bottom-color: #1a1a1a; font-weight: 500; }
.tabs button:hover { background: transparent; color: #1a1a1a; }

.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}

.rel-periodo {
  background: #fff;
  border: 0.5px solid rgba(0,0,0,0.18);
  font-size: 13px;
}
.rel-periodo.active {
  background: #1a1a1a; color: #fff; border-color: #1a1a1a;
}

/* Linha admin com ações */
.admin-row .actions {
  display: flex; gap: 6px;
}
.admin-row button { padding: 4px 10px; font-size: 13px; }
