/* GeoAgenda - Estilos Refinados do Workspace Acadêmico */
:root {
  --bg-page: #edf2ee;
  --bg-surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #1e293b;
  --text-subtle: #334155;
  --color-petrol-700: #125443;
  --color-petrol-800: #0d4033;
  --color-petrol-900: #082921;
  --border-subtle: #cbd5e1;
  --border-strong: #94a3b8;
}

body {
  font-size: 15px;
  background-color: var(--bg-page);
  color: var(--text-main);
}

/* Sidebar Desktop */
.sidebar {
  width: 250px;
  background: #0e3128;
  color: #e0eee7;
  padding: 28px 20px;
  border: 0;
}

.brand-logo-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  filter: drop-shadow(0 2px 10px rgba(16, 185, 129, 0.4));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-logo-wrapper:hover .brand-logo-img {
  transform: rotate(12deg) scale(1.08);
}

.brand-title {
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.15;
}

.brand-subtitle {
  color: #a7f3d0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.sidebar-brand {
  padding-bottom: 20px;
  border-bottom: 1px solid #234c40;
  margin-bottom: 22px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.nav-tab-btn {
  color: #d1e6dc;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease-in-out;
}

.nav-tab-btn:hover {
  background: #194337;
  color: #ffffff;
}

.nav-tab-btn.active {
  background: #1f5041;
  border-color: #457a67;
  color: #ffffff;
}

.sidebar-heading {
  color: #b5d8c8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.stat-card {
  background: #163b31;
  border: 1px solid #2a5749;
  padding: 12px 10px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  color: #d1e6dc;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.stat-value {
  color: #ffffff;
  font-size: 26px;
  font-weight: 800;
  margin-top: 4px;
}

.stat-value.stat-success {
  color: #4ade80;
}

.stat-value.stat-info {
  color: #7dd3fc;
}

.stat-value.stat-fav {
  color: #fde047;
}

.stat-value.stat-muted {
  color: #cbd5e1;
}

.sidebar-curator {
  margin-top: 10px;
}

.curator-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.curator-name {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.curator-inst {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  background: #059669;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

.curator-mission {
  color: #cbd5e1;
  font-size: 11px;
  line-height: 1.45;
  margin: 0;
}

.curator-lattes-link {
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  margin-top: 4px;
}

.curator-lattes-link:hover {
  text-decoration: underline;
  color: #bae6fd;
}

.dialog-curator-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px 16px;
  margin-top: 14px;
}

.dialog-curator-desc {
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
  margin-bottom: 6px;
}

.sidebar-footer {
  border-top: 1px solid #234c40;
  padding-top: 18px;
  margin-top: auto;
}

.sync-status,
.updated-timestamp {
  color: #b8dcce;
  font-size: 12px;
  font-weight: 500;
}

.sidebar .btn-export {
  background: #163f33;
  color: #ffffff;
  border: 1px solid #326b5a;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
  width: 100%;
  text-align: center;
  border-radius: 6px;
  display: inline-block;
  text-decoration: none;
  transition: background 0.15s;
}

.sidebar .btn-export:hover {
  background: #215647;
  border-color: #458772;
}

/* Main Content */
.main-content {
  width: calc(100% - 250px);
  max-width: 1600px;
  min-width: 0;
  padding: 34px 38px;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: #1a4d3f;
  font-weight: 800;
}

.workspace-header h1 {
  font-size: 30px;
  letter-spacing: -0.8px;
  line-height: 1.25;
  font-weight: 800;
  color: #082921;
  margin: 6px 0;
}

.workspace-header p:not(.eyebrow) {
  font-size: 15px;
  color: #1e293b;
  font-weight: 500;
}

.btn {
  border-radius: 6px;
  min-height: 38px;
  font-weight: 600;
  font-size: 14px;
}

.btn-primary {
  background: #125443;
  border-color: #0d4033;
  color: #ffffff;
}

.btn-primary:hover {
  background: #0d4033;
}

/* Coleções Rápidas (Pills/Tabs) */
.collection-nav {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.collection {
  font: inherit;
  text-align: left;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #ffffff;
  padding: 14px 12px;
  cursor: pointer;
  color: #0f172a;
  min-width: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.collection strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.collection span {
  font-size: 12px;
  font-weight: 500;
  color: #1e293b;
  display: block;
  line-height: 1.35;
}

.collection:hover {
  border-color: #125443;
  background: #f4faf6;
  box-shadow: 0 2px 6px rgba(18, 84, 67, 0.1);
}

.collection.active {
  background: #e2f1e8;
  border-color: #125443;
  box-shadow: inset 0 3px 0 #125443;
}

.collection.active strong {
  color: #062b21;
}

.collection.active span {
  color: #125443;
  font-weight: 600;
}

/* Toolbar da Visualização */
.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 14px;
}

.view-toolbar h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #0f172a;
  margin-top: 4px;
}

.view-switch {
  display: flex;
  border: 1px solid var(--border-subtle);
  background: #e2e8f0;
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.view-switch button {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  border: 0;
  background: transparent;
  color: #1e293b;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-switch button.active {
  background: #ffffff;
  color: #0a2923;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Estrutura das Abas */
#pane-agenda {
  display: flex;
  flex-direction: column;
}

.calendar-card {
  display: none;
  order: 2;
}

.filters-card {
  order: 1;
}

.cards-section {
  order: 3;
  padding-bottom: 60px;
}

body.calendar-view .calendar-card {
  display: block;
}

body.calendar-view .cards-section {
  display: none;
}

.card {
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

/* Painel de Filtros */
.filters-card {
  padding: 18px 20px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
}

.filters-header {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.filters-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.items-counter {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.filter-label {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}

/* Grid de filtros: Busca na linha 1, e 4 selects na linha 2 */
.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.filter-group-search {
  grid-column: 1 / -1;
}

.form-input,
.form-select {
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  min-height: 40px;
  padding: 8px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.form-input::placeholder {
  color: #64748b;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: #125443;
  box-shadow: 0 0 0 2px rgba(18, 84, 67, 0.2);
}

.filters-footer {
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid #e2e8f0;
}

.filter-checkbox-wrap {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

/* Grid de Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.item-card {
  position: relative;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.07);
  min-width: 0;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  transition: border-color 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.item-card:hover {
  border-color: #059669;
  box-shadow: 0 14px 28px rgba(5, 150, 105, 0.12), 0 3px 8px rgba(15, 23, 42, 0.06);
  transform: translateY(-3px);
}

.item-card:hover .thumb-pattern {
  opacity: 0.85;
  transform: scale(1.05);
}

/* Miniatura gráfica temática no topo do card */
.card-thumb {
  height: 76px;
  position: relative;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.card-thumb-urban {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 45%, #0284c7 100%);
}

.card-thumb-geomorph {
  background: linear-gradient(135deg, #2e1002 0%, #78350f 50%, #b45309 100%);
}

.card-thumb-bio {
  background: linear-gradient(135deg, #022c22 0%, #064e3b 45%, #059669 100%);
}

.card-thumb-journal {
  background: linear-gradient(135deg, #17153a 0%, #312e81 50%, #4f46e5 100%);
}

.card-thumb-intl {
  background: linear-gradient(135deg, #082f49 0%, #0369a1 50%, #0284c7 100%);
}

.card-thumb .thumb-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}

.thumb-seal {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.thumb-badge {
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(4px);
  padding: 2px 8px;
  border-radius: 12px;
  color: #ffffff;
}

.thumb-center {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.thumb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  flex-shrink: 0;
  color: #ffffff;
}

.thumb-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.55;
}

.thumb-discipline {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-card.card-closed .card-thumb {
  filter: grayscale(0.35) opacity(0.85);
}

.card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

/* Botão Google Agenda */
.btn-gcal {
  background: #ffffff;
  color: #1a73e8;
  border: 1px solid #c7d2fe;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-gcal:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.18);
}

/* Micro-interações de clique */
.btn:active,
.btn-card-fav:active,
.collection:active,
.nav-tab-btn:active {
  transform: scale(0.96) !important;
}

.source-caption {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #125443;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
  height: 32px;
  line-height: 1.35;
  display: flex;
  align-items: center;
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-badges-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  flex: 1;
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1.3;
  border: 1px solid transparent;
}

.badge-status-open {
  background: #dcfce7;
  color: #0f4223;
  border-color: #86efac;
}

.badge-status-upcoming {
  background: #e0f2fe;
  color: #034b75;
  border-color: #7dd3fc;
}

.badge-status-verify {
  background: #fef3c7;
  color: #78350f;
  border-color: #fcd34d;
}

.badge-status-closed {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

.badge-type,
.badge-scope {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

/* Botão Salvar posicionado no topo do corpo do card */
@keyframes favPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.3) rotate(-8deg); }
  70% { transform: scale(0.9) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

.btn-card-fav {
  position: static;
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: #1e293b;
  border-radius: 6px;
  padding: 4px 10px;
  min-height: 28px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-card-fav:hover {
  border-color: #10b981;
  color: #047857;
  background: #f0fdf4;
  transform: translateY(-1px);
}

.btn-card-fav.is-fav {
  background: #dcfce7;
  color: #0f4223;
  border-color: #86efac;
  font-weight: 700;
  animation: favPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-title {
  font-size: 14.5px;
  letter-spacing: -0.3px;
  line-height: 1.35;
  font-weight: 700;
  color: #0f172a;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 60px;
  margin: 0;
}

/* Destaque de Prazo / Data */
.date-highlight {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #16a34a;
  padding: 8px 12px;
  border-radius: 6px;
}

.date-highlight strong {
  font-size: 16px;
  font-weight: 800;
  color: #14532d;
  letter-spacing: -0.3px;
}

.date-highlight span {
  font-size: 11.5px;
  font-weight: 700;
  color: #166534;
}

/* Destaque para Eventos Realizados / Prazos Encerrados */
.date-highlight.date-highlight-closed {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #475569;
}

.date-highlight.date-highlight-closed strong {
  color: #0f172a;
}

.date-highlight.date-highlight-closed span {
  color: #334155;
  font-weight: 800;
}

.item-card.card-closed {
  opacity: 0.88;
  border-color: #cbd5e1;
}

.item-card.card-closed:hover {
  opacity: 1;
}

.badge-cal-past {
  opacity: 0.65;
  filter: grayscale(0.5);
  border-style: dashed !important;
}

.stat-value.stat-muted {
  color: #cbd5e1 !important;
}

/* Lista de Metadados Desktop */
.card-meta-list {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  gap: 6px;
  min-height: 115px;
}

.card-meta-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.meta-label {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  min-width: 0;
}

.meta-value {
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  word-break: break-word;
}

.card-review-alert {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #d97706;
  border-radius: 6px;
  color: #92400e;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 12px;
  line-height: 1.5;
}

/* Rodapé do Card */
.card-bottom-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.card-bottom-actions.has-gcal .btn-primary {
  grid-column: 1 / -1;
}

.card-bottom-actions .btn {
  font-size: 12.5px;
  font-weight: 700;
  min-height: 38px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 6px 10px;
  white-space: nowrap;
}

.card-bottom-actions .btn-primary {
  background: #125443;
  color: #ffffff;
  border: 1px solid #0d4033;
}

.card-bottom-actions .btn-primary:hover {
  background: #0d4033;
}

.card-bottom-actions .btn-secondary {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid var(--border-subtle);
}

.card-bottom-actions .btn-secondary:hover {
  background: #f8fafc;
  border-color: var(--border-strong);
}

/* Calendário */
.cal-day-cell {
  min-width: 0;
  min-height: 96px;
  border-radius: 6px;
  padding: 6px 8px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
}

.cal-day-cell.is-today {
  border: 2px solid #125443;
  background: #f0fdf4;
}

.cal-badge {
  min-width: 0;
  text-align: left;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
}

.calendar-month-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

.calendar-legend {
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
}

/* Janela Modal Dialog */
.item-dialog {
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
}

.item-dialog[open] {
  animation: dialogZoomIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.item-dialog::backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
  animation: dialogBackdrop 0.2s ease-out;
}

@keyframes dialogZoomIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(14px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes dialogBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dialog-header {
  padding: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.dialog-heading {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #0f172a;
}

.dialog-body {
  padding: 24px;
  font-size: 14px;
  line-height: 1.6;
}

.dialog-meta-item strong {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.dialog-meta-item span {
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
}

.dialog-dates-box {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
}

.dialog-evidence-quote {
  font-size: 13px;
  color: #1e293b;
  background: #f8fafc;
  border-left: 4px solid #125443;
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
}

/* Tabela de Fontes */
.data-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #334155;
  background: #f8fafc;
  padding: 12px 14px;
}

.data-table td {
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  padding: 14px;
}

.sources-info-card h2 {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

/* Foco Acessível */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #125443;
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

/* Breakpoint: Desktop Ultrawide */
@media (min-width: 1700px) {
  .cards-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Breakpoint: Notebooks / Telas Médias */
@media (max-width: 1250px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .main-content {
    padding: 28px;
  }
  .collection-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Breakpoint: Tablet e Telas Verticais */
@media (max-width: 1024px) {
  .app-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    padding: 14px 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    border-bottom: 1px solid #234c40;
  }
  .sidebar-brand {
    margin: 0;
    padding: 0;
    border: 0;
  }
  .brand-title {
    font-size: 24px;
  }
  .brand-subtitle {
    font-size: 10px;
  }
  .sidebar-nav {
    flex-direction: row;
    margin: 0;
    align-items: center;
  }
  .sidebar-section {
    display: none;
  }
  .sidebar-footer {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    border: 0;
    padding: 0;
    gap: 10px;
  }
  .main-content {
    width: 100%;
    padding: 24px;
  }
  .workspace-header h1 {
    font-size: 28px;
  }
}

/* Breakpoint: Mobile (375px até 640px) */
@media (max-width: 640px) {
  .sidebar {
    padding: 10px 14px;
    gap: 8px;
    grid-template-columns: 1fr;
  }
  .sidebar-brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }
  .brand-title {
    font-size: 20px;
  }
  .brand-subtitle {
    font-size: 9px;
  }
  .sidebar-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .nav-tab-btn {
    padding: 8px;
    font-size: 13px;
    text-align: center;
    min-height: 38px;
  }
  .nav-tab-btn.active {
    background: #1f5746;
    border: 1px solid #488b75;
    color: #ffffff;
  }
  .sidebar-footer {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    font-size: 10px;
    padding-top: 4px;
  }
  .updated-timestamp,
  .sync-status {
    font-size: 10px;
  }
  .main-content {
    padding: 14px 12px;
  }
  .workspace-header {
    margin-bottom: 16px;
    align-items: flex-start;
  }
  .workspace-header h1 {
    font-size: 22px;
    max-width: 290px;
  }
  .workspace-header > .btn {
    display: none;
  }
  .workspace-header p:not(.eyebrow) {
    font-size: 13px;
    line-height: 1.4;
  }
  /* Carrossel de Coleções no Mobile com affordance e snap */
  .collection-nav {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 6px;
    padding-right: 14px;
  }
  .collection {
    flex: 0 0 160px;
    padding: 12px 10px;
    scroll-snap-align: start;
    min-height: 80px;
    border: 1px solid #cbd5e1;
  }
  .collection strong {
    font-size: 13px;
  }
  .collection span {
    font-size: 11px;
    line-height: 1.3;
  }
  .view-toolbar {
    margin-bottom: 12px;
  }
  .view-toolbar h2 {
    font-size: 19px;
  }
  .view-switch {
    min-height: 40px;
  }
  .view-switch button {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 34px;
    color: #1e293b;
  }
  .view-switch button.active {
    color: #0a2923;
  }
  .view-toolbar .eyebrow {
    font-size: 10px;
  }
  /* Filtros no Mobile: 1 coluna para evitar truncar textos dos selects */
  .filters-card {
    padding: 14px;
  }
  .filters-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .filter-group-search {
    grid-column: 1 / -1;
  }
  .form-select,
  .form-input {
    font-size: 15px;
    min-height: 44px;
  }
  .filter-label {
    font-size: 12px;
    font-weight: 700;
  }
  .filters-header {
    gap: 6px;
    margin-bottom: 12px;
  }
  .filters-title {
    font-size: 14px;
  }
  .items-counter {
    font-size: 12px;
  }
  .filter-checkbox-wrap {
    font-size: 13px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .filters-footer .btn {
    min-height: 44px;
  }
  /* Cards no Mobile: Metadados empilhados com espaçamento compacto */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .item-card {
    padding: 14px;
    gap: 10px;
  }
  .source-caption {
    padding-right: 70px;
  }
  .card-top-row {
    padding-right: 0;
  }
  .btn-card-fav {
    top: 12px;
    right: 12px;
    min-height: 28px;
    padding: 3px 8px;
    font-size: 11px;
  }
  .card-title {
    font-size: 16px;
    line-height: 1.35;
  }
  .card-meta-list {
    font-size: 13px;
    gap: 6px;
  }
  .card-meta-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }
  .meta-label {
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .meta-value {
    font-size: 13px;
    font-weight: 500;
    color: #0f172a;
    line-height: 1.35;
  }
  .card-review-alert {
    font-size: 12px;
  }
  .card-bottom-actions {
    display: flex;
    gap: 8px;
  }
  .card-bottom-actions .btn {
    min-height: 42px;
    font-size: 12.5px;
    padding: 8px 10px;
  }
  /* Calendário no Mobile */
  .calendar-card {
    padding: 12px;
  }
  .cal-day-cell {
    padding: 3px;
    min-height: 66px;
  }
  .cal-badge {
    font-size: 10px;
    padding: 3px 4px;
  }
  .calendar-month-title {
    font-size: 17px;
  }
  .calendar-nav-buttons button {
    min-height: 38px;
  }
  .calendar-legend {
    gap: 8px;
    font-size: 11px;
    flex-wrap: wrap;
  }
  /* Modal no Mobile */
  .dialog-header,
  .dialog-body {
    padding: 16px;
  }
  .dialog-heading {
    font-size: 19px;
  }
  .item-dialog {
    width: 95%;
    max-width: 95%;
  }
  .dialog-meta-grid {
    grid-template-columns: 1fr;
  }
  .dialog-footer {
    flex-direction: column-reverse;
  }
  .dialog-footer .btn {
    width: 100%;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
