@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Source+Serif+4:wght@400;500;600;700&display=swap");

:root {
  --bg: #f8f4ee;
  --bg-strong: #f0e7da;
  --panel: rgba(254, 250, 244, 0.94);
  --panel-solid: #fffbf6;
  --panel-muted: #f5eee4;
  --line: #e7ddd0;
  --line-strong: #d9ccb7;
  --text: #26231f;
  --muted: #6f6a64;
  --muted-soft: #a09a91;
  --primary: #4f8380;
  --primary-strong: #396766;
  --secondary: #6b8c7a;
  --accent: #7a9bb2;
  --danger: #b95b57;
  --danger-soft: rgba(185, 91, 87, 0.12);
  --warning: #b98b48;
  --warning-soft: rgba(185, 139, 72, 0.16);
  --info: #65879d;
  --info-soft: rgba(101, 135, 157, 0.14);
  --success: #5a8a70;
  --success-soft: rgba(90, 138, 112, 0.14);
  --shadow-soft: 0 1px 2px rgba(38, 35, 31, 0.03), 0 2px 10px rgba(38, 35, 31, 0.05);
  --shadow-card: 0 2px 6px rgba(38, 35, 31, 0.04), 0 14px 38px rgba(38, 35, 31, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sidebar-width: 272px;
  --clarity-gradient: linear-gradient(135deg, var(--primary), var(--secondary));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 248, 236, 0.95), transparent 28%),
    radial-gradient(circle at top right, rgba(209, 225, 220, 0.5), transparent 24%),
    linear-gradient(180deg, #fcf8f2 0%, var(--bg) 50%, #f1e8db 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: flex;
}

.app-sidebar {
  width: var(--sidebar-width);
  background: rgba(27, 31, 33, 0.96);
  color: #cbc3b8;
  border-right: 1px solid rgba(53, 58, 60, 0.92);
  backdrop-filter: blur(18px);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand-mark {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--clarity-gradient);
  color: #fff;
  font-size: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

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

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-switcher {
  display: block;
}

.brand-title {
  font-family: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: rgba(203, 195, 184, 0.56);
}

.brand-subtitle-select {
  width: auto;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(203, 195, 184, 0.56);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  box-shadow: none;
  cursor: pointer;
}

.brand-subtitle-select:focus {
  border: none;
  box-shadow: none;
}

.sidebar-section-label {
  display: block;
  margin: 0 10px 10px;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: rgba(203, 195, 184, 0.44);
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.sidebar-nav-nested {
  margin-top: 8px;
}

.sidebar-nav-nested .sidebar-link {
  padding-left: 16px;
  font-size: 0.92rem;
}

.sidebar-advanced {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 18px;
}

.sidebar-advanced-summary {
  list-style: none;
  cursor: pointer;
  color: rgba(203, 195, 184, 0.88);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.sidebar-advanced-summary::-webkit-details-marker {
  display: none;
}

.sidebar-advanced-summary::after {
  content: "+";
  float: right;
  color: rgba(203, 195, 184, 0.5);
}

.sidebar-advanced[open] .sidebar-advanced-summary::after {
  content: "−";
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  color: rgba(203, 195, 184, 0.8);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f6f0e8;
  transform: translateX(1px);
}

.sidebar-link-active {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-weight: 600;
}

.sidebar-icon {
  width: 18px;
  text-align: center;
  flex: 0 0 18px;
}

.sidebar-version {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-footer-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: rgba(203, 195, 184, 0.44);
}

.sidebar-footer-copy {
  font-size: 0.84rem;
  color: rgba(203, 195, 184, 0.78);
}

.app-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(212, 199, 178, 0.6);
  background: rgba(255, 251, 246, 0.72);
  backdrop-filter: blur(18px);
}

.topbar-title {
  font-size: 0.92rem;
  color: var(--muted);
}

.topbar-date {
  font-size: 0.8rem;
  color: var(--muted-soft);
}

.page-shell {
  padding: 28px 32px 52px;
  overflow: visible;
}

.page-stack {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
  min-width: 0;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.page-title {
  margin: 0;
  font-family: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(2rem, 3vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 760px;
}

.header-actions,
.stack-actions,
.button-row,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-link,
button,
.button-secondary,
.button-ghost,
.button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  min-width: 0;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.button-link,
button {
  background: var(--clarity-gradient);
  color: #fff;
  box-shadow: 0 12px 28px rgba(79, 131, 128, 0.22);
}

.button-link:hover,
button:hover,
.button-secondary:hover,
.button-ghost:hover,
.button-danger:hover {
  transform: translateY(-1px);
}

.button-link-muted,
.button-secondary {
  background: rgba(244, 237, 227, 0.94);
  color: var(--text);
  border-color: rgba(212, 199, 178, 0.8);
  box-shadow: none;
}

.button-ghost {
  background: transparent;
  color: var(--muted);
  border-color: rgba(212, 199, 178, 0.5);
  box-shadow: none;
}

.button-danger,
button.danger {
  background: linear-gradient(135deg, #ba625a, #a74f4d);
  color: #fff;
  box-shadow: 0 12px 28px rgba(169, 79, 77, 0.18);
}

.action-menu {
  position: relative;
}

.action-menu summary {
  list-style: none;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(212, 199, 178, 0.82);
  background: rgba(255, 251, 246, 0.98);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 4px;
  z-index: 30;
}

.action-menu-popover a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text);
}

.action-menu-popover a:hover {
  background: rgba(79, 131, 128, 0.08);
}

.card,
.surface-card,
.metric-card,
.calendar-day,
.idea-card,
.option-card,
.summary-panel,
.loading-shell {
  background: var(--panel);
  border: 1px solid rgba(212, 199, 178, 0.72);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
}

.card,
.surface-card,
.loading-shell {
  padding: 22px;
  overflow: visible;
}

.surface-card,
.metric-card,
.hero-card,
.idea-card,
.summary-panel,
.loading-shell {
  animation: fade-in 0.32s ease-out;
}

.metric-grid,
.card-grid,
.detail-grid,
.action-grid,
.idea-grid,
.calendar-stats,
.profile-grid {
  display: grid;
  gap: 18px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.95fr);
  align-items: start;
}

.action-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.35fr) minmax(0, 0.75fr);
  align-items: start;
}

