:root {
    --dark: #0a0f04;
    --dark-2: #0f1508;
    --osso: #e9e2d3;
    --lime: #c8f540;
    --lime-dim: #a8d030;
    --ink: #150604;
    --body-dark: rgba(233, 226, 211, .65);
    --line: rgba(200, 245, 64, .14);
    --panel: rgba(233, 226, 211, .03);
    --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* [hidden] precisa vencer displays customizados (ex.: .auth usa grid) */
[hidden] { display: none !important; }

html, body {
    min-height: 100%;
    background: var(--dark);
    color: var(--osso);
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body { position: relative; overflow-x: hidden; }

.bg-grid {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(900px 500px at 50% -10%, rgba(200, 245, 64, .10), transparent 70%),
        linear-gradient(180deg, var(--dark), var(--dark-2));
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
    color: var(--lime); margin-bottom: 12px;
}

/* ═══════════ LOGIN ═══════════ */
.auth {
    position: relative; z-index: 1;
    min-height: 100dvh;
    display: grid; place-items: center;
    padding: 32px 20px;
}

.card {
    width: 100%; max-width: 420px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 40px 36px;
    backdrop-filter: blur(8px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}

.card__logo img { height: 34px; margin-bottom: 28px; }
.card__title {
    font-family: 'Instrument Serif', serif;
    font-size: 34px; font-weight: 400; line-height: 1.05; letter-spacing: -.01em;
}
.card__sub { color: var(--body-dark); font-size: 14.5px; margin: 10px 0 28px; line-height: 1.5; }
.card__foot { text-align: center; font-size: 13px; color: var(--body-dark); margin-top: 22px; }
.card__foot a { color: var(--lime); }

/* ═══════════ FORMULÁRIOS ═══════════ */
.field { display: block; margin-bottom: 18px; }
.field > span {
    display: block; font-size: 12.5px; font-weight: 600;
    color: var(--osso); margin-bottom: 8px;
}
.field__hint { display: block; margin-top: 6px; font-size: 11.5px; color: var(--body-dark); }
.field--inline {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 0; align-self: end; padding-bottom: 14px;
}
.field--inline > span { margin: 0; }
.field--inline input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--lime); }

.field input,
.field select,
.field textarea,
.company-switch {
    width: 100%;
    background: rgba(10, 15, 4, .6);
    border: 1px solid rgba(233, 226, 211, .14);
    border-radius: 12px;
    color: var(--osso);
    font-size: 15px; font-family: inherit;
    transition: border-color .18s, box-shadow .18s;
}
.field input, .field select { height: 50px; padding: 0 14px; }
.field textarea { padding: 12px 14px; line-height: 1.5; resize: vertical; min-height: 90px; }
.field input::placeholder, .field textarea::placeholder { color: rgba(233, 226, 211, .35); }
.field input:focus, .field select:focus, .field textarea:focus, .company-switch:focus {
    outline: none;
    border-color: var(--lime);
    box-shadow: 0 0 0 3px rgba(200, 245, 64, .12);
}
.field input[type="file"] {
    padding: 12px 14px; height: auto; font-size: 13.5px;
}
.field input[type="file"]::file-selector-button {
    margin-right: 12px; padding: 7px 14px;
    background: rgba(200, 245, 64, .12); color: var(--lime);
    border: 1px solid var(--line); border-radius: 8px;
    font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}

.field__pass { position: relative; }
.field__pass input { padding-right: 48px; }
.field__eye {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px; display: grid; place-items: center;
    background: none; border: none; color: rgba(233, 226, 211, .5);
    cursor: pointer; border-radius: 9px;
}
.field__eye:hover { color: var(--lime); }

.form { display: flex; flex-direction: column; gap: 4px; }
.form__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.form__actions .btn-primary { width: auto; min-width: 190px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 .field { margin-bottom: 0; }
.divider { border: none; border-top: 1px solid var(--line); margin: 22px 0; }

/* ═══════════ BOTÕES ═══════════ */
.btn-primary {
    width: 100%; height: 52px;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    background: var(--lime); color: var(--ink);
    border: none; border-radius: 12px;
    font-size: 15px; font-weight: 700; font-family: inherit;
    cursor: pointer; transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(200, 245, 64, .28); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary .arrow { transition: transform .15s; }
.btn-primary:hover .arrow { transform: translateX(3px); }

.btn-ghost {
    background: transparent; color: var(--osso);
    border: 1px solid var(--line); border-radius: 10px;
    padding: 9px 16px; font-size: 13.5px; font-weight: 600;
    font-family: inherit; cursor: pointer;
    transition: background .15s, border-color .15s;
}
.btn-ghost:hover { background: rgba(200, 245, 64, .08); border-color: rgba(200, 245, 64, .4); }
.btn-ghost:disabled { opacity: .55; cursor: not-allowed; }
.btn--small { padding: 7px 13px; font-size: 12.5px; }
.btn--danger { color: #ffb4a8; border-color: rgba(255, 90, 70, .3); }
.btn--danger:hover { background: rgba(255, 90, 70, .12); border-color: rgba(255, 90, 70, .5); }

.back-link {
    background: none; border: none; color: var(--body-dark);
    font-family: inherit; font-size: 13.5px; font-weight: 600;
    cursor: pointer; padding: 0; margin-bottom: 18px;
}
.back-link:hover { color: var(--lime); }

/* ═══════════ SHELL ═══════════ */
.app { position: relative; z-index: 1; min-height: 100dvh; }

.topbar {
    display: flex; align-items: center; gap: 24px;
    padding: 14px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(10, 15, 4, .72);
    backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 5;
}
.topbar__logo img { height: 26px; }
.topbar__right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.topbar__user { text-align: right; line-height: 1.25; }
.topbar__company { display: block; font-size: 13.5px; font-weight: 700; }
.topbar__email { display: block; font-size: 11.5px; color: var(--body-dark); }

.company-switch {
    height: 38px; width: auto; min-width: 170px;
    padding: 0 10px; font-size: 13px;
}

.nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav__item {
    white-space: nowrap;
    padding: 8px 13px; border-radius: 9px;
    font-size: 13.5px; font-weight: 600; color: var(--body-dark);
    transition: color .15s, background .15s;
}
.nav__item:hover { color: var(--osso); background: rgba(200, 245, 64, .06); }
.nav__item--active { color: var(--ink); background: var(--lime); }

/* ═══════════ PÁGINA ═══════════ */
.page { position: relative; z-index: 1; }
.page__inner { max-width: 980px; margin: 0 auto; padding: 48px 24px 90px; }
.page__head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
    margin-bottom: 32px;
}
.page__title {
    font-family: 'Instrument Serif', serif;
    font-size: 44px; font-weight: 400; line-height: 1.02; letter-spacing: -.01em;
}
.page__sub { color: var(--body-dark); font-size: 15px; margin-top: 12px; max-width: 62ch; line-height: 1.55; }
.page__actions { display: flex; gap: 10px; flex: none; }

.block { margin-bottom: 40px; }
.block__head {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    margin-bottom: 16px;
}
.block__title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
    color: var(--lime); font-weight: 600;
}
.block__actions { display: flex; gap: 8px; }
.block--form .block__body {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px; background: var(--panel);
}

/* ═══════════ CONTADORES ═══════════ */
.counters {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--panel);
    margin-bottom: 40px; overflow: hidden;
}
.counter {
    padding: 22px 24px;
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 6px;
}
.counter:last-child { border-right: none; }
.counter__value {
    font-family: 'Instrument Serif', serif;
    font-size: 34px; line-height: 1; color: var(--lime);
}
.counter__label {
    font-size: 12px; color: var(--body-dark);
    letter-spacing: .02em;
}

/* ═══════════ LISTAS ═══════════ */
.rows { list-style: none; display: flex; flex-direction: column; gap: 12px; }

.row {
    display: flex; align-items: center; gap: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: border-color .18s, background .18s;
}
.row:hover { border-color: rgba(200, 245, 64, .34); background: rgba(200, 245, 64, .045); }
.row--link { cursor: pointer; }

.row__icon {
    flex: none; width: 48px; height: 48px; border-radius: 12px;
    display: grid; place-items: center;
    background: rgba(200, 245, 64, .12); color: var(--lime);
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600;
    border: 1px solid rgba(200, 245, 64, .25);
}
.row__main { flex: 1; min-width: 0; }
.row__title {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    font-size: 15.5px; font-weight: 700;
}
.row__desc { font-size: 13.5px; color: var(--body-dark); margin-top: 7px; line-height: 1.5; }
.row__link { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--accent); text-decoration: none; }
.row__link:hover { text-decoration: underline; }
.row--stack { align-items: flex-start; }
.row__meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px; color: var(--body-dark); margin-top: 7px;
}
.row__side { flex: none; display: flex; align-items: center; gap: 10px; }
.row__side--actions { flex-wrap: wrap; justify-content: flex-end; }

