/*
 * Formero Admin - styles (on top of portal/portal.css)
 * © 2026 Sergio Romero. All rights reserved.
 */

.admin-tag { color: var(--amber); }
.shell { flex: 1; display: grid; grid-template-columns: 210px minmax(0, 1fr); width: 100%; max-width: 1400px; margin: 0 auto; }
.shell main { max-width: none; margin: 0; }
.side[hidden] { display: none; }
.side[hidden] + main { grid-column: 1 / -1; }
/* signed out: the sign-in box sits in the middle of the page */
.shell:has(.side[hidden]) { grid-template-columns: 1fr; place-items: center; }
.shell:has(.side[hidden]) main { display: grid; place-items: center; min-height: calc(100vh - 160px); padding-top: 0; padding-bottom: 0; }
.shell:has(.side[hidden]) .login { margin: 0 auto; width: min(460px, 100%); }
.side {
  display: flex; flex-direction: column; gap: 2px; padding: 26px 0 26px clamp(16px, 3vw, 32px);
  position: sticky; top: 64px; align-self: start;
}
.side a {
  display: block; padding: 10px 12px; color: var(--muted); text-decoration: none; font-size: 14px;
  border-left: 2px solid transparent; border-radius: 0 var(--r) var(--r) 0;
}
.side a:hover { color: var(--bone); background: rgba(255, 255, 255, 0.03); }
.side a.on { color: var(--cyan); border-left-color: var(--cyan); background: rgba(46, 211, 198, 0.07); font-weight: 500; }
.side a.ext { margin-top: 14px; font-size: 12.5px; border-top: 1px solid var(--gray); border-radius: 0; padding-top: 14px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.page-head h1 { margin-top: 8px; }
.page-head .chip { margin-right: 6px; }
.block { margin-bottom: 30px; }
.muted { color: var(--muted); }
.nw { white-space: nowrap; }
.label { font-size: 13px; color: var(--muted); margin: 14px 0 6px; }

/* counters */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 30px; }
.kpi {
  display: flex; flex-direction: column; gap: 4px; padding: 16px; text-decoration: none; color: var(--bone);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
}
.kpi b { font-size: 30px; line-height: 1; color: var(--cyan); font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi.warn b { color: var(--amber); }
a.kpi:hover { box-shadow: 0 0 12px var(--cyan-glow); }

.chip.t-draft { color: var(--magenta); }
.card.t-draft { border-left-color: var(--magenta); }

/* tables */
.scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); vertical-align: middle; }
.tbl a { color: var(--bone); text-decoration: none; }
.tbl a:hover { color: var(--cyan); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.off td { opacity: 0.55; }
.tbl .acts { text-align: right; white-space: nowrap; }
.tbl .acts .btn + .btn { margin-left: 6px; }
.btn.danger { color: var(--magenta); border-color: var(--magenta); }
.btn.danger:hover { background: rgba(255, 45, 180, 0.1); box-shadow: 0 0 10px rgba(255, 45, 180, 0.35); }

/* activity log */
.log { list-style: none; margin: 0 0 14px; padding: 0; border-left: 1px solid var(--line); }
.log li { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; padding: 7px 0 7px 16px; position: relative; font-size: 13.5px; }
.log li::before { content: ""; position: absolute; left: -4px; top: 14px; width: 7px; height: 7px; background: var(--gray); transform: rotate(45deg); }
.log li.k-published::before, .log li.k-notified::before { background: var(--cyan); }
.log li.k-downloaded::before, .log li.k-exported::before { background: var(--ok); }
.log li.k-signed::before { background: var(--amber); }
.log li.k-archived::before { background: var(--muted); }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; }
.log .ev a { color: var(--cyan); text-decoration: none; margin-left: 4px; }
.log .detail { display: block; color: var(--muted); font-size: 12.5px; }