.idea-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.profile-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.8fr);
  align-items: start;
}

.section-heading {
  margin: 0 0 14px;
  font-family: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.section-kicker {
  margin: 0 0 8px;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted-soft);
}

.metric-card {
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.metric-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(79, 131, 128, 0.12);
  color: var(--primary-strong);
  font-size: 1.15rem;
  flex-shrink: 0;
}

.metric-card:nth-child(2) .metric-icon {
  background: var(--warning-soft);
  color: var(--warning);
}

.metric-card:nth-child(3) .metric-icon {
  background: var(--info-soft);
  color: var(--info);
}

.metric-card:nth-child(4) .metric-icon {
  background: var(--success-soft);
  color: var(--success);
}

.metric-value {
  display: block;
  font-family: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.85rem;
  line-height: 1;
  font-weight: 700;
}

.metric-label {
  display: block;
  margin-top: 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted-soft);
}

.muted-text {
  color: var(--muted);
}

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

.score-big {
  font-family: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.recent-list,
.upcoming-list,
.timeline-list {
  display: grid;
  gap: 10px;
}

.recent-row,
.upcoming-card,
.agenda-row,
.history-row {
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(212, 199, 178, 0.5);
  background: rgba(247, 242, 234, 0.76);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  overflow: visible;
}

.recent-row:hover,
.upcoming-card:hover,
.agenda-row:hover,
.history-row:hover {
  background: rgba(255, 249, 241, 0.92);
  border-color: rgba(79, 131, 128, 0.18);
  transform: translateY(-1px);
}

.recent-row {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
}

.mono {
  font-family: "SFMono-Regular", ui-monospace, Menlo, monospace;
  font-size: 0.77rem;
  color: var(--muted);
}

.row-title {
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1.35;
}

.row-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}

