:root {
  --ink: #0a0a0a;
  --ink-soft: #222322;
  --paper: #f7f4ed;
  --paper-strong: #fffdf7;
  --line: #ded7ca;
  --muted: #6b675f;
  --cyan: #49dce3;
  --cyan-deep: #168e99;
  --yellow: #ffe36a;
  --yellow-deep: #d7a913;
  --terracotta: #b76345;
  --green: #4d8d6e;
  --red: #b94d4b;
  --type-post: #5ce1e6;
  --type-carousel: #ffde59;
  --type-reel: #b76345;
  --type-story: #e71877;
  --shadow: 0 18px 42px rgba(10, 10, 10, 0.12);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

body:not(.is-authenticated) {
  overflow: hidden;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

body:not(.is-authenticated) .app-shell {
  display: none;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(4, 8, 12, 0.82), rgba(4, 8, 12, 0.62)),
    url("assets/la-roque-panorama.jpg");
  background-position: center;
  background-size: cover;
}

body.is-authenticated .login-screen {
  display: none;
}

.login-card {
  width: min(100%, 420px);
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: var(--shadow);
}

.login-logo {
  width: min(100%, 260px);
  height: auto;
  display: block;
  padding: 10px;
  border-radius: 8px;
  background: var(--paper-strong);
}

.login-card h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1;
}

.login-card .primary-button {
  width: 100%;
}

.login-error {
  min-height: 1.25rem;
  margin: -4px 0 0;
  color: var(--red);
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background-color: var(--ink);
  background-image:
    linear-gradient(180deg, rgba(4, 8, 12, 0.86), rgba(4, 8, 12, 0.74)),
    linear-gradient(135deg, rgba(73, 220, 227, 0.22), transparent 56%),
    url("assets/la-roque-panorama.jpg");
  background-position: center;
  background-size: cover;
  color: var(--paper-strong);
  display: flex;
  flex-direction: column;
  gap: 28px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.brand {
  display: grid;
  align-items: start;
}

.brand-logo {
  width: min(100%, 246px);
  height: auto;
  display: block;
  object-fit: contain;
  padding: 10px;
  border-radius: 8px;
  background: var(--paper-strong);
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.5));
}

.topbar h2,
.panel-heading h3,
.chart-panel h4,
.insight-panel h4 {
  margin: 0;
  line-height: 1.05;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar .eyebrow {
  color: rgba(247, 244, 237, 0.82);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

.nav-stack {
  display: grid;
  gap: 8px;
}

.nav-item,
.ghost-button,
.primary-button,
.drive-link,
.segment,
.icon-button,
.text-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.nav-item {
  width: 100%;
  padding: 11px 12px;
  background: rgba(4, 8, 12, 0.22);
  color: rgba(247, 244, 237, 0.9);
  text-align: left;
  backdrop-filter: blur(8px);
}

.nav-item:hover,
.nav-item.active {
  background: rgba(10, 64, 78, 0.72);
  border-color: rgba(73, 220, 227, 0.72);
  color: var(--paper-strong);
}

.drive-link {
  margin-top: auto;
  display: grid;
  place-items: center;
  padding: 11px 14px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}

.topbar h2 {
  font-size: clamp(1.55rem, 2.2vw, 2.4rem);
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.notification-center {
  position: relative;
}

.notification-button {
  position: relative;
  width: 44px;
  padding: 0;
  border-color: var(--line);
  background: var(--paper-strong);
}

.bell-icon {
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-block;
  border: 2px solid var(--ink);
  border-bottom: 0;
  border-radius: 10px 10px 4px 4px;
}

.bell-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 999px;
  transform: translateX(-50%);
}

.bell-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 6px;
  height: 6px;
  background: var(--ink);
  border-radius: 50%;
  transform: translateX(-50%);
}

.notification-dot {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  display: none;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--paper);
  border-radius: 999px;
  background: var(--red);
  color: var(--paper-strong);
  font-size: 0.68rem;
  font-weight: 900;
}

