:root {
  --blue-900: #172554;
  --blue-800: #253b80;
  --blue-700: #2f4a9e;
  --blue-100: #eff6ff;
  --orange-600: #f58220;
  --orange-100: #fff7ed;
  --green-700: #166534;
  --green-100: #dcfce7;
  --teal-700: #0f766e;
  --teal-100: #ccfbf1;
  --yellow-700: #a16207;
  --yellow-100: #fef9c3;
  /* Mesmos valores da Central de Demandas: os selos de status das duas telas
     precisam ler igual. Ver .status-* em app_demandas_static/css/styles.css. */
  --purple-700: #6d28d9;
  --purple-100: #f3e8ff;
  --slate-950: #0f172a;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;
  --danger: #b91c1c;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
  --ring: 0 0 0 4px rgba(245, 130, 32, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.74), rgba(248, 250, 252, 0.98) 48%, #ffffff 100%),
    var(--slate-50);
  color: var(--slate-950);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.lucide {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

main {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
}

.top-logos {
  display: flex;
  justify-content: center;
  margin: 22px 0 16px;
  padding: 14px 18px;
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.top-logos img {
  width: min(720px, 100%);
  height: auto;
}

.intro-band {
  min-height: 186px;
  margin: 0;
  padding: clamp(21px, 4vw, 37px);
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(112deg, #172554 0%, #2f4a9e 58%, #f58220 100%);
  box-shadow: var(--shadow);
  color: var(--white);
}

.intro-copy {
  max-width: 740px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--orange-600);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro-band .eyebrow {
  color: #ffd0a6;
  font-size: 0.62rem;
}

.intro-band h1 {
  margin: 0;
  font-size: clamp(1.76rem, 4.3vw, 3.5rem);
  font-weight: 700;
  line-height: 0.98;
}

.intro-band p:last-child {
  max-width: 650px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(0.8rem, 1.6vw, 0.98rem);
  line-height: 1.55;
}

.workspace {
  padding-bottom: 28px;
}

#solicitacao {
  margin-top: 22px;
}

.request-type-card {
  width: 100%;
  padding: 18px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.request-type-card > p {
  margin: 0 0 12px;
  color: var(--slate-500);
  font-size: 0.82rem;
  font-weight: 600;
}

.request-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tab-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 88px;
  padding: 16px;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: var(--white);
  color: var(--slate-700);
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.tab-button.is-active {
  border-color: rgba(47, 74, 158, 0.55);
  background: rgba(47, 74, 158, 0.78);
  color: var(--white);
  box-shadow: 0 10px 20px rgba(47, 74, 158, 0.16);
}

.tab-button:not(.is-active):hover {
  border-color: rgba(47, 74, 158, 0.38);
  background: var(--blue-100);
}

.tab-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--slate-100);
  color: var(--blue-700);
}

.tab-button.is-active .tab-icon {
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
}

.tab-button strong,
.tab-button small {
  display: block;
}

.tab-button strong {
  margin-bottom: 3px;
  font-size: 0.98rem;
  font-weight: 700;
}

.tab-button small {
  color: var(--slate-500);
  font-size: 0.78rem;
  line-height: 1.35;
}

.tab-button.is-active small {
  color: rgba(255, 255, 255, 0.82);
}

.request-panel {
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(203, 213, 225, 0.68);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.07);
}

#request-form {
  margin-top: 22px;
}

.form-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--slate-200);
}

.form-heading h2 {
  margin: 0;
  color: var(--blue-900);
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  font-weight: 700;
  line-height: 1.1;
}

.deadline-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 28px;
  margin-top: 8px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--orange-100);
  color: #b45309;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.deadline-pill.is-danger {
  background: #fef2f2;
  color: var(--danger);
}