.row__cta {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--lime); color: var(--ink);
    border: none; border-radius: 10px;
    padding: 10px 17px; font-size: 13.5px; font-weight: 700;
    font-family: inherit; cursor: pointer;
    transition: transform .15s, box-shadow .15s, opacity .2s;
}
.row__cta:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(200, 245, 64, .25); }
.row__cta:disabled { opacity: .6; cursor: progress; transform: none; box-shadow: none; }
.row__cta--ghost {
    background: transparent; color: var(--osso);
    border: 1px solid var(--line);
}
.row__cta--ghost:hover { background: rgba(200, 245, 64, .08); box-shadow: none; }

/* ═══════════ BADGES ═══════════ */
.badge {
    display: inline-flex; align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    padding: 4px 9px; border-radius: 20px;
    border: 1px solid transparent; white-space: nowrap;
}
.badge--neutral { background: rgba(233, 226, 211, .09); color: var(--osso); border-color: rgba(233, 226, 211, .18); }
.badge--muted { background: rgba(233, 226, 211, .05); color: var(--body-dark); border-color: rgba(233, 226, 211, .12); }
.badge--info { background: rgba(120, 190, 255, .12); color: #a9d4ff; border-color: rgba(120, 190, 255, .3); }
.badge--success { background: rgba(200, 245, 64, .13); color: var(--lime); border-color: rgba(200, 245, 64, .32); }
.badge--warning { background: rgba(255, 196, 84, .12); color: #ffd694; border-color: rgba(255, 196, 84, .3); }
.badge--danger { background: rgba(255, 90, 70, .12); color: #ffb4a8; border-color: rgba(255, 90, 70, .32); }

/* ═══════════ PROGRESSO ═══════════ */
.progress { display: flex; align-items: center; gap: 10px; min-width: 130px; }
.progress__track {
    flex: 1; height: 6px; border-radius: 3px;
    background: rgba(233, 226, 211, .1); overflow: hidden;
}
.progress__fill { height: 100%; background: var(--lime); border-radius: 3px; transition: width .3s ease; }
.progress__value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px; color: var(--body-dark); min-width: 34px; text-align: right;
}
.progress--upload { margin: 14px 0 4px; }

/* ═══════════ FATOS ═══════════ */
.facts {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--panel);
    overflow: hidden; margin-bottom: 36px;
}
.fact {
    padding: 16px 18px; display: flex; flex-direction: column; gap: 8px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.fact__label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--body-dark);
}
.fact__value { font-size: 14.5px; font-weight: 600; }