.notification-dot.visible {
  display: grid;
}

.notification-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: min(360px, calc(100vw - 32px));
  display: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}

.notification-popover.active {
  display: block;
}

.notification-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.notification-list {
  max-height: 360px;
  overflow: auto;
}

.notification-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.notification-item.unread {
  background: rgba(73, 220, 227, 0.1);
}

.notification-item strong,
.notification-item p {
  margin: 0;
}

.notification-item p,
.notification-item span,
.empty-notifications {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.notification-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notification-footer .text-button {
  min-height: 30px;
  padding: 4px 7px;
  font-size: 0.76rem;
}

.empty-notifications {
  margin: 0;
  padding: 14px;
}

.ghost-button,
.primary-button {
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.ghost-button {
  border-color: var(--line);
  background: var(--paper-strong);
  color: var(--ink);
}

.primary-button {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper-strong);
}

.primary-button:hover,
.ghost-button:hover,
.drive-link:hover,
.icon-button:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.ghost-button:disabled,
.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.scope-strip,
.summary-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.scope-strip {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.scope-strip.single {
  grid-template-columns: minmax(0, 430px);
}

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

body[data-view="stats"] .summary-grid {
  display: none;
}

.scope-card,
.metric-card,
.view-panel,
.post-card,
.instagram-card,
.brief-form,
.brief-item,
.chart-panel,
.insight-panel,
.performance-table,
.calendar-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.scope-card,
.metric-card {
  padding: 16px;
}

.scope-card {
  min-height: 82px;
  display: grid;
  align-content: space-between;
  background:
    linear-gradient(135deg, rgba(73, 220, 227, 0.15), transparent 55%),
    var(--paper-strong);
}

.scope-link {
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.scope-link:hover,
.scope-link:focus-visible {
  border-color: var(--cyan-deep);
  box-shadow: 0 12px 26px rgba(22, 142, 153, 0.16);
  outline: none;
  transform: translateY(-1px);
}

.scope-card span,
.metric-label,
.meta-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.scope-card strong {
  font-size: 1.3rem;
}

.scope-card small {
  color: var(--cyan-deep);
  font-size: 0.78rem;
  font-weight: 800;
}

.metric-value {
  display: block;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  font-weight: 900;
  line-height: 1;
}

.view-panel {
  display: none;
  padding: 20px;
  box-shadow: var(--shadow);
}

.view-panel.active {
  display: block;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.panel-heading h3 {
  font-size: 1.35rem;
}

.panel-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(0, auto));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eee7d9;
}

.segmented-control.compact {
  grid-template-columns: repeat(2, minmax(0, auto));
}

.segment {
  min-height: 34px;
  padding: 6px 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segment.active {
  background: var(--paper-strong);
  color: var(--ink);
  border-color: rgba(10, 10, 10, 0.08);
}

.approval-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.post-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 340px);
  overflow: auto;
  padding-right: 4px;
}

.post-card {
  width: 100%;
  padding: 12px;
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.post-card.active {
  border-color: var(--cyan-deep);
  box-shadow: inset 4px 0 0 var(--cyan);
}

.post-thumb {
  width: 78px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: #eee7d9;
}

.video-thumb {
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--yellow);
  font-size: 0.76rem;
  font-weight: 900;
}

.post-title-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: start;
}

.post-title-row h4 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.2;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ebe4d8;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
}

.pill.pending {
  background: rgba(255, 227, 106, 0.8);
}

.pill.approved {
  background: rgba(77, 141, 110, 0.18);
  color: #236347;
}

.pill.needs-work {
  background: rgba(185, 77, 75, 0.15);
  color: #8f302e;
}

.pill.scheduled {
  background: rgba(73, 220, 227, 0.19);
  color: #126d75;
}

.post-preview {
  position: sticky;
  top: 28px;
}

.instagram-card {
  overflow: hidden;
}

.instagram-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.avatar {
  width: 34px;
  height: 34px;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  background: #eee7d9;
}

.instagram-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  background: #eee7d9;
}