/* forms */
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%; padding: 11px 12px; font: 16px Roboto, Arial, sans-serif; color: var(--bone);
  background: rgba(0, 0, 0, 0.4); border: 1px solid var(--gray); border-radius: var(--r); outline: none;
}
textarea { resize: vertical; line-height: 1.5; }
select { appearance: auto; }
.inline-form { margin-top: 16px; padding: 16px; border: 1px dashed var(--gray); border-radius: var(--r); }
.inline-form label { margin-top: 0; }
.inline-form .row { display: flex; gap: 8px; }
.inline-form .row input { flex: 1; }
.form-title { margin: 0 0 10px; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.add-user .btn { margin-top: 4px; }
.acts-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.acts-row.wrap { flex-wrap: wrap; justify-content: flex-start; }
.check { margin: 8px 0; }

.types { border: 0; padding: 0; margin: 0 0 6px; display: grid; gap: 8px; }
.types legend { font-size: 13px; color: var(--muted); margin-bottom: 8px; padding: 0; }
.opt { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 12px; border: 1px solid var(--gray); border-radius: var(--r); cursor: pointer; color: var(--bone); }
.opt input { margin-top: 3px; accent-color: var(--cyan); width: 18px; height: 18px; flex-shrink: 0; }
.opt b { display: block; font-size: 12px; letter-spacing: 0.12em; }
.opt small { color: var(--muted); font-size: 13px; }
.opt.t-wip b { color: var(--cyan); }
.opt.t-renders b { color: var(--magenta); }
.opt.t-final b { color: var(--amber); }
.opt:has(input:checked) { border-color: var(--cyan); background: rgba(46, 211, 198, 0.06); }

/* folder page */
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.two > .block { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.contents { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.contents li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px; border: 1px solid var(--gray); border-radius: var(--r); }
.contents li .small { flex-basis: 100%; margin: 0; }
.contents li.img img { width: 72px; height: 54px; object-fit: cover; border-radius: var(--r); }
.contents li.img span { font-size: 13px; word-break: break-all; }
.facts { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 14px; margin: 0 0 14px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-word; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 18px; }
.filters label { margin: 0; }
.filters select { width: auto; min-width: 180px; }

.settings .block { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.account { display: flex; align-items: center; gap: 14px; padding: 14px; margin-bottom: 14px; border: 1px solid var(--gray); border-radius: var(--r); }
.account.ok { border-color: var(--ok); }
.account div { flex: 1; display: flex; flex-direction: column; }
.account .small { margin: 2px 0 0; }
.save-bar { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 40%); text-align: right; }

/* google sign-in */
.btn.google { width: 100%; margin-top: 18px; text-transform: none; letter-spacing: 0.02em; font-size: 15px; background: var(--bone); color: #1f1f1f; border-color: var(--bone); }
.btn.google:hover { background: #fff; }
.g { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: #4285f4; font-weight: 700; font-size: 15px; border: 1px solid #dadce0; }

/* dialogs */
.email-dlg { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 24px); display: flex; flex-direction: column; }
.email-dlg[open] { display: flex; }
.email-head { padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.email-head p { margin: 3px 0; word-break: break-word; }
.email-head span { display: inline-block; width: 62px; color: var(--muted); }
.email-frame { width: 100%; height: min(62vh, 640px); border: 0; background: #0b0b0c; }
.email-dlg .so-actions { padding: 12px 18px; margin: 0; border-top: 1px solid var(--line); }
.confirm { width: min(460px, calc(100vw - 24px)); padding: 22px; }
.confirm p { margin: 0 0 6px; line-height: 1.55; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    flex-direction: row; overflow-x: auto; gap: 4px; padding: 10px 16px; position: sticky; top: 55px; z-index: 15;
    background: rgba(11, 11, 12, 0.92); border-bottom: 1px solid var(--line);
  }
  .side a { flex: none; border-left: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 10px; }
  .side a.on { border-bottom-color: var(--cyan); }
  .side a.ext { margin: 0; border-top: 0; padding-top: 8px; }
  .two { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { flex-direction: column; }
}
@media (max-width: 600px) {
  .tbl { font-size: 13px; }
  .stack thead { display: none; }
  .stack tr { display: grid; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .stack td { display: flow-root; border: 0; padding: 3px 0 3px 9em; text-align: left !important; }
  .stack td::before { content: attr(data-l); float: left; width: 8.5em; margin-left: -9em; color: var(--muted); font-size: 12px; }
  .stack td:empty { display: none; }
  .tbl .acts { white-space: normal; }
  .log li { grid-template-columns: 1fr; gap: 0; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .inline-form .row { flex-direction: column; }
}

/* client Drive folder */
.drive-card { background: var(--panel); border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--r); padding: 18px 20px; }
.drive-card.ok { border-left-color: var(--ok); }
.drive-card.warn { border-left-color: var(--amber); }
.drive-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.drive-row div { flex: 1 1 240px; display: flex; flex-direction: column; min-width: 0; }
.drive-row .small { margin: 2px 0 0; overflow-wrap: anywhere; }
.drive-ico { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r); background: rgba(152, 235, 52, 0.12); color: var(--ok); font-size: 14px; }
.drive-card.warn .banner-text { margin: 0 0 10px; color: var(--amber); }
.drive-form { margin-top: 14px; }
.drive-form label { margin-top: 0; }
.drive-form .row { display: flex; gap: 8px; }
.drive-form .row input { flex: 1; }
.how { margin-top: 14px; font-size: 13.5px; }
.how summary { cursor: pointer; color: var(--cyan); }
.how pre { margin: 10px 0 6px; padding: 12px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--gray); border-radius: var(--r); font-size: 12.5px; line-height: 1.6; overflow-x: auto; color: var(--bone); }
.banner a { color: var(--amber); }
@media (max-width: 600px) { .drive-form .row { flex-direction: column; } }

.tag-real { color: var(--ok); font-weight: 700; letter-spacing: 0.06em; }
.steps { margin: 10px 0; padding-left: 20px; line-height: 1.6; }
.steps li { margin-bottom: 6px; }
.steps code, .small code { font-size: 12.5px; background: rgba(0, 0, 0, 0.4); padding: 1px 5px; border-radius: var(--r); }
.report-dlg { width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow: auto; }
.report { margin: 4px 0 12px; padding-left: 18px; font-size: 13.5px; color: var(--muted); }
.form-title.err { color: var(--magenta); }
.origin { margin: 10px 0 4px; font-size: 13.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.origin code { font-size: 14px; color: var(--amber); background: rgba(0, 0, 0, 0.4); padding: 4px 8px; border-radius: var(--r); }

/* preview before sending */
.contents li.can-view { border-color: rgba(46, 211, 198, 0.35); }
.contents .view-btn { margin-left: auto; }
.img-btn { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; border-radius: var(--r); }
.img-btn:focus-visible { outline: 2px solid var(--amber); }
.preview-dlg { width: min(1280px, calc(100vw - 24px)); height: calc(100vh - 24px); max-height: none; display: flex; flex-direction: column; }
.preview-dlg[open] { display: flex; }
.pv-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pv-head .kicker { margin: 0 0 2px; font-size: 10.5px; color: var(--amber); }
.pv-head b { font-size: 16px; }
.pv-nav { display: flex; align-items: center; gap: 8px; }
.pv-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #03080b; }
.pv-stage iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; }

/* trial run */
.side a.trial-link { color: var(--amber); }
.side a.trial-link.on { color: var(--amber); border-color: var(--amber); background: rgba(255, 176, 32, 0.08); }
.trial { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.trial > li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--gray); border-radius: var(--r); }
.trial > li.next { border-color: var(--cyan); box-shadow: 0 0 12px var(--cyan-glow); }
.trial > li.done { border-color: rgba(152, 235, 52, 0.4); }
.trial .n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--gray); color: var(--muted); font-weight: 700; }
.trial li.next .n { border-color: var(--cyan); color: var(--cyan); }
.trial li.done .n { background: var(--ok); border-color: var(--ok); color: var(--bg); }
.trial h3 { font-size: 16px; margin: 6px 0 6px; }
.trial li.done h3 { color: var(--muted); }
.trial p { margin: 4px 0 10px; font-size: 14px; }
.trial pre { margin: 8px 0; padding: 12px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--gray); border-radius: var(--r); font-size: 12.5px; line-height: 1.6; overflow-x: auto; }
.trial .grid { margin: 6px 0 4px; align-items: end; }
.trial .grid label { margin-top: 0; }
.trial .end { display: flex; align-items: flex-end; }
.row-form { display: flex; gap: 8px; margin: 6px 0; }
.row-form input { flex: 1; }
.tr-list { list-style: none; margin: 6px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tr-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; }
.tr-list a:not(.btn) { color: var(--bone); text-decoration: none; }
.tr-list .btn { margin-left: auto; }
@media (max-width: 600px) { .row-form { flex-direction: column; } .trial > li { grid-template-columns: 1fr; } }
