:root {
  --ink: #303033;
  --muted: #6a6b70;
  --line: #e6e6e8;
  --paper: #fff;
  --bg: #f7f7f8;
  --accent: #13cdcc;
  --accent-2: #0fb3b2;
  --warn: #ff9e45;
  --danger: #e44e56;
  --shadow: 0 10px 30px rgba(48, 48, 51, .06);
  --radius: 4px;
}

html {
  scrollbar-gutter: stable;
  overflow-y: scroll;
}
html, body {
  font-family: Montserrat, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100%;
}

h1, h2, h3 {
  font-family: Montserrat, system-ui, sans-serif;
}

a { color: var(--ink); }
a:hover { color: var(--accent-2); }

.navbar {
  background: var(--ink);
}
.shell {
  width: min(960px, calc(100% - 40px));
  margin-left: auto;
  margin-right: auto;
}
.nav-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 64px;
}
.nav-left {
  display: flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
}
.nav-logo {
  display: flex;
  align-items: center;
  padding: 0;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-self: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-menu a {
  min-height: 64px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: #fff;
  text-decoration: none;
}
.nav-menu a:hover,
.nav-menu .on a {
  color: var(--accent);
}
.nav-right {
  justify-self: end;
  margin-left: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.wrap.shell {
  width: min(960px, calc(100% - 40px));
  padding: 32px 0 72px;
  min-height: calc(100vh - 160px);
}
.brand-logo {
  height: 26px;
  width: auto;
  display: block;
}
.auth-brand .brand-logo {
  height: 42px;
}
.product {
  margin-left: 12px;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #b4b5ba;
}

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
}
.auth-brand {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: rgb(47, 191, 196);
  background-image: url("brand/estacio-franca.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  background-blend-mode: color-burn;
  min-height: 100vh;
}
.auth-brand-cover {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.14);
  pointer-events: none;
}
.auth-brand > *:not(.auth-brand-cover) {
  position: relative;
  z-index: 1;
}
.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  background: #13cdcc;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 18px;
}
.white-line {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  width: 80px;
  margin: 16px 0;
}
.auth-brand h1,
.auth-brand p,
.auth-brand .meta {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}
.auth-brand h1 {
  position: relative;
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -.03em;
  max-width: 14ch;
  margin: 24px 0 12px;
}
.auth-brand p {
  position: relative;
  max-width: 40ch;
  font-weight: 500;
}
.kicker {
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: .72rem;
  font-weight: 600;
  color: #b4b5ba;
  margin: 0 0 8px;
}
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  background: #fff;
}
.auth-card { width: min(420px, 100%); }
.auth-card h1 { margin: 0 0 8px; font-weight: 500; letter-spacing: -.02em; }
.hint-accounts {
  margin-top: 28px;
  padding: 14px 16px;
  background: #f7f7f8;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: .85rem;
}
.hint-accounts code { color: var(--ink); font-weight: 600; }