.instagram-body {
  padding: 16px;
}

.caption {
  margin: 0 0 12px;
  line-height: 1.5;
}

.hashtags {
  margin: 0;
  color: var(--cyan-deep);
  font-weight: 800;
  line-height: 1.5;
}

.preview-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}

.meta-box {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ed;
}

.meta-box strong {
  display: block;
  margin-top: 4px;
}

.decision-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: #fbf7ed;
}

.decision-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.approve-button,
.change-button,
.delete-button {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.approve-button {
  background: var(--cyan);
  color: var(--ink);
}

.change-button {
  background: var(--yellow);
  color: var(--ink);
}

.delete-button {
  display: none;
  background: var(--red);
  color: var(--paper-strong);
}

body.admin-unlocked .delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.feedback-box {
  display: none;
  gap: 8px;
}

.feedback-box.active {
  display: grid;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  color: var(--ink);
  padding: 10px 11px;
  resize: vertical;
}

input[type="file"] {
  min-height: 44px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-weight: 800;
}

.admin-panel {
  display: none;
}

body.admin-unlocked .admin-panel {
  display: grid;
}

.admin-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(73, 220, 227, 0.11), transparent 58%),
    var(--paper-strong);
}

.admin-form .primary-button {
  align-self: end;
}

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

.publication-form.is-story .caption-field,
.publication-form.is-story .hashtags-field {
  display: none;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.calendar-grid.month-view {
  display: block;
}

.calendar-day {
  min-height: 168px;
  padding: 12px;
}

.calendar-date {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 10px;
}

.calendar-date strong {
  font-size: 1.1rem;
}

.calendar-item {
  padding: 8px;
  border-left: 4px solid var(--cyan);
  background: #f1eadf;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 800;
}

.calendar-item.type-post,
.month-post.type-post {
  border-left-color: var(--type-post);
}

.calendar-item.type-carousel,
.month-post.type-carousel {
  border-left-color: var(--type-carousel);
}

.calendar-item.type-reel,
.month-post.type-reel {
  border-left-color: var(--type-reel);
}

.calendar-item.type-story,
.month-post.type-story {
  border-left-color: var(--type-story);
}

.month-calendar {
  display: grid;
  gap: 10px;
}

.month-heading {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ed;
  font-weight: 900;
  text-transform: capitalize;
}

.month-weekdays,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.month-weekdays span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.month-cell {
  min-height: 124px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.month-cell.muted-cell {
  background: transparent;
  border-style: dashed;
}

.month-cell strong {
  display: block;
  margin-bottom: 8px;
}

.month-posts {
  display: grid;
  gap: 6px;
}

.month-post {
  width: 100%;
  padding: 6px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--cyan);
  border-radius: 6px;
  background: #f1eadf;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
}

.month-post span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
}

.brief-layout,
.stats-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(360px, 1.2fr);
  gap: 18px;
}

.brief-form {
  padding: 16px;
  display: grid;
  gap: 13px;
  align-self: start;
}

.brief-feed {
  display: grid;
  gap: 10px;
}

.brief-item {
  padding: 14px;
}

.brief-item h4 {
  margin: 0 0 8px;
}

.brief-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.chart-panel,
.insight-panel {
  padding: 16px;
}

.stats-dashboard {
  display: grid;
  gap: 18px;
}

.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card {
  min-height: 132px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.kpi-card-wide {
  grid-column: span 3;
}

.kpi-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.kpi-card strong {
  font-size: clamp(1.08rem, 2vw, 1.7rem);
  line-height: 1.12;
}

.kpi-card small {
  color: var(--cyan-deep);
  font-weight: 900;
}

.kpi-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.chart-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chart-title-stack {
  display: flex;
  align-items: center;
  min-width: min(100%, 440px);
}

.chart-title-stack .range-control {
  display: grid;
  grid-template-columns: 1fr;
  min-width: min(100%, 290px);
}

.range-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eee7d9;
}

