:root {
  --ink: #172126;
  --muted: #66747b;
  --line: #dce3e4;
  --paper: #ffffff;
  --canvas: #f3f5f3;
  --forest: #173f36;
  --forest-soft: #dce9e3;
  --lime: #c8dd63;
  --critical: #a52c36;
  --critical-soft: #f8e3e4;
  --high: #b85b19;
  --high-soft: #faeadc;
  --medium: #806a12;
  --medium-soft: #f4efcf;
  --low: #48615b;
  --low-soft: #e5ece9;
  --shadow: 0 18px 60px rgba(23, 48, 41, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.app-shell { min-height: 100vh; }
.topbar { height: 82px; padding: 0 clamp(20px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; background: var(--forest); color: #fff; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--forest); background: var(--lime); font-size: 13px; font-weight: 900; letter-spacing: -.04em; }
.brand h1, .brand p { margin: 0; }
.brand h1 { font-size: 19px; letter-spacing: -.02em; }
.eyebrow { margin: 0 0 5px; color: #75847f; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.brand .eyebrow { color: #b8cbc4; }
.security-indicator { display: flex; gap: 8px; align-items: center; color: #d7e2de; font-size: 13px; }
.security-indicator span { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(200,221,99,.13); }
.security-indicator span:last-child { width: auto; height: auto; border-radius: 0; background: transparent; box-shadow: none; }
.account-menu { display: flex; align-items: center; gap: 14px; }
.logout-button { padding: 7px 11px; border: 1px solid rgba(255,255,255,.28); border-radius: 7px; color: #fff; background: transparent; font-size: 12px; font-weight: 700; }
.logout-button:hover { background: rgba(255,255,255,.08); }
main { width: min(1440px, 100%); margin: 0 auto; padding: 42px clamp(20px, 4vw, 64px) 64px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.hero h2 { max-width: 730px; margin: 0; color: var(--forest); font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 4.4vw, 60px); font-weight: 500; line-height: .98; letter-spacing: -.045em; }
.hero-copy { max-width: 660px; margin: 18px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.button { min-height: 42px; padding: 0 18px; border: 1px solid var(--forest); border-radius: 9px; font-weight: 750; }
.button.secondary { color: var(--forest); background: transparent; }
.button.primary { color: #fff; background: var(--forest); }
.button:hover { transform: translateY(-1px); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 22px; }
.metric { min-height: 144px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); display: flex; flex-direction: column; }
.metric span { color: var(--muted); font-size: 13px; font-weight: 700; }
.metric strong { margin: auto 0 2px; color: var(--forest); font-family: Georgia, "Times New Roman", serif; font-size: 42px; font-weight: 500; line-height: 1; }
.metric small { color: #87938f; }
.metric.urgent { border-color: #eac6c8; background: linear-gradient(145deg, #fff 50%, #f9eded); }
.metric.urgent strong { color: var(--critical); }
.workspace { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 8px 28px rgba(23,48,41,.05); }
.toolbar { display: grid; grid-template-columns: minmax(280px, 1.7fr) repeat(3, minmax(150px,.7fr)); gap: 12px; padding: 18px; border-bottom: 1px solid var(--line); background: #fafbfa; }
.toolbar label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.toolbar input, .toolbar select { width: 100%; height: 44px; padding: 0 13px; border: 1px solid #ccd6d3; border-radius: 8px; outline: none; color: var(--ink); background: #fff; font-size: 14px; letter-spacing: normal; text-transform: none; }
.toolbar input:focus, .toolbar select:focus, textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(23,63,54,.1); }
.search-field { justify-content: flex-end; }
.list-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 24px 24px 16px; }
.list-heading h3 { margin: 0; color: var(--forest); font-family: Georgia, "Times New Roman", serif; font-size: 27px; font-weight: 500; }
.list-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.sort-note { padding-bottom: 3px; }
.notification-list { padding: 0 14px 14px; }
.notification-card { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; gap: 18px; align-items: stretch; margin-top: 8px; border: 1px solid transparent; border-radius: 11px; background: #fff; transition: border-color .15s, background .15s, transform .15s; }
.notification-card:hover { border-color: var(--line); background: #fafbfa; transform: translateY(-1px); }
.priority-bar { border-radius: 8px 0 0 8px; background: var(--low); }
.priority-bar.critica { background: var(--critical); }
.priority-bar.alta { background: var(--high); }
.priority-bar.media { background: #b69b26; }
.card-main { min-width: 0; padding: 17px 0; }
.card-topline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; }
.pill { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.pill.critica { color: var(--critical); background: var(--critical-soft); }
.pill.alta { color: var(--high); background: var(--high-soft); }
.pill.media { color: var(--medium); background: var(--medium-soft); }
.pill.baixa { color: var(--low); background: var(--low-soft); }
.category-label, .date-label { color: var(--muted); font-size: 12px; }
.manual-badge { color: var(--forest); font-size: 11px; font-weight: 800; }
.card-main h4 { margin: 0 0 7px; overflow: hidden; color: #1e2a2f; font-size: 16px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.card-main p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-meta { display: flex; gap: 14px; margin-top: 11px; color: #75817d; font-size: 11px; }
.card-action { align-self: center; margin-right: 18px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--forest); background: #fff; font-size: 20px; }
.empty-state { padding: 60px 20px 70px; text-align: center; color: var(--muted); }
.empty-state div { width: 42px; height: 42px; margin: auto; display: grid; place-items: center; border-radius: 50%; color: var(--forest); background: var(--forest-soft); }
.empty-state h3 { margin: 14px 0 5px; color: var(--ink); }
.empty-state p { margin: 0; }
.disclaimer { margin-top: 18px; padding: 16px 18px; border-left: 3px solid var(--lime); color: var(--muted); background: rgba(255,255,255,.65); font-size: 13px; line-height: 1.55; }
.disclaimer strong { color: var(--ink); }
.drawer-backdrop { position: fixed; inset: 0; z-index: 10; background: rgba(11,28,24,.42); backdrop-filter: blur(2px); }
.detail-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 11; width: min(620px, 100vw); display: flex; flex-direction: column; background: #fff; box-shadow: var(--shadow); transform: translateX(102%); transition: transform .24s ease; }
.detail-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 26px 28px 20px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { margin: 0; color: var(--forest); font-family: Georgia, "Times New Roman", serif; font-size: 27px; font-weight: 500; line-height: 1.2; }
.icon-button { flex: 0 0 auto; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: #fff; font-size: 24px; line-height: 1; }
.drawer-content { overflow-y: auto; padding: 24px 28px 40px; }
.detail-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 24px; }
.detail-field { padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfa; }
.detail-field span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.detail-field strong { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.section-title { margin: 24px 0 10px; color: var(--forest); font-size: 13px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.notification-body { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fbfbfa; color: #344046; font-size: 14px; line-height: 1.68; white-space: pre-wrap; overflow-wrap: anywhere; }
.rationale-list { margin: 0; padding: 0; list-style: none; }
.rationale-list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid #edf0ef; color: var(--muted); font-size: 13px; }
.rationale-list b { color: var(--forest); }
.review-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; padding: 18px; border-radius: 12px; background: var(--forest-soft); }
.review-form label { display: flex; flex-direction: column; gap: 6px; color: var(--forest); font-size: 11px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.review-form select, .review-form textarea { width: 100%; padding: 10px; border: 1px solid #b9cbc4; border-radius: 8px; color: var(--ink); background: #fff; font-size: 13px; letter-spacing: normal; text-transform: none; }
.review-form textarea { min-height: 96px; resize: vertical; }
.review-form .full { grid-column: 1 / -1; }
.review-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 30; padding: 12px 17px; border-radius: 9px; color: #fff; background: var(--forest); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translate(-50%,12px); transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.loading { padding: 50px; color: var(--muted); text-align: center; }
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(11,28,24,.52); backdrop-filter: blur(3px); }
.modal-card { position: relative; z-index: 1; width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 24px 26px 18px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; color: var(--forest); font-family: Georgia, "Times New Roman", serif; font-size: 27px; font-weight: 500; }
.extraction-form { display: grid; gap: 17px; padding: 22px 26px 26px; }
.extraction-form > label:not(.legal-confirmation) { display: flex; flex-direction: column; gap: 7px; color: var(--forest); font-size: 12px; font-weight: 800; }
.extraction-form input[type="password"], .extraction-form input[type="file"] { width: 100%; padding: 11px; border: 1px solid #c8d3d0; border-radius: 8px; color: var(--ink); background: #fff; font-size: 14px; font-weight: 400; }
.extraction-form input:focus { border-color: var(--forest); outline: none; box-shadow: 0 0 0 3px rgba(23,63,54,.1); }
.file-field small { color: var(--muted); font-weight: 400; }
.security-note { padding: 14px 15px; border-left: 3px solid var(--lime); background: #f4f7ef; }
.security-note strong { color: var(--forest); font-size: 13px; }
.security-note p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.legal-confirmation { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; padding: 13px; border: 1px solid #ead1b5; border-radius: 9px; color: #6e4a29; background: #fff8ef; font-size: 12px; line-height: 1.5; }
.legal-confirmation input { width: 16px; height: 16px; margin-top: 1px; accent-color: var(--forest); }
.extraction-progress { display: flex; align-items: center; gap: 13px; padding: 14px; border-radius: 9px; color: var(--forest); background: var(--forest-soft); }
.extraction-progress p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.spinner { flex: 0 0 auto; width: 24px; height: 24px; border: 3px solid #b9cbc4; border-top-color: var(--forest); border-radius: 50%; animation: spin .8s linear infinite; }
.form-error { padding: 12px 14px; border-radius: 8px; color: #842a31; background: var(--critical-soft); font-size: 12px; line-height: 1.45; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-page { min-height: 100vh; background: var(--forest); }
.login-shell { width: 100%; min-height: 100vh; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(360px,.9fr) minmax(480px,1.1fr); }
.login-brand-panel { min-height: 100vh; padding: clamp(32px,6vw,78px); display: flex; flex-direction: column; color: #fff; background: radial-gradient(circle at 85% 12%, rgba(200,221,99,.16), transparent 28%), var(--forest); }
.login-brand h1, .login-brand p { margin: 0; }
.login-brand h1 { font-size: 20px; }
.login-message { max-width: 560px; margin: auto 0; }
.login-message .eyebrow { color: var(--lime); }
.login-message h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px,5vw,68px); font-weight: 500; line-height: .98; letter-spacing: -.045em; }
.login-message > p:last-child { max-width: 480px; margin: 24px 0 0; color: #c5d4ce; font-size: 16px; line-height: 1.65; }
.login-security { display: flex; align-items: center; gap: 9px; margin: 0; color: #b8cbc4; font-size: 12px; }
.login-security span { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); }
.login-form-panel { min-height: 100vh; padding: 32px; display: grid; place-items: center; background: #f7f8f6; }
.login-form { width: min(430px,100%); display: grid; gap: 19px; }
.login-form h2 { margin: 0; color: var(--forest); font-family: Georgia, "Times New Roman", serif; font-size: 39px; font-weight: 500; letter-spacing: -.03em; }
.login-help { margin: 9px 0 4px; color: var(--muted); font-size: 14px; }
.login-form label { display: flex; flex-direction: column; gap: 7px; color: var(--forest); font-size: 12px; font-weight: 800; }
.login-form input { width: 100%; height: 48px; padding: 0 13px; border: 1px solid #c8d3d0; border-radius: 8px; outline: none; color: var(--ink); background: #fff; font-size: 15px; font-weight: 400; }
.login-form input:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(23,63,54,.1); }
.login-button { width: 100%; min-height: 48px; margin-top: 3px; }

@media (max-width: 960px) {
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .toolbar { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .search-field { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .topbar { height: 70px; }
  .security-indicator { font-size: 0; }
  .security-indicator #currentUser { display: none; }
  main { padding-top: 28px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .hero-actions { justify-content: flex-start; }
  .hero h2 { font-size: 39px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric { min-height: 120px; padding: 16px; }
  .metric strong { font-size: 34px; }
  .toolbar { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .list-heading { align-items: flex-start; flex-direction: column; }
  .sort-note { display: none; }
  .notification-card { grid-template-columns: 7px minmax(0,1fr) 42px; gap: 11px; }
  .card-action { margin-right: 8px; }
  .card-main h4 { white-space: normal; }
  .card-meta { flex-direction: column; gap: 3px; }
  .drawer-header, .drawer-content { padding-left: 20px; padding-right: 20px; }
  .detail-grid, .review-form { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
  .login-form-panel { min-height: 100vh; padding: 28px 20px; }
}