/* ═══════════ AVISOS ═══════════ */
.notices { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.notice {
    border: 1px solid var(--line); border-left: 2px solid var(--lime);
    border-radius: 12px; padding: 16px 18px; background: rgba(200, 245, 64, .04);
}
.notice--warning { border-left-color: #ffc454; background: rgba(255, 196, 84, .05); }
.notice--success { border-left-color: var(--lime); }
.notice__head { display: flex; align-items: center; gap: 10px; }
.notice__title { font-size: 14.5px; }
.notice__rm {
    margin-left: auto; background: none; border: none; cursor: pointer;
    color: var(--body-dark); font-size: 18px; line-height: 1; padding: 0 4px;
}
.notice__rm:hover { color: #ffb4a8; }
.notice__body { font-size: 13.5px; color: var(--body-dark); margin-top: 8px; line-height: 1.55; white-space: pre-wrap; }
.notice__meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; color: var(--body-dark); margin-top: 10px; opacity: .8;
}

/* ═══════════ TIMELINE ═══════════ */
.timeline { list-style: none; position: relative; padding-left: 22px; }
.timeline::before {
    content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px;
    width: 1px; background: var(--line);
}
.timeline__item { position: relative; padding-bottom: 22px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
    position: absolute; left: -22px; top: 5px;
    width: 11px; height: 11px; border-radius: 50%;
    background: var(--dark); border: 2px solid var(--lime);
}
.timeline__item--note .timeline__dot { border-color: rgba(233, 226, 211, .35); }
.timeline__title { font-size: 14.5px; font-weight: 700; }
.timeline__body { font-size: 13.5px; color: var(--body-dark); margin-top: 6px; line-height: 1.55; white-space: pre-wrap; }
.timeline__meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; color: var(--body-dark); margin-top: 8px; opacity: .8;
}

/* ═══════════ THREAD ═══════════ */
.thread { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }
.thread__item {
    border: 1px solid var(--line); border-radius: 14px;
    padding: 14px 16px; background: var(--panel);
    max-width: 82%;
}
.thread__item--nexify { align-self: flex-start; border-left: 2px solid var(--lime); }
.thread__item--client { align-self: flex-end; background: rgba(200, 245, 64, .06); }
.thread__meta {
    display: flex; gap: 12px; align-items: baseline;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--body-dark);
}
.thread__meta strong { font-family: 'Inter', sans-serif; font-size: 12.5px; color: var(--osso); }
.thread__body { font-size: 14px; line-height: 1.6; margin-top: 8px; white-space: pre-wrap; }

