/* Portal de Documentos MCLvale — sistema de design
   Marca: verde-floresta (#00531f) e verde-vivo (#04b220) do logotipo. */

:root {
  --nav-bg: #082616;
  --nav-bg-2: #0d3520;
  --nav-ink: #cfe3d6;
  --brand-900: #013a1a;
  --brand-700: #00632a;
  --brand-600: #007a35;
  --brand-500: #0a9a3d;
  --brand-400: #04b220;
  --brand-200: #bfe6cb;
  --brand-100: #e1f3e7;
  --brand-50: #f0f9f3;
  --ink: #12231a;
  --ink-2: #3a4c41;
  --muted: #62766a;
  --line: #dbe5de;
  --line-2: #ebf1ed;
  --bg: #f2f6f3;
  --card: #ffffff;
  --amber-ink: #8a4b00; --amber-bg: #fff2d6; --amber-line: #f2d48a;
  --blue-ink: #174ea6; --blue-bg: #e7effd; --blue-line: #bcd1f7;
  --red-ink: #a8271d; --red-bg: #fdeceb; --red-line: #f3bdb8;
  --grey-ink: #526158; --grey-bg: #edf1ee; --grey-line: #d3dcd6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-1: 0 1px 2px rgba(8, 38, 22, .06), 0 1px 3px rgba(8, 38, 22, .05);
  --shadow-2: 0 8px 28px rgba(8, 38, 22, .12);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 .75em; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-400) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .92em; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i-sm { width: 15px; height: 15px; }
.i-lg { width: 24px; height: 24px; }

