/* Repinho UI/UX v3.2 — camada visual, sem dependências adicionais */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');
:root{--ui-green:#07826c;--ui-deep:#075e52;--ui-green-soft:#e8f7f0;--ui-bg:#f5f7f7;--ui-text:#172b2a;--ui-muted:#72807d;--ui-border:#e5ebea;--ui-shadow:0 6px 30px rgba(15,43,38,.045)}
body{font-family:'DM Sans',Inter,system-ui,sans-serif!important;background:var(--ui-bg)!important;color:var(--ui-text)!important;font-size:14px}
#appScreen{min-height:100vh}
#appScreen>header{background:#fff!important;border-bottom:1px solid var(--ui-border)!important;box-shadow:none!important;color:var(--ui-text)!important;position:sticky;top:0;z-index:30}
#appScreen>header>div{max-width:1600px!important;padding:18px 34px;gap:20px}
#appScreen>header h1{font-size:15px!important;font-weight:800;color:var(--ui-text)!important;letter-spacing:-.3px}
#appScreen #statusArquivoInfo{color:#85938d!important;font-size:11px}
#navLogoPreview{background:#eff8f4!important;border:1px solid #d8e9e2!important;color:var(--ui-deep);border-radius:12px!important}
#welcomeUser{font-weight:700;color:#425850;font-size:12px}
#appScreen>header button{background:#fff!important;color:#3a5e54!important;border:1px solid #dce8e1!important;border-radius:10px!important;box-shadow:none!important;min-height:36px;white-space:nowrap}
#appScreen>header button:hover{background:#eff7f2!important}
#appScreen main{max-width:1600px!important;display:grid;grid-template-columns:230px minmax(0,1fr);column-gap:26px;align-items:start;padding:25px 34px!important}
#appScreen main>#workspaceNav{display:flex!important;flex-direction:column;gap:5px;background:#fff!important;border:1px solid var(--ui-border)!important;border-radius:17px!important;padding:18px 12px!important;box-shadow:var(--ui-shadow)!important;position:sticky;top:108px;grid-row:1 / span 2;grid-column:1;overflow:visible!important;min-height:calc(100vh - 149px);margin:0!important}
.workspace-nav-title{font-size:10px;color:#99a6a1;font-weight:800;letter-spacing:1.35px;margin:5px 10px 13px}
#workspaceNav button{background:transparent!important;border:0!important;border-radius:10px!important;padding:13px!important;width:100%;text-align:left!important;display:flex;gap:9px;align-items:center;color:#586761!important;font-size:13px!important;font-weight:700!important;transition:background .15s}
#workspaceNav button:hover{background:#f1f6f3!important}
#workspaceNav button.nav-active{background:#e4f5ed!important;color:#04775d!important}
#appScreen main>.tab-content{min-width:0;grid-column:2}
#appScreen main>.tab-content.hidden{display:none!important}
#appScreen .tab-content>div.bg-white,#appScreen form.bg-white,#tabUsuarios>div.bg-white{border:1px solid var(--ui-border)!important;border-radius:18px!important;box-shadow:var(--ui-shadow)!important;background:#fff!important}
#appScreen .bg-emerald-700,#appScreen .bg-emerald-800,#appScreen .primary-action{background:var(--ui-green)!important;color:#fff!important}
#appScreen button.bg-emerald-700,#appScreen button.bg-emerald-800{border-radius:10px!important;min-height:40px}
#appScreen .tab-content h2{letter-spacing:-.55px;color:var(--ui-text)}
#appScreen input:not([type=checkbox]),#appScreen select,#appScreen textarea{border:1px solid #dce5e2!important;border-radius:10px!important;min-height:44px;background:#fff;font-size:13px!important;box-shadow:none!important}
#appScreen input:focus,#appScreen textarea:focus,#appScreen select:focus{outline:2px solid #82cabb!important;outline-offset:1px}
#appScreen label{color:#667a73!important}
#tabNova form>div.border-t h3{font-size:12px;letter-spacing:.08em;color:#225e50}
#tabHistorico table{border-collapse:separate;border-spacing:0;width:100%}
#tabHistorico thead{background:#f7faf9!important}
#tabHistorico thead th{font-size:10px;color:#819089;letter-spacing:.04em;font-weight:800;padding:14px 12px;white-space:nowrap}
#tabelaHistoricoBody .order-row>td{padding:17px 12px!important;border-bottom:1px solid #edf1ef;color:#40574e;font-size:12px}
#tabelaHistoricoBody .order-row:hover{background:#fbfdfc}
#tabelaHistoricoBody .order-row td:first-child strong{color:#075b50;font-size:13px}
.row-actions{min-width:200px}.row-actions button{border-radius:8px;font-weight:700;padding:8px 10px}.row-actions .primary-action{background:#067e68!important}
.status-pill{font-size:10px;border-radius:30px!important;padding:6px 10px}
#tabHistorico .bg-white>div:first-child{gap:16px}
#tabHistorico input#inputBusca{min-width:180px}
#tabUsuarios table th{padding:13px;text-align:left;background:#f8faf9;font-size:11px;color:#71857e}#tabUsuarios table td{padding:12px;border-top:1px solid var(--ui-border)}
.overview-head{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:25px}
.overview-head h2{font-size:28px!important;line-height:1.15;font-weight:800;color:#15342d;margin:4px 0 8px}
.overview-head p:not(.overview-eyebrow){color:#87948f;font-size:13px}
.overview-eyebrow{font-size:10px;letter-spacing:1.5px;color:#07826c;font-weight:800}
.overview-create{background:var(--ui-green);color:white;border-radius:10px;padding:13px 20px;font-weight:800;white-space:nowrap}
.overview-create:hover{background:var(--ui-deep)}
.overview-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px;margin:0 0 20px}
.metric-card{border:1px solid var(--ui-border);background:#fff;border-radius:17px;padding:20px 19px;min-height:152px;box-shadow:var(--ui-shadow)}
.metric-top{display:flex;align-items:center;justify-content:space-between;color:#667871;font-size:12px;font-weight:700;gap:5px}
.metric-icon{display:grid;place-items:center;width:31px;height:31px;border-radius:10px;background:#eaf5f0;color:#148167;font-size:17px}
.metric-card strong{display:block;color:#1c3930;font-size:34px;line-height:1.4;margin:7px 0 0;letter-spacing:-1px}.metric-card p{color:#87948e;font-size:11px}.metric-card.expired .metric-icon{background:#fff3e2;color:#ae7c2a}.metric-card.done .metric-icon{background:#e6f7eb}
.overview-grid{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(270px,1fr);gap:18px}
.overview-panel{background:#fff;border:1px solid var(--ui-border);border-radius:18px;box-shadow:var(--ui-shadow);overflow:hidden}
.overview-panel-header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:21px 23px;border-bottom:1px solid var(--ui-border)}
.overview-panel-header h3{font-weight:800;font-size:16px;letter-spacing:-.3px}.overview-panel-header p{font-size:11px;color:#98a29e;margin-top:4px}
.overview-panel-header button{color:#087d69;font-size:12px;font-weight:800;white-space:nowrap}
.recent-order{display:flex;text-align:left;align-items:center;gap:14px;padding:15px 22px;border-bottom:1px solid #edf2f0;width:100%;transition:background .15s}.recent-order:hover{background:#f8fcfa}.recent-order:last-child{border-bottom:0}
.recent-order-symbol{width:40px;height:42px;display:grid;place-items:center;color:#087b67;background:#e5f3ee;border-radius:10px;font-size:23px;flex-shrink:0}
.recent-order-body{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}.recent-order-body strong{font-size:13px;color:#173c31}.recent-order-body span,.recent-order-body small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#7a8982;font-size:11px}
.recent-order-end{text-align:right;display:flex;flex-direction:column;align-items:flex-end;gap:7px}.recent-order-end small{font-size:10px;color:#07826c;font-weight:700}
.attention-row{display:flex;align-items:center;gap:14px;padding:19px 22px;border-bottom:1px solid #eef3f0}.attention-row:last-child{border-bottom:0}.attention-count{font-size:23px;font-weight:800;width:48px;height:48px;border-radius:14px;background:#e7f5ed;color:#08745e;display:grid;place-items:center}.attention-row.expired .attention-count{background:#fff1e0;color:#ad7d22}.attention-row strong{font-size:13px}.attention-row p{font-size:11px;color:#819089;margin-top:5px}.dashboard-empty{padding:30px;color:#7d8e85}
#loginScreen{background:radial-gradient(circle at 22% 22%,#158f78 0,#085f52 28%,#06463e 66%,#05392f 100%)!important;position:relative;overflow:hidden}
#loginScreen:before{content:'REPINHO  /  GESTÃO FLORESTAL';position:absolute;top:46px;left:5vw;color:#c6e7dc;font-size:11px;font-weight:800;letter-spacing:2px}
#loginScreen:after{content:'';position:absolute;width:650px;height:650px;border:1px solid rgba(255,255,255,.09);border-radius:50%;right:-260px;top:-220px;box-shadow:0 0 0 90px rgba(255,255,255,.022),0 0 0 180px rgba(255,255,255,.017);pointer-events:none}
#loginScreen form{position:relative;z-index:1;border:0!important;max-width:430px!important;border-radius:24px!important;padding:38px!important;box-shadow:0 30px 80px rgba(0,23,18,.22)!important}
#loginScreen form h1{font-size:27px!important;letter-spacing:-1px}#loginScreen form button{background:#07826c!important;min-height:48px;border-radius:11px!important}#loginBrandMark{border-radius:14px}
#modalDetalhe,#modalDistribuicao,#modalMinhaSenha{backdrop-filter:blur(3px)}
#modalDetalhe>div,#modalDistribuicao>div{border-radius:22px!important;box-shadow:0 18px 90px #0b352a35!important}
#blocoAceite{background:#eff9f5!important;border-color:#cbe7dc!important}#blocoAceite label{border:1px solid #d6ece4!important;padding:17px!important;border-radius:12px!important}
#blocoAceite button{background:#07826c!important;border-radius:11px!important;min-height:54px!important}
/* Smartphone: fluxo de aprovação prioritário, com topo, cartões e toques confortáveis. */
@media(max-width:1100px){.overview-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.overview-grid{grid-template-columns:1fr}}
@media(max-width:850px){#appScreen main{grid-template-columns:1fr!important;gap:14px;padding:15px!important}#appScreen main>#workspaceNav{position:relative;top:auto;grid-row:auto;grid-column:1;min-height:0;display:flex!important;flex-direction:row;overflow-x:auto!important;padding:8px!important;border-radius:13px!important;gap:4px}#workspaceNav .workspace-nav-title{display:none}#workspaceNav button{width:auto!important;white-space:nowrap;font-size:12px!important;padding:10px 13px!important}#appScreen main>.tab-content{grid-column:1}#appScreen>header>div{padding:13px 17px}#appScreen>header{position:relative}}
@media(max-width:640px){#loginScreen form{padding:25px!important;border-radius:19px!important}#appScreen>header>div{gap:9px}#appScreen>header>div>div:last-child{justify-content:flex-start;gap:6px}#welcomeUser{display:block;width:100%;font-size:11px}#appScreen>header button{font-size:11px!important;padding:8px!important;min-height:35px}#appScreen #headerCompanyName{font-size:14px!important}.overview-head{align-items:flex-start}.overview-head h2{font-size:23px!important}.overview-create{font-size:12px;padding:11px}.overview-metrics{gap:9px}.metric-card{padding:13px;min-height:123px;border-radius:13px}.metric-top{font-size:10px}.metric-icon{width:27px;height:27px}.metric-card strong{font-size:29px}.metric-card p{font-size:10px}.overview-panel-header{padding:15px}.recent-order{padding:13px}.recent-order-end .status-pill{font-size:9px}.recent-order-symbol{width:35px;height:35px}.attention-row{padding:14px}#tabHistorico table{display:block!important}#tabHistorico thead{display:none!important}#tabHistorico tbody{display:block!important}#tabelaHistoricoBody .order-row{display:block;background:#fff;border:1px solid var(--ui-border);padding:12px!important;margin:10px 0;border-radius:14px;box-shadow:var(--ui-shadow)}#tabelaHistoricoBody .order-row>td{display:block;padding:8px 5px!important;border:0!important}#tabelaHistoricoBody .order-row>td::before{content:attr(data-label);display:block;font-size:10px;text-transform:uppercase;letter-spacing:.8px;color:#8a9991;font-weight:800;margin-bottom:3px}#tabelaHistoricoBody .order-row>td:nth-child(8){display:none}.row-actions{display:grid;grid-template-columns:1fr 1fr;min-width:0}.row-actions button{min-height:43px;font-size:11px}.approval-panel{border-radius:12px}#modalDetalhe,#modalDistribuicao{align-items:stretch!important;padding:0!important}#modalDetalhe>div,#modalDistribuicao>div{width:100%;max-width:none!important;max-height:100dvh!important;height:100dvh;border-radius:0!important;padding:20px 17px calc(32px + env(safe-area-inset-bottom))!important}#detalheCampos{grid-template-columns:1fr 1fr!important}#blocoAceite label{font-size:14px;min-height:76px!important}#blocoAceite label input{width:24px;height:24px}#blocoAceite button{position:sticky;bottom:calc(8px + env(safe-area-inset-bottom));z-index:2;box-shadow:0 7px 28px #0b694c40}}
@media(max-width:380px){#detalheCampos{grid-template-columns:1fr!important}.overview-head{flex-direction:column}.overview-create{width:100%}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition:none!important}}
/* Respeitar permissões existentes: nunca revelar controles ocultos pelo JavaScript. */
#appScreen #workspaceNav button.hidden,#appScreen .tab-content.hidden,#appScreen .admin-only.hidden,#appScreen .superadmin-only.hidden,#appScreen .fiscal-only.hidden{display:none!important}

/* v3.4 — tabelas compactas, navegação iconográfica e header legível */
#appScreen>header{background:#087b68!important;color:#fff!important;border-bottom:0!important}
#appScreen>header h1{color:#fff!important}
#welcomeUser{color:#fff!important;font-size:12px;font-weight:700;opacity:1!important}
#appScreen>header button{background:rgba(255,255,255,.12)!important;color:#fff!important;border:1px solid rgba(255,255,255,.35)!important}
#appScreen>header button:hover{background:rgba(255,255,255,.22)!important}
#appScreen #workspaceNav button.nav-item{display:flex!important;align-items:center!important;gap:12px!important}
#appScreen #workspaceNav button.nav-item.hidden{display:none!important}
.nav-icon{width:20px;height:20px;flex:none;display:inline-flex;justify-content:center;align-items:center;color:currentColor}
.nav-icon svg{width:20px;height:20px;display:block}
.nav-system-footer{margin-top:auto;border-top:1px solid #edf1ef;padding:16px 10px 3px;display:flex;align-items:center;gap:9px;font-size:11px;font-weight:600;color:#64766f;line-height:1.45}
.nav-system-dot{display:inline-block;width:7px;height:7px;background:#10a67a;border-radius:50%;flex:none}
#appScreen #statusArquivoInfo{color:#64766f!important;font-size:11px}
.metric-card{padding:14px 16px!important;min-height:127px!important}
.metric-card strong{font-size:38px!important;font-weight:800;line-height:1.2!important;margin-top:10px!important}
.metric-card p{color:#475569!important}
#tabHistorico>div.bg-white{padding:21px!important}
#tabHistorico .history-table-scroll{overflow:visible;width:100%}
#tabHistorico .history-table{width:100%;border-collapse:collapse;table-layout:fixed}
#tabHistorico .history-table thead{display:table-header-group!important;background:#f5f8f7!important}
#tabHistorico .history-table thead th{font-size:10px!important;letter-spacing:.075em;font-weight:800!important;color:#64748b!important;text-align:left;padding:13px 12px!important}
#tabHistorico .history-table thead th:nth-child(1){width:14%}
#tabHistorico .history-table thead th:nth-child(2){width:23%}
#tabHistorico .history-table thead th:nth-child(3){width:22%}
#tabHistorico .history-table thead th:nth-child(4){width:13%}
#tabHistorico .history-table thead th:nth-child(5){width:19%}
#tabHistorico .history-table thead th:nth-child(6){width:9%;text-align:right}
#tabelaHistoricoBody .order-row>td{padding:16px 12px!important;border-bottom:1px solid #e5ebe8!important;vertical-align:middle!important;color:#334155!important;font-size:12px!important;overflow-wrap:anywhere}
#tabelaHistoricoBody .order-row:hover{background:#f8fbfa}
.history-strong{display:block;font-size:12px;font-weight:700;color:#334155;line-height:1.45}
.history-secondary{display:block;margin-top:5px;font-size:11px;color:#475569;font-weight:500;line-height:1.45}
.order-num-cell{text-align:left}
.order-number-link{font-size:13px;font-weight:800;color:#076f5d;text-align:left;letter-spacing:-.015em}
.order-number-link:hover{text-decoration:underline;text-underline-offset:3px}
.order-date{display:block;margin-top:6px;color:#475569;font-weight:500;font-size:10px;line-height:1.4;white-space:normal}
.history-vigencia{display:block;font-size:11px;font-weight:700;margin-top:5px}
.history-vigencia.expired{color:#b45309}.history-vigencia.valid{color:#08765c}
#tabelaHistoricoBody .status-pill{max-width:100%;white-space:normal;text-align:left;line-height:1.3;padding:5px 8px}
.history-actions{text-align:right}
.history-action-wrap{display:flex;justify-content:flex-end;align-items:center;gap:7px}
#tabelaHistoricoBody .history-action-wrap button{font-size:11px!important;min-height:34px!important;border-radius:9px;padding:8px 10px!important;white-space:nowrap}
#tabelaHistoricoBody .history-action-wrap .op-more{width:35px;display:inline-flex;align-items:center;justify-content:center;padding:6px!important;border:1px solid #d4dfda;background:#fff;color:#475569}
#tabelaHistoricoBody .history-action-wrap .op-more:hover{background:#ecf5f1;color:#075e52}
.history-action-menu{position:fixed;z-index:9999;background:#fff;border:1px solid #d9e5df;border-radius:12px;padding:6px;min-width:205px;box-shadow:0 18px 55px rgba(10,43,35,.18);max-height:70vh;overflow-y:auto}
.history-action-menu button{display:block;width:100%;text-align:left;padding:11px 12px;font-size:12px;color:#334155;font-weight:600;border-radius:8px;line-height:1.3}
.history-action-menu button:hover,.history-action-menu button:focus{background:#edf7f3;outline:0;color:#075e52}
.history-action-menu .danger-menu-item{color:#b42332}
.history-action-menu .danger-menu-item:hover{background:#fff1f2;color:#9b1c2c}
.history-empty{text-align:center;padding:35px!important;color:#64748b;font-size:13px}
@media(max-width:1100px){#tabHistorico .history-table-scroll{overflow-x:auto}#tabHistorico .history-table{min-width:790px}}
@media(max-width:640px){.nav-system-footer{display:none}#welcomeUser{color:#fff!important}#tabHistorico .history-table-scroll{overflow:visible!important}#tabHistorico .history-table{min-width:0!important;display:block!important}#tabHistorico .history-table thead{display:none!important}#tabHistorico .history-table tbody{display:block!important}#tabelaHistoricoBody .order-row{display:block!important;border:1px solid #dfe8e3!important;border-radius:14px!important;margin:12px 0!important;padding:9px 12px!important;background:#fff;box-shadow:0 3px 16px rgba(11,54,40,.035)}#tabelaHistoricoBody .order-row>td{display:block!important;padding:9px 5px!important;border:0!important;text-align:left!important}#tabelaHistoricoBody .order-row>td::before{display:block!important;content:attr(data-label)!important;font-size:10px!important;text-transform:uppercase!important;letter-spacing:.08em!important;color:#718096!important;font-weight:800!important;margin-bottom:4px}#tabelaHistoricoBody .order-row>td:nth-child(6){display:block!important}#tabelaHistoricoBody .history-action-wrap{justify-content:flex-start}#tabelaHistoricoBody .history-action-wrap button{min-height:42px!important}#tabelaHistoricoBody .history-action-wrap .op-more{width:44px}#tabHistorico>div.bg-white{padding:15px!important}.metric-card strong{font-size:32px!important}}