.range-control button {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.range-control button.active {
  border-color: rgba(10, 10, 10, 0.08);
  background: var(--paper-strong);
  color: var(--ink);
}

.followers-chart {
  width: 100%;
  min-height: 190px;
}

.followers-chart polyline {
  fill: none;
  stroke: var(--cyan-deep);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.followers-chart circle {
  fill: var(--yellow);
  stroke: var(--ink);
  stroke-width: 2;
}

.followers-chart text {
  fill: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.regularity-chart .axis-date-label {
  font-size: 0.5rem;
  font-weight: 900;
}

.regularity-chart rect {
  fill: var(--cyan-deep);
}

.regularity-chart .week-band {
  fill: rgba(73, 220, 227, 0.08);
}

.regularity-chart .week-band.alternate {
  fill: rgba(255, 222, 89, 0.12);
}

.regularity-chart .week-total-label {
  fill: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
}

.stats-source {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: -6px 0 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7ed;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.stats-source span:first-child {
  color: var(--ink);
}

.chart-panel h4,
.insight-panel h4 {
  margin-bottom: 14px;
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(130px, 220px) 1fr 78px;
  gap: 10px;
  align-items: center;
  font-size: 0.86rem;
}

.bar-row a,
.performance-table a {
  color: inherit;
  text-decoration: none;
}

.bar-row a:hover,
.performance-table a:hover {
  color: var(--cyan-deep);
}

.bar-track {
  min-height: 14px;
  background: #ebe4d8;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 14px;
  background: linear-gradient(90deg, var(--cyan), var(--yellow));
}

.empty-chart-row {
  display: grid;
  grid-template-columns: minmax(110px, 180px) 1fr;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.empty-chart-row span:last-child {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ebe4d8, rgba(235, 228, 216, 0.35));
}

.insight-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.performance-table {
  margin-top: 18px;
  overflow: auto;
}

.performance-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.performance-table th,
.performance-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.performance-table th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.sort-button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  text-transform: uppercase;
}

.sort-button span:last-child {
  color: var(--cyan-deep);
  font-size: 0.9rem;
  line-height: 1;
}

.sort-button.active span:last-child {
  color: var(--ink);
}

.text-button {
  min-height: 32px;
  padding: 5px 8px;
  background: #ebe4d8;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 900;
}

.danger-text-button {
  background: rgba(185, 77, 75, 0.14);
  color: #8f302e;
}

.table-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}

.connector-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(73, 220, 227, 0.11), transparent 58%),
    var(--paper-strong);
}

.connector-panel.compact {
  padding: 0;
  border: 0;
  background: transparent;
}

.connector-panel h4,
.connector-panel p {
  margin: 0;
}

.connector-panel h4 {
  font-size: 1.1rem;
}

.connector-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.connector-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.connector-steps span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #ebe4d8;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 13px 15px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper-strong);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.app-footer {
  margin: 18px 0 0;
  padding: 10px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

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

  .nav-item {
    text-align: center;
  }

  .drive-link {
    margin-top: 0;
  }

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

  .admin-form,
  .stats-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

.kpi-card-wide {
  grid-column: span 2;
}

.top-period-card {
  min-height: auto;
}

  .approval-layout,
  .brief-layout,
  .stats-layout {
    grid-template-columns: 1fr;
  }

  .post-preview {
    position: static;
  }
}

@media (max-width: 680px) {
  .workspace {
    padding: 16px;
  }

  .topbar,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .panel-actions,
  .decision-actions {
    flex-direction: column;
  }

  .ghost-button,
  .primary-button,
  .approve-button,
  .change-button,
  .delete-button {
    width: 100%;
  }

  .stats-source {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-stack,
  .scope-strip,
  .summary-grid,
  .admin-form,
  .stats-kpi-grid,
  .calendar-grid,
  .preview-meta {
    grid-template-columns: 1fr;
  }

  .kpi-card-wide {
    grid-column: span 1;
  }

  .kpi-heading {
    align-items: stretch;
    flex-direction: column;
  }

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

  .post-list {
    max-height: none;
  }
}
