:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --ink: #1c1a18;
  --muted: #746b60;
  --line: #d9d0c2;
  --panel: #fffaf2;
  --panel-strong: #ffffff;
  --accent: #e83f6f;
  --accent-dark: #bf2452;
  --teal: #077e73;
  --amber: #bf7a12;
  --shadow: 0 18px 50px rgba(41, 32, 23, 0.13);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.legal-page {
  width: min(860px, calc(100% - 32px));
  margin: 40px auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  line-height: 1.6;
}

.legal-page h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

.legal-page h2 {
  margin: 24px 0 6px;
  font-size: 18px;
}

.legal-page p {
  margin: 0 0 10px;
  color: var(--muted);
}

.legal-page a {
  color: var(--accent-dark);
}

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

button {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  border-radius: 8px;
  min-height: 42px;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  border-color: #bcae9c;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 360px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #ede5d8;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 8px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), #f08a24);
  font-weight: 900;
  letter-spacing: 0;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h2,
.preview-copy p,
.queue-head h2 {
  margin: 0;
}

.brand h1 {
  font-size: 22px;
  line-height: 1.05;
}

.brand p,
.topbar p,
.file-summary,
.preview-copy p,
.empty-state,
.stats span,
.hint {
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(41, 32, 23, 0.06);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-title span {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1c1a18;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.panel h2 {
  font-size: 16px;
}

.drop-zone {
  min-height: 124px;
  border: 1px dashed #b9aa97;
  border-radius: 8px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  background: #fffdf8;
  cursor: pointer;
}

.drop-zone input {
  display: none;
}

.drop-zone strong {
  display: block;
  color: var(--accent-dark);
}

.drop-zone small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}

.file-summary {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.icon-button {
  min-height: 32px;
  width: 32px;
  padding: 0;
  font-weight: 800;
}

.account-form {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 8px;
}

.account-form button {
  grid-column: 1 / -1;
}

.account-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.account-item {
  display: grid;
  grid-template-columns: auto 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  background: #fffdf8;
  border-radius: 8px;
  padding: 9px;
}

.account-item.needs-reconnect {
  border-color: rgba(232, 63, 111, 0.45);
  background: rgba(232, 63, 111, 0.06);
}

.account-item input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.account-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-item span {
  display: block;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0;
}

.account-avatar-wrap {
  position: relative;
  width: 34px;
  height: 34px;
  display: block;
}

.account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #f4eee5;
}

.account-avatar.fallback {
  display: grid;
  place-items: center;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 900;
}

.account-avatar-wrap .account-avatar.fallback {
  display: none;
}

.account-avatar-wrap.is-fallback .account-avatar.fallback {
  display: grid;
}

.edit-account,
.remove-account {
  min-height: 30px;
  width: 30px;
  padding: 0;
  font-weight: 800;
}

.hint {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.35;
}

.connect-box {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fffdf8;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
}

.connect-box strong {
  font-size: 14px;
}

.connect-box small {
  color: var(--muted);
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
  padding: 11px 12px;
  margin-top: 10px;
  line-height: 1.4;
}

input,
select {
  height: 44px;
  padding: 0 11px;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 63, 111, 0.13);
}

.workspace {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.topbar h2 {
  font-size: 28px;
  line-height: 1.1;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.actions[hidden] {
  display: none !important;
}

.schedule-controls {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(180px, 1fr) minmax(190px, 1fr) minmax(180px, 0.9fr) minmax(190px, 0.9fr) auto;
  gap: 12px;
  align-items: end;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

label span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 7px;
}

.number-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
}

.quick-intervals {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.quick-intervals button {
  min-height: 32px;
  padding: 0 6px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quick-intervals button.active {
  border-color: var(--accent);
  background: rgba(232, 63, 111, 0.1);
  color: var(--accent-dark);
}

.repeat-media-row {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) auto;
}

.repeat-media-row input {
  border-radius: 8px 0 0 8px;
}

.repeat-media-row > span {
  min-width: 72px;
  height: 44px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0 12px;
  color: var(--muted);
  background: #363636;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  white-space: nowrap;
}

.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  white-space: nowrap;
}

.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

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

.stats div {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.stats strong {
  display: block;
  font-size: 22px;
}

.queue-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.preview {
  position: sticky;
  top: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.phone {
  aspect-ratio: 9 / 16;
  max-height: 560px;
  border-radius: 26px;
  background: #111;
  overflow: hidden;
  position: relative;
  border: 10px solid #1d1c1b;
}

.phone video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.empty-preview {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(circle at 30% 25%, rgba(232, 63, 111, 0.45), transparent 28%),
    linear-gradient(155deg, #25211d, #0d0d0d 58%, #29423f);
  font-weight: 900;
  font-size: 28px;
}

.preview-copy {
  padding-top: 14px;
}

.preview-copy strong {
  display: block;
  margin-bottom: 8px;
}

.preview-copy p {
  line-height: 1.45;
  word-break: break-word;
}

.queue-panel {
  min-width: 0;
}

.queue-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.queue-head h2 {
  font-size: 18px;
}

.queue-list {
  display: grid;
  gap: 10px;
}

.queue-item {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 150px;
  gap: 12px;
  align-items: center;
}

.thumb {
  width: 74px;
  aspect-ratio: 9 / 12;
  border-radius: 7px;
  background: #171615;
  overflow: hidden;
}

.thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.queue-main {
  min-width: 0;
}

.queue-title {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}

.queue-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #dff1ee;
  color: var(--teal);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.platform-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fff0d7;
  color: var(--amber);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.placement-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(232, 63, 111, 0.1);
  color: var(--accent-dark);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.account-name {
  color: var(--teal);
  font-weight: 800;
}

.queue-caption,
.queue-tags {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.queue-time {
  text-align: right;
  color: var(--ink);
  font-weight: 800;
}

.queue-time span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin-top: 3px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  background: rgba(255, 250, 242, 0.7);
}

.stories-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.stories-main,
.story-summary-card,
.story-accounts-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.stories-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.stories-head span,
.story-summary-card > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stories-head h2,
.story-summary-card h2 {
  margin: 4px 0 4px;
  font-size: 28px;
}

.stories-head p {
  margin: 0;
  color: var(--muted);
}

.story-drop-zone {
  min-height: 112px;
}

.story-editor-card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
}

.story-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 18px;
  align-items: start;
}

.story-editor-fields {
  display: grid;
  gap: 14px;
}

.story-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.story-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.story-toggle strong,
.story-toggle small {
  display: block;
}

.story-toggle small,
.story-editor-hint {
  color: var(--muted);
}

.story-editor-card textarea {
  min-height: 108px;
  resize: vertical;
}

.story-controls-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px minmax(0, 1fr);
  gap: 10px;
}

.story-controls-grid input[type="color"] {
  min-height: 42px;
  padding: 4px;
}

.story-editor-hint {
  margin: 0;
  font-size: 13px;
}

.story-preview-shell > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-phone-preview {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid rgba(124, 155, 255, 0.42);
  border-radius: 24px;
  background: linear-gradient(160deg, #151a2a, #261632 55%, #08090f);
}

.story-phone-preview img,
.story-phone-preview video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.story-preview-text {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  max-width: 82%;
  transform: translate(-50%, -50%);
  border-radius: 16px;
  padding: 10px 12px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.72);
  font-weight: 900;
  line-height: 1.02;
  text-align: center;
  text-wrap: balance;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.story-preview-text[data-dragging="true"] {
  cursor: grabbing;
}

.story-accounts-card {
  margin-top: 16px;
}

.story-account-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.story-account-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-strong);
}

.story-account-item input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.story-account-item span {
  min-width: 0;
}

.story-account-item strong,
.story-account-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-account-item small {
  color: var(--muted);
  margin-top: 2px;
}

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

.story-mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.story-mini-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-strong);
}