.deadline-pill.is-warning {
  background: var(--orange-100);
  color: #b45309;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend,
.field span {
  display: block;
  margin-bottom: 8px;
  color: var(--slate-700);
  font-size: 0.86rem;
  font-weight: 600;
}

.unit-picker,
.channel-picker,
.support-picker,
.local-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.unit-picker legend,
.channel-picker legend,
.support-picker legend,
.local-picker legend {
  flex-basis: 100%;
}

.unit-picker label,
.channel-picker label,
.support-picker label,
.local-picker label {
  position: relative;
}

.unit-picker input,
.channel-picker input,
.support-picker input,
.local-picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.unit-picker span,
.channel-picker span,
.support-picker span,
.local-picker span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: var(--white);
  color: var(--slate-500);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.support-picker span::before,
.channel-picker input + span::before {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--slate-300);
  border-radius: 5px;
  color: transparent;
  content: "✓";
  font-size: 0.72rem;
  font-weight: 700;
}

.unit-picker input:checked + span,
.channel-picker input:checked + span,
.support-picker input:checked + span,
.local-picker input:checked + span {
  border-color: rgba(47, 74, 158, 0.48);
  background: #f4f8ff;
  color: var(--blue-800);
  box-shadow: 0 8px 18px rgba(47, 74, 158, 0.08);
}

.support-picker input:checked + span::before,
.channel-picker input:checked + span::before {
  border-color: var(--blue-700);
  background: var(--blue-700);
  color: var(--white);
}

.channel-picker input:disabled + span {
  opacity: 0.5;
  background: var(--slate-50);
  color: var(--slate-500);
  cursor: not-allowed;
}

/* Balãozinho de instrução no canto do botão de canal. */
.channel-picker .channel-hint {
  position: absolute;
  top: -7px;
  right: -7px;
  z-index: 3;
  display: inline-grid;
  place-items: center;
  width: 16px;
  min-width: 0;
  height: 16px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--white);
  background: var(--slate-200);
  color: var(--slate-500);
  font-size: 0.6rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: none;
  cursor: help;
}

/* Discreto parado, legível quando a pessoa vai ler a instrução. */
.channel-picker .channel-hint:hover,
.channel-picker .channel-hint:focus-visible {
  background: var(--slate-500);
  color: var(--white);
}

.channel-hint::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  right: -4px;
  width: max-content;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--slate-950);
  color: var(--white);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
  pointer-events: none;
}

.channel-hint:hover::after,
.channel-hint:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 20px;
  row-gap: 24px;
  margin-bottom: 30px;
}

.field {
  display: block;
  min-width: 0;
}

.datetime-pair {
  display: contents;
  min-width: 0;
}

.field-grid.is-support .datetime-pair {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

.end-datetime-pair[hidden] {
  display: none !important;
}

.start-datetime-pair[hidden] {
  display: none !important;
}

.field-wide {
  margin-top: 18px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--slate-950);
  outline: 0;
  padding: 0 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field textarea {
  min-height: 168px;
  padding: 14px;
  resize: vertical;
  line-height: 1.5;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--orange-600);
  box-shadow: var(--ring);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #94a3b8;
}

.upload-row {
  margin-top: 22px;
}

.upload-box {
  min-height: 92px;
  border-radius: 8px;
}

.upload-box {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 12px;
  padding: 18px;
  border: 1px dashed rgba(47, 74, 158, 0.46);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  cursor: pointer;
}

.upload-box .lucide {
  grid-row: 1 / 3;
  width: 32px;
  height: 32px;
  color: var(--blue-700);
}

.upload-box span,
.confirm-dialog h2 {
  color: var(--blue-900);
  font-size: 0.92rem;
  font-weight: 600;
}

.upload-box small {
  overflow-wrap: anywhere;
  color: var(--slate-500);
  font-size: 0.83rem;
  line-height: 1.45;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.attachment-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.attachment-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 10px;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: #fbfdff;
}

.attachment-preview {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--slate-100);
  color: var(--blue-700);
}

.attachment-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-meta {
  min-width: 0;
}

.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  margin-bottom: 30px;
}