/* ═══════════ CONTATOS / RELEASES ═══════════ */
.contacts {
    list-style: none; display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px;
}
.contact {
    border: 1px solid var(--line); border-radius: 12px;
    padding: 16px 18px; background: var(--panel);
    display: flex; flex-direction: column; gap: 5px;
}
.contact__name { font-size: 14.5px; }
.contact__role { font-size: 12.5px; color: var(--body-dark); }
.contact__link { font-size: 13px; color: var(--lime); }

.releases { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.release {
    border: 1px solid var(--line); border-radius: 12px;
    padding: 16px 18px; background: var(--panel);
}
.release__head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.release__head strong { color: var(--lime); font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.release__title { font-size: 14px; font-weight: 600; }
.release__date {
    margin-left: auto; font-family: 'JetBrains Mono', monospace;
    font-size: 11px; color: var(--body-dark);
}
.release__notes { list-style: none; margin-top: 12px; display: grid; gap: 7px; }
.release__notes > li {
    position: relative; padding-left: 16px;
    font-size: 13.5px; line-height: 1.5; color: var(--body-dark);
}
.release__notes > li::before {
    content: '›'; position: absolute; left: 2px; top: -1px;
    color: var(--lime); font-weight: 700;
}

/* ═══════════ ESTADOS ═══════════ */
.empty {
    text-align: center; color: var(--body-dark);
    border: 1px dashed var(--line); border-radius: var(--radius);
    padding: 42px 20px; font-size: 14.5px;
}
.loading { color: var(--body-dark); font-size: 14px; padding: 40px 4px; }
.error {
    background: rgba(255, 90, 70, .1);
    border: 1px solid rgba(255, 90, 70, .35);
    color: #ffb4a8;
    font-size: 13px; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px;
}
.ok {
    color: #b6f07a; font-size: 14px;
    padding: 10px 12px; border-radius: 10px;
    background: rgba(182, 240, 122, .08); border: 1px solid rgba(182, 240, 122, .25);
}
.note {
    font-size: 13.5px; color: var(--body-dark); line-height: 1.55;
    border: 1px solid var(--line); border-radius: 12px;
    padding: 14px 16px; background: var(--panel);
}
.note--warning {
    border-color: rgba(255, 196, 84, .32); color: #ffd694;
    background: rgba(255, 196, 84, .07); margin-bottom: 28px;
}

code {
    font-family: 'JetBrains Mono', monospace; font-size: .9em;
    background: rgba(200, 245, 64, .1); color: var(--lime);
    padding: 1px 6px; border-radius: 5px;
}

/* ═══════════ TOASTS ═══════════ */
.toast-stack {
    position: fixed; right: 20px; bottom: 20px; z-index: 50;
    display: flex; flex-direction: column; gap: 10px;
    pointer-events: none;
}
.toast {
    min-width: 240px; max-width: 380px;
    padding: 13px 16px; border-radius: 12px;
    font-size: 13.5px; line-height: 1.45;
    background: rgba(15, 21, 8, .96);
    border: 1px solid var(--line);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
    animation: toast-in .22s ease-out;
}
.toast--success { border-color: rgba(200, 245, 64, .4); color: var(--lime); }
.toast--danger { border-color: rgba(255, 90, 70, .4); color: #ffb4a8; }
.toast--warning { border-color: rgba(255, 196, 84, .4); color: #ffd694; }
.toast--out { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ═══════════ RESPONSIVO ═══════════ */
@media (max-width: 1080px) {
    .topbar { flex-wrap: wrap; gap: 12px 20px; }
    .nav { order: 3; width: 100%; padding-bottom: 2px; }
    .topbar__right { margin-left: auto; }
}

@media (max-width: 760px) {
    .grid2 { grid-template-columns: 1fr; }
    .counters { grid-template-columns: 1fr 1fr; }
    .counter { border-bottom: 1px solid var(--line); }
    .counter:nth-child(2n) { border-right: none; }
    .counter:last-child { border-bottom: none; }
    .page__head { flex-direction: column; align-items: flex-start; }
    .thread__item { max-width: 100%; }
}

@media (max-width: 560px) {
    .card { padding: 32px 24px; }
    .topbar { padding: 12px 16px; }
    .topbar__user { display: none; }
    .company-switch { min-width: 130px; }
    .page__inner { padding: 32px 16px 70px; }
    .page__title { font-size: 34px; }
    .row { flex-wrap: wrap; }
    .row__side--actions { width: 100%; justify-content: flex-start; }
    .row__cta { flex: 1; justify-content: center; }
    .form__actions .btn-primary { width: 100%; }
    .toast-stack { left: 16px; right: 16px; bottom: 16px; }
    .toast { max-width: none; }
}