/* ------------------------------------------------------------ layout */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px 14px;
  color: var(--nav-ink); background:
    radial-gradient(120% 60% at 0% 0%, rgba(4, 178, 32, .16), transparent 60%), linear-gradient(180deg, var(--nav-bg-2), var(--nav-bg));
}
.brand { display: block; padding: 4px 10px 18px; }
.brand img { width: 150px; display: block; }
.brand small { display: block; margin-top: 8px; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: #8fb09b; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; overflow-y: auto; }
.nav-title { margin: 16px 10px 6px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #6f9580; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; color: var(--nav-ink);
  font-weight: 500; text-decoration: none; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active { background: rgba(4, 178, 32, .2); color: #fff; box-shadow: inset 3px 0 0 var(--brand-400); }
.nav .badge { margin-left: auto; background: var(--brand-400); color: #031b0d; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.nav .badge.warn { background: #ffc24a; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .09); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 6px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 13px;
  color: #052a14; background: linear-gradient(135deg, #8de29d, #04b220);
}
.user-chip .who { min-width: 0; line-height: 1.25; }
.user-chip .who b { display: block; color: #fff; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who span { display: block; font-size: 11.5px; color: #8fb09b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-links { display: flex; gap: 6px; margin-top: 6px; }
.foot-links a, .foot-links button {
  flex: 1; display: flex; justify-content: center; align-items: center; gap: 7px; padding: 8px; border-radius: 8px; border: 0;
  color: var(--nav-ink); background: rgba(255, 255, 255, .06); font-size: 13px; cursor: pointer; text-decoration: none;
}
.foot-links a:hover, .foot-links button:hover { background: rgba(255, 255, 255, .13); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { width: 100%; max-width: 1240px; margin: 0 auto; padding: 30px 36px 70px; }
.footer { margin-top: auto; padding: 18px 36px 26px; color: var(--muted); font-size: 12.5px; text-align: center; }

/* ------------------------------------------------------------ cabeçalhos */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumbs .i { width: 13px; height: 13px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.eyebrow { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-600); font-weight: 700; margin-bottom: 6px; }
.lead { color: var(--ink-2); max-width: 70ch; margin-top: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.order-head {
  position: relative; overflow: hidden; border-radius: var(--radius); color: #fff; padding: 24px 28px 22px; margin-bottom: 0;
  background: linear-gradient(120deg, var(--brand-900), #02522a 55%, #057a35);
  box-shadow: var(--shadow-1);
}
.order-head::after {
  content: ""; position: absolute; right: -40px; top: -60px; width: 300px; height: 300px; opacity: .13; pointer-events: none;
  background: conic-gradient(from 20deg, #fff 0 25%, transparent 0 50%, #fff 0 75%, transparent 0); transform: rotate(35deg) scale(.7); border-radius: 30%;
}
.order-head .eyebrow { color: #9be7ad; }
.order-head h1 { color: #fff; font-size: 30px; font-family: var(--mono); letter-spacing: -.02em; }
.order-head .sub { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 8px; color: #d4eddc; font-size: 14px; }
.order-head .sub span { display: inline-flex; align-items: center; gap: 7px; }
.order-head .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; position: relative; z-index: 1; }

.stepper { display: flex; gap: 0; margin-top: 20px; position: relative; z-index: 1; }
.stepper .step { flex: 1; position: relative; padding-top: 18px; font-size: 12px; color: #a6d4b4; letter-spacing: .02em; }
.stepper .step::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 3px; background: rgba(255, 255, 255, .18); }
.stepper .step:first-child::before { border-radius: 3px 0 0 3px; }
.stepper .step:last-child::before { border-radius: 0 3px 3px 0; }
.stepper .step::after { content: ""; position: absolute; top: 0; left: 0; width: 13px; height: 13px; border-radius: 50%; background: #0d6a37; border: 2px solid rgba(255, 255, 255, .35); }
.stepper .step.done::before { background: var(--brand-400); }
.stepper .step.done::after { background: var(--brand-400); border-color: var(--brand-400); }
.stepper .step.now { color: #fff; font-weight: 650; }
.stepper .step.now::before { background: linear-gradient(90deg, var(--brand-400) 40%, rgba(255, 255, 255, .18) 40%); }
.stepper .step.now::after { background: #fff; border-color: var(--brand-400); box-shadow: 0 0 0 4px rgba(4, 178, 32, .35); }

.tabs { display: flex; gap: 2px; overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 0 10px; margin-bottom: 24px; box-shadow: var(--shadow-1); }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 14px 14px 13px; color: var(--ink-2); font-weight: 550; white-space: nowrap; border-bottom: 3px solid transparent; text-decoration: none; }
.tabs a:hover { color: var(--brand-700); }
.tabs a.active { color: var(--brand-700); border-bottom-color: var(--brand-500); }
.tabs .count { background: var(--line-2); color: var(--ink-2); font-size: 11.5px; padding: 1px 7px; border-radius: 999px; font-weight: 650; }
.tabs .count.warn { background: var(--amber-bg); color: var(--amber-ink); }
.tabs .spacer { flex: 1; }

/* ------------------------------------------------------------ botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--brand-50); border-color: var(--brand-200); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, var(--shadow-1); }
.btn-primary:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn-danger { color: var(--red-ink); border-color: var(--red-line); background: #fff; }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red-line); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand-700); }
.btn-ghost:hover { background: var(--brand-50); border-color: transparent; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-icon { padding: 7px; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-700); cursor: pointer; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

/* ------------------------------------------------------------ cartões */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card + .card { margin-top: 20px; }
/* dentro de uma grade o espaço já vem do gap: sem isto o 2º cartão em diante desce 20px e o 1º parece mais alto */
.grid > .card + .card { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-head .sub { color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 2px; }
.card-body { padding: 20px; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
.stack > * + * { margin-top: 20px; }

.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi .value { font-size: 32px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.kpi .i-lg { position: absolute; right: 16px; top: 16px; color: var(--brand-200); width: 30px; height: 30px; }
.kpi.accent { border-color: var(--amber-line); background: linear-gradient(180deg, #fffaf0, #fff); }
.kpi.accent .i-lg { color: #f1c35e; }
.kpi.good .value { color: var(--brand-600); }
.kpi.bad .value { color: var(--red-ink); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 22px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ tabelas */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 650; padding: 11px 16px; background: #f8fbf9; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafdfb; }
.table tr.is-old td { background: #fbfcfb; color: var(--muted); }
.table tr.is-canceled td { color: var(--muted); text-decoration: line-through; text-decoration-color: #c9d3cd; }
.table td.check, .table th.check { width: 42px; padding-right: 0; }
.table .cell-title { font-weight: 600; }
.table .cell-sub { color: var(--muted); font-size: 12.5px; }
.table .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand-600); width: 17px; height: 17px; cursor: pointer; vertical-align: middle; }

.tag {
  display: inline-block; font-family: var(--mono); font-size: 12.5px; font-weight: 600; letter-spacing: .01em; color: var(--brand-900);
  background: var(--brand-50); border: 1px solid var(--brand-200); padding: 2px 8px; border-radius: 6px; white-space: nowrap;
}
a.tag:hover { background: var(--brand-100); text-decoration: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--grey-line); background: var(--grey-bg); color: var(--grey-ink); white-space: nowrap; }
.chip .i { width: 12px; height: 12px; }
.chip.green { background: var(--brand-100); border-color: var(--brand-200); color: var(--brand-700); }
.chip.amber { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber-ink); }
.chip.blue { background: var(--blue-bg); border-color: var(--blue-line); color: var(--blue-ink); }
.chip.red { background: var(--red-bg); border-color: var(--red-line); color: var(--red-ink); }
.rev { font-family: var(--mono); font-weight: 700; font-size: 12.5px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line-2); background: #fbfdfc; border-radius: var(--radius) var(--radius) 0 0; }
.toolbar .grow { flex: 1; }
.search { position: relative; min-width: 240px; flex: 1; max-width: 420px; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.search input[type=search] { padding-left: 38px; }
.selection-bar { display: none; align-items: center; gap: 12px; padding: 10px 20px; background: var(--brand-900); color: #fff; font-size: 14px; }
.selection-bar.show { display: flex; }
.selection-bar .btn { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); color: #fff; }
.selection-bar .btn:hover { background: rgba(255, 255, 255, .22); }

/* ------------------------------------------------------------ formulários */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; align-content: start; }
.field > label, .label { font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.field .hint { color: var(--muted); font-size: 12.5px; }
.req::after { content: " *"; color: var(--red-ink); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #cbd8d0; border-radius: 9px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #aebfb4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-400) 25%, transparent); }
textarea { min-height: 90px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2362766a' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.cols-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.form-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; padding-top: 6px; }
.segmented { display: inline-flex; padding: 4px; background: var(--line-2); border-radius: 11px; gap: 2px; }
.segmented label { padding: 8px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:checked + span { color: var(--brand-700); }
.segmented label:has(input:checked) { background: #fff; box-shadow: var(--shadow-1); color: var(--brand-700); }
.segmented label:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--brand-400) 55%, transparent); }

.dropzone {
  display: grid; place-items: center; text-align: center; gap: 4px; padding: 30px 20px; border: 2px dashed #b5cbbd; border-radius: var(--radius);
  background: var(--brand-50); color: var(--ink-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand-500); background: var(--brand-100); }
.dropzone .i-lg { width: 34px; height: 34px; color: var(--brand-600); }
.dropzone b { font-size: 15px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone.filled { border-style: solid; background: #fff; }
.progress { height: 10px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-500), var(--brand-400)); transition: width .2s; border-radius: 999px; }
.tag-preview { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--brand-900); color: #fff; }
.tag-preview .mono { font-size: 17px; font-weight: 700; letter-spacing: .02em; color: #b9f1c7; }
.tag-preview small { color: #9bc4a8; }

/* ------------------------------------------------------------ avisos */
.flashes { display: grid; gap: 10px; margin-bottom: 20px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 10px; border: 1px solid var(--grey-line); background: var(--grey-bg); font-size: 14px; overflow-wrap: anywhere; }
.alert .i { margin-top: 2px; }
.alert.ok { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-900); }
.alert.error { background: var(--red-bg); border-color: var(--red-line); color: var(--red-ink); }
.alert.warn { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber-ink); }
.alert.info { background: var(--blue-bg); border-color: var(--blue-line); color: var(--blue-ink); }
.alert .close { margin-left: auto; background: none; border: 0; cursor: pointer; opacity: .6; padding: 0; color: inherit; }
.alert .close:hover { opacity: 1; }
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .i-lg { width: 40px; height: 40px; color: #b8cabf; margin-bottom: 10px; }
.empty h3 { color: var(--ink-2); margin-bottom: 4px; }

/* ------------------------------------------------------------ listas e linhas do tempo */
.order-card { display: block; padding: 20px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.order-card:hover { text-decoration: none; border-color: var(--brand-200); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.order-card .num-order { font-family: var(--mono); font-weight: 700; font-size: 19px; color: var(--brand-900); }
.order-card .client { font-weight: 600; margin-top: 2px; }
.order-card .meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.order-card .meta span { display: inline-flex; align-items: center; gap: 6px; }
.mini-steps { display: flex; gap: 4px; margin-top: 16px; }
.mini-steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.mini-steps i.on { background: var(--brand-400); }
.mini-steps i.now { background: var(--brand-600); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--line-2); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.list .sub { color: var(--muted); font-size: 13px; }
.file-ico { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--brand-100); color: var(--brand-700); font-size: 10px; font-weight: 800; letter-spacing: .03em; }
.file-ico.pdf { background: #fde9e7; color: #b42318; }
.file-ico.dwg, .file-ico.dxf { background: #e8eefc; color: #1d4ed8; }
.file-ico.xls, .file-ico.xlsx, .file-ico.csv { background: #e1f3e7; color: #00632a; }
.file-ico.doc, .file-ico.docx, .file-ico.txt { background: #e7effd; color: #174ea6; }
.file-ico.zip { background: #fff2d6; color: #8a4b00; }

.timeline { list-style: none; margin: 0; padding: 4px 20px 8px; }
.timeline li { position: relative; padding: 10px 0 12px 28px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--brand-400); }
.timeline li.t-down::before { border-color: #3b82f6; }
.timeline li.t-warn::before { border-color: #f2a73b; }
.timeline li.t-bad::before { border-color: #e5483c; }
.timeline li.t-mute::before { border-color: #b3c2b9; }
.timeline .when { color: var(--muted); font-size: 12.5px; }
.timeline .what { font-weight: 600; }
.timeline .detail { color: var(--ink-2); font-size: 13.5px; overflow-wrap: anywhere; }

.revisions { display: grid; gap: 14px; }
.revision { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.revision.current { border-color: var(--brand-200); background: linear-gradient(180deg, var(--brand-50), #fff 70%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-400) 10%, transparent); }
.revision .big { font-family: var(--mono); font-weight: 800; font-size: 20px; color: var(--brand-900); text-align: center; }
.revision.old .big { color: var(--muted); }
.revision .hash { font-family: var(--mono); font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }

/* medição */
.bar-row { display: grid; grid-template-columns: 1fr; gap: 6px; }
.bar { position: relative; height: 12px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; }
.bar .plan { background: #b8cfc1; }
.bar .real { background: linear-gradient(90deg, var(--brand-500), var(--brand-400)); height: 60%; top: 20%; }
.bar.late .real { background: linear-gradient(90deg, #d9534a, #f0875e); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.dev-pos { color: var(--brand-600); font-weight: 700; }
.dev-neg { color: var(--red-ink); font-weight: 700; }
.inline-form { display: contents; }
.table input, .table select { padding: 6px 8px; font-size: 13.5px; border-radius: 7px; }
.table .col-desc { min-width: 250px; }
.table .w-sm { width: 82px; }
.table .w-md { width: 150px; }

/* paginação */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 16px; color: var(--muted); font-size: 13.5px; }

/* diálogos */
dialog { border: 0; padding: 0; border-radius: 16px; box-shadow: var(--shadow-2); width: min(520px, calc(100vw - 32px)); color: var(--ink); }
dialog::backdrop { background: rgba(5, 30, 17, .5); backdrop-filter: blur(2px); }
dialog .dlg-head { padding: 20px 22px 6px; }
dialog .dlg-body { padding: 8px 22px 6px; }
dialog .dlg-foot { padding: 16px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; }

.resp-form { display: grid; gap: 12px; padding: 16px 18px; background: #f7faf8; border-top: 1px solid var(--line-2); border-radius: 0 0 var(--radius) var(--radius); }
.resp-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.resp-options label { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-weight: 600; font-size: 14px; }
.resp-options label:has(input:checked) { border-color: var(--brand-500); background: var(--brand-50); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-400) 18%, transparent); }
.resp-options label.neg:has(input:checked) { border-color: #e5483c; background: var(--red-bg); box-shadow: 0 0 0 3px rgba(229, 72, 60, .15); }
.answered { padding: 14px 18px; border-top: 1px solid var(--line-2); display: flex; gap: 12px; align-items: flex-start; background: #fbfdfc; border-radius: 0 0 var(--radius) var(--radius); }
.titem { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-1); scroll-margin-top: 20px; }
.titem + .titem { margin-top: 14px; }
.titem-top { display: flex; gap: 16px; align-items: center; padding: 16px 18px; flex-wrap: wrap; }
.titem:target { border-color: var(--brand-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-400) 22%, transparent); }

/* bloco para impressão do boletim */
.sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 40px; box-shadow: var(--shadow-1); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 3px solid var(--brand-600); padding-bottom: 16px; margin-bottom: 20px; }
.sheet-head img { width: 140px; }

/* ------------------------------------------------------------ autenticação */
.auth { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, 520px); min-height: 100vh; background: #fff; }
.auth-hero {
  position: relative; color: #fff; padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
  background: linear-gradient(160deg, rgba(1, 58, 26, .88), rgba(0, 83, 31, .62) 55%, rgba(4, 36, 18, .9)), url("/static/img/sede.jpg") center/cover;
}
.auth-hero img.logo { width: 170px; }
.auth-hero h2 { font-size: 40px; line-height: 1.1; letter-spacing: -.025em; max-width: 14ch; font-weight: 750; }
.auth-hero h2 em { font-style: normal; color: #7ff29a; }
.auth-hero p { color: #d3ecd9; max-width: 44ch; font-size: 16px; margin-top: 16px; }
.auth-points { display: grid; gap: 12px; margin-top: 28px; }
.auth-points div { display: flex; align-items: center; gap: 12px; color: #e5f6ea; font-size: 14.5px; }
.auth-points .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .18); }
.auth-hero small { color: #9bc7a8; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 5vw, 64px); }
.auth-panel .logo-m { display: none; width: 140px; margin-bottom: 26px; }
.auth-panel h1 { font-size: 27px; }
.auth-panel .lead { margin-bottom: 26px; }
.auth-panel .btn-primary { width: 100%; padding: 12px; font-size: 15px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; margin-top: 4px; }
.pw-wrap { position: relative; }
.pw-wrap .toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 6px 8px; color: var(--muted); cursor: pointer; border-radius: 6px; font-size: 12.5px; font-weight: 600; }
.pw-wrap input { padding-right: 70px; }
.secure-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 26px; padding: 12px 14px; border-radius: 10px; background: var(--brand-50); color: var(--ink-2); font-size: 12.5px; }
.err-page { min-height: 60vh; display: grid; place-content: center; text-align: center; gap: 8px; padding: 40px 0; }
.err-page .code { font-family: var(--mono); font-size: 76px; font-weight: 800; color: var(--brand-200); line-height: 1; }

/* ------------------------------------------------------------ responsivo */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
  .content { padding: 26px 24px 60px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: 280px; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-2); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(4, 25, 14, .5); z-index: 30; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--nav-bg); color: #fff; position: sticky; top: 0; z-index: 20; }
  .topbar img { height: 30px; }
  .topbar button { background: rgba(255, 255, 255, .1); border: 0; color: #fff; padding: 8px; border-radius: 8px; display: grid; }
  .content { padding: 20px 16px 50px; }
  .grid-2, .grid-3, .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  h1 { font-size: 23px; }
  .order-head { padding: 20px 18px; }
  .order-head h1 { font-size: 25px; }
  .stepper .step { font-size: 10.5px; }
  .revision { grid-template-columns: 1fr; }
  .revision .big { text-align: left; }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-panel { padding: 34px 22px; min-height: 100vh; }
  .auth-panel .logo-m { display: block; }
  .sheet { padding: 22px 18px; }
}
/* ------------------------------------------------------------ textos legais (privacidade e termos) */
.legal-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.legal-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px clamp(18px, 4vw, 48px); background: var(--card); border-bottom: 1px solid var(--line); }
.legal-head img { height: 34px; display: block; }
.legal { width: 100%; max-width: 880px; margin: 0 auto; padding: 32px clamp(18px, 4vw, 40px) 56px; }
.legal h1 { margin-bottom: 6px; }
.legal .meta { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }
.legal h2 { font-size: 18px; margin: 30px 0 8px; }
.legal p, .legal li { color: var(--ink-2); max-width: 75ch; }
.legal ul, .legal ol { padding-left: 22px; }
.legal li + li { margin-top: 5px; }
.legal .table-wrap { margin: 12px 0; }
.legal mark.todo { background: var(--amber-bg); color: var(--amber-ink); border: 1px dashed var(--amber-line); border-radius: 4px; padding: 0 5px; font-weight: 600; }
.legal-notes { margin-top: 36px; border: 1px dashed var(--amber-line); border-radius: var(--radius); background: var(--amber-bg); padding: 14px 18px; color: var(--amber-ink); font-size: 14px; }
.legal-notes summary { cursor: pointer; font-weight: 700; }
.legal-notes ol { margin: 10px 0 0; }
.legal-notes li { color: var(--amber-ink); }
.legal-foot { margin-top: auto; padding: 18px; text-align: center; font-size: 13px; color: var(--muted); }
.legal-links { font-size: 13px; color: var(--muted); margin-top: 14px; max-width: 46ch; }

@media print {
  .legal-head .btn, .legal-notes { display: none !important; }
  .sidebar, .topbar, .tabs, .actions, .footer, .no-print, .flashes { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .sheet { border: 0; box-shadow: none; padding: 0; }
  .order-head { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
