/* ===== Aprovadores Workflow ===== */
.aw-panel { margin: 4px 0 8px; }
.aw-panel .aw-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.aw-panel .aw-header p { margin: 0; }
.aw-panel .aw-mode { color: #666; font-size: 0.9em; }
.aw-panel .aw-meta { color: #555; font-size: 0.9em; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.aw-panel .aw-overdue, .aw-mine .aw-overdue { color: #b71c1c; font-weight: bold; }
.aw-panel .aw-note { background: #f6f8fa; border-left: 3px solid #8a9bb0; padding: 6px 10px; color: #444; }
.aw-panel table.aw-approvers { margin: 6px 0 10px; }
.aw-panel table.aw-approvers td { vertical-align: top; }
.aw-panel table.aw-approvers td.aw-name { text-align: left; white-space: nowrap; }
.aw-panel table.aw-approvers td.aw-comment { text-align: left; max-width: 420px; }
.aw-panel table.aw-approvers td.aw-comment p { margin: 0; }
.aw-panel table.aw-approvers td.aw-pos, .aw-panel table.aw-approvers th.aw-pos { width: 3em; text-align: center; }
.aw-panel tr.aw-current td { background: #fffbe6; }
.aw-panel tr.aw-me td.aw-name { font-weight: bold; }
.aw-panel .aw-added { color: #888; margin-left: 3px; cursor: help; }
.aw-panel .aw-residual { color: #888; font-size: 0.85em; margin-left: 4px; }

.aw-badge { display: inline-block; padding: 1px 8px; border-radius: 3px; font-size: 0.85em; font-weight: bold; white-space: nowrap; }
.aw-decision-pending  { background: #fff3cd; color: #7a5b00; }
.aw-decision-approved { background: #dff3e0; color: #1b5e20; }
.aw-decision-rejected { background: #fde2e1; color: #b71c1c; }
.aw-decision-skipped  { background: #eceff1; color: #607d8b; }
.aw-state-pending   { background: #e3f0fb; color: #0d47a1; }
.aw-state-approved  { background: #dff3e0; color: #1b5e20; }
.aw-state-rejected  { background: #fde2e1; color: #b71c1c; }
.aw-state-expired   { background: #ffe0b2; color: #8a4b00; }
.aw-state-cancelled { background: #eceff1; color: #455a64; }
.aw-mini { display: inline-block; padding: 0 5px; margin: 0 2px; border-radius: 2px; font-size: 0.8em; }

.aw-btn { cursor: pointer; border: 1px solid transparent; border-radius: 3px; padding: 5px 14px; font-weight: bold; font-size: 0.95em; line-height: 1.4; }
.aw-btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.aw-btn-wrap { display: inline-block; cursor: help; }
.aw-btn-approve { background: #2e7d32; color: #fff; border-color: #1b5e20; }
.aw-btn-approve:hover { background: #256b29; }
.aw-btn-reject { background: #c62828; color: #fff; border-color: #a31f1f; }
.aw-btn-reject:hover { background: #ad2222; }
.aw-btn-neutral { background: #f4f4f4; color: #333; border-color: #ccc; font-weight: normal; }
.aw-btn-neutral:hover { background: #e8e8e8; }
.aw-vote-actions { display: flex; gap: 8px; margin: 8px 0; }
.aw-vote-form { border: 1px solid #ddd; background: #fafafa; padding: 8px 12px; margin: 6px 0 10px; border-left-width: 4px; }
.aw-vote-form.aw-vote-approved { border-left-color: #2e7d32; }
.aw-vote-form.aw-vote-rejected { border-left-color: #c62828; }
.aw-vote-form textarea { width: 98%; }
.aw-vote-form .aw-required-hint { color: #b71c1c; font-size: 0.9em; }
.aw-tools { margin-top: 8px; }
.aw-tools .aw-add-form { margin: 6px 0; }
.aw-tool-buttons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.aw-inline-form { display: inline; margin: 0; }
.aw-history { margin-top: 10px; font-size: 0.9em; color: #555; }
.aw-history summary { cursor: pointer; }
.aw-history li { margin: 3px 0; }
.aw-lock-notice { background: #fff3cd; border: 1px solid #f0d77a; padding: 6px 10px; color: #6b5200; }
.aw-lock-notice.aw-lock-bypass { background: #e3f0fb; border-color: #a9c9ec; color: #0d3c78; }

/* Configurações */
.aw-settings table.aw-rules td { vertical-align: top; }
.aw-settings tr.aw-inactive td { color: #999; }
.aw-settings .aw-approver-list { text-align: left; }
.aw-settings .aw-pos-num { color: #888; margin-right: 3px; }
.aw-status-chip { background: #eef3f8; padding: 0 6px; border-radius: 2px; }
.aw-approvers-box table.aw-approver-rows { width: auto; min-width: 480px; }
.aw-approvers-box select.aw-principal { min-width: 320px; }

/* Página pública (aprovação por e-mail) */
.aw-public-body { margin: 0; background: #eef1f4; font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: #222; }
.aw-public { max-width: 680px; margin: 32px auto; background: #fff; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.12); overflow: hidden; }
.aw-public-brand { background: #3e5b76; color: #fff; padding: 12px 24px; font-weight: bold; }
.aw-public-issue, .aw-public-action, .aw-public-result { padding: 20px 24px; }
.aw-public-issue { border-bottom: 1px solid #e5e5e5; }
.aw-public-ref { color: #667; margin: 0 0 4px; font-size: 0.9em; }
.aw-public-issue h1 { font-size: 1.35em; margin: 0 0 12px; }
.aw-public-fields { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; font-size: 0.95em; }
.aw-public-fields dt { color: #667; }
.aw-public-fields dd { margin: 0; }
.aw-public-desc { margin-top: 12px; padding: 10px 12px; background: #f7f8fa; border-radius: 4px; font-size: 0.93em; max-height: 260px; overflow: auto; }
.aw-public-action h2, .aw-public-result h2 { margin-top: 0; font-size: 1.2em; }
.aw-public-approved h2 { color: #1b5e20; }
.aw-public-rejected h2 { color: #b71c1c; }
.aw-public-error h2 { color: #8a4b00; }
.aw-public-action label { display: block; margin-bottom: 6px; color: #444; }
.aw-public-action textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 8px; border: 1px solid #c8cdd3; border-radius: 4px; }
.aw-public-buttons { display: flex; align-items: center; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.aw-public-buttons .aw-btn { padding: 10px 24px; font-size: 1em; }
.aw-public-switch { color: #3e5b76; font-size: 0.9em; }
.aw-public .aw-btn:focus-visible, .aw-public-switch:focus-visible { outline: 3px solid #90b4d8; outline-offset: 2px; }
@media (max-width: 720px) { .aw-public { margin: 0; border-radius: 0; } }
.aw-rule-form fieldset.aw-outcome { border: 1px solid #e2e2e2; margin: 8px 0; padding: 4px 0 2px; }
.aw-rule-form fieldset.aw-outcome legend { margin-left: 8px; padding: 0 4px; font-weight: bold; color: #555; }
.aw-rule-form .aw-cf-values select { min-width: 260px; }
.aw-rule-form .aw-assign-info { margin-left: 180px; color: #666; }
.aw-card { margin-bottom: 16px; }
.aw-card .card-body .aw-panel { margin: 0; }

/* ===== Aviso de aprovações pendentes ===== */
.aw-modal-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(30, 36, 46, .45); animation: aw-fade .18s ease-out; }
.aw-modal { width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 6px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25); font-family: "IBM Plex Sans", inherit; color: var(--neutral-color, #1E242E);
  border-top: 4px solid var(--primary-color, #340B6A); animation: aw-rise .2s ease-out; }
.aw-modal-head { display: flex; gap: 12px; align-items: flex-start; padding: 20px 20px 8px; }
.aw-modal-icon { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 6px;
  font-size: 22px; color: var(--myrthes-purple-700, #7A1EE3); background: var(--myrthes-neutral-100, #ECEDF2); }
.aw-modal-head h3 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.3; color: var(--neutral-color, #1E242E); }
.aw-modal-sub { margin: 4px 0 0; font-size: 14px; color: var(--myrthes-neutral-600, #4D556E); }
.aw-modal-close { margin-left: auto; border: none; background: none; font-size: 22px; line-height: 1; cursor: pointer;
  color: var(--myrthes-neutral-400, #8791A9); padding: 2px 6px; border-radius: 3px; }
.aw-modal-close:hover { background: var(--myrthes-neutral-100, #ECEDF2); color: var(--neutral-color, #1E242E); }
.aw-modal-list { list-style: none; margin: 8px 0 0; padding: 0 12px; }
.aw-modal-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; border-radius: 4px;
  text-decoration: none !important; color: inherit !important; border-bottom: 1px solid var(--myrthes-neutral-100, #ECEDF2); }
.aw-modal-list li:last-child .aw-modal-item { border-bottom: none; }
.aw-modal-item:hover { background: var(--background-color, #F3F7F8); }
.aw-modal-ref { font-size: 12px; font-weight: 600; color: var(--primary-text-color, #8E48FF); white-space: nowrap; }
.aw-modal-subject { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aw-modal-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--myrthes-neutral-600, #4D556E); }
.aw-modal-due { color: var(--myrthes-neutral-800, #3B4051); }
.aw-modal-due-soon { color: var(--colors-red-700, #B91C1C); font-weight: 600; }
.aw-modal-more { margin: 4px 20px 0; font-size: 13px; color: var(--myrthes-neutral-600, #4D556E); }
.aw-modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 20px; }
.aw-modal-btn { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 3px; border: none;
  font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none !important; }
.aw-modal-btn-primary { background: var(--myrthes-purple-700, #7A1EE3); color: #fff !important; }
.aw-modal-btn-primary:hover { background: var(--primary-color, #340B6A); }
.aw-modal-btn-text { background: var(--myrthes-neutral-100, #ECEDF2); color: var(--myrthes-neutral-950, #23252E); }
.aw-modal-btn-text:hover { background: var(--myrthes-neutral-200, #D5D8E2); }
.aw-modal-btn:focus-visible, .aw-modal-close:focus-visible, .aw-modal-item:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--shadow-purple, #e0c5ff); }
.aw-modal-leaving { opacity: 0; transition: opacity .15s ease-in; }
@keyframes aw-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes aw-rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .aw-modal-overlay, .aw-modal { animation: none; } }

/* ===== Aprovadores a informar (formulário da tarefa) ===== */
.aw-slots-box.card { margin: 16px 0; background: #fff; border-radius: 6px; border-left: 4px solid var(--myrthes-purple-700, #7A1EE3); }
.aw-slots-box.card > .card-header { padding: 12px 16px 4px; font-weight: 600; }
.aw-slots-box.card > .card-body { padding: 0 16px 12px; }
.aw-slots-box .aw-slots-intro { margin: 0; font-size: 14px; color: var(--myrthes-neutral-600, #4D556E); }
.aw-slots-box.card .aw-slot-field { flex-direction: column; gap: 6px; }
.aw-slots-box.card .aw-slot-field label { display: block; font-weight: 500; }
.aw-slots-box .aw-slot-pos { color: var(--primary-text-color, #8E48FF); margin-right: 2px; }
.aw-slots-box.card .aw-slot-field select { width: 100%; }
.aw-slots-box .aw-slot-empty { color: var(--colors-red-700, #B91C1C); }
.aw-slots-box .aw-slots-fixed { margin: 0; font-size: 13px; color: var(--myrthes-neutral-600, #4D556E); }
.aw-slot-awaiting { color: var(--colors-yellow-700, #A16207); font-style: italic; }
.aw-slot-label-tag { display: block; font-size: 12px; color: var(--myrthes-neutral-600, #4D556E); font-weight: normal; }
.aw-fill-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.aw-decision-awaiting { background: #fef9c3; color: #854d0e; }
.aw-slots-box.card .aw-slot-field .info { font-size: 12px; font-style: normal; line-height: 15.6px; color: var(--myrthes-neutral-600, #4D556E); }
.aw-slots-box .aw-slot-field .info.aw-slot-empty { color: var(--colors-red-700, #B91C1C); }
.aw-slots-box .required { color: var(--critical-color, #c62828); }

/* Ícone criado para "Minhas aprovações" quando o tema usa ícones no menu de conta */
.aw-account-icon { display: inline-flex; flex: none; vertical-align: middle; color: inherit; }
.aw-account-icon svg { display: block; }

/* ===== Menu de conta agrupado (temas com barra) - padrão Myrthes ===== */
.aw-acc-holder { position: relative; }
.aw-acc-trigger { cursor: pointer; }
.aw-acc-caret { display: inline-block; width: 0; height: 0; margin-left: 6px; vertical-align: middle;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; }
.aw-acc-trigger[aria-expanded="true"] .aw-acc-caret { transform: rotate(180deg); }
.aw-acc-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  margin-left: 6px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; background: #FF5861; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1; vertical-align: middle; }
.aw-acc-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 1000; min-width: 190px; padding: 4px;
  background: #fff; border-radius: 3px; box-shadow: 0 3px 5px rgba(54, 65, 77, .25); text-align: left; }
.aw-acc-menu[hidden] { display: none; }
.aw-acc-menu .aw-acc-item { display: flex !important; align-items: center; height: 24px; padding: 4px 10px !important;
  margin: 0 !important; background: none !important; color: #1E242E !important; font-size: 14px; font-weight: 500;
  line-height: 18px; text-decoration: none !important; white-space: nowrap; border-radius: 3px; }
.aw-acc-menu .aw-acc-item::before, .aw-acc-menu .aw-acc-item::after { content: none !important; display: none !important; }
.aw-acc-menu .aw-acc-item:hover, .aw-acc-menu .aw-acc-item:focus-visible { background: #F3F7F8 !important; outline: none; }
.aw-acc-grouped { justify-content: flex-end !important; }

/* Formulário padrão do Redmine (tema Bleuclair, padrão etc.): segue o layout nativo */
.aw-slots-tabular .aw-slot-field select { min-width: 260px; max-width: 100%; }
.aw-slots-tabular .aw-slot-field .info { display: block; }
.aw-slots-tabular .aw-slots-intro { color: #555; }
.aw-slots-tabular .aw-slot-empty { color: #b71c1c; }
