/* Paleta oficial da família Monitoria Jurídica (src/theme.ts) */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f3ef;
  --border: #e8e4de;
  --text: #2e2e2e;
  --text-dim: #7a7470;
  --accent: #38bdf8;
  --accent-dim: #0ea5e9;
  --accent-bg: rgba(56, 189, 248, 0.08);
  --ok: #4caf50;
  --ok-bg: rgba(76, 175, 80, 0.08);
  --err: #e57373;
  --err-bg: rgba(229, 115, 115, 0.07);
  --header-bg: #3a3a3a;
  --header-text: #ffffff;
  --header-text-dim: rgba(255, 255, 255, 0.7);
  --radius: 12px;
  color-scheme: light;
}

/* Escuro é opcional — só entra quando o usuário alterna manualmente (js/app.js),
   nunca por preferência automática do sistema, pra não confundir com a marca (só clara). */
:root[data-theme="dark"] {
  --bg: #201e1c;
  --surface: #2b2825;
  --surface-2: #252220;
  --border: #3d3936;
  --text: #f0ece6;
  --text-dim: #b5afa8;
  --accent: #38bdf8;
  --accent-dim: #0ea5e9;
  --accent-bg: rgba(56, 189, 248, 0.14);
  --ok: #66bb6a;
  --ok-bg: rgba(102, 187, 106, 0.12);
  --err: #ef9a9a;
  --err-bg: rgba(239, 154, 154, 0.12);
  --header-bg: #1c1a19;
  --header-text: #f0ece6;
  --header-text-dim: rgba(240, 236, 230, 0.65);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  padding: 2rem 1.5rem 1.25rem;
  text-align: center;
  position: relative;
  background: var(--header-bg);
  border-bottom: 2px solid var(--accent);
}

.app-header h1 {
  margin: 0 auto 0.25rem;
  font-size: 1.75rem;
  color: var(--header-text);
  font-weight: 700;
}

.app-logo {
  width: 100%;
  max-width: 220px;
}

.app-logo svg {
  display: block;
  width: 100%;
  height: auto;
}

.subtitle {
  margin: 0;
  color: var(--header-text-dim);
  font-size: 0.95rem;
}

.app-header .btn-ghost {
  color: var(--header-text);
  border-color: rgba(255, 255, 255, 0.3);
}

.header-actions {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.1rem;
  padding: 0.4rem 0.6rem;
}

.app-main {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface);
}

.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--surface-2);
}

.drop-zone p {
  margin: 0.25rem 0;
}

.drop-actions {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin: 0.9rem 0;
  flex-wrap: wrap;
}

.drop-hint {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.queue-section,
.results-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.queue-header h2,
.results-section h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 700;
}

.queue-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
  transition: filter 0.1s;
}

.btn:hover {
  filter: brightness(1.1);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.btn-secondary {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.btn-ghost {
  background: transparent;
}

.queue-list,
.results-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.queue-item,
.result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.item-icon {
  font-size: 1.2rem;
}

.item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.item-status {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.item-status.ok {
  color: var(--ok);
}

.item-status.err {
  color: var(--err);
}

.item-remove {
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

.item-remove:hover {
  color: var(--err);
  background: var(--err-bg);
}

.result-item {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.result-item-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.result-item-header .item-name {
  font-weight: 600;
}

.result-actions {
  display: flex;
  gap: 0.4rem;
}

.result-preview {
  display: none;
  max-height: 260px;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.result-preview.open {
  display: block;
}

.hidden {
  display: none !important;
}

.app-footer {
  text-align: center;
  padding: 1rem;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.install-guide-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 100;
}

.install-guide-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.install-guide-header {
  margin-bottom: 0.75rem;
}

.install-guide-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

.install-guide-header p {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.install-step {
  display: flex;
  gap: 0.9rem;
  padding: 0.6rem 0;
}

.install-step-icon {
  position: relative;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.install-step-num {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: #ffffff;
  border: 2px solid var(--surface);
}

.install-step-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  justify-content: center;
}

.install-step-body strong {
  font-size: 0.95rem;
  color: var(--text);
}

.install-step-body p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.install-step-tag {
  align-self: flex-start;
  border: 1px solid;
  border-radius: 8px;
  padding: 0.15rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.install-guide-note {
  display: flex;
  gap: 0.5rem;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 0.75rem;
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.install-guide-close {
  width: 100%;
  margin-top: 1rem;
}
