:root {
  --bg: #050505;
  --surface: #101010;
  --surface-2: #191919;
  --border: #303030;
  --text: #f2f2f2;
  --muted: #999999;
  --blue: #e8e8e8;
  --green: #d0d0d0;
  --red: #b8b8b8;
  --yellow: #c5c5c5;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at 15% 0%, #202020 0, transparent 34rem), var(--bg);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  height: 62px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--border);
  background: rgba(5, 5, 5, .9);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #505050; border-radius: 9px; color: #f5f5f5; background: #1b1b1b; font-size: 14px; }
.logout-button { padding: 7px 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 8px; background: #111; cursor: pointer; }
.topbar-note, .muted { color: var(--muted); }
.container { max-width: 1180px; margin: 0 auto; padding: 42px 24px 80px; }
.heading-row, .subpage-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 26px; }
.heading-actions { display: flex; align-items: center; gap: 10px; }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .14em; }
h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.12; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 19px; }
.heading-row .muted, .subpage-head .muted { margin: 8px 0 0; }
.counter { min-width: 82px; padding: 12px 18px; display: flex; align-items: baseline; gap: 7px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.counter strong { font-size: 26px; }.counter span { color: var(--muted); }
.panel, .project-card, .empty { border: 1px solid var(--border); background: rgba(16, 16, 16, .94); border-radius: 16px; }
.add-panel { padding: 20px; margin-bottom: 24px; }
.add-form label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 13px; }
.input-row { display: flex; gap: 10px; }
input, textarea { width: 100%; color: var(--text); background: #090909; border: 1px solid #3b3b3b; border-radius: 10px; outline: none; }
input { height: 43px; padding: 0 13px; }
input:focus, textarea:focus { border-color: #888; box-shadow: 0 0 0 3px rgba(255, 255, 255, .08); }
.button { min-height: 39px; padding: 9px 14px; color: var(--text); border: 1px solid #3b3b3b; border-radius: 9px; background: var(--surface-2); cursor: pointer; font-weight: 650; white-space: nowrap; }
.button:hover { filter: brightness(1.12); text-decoration: none; }
.button.primary { color: #080808; border-color: #eeeeee; background: #eeeeee; }
.button.success { color: #eeeeee; border-color: #585858; background: #292929; }
.button.danger { color: #cfcfcf; border-color: #454545; background: #151515; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.project-card { padding: 20px; }
.project-head { display: flex; justify-content: space-between; gap: 18px; }
.path { max-width: 480px; margin: 6px 0 0; color: var(--muted); font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; }
.status { height: 27px; padding: 4px 9px; border-radius: 999px; color: var(--muted); background: #202a35; font-size: 12px; white-space: nowrap; }
.status-active {
  color: #b9f6ce;
  border: 1px solid #276842;
  background: #123020;
}
.status-inactive,
.status-failed,
.status-não-instalado,
.status-indisponível {
  color: #ffc2c7;
  border: 1px solid #754048;
  background: #39191d;
}
.status-activating,
.status-deactivating {
  color: #e0e0e0;
  border: 1px solid #555;
  background: #2c2c2c;
}
.checks { display: flex; gap: 15px; margin: 18px 0; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 13px; }
.ok { color: #d8d8d8; }.bad { color: #777; }
.actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.actions form { display: flex; gap: 7px; }.links { display: flex; align-items: center; gap: 13px; font-size: 13px; }
.links .inline-form { display: inline; }
.link-button { padding: 0; color: #c8c8c8; border: 0; background: transparent; cursor: pointer; font: inherit; }
.link-button:hover { color: #fff; text-decoration: underline; }
.subpage-actions { display: flex; align-items: center; gap: 9px; }
details { margin-top: 15px; color: var(--muted); font-size: 13px; }
summary { cursor: pointer; width: max-content; }
.text-danger { margin-top: 10px; padding: 0; color: var(--red); border: 0; background: transparent; cursor: pointer; }
.empty { grid-column: 1 / -1; min-height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--muted); }
.empty strong { color: var(--text); }
.messages { margin-bottom: 20px; display: grid; gap: 8px; }
.message { padding: 12px 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.message.success { color: #e5e5e5; border-color: #515151; }.message.error { color: #d0d0d0; border-color: #656565; }
.log-view { min-height: 520px; margin: 0; padding: 20px; overflow: auto; color: #d5d5d5; border: 1px solid var(--border); border-radius: 14px; background: #030303; font: 13px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.env-form textarea { min-height: 60vh; padding: 18px; resize: vertical; font: 13px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.env-footer { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--muted); font-size: 13px; }
.login-wrap { min-height: calc(100vh - 185px); display: grid; place-items: center; }
.login-card { width: min(100%, 420px); padding: 34px; border: 1px solid var(--border); border-radius: 18px; background: rgba(15, 15, 15, .96); box-shadow: 0 24px 80px rgba(0, 0, 0, .45); }
.login-card h1 { font-size: 32px; }
.login-card .muted { margin: 10px 0 24px; }
.login-icon { width: 42px; height: 42px; margin-bottom: 24px; display: grid; place-items: center; color: #fff; border: 1px solid #515151; border-radius: 12px; background: #222; font-weight: 800; }
.login-form { display: grid; gap: 9px; }
.login-form label { margin-top: 7px; color: #bdbdbd; font-size: 13px; }
.login-form .button { margin-top: 12px; width: 100%; }
.field-help { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.archive-panel { padding: 20px; margin-bottom: 18px; }
.archive-results { padding: 20px; }
.archive-results-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.archive-results-head h2 { font: 14px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.archive-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.archive-list { display: grid; gap: 8px; }
.archive-item { display: grid; grid-template-columns: auto 58px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #0a0a0a; cursor: pointer; }
.archive-item:has(input:checked) { border-color: #888; background: #181818; }
.archive-item.unsupported { opacity: .52; cursor: not-allowed; }
.archive-item input { width: 16px; height: 16px; }
.archive-type { padding: 3px 6px; color: #ddd; border: 1px solid #444; border-radius: 6px; text-align: center; font-size: 11px; }
.archive-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive-size, .archive-warning { color: var(--muted); font-size: 12px; white-space: nowrap; }
.extract-options { margin-top: 18px; padding-top: 18px; display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; align-items: end; gap: 12px; border-top: 1px solid var(--border); }
.extract-options > label:first-child { grid-column: 1 / -1; margin-bottom: -6px; color: var(--muted); font-size: 12px; }
.checkbox-row { min-height: 43px; display: flex; align-items: center; gap: 8px; color: #ccc; font-size: 13px; }
.checkbox-row input { width: 16px; height: 16px; }
.archive-empty { min-height: 130px; border: 0; background: #090909; }

@media (max-width: 820px) {
  .project-grid { grid-template-columns: 1fr; }
  .actions { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 600px) {
  .topbar-note { display: none; }
  .container { padding: 28px 14px 60px; }
  .heading-row, .subpage-head { align-items: flex-start; }
  .counter { display: none; }
  .heading-actions { align-items: flex-end; flex-direction: column; }
  .input-row, .env-footer { align-items: stretch; flex-direction: column; }
  .project-head { flex-direction: column; }
  .status { width: max-content; }
  .actions form { width: 100%; flex-wrap: wrap; }
  .archive-item { grid-template-columns: auto 50px minmax(0, 1fr); }
  .archive-size, .archive-warning { grid-column: 3; }
  .extract-options { grid-template-columns: 1fr; }
}