.wrap {
  padding: 32px 0 72px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
h1 { margin: 0 0 6px; font-weight: 500; letter-spacing: -.03em; font-size: clamp(1.6rem, 3vw, 2.1rem); }
.lede { margin: 0; color: var(--muted); max-width: 48ch; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat b { display: block; font-size: 1.6rem; font-weight: 500; letter-spacing: -.04em; }
.stat.open { border-color: #b8f3f2; background: #f3fcfc; }
.stat.open b { color: var(--accent-2); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  align-items: end;
}
.field { margin-bottom: 14px; }
.filters .field { margin: 0; min-width: 150px; flex: 1; }
label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
input:not([type]),
input[type=text],
input[type=email],
input[type=password],
input[type=url],
input[type=date],
select,
textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  min-height: 44px;
  box-sizing: border-box;
}
textarea { min-height: 130px; resize: vertical; }
.file-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  box-sizing: border-box;
}
.file-box:hover,
.file-box:focus-within {
  border-color: #c8c8cc;
}
.file-box-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.file-box-ui {
  pointer-events: none;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-box.has-files .file-box-ui { color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  box-sizing: border-box;
  line-height: 1.2;
  text-decoration: none;
}
.btn:hover { background: #1f1f22; color: #fff; }
.btn-accent { background: var(--accent); color: var(--ink); }
.btn-accent:hover { background: var(--accent-2); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: #fff; color: var(--ink); }
.btn-danger { background: var(--danger); }
.btn-warn { background: var(--warn); color: var(--ink); }
.navbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.25); }

.grid { display: grid; gap: 12px; }
.ticket {
  display: grid;
  grid-template-columns: minmax(88px, 110px) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
a.ticket:hover { border-color: var(--accent); box-shadow: var(--shadow); color: inherit; }
a.ticket { color: inherit; text-decoration: none; }
.ticket.open { border-color: #b8f3f2; background: #f3fcfc; }
.ref { font-weight: 700; letter-spacing: .04em; }
.meta { color: var(--muted); font-size: .88rem; }
.ticket h3 { margin: 0 0 4px; font-size: 1.02rem; font-weight: 500; }
.ticket-aside {
  text-align: right;
  min-width: 108px;
}
.ticket-aside b {
  display: block;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: 1.15;
}
.ticket-aside span { display: block; font-size: .78rem; color: var(--muted); }

.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: start;
}
.col {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  min-height: 180px;
}
.col h2 { margin: 6px 8px 12px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.col.open-col { background: #f3fcfc; border-color: #b8f3f2; }
.mini {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
}
.mini:hover { border-color: var(--accent); color: inherit; }
.mini .ref { font-size: .78rem; }

.badge {
  display: inline-block;
  border-radius: 2px;
  padding: 3px 8px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-open { background: #e7fbfb; color: #0a8f8e; }
.badge-in_progress { background: #ececef; color: var(--ink); }
.badge-in_production, .badge-done { background: #e7fbfb; color: #0a8f8e; }
.badge-rejected { background: #fdecee; color: #b4232c; }
.badge-internal { background: var(--ink); color: #fff; }

.flash { margin: 16px auto 0; }
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 8px; }
.alert-ok { background: #e7fbfb; color: #0a8f8e; }
.alert-error { background: #fdecee; color: #b4232c; }

.layout { display: grid; grid-template-columns: 1.6fr .9fr; gap: 18px; }
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
}
.track {
  display: flex;
  gap: 0;
  margin: 8px 0 18px;
}
.step {
  flex: 1;
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  padding-top: 22px;
}
.step::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line);
}
.step::after {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--line);
  position: absolute;
  top: 1px;
  left: 50%;
  transform: translateX(-50%);
}
.step.on { color: var(--ink); }
.step.on::before { background: var(--accent); }
.step.on::after { border-color: var(--accent); background: var(--accent); }
.step.dead { color: var(--danger); }
.step.dead::before, .step.dead::after { border-color: var(--danger); background: var(--danger); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}
.actions form { margin: 0; }
.actions .btn {
  min-width: 13rem;
  height: 44px;
  padding: 0 16px;
  white-space: nowrap;
}
.action-extra {
  margin-bottom: 14px;
}
.action-extra .field { margin-bottom: 0; }
.thread { display: grid; gap: 10px; }
.comment {
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.comment.internal { background: var(--ink); color: #fff; border-color: var(--ink); }
.comment.internal .meta { color: #b4b5ba; }
.foot { padding: 8px 0 32px; color: var(--muted); font-size: .82rem; }
.panel-table {
  padding: 0;
  overflow: auto;
}
.panel-table h2 {
  margin: 0;
  padding: 18px 22px 0;
}
.data-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.data-table th,
.data-table td {
  text-align: left;
  vertical-align: middle;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
}
.data-table thead th {
  background: #fafafa;
}
.data-table th {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.data-table th:first-child,
.data-table td:first-child { padding-left: 22px; }
.data-table th:last-child,
.data-table td:last-child { padding-right: 22px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table col.name { width: 18%; }
.data-table col.email { width: 24%; }
.data-table col.role { width: 15%; }
.data-table col.company { width: 16%; }
.data-table col.status { width: 12%; }
.data-table col.actions { width: 132px; }
.data-table .col-actions {
  text-align: right;
  overflow: visible;
  white-space: nowrap;
}
.data-table .col-actions .btn { padding: 6px 12px; font-size: .85rem; }
.data-table tbody tr:hover { background: #fafafa; }
.navbar .btn-out {
  color: #fff;
  border-color: rgba(255,255,255,.3);
  padding: 7px 14px;
  font-size: .85rem;
}
.navbar .btn-out:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.who {
  color: #b4b5ba;
  font-size: .82rem;
  padding: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.empty { text-align: center; color: var(--muted); padding: 28px 8px; }
.narrow { max-width: 640px; }
.navbar form { margin: 0; }
.comment-form { margin-top: 16px; }
.request-dialog {
  position: relative;
  width: 560px;
  max-width: calc(100vw - 32px);
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 24px 60px rgba(48, 48, 51, .22);
}
.request-dialog::backdrop {
  background: rgba(48, 48, 51, .45);
}
.dialog-head {
  padding: 20px 48px 8px 24px;
}
.dialog-head h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -.03em;
}
.dialog-body { padding: 8px 24px 24px; }
.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.dialog-close:hover { color: var(--ink); }
.lang-switch {
  display: flex;
  gap: 2px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
}
.lang-switch a {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius);
}
.lang-switch a:hover,
.lang-switch a.on {
  color: var(--ink);
}
.lang-switch a.on {
  background: #f0f0f2;
}
.auth-card .lang-switch {
  justify-content: flex-end;
  margin: -8px 0 12px;
}
.navbar .lang-switch a {
  color: #b4b5ba;
}
.navbar .lang-switch a:hover,
.navbar .lang-switch a.on {
  color: #fff;
}
.navbar .lang-switch a.on {
  background: rgba(255, 255, 255, .12);
}

@media (max-width: 900px) {
  .auth, .layout, .kanban, .stats, .ticket { grid-template-columns: 1fr; }
  .auth-brand { min-height: 240px; padding: 32px 24px; }
  .nav-bar {
    grid-template-columns: 1fr auto;
  }
  .nav-menu {
    grid-column: 1 / -1;
    justify-self: center;
  }
  .nav-menu a { min-height: 44px; }
  .who { display: none; }
}