.card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-generated { background: rgba(119, 107, 95, 0.12); color: var(--muted); }
.status-pending_review { background: var(--warning-soft); color: #8b5e1d; }
.status-in_review { background: var(--info-soft); color: #4e6d83; }
.status-reviewed { background: rgba(109, 141, 130, 0.14); color: #48655c; }
.status-approved { background: var(--success-soft); color: var(--success); }
.status-rejected { background: var(--danger-soft); color: var(--danger); }
.status-scheduled { background: rgba(177, 136, 78, 0.14); color: #8e6a32; }
.status-posted { background: rgba(82, 127, 156, 0.14); color: #476f8b; }
.status-pending { background: rgba(119, 107, 95, 0.12); color: var(--muted); }
.status-syncing { background: rgba(79, 131, 128, 0.14); color: var(--primary-strong); }
.status-synced { background: var(--success-soft); color: var(--success); }
.status-failed { background: var(--danger-soft); color: var(--danger); }
.status-ok { background: var(--success-soft); color: var(--success); }
.status-gerando\ texto,
.status-gerando\ imagem { background: rgba(79, 131, 128, 0.14); color: var(--primary-strong); }

.status-image-pending { background: rgba(119, 107, 95, 0.12); color: var(--muted); }
.status-image-generating { background: rgba(79, 131, 128, 0.14); color: var(--primary-strong); }
.status-image-ready { background: var(--success-soft); color: var(--success); }
.status-image-failed { background: var(--danger-soft); color: var(--danger); }

.inline-loading {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(79, 131, 128, 0.16);
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
  flex-shrink: 0;
}

.animated-status::after {
  content: "...";
  display: inline-block;
  width: 1.2em;
  overflow: hidden;
  vertical-align: bottom;
  animation: dots 1.2s steps(4, end) infinite;
}

.filters-card {
  padding: 18px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) repeat(2, minmax(180px, 0.76fr)) auto;
  gap: 12px;
  align-items: end;
}

.filters label,
.form-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted-soft);
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(212, 199, 178, 0.88);
  background: rgba(255, 252, 246, 0.96);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(79, 131, 128, 0.58);
  box-shadow: 0 0 0 4px rgba(79, 131, 128, 0.08);
}

.table-shell {
  overflow: visible;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

thead th {
  padding: 16px 18px;
  text-align: left;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted-soft);
  background: rgba(244, 237, 227, 0.72);
  border-bottom: 1px solid rgba(212, 199, 178, 0.72);
  white-space: normal;
  word-break: break-word;
}

tbody td {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(227, 217, 200, 0.78);
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

tbody tr:nth-child(even) td {
  background: rgba(247, 242, 234, 0.34);
}

tbody tr:hover td {
  background: rgba(255, 249, 241, 0.84);
}

.table-title-link {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  max-width: 100%;
}

.table-title-link span:first-child {
  font-weight: 600;
}

.table-subline {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.score-pill {
  display: inline-flex;
  min-width: 44px;
  justify-content: center;
  align-items: center;
  padding: 8px 10px;
  border-radius: 14px;
  font-weight: 700;
  background: rgba(79, 131, 128, 0.1);
  color: var(--primary-strong);
}

.score-danger { background: var(--danger-soft); color: var(--danger); }
.score-warning { background: var(--warning-soft); color: #8e6a32; }
.score-success { background: var(--success-soft); color: var(--success); }

.hero-card {
  padding: 26px;
  display: grid;
  gap: 18px;
}

.idea-card {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.idea-meta {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted-soft);
}

.idea-title {
  margin: 0;
  font-family: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.18rem;
  line-height: 1.2;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr);
  gap: 22px;
}

.image-panel {
  display: grid;
  gap: 12px;
}

.image-frame {
  aspect-ratio: 1 / 1;
  max-height: 440px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(212, 199, 178, 0.72);
  background: linear-gradient(180deg, rgba(247, 242, 234, 0.96), rgba(236, 229, 218, 0.95));
}

.post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.image-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.content-blocks,
.score-list,
.details-list,
.review-grid,
.wizard-summary-list,
.calendar-legend {
  display: grid;
  gap: 14px;
}

.content-block {
  padding: 16px;
  border-radius: 16px;
  background: rgba(247, 242, 234, 0.68);
  border: 1px solid rgba(227, 217, 200, 0.8);
}

.content-value {
  margin-top: 8px;
  line-height: 1.65;
}

pre.content-value {
  margin: 8px 0 0;
  white-space: pre-wrap;
  font-family: inherit;
}

.side-column {
  display: grid;
  gap: 18px;
}

.score-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.score-badge {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: rgba(79, 131, 128, 0.12);
  color: var(--primary-strong);
  font-family: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
}

.score-delta {
  font-size: 0.86rem;
  color: var(--muted);
}

.score-item,
.details-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.94rem;
}

.score-item span:last-child,
.details-item span:last-child {
  font-weight: 600;
}

.history-row,
.timeline-item {
  display: grid;
  gap: 6px;
}

.timeline-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.review-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-grid .form-field-full {
  grid-column: 1 / -1;
}

.wizard-shell {
  max-width: 920px;
  margin: 0 auto;
}

.wizard-progress {
  display: flex;
  gap: 8px;
  align-items: center;
}

.wizard-progress-bar {
  height: 5px;
  flex: 1;
  border-radius: 999px;
  background: rgba(212, 199, 178, 0.6);
}

.wizard-progress-bar-active,
.wizard-progress-bar-done {
  background: rgba(79, 131, 128, 0.62);
}

.wizard-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.option-card {
  padding: 18px;
  text-align: left;
  color: var(--text);
  background: rgba(255, 252, 246, 0.94);
  border: 1px solid rgba(212, 199, 178, 0.72);
  box-shadow: none;
}

.option-card:hover {
  background: rgba(255, 249, 241, 0.95);
  border-color: rgba(79, 131, 128, 0.3);
}

.option-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 0.98rem;
}

.option-card span {
  display: block;
  color: var(--muted);
  line-height: 1.5;
}

.summary-panel {
  padding: 18px;
  background: linear-gradient(180deg, rgba(250, 246, 239, 0.94), rgba(242, 234, 223, 0.94));
}

.summary-panel-cta {
  padding: 20px;
  border-radius: 18px;
  border: 1px dashed rgba(79, 131, 128, 0.24);
  background: rgba(79, 131, 128, 0.06);
  text-align: center;
}

.calendar-shell {
  display: grid;
  gap: 18px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calendar-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  background: rgba(212, 199, 178, 0.58);
  border-radius: 20px;
  overflow: hidden;
}

.calendar-day {
  min-height: 138px;
  border-radius: 0;
  padding: 12px;
  box-shadow: none;
  background: rgba(255, 252, 246, 0.96);
}

.calendar-day header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
}

.calendar-day.today header {
  background: var(--clarity-gradient);
  color: white;
}

.calendar-muted {
  opacity: 0.42;
}

.calendar-entry {
  display: block;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  line-height: 1.4;
  border: 1px solid transparent;
}

.calendar-entry .entry-score {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  opacity: 0.78;
}

.agenda-list {
  display: grid;
}

.agenda-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
}