.profile-photo-col {
  display: flex;
  flex: 0 0 184px;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.profile-photo-preview {
  width: 184px;
  height: 184px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--slate-100);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.profile-photo-change {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  background: var(--white);
  color: var(--blue-800);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.profile-photo-change:hover {
  border-color: rgba(47, 74, 158, 0.48);
  background: var(--blue-100);
}

.profile-photo-col small {
  color: var(--slate-500);
  font-size: 0.78rem;
}

.profile-photo-divider {
  align-self: stretch;
  height: 0;
  margin: 4px 0 0;
  border: 0;
  border-top: 1px solid var(--slate-200);
}

.photo-editor-dialog {
  width: min(94vw, 620px);
  max-height: 94vh;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.28);
}

.photo-editor-dialog::backdrop {
  background: rgba(15, 23, 42, 0.66);
  backdrop-filter: blur(3px);
}

.photo-editor-shell {
  display: grid;
  gap: 20px;
  padding: 26px;
}

.photo-editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.photo-editor-heading h2,
.photo-editor-heading p {
  margin: 0;
}

.photo-editor-heading h2 {
  margin-top: 3px;
  color: var(--slate-950);
  font-size: 1.35rem;
}

.photo-editor-heading p:last-child {
  margin-top: 7px;
  color: var(--slate-500);
  font-size: 0.9rem;
  line-height: 1.45;
}

.dialog-icon-button,
.photo-zoom-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--slate-300);
  border-radius: 10px;
  background: var(--white);
  color: var(--blue-800);
  cursor: pointer;
}

.dialog-icon-button:hover,
.photo-zoom-button:hover {
  background: var(--blue-100);
}

.photo-crop-stage {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 16px;
  background: #111827;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  touch-action: none;
}

.photo-crop-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  outline: none;
}

.photo-crop-canvas:active {
  cursor: grabbing;
}

.photo-crop-canvas:focus-visible {
  box-shadow: inset 0 0 0 3px #93c5fd;
}

.photo-crop-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, transparent 33.1%, rgba(255, 255, 255, 0.42) 33.2%, rgba(255, 255, 255, 0.42) 33.45%, transparent 33.55%, transparent 66.45%, rgba(255, 255, 255, 0.42) 66.55%, rgba(255, 255, 255, 0.42) 66.8%, transparent 66.9%),
    linear-gradient(to bottom, transparent 33.1%, rgba(255, 255, 255, 0.42) 33.2%, rgba(255, 255, 255, 0.42) 33.45%, transparent 33.55%, transparent 66.45%, rgba(255, 255, 255, 0.42) 66.55%, rgba(255, 255, 255, 0.42) 66.8%, transparent 66.9%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.86);
}

.photo-zoom-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 430px);
  margin: 0 auto;
}

.photo-zoom-row label {
  display: grid;
  flex: 1;
  gap: 5px;
  color: var(--slate-700);
  font-size: 0.78rem;
  font-weight: 700;
}

.photo-zoom-row input {
  width: 100%;
  accent-color: var(--blue-700);
}

.photo-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 560px) {
  .photo-editor-shell {
    gap: 16px;
    padding: 20px;
  }

  .photo-editor-heading p:last-child {
    font-size: 0.84rem;
  }

  .photo-editor-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.profile-header-fields {
  display: grid;
  flex: 1;
  gap: 24px;
  min-width: 0;
}

.profile-header-fields .field-grid {
  margin-bottom: 0;
}

.link-rows {
  display: grid;
  gap: 10px;
  margin-top: 24px;
  margin-bottom: 30px;
}

.link-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.link-row span {
  margin-bottom: 0;
}

.link-row input:invalid {
  border-color: var(--danger);
}

.link-row input:invalid:focus {
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.18);
}

.attachment-meta strong,
.attachment-meta span {
  display: block;
}

