/* Spec Studio — identidade visual Spec: #222222 · #00F28A · branco · Ubuntu */
@font-face { font-family: "Ubuntu"; font-weight: 400; font-display: swap; src: url(fontes/ubuntu-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Ubuntu"; font-weight: 500; font-display: swap; src: url(fontes/ubuntu-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Ubuntu"; font-weight: 700; font-display: swap; src: url(fontes/ubuntu-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Ubuntu"; font-weight: 400; font-display: swap; src: url(fontes/ubuntu-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Ubuntu"; font-weight: 500; font-display: swap; src: url(fontes/ubuntu-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Ubuntu"; font-weight: 700; font-display: swap; src: url(fontes/ubuntu-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --verde: #00f28a;
  --preto: #222222;
  --branco: #ffffff;
  --cinza: #cfd2d3;

  /* tema escuro (padrão) */
  --bg: #1a1a1a;
  --surface: #222222;
  --surface-2: #2a2a2a;
  --surface-3: #333333;
  --border: #383838;
  --text: #ffffff;
  --text-2: #cfd2d3;
  --muted: #9a9e9f;
  --accent: var(--verde);
  --accent-ink: var(--verde);      /* verde usado em texto */
  --on-accent: #222222;
  --accent-soft: rgba(0, 242, 138, 0.12);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.12);
  --warn: #f5c84b;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --radius-sm: 9px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f5f5;
  --surface: #ffffff;
  --surface-2: #f4f5f5;
  --surface-3: #e9ebeb;
  --border: #dfe2e3;
  --text: #222222;
  --text-2: #3d4142;
  --muted: #6b7071;
  --accent-ink: #008a4e;            /* verde escurecido p/ contraste em fundo branco */
  --accent-soft: rgba(0, 242, 138, 0.16);
  --danger: #d63c3c;
  --danger-soft: rgba(214, 60, 60, 0.1);
  --warn: #9a6a00;
  --shadow: 0 10px 30px rgba(34, 34, 34, 0.08);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f5f5; --surface: #ffffff; --surface-2: #f4f5f5; --surface-3: #e9ebeb; --border: #dfe2e3;
    --text: #222222; --text-2: #3d4142; --muted: #6b7071; --accent-ink: #008a4e;
    --accent-soft: rgba(0, 242, 138, 0.16); --danger: #d63c3c; --danger-soft: rgba(214, 60, 60, 0.1);
    --warn: #9a6a00; --shadow: 0 10px 30px rgba(34, 34, 34, 0.08); color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
#raiz { min-height: 100vh; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 "Ubuntu", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 700; margin: 0; line-height: 1.2; }
h1 { font-size: 28px; letter-spacing: 0.01em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* logos alternam com o tema */
.logo-claro { display: none; }
:root[data-theme="light"] .logo-escuro { display: none; }
:root[data-theme="light"] .logo-claro { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .logo-escuro { display: none; }
  :root:not([data-theme="dark"]) .logo-claro { display: block; }
}

/* ---------- rótulo de seção (linha verde, como na apresentação Spec) ---------- */
.rotulo {
  display: flex; align-items: center; gap: 12px;
  color: var(--accent-ink); font-weight: 500; letter-spacing: 0.12em; font-size: 12px; text-transform: uppercase;
}
.rotulo::before { content: ""; width: 24px; height: 3px; background: var(--accent); border-radius: 2px; }
.rotulo::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- login ---------- */
.login {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
}
.login-arte {
  background: var(--preto); color: #fff; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; padding: 48px;
}
.login-arte .ondas { position: absolute; inset: 0; opacity: 0.9; }
.login-arte .ondas path { fill: none; stroke: var(--verde); stroke-width: 6; stroke-linecap: round; }
.login-arte > * { position: relative; }
.login-arte img { width: min(360px, 70%); }
.login-arte .pilares { font-size: 13px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--cinza); }
.login-arte .pilares b { color: var(--verde); font-weight: 700; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.login-card { width: min(380px, 100%); display: grid; gap: 18px; }
.login-card h1 { font-size: 26px; }

/* ---------- layout do app ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 22px 14px; gap: 22px; position: sticky; top: 0; height: 100vh;
}
.sidebar .marca { padding: 4px 10px 0; }
.sidebar .marca img { height: 34px; }
.sidebar .marca small { display: block; margin-top: 8px; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
.nav { display: grid; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; text-decoration: none;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.ativo { background: var(--accent-soft); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.nav svg { width: 19px; height: 19px; flex: none; }
.sidebar .rodape { margin-top: auto; display: grid; gap: 10px; }
.usuario { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; font-weight: 700; flex: none;
}
.usuario div { min-width: 0; }
.usuario b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usuario span { font-size: 12px; color: var(--muted); }

.tema { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.tema button { flex: 1; border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 7px; cursor: pointer; font: inherit; font-size: 12px; }
.tema button.ativo { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.15); }

.main { min-width: 0; padding: 32px 36px 60px; display: grid; gap: 26px; align-content: start; }
.topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.topo .titulo { display: grid; gap: 6px; }

.barra-movel { display: none; }

/* ---------- componentes ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 9px 16px; border-radius: var(--radius-sm); font: 500 14px "Ubuntu", sans-serif; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }
.btn.primario { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn.primario:hover { filter: brightness(1.06); }
.btn.perigo { color: var(--danger); }
.btn.perigo:hover { background: var(--danger-soft); }
.btn.fantasma { background: transparent; border-color: transparent; }
.btn.pequeno { padding: 6px 10px; font-size: 13px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }

label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
input, select, textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 10px 12px; font: 400 15px "Ubuntu", sans-serif;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .nav a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}
input[type="color"] { padding: 3px; height: 42px; cursor: pointer; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--verde); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; color: var(--text); }

.grid-form { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-form .cheia { grid-column: 1 / -1; }
.acoes { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.erro-msg { color: var(--danger); font-size: 14px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 500;
  background: var(--surface-3); color: var(--text-2);
}
.badge.ok { background: var(--accent-soft); color: var(--accent-ink); }
.badge.erro { background: var(--danger-soft); color: var(--danger); }
.badge.rodando::before, .badge.na_fila::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulso 1.2s infinite;
}
.badge.na_fila::before { background: var(--muted); }
@keyframes pulso { 50% { opacity: 0.3; } }

/* ---------- clientes ---------- */
.grade-clientes { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.cliente-card {
  display: grid; gap: 14px; text-decoration: none; color: var(--text); position: relative; overflow: hidden;
  transition: transform .15s, border-color .15s;
}
.cliente-card:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }
.cliente-card .faixa { display: flex; gap: 6px; }
.cliente-card .faixa span { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border); }
.cliente-card .inicial {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 20px;
}
.vazio {
  border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 40px 20px; text-align: center; color: var(--muted);
  display: grid; gap: 12px; justify-items: center;
}
.vazio img { width: 46px; opacity: 0.9; }

/* ---------- abas ---------- */
.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.abas a {
  padding: 11px 14px; color: var(--muted); font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px;
  white-space: nowrap; text-decoration: none; display: flex; gap: 8px; align-items: center;
}
.abas a:hover { color: var(--text); }
.abas a.ativo { color: var(--text); border-bottom-color: var(--accent); }
.abas .cont { font-size: 11px; background: var(--surface-3); border-radius: 99px; padding: 1px 7px; color: var(--text-2); }

/* ---------- biblioteca ---------- */
.dropzone {
  border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted);
  display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; transition: .15s;
}
.dropzone.sobre { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.progresso { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progresso div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }

.grade-arquivos { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); align-items: start; }
.arquivo { padding: 0; overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.arquivo .midia {
  aspect-ratio: 16/10; background: var(--surface-3); display: grid; place-items: center; cursor: pointer; position: relative;
  background-image: linear-gradient(45deg, var(--surface-2) 25%, transparent 25%), linear-gradient(-45deg, var(--surface-2) 25%, transparent 25%);
  background-size: 16px 16px;
}
.arquivo .midia { overflow: hidden; }
.arquivo .midia img, .arquivo .midia video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #111; }
.arquivo .midia .tipo { font-weight: 700; letter-spacing: .1em; color: var(--muted); font-size: 13px; text-transform: uppercase; }
.arquivo .midia .play {
  position: absolute; width: 44px; height: 44px; border-radius: 50%; background: rgba(34,34,34,.75); display: grid; place-items: center;
}
.arquivo .midia .play::after { content: ""; border-left: 14px solid var(--verde); border-top: 9px solid transparent; border-bottom: 9px solid transparent; margin-left: 4px; }
.arquivo .info { padding: 12px 14px 14px; display: grid; gap: 8px; align-content: start; }
.arquivo .nome { font-weight: 500; font-size: 14px; word-break: break-word; line-height: 1.35; }
.arquivo .meta { font-size: 12px; color: var(--muted); }
.arquivo .acoes { gap: 6px; }

/* ---------- tarefas ---------- */
.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 0 12px 10px; }
.tabela td { padding: 12px; border-top: 1px solid var(--border); vertical-align: middle; }
.tabela tr:hover td { background: var(--surface-2); }
.rolagem { overflow-x: auto; }
pre.log {
  background: #111; color: #d8f7e8; border-radius: var(--radius-sm); padding: 14px; font: 12px/1.5 ui-monospace, Menlo, monospace;
  white-space: pre-wrap; word-break: break-word; max-height: 55vh; overflow: auto; margin: 0;
}

/* ---------- criar / IA ---------- */
.dupla { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.previa {
  border-radius: var(--radius-sm); overflow: hidden; position: relative; display: grid; align-content: center; padding: 8%;
  gap: 4%; container-type: inline-size; margin-inline: auto; max-height: 520px; width: 100%;
  background-size: cover; background-position: center;
}
.previa .p-marca { position: absolute; top: 5%; left: 8%; font-weight: 700; font-size: 3.4cqi; letter-spacing: .1em; text-transform: uppercase; }
.previa .p-titulo { font-weight: 700; font-size: 8cqi; line-height: 1.05; }
.previa .p-sub { font-size: 4cqi; opacity: .9; }
.previa .p-cta { justify-self: start; font-weight: 700; font-size: 3.6cqi; padding: 2.4cqi 4.4cqi; border-radius: 99px; }
.sugestoes { display: flex; flex-wrap: wrap; gap: 8px; }
.sugestoes button {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); border-radius: 99px; padding: 7px 12px;
  font: 13px "Ubuntu", sans-serif; cursor: pointer; text-align: left;
}
.sugestoes button:hover { border-color: var(--accent); color: var(--text); }
.lista-escolha { display: grid; gap: 6px; max-height: 260px; overflow: auto; padding: 4px; }
.lista-escolha label { flex-direction: row; display: flex; align-items: center; gap: 10px; font-weight: 400; color: var(--text); padding: 6px 8px; border-radius: 8px; }
.lista-escolha label:hover { background: var(--surface-2); }

/* ---------- modal ---------- */
dialog {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text);
  padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow);
}
dialog.largo { width: min(980px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 10, 10, 0.6); backdrop-filter: blur(3px); }
dialog .cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
dialog .corpo { padding: 20px; display: grid; gap: 16px; }
dialog .corpo video, dialog .corpo img { width: 100%; max-height: 70vh; object-fit: contain; background: #111; border-radius: var(--radius-sm); }

.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 50; background: var(--preto); color: #fff; border-left: 4px solid var(--verde);
  padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: calc(100vw - 40px); font-size: 14px;
}
.toast.erro { border-left-color: var(--danger); }