.profile-editor {
  min-height: 620px;
  font-size: 0.95rem;
  line-height: 1.7;
  background: rgba(247, 242, 234, 0.72);
}

.note-list {
  display: grid;
  gap: 12px;
}

.note-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(247, 242, 234, 0.72);
  border: 1px solid rgba(227, 217, 200, 0.8);
}

.loading-shell {
  max-width: 740px;
  margin: 0 auto;
  text-align: center;
  padding: 30px 26px;
}

.loading-orb {
  width: 96px;
  height: 96px;
  margin: 18px auto;
  border-radius: 999px;
  border: 8px solid rgba(79, 131, 128, 0.14);
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}

.loading-orb-done {
  animation: none;
  border-top-color: var(--success);
}

.loading-orb-failed {
  border-top-color: var(--danger);
}

.error-text {
  color: var(--danger);
}

.empty-state {
  padding: 30px;
  text-align: center;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@keyframes dots {
  0% { width: 0; }
  100% { width: 1.2em; }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-grid,
  .two-column,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .recent-row,
  .agenda-row {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
  }

  .app-sidebar {
    position: static;
    width: auto;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(53, 58, 60, 0.92);
    padding: 18px 16px;
  }

  .topbar {
    padding: 0 20px;
  }

  .page-shell {
    padding: 20px;
  }

  .card-grid,
  .action-grid,
  .filters,
  .review-grid,
  .wizard-options,
  .calendar-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-header,
  .card-toolbar,
  .calendar-toolbar,
  .image-caption {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar {
    height: auto;
    padding: 16px 20px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
    background: transparent;
    gap: 12px;
  }

  .calendar-day {
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
  }

  thead {
    display: none;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  tbody tr {
    padding: 16px 0;
  }

  tbody td {
    border-bottom: none;
    padding: 6px 0;
    background: transparent !important;
  }
}

/* ---------- Login ---------- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-card { width: 100%; max-width: 380px; padding: 32px 28px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.login-card h1 { margin: 20px 0 4px; font-size: 1.6rem; }
.login-sub { margin: 0 0 18px; color: var(--muted); }
.login-card form { display: flex; flex-direction: column; gap: 6px; }
.login-card label { margin-top: 10px; font-size: 0.9rem; color: var(--muted); }
.login-card input[type="text"], .login-card input[type="password"] { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px; width: 100%; }
.login-card input:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
.login-button { margin-top: 18px; font: inherit; font-weight: 600; color: #fff; background: var(--clarity-gradient); border: 0; border-radius: var(--radius-sm); padding: 13px; cursor: pointer; }
.login-button:hover { filter: brightness(1.06); }
.login-erro { margin: 8px 0 0; color: var(--danger); font-size: 0.9rem; }
.logout-form { margin: 0; }
.logout-button { font: inherit; font-size: 0.9rem; color: var(--muted); background: none; border: 0; padding: 4px 0; cursor: pointer; }
.logout-button:hover { color: var(--text); text-decoration: underline; }
