@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  font-family: 'DM Sans', sans-serif;
  color: #18251f;
  background: #f5f7f3;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --green: #176b4b;
  --muted: #77837c;
  --line: #e5e9e4;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
.page-shell { max-width: 1056px; margin: 0 auto; padding: 0 28px; }
.page-header { height: 78px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.brand { font: 800 19px Manrope, sans-serif; letter-spacing: -.7px; color: #203a2d; text-decoration: none; }
.brand span { display: block; margin-top: 2px; color: #8a968e; font: 700 8px 'DM Sans', sans-serif; letter-spacing: 2px; }
.header-note, .eyebrow { color: #829087; font-size: 10px; font-weight: 700; letter-spacing: 1.4px; }
.header-link { color: var(--green); font-size: 12px; font-weight: 600; text-decoration: none; }
.header-link:hover, .breadcrumb:hover { text-decoration: underline; }
.breadcrumb { color: inherit; text-decoration: none; }
.intro { padding: 46px 0 26px; }
.intro .eyebrow { margin: 0 0 12px; color: var(--green); }
h1, h2 { font-family: Manrope, sans-serif; letter-spacing: -1.1px; }
h1 { margin: 0; font-size: clamp(30px, 5vw, 38px); line-height: 1.2; }
.lead { margin: 10px 0 0; color: #748078; font-size: 14px; }
.form-card { background: #fff; border: 1px solid #e8ece7; border-radius: 12px; padding: 30px 34px 26px; box-shadow: 0 10px 32px #1e33210a; }
.card-heading { display: flex; justify-content: space-between; align-items: end; padding-bottom: 21px; border-bottom: 1px solid #edf0ec; }
.card-heading .eyebrow { margin: 0 0 6px; color: var(--green); }
h2 { margin: 0; font-size: 18px; letter-spacing: -.4px; }
.required-note { color: #8a948e; font-size: 11px; }
form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; padding-top: 22px; }
.full-width { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 600; color: #35433b; }
.field label span { color: #c36b4e; }
input, textarea, select { width: 100%; border: 1px solid #dfe5df; border-radius: 6px; background: #fff; color: #26352c; font: 13px 'DM Sans', sans-serif; outline: none; transition: border .15s, box-shadow .15s; }
input, select { height: 42px; padding: 0 12px; }
textarea { min-height: 82px; padding: 11px 12px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #abb4ae; }
input:focus, textarea:focus, select:focus { border-color: #61a282; box-shadow: 0 0 0 3px #176b4b15; }
[aria-invalid="true"] { border-color: #c65353; }
.money-input { position: relative; }
.money-input > span { position: absolute; left: 12px; top: 13px; font-size: 12px; color: #829087; }
.money-input input { padding-left: 38px; }
.error { display: block; min-height: 0; color: #b43b3b; font-size: 11px; }
.error:empty { display: none; }
.form-message { min-height: 0; font-size: 12px; }
.form-message:not(:empty) { padding: 11px 13px; border-radius: 6px; }
.is-error { color: #963d37; background: #fff2f0; }
.is-success { color: #176b4b; background: #edf8f1; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid #edf0ec; padding-top: 18px; margin-top: 1px; }
.form-actions p { margin: 0; max-width: 430px; color: #859088; font-size: 11px; line-height: 1.6; }
button { min-height: 43px; padding: 0 18px; border: 0; border-radius: 6px; color: #fff; background: var(--green); font: 600 12px 'DM Sans', sans-serif; cursor: pointer; transition: background .15s; }
button:hover { background: #10593d; }
button:disabled { opacity: .65; cursor: wait; }
button span { margin-left: 9px; font-size: 16px; vertical-align: -1px; }
footer { padding: 25px 0; color: #9aa39d; font-size: 10px; letter-spacing: .5px; }
footer span { padding: 0 4px; color: #4f8b6b; }
.home-intro { padding-top: 62px; padding-bottom: 34px; }
.home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.home-card { position: relative; display: flex; min-height: 244px; flex-direction: column; align-items: flex-start; padding: 25px 27px; border: 1px solid #e4eae3; border-radius: 10px; background: #fff; color: inherit; text-decoration: none; box-shadow: 0 8px 28px #1e332108; transition: border-color .16s, transform .16s, box-shadow .16s; }
.home-card:hover { transform: translateY(-2px); border-color: #a9c9b6; box-shadow: 0 12px 32px #1e332110; }
.home-card-icon { display: grid; width: 38px; height: 38px; margin-bottom: 25px; place-items: center; border-radius: 8px; background: #edf6ef; color: var(--green); font-size: 24px; }
.home-card-icon.list-icon { font-size: 19px; }
.home-card .eyebrow { margin: 0 0 8px; color: var(--green); }
.home-card strong { font: 700 19px Manrope, sans-serif; letter-spacing: -.4px; }
.home-card-description { max-width: 310px; margin-top: 8px; color: #77837c; font-size: 12px; line-height: 1.6; }
.home-card-link { margin-top: auto; padding-top: 22px; color: var(--green); font-size: 12px; font-weight: 700; }
.home-card-link span { margin-left: 6px; font-size: 16px; }
.home-note { display: flex; align-items: center; gap: 14px; margin-top: 20px; padding: 15px 18px; border: 1px solid #e7ece6; border-radius: 8px; background: #f9fbf8; }
.home-note-mark { color: #6d9b7c; font-size: 20px; }
.home-note p { margin: 0; color: #77837c; font-size: 11px; line-height: 1.7; }
.home-note strong { color: #34473b; font-size: 12px; }
.projects-intro { padding-bottom: 27px; }
.projects-title-row { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.projects-title-row .lead { margin-top: 8px; }
.button-link { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 0 16px; border-radius: 6px; background: var(--green); color: white; font-size: 12px; font-weight: 600; text-decoration: none; }
.button-link:hover { background: #10593d; }
.projects-panel { padding: 25px 28px 8px; border: 1px solid #e8ece7; border-radius: 10px; background: #fff; box-shadow: 0 10px 32px #1e33210a; }
.projects-panel-heading { display: flex; align-items: end; justify-content: space-between; padding-bottom: 19px; border-bottom: 1px solid #edf0ec; }
.projects-panel-heading .eyebrow { margin: 0 0 6px; color: var(--green); }
.project-count { color: #89948d; font-size: 11px; }
.projects-message { padding: 30px 10px; color: #77837c; font-size: 12px; text-align: center; }
.projects-message[hidden] { display: none; }
.empty-state strong { display: inline-block; margin-bottom: 6px; color: #314338; font: 700 16px Manrope, sans-serif; }
.projects-list { display: flex; flex-direction: column; }
.project-row { display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(165px, 1fr) minmax(115px, .7fr) auto; align-items: center; gap: 20px; padding: 20px 0; border-bottom: 1px solid #edf0ec; }
.project-row:last-child { border-bottom: 0; }
.project-main h3 { margin: 0; overflow-wrap: anywhere; font: 700 14px Manrope, sans-serif; }
.project-main p { display: -webkit-box; margin: 5px 0 0; overflow: hidden; color: #859088; font-size: 11px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.project-dates, .project-budget { display: flex; flex-direction: column; gap: 5px; }
.project-dates span, .project-budget span { color: #96a099; font-size: 9px; font-weight: 700; letter-spacing: .8px; }
.project-dates strong, .project-budget strong { color: #35443b; font-size: 11px; font-weight: 600; }
.status-badge { justify-self: end; padding: 6px 9px; border-radius: 20px; background: #f0f3f1; color: #65736a; font-size: 10px; font-weight: 600; white-space: nowrap; }
.status-planning { background: #f2f3ed; color: #71734f; }
.status-in_progress { background: #eaf4ed; color: #347250; }
.status-on_hold { background: #fff3e6; color: #9a6826; }
.status-completed { background: #edf0f8; color: #5b6691; }
.home-card-icon.finance-icon { font-size: 13px; font-weight: 700; }
.project-row { grid-template-columns: minmax(150px, 1.5fr) minmax(150px, 1fr) minmax(110px, .7fr) auto auto; }
.project-financial-link { justify-self: end; color: var(--green); font-size: 11px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.project-financial-link:hover { text-decoration: underline; }
.finance-intro { padding-bottom: 20px; }
.project-search { display: flex; align-items: end; gap: 14px; padding: 17px 20px; border: 1px solid #e6ebe5; border-radius: 9px; background: #fff; box-shadow: 0 8px 24px #1e332108; }
.project-search .field { flex: 1; }
.project-search button { white-space: nowrap; }
.finance-message { padding: 13px 2px 18px; color: #77837c; font-size: 12px; }
.finance-message.is-error { padding: 12px 14px; margin: 10px 0 16px; border-radius: 6px; }
.finance-message.is-success { color: #176b4b; }
.finance-dashboard[hidden] { display: none; }
.finance-project-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 10px 0 20px; }
.finance-project-heading .eyebrow { margin: 0 0 7px; color: var(--green); }
.finance-project-heading h2 { overflow-wrap: anywhere; font-size: 21px; }
.finance-period, .budget-heading > div { display: flex; flex-direction: column; gap: 5px; }
.finance-period span, .budget-heading span { color: #919b94; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.finance-period strong, .budget-heading strong { color: #35443b; font-size: 12px; font-weight: 600; }
.finance-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.finance-kpi { min-width: 0; padding: 17px 16px 15px; border: 1px solid #e7ece6; border-radius: 8px; background: #fff; }
.finance-kpi > span { display: block; min-height: 25px; color: #829087; font-size: 9px; font-weight: 700; letter-spacing: .7px; line-height: 1.45; }
.finance-kpi > strong { display: block; overflow-wrap: anywhere; margin-top: 7px; color: #243a2d; font: 700 17px Manrope, sans-serif; letter-spacing: -.5px; }
.finance-kpi > small { display: block; margin-top: 7px; color: #8a958e; font-size: 10px; }
.balance-kpi { border-color: #cbded0; background: #f5faf6; }
.budget-panel { margin-top: 13px; padding: 18px 20px 14px; border: 1px solid #e7ece6; border-radius: 8px; background: #fff; }
.budget-heading { display: flex; justify-content: space-between; gap: 15px; }
.budget-used-label { align-items: flex-end; }
.budget-track, .category-track { height: 7px; overflow: hidden; border-radius: 10px; background: #edf1ed; }
.budget-track { margin-top: 15px; }
.budget-track > span, .category-track > span { display: block; height: 100%; border-radius: inherit; background: #43845e; transition: width .2s ease; }
.budget-remaining { margin: 8px 0 0; color: #849087; font-size: 10px; text-align: right; }
.finance-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.finance-panel { min-width: 0; padding: 20px 22px; border: 1px solid #e7ece6; border-radius: 8px; background: #fff; }
.finance-panel-heading { display: flex; justify-content: space-between; padding-bottom: 15px; border-bottom: 1px solid #edf0ec; }
.finance-panel-heading .eyebrow { margin: 0 0 6px; color: var(--green); }
.finance-panel-heading h2 { font-size: 16px; }
.comparison-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.comparison-table th, .comparison-table td { padding: 12px 5px; border-bottom: 1px solid #f0f2ef; text-align: left; }
.comparison-table th { color: #929d95; font-size: 9px; font-weight: 700; letter-spacing: .5px; }
.comparison-table th:not(:first-child), .comparison-table td:not(:first-child) { text-align: right; }
.comparison-table td { color: #58665d; }
.comparison-table .comparison-total td { border-bottom: 0; color: #263c2e; font-weight: 700; }
.category-list { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; }
.category-row { display: flex; flex-direction: column; gap: 7px; }
.category-heading { display: flex; justify-content: space-between; gap: 12px; }
.category-heading strong { overflow-wrap: anywhere; color: #49584e; font-size: 11px; font-weight: 600; }
.category-heading span { color: #35443b; font-size: 11px; font-weight: 700; white-space: nowrap; }
.category-row small { color: #9aa39d; font-size: 9px; }
.category-track { height: 5px; }
.payment-panel { grid-column: 1 / -1; }
.payment-status-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; padding-top: 15px; }
.payment-status-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 12px; border: 1px solid #edf0ec; border-radius: 6px; }
.payment-status-dot { position: relative; padding-left: 13px; color: #4b5b50; font-size: 11px; font-weight: 600; }
.payment-status-dot::before { position: absolute; top: 4px; left: 0; width: 7px; height: 7px; border-radius: 50%; background: #d4a34f; content: ''; }
.payment-paid::before { background: #4d9868; }
.payment-overdue::before { background: #c75b51; }
.payment-cancelled::before { background: #a1aaa4; }
.payment-status-row small { color: #99a29c; font-size: 9px; }
.payment-status-row strong { grid-column: 2; grid-row: 1 / span 2; color: #35443b; font-size: 11px; }
.panel-empty { padding: 18px 0 2px; color: #909b93; font-size: 11px; text-align: center; }
@media (max-width: 650px) {
  .page-shell { padding: 0 17px; }
  .intro { padding-top: 34px; }
  .home-intro { padding-top: 42px; }
  .home-grid { grid-template-columns: 1fr; }
  .home-card { min-height: 218px; }
  .projects-title-row { align-items: flex-start; flex-direction: column; }
  .projects-panel { padding: 20px 17px 6px; }
  .project-row { grid-template-columns: 1fr auto; gap: 13px; }
  .project-main { grid-column: 1 / -1; }
  .status-badge { grid-column: 2; grid-row: 2; }
  .project-financial-link { grid-column: 1 / -1; justify-self: start; }
  .project-dates { grid-column: 1; }
  .project-budget { grid-column: 1; }
  .finance-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-kpi:last-child { grid-column: 1 / -1; }
  .finance-project-heading { align-items: flex-start; flex-direction: column; }
  .project-search { align-items: stretch; flex-direction: column; }
  .project-search button { width: 100%; }
  .finance-details-grid { grid-template-columns: 1fr; }
  .payment-panel { grid-column: auto; }
  .form-card { padding: 22px 18px; }
  form { grid-template-columns: 1fr; gap: 15px; }
  .full-width { grid-column: auto; }
  .form-actions { align-items: stretch; flex-direction: column; }
  button { width: 100%; }
}

.projects-title-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.project-links { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.home-card-icon.purchase-icon { font-size: 18px; }
.purchase-total { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border: 1px solid #cbded0; border-radius: 8px; background: #f5faf6; }
.purchase-total span, .review-total span, .success-summary span { display: block; color: #829087; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.purchase-total small { display: block; margin-top: 5px; color: #8a958e; font-size: 11px; }
.purchase-total output { color: #203a2d; font: 800 22px Manrope, sans-serif; letter-spacing: -.6px; white-space: nowrap; }
.purchase-review, .purchase-success { padding-top: 22px; }
.purchase-review[hidden], .purchase-success[hidden], #purchase-form[hidden] { display: none; }
.review-intro { margin: 0 0 14px; color: #6e7a72; font-size: 12px; }
.review-list { display: grid; grid-template-columns: minmax(130px, 200px) 1fr; margin: 0; border-top: 1px solid #edf0ec; }
.review-list dt, .review-list dd { margin: 0; padding: 11px 0; border-bottom: 1px solid #edf0ec; font-size: 12px; }
.review-list dt { color: #829087; font-weight: 600; }
.review-list dd { color: #26352c; font-weight: 600; overflow-wrap: anywhere; }
.review-total { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 14px; padding: 15px 18px; border-radius: 8px; background: #f5faf6; border: 1px solid #cbded0; }
.review-total strong { color: #203a2d; font: 800 22px Manrope, sans-serif; }
.review-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 1px solid #edf0ec; }
.button-secondary { color: var(--green); background: #fff; border: 1px solid #cfe0d4; }
.button-secondary:hover { background: #f1f7f2; }
.button-link-secondary { color: var(--green); background: #fff; border: 1px solid #cfe0d4; }
.button-link-secondary:hover { background: #f1f7f2; }
.purchase-success { text-align: center; }
.success-mark { display: inline-grid; width: 44px; height: 44px; place-items: center; border-radius: 50%; background: #edf8f1; color: var(--green); font-size: 22px; font-weight: 700; }
.purchase-success h2 { margin-top: 12px; }
.purchase-success p { max-width: 560px; margin: 8px auto 0; color: #6e7a72; font-size: 12px; line-height: 1.6; }
.success-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 20px; text-align: left; }
.success-summary div { padding: 14px 16px; border: 1px solid #e7ece6; border-radius: 8px; }
.success-summary strong { display: block; margin-top: 6px; color: #243a2d; font: 700 16px Manrope, sans-serif; }
.success-summary strong.is-negative { color: #b43b3b; background: none; }
.purchase-success .review-actions { justify-content: center; }
.home-grid.home-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-grid.home-grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-grid.home-grid-7 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-grid.home-grid-7 > :last-child { grid-column: 2; }
.home-card-icon.category-icon, .home-card-icon.expense-icon { font-size: 18px; }
.field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.field-label-row label { margin-bottom: 0; }
.field-inline-link { color: var(--green); font-size: 11px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.field-inline-link:hover { text-decoration: underline; }
.categories-panel { margin-top: 22px; padding-bottom: 24px; }
.categories-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding-top: 18px; }
.category-chip-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border: 1px solid #e7ece6; border-radius: 8px; background: #fafcfa; }
.category-chip-card strong { color: #243a2d; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
#expense-form[hidden] { display: none; }
.employee-payment-search, .employee-payment-editor { padding: 22px 25px; border: 1px solid #e7ece6; border-radius: 9px; background: #fff; box-shadow: 0 8px 24px #1e332108; }
.employee-payment-editor { margin-top: 22px; }
.employee-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-bottom: 16px; border-bottom: 1px solid #edf0ec; }
.employee-section-heading .eyebrow { margin: 0 0 6px; color: var(--green); }
.employee-section-heading h2 { font-size: 17px; }
.employee-section-heading button { white-space: nowrap; }
.payment-search-form { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr auto; align-items: end; gap: 13px; padding-top: 18px; }
.employee-payments-list { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.employee-payment-card { display: grid; grid-template-columns: minmax(145px, 1.3fr) minmax(100px, .8fr) minmax(130px, 1fr) auto auto; align-items: center; gap: 15px; width: 100%; padding: 15px 16px; border: 1px solid #e7ece6; border-radius: 8px; background: #fff; color: inherit; text-align: left; }
.employee-payment-card:hover, .employee-payment-card.is-selected { border-color: #90b99d; background: #f8fbf8; }
.employee-payment-main, .employee-payment-dates { display: flex; flex-direction: column; gap: 5px; }
.employee-payment-main strong { color: #2c4033; font-size: 12px; overflow-wrap: anywhere; }
.employee-payment-main small, .employee-payment-dates small { color: #859088; font-size: 10px; }
.employee-payment-value { color: #243a2d; font: 700 13px Manrope, sans-serif; white-space: nowrap; }
.employee-payment-select { color: var(--green); font-size: 10px; font-weight: 700; white-space: nowrap; }
.employee-payment-card .status-badge { justify-self: start; }
.payment-status-planned { background: #f2f3ed; color: #71734f; }
.payment-status-pending { background: #fff3e6; color: #9a6826; }
.payment-status-paid { background: #eaf4ed; color: #347250; }
.payment-status-cancelled { background: #f0f1f0; color: #717a74; }
.employee-not-found { padding: 20px 15px; border: 1px dashed #dce4dc; border-radius: 8px; color: #77837c; font-size: 12px; text-align: center; }
.employee-not-found[hidden], .employee-payments-list[hidden] { display: none; }
.employee-editor-note { color: #77837c; font-size: 11px; line-height: 1.6; }
.employee-payment-form { padding-top: 12px; }
@media (max-width: 650px) {
  .purchase-total, .review-total { flex-direction: column; align-items: flex-start; }
  .review-list { grid-template-columns: 1fr; }
  .review-list dt { padding-bottom: 0; border-bottom: 0; }
  .review-actions { flex-direction: column-reverse; }
  .success-summary { grid-template-columns: 1fr; }
  .home-grid.home-grid-4, .home-grid.home-grid-6, .home-grid.home-grid-7 { grid-template-columns: 1fr; }
  .home-grid.home-grid-7 > :last-child { grid-column: auto; }
  .project-links { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; gap: 16px; }
  .employee-payment-search, .employee-payment-editor { padding: 19px 16px; }
  .employee-section-heading { align-items: flex-start; flex-direction: column; }
  .payment-search-form { grid-template-columns: 1fr; }
  .payment-search-form button { width: 100%; }
  .employee-payment-card { grid-template-columns: 1fr auto; gap: 9px 12px; }
  .employee-payment-value { grid-column: 2; grid-row: 1; }
  .employee-payment-dates { grid-column: 1; }
  .employee-payment-card .status-badge { grid-column: 2; grid-row: 2; }
  .employee-payment-select { grid-column: 1 / -1; }
}

/* Notas fiscais: lista de compras e modal "Anexar Nota Fiscal" */
.purchases-panel { margin-top: 18px; }
.project-row.purchase-row { grid-template-columns: minmax(150px, 1.4fr) minmax(95px, .6fr) minmax(130px, .9fr) minmax(100px, .7fr) auto; }
.purchase-invoices { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: 220px; }
.purchase-invoices .project-financial-link { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.attach-invoice-button { min-height: 34px; padding: 0 12px; font-size: 11px; white-space: nowrap; }
.fiscal-dialog { width: min(520px, calc(100vw - 32px)); padding: 26px 28px 22px; border: 1px solid #e8ece7; border-radius: 12px; color: inherit; box-shadow: 0 18px 48px #1e33212e; }
.fiscal-dialog::backdrop { background: #18251f66; }
.fiscal-dialog .card-heading { align-items: flex-start; padding-bottom: 16px; }
.fiscal-dialog form { grid-template-columns: 1fr; padding-top: 16px; }
.fiscal-dialog .review-actions { margin-top: 4px; }
.fiscal-dialog-close { min-height: 32px; width: 32px; padding: 0; color: #6e7a72; background: transparent; font-size: 22px; line-height: 1; }
.fiscal-dialog-close:hover { background: #f1f7f2; }
.fiscal-dialog-purchase { margin: 14px 0 0; color: #6e7a72; font-size: 12px; overflow-wrap: anywhere; }
.fiscal-dialog input[type="file"] { height: auto; padding: 10px 12px; cursor: pointer; }
.field-hint { display: block; margin-top: 6px; color: #8a958e; font-size: 11px; }
.fiscal-preview { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid #e7ece6; border-radius: 8px; background: #fafcfa; }
.fiscal-preview[hidden] { display: none; }
.fiscal-preview img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid #e7ece6; }
.fiscal-preview-icon { display: grid; width: 52px; height: 64px; place-items: center; border-radius: 6px; background: #fff2f0; color: #963d37; font: 800 12px Manrope, sans-serif; }
.fiscal-preview-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fiscal-preview-info strong { color: #243a2d; font-size: 12px; overflow-wrap: anywhere; }
.fiscal-preview-info small { color: #8a958e; font-size: 11px; }
.fiscal-camera-trigger { min-height: 30px; padding: 0 11px; font-size: 11px; }
.fiscal-camera-panel { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid #e7ece6; border-radius: 8px; background: #fafcfa; }
.fiscal-camera-panel[hidden] { display: none; }
#fiscal-camera-video { width: 100%; max-height: 240px; border-radius: 6px; background: #18251f; object-fit: cover; }
.fiscal-camera-actions { display: flex; justify-content: flex-end; gap: 10px; }
.fiscal-extracted { padding: 14px 16px; border: 1px solid #cbded0; border-radius: 8px; background: #f5faf6; }
.fiscal-extracted[hidden] { display: none; }
.fiscal-extracted-title { margin: 0 0 8px; color: var(--green); }
.fiscal-extracted-list { grid-template-columns: minmax(120px, 155px) 1fr; }
.fiscal-extracted-list dt, .fiscal-extracted-list dd { padding: 7px 0; font-size: 11px; }
.fiscal-extracted-items { list-style: none; margin: 6px 0 0; padding: 0; border-top: 1px solid #dfeae2; }
.fiscal-extracted-items li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid #dfeae2; font-size: 11px; color: #35443b; }
.fiscal-extracted-items li:last-child { border-bottom: 0; }
.fiscal-extracted-note { margin: 0; color: #6e7a72; font-size: 11px; line-height: 1.5; }
.purchase-invoice-meta { color: #748078; font-size: 10px; }
.purchase-invoice-review-btn { min-height: 24px; padding: 0 8px; border: 1px solid #cfe0d4; border-radius: 4px; background: #f5faf6; color: var(--green); font-size: 10px; font-weight: 600; }
.purchase-invoice-review-btn:hover { background: #e8f4ec; }
.fiscal-dialog { width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 36px); overflow-y: auto; }
.fiscal-review-section { display: flex; flex-direction: column; gap: 14px; padding: 16px; border: 1px solid #d8e5dc; border-radius: 8px; background: #fafcfa; }
.fiscal-review-section[hidden], #fiscal-file-wrapper[hidden] { display: none; }
.fiscal-extraction-banner { padding: 10px 12px; border-radius: 6px; font-size: 11px; line-height: 1.5; }
.fiscal-extraction-banner.is-extracted { background: #edf8f1; color: #176b4b; border: 1px solid #cbded0; }
.fiscal-extraction-banner.is-manual { background: #fff8eb; color: #8a5b1d; border: 1px solid #eed9b3; }
.fiscal-extraction-banner.is-loading { background: #f1f5fb; color: #3c5a85; border: 1px solid #d3deee; }
.fiscal-review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.fiscal-items-container { display: flex; flex-direction: column; gap: 8px; }
.fiscal-item-row { display: grid; grid-template-columns: 1.6fr .7fr .9fr auto; gap: 8px; align-items: center; }
.fiscal-item-row input { height: 36px; font-size: 12px; }
.fiscal-item-remove { min-height: 36px; width: 36px; padding: 0; font-size: 16px; }
.fiscal-consistency-hint { margin: 0; padding: 9px 11px; border-radius: 6px; background: #fff8eb; color: #8a5b1d; font-size: 11px; line-height: 1.45; }
.fiscal-consistency-hint[hidden] { display: none; }
#success-invoice-message:not(:empty) { margin-top: 14px; }
.field-optional { color: #8a958e; font-weight: 400; }
.purchase-nf-box { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border: 1px dashed #b9d2c0; border-radius: 10px; background: #f8fbf9; }
.purchase-nf-box .eyebrow { margin: 0 0 4px; color: var(--green); }
.purchase-nf-box input[type="file"] { height: auto; padding: 10px 12px; background: #fff; cursor: pointer; }
.purchase-nf-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.purchase-items-section { padding-top: 6px; }
.purchase-items-header, .purchase-item-row { display: grid; grid-template-columns: 1.8fr .65fr .9fr .85fr auto; gap: 8px; align-items: center; }
.purchase-items-header { padding: 0 2px 6px; color: #748078; font-size: 11px; font-weight: 600; }
.purchase-items-container { display: flex; flex-direction: column; gap: 8px; }
.purchase-item-row input { height: 38px; font-size: 12px; }
.purchase-item-subtotal { color: #243a2d; font: 700 12px Manrope, sans-serif; text-align: right; white-space: nowrap; }
.purchase-discount-row { display: grid; grid-template-columns: minmax(180px, 240px); justify-content: end; }
.review-items-block { margin-top: 16px; }
.review-items-block .eyebrow { margin: 0 0 8px; color: var(--green); }
.review-items-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid #edf0ec; }
.review-items-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #edf0ec; font-size: 12px; color: #26352c; }
@media (max-width: 650px) {
  .project-row.purchase-row { grid-template-columns: 1fr 1fr; }
  .purchase-invoices { grid-column: 1 / -1; align-items: flex-start; max-width: none; }
  .fiscal-dialog { padding: 22px 18px 18px; }
  .purchase-items-header { display: none; }
  .purchase-item-row { grid-template-columns: 1fr 1fr; }
  .purchase-item-product { grid-column: 1 / -1; }
  .purchase-item-subtotal { text-align: left; }
}

/* Dropdown de projetos em vigência (busca do financeiro) */
.project-combobox { position: relative; }
.project-options { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; max-height: 280px; margin: 0; padding: 6px; overflow-y: auto; list-style: none; border: 1px solid #dfe5df; border-radius: 8px; background: #fff; box-shadow: 0 14px 34px #1e33211f; }
.project-options[hidden] { display: none; }
.project-option { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; align-items: center; padding: 10px 11px; border-radius: 6px; cursor: pointer; }
.project-option strong { overflow: hidden; color: #26352c; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.project-option small { grid-column: 1; color: #8a948e; font-size: 11px; }
.project-option .status-badge { grid-row: 1 / span 2; grid-column: 2; }
.project-option[aria-selected="true"] { background: #eef6f1; }
.project-options-note { padding: 11px; color: #8a948e; font-size: 12px; }