/* ---------- painel de envios (fica por cima de todas as telas) ---------- */
.envios {
  position: fixed; right: 20px; bottom: 20px; z-index: 45; width: min(380px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px; display: grid; gap: 10px;
}
.env-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.env-cab b { font-size: 14px; }
.env-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 300px; overflow: auto; }
.env-lista li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; font-size: 13px; }
.env-nome { min-width: 0; display: grid; }
.env-nome span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.env-nome small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.env-status { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.env-status.ok { color: var(--accent-ink); }
.env-status.erro { color: var(--danger); white-space: normal; max-width: 150px; text-align: right; }
.env-status .btn { padding: 2px 6px; }
.env-status .btn svg { width: 14px; height: 14px; }
.env-lista .progresso.fino { grid-column: 1 / -1; height: 4px; }
.toast { bottom: auto; top: 20px; }

/* ---------- responsivo ---------- */
@media (max-width: 960px) {
  .dupla { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-arte { min-height: 240px; padding: 28px 20px; }
  .login-arte img { width: 200px; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform .2s;
    box-shadow: var(--shadow);
  }
  .app.menu-aberto .sidebar { transform: none; }
  .barra-movel {
    display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--surface);
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30;
  }
  .barra-movel img { height: 30px; }
  .main { padding: 20px 16px 48px; }
  h1 { font-size: 23px; }
}