.attachment-meta strong {
  overflow: hidden;
  color: var(--slate-700);
  font-size: 0.88rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-meta span {
  margin-top: 4px;
  color: var(--slate-500);
  font-size: 0.78rem;
}

.form-alert {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid rgba(185, 28, 28, 0.2);
  background: #fef2f2;
  color: var(--danger);
  font-size: 0.92rem;
  font-weight: 600;
}

.form-alert.is-success {
  border-color: rgba(22, 101, 52, 0.2);
  background: #f0fdf4;
  color: var(--green-700);
}

.form-alert.is-warning {
  border-color: rgba(180, 83, 9, 0.24);
  background: var(--orange-100);
  color: #b45309;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--slate-200);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 600;
}

.primary-button {
  border: 1px solid var(--orange-600);
  background: var(--orange-600);
  color: var(--white);
  box-shadow: 0 14px 26px rgba(245, 130, 32, 0.23);
}

.primary-button:hover {
  filter: brightness(0.97);
}

.secondary-button {
  border: 1px solid var(--slate-200);
  background: var(--white);
  color: var(--slate-700);
}

.footer-logos {
  width: min(720px, calc(100% - 32px));
  margin: 52px auto 28px;
  padding-top: 18px;
  border-top: 1px solid var(--slate-200);
}

.footer-logos img {
  width: 100%;
  margin: 0 auto;
}

/* ===== Login (portal público) ===== */

.login-gate {
  display: grid;
  justify-items: center;
  gap: 20px;
  width: min(420px, 100%);
  margin: clamp(40px, 10vh, 90px) auto 32px;
}

.login-gate-intro {
  width: 100%;
  padding: 20px 24px;
  border-radius: 8px;
  background: linear-gradient(112deg, #172554 0%, #2f4a9e 58%, #f58220 100%);
  box-shadow: var(--shadow);
  color: var(--white);
  text-align: center;
}

.login-gate-intro .eyebrow {
  margin: 0 0 4px;
  color: #ffd0a6;
}

.login-gate-intro h1 {
  margin: 0;
  color: var(--white);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.2;
}

.login-gate-card {
  width: 100%;
  display: grid;
  gap: 14px;
  padding: clamp(24px, 4vw, 34px);
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.07);
  text-align: center;
}

.login-gate-card > p:not(.eyebrow):not(.form-alert) {
  margin: 0;
  color: var(--slate-500);
  font-size: 0.94rem;
  line-height: 1.5;
}

.login-gate-card .google-button {
  justify-self: stretch;
}

.google-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  background: var(--white);
  color: #3c4043;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
}

.google-button:hover,
.google-button:focus-visible {
  border-color: #dadce0;
  background: #f8fafd;
  box-shadow: 0 2px 4px rgba(60, 64, 67, 0.16);
}

.login-gate-logos {
  width: min(360px, 88%);
}

.google-mark {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.app-shell {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  width: min(1204px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 100vh;
}

.app-shell > main {
  width: auto;
  min-width: 0;
  margin: 0;
  padding-top: 22px;
  flex: 1;
}

.auth-loading {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--blue-700);
}

.auth-loading .lucide {
  width: 28px;
  height: 28px;
  animation: spin 1s linear infinite;
}

.sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-content: start;
  width: 220px;
  min-width: 0;
  flex: 0 0 220px;
  position: sticky;
  top: 22px;
  margin: 22px 0;
  padding: 24px 16px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.sidebar-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--slate-200);
  text-align: center;
}

.sidebar-user img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--slate-100);
}

.sidebar-user strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--slate-950);
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user span {
  max-width: 100%;
  overflow: hidden;
  color: var(--slate-500);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--slate-700);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
  text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
  background: var(--blue-100);
  color: var(--blue-800);
}

.sidebar-link.is-active {
  background: var(--blue-700);
  color: var(--white);
}

.sidebar-logout {
  color: var(--danger);
}

.sidebar-logout:hover,
.sidebar-logout:focus-visible {
  background: #fef2f2;
  color: var(--danger);
}

/* Sempre no rodapé da barra, atrás de um divisor: é um atalho secundário,
   não pode competir com o menu nem com a lista de solicitações. */
.sidebar-feedback {
  min-width: 0;
  padding-top: 14px;
  border-top: 1px solid var(--slate-200);
}

.sidebar-feedback-button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: var(--slate-100);
  color: var(--slate-500);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.sidebar-feedback-button .lucide {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.sidebar-feedback-button:hover,
.sidebar-feedback-button:focus-visible {
  background: var(--blue-100);
  color: var(--blue-800);
}

.feedback-dialog {
  width: min(480px, calc(100% - 32px));
  max-width: calc(100vw - 32px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 26px 80px rgba(15, 23, 42, 0.28);
}

.feedback-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.feedback-dialog form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
}

.feedback-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.feedback-title-row h2 {
  margin: 0 0 4px;
  color: var(--slate-950);
  font-size: 1.05rem;
}

.feedback-title-row p {
  margin: 0;
  color: var(--slate-500);
  font-size: 0.82rem;
  line-height: 1.45;
}

.feedback-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--blue-100);
  color: var(--blue-700);
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Solicitante e e-mail vêm da conta Google e não se editam: cinza mais
   forte para isso ficar claro antes de a pessoa tentar digitar. */
