/* AlempDocs · cores do site alemp.tec.br */
:root {
    --navy: #0b1f3a;
    --navy-2: #12315c;
    --teal: #00c9a7;
    --teal-dark: #0b7a63;
    --blue: #2f7cf6;
    --text: #1a2332;
    --muted: #5b6b81;
    --line: #e4eaf2;
    --line-2: #cfd8e5;
    --bg: #f4f7fb;
    --white: #ffffff;
    --danger: #b42318;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 10px 40px rgba(11, 31, 58, .08);
    --font: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
    --font-display: 'Exo 2', 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--teal-dark); font-weight: 600; text-decoration: none; }
a:hover { color: var(--navy); text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--navy); margin: 0; line-height: 1.2; }
h1 { font-size: clamp(24px, 3vw, 30px); font-weight: 700; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
h2 { font-size: 20px; font-weight: 700; }
.h3 { font-size: 18px; font-weight: 700; }
.h4 { font-size: 16px; font-weight: 700; }
code { background: #eef2f7; padding: 1px 6px; border-radius: 6px; font-size: 14px; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.upper { text-transform: uppercase; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 12px; }
.logo-text { font-family: var(--font-display); font-size: 24px; font-weight: 500; line-height: 1; }
.logo-text b { font-weight: 800; font-style: italic; color: var(--teal); }
.logo-dark .logo-text { color: var(--white); }
.logo-light .logo-text { color: var(--navy); }
.logo-light .logo-text b { color: var(--blue); }

/* Shell: menu lateral + conteúdo */
.shell { min-height: 100vh; display: flex; }
.side { width: 256px; flex: 0 0 256px; background: var(--navy); color: var(--white); padding: 24px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 24px; }
.side-brand:hover { text-decoration: none; }
.side-toggle { display: none; background: transparent; border: 0; color: var(--white); width: 44px; height: 44px; border-radius: 10px; cursor: pointer; align-items: center; justify-content: center; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav > a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: #c9d4e3; font-size: 15px; font-weight: 600; }
.nav > a:hover { background: rgba(255, 255, 255, .06); color: var(--white); text-decoration: none; }
.nav > a.active { background: var(--navy-2); color: var(--white); box-shadow: inset 3px 0 0 var(--teal); }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 14px 4px 0 6px; border-top: 1px solid rgba(255, 255, 255, .1); }
.side-user-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--white); padding: 4px; border-radius: 10px; }
.side-user-link:hover { background: rgba(255, 255, 255, .06); text-decoration: none; color: var(--white); }
.side-user-info { display: flex; flex-direction: column; min-width: 0; }
.side-user-info b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-info small { font-size: 13px; color: #9fb0c6; font-weight: 400; }
.side-user .icon-btn { color: #c9d4e3; }
.side-user .icon-btn:hover { background: rgba(255, 255, 255, .08); color: var(--white); }
.avatar { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; background: var(--navy-2); color: var(--teal); font-weight: 700; display: flex; align-items: center; justify-content: center; }

.main { flex: 1; min-width: 0; padding: 32px clamp(16px, 3vw, 40px) 48px; display: flex; flex-direction: column; gap: 24px; }

@media (max-width: 900px) {
    .shell { flex-direction: column; }
    .side { width: 100%; flex: none; height: auto; position: sticky; top: 0; z-index: 20; padding: 10px 12px; }
    .side-top { padding: 0 4px; }
    .side-toggle { display: inline-flex; }
    .nav { display: none; padding-top: 12px; }
    .side.open .nav { display: flex; }
    .side.open { max-height: 100vh; overflow-y: auto; }
    .main { padding-top: 20px; }
}

/* Cabeçalho de página */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head > div:first-child { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.page-head p { margin: 0; }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid transparent; font-family: var(--font-display); font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-2); color: var(--white); }
.btn-accent { background: var(--teal); color: var(--navy); }
.btn-accent:hover { background: #00b394; color: var(--navy); }
.btn-ghost { background: var(--white); color: var(--navy); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn-danger-ghost { background: var(--white); color: var(--danger); border-color: #f1c4bf; }
.btn-danger-ghost:hover { border-color: var(--danger); color: var(--danger); }
.btn-lg { min-height: 50px; font-size: 16px; padding: 0 22px; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 46px; min-height: 46px; padding: 0; flex: 0 0 46px; }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn.loading { opacity: .7; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-row.end { justify-content: flex-end; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--navy-2); cursor: pointer; }
.icon-btn:hover { background: #eef2f7; color: var(--navy); }

/* Cards */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 22px clamp(16px, 2.4vw, 26px); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head-wrap { flex-wrap: wrap; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line); }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.narrow { max-width: 760px; width: 100%; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty p { margin: 0; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; color: var(--text); font-weight: 400; }
a.kpi:hover { border-color: var(--line-2); box-shadow: var(--shadow); text-decoration: none; color: var(--text); }
.kpi-label { display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 600; color: var(--muted); }
.kpi strong { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.kpi small { font-size: 14px; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.dot-gray { background: #9fb0c6; } .dot-blue { background: var(--blue); } .dot-teal { background: var(--teal); } .dot-navy { background: var(--navy); }
.dot-p0 { background: #d64534; } .dot-p1 { background: #f08c00; } .dot-p2 { background: var(--blue); } .dot-p3 { background: #9fb0c6; }

/* Layout em duas colunas que empilha no celular */
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split-main { flex: 999 1 560px; min-width: 0; }
.split-side { flex: 1 1 300px; min-width: 0; }
.split-doc .split-main { flex-basis: 640px; }

/* Tabelas */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; padding: 12px 10px; white-space: nowrap; }
.table td { padding: 12px 10px; border-top: 1px solid #eef2f7; vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 18px; }
.table tbody tr:hover { background: #f8fafd; }
.table .num { text-align: right; }
.table .actions { text-align: right; width: 1%; }
.table:not(.table-edit) { min-width: 720px; }
.cell-2 { display: flex; flex-direction: column; gap: 2px; }
.cell-2 small { font-size: 13px; color: var(--muted); }
.table-edit td { padding: 8px 6px; }
.table-edit input { min-height: 42px; }
.sla-mini { width: 100%; border-collapse: collapse; font-size: 15px; }
.sla-mini th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; padding-bottom: 6px; }
.sla-mini td { padding: 9px 0; border-top: 1px solid #eef2f7; }
.sla-mini td:first-child { font-weight: 600; }
.sla-mini .dot { margin-right: 6px; }

/* Status */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-family: var(--font); font-size: 13px; font-weight: 700; white-space: nowrap; vertical-align: middle; }
.pill-rascunho, .pill-cancelada { background: #eef2f7; color: #3d4b5f; }
.pill-enviada { background: #e6effe; color: #1c4fa8; }
.pill-visualizada { background: #fff3df; color: #8a4b00; }
.pill-aceita { background: #e0f7f2; color: #0b6b56; }
.pill-recusada { background: #fde8e6; color: #a1281b; }
.pill-vencida { background: #fff; color: #a1281b; border: 1px solid #f1c4bf; }

/* Filtros e busca */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--white); color: #3d4b5f; font-size: 14px; }
.chip:hover { border-color: var(--navy); color: var(--navy); text-decoration: none; }
.chip.active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 40px; width: 300px; max-width: 100%; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Formulários */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label-row label { font-size: 15px; font-weight: 600; color: var(--text); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.label-row a { font-size: 14px; }
.req { color: var(--danger); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
    width: 100%; min-height: 46px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 14px;
    font: inherit; font-size: 16px; color: var(--text); background: var(--white);
}
textarea { resize: vertical; line-height: 1.5; }
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' stroke='%235b6b81' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47, 124, 246, .15); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
input[type=file] { font: inherit; font-size: 15px; }
.help { margin: 0; font-size: 14px; color: var(--muted); }
.help.ok { color: var(--teal-dark); }
.help.warn { color: #8a4b00; }
.error { margin: 0; font-size: 14px; color: var(--danger); font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); flex: 0 0 20px; }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; min-width: 0; }
.input-icon { position: relative; }
.input-icon input { padding-right: 52px; }
.input-icon .icon-btn { position: absolute; right: 3px; top: 3px; width: 44px; height: 40px; color: var(--muted); }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line-2); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: #f4f7fb; color: var(--muted); font-size: 15px; }
.input-prefix input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; min-width: 0; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.grid > * { grid-column: span 12; }
@media (min-width: 720px) {
    .col-2 { grid-column: span 2 !important; } .col-3 { grid-column: span 3 !important; } .col-4 { grid-column: span 4 !important; }
    .col-5 { grid-column: span 5 !important; } .col-6 { grid-column: span 6 !important; } .col-8 { grid-column: span 8 !important; }
}
@media (min-width: 480px) and (max-width: 719px) {
    .col-2, .col-3 { grid-column: span 6 !important; }
}
.cnpj-badge-slot { display: flex; align-items: center; padding-top: 22px; }
.cnpj-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: #e0f7f2; color: #0b6b56; font-size: 14px; font-weight: 600; }
.cnpj-badge.warn { background: #fff3df; color: #8a4b00; }
@media (max-width: 719px) { .cnpj-badge-slot { padding-top: 0; } .cnpj-badge-slot:empty { display: none; } }

.step { display: flex; align-items: center; gap: 12px; }
.step span { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: var(--teal); font-family: var(--font-display); font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 32px; }
.proposal-form { display: flex; flex-direction: column; gap: 20px; }

/* Itens da proposta */
.item-row { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; background: #fbfcfe; }
.item-grid { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 12px; align-items: end; }
.item-grid > .field, .item-grid > .item-total { grid-column: 1 / 2; }
.item-remove { grid-column: 2; grid-row: 1; align-self: end; }
.item-total { display: flex; flex-direction: column; gap: 2px; }
.item-total strong { font-family: var(--font-display); font-size: 18px; color: var(--navy); min-height: 46px; display: flex; align-items: center; }
@media (min-width: 900px) {
    .item-grid { grid-template-columns: 200px minmax(0, 1fr) 90px 150px 120px 130px 44px; }
    .item-grid > .field, .item-grid > .item-total { grid-column: auto; }
    .item-remove { grid-column: 7; grid-row: 1; margin-bottom: 1px; }
    .item-details { grid-column: 2 / 7 !important; }
    .item-total strong { justify-content: flex-end; }
    .item-total span { text-align: right; }
}
.items-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 14px; }
.totals { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 260px; }
.totals div { display: flex; justify-content: space-between; gap: 24px; padding: 10px 14px; border-radius: 10px; background: var(--bg); }
.totals div:first-child { background: var(--navy); color: var(--white); }
.totals dt { font-weight: 600; }
.totals dd { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.action-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px clamp(16px, 2vw, 22px); background: rgba(255, 255, 255, .96); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -6px 24px rgba(11, 31, 58, .06); }
.action-bar .btn-danger-ghost { margin-right: auto; }

/* Alertas */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); font-size: 15px; border: 1px solid; }
.alert svg { flex: 0 0 20px; margin-top: 1px; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert-success { background: #e9f9f5; border-color: #a8e6d8; color: #0b5a48; }
.alert-warning { background: #fff7e8; border-color: #f5d49a; color: #6e3c00; }
.alert-error { background: #fdeeec; border-color: #f1c4bf; color: #8d1f14; }

/* Pré-visualização do documento */
.preview-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.preview-bar span { display: inline-flex; align-items: center; gap: 6px; }
.paper { background: var(--white); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); padding: clamp(18px, 5vw, 56px); max-width: 860px; overflow-x: auto; }
.facts { margin: 0; display: flex; flex-direction: column; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid #eef2f7; font-size: 15px; }
.facts div:first-child { border-top: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.timeline li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.timeline li div { display: flex; flex-direction: column; min-width: 0; word-break: break-word; }
.attach { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--bg); }
.attach div { flex: 1; display: flex; flex-direction: column; min-width: 0; word-break: break-all; }
.attach svg { color: var(--navy-2); }

/* Empresa */
.company-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.company-logo { max-height: 56px; max-width: 200px; object-fit: contain; border-radius: 8px; }
.company-logo-empty { width: 56px; height: 56px; border-radius: 12px; background: var(--bg); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.logo-upload { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }

/* Login */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth-hero { flex: 1 1 480px; background: var(--navy); color: var(--white); padding: 48px clamp(24px, 6vw, 88px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-hero .logo-text { font-size: 30px; }
.auth-pitch { display: flex; flex-direction: column; gap: 24px; max-width: 520px; }
.auth-pitch h1 { color: var(--white); font-size: clamp(28px, 3.4vw, 44px); line-height: 1.15; display: block; }
.auth-pitch p { margin: 0; font-size: 18px; line-height: 1.6; color: #c9d4e3; }
.auth-pitch ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-pitch li { display: flex; align-items: center; gap: 12px; }
.auth-pitch li span { width: 32px; height: 32px; border-radius: 10px; background: rgba(0, 201, 167, .15); color: var(--teal); display: flex; align-items: center; justify-content: center; flex: 0 0 32px; }
.auth-foot { margin: 0; font-size: 14px; color: #9fb0c6; }
.auth-main { flex: 1 1 440px; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 36px clamp(20px, 4vw, 40px); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }
.auth-title { display: flex; flex-direction: column; gap: 6px; }
.auth-title h2 { font-size: 28px; }
.auth-title p { margin: 0; color: var(--muted); }
.secure-note { margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; color: var(--muted); }
@media (max-width: 760px) {
    .auth-hero { padding: 28px 20px; gap: 20px; }
    .auth-pitch h1 { font-size: 24px; }
    .auth-pitch p, .auth-pitch ul, .auth-foot { display: none; }
}

@media print {
    .side, .page-head, .preview-bar, .split-side, .alert { display: none !important; }
    .main { padding: 0; }
    .paper { border: 0; box-shadow: none; padding: 0; }
}