.story-mini-stats strong {
  display: block;
  font-size: 26px;
}

.story-mini-stats small {
  color: var(--muted);
}

.story-history-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.story-history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-strong);
}

.story-history-item strong,
.story-history-item span,
.story-history-item small {
  display: block;
}

.story-history-item span,
.story-history-item small {
  color: var(--muted);
  margin-top: 2px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 340px;
  background: #1c1a18;
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.18s ease;
}

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

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(28, 26, 24, 0.46);
  z-index: 20;
}

.modal.show {
  display: grid;
}

.modal-card {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.modal-card label {
  display: block;
  margin-top: 12px;
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-head h2 {
  margin: 0;
  font-size: 20px;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 16px;
  flex-wrap: wrap;
}

.manual-account-card {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.manual-account-card h3 {
  margin: 0;
  font-size: 16px;
}

.manual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .schedule-controls,
  .queue-layout,
  .stories-workspace {
    grid-template-columns: 1fr;
  }

  .preview {
    position: static;
  }

  .phone {
    max-height: 520px;
    margin-inline: auto;
  }

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

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

  .topbar,
  .queue-head {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    justify-content: stretch;
  }

  .actions button,
  .queue-head button {
    width: 100%;
  }

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

  .stories-head {
    align-items: stretch;
    flex-direction: column;
  }

  .stories-head button {
    width: 100%;
  }

  .story-editor-grid,
  .story-controls-grid {
    grid-template-columns: 1fr;
  }

  .story-preview-shell {
    max-width: 260px;
    width: 100%;
    margin-inline: auto;
  }

  .queue-item {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .thumb {
    width: 58px;
  }

  .queue-time {
    grid-column: 1 / -1;
    text-align: left;
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }
}

/* Tema escuro Murphy */
:root {
  --bg: #050506;
  --panel: #0c0d11;
  --panel-strong: #14151b;
  --panel-soft: #080a0f;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(199, 118, 255, 0.58);
  --text: #f7f7fb;
  --muted: #a7a7b2;
  --accent: #c176ff;
  --accent-dark: #8f45dd;
  --accent-soft: rgba(193, 118, 255, 0.16);
  --teal: #5f8dff;
  --amber: #d8d8df;
  --danger: #ff5d68;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
}

html {
  scrollbar-color: var(--accent) #0a0a0d;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 22% 18%, rgba(193, 118, 255, 0.11), transparent 28%),
    radial-gradient(circle at 74% 8%, rgba(95, 141, 255, 0.09), transparent 24%),
    linear-gradient(135deg, #030304 0%, #08080b 48%, #020203 100%);
}

.app-shell {
  background: rgba(5, 5, 6, 0.98);
}

.sidebar {
  background: linear-gradient(180deg, #050506 0%, #09090c 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  color: #ffffff;
  background: linear-gradient(135deg, #151820, #2b173d 52%, var(--accent-dark));
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 30px rgba(193, 118, 255, 0.22);
}

.workspace {
  background: transparent;
}

.topbar,
.schedule-controls,
.stats > div,
.stories-main,
.story-editor-card,
.story-summary-card,
.story-accounts-card,
.connect-box,
.preview,
.queue-panel,
.empty-queue,
.modal-card,
.account-item,
.queue-item,
.caption-box,
.files-panel,
.video-list,
.settings-card {
  color: var(--text);
  background: linear-gradient(180deg, rgba(20, 21, 27, 0.96), rgba(8, 9, 13, 0.96));
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.schedule-controls,
.queue-panel,
.preview {
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.stats > *:first-child,
.stories-main,
.queue-panel,
.preview {
  background:
    radial-gradient(circle at 18% 0%, rgba(193, 118, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(20, 21, 27, 0.98), rgba(8, 9, 13, 0.98));
}

.sidebar h1,
.topbar h2,
.queue-head h2,
.section-title,
.stats strong,
.connect-box strong,
.account-name,
.queue-title {
  color: var(--text);
}

.sidebar p,
.muted,
.connect-box small,
.account-meta,
.queue-meta,
.field-hint,
.empty-queue,
label,
.stats span {
  color: var(--muted);
}

a,
.link-button {
  color: var(--accent);
}

button,
.button,
input,
select,
textarea {
  color: var(--text);
  background: #07080c;
  border-color: rgba(255, 255, 255, 0.13);
}

input::placeholder,
textarea::placeholder {
  color: #6f7b73;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(193, 118, 255, 0.16);
  outline: none;
}

button:hover,
.button:hover {
  border-color: var(--line-strong);
  background: rgba(193, 118, 255, 0.1);
}

button.primary,
.primary,
.generate-btn,
.actions button:first-child,
.connect-box button:hover {
  color: #050506;
  background: linear-gradient(135deg, #ffffff, #d9dbe4);
  border-color: transparent;
  box-shadow: 0 12px 30px rgba(255, 255, 255, 0.14);
}

button.primary:hover,
.primary:hover,
.generate-btn:hover,
.actions button:first-child:hover {
  background: linear-gradient(135deg, #ffffff, #cbd0dc);
  transform: translateY(-1px);
}

.preset button,
.tab-button,
.chip,
.pill,
.badge,
.needs-reconnect {
  color: var(--text);
  background: rgba(193, 118, 255, 0.1);
  border-color: rgba(193, 118, 255, 0.28);
}

.preset button.active,
.tab-button.active,
.chip.active,
.pill.active,
.badge.active {
  color: #071006;
  background: var(--accent);
  border-color: var(--accent);
}

.preset button,
.preset button:hover,
.preset button.active,
.preset button.active:hover {
  background: #363636;
}

.preset button.active,
.preset button.active:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.quick-intervals button,
.quick-intervals button:hover,
.quick-intervals button.active,
.quick-intervals button.active:hover {
  background: #363636;
}

.quick-intervals button.active,
.quick-intervals button.active:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.account-item.is-selected,
.queue-item:hover,
.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--line-strong);
  background:
    radial-gradient(circle at 18% 0%, rgba(193, 118, 255, 0.16), transparent 42%),
    rgba(10, 12, 18, 0.98);
}

.queue-control {
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(193, 118, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(20, 21, 27, 0.98), rgba(8, 9, 13, 0.98));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.queue-control-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.queue-control-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.queue-control-head h2 {
  color: var(--text);
  margin: 6px 0 0;
  font-size: 25px;
}

.queue-control-head small {
  color: var(--muted);
}

.queue-control-accounts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.queue-account-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(193, 118, 255, 0.28);
  background: rgba(193, 118, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
}

.queue-account-pill input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.queue-account-pill span {
  color: var(--text);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-account-pill strong {
  color: var(--accent);
  margin-left: auto;
}

.queue-control-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.queue-item.is-paused {
  opacity: 0.62;
}

/* Navegacao e areas da aplicacao */
.app-shell {
  grid-template-columns: 248px minmax(0, 1fr);
}

.app-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  background: #07080c;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.app-nav .brand {
  padding: 0 6px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-nav .brand-mark {
  flex: 0 0 auto;
  background: #141824;
  border-color: rgba(120, 155, 255, 0.46);
  box-shadow: none;
}

.app-nav .brand p {
  margin-top: 4px;
  font-size: 12px;
}

.nav-create {
  width: 100%;
  min-height: 46px;
  color: #08101d;
  background: #edf2ff;
  border-color: #edf2ff;
  font-weight: 850;
}

.nav-create:hover {
  color: #08101d;
  background: #dce7ff;
  border-color: #dce7ff;
}

.nav-create span {
  margin-right: 6px;
}

.app-nav-list {
  display: grid;
  gap: 7px;
}

.app-nav-item {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  text-align: left;
  color: #aeb5c7;
  background: transparent;
  border-color: transparent;
  font-weight: 750;
}

.app-nav-item:hover {
  color: #f7f9ff;
  background: #10131b;
  border-color: rgba(255, 255, 255, 0.08);
}

.app-nav-item.is-active {
  color: #f7f9ff;
  background: #171c2a;
  border-color: rgba(117, 151, 255, 0.48);
  box-shadow: inset 3px 0 0 #7597ff;
}

.nav-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
}

.nav-count {
  min-width: 25px;
  padding: 3px 7px;
  text-align: center;
  color: #dfe6ff;
  background: #242c42;
  border-radius: 999px;
  font-size: 11px;
}

.nav-status {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  background: #0d1118;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.nav-status > span {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #43d68f;
  box-shadow: 0 0 0 4px rgba(67, 214, 143, 0.12);
}

.nav-status strong,
.nav-status small {
  display: block;
}

.nav-status strong {
  color: #f4f6fb;
  font-size: 13px;
}

.nav-status small {
  margin-top: 2px;
  color: #838b9f;
  font-size: 11px;
}

.workspace {
  min-width: 0;
  padding: 26px 30px 40px;
}

.topbar {
  min-height: 74px;
  padding-bottom: 18px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.page-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: #7597ff;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-page {
  min-width: 0;
}

.app-page[hidden] {
  display: none !important;
}

.campaign-columns {
  display: grid;
  grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.campaign-setup,
.campaign-scheduler,
#accountsContent,
#queuesContent {
  display: grid;
  gap: 16px;
}

.campaign-setup {
  position: sticky;
  top: 20px;
}

.campaign-setup .panel,
#accountsContent .panel {
  margin: 0;
  background: #0d0f15;
  box-shadow: none;
}

.campaign-setup .drop-zone {
  color: var(--text);
  background: #090b10;
  border-color: rgba(117, 151, 255, 0.42);
}

.campaign-scheduler .schedule-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.campaign-scheduler .schedule-controls > .primary {
  grid-column: 1 / -1;
}

#accountsContent .panel {
  width: 100%;
}

#accountsContent .account-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 20px;
}

.account-group-section {
  display: grid;
  gap: 12px;
}

.account-group-head {
  min-height: 84px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #0c0c0e;
  border: 1px solid rgba(124, 242, 79, 0.3);
  border-radius: 12px;
}

.account-group-head > div:first-child > span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.account-group-head h3 {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 25px;
}

.account-group-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.account-group-summary span {
  padding: 7px 10px;
  color: var(--muted);
  background: #060806;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.account-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 320px));
  gap: 12px;
  justify-content: start;
}

#accountsContent .account-item.account-card {
  min-height: 260px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  background: #0c0c0e;
  border-color: var(--line);
  border-radius: 12px;
}

.account-card-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.account-health-badge {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #d8e2e8;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
}

.account-health-badge i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #93a0a8;
}

.account-health-badge.health-ready i { background: #7cf24f; box-shadow: 0 0 10px rgba(124, 242, 79, 0.55); }
.account-health-badge.health-restricted i,
.account-health-badge.health-disconnected i,
.account-health-badge.health-no_token i { background: #ff667f; }
.account-health-badge.health-warning i,
.account-health-badge.health-permission_missing i { background: #f1bd55; }
.account-health-badge.health-checking i,
.account-health-badge.health-pending i { background: #65b7ff; }

.account-health-detail {
  min-height: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

#accountsContent .account-health-detail span {
  color: #9fafb8;
  font-size: 11px;
}

#accountsContent .account-card.health-restricted,
#accountsContent .account-card.health-disconnected,
#accountsContent .account-card.health-no_token {
  border-color: rgba(255, 102, 127, 0.65);
}

#accountsContent .account-card.health-warning,
#accountsContent .account-card.health-permission_missing {
  border-color: rgba(241, 189, 85, 0.65);
}

.account-group-summary .has-attention {
  color: #ffd0d7;
  border-color: rgba(255, 102, 127, 0.45);
}

.campaign-account-item .account-health-text.health-ready { color: #9af377; }
.campaign-account-item .account-health-text.health-restricted,
.campaign-account-item .account-health-text.health-disconnected,
.campaign-account-item .account-health-text.health-no_token { color: #ff899b; }
.campaign-account-item .account-health-text.health-warning,
.campaign-account-item .account-health-text.health-permission_missing { color: #f1c873; }

.account-card-select label {
  min-height: 34px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  background: #060806;
  border: 1px solid rgba(124, 242, 79, 0.25);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.account-card-select input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.account-card-select span {
  color: var(--muted);
  font-size: 12px;
}

.account-card-profile {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

#accountsContent .account-card-profile .account-avatar,
#accountsContent .account-card-profile .account-avatar-wrap {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.account-card-profile > div {
  min-width: 0;
}

#accountsContent .account-card-profile strong {
  overflow: visible;
  color: var(--text);
  text-overflow: clip;
  white-space: normal;
}

.account-card-profile span {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.account-type-editor {
  display: grid;
  gap: 7px;
}

.account-type-editor > label {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.account-type-editor > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.account-type-editor input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  border-radius: 8px 0 0 8px;
}

.account-type-editor .account-type-save,
.account-type-editor .account-type-save:hover {
  min-height: 38px;
  color: #071006;
  background: var(--accent);
  border-color: var(--accent);
  border-radius: 0 8px 8px 0;
  font-weight: 850;
}

.account-card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

.account-card-actions button {
  width: auto;
  min-width: 38px;
}

#accountsContent .account-card:has([data-account-check]:checked) {
  border-color: rgba(124, 242, 79, 0.42);
}

.page-intro,
.dashboard-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px;
  color: var(--text);
  background: #0d1017;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.page-intro {
  margin-bottom: 18px;
}

.page-intro h2,
.page-intro p,
.dashboard-hero h2,
.dashboard-hero p {
  margin: 0;
}

.page-intro h2,
.dashboard-hero h2 {
  font-size: clamp(24px, 3vw, 36px);
}

.page-intro p,
.dashboard-hero p {
  margin-top: 7px;
  color: var(--muted);
}

.overview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.overview-stats article,
.settings-tile {
  padding: 20px;
  background: #0d0f15;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.overview-stats span,
.overview-stats small,
.settings-tile > span,
.settings-tile p {
  color: var(--muted);
}

.overview-stats strong {
  display: block;
  margin: 9px 0 4px;
  color: var(--text);
  font-size: 34px;
}

.overview-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.overview-actions button {
  min-height: 92px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  background: #11151e;
}

.overview-actions button span {
  margin-bottom: 7px;
  color: #7597ff;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

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

.settings-tile h3 {
  margin: 7px 0 8px;
}

.settings-tile p {
  min-height: 44px;
  margin: 0 0 18px;
  line-height: 1.5;
}

.settings-actions {
  display: flex;
  gap: 8px;
}

#storiesPage .stories-workspace,
#queuesContent .queue-control,
#queuesContent .queue-layout {
  margin: 0;
}

#queuesContent {
  gap: 18px;
}

@media (max-width: 1180px) {
  .campaign-columns {
    grid-template-columns: 1fr;
  }

  .campaign-setup {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .campaign-setup #captionsPanel {
    grid-column: 1 / -1;
  }

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

@media (min-width: 1540px) {
  .campaign-scheduler .schedule-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .app-nav {
    position: fixed;
    z-index: 30;
    inset: auto 0 0;
    width: 100%;
    height: 68px;
    padding: 8px 10px;
    display: block;
    overflow: visible;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-right: 0;
  }

  .app-nav .brand,
  .nav-create,
  .nav-status {
    display: none;
  }

  .app-nav-list {
    height: 100%;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
  }

  .app-nav-item {
    min-height: 52px;
    padding: 5px 2px;
    grid-template-columns: 1fr;
    grid-template-rows: 24px 16px;
    gap: 2px;
    justify-items: center;
    text-align: center;
    font-size: 10px;
  }

  .app-nav-item.is-active {
    box-shadow: inset 0 2px 0 #7597ff;
  }

  .nav-icon {
    width: 23px;
    height: 23px;
  }

  .nav-count {
    display: none;
  }

  .workspace {
    padding: 18px 14px 30px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .campaign-setup,
  .overview-stats,
  .overview-actions {
    grid-template-columns: 1fr;
  }

  .campaign-scheduler .schedule-controls {
    grid-template-columns: 1fr;
  }

  .campaign-scheduler .schedule-controls > .primary {
    grid-column: auto;
  }

  .campaign-setup #captionsPanel {
    grid-column: auto;
  }

  .dashboard-hero,
  .page-intro {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .app-nav-item:nth-child(1) {
    display: none;
  }

  .app-nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .topbar h2 {
    font-size: 26px;
  }

  .actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.campaign-account-picker {
  padding: 18px;
  color: var(--text);
  background: #0d0f15;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.campaign-account-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.campaign-account-head h2,
.campaign-account-head p {
  margin: 0;
}

.campaign-account-head h2 {
  font-size: 20px;
}

.campaign-account-head p {
  margin-top: 5px;
  color: var(--muted);
}

.campaign-account-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.select-all-accounts {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.select-all-accounts input {
  width: 16px;
  height: 16px;
}

.select-all-accounts span {
  margin: 0;
  color: var(--text);
}

.campaign-account-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.campaign-account-group {
  display: grid;
  gap: 9px;
}

.campaign-account-group-head {
  min-height: 58px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #0c0c0e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.campaign-account-group-head label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.campaign-account-group-head input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: 0;
}

.campaign-account-group-head label > span,
.campaign-account-group-head strong,
.campaign-account-group-head small {
  display: block;
}

.campaign-account-group-head strong {
  color: var(--text);
  font-size: 14px;
}

.campaign-account-group-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.campaign-group-count {
  flex: 0 0 auto;
  padding: 6px 9px;
  color: var(--accent);
  background: rgba(124, 242, 79, 0.08);
  border: 1px solid rgba(124, 242, 79, 0.24);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.campaign-account-group-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 9px;
}

.campaign-account-item {
  min-width: 0;
  min-height: 66px;
  display: grid;
  grid-template-columns: 18px 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: #090b10;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
}

.campaign-account-item.is-selected {
  background: #131927;
  border-color: rgba(117, 151, 255, 0.55);
}

.campaign-account-item input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.campaign-account-item .account-avatar,
.campaign-account-item .account-avatar-wrap {
  width: 38px;
  height: 38px;
}

.campaign-account-item > span:last-child {
  min-width: 0;
}

.campaign-account-item strong,
.campaign-account-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-account-item strong {
  color: var(--text);
}

.campaign-account-item small {
  margin-top: 3px;
  color: var(--muted);
}

.campaign-accounts-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #090b10;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.campaign-accounts-empty span {
  margin-right: auto;
  color: var(--muted);
}

@media (max-width: 820px) {
  .campaign-account-head,
  .campaign-accounts-empty,
  .campaign-account-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .campaign-account-group-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.status-badge {
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 800;
}

.status-publicado {
  color: #adf7cf;
  border-color: rgba(84, 214, 132, 0.52);
  background: rgba(84, 214, 132, 0.14);
}

.status-publicando {
  color: #ffe3a3;
  border-color: rgba(255, 196, 87, 0.5);
  background: rgba(255, 196, 87, 0.13);
}

.status-falhou {
  color: #ffb7b7;
  border-color: rgba(255, 91, 91, 0.52);
  background: rgba(255, 91, 91, 0.13);
}

.thumb span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  padding: 6px;
  text-align: center;
}

.phone {
  border-color: rgba(255, 255, 255, 0.18);
  background:
    radial-gradient(circle at 30% 20%, rgba(193, 118, 255, 0.18), transparent 30%),
    linear-gradient(160deg, #15151a, #020203 62%, #101421);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.phone::before,
.phone::after {
  background: rgba(255, 255, 255, 0.26);
}

.preview-text,
.phone .preview-text {
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.toast,
.status-toast {
  color: var(--text);
  background: #08090d;
  border: 1px solid var(--line-strong);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.42);
}

.danger,
button.danger {
  color: #ffe9eb;
  background: rgba(255, 93, 104, 0.12);
  border-color: rgba(255, 93, 104, 0.32);
}

.danger:hover,
button.danger:hover {
  background: rgba(255, 93, 104, 0.2);
}

.modal-backdrop {
  background: rgba(0, 0, 0, 0.72);
}

/* Paleta Raven: preto profundo, grafite e verde eletrico */
:root {
  --bg: #020303;
  --panel: #0b0d0c;
  --panel-strong: #111412;
  --panel-soft: #070908;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(124, 242, 79, 0.58);
  --text: #f5f7f5;
  --ink: #f5f7f5;
  --muted: #999d9a;
  --accent: #7cf24f;
  --accent-dark: #55c934;
  --accent-soft: rgba(124, 242, 79, 0.14);
  --teal: #7cf24f;
  --amber: #b4c927;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.52);
}

html {
  scrollbar-color: var(--accent) #080a08;
}

body {
  background:
    radial-gradient(circle at 20% 12%, rgba(124, 242, 79, 0.07), transparent 28%),
    linear-gradient(135deg, #010202 0%, #050706 52%, #010201 100%);
}

.app-shell {
  background: rgba(2, 3, 3, 0.98);
}

.app-nav,
.sidebar {
  background: #0c0c0e;
  border-color: rgba(255, 255, 255, 0.08);
}

.app-nav .brand-mark,
.brand-mark {
  color: var(--accent);
  background: linear-gradient(145deg, #0e1510, #071009);
  border-color: rgba(124, 242, 79, 0.46);
  box-shadow: 0 0 26px rgba(124, 242, 79, 0.12);
}

.nav-create,
button.primary,
.primary,
.generate-btn,
.actions button:first-child {
  color: #071006;
  background: linear-gradient(135deg, #8af65f, #70e847);
  border-color: #7cf24f;
  box-shadow: 0 10px 28px rgba(124, 242, 79, 0.2);
}

.nav-create:hover,
button.primary:hover,
.primary:hover,
.generate-btn:hover,
.actions button:first-child:hover {
  color: #071006;
  background: linear-gradient(135deg, #9aff71, #7cf24f);
  border-color: #9aff71;
}

.actions button:first-child,
.actions button:first-child:hover {
  box-shadow: none;
}

.app-nav-item {
  color: #a8ada9;
}

.app-nav-item:hover {
  color: #f5f7f5;
  background: #0d120e;
  border-color: rgba(124, 242, 79, 0.16);
}

.app-nav-item.is-active {
  color: var(--accent);
  background: rgba(124, 242, 79, 0.08);
  border-color: rgba(124, 242, 79, 0.22);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-count {
  color: #dfffd4;
  background: rgba(124, 242, 79, 0.17);
}

.nav-status {
  background: #09100b;
  border-color: rgba(124, 242, 79, 0.16);
}

.nav-status > span {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 242, 79, 0.12);
}

.page-eyebrow,
.overview-actions button span {
  color: var(--accent);
}

.topbar,
.schedule-controls,
.stats > div,
.stories-main,
.story-editor-card,
.story-summary-card,
.story-accounts-card,
.connect-box,
.preview,
.queue-panel,
.empty-queue,
.modal-card,
.account-item,
.queue-item,
.caption-box,
.files-panel,
.video-list,
.settings-card,
.campaign-setup .panel,
#accountsContent .panel,
.campaign-account-picker,
.overview-stats article,
.settings-tile {
  background: #0c0c0e;
  border-color: var(--line);
}

.topbar {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stats > *:first-child,
.stories-main,
.queue-panel,
.preview,
.queue-control {
  background: #0c0c0e;
}

.page-intro,
.dashboard-hero {
  background: #0c0c0e;
}

button,
.button,
input,
select,
textarea {
  background: #363636;
  border-color: rgba(255, 255, 255, 0.12);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 242, 79, 0.14);
}

button:hover,
.button:hover {
  border-color: var(--line-strong);
  background: #363636;
}

.preset button,
.tab-button,
.chip,
.pill,
.badge,
.needs-reconnect,
.queue-account-pill {
  background: rgba(124, 242, 79, 0.08);
  border-color: rgba(124, 242, 79, 0.24);
}

.preset button.active,
.tab-button.active,
.chip.active,
.pill.active,
.badge.active {
  color: #071006;
  background: var(--accent);
  border-color: var(--accent);
}

.account-item.is-selected,
.queue-item:hover,
.drop-zone:hover,
.drop-zone.is-dragging,
.campaign-account-item.is-selected {
  border-color: var(--line-strong);
  background: #0c0c0e;
}

.campaign-setup .drop-zone,
.campaign-account-item,
.campaign-accounts-empty {
  background: #060806;
  border-color: rgba(124, 242, 79, 0.3);
}

.campaign-setup .drop-zone {
  background: #363636;
}

.campaign-account-item {
  background: #363636;
  border-color: rgba(255, 255, 255, 0.12);
}

.campaign-account-item.is-selected {
  background: #363636;
  border-color: var(--accent);
}

.overview-actions button {
  background: #0c0c0e;
}

.phone {
  background:
    radial-gradient(circle at 30% 20%, rgba(124, 242, 79, 0.14), transparent 30%),
    linear-gradient(160deg, #111612, #020302 62%, #0b120c);
}

.toast,
.status-toast {
  background: #070a08;
}

@media (max-width: 820px) {
  .app-nav-item.is-active {
    box-shadow: inset 0 2px 0 var(--accent);
  }
}

/* Selecao e troca de grupo em massa na aba Contas. */
.account-group-tools {
  min-width: min(720px, 70%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.account-group-select-all {
  min-height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  background: rgba(214, 174, 85, 0.08);
  border: 1px solid rgba(214, 174, 85, 0.28);
  border-radius: 9px;
  cursor: pointer;
}

.account-group-select-all input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.account-group-select-all span {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.account-group-bulk-editor {
  width: min(360px, 100%);
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
}

.account-group-bulk-editor input {
  height: 40px;
  border-radius: 8px 0 0 8px;
}

.account-group-bulk-editor button,
.account-group-bulk-editor button:hover {
  min-height: 40px;
  padding: 0 12px;
  color: #17130a;
  background: var(--accent);
  border-color: var(--accent);
  border-radius: 0 8px 8px 0;
  font-weight: 850;
}

@media (max-width: 1200px) {
  .account-group-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-group-tools {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .account-group-select-all,
  .account-group-bulk-editor {
    width: 100%;
  }
}

/* Cartoes da aba Contas com o mesmo azul-grafite usado na Campanha. */
#accountsContent .account-item.account-card,
#accountsContent .account-card:has([data-account-check]:checked) {
  background: #26343d;
}

#accountsContent .account-card:has([data-account-check]:checked) {
  border-color: var(--accent);
}

/* Contornos dos itens da barra lateral no tema Murphy. */
.app-nav-item {
  background: rgba(13, 23, 31, 0.72);
  border: 1px solid rgba(214, 174, 85, 0.18);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.app-nav-item:hover {
  background: rgba(214, 174, 85, 0.08);
  border-color: rgba(214, 174, 85, 0.38);
}

.app-nav-item.is-active {
  border-color: rgba(214, 174, 85, 0.72);
  box-shadow: inset 3px 0 0 var(--accent), 0 0 20px rgba(214, 174, 85, 0.1);
}

@media (max-width: 600px) {
  .account-group-grid {
    grid-template-columns: 1fr;
  }

  .account-group-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-group-summary {
    justify-content: flex-start;
  }
}

/* Login e cadastro */
.auth-screen {
  position: relative;
  min-height: 100vh;
  padding: 32px 18px;
  display: grid;
  place-items: center;
  overflow: hidden auto;
  background:
    radial-gradient(circle at 50% 45%, rgba(124, 242, 79, 0.08), transparent 28%),
    #020303;
}

.auth-orb {
  position: fixed;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: rotate(45deg);
  pointer-events: none;
}

.auth-orb-one {
  top: -250px;
  left: -190px;
}

.auth-orb-two {
  right: -230px;
  bottom: -250px;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  padding: 36px;
  color: var(--text);
  background: #0c0c0e;
  border: 1px solid rgba(124, 242, 79, 0.28);
  border-radius: 20px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.52);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 28px;
}

.auth-brand .brand-mark {
  width: 54px;
  height: 54px;
}

.auth-brand strong,
.auth-brand small {
  display: block;
}

.auth-brand strong {
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.auth-brand small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-form {
  display: grid;
  gap: 17px;
}

.auth-heading {
  margin-bottom: 2px;
}

.auth-heading span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-heading h1 {
  margin: 7px 0 6px;
  font-size: clamp(32px, 6vw, 46px);
  line-height: 1.05;
}

.auth-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.auth-form > label {
  display: grid;
  gap: 7px;
}

.auth-form > label > span {
  color: #daddda;
  font-size: 13px;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  color: var(--text);
  background: #171719;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
}

.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 242, 79, 0.13);
}

.auth-submit,
.auth-submit:hover {
  min-height: 50px;
  color: #071006;
  background: linear-gradient(135deg, #8af65f, #70e847);
  border-color: var(--accent);
  border-radius: 10px;
  box-shadow: none;
  font-weight: 900;
}

.auth-switch {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.auth-switch button,
.auth-switch button:hover {
  min-height: auto;
  padding: 0;
  color: var(--accent);
  background: transparent;
  border: 0;
  font-weight: 850;
  text-decoration: underline;
}

.auth-message {
  margin-top: 17px;
  padding: 11px 12px;
  color: #ffd6d9;
  background: rgba(255, 93, 104, 0.1);
  border: 1px solid rgba(255, 93, 104, 0.3);
  border-radius: 9px;
  font-size: 13px;
}

.auth-message.is-success {
  color: #dfffd4;
  background: rgba(124, 242, 79, 0.1);
  border-color: rgba(124, 242, 79, 0.3);
}

.auth-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-top: 20px;
  font-size: 12px;
}

.auth-legal a {
  color: var(--muted);
}

.auth-legal a:hover {
  color: var(--accent);
}

.admin-users-content {
  display: grid;
  gap: 12px;
}

.admin-user-card {
  padding: 17px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  background: #0c0c0e;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.admin-user-card.status-pending {
  border-color: rgba(255, 196, 87, 0.42);
}

.admin-user-card.status-approved {
  border-color: rgba(124, 242, 79, 0.28);
}

.admin-user-card.status-rejected {
  border-color: rgba(255, 93, 104, 0.35);
}

.admin-user-main,
.admin-user-stats,
.admin-user-actions,
.admin-account-row {
  display: flex;
  align-items: center;
}

.admin-user-main {
  gap: 12px;
  min-width: 0;
}

.admin-user-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #071006;
  background: var(--accent);
  border-radius: 50%;
  font-weight: 900;
}

.admin-user-identity {
  min-width: 0;
}

.admin-user-identity > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-user-identity strong,
.admin-user-identity > span,
.admin-user-identity small {
  display: block;
}

.admin-user-identity > span,
.admin-user-identity small {
  margin-top: 3px;
  color: var(--muted);
}

.admin-status,
.owner-badge {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
}

.status-pending .admin-status {
  color: #ffe3a3;
  border-color: rgba(255, 196, 87, 0.45);
}

.status-approved .admin-status,
.owner-badge {
  color: var(--accent);
  border-color: rgba(124, 242, 79, 0.35);
}

.status-rejected .admin-status {
  color: #ffb7b7;
  border-color: rgba(255, 93, 104, 0.4);
}

.admin-user-stats {
  gap: 7px;
}

.admin-user-stats > span {
  min-width: 68px;
  padding: 8px;
  color: var(--muted);
  background: #171719;
  border-radius: 8px;
  text-align: center;
  font-size: 11px;
}

.admin-user-stats strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 16px;
}

.admin-user-actions {
  gap: 7px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.admin-user-actions button {
  min-height: 36px;
}

.admin-user-actions .admin-approve,
.admin-user-actions .admin-approve:hover {
  color: #071006;
  background: var(--accent);
  border-color: var(--accent);
}

.admin-user-actions .admin-reject,
.admin-user-actions .admin-reject:hover {
  color: #ffd6d9;
  background: rgba(255, 93, 104, 0.12);
  border-color: rgba(255, 93, 104, 0.35);
}

.admin-user-accounts {
  grid-column: 1 / -1;
  padding-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  border-top: 1px solid var(--line);
}

.admin-user-accounts[hidden] {
  display: none;
}

.admin-account-row {
  gap: 9px;
  padding: 10px;
  background: #171719;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.admin-account-row .account-avatar,
.admin-account-row .account-avatar-wrap {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

.admin-account-row strong,
.admin-account-row span {
  display: block;
}

.admin-account-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.nav-user {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 11px;
  background: #0c0c0e;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.nav-user-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #071006;
  background: var(--accent);
  border-radius: 50%;
  font-weight: 900;
}

.nav-user strong,
.nav-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-user strong {
  color: var(--text);
  font-size: 12px;
}

.nav-user small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.nav-user button,
.nav-user button:hover {
  min-height: 32px;
  padding: 0 9px;
  color: var(--accent);
  background: transparent;
  border-color: rgba(124, 242, 79, 0.3);
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 600px) {
  .auth-card {
    padding: 26px 20px;
    border-radius: 16px;
  }

  .auth-heading h1 {
    font-size: 34px;
  }

  .admin-user-card {
    grid-template-columns: 1fr;
  }

  .admin-user-actions {
    justify-content: flex-start;
  }
}

/* Tema experimental Murphy: azul-grafite, dourado e ciano.
   A paleta Raven verde permanece acima para permitir restauracao imediata. */
:root {
  --bg: #0d141b;
  --panel: #18222b;
  --panel-strong: #202d37;
  --panel-soft: #121b23;
  --line: rgba(214, 174, 85, 0.22);
  --line-strong: rgba(214, 174, 85, 0.72);
  --text: #f7f5ee;
  --ink: #f7f5ee;
  --muted: #a8b0b6;
  --accent: #d6ae55;
  --accent-dark: #b9882d;
  --accent-soft: rgba(214, 174, 85, 0.16);
  --teal: #35d4d8;
  --amber: #e0ba63;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

html {
  scrollbar-color: var(--accent) #111a21;
}

body {
  background:
    radial-gradient(circle at 18% 12%, rgba(214, 174, 85, 0.1), transparent 28%),
    radial-gradient(circle at 82% 78%, rgba(53, 212, 216, 0.055), transparent 30%),
    linear-gradient(135deg, #0b1218 0%, #111a22 52%, #0c141a 100%);
}

.app-shell {
  background: rgba(13, 20, 27, 0.96);
}

.app-nav,
.sidebar {
  background: #18232c;
  border-color: rgba(214, 174, 85, 0.16);
}

.app-nav .brand-mark,
.brand-mark {
  color: var(--accent);
  background: linear-gradient(145deg, #26333c, #121b22);
  border-color: rgba(214, 174, 85, 0.5);
  box-shadow: 0 0 26px rgba(214, 174, 85, 0.13);
}

.nav-create,
button.primary,
.primary,
.generate-btn,
.actions button:first-child,
.auth-submit,
.auth-submit:hover {
  color: #17130a;
  background: linear-gradient(135deg, #e7c66f, #c79538);
  border-color: #d6ae55;
  box-shadow: 0 10px 28px rgba(214, 174, 85, 0.2);
}

.nav-create:hover,
button.primary:hover,
.primary:hover,
.generate-btn:hover,
.actions button:first-child:hover {
  color: #17130a;
  background: linear-gradient(135deg, #f1d581, #d6ae55);
  border-color: #e7c66f;
}

.actions button:first-child,
.actions button:first-child:hover {
  box-shadow: none;
}

.app-nav-item {
  color: #bdc2c4;
}

.app-nav-item:hover {
  color: var(--text);
  background: rgba(214, 174, 85, 0.07);
  border-color: rgba(214, 174, 85, 0.2);
}

.app-nav-item.is-active {
  color: #efd078;
  background: linear-gradient(90deg, rgba(214, 174, 85, 0.18), rgba(214, 174, 85, 0.07));
  border-color: rgba(214, 174, 85, 0.56);
  box-shadow: inset 3px 0 0 var(--accent), 0 0 22px rgba(214, 174, 85, 0.09);
}

.nav-count {
  color: #f8dfa0;
  background: rgba(214, 174, 85, 0.18);
}

.nav-status {
  background: rgba(53, 212, 216, 0.055);
  border-color: rgba(53, 212, 216, 0.22);
}

.nav-status > span {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(53, 212, 216, 0.12), 0 0 18px rgba(53, 212, 216, 0.34);
}

.topbar,
.schedule-controls,
.stats > div,
.stories-main,
.story-editor-card,
.story-summary-card,
.story-accounts-card,
.connect-box,
.preview,
.queue-panel,
.empty-queue,
.modal-card,
.account-item,
.queue-item,
.caption-box,
.files-panel,
.video-list,
.settings-card,
.campaign-setup .panel,
#accountsContent .panel,
.campaign-account-picker,
.overview-stats article,
.settings-tile,
.page-intro,
.dashboard-hero,
.queue-control,
.account-group-head,
.account-card,
.admin-user-card,
.nav-user {
  background: #18222b;
  border-color: var(--line);
}

.stats > *:first-child,
.stories-main,
.queue-panel,
.preview,
.queue-control {
  background: #1b2730;
}

button,
.button,
input,
select,
textarea,
.repeat-media-row > span {
  background: #293640;
  border-color: rgba(255, 255, 255, 0.13);
}

button:hover,
.button:hover {
  background: #303f49;
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus,
.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(214, 174, 85, 0.15);
}

.preset button,
.tab-button,
.chip,
.pill,
.badge,
.needs-reconnect,
.queue-account-pill {
  background: rgba(214, 174, 85, 0.09);
  border-color: rgba(214, 174, 85, 0.26);
}

.preset button.active,
.tab-button.active,
.chip.active,
.pill.active,
.badge.active {
  color: #17130a;
  background: var(--accent);
  border-color: var(--accent);
}

.account-item.is-selected,
.queue-item:hover,
.drop-zone:hover,
.drop-zone.is-dragging,
.campaign-account-item.is-selected {
  border-color: var(--line-strong);
  background: #202d37;
}

.campaign-setup .drop-zone,
.campaign-account-item,
.campaign-accounts-empty {
  background: #202c35;
  border-color: rgba(214, 174, 85, 0.27);
}

.campaign-account-item {
  border-color: rgba(255, 255, 255, 0.12);
}

.campaign-account-item.is-selected {
  background: #26343d;
  border-color: var(--accent);
}

.phone {
  background:
    radial-gradient(circle at 30% 20%, rgba(53, 212, 216, 0.12), transparent 30%),
    linear-gradient(160deg, #24323b, #101820 62%, #19252d);
}

.toast,
.status-toast {
  background: #121b22;
  border-color: rgba(53, 212, 216, 0.3);
}

.auth-screen {
  background:
    radial-gradient(circle at 50% 45%, rgba(214, 174, 85, 0.09), transparent 28%),
    #0b1218;
}

.auth-card {
  background: #18232c;
  border-color: rgba(214, 174, 85, 0.35);
}

.auth-form input,
.admin-user-stats > span,
.admin-account-row {
  background: #25323c;
}

.auth-message.is-success {
  color: #c8fbfc;
  background: rgba(53, 212, 216, 0.09);
  border-color: rgba(53, 212, 216, 0.3);
}

.admin-user-card.status-approved,
.status-approved .admin-status,
.owner-badge,
.nav-user button,
.nav-user button:hover {
  border-color: rgba(214, 174, 85, 0.36);
}

.admin-user-avatar,
.nav-user-avatar,
.admin-user-actions .admin-approve,
.admin-user-actions .admin-approve:hover {
  color: #17130a;
  background: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 820px) {
  .app-nav-item.is-active {
    box-shadow: inset 0 2px 0 var(--accent);
  }
}