.field input[readonly] {
  border-color: var(--slate-200);
  background: var(--slate-100);
  color: var(--slate-500);
  cursor: not-allowed;
}

.confirm-dialog {
  width: min(430px, calc(100% - 32px));
  max-width: calc(100vw - 32px);
  overflow-x: hidden;
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 26px 80px rgba(15, 23, 42, 0.28);
}

.confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(3px);
}

.confirm-dialog form {
  min-width: 0;
  padding: 26px;
}

.confirm-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: var(--orange-100);
  color: var(--orange-600);
}

.confirm-dialog h2 {
  margin: 0;
  font-size: 1.35rem;
}

.confirm-summary {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: var(--slate-50);
}

.confirm-summary div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
}

.confirm-summary span {
  color: var(--slate-500);
  font-size: 0.82rem;
}

.confirm-summary strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--slate-700);
  font-size: 0.9rem;
  font-weight: 600;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  margin-top: 24px;
}

.confirm-actions .secondary-button,
.confirm-actions .primary-button,
.confirm-ok {
  width: 100%;
}

.confirm-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(180, 83, 9, 0.22);
  border-radius: 8px;
  background: var(--orange-100);
  color: #b45309;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

.confirm-status.is-success {
  border-color: rgba(22, 101, 52, 0.2);
  background: #f0fdf4;
  color: var(--green-700);
}

.confirm-status.is-error {
  border-color: rgba(185, 28, 28, 0.2);
  background: #fef2f2;
  color: var(--danger);
}

.confirm-status.is-loading .lucide {
  animation: spin 1s linear infinite;
}

.confirm-ok {
  margin-top: 24px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .field-grid {
    grid-template-columns: 1fr;
  }

  .field-grid:not(.is-support) .start-datetime-pair {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(96px, 0.8fr);
    gap: 10px;
  }

  .app-shell {
    flex-direction: column;
    gap: 0;
    width: min(960px, calc(100% - 32px));
  }

  .sidebar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex: none;
    position: static;
    margin: 12px 0 0;
    gap: 12px;
    padding: 10px 14px;
  }

  .app-shell > main {
    padding-top: 12px;
  }

  .sidebar-user {
    flex-direction: row;
    gap: 8px;
    padding-bottom: 0;
    border-bottom: 0;
    text-align: left;
  }

  .sidebar-user img {
    width: 36px;
    height: 36px;
  }

  .sidebar-user span {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
  }

  /* Na faixa horizontal do mobile o botão cai numa segunda linha, ocupando a
     largura toda — continua no fim de tudo, como no desktop. */
  .sidebar-feedback {
    flex: 1 0 100%;
    padding-top: 10px;
  }

  .sidebar-feedback-button {
    justify-content: center;
    padding: 7px 10px;
    font-size: 0.74rem;
    text-align: center;
  }
}

@media (max-width: 640px) {
  main {
    width: min(100% - 20px, 960px);
  }

  .intro-band {
    min-height: 230px;
    margin-top: 10px;
    padding: 24px;
  }

  #solicitacao {
    margin-top: 14px;
  }

  .request-type-card {
    width: 100%;
  }

  .request-tabs {
    grid-template-columns: 1fr;
  }

  .field-grid.is-support .datetime-pair {
    grid-template-columns: minmax(0, 1.45fr) minmax(96px, 0.8fr);
    gap: 10px;
  }

  .form-heading,
  .form-actions,
  .confirm-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .deadline-pill,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .unit-picker span,
  .channel-picker span,
  .support-picker span,
  .local-picker span {
    min-width: 78px;
  }

  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-header-fields {
    width: 100%;
  }

  .link-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
