:root {
  --bg: #f2f2f2;
  --surface: #ffffff;
  --ink: #242424;
  --muted: #666666;
  --line: #d7d7d7;
  --soft-line: #ececec;
  --primary: #b51205;
  --primary-strong: #930f03;
  --primary-soft: #fff1ef;
  --accent: #666666;
  --accent-strong: #4f4f4f;
  --good: #247a42;
  --warn: #a86600;
  --danger: #8a1f14;
  --shadow: 0 14px 34px rgba(36, 36, 36, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.hidden {
  display: none !important;
}

.login-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 210px 24px 48px;
  background:
    linear-gradient(#fff 0 114px, var(--primary) 114px 172px, var(--accent) 172px 228px, var(--bg) 228px 100%);
}

.portal-masthead {
  position: absolute;
  inset: 0 0 auto;
  display: grid;
  place-items: center;
  height: 114px;
  background: #fff;
  border-bottom: 1px solid var(--soft-line);
}

.portal-masthead img {
  width: min(330px, 70vw);
  max-height: 86px;
  object-fit: contain;
}

.login-grid {
  width: min(1060px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 22px;
  align-items: start;
}

.brand-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--soft-line);
}

.brand-strip img {
  width: 100%;
  max-height: 76px;
  object-fit: contain;
  background: #fff;
}

.login-avatar {
  width: min(240px, 62vw);
  aspect-ratio: 1;
  margin: -8px auto 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--soft-line);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%, #ffffff 0 54%, var(--primary-soft) 55% 100%);
  box-shadow: 0 14px 28px rgba(36, 36, 36, 0.12);
  overflow: hidden;
}

.login-avatar.compact {
  width: 132px;
  margin-top: 0;
}

.login-avatar img {
  width: 112%;
  height: 112%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 10px 12px rgba(36, 36, 36, 0.16));
}

.login-panel {
  width: 100%;
  max-width: 560px;
  justify-self: center;
  grid-column: 1 / -1;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 5px solid var(--primary);
  border-radius: 6px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin-bottom: 8px;
}

.login-panel p {
  margin-bottom: 22px;
}

.login-choice {
  max-width: 780px;
  text-align: center;
}

.entry-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.entry-actions button {
  min-height: 56px;
  font-size: 1rem;
}

.secondary-button {
  background: var(--accent);
}

.secondary-button:hover {
  background: var(--accent-strong);
}

.type-guide-button {
  align-self: end;
}

.mini-action {
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: #fff;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.mini-action:hover {
  background: #fff5f4;
}

.project-summary-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--soft-line);
}

.project-summary-head h2 {
  margin-bottom: 4px;
}

.project-summary-head p {
  margin: 0;
  color: var(--primary-strong);
  font-weight: 700;
  line-height: 1.35;
}

.project-summary-head .type-guide-button {
  min-width: 190px;
}

.creator-credit {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr;
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid var(--soft-line);
  box-shadow: 0 6px 20px rgba(36, 36, 36, 0.08);
}

.topbar-brand {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px 28px;
}

.topbar-brand img:first-child {
  width: 210px;
  height: 68px;
}

.topbar-brand img {
  width: 168px;
  height: 58px;
  object-fit: contain;
}

.topbar-brand .topbar-avatar {
  width: 62px;
  height: 62px;
  border: 2px solid var(--primary-soft);
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
  object-position: center bottom;
  box-shadow: 0 8px 18px rgba(36, 36, 36, 0.12);
}

.topbar strong {
  display: block;
  font-size: 1.22rem;
  color: var(--primary-strong);
}

.topbar span {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  font-size: 0.92rem;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  min-height: 58px;
  background: var(--primary);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.tab,
button {
  min-height: 42px;
  border: 0;
  border-radius: 4px;
  padding: 0 17px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.tab {
  min-height: 58px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
  background: transparent;
}

.tab:last-of-type {
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.tab.active,
.tab:hover,
button:hover {
  background: var(--primary-strong);
}

#logoutButton {
  min-height: 58px;
  border-radius: 0;
  background: var(--accent);
}

#logoutButton:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.link-button {
  margin-top: 10px;
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.link-button:hover {
  background: var(--primary);
  color: #fff;
}

.context-bar {
  min-height: 56px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

main {
  width: min(1260px, calc(100% - 32px));
  margin: 30px auto 64px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin: 0 0 18px;
  padding: 0 0 16px;
  border-bottom: 3px solid var(--primary);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--primary-strong);
  font-size: clamp(1.65rem, 2.4vw, 2.35rem);
  line-height: 1.1;
}

h2 {
  color: var(--ink);
  font-size: 1.08rem;
  margin-bottom: 16px;
}

p {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 18px;
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.four {
  grid-template-columns: 1.4fr 0.55fr 0.55fr 1fr;
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--primary);
  border-radius: 6px;
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.admin-overview {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-stat {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.admin-stat span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-stat strong {
  color: var(--primary-strong);
  font-size: clamp(1.15rem, 1.45vw, 1.55rem);
  line-height: 1.1;
}

.admin-stat.attention {
  border-left-color: var(--primary);
  background: var(--primary-soft);
}

.admin-stat.rejected {
  border-left-color: var(--danger);
  background: #f8e8e4;
}

.admin-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.admin-section-title h2 {
  margin: 0;
  color: var(--primary-strong);
  font-size: 1.2rem;
}

.admin-section-title p {
  max-width: 560px;
  text-align: right;
}

.admin-control-grid {
  min-width: 0;
  align-items: start;
}

.admin-cycle-panel {
  border-top-width: 0;
  border-left: 5px solid var(--primary);
  padding: 0;
  overflow: hidden;
}

.admin-cycle-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.admin-cycle-top-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(520px, 1.4fr);
  min-width: 0;
}

.admin-cycle-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  min-height: 100%;
  padding: 20px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.admin-cycle-top-row .admin-cycle-card:last-child {
  border-right: 0;
}

.registration-window-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  gap: 12px;
  min-width: 0;
}

.deadline-config-fields {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) repeat(3, minmax(180px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  min-width: 0;
}

.admin-cycle-card h2 {
  margin-bottom: 2px;
  color: var(--primary-strong);
}

.admin-cycle-card label {
  margin-bottom: 0;
}

.admin-cycle-card button {
  justify-self: start;
  margin-top: 4px;
}

.deadline-config-card {
  background: #fffdfd;
  border-top: 1px solid var(--line);
  border-right: 0;
}

.deadline-config-card h2 {
  margin-bottom: 0;
}

.deadline-inline-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  margin-top: 3px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f4f5f6;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.deadline-inline-status.open {
  background: #eefaf3;
  color: var(--good);
}

.deadline-inline-status.closed {
  background: var(--primary-soft);
  color: var(--danger);
}

.deadline-inline-status.pending {
  background: #f4f5f6;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .admin-overview {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .admin-cycle-top-row {
    grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
  }

  .admin-cycle-top-row .admin-cycle-card:first-child {
    border-right: 1px solid var(--line);
  }

  .deadline-config-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .deadline-config-fields label:first-child {
    grid-column: 1 / -1;
  }

  .deadline-config-fields button {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 760px) {
  main,
  .panel,
  .admin-panel,
  .admin-control-grid,
  .fatec-course-panel,
  .professor-panel,
  .fatec-create-form,
  .professor-create-form,
  .fatec-create-main,
  .professor-create-main,
  .professor-edit-picker,
  .professor-fatec-field,
  .embedded-table-block {
    max-width: 100%;
    min-width: 0;
  }

  .topbar {
    position: static;
  }

  .topbar-brand {
    min-height: auto;
    padding: 12px 16px;
    gap: 10px;
  }

  .topbar-brand img:first-child {
    width: 150px;
    height: 48px;
  }

  .topbar-brand img {
    width: 112px;
    height: 42px;
  }

  .topbar strong {
    font-size: 1.05rem;
  }

  .topbar span {
    font-size: 0.82rem;
  }

  .admin-cycle-top-row,
  .registration-window-fields,
  .deadline-config-fields {
    grid-template-columns: 1fr;
  }

  .admin-cycle-top-row .admin-cycle-card:first-child {
    border-right: 0;
  }

  .deadline-config-fields label:first-child,
  .deadline-config-fields button {
    grid-column: auto;
  }

  .admin-cycle-panel {
    border-left-width: 4px;
  }

  .admin-cycle-card {
    padding: 16px;
  }

  .admin-cycle-card button,
  .deadline-config-fields button {
    width: 100%;
    justify-self: stretch;
  }

  .deadline-inline-status {
    max-width: 100%;
    white-space: normal;
  }

  .check-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .check-option {
    width: 100%;
    justify-content: flex-start;
  }

  .admin-fatec-table,
  .admin-professor-table,
  .admin-group-table {
    display: block;
    min-width: 0;
    width: 100%;
    border-spacing: 0;
  }

  .admin-fatec-table thead,
  .admin-professor-table thead,
  .admin-group-table thead {
    display: none;
  }

  .admin-fatec-table tbody,
  .admin-professor-table tbody,
  .admin-group-table tbody {
    display: grid;
    gap: 12px;
  }

  .admin-fatec-table tr,
  .admin-professor-table tr,
  .admin-group-table tr {
    display: grid;
    border: 1px solid var(--soft-line);
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
  }

  .admin-fatec-table td,
  .admin-professor-table td,
  .admin-group-table td {
    display: grid;
    grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 10px 12px;
    border-bottom: 1px solid var(--soft-line);
    overflow-wrap: anywhere;
  }

  .admin-fatec-table td::before,
  .admin-professor-table td::before,
  .admin-group-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .admin-fatec-table td:last-child,
  .admin-professor-table td:last-child,
  .admin-group-table td:last-child {
    border-bottom: 0;
  }
}

.admin-panel {
  overflow: hidden;
  min-height: 100%;
  border-top-width: 0;
  border-left: 5px solid var(--primary);
}

.fatec-course-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.fatec-course-panel > h2 {
  margin-bottom: 0;
}

.fatec-create-form {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--soft-line);
}

.fatec-create-main {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}

.fatec-create-form label {
  margin: 0;
}

.fatec-whatsapp-field {
  display: block;
}

.fatec-edit-picker {
  max-width: 520px;
}

.fatec-signature-field {
  display: grid;
  gap: 8px;
}

.signature-status {
  display: block;
  color: var(--muted);
}

.fatec-create-form button {
  justify-self: start;
}

.fatec-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.fatec-form-actions .check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.fatec-form-actions .check input {
  flex: 0 0 auto;
}

.professor-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.professor-create-form {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.professor-create-main {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) minmax(220px, 1fr) minmax(180px, 0.7fr);
  gap: 14px;
  align-items: end;
}

.professor-create-form label {
  margin: 0;
}

.professor-edit-picker {
  width: 100%;
  max-width: 520px;
}

.professor-fatec-field {
  min-width: 0;
  margin-bottom: 0;
}

.professor-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.embedded-table-block {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.embedded-table-block h3 {
  margin: 0;
  color: var(--primary-strong);
  font-size: 1.05rem;
}

.ai-admin-panel textarea {
  min-height: 124px;
}

.requests-panel {
  border-left-color: var(--accent);
}

.admin-group-requests {
  margin-top: 18px;
}

.admin-data-lists {
  margin-top: 18px;
}

.admin-list-panel {
  border-top-width: 0;
  border-left: 5px solid var(--accent);
}

.wide {
  width: 100%;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #333333;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 15px;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

select,
input {
  text-overflow: ellipsis;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(181, 18, 5, 0.16);
  border-color: var(--primary);
}

.lists {
  margin-top: 4px;
}

.admin-lists {
  grid-template-columns: 1fr;
}

.admin-lists .panel {
  margin-bottom: 0;
}

.list {
  display: grid;
  gap: 12px;
}

.item,
.work-card,
.delivery-row {
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 5px;
  padding: 14px;
  background: #fff;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 38px;
  min-height: 34px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
}

.password-toggle:hover,
.password-toggle:focus {
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: none;
}

.item strong,
.work-card strong {
  display: block;
  color: var(--primary-strong);
}

.inline-edit {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr)) auto;
  gap: 16px;
  align-items: end;
  padding: 18px;
  border-left-width: 4px;
  box-shadow: none;
}

.compact-edit {
  grid-template-columns: minmax(280px, 1fr) auto auto;
}

.admin-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.approved {
  background: #eefaf3;
  color: var(--good);
}

.status-pill.pending {
  background: var(--primary-soft);
  color: var(--danger);
}

.status-pill.rejected {
  background: #f8e8e4;
  color: var(--danger);
}

.admin-request-card {
  display: grid;
  gap: 10px;
}

.admin-request-card.pending {
  border-left-color: var(--primary);
}

.admin-request-card.approved {
  border-left-color: var(--good);
}

.admin-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-meta-grid span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: #fafafa;
  color: var(--ink);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.admin-meta-grid small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.signature-preview {
  display: block;
  width: 180px;
  max-height: 64px;
  object-fit: contain;
  margin: 6px 0 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.processing-box {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 16px;
  border: 1px solid rgba(181, 18, 5, 0.18);
  border-radius: 6px;
  background: #ffffff;
  color: var(--primary-strong);
  box-shadow: 0 12px 32px rgba(35, 39, 44, 0.18);
  font-weight: 700;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.processing-box.show {
  opacity: 1;
  transform: translateY(0);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #f0c8c4;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.inline-edit label {
  margin: 0;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 12px 14px 14px;
  margin: 0 0 15px;
  background: #fafafa;
}

legend {
  padding: 0 6px;
  color: #333333;
  font-size: 0.9rem;
  font-weight: 700;
}

.span-2 {
  grid-column: span 2;
}

.check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.check-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin: 0;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.check-option input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--primary);
}

.form-message {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-radius: 5px;
  border: 1px solid #e0aa9d;
  background: var(--primary-soft);
  color: var(--danger);
  font-weight: 700;
  margin-bottom: 14px;
}

.form-message.success {
  border-color: #a7d8bd;
  background: #eefaf3;
  color: var(--good);
}

.form-note {
  border: 1px solid var(--soft-line);
  border-left: 5px solid var(--accent);
  border-radius: 5px;
  padding: 12px 14px;
  background: #fff8e8;
  color: var(--text);
  line-height: 1.45;
}

.form-note.blocked {
  border-color: #e0aa9d;
  border-left-color: var(--danger);
  background: var(--primary-soft);
  color: var(--danger);
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(20, 24, 28, 0.62);
  backdrop-filter: blur(2px);
}

.modal-panel {
  display: flex;
  flex-direction: column;
  width: min(1040px, 100%);
  max-height: calc(100vh - 44px);
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.3);
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px;
  background: var(--primary);
  color: #fff;
}

.modal-head span {
  display: block;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.modal-head h2 {
  margin: 3px 0 0;
  color: #fff;
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.modal-head p {
  max-width: 720px;
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.45;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1.4rem;
  line-height: 1;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.22);
}

.confirm-modal {
  width: min(520px, 100%);
}

.confirm-modal .modal-head {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-strong) 100%);
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 22px;
  border-top: 1px solid var(--soft-line);
  background: #fff;
}

.confirm-modal-actions button {
  min-height: 42px;
}

.notice-modal-body {
  display: grid;
  gap: 8px;
  padding: 18px 22px 4px;
}

.notice-modal-body div {
  padding: 10px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: #fafafa;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.35;
}

.prompt-modal-body {
  padding: 18px 22px 4px;
}

.prompt-modal-body textarea {
  min-height: 130px;
}

.type-guide-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 22px 26px 72px;
  background: #f8fafb;
  scrollbar-gutter: stable;
}

.type-guide-section {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.type-guide-section:last-child {
  margin-bottom: 0;
}

.type-guide-section h3 {
  margin: 0 0 14px;
  color: var(--primary-strong);
  font-size: 1.08rem;
}

.type-guide-group {
  margin: 0 0 14px;
  padding-top: 12px;
  border-top: 1px solid var(--soft-line);
}

.type-guide-group:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.type-guide-group strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-strong);
}

.type-guide-group ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.type-guide-group li {
  position: relative;
  padding-left: 18px;
  line-height: 1.4;
  color: var(--text);
}

.type-guide-group li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.type-guide-group li span {
  display: block;
}

.type-guide-complement {
  border: 1px solid #f0d4d1;
  border-left: 5px solid var(--accent);
  background: #fff8f7;
}

.registration-status {
  padding: 10px 12px;
  border: 1px solid #a7d8bd;
  border-radius: 5px;
  background: #eefaf3;
  color: var(--good);
  font-weight: 700;
  margin-bottom: 14px;
}

.registration-status.closed {
  border-color: #e0aa9d;
  background: var(--primary-soft);
  color: var(--danger);
}

.meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.components-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 4px;
}

.component-row {
  display: grid;
  grid-template-columns: 0.75fr 1.2fr 0.85fr 1.25fr 0.7fr 0.75fr auto;
  gap: 12px;
  align-items: end;
  padding: 15px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 5px;
  margin-bottom: 12px;
  background: #fff;
}

.component-row label {
  margin: 0;
}

.component-row .check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.check input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--primary);
}

.remove {
  width: 44px;
  padding: 0;
  background: var(--accent);
}

.remove:hover {
  background: var(--danger);
}

.work-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.work-card {
  border-left-color: var(--primary);
}

.work-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.work-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 100%;
}

.work-card-head > div:first-child {
  min-width: 0;
}

.work-description {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: #fafafa;
  color: var(--ink);
}

.grade-composition {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--danger);
  border-radius: 5px;
  background: var(--primary-soft);
}

.grade-composition.approved {
  border-left-color: var(--good);
  background: #eefaf3;
}

.grade-composition strong {
  color: var(--primary-strong);
}

.grade-composition span,
.grade-composition small {
  color: var(--muted);
}

.grade-breakdown {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.grade-breakdown div {
  display: grid;
  gap: 4px;
  min-height: 64px;
  align-content: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.phase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.phase-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 5px;
  padding: 12px;
  background: #fff;
}

.phase-card.open {
  border-left-color: var(--good);
}

.phase-card.closed {
  border-left-color: var(--danger);
  background: var(--primary-soft);
}

.phase-card.pending {
  border-left-color: var(--warn);
}

.phase-card span,
.phase-card small {
  color: var(--muted);
  line-height: 1.35;
}

.work-edit-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.component-details {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: #fafafa;
}

.component-details > strong {
  color: var(--primary-strong);
}

.component-detail-row {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr 0.75fr 1.25fr 0.7fr;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.whatsapp-info:empty {
  display: none;
}

.whatsapp-info h2 {
  margin-bottom: 12px;
}

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

.whatsapp-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 5px solid var(--good);
  border-radius: 5px;
  padding: 12px;
  background: #fff;
}

.whatsapp-card img {
  width: 96px;
  height: 96px;
  border: 1px solid var(--soft-line);
  background: #fff;
}

.whatsapp-card a,
.qr-link {
  color: var(--primary);
  font-weight: 700;
}

.admin-delivery-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.admin-delivery-sidebar {
  display: grid;
  gap: 18px;
  align-items: start;
}

.admin-delivery-main {
  min-width: 0;
}

.delivery-admin-filter {
  border-top-width: 0;
  border-left: 5px solid var(--primary);
}

.delivery-admin-filter h2 {
  margin-bottom: 12px;
  color: var(--primary-strong);
}

.delivery-list-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--soft-line);
}

.delivery-list-head h2 {
  margin-bottom: 3px;
}

.delivery-list-head span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.delivery-projects {
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.delivery-project-table {
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}

.admin-group-table {
  min-width: 1080px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}

.admin-fatec-table {
  min-width: 1080px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}

.admin-professor-table {
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}

.delivery-project-table th,
.admin-group-table th,
.admin-fatec-table th,
.admin-professor-table th {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
  color: var(--accent-strong);
  font-size: 0.76rem;
  text-align: left;
  text-transform: uppercase;
}

.delivery-project-table thead tr:first-child th,
.admin-group-table thead th,
.admin-fatec-table thead th,
.admin-professor-table thead th {
  background: #fff8f7;
  color: var(--primary-strong);
}

.delivery-project-table td,
.admin-group-table td,
.admin-fatec-table td,
.admin-professor-table td {
  padding: 11px 9px;
  border-bottom: 1px solid var(--soft-line);
  vertical-align: top;
}

.delivery-project-table tbody tr,
.admin-group-table tbody tr,
.admin-fatec-table tbody tr,
.admin-professor-table tbody tr {
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.delivery-project-table tbody tr:hover,
.delivery-project-table tbody tr.selected,
.admin-group-table tbody tr:hover,
.admin-fatec-table tbody tr:hover,
.admin-professor-table tbody tr:hover {
  background: #fff8f7;
}

.delivery-project-table tbody tr.selected td:first-child {
  box-shadow: inset 5px 0 0 var(--primary);
}

.delivery-project-table td strong,
.admin-group-table td strong,
.admin-fatec-table td strong,
.admin-professor-table td strong {
  color: var(--primary-strong);
}

.delivery-project-table td small,
.admin-group-table td small,
.admin-fatec-table td small,
.admin-professor-table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.delivery-project-table button,
.admin-group-table button,
.admin-fatec-table button,
.admin-professor-table button {
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vertical-actions {
  display: grid;
  justify-items: start;
}

.admin-fatec-table input[type="text"],
.admin-fatec-table input[type="url"],
.admin-fatec-table input[type="email"],
.admin-fatec-table input:not([type]) {
  min-height: 40px;
}

.admin-fatec-table input[type="file"] {
  min-height: 40px;
  padding: 8px;
  font-size: 0.82rem;
}

.table-signature {
  width: 130px;
  max-height: 46px;
  margin-bottom: 6px;
}

.table-check {
  display: inline-flex;
  margin: 0;
}

.rejection-reason {
  display: block;
  max-width: 320px;
  color: var(--muted);
  line-height: 1.4;
}

.muted-action {
  color: var(--muted);
  font-weight: 700;
}

.delivery-average {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 30px;
  border-radius: 999px;
  background: #f4f5f6;
}

.delivery-average.approved {
  background: #eefaf3;
  color: var(--good);
}

.delivery-average.failed {
  background: var(--primary-soft);
  color: var(--danger);
}

.delivery-table-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f2f2f2;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.delivery-table-status.open {
  background: #eefaf3;
  color: var(--good);
}

.delivery-table-status.pending {
  background: #f4f5f6;
  color: var(--muted);
}

.delivery-table-status.closed {
  background: var(--primary-soft);
  color: var(--danger);
}

.delivery-upload-layout {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(320px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.delivery-phase-field {
  align-self: start;
}

.file-drop-zone {
  min-height: 150px;
  margin-bottom: 0;
  padding: 18px;
  border: 2px dashed #c9c9c9;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.file-drop-zone:hover,
.file-drop-zone:focus-within {
  border-color: var(--accent);
  background: #fff8f7;
}

.file-drop-zone input[type="file"] {
  margin: 8px 0 10px;
  min-height: 48px;
  padding: 9px;
  border: 1px solid var(--line);
  background: #fafafa;
}

.file-drop-title {
  display: block;
  margin-top: 4px;
  color: var(--primary-strong);
  font-size: 1.05rem;
  font-weight: 800;
}

.file-drop-help {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
}

#selectedDeliveryFile {
  display: block;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: #f8fafb;
  color: var(--muted);
  word-break: break-word;
}

#selectedDeliveryFile.has-file {
  border-color: #a7d8bd;
  background: #eefaf3;
  color: var(--good);
}

.delivery-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) minmax(150px, 210px);
  grid-template-areas:
    "phase file date"
    "phase evaluation evaluation"
    "phase preview preview"
    "phase feedback feedback";
  gap: 12px 16px;
  align-items: start;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fff;
}

.delivery-phase-label {
  grid-area: phase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.delivery-file-cell {
  grid-area: file;
  min-width: 0;
}

.delivery-file-cell > span,
.delivery-date-cell > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.delivery-file-cell strong,
.delivery-date-cell strong {
  display: block;
  min-width: 0;
  color: var(--text);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.delivery-file-cell a {
  overflow-wrap: anywhere;
}

.delivery-date-cell {
  grid-area: date;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fafafa;
}

.delivery-evaluation-cell {
  grid-area: evaluation;
  min-width: 0;
}

.delivery-preview {
  grid-area: preview;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafb;
}

.delivery-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
  background: #fff;
}

.delivery-preview-head strong {
  color: var(--primary-strong);
}

.delivery-preview-head a {
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.delivery-preview iframe {
  display: block;
  width: 100%;
  height: min(62vh, 620px);
  min-height: 420px;
  border: 0;
  background: #f2f2f2;
}

.delivery-detail-panel {
  border: 1px solid rgba(181, 18, 5, 0.18);
  border-top: 6px solid var(--primary);
  border-left: 1px solid rgba(181, 18, 5, 0.18);
  box-shadow: 0 18px 45px rgba(35, 39, 44, 0.12);
}

.delivery-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin: -18px -18px 18px;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(181, 18, 5, 0.16);
  background: linear-gradient(90deg, #fff8f7 0%, #ffffff 62%);
}

.delivery-detail-head span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.delivery-detail-head h2 {
  margin: 3px 0 4px;
  color: var(--primary-strong);
}

.delivery-detail-head > strong {
  align-self: start;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #f8f8f8;
  color: var(--accent-strong);
  font-size: 0.88rem;
  text-align: right;
}

.delivery-advisors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.delivery-advisors div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-left: 5px solid var(--accent);
  border-radius: 6px;
  background: #fff;
}

.delivery-advisors span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.delivery-advisors strong {
  color: var(--primary-strong);
  overflow-wrap: anywhere;
}

.delivery-advisors small {
  color: var(--muted);
}

.delivery-feedback {
  grid-area: feedback;
  border-top: 1px solid var(--soft-line);
  padding-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.delivery-feedback strong {
  color: var(--primary-strong);
}

.delivery-feedback p {
  margin: 4px 0 0;
}

.delivery-feedback small,
.feedback-preview {
  color: var(--muted);
  line-height: 1.4;
}

.deadline-panel {
  border-top-color: var(--accent);
}

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

.deadline-fatec-list {
  display: grid;
  gap: 16px;
}

.deadline-fatec {
  display: grid;
  gap: 10px;
}

.deadline-fatec > strong {
  color: var(--primary-strong);
}

.deadline-card {
  display: grid;
  gap: 6px;
  min-height: 86px;
  align-content: center;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 5px;
  padding: 14px;
  background: #fff;
}

.deadline-card strong {
  color: var(--primary-strong);
}

.deadline-card span {
  color: var(--muted);
  font-weight: 700;
}

.deadline-card small {
  color: var(--muted);
  line-height: 1.35;
}

.deadline-card.open {
  border-left-color: var(--good);
}

.deadline-card.closed {
  border-left-color: var(--danger);
  background: var(--primary-soft);
}

.deadline-card.admin {
  border-left-color: var(--accent);
  background: #f8f8f8;
}

.grade-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fafafa;
}

.grade-form-top {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.grade-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.grade-form input,
.grade-form button {
  min-height: 40px;
}

.grade-form button {
  padding: 0 14px;
  white-space: nowrap;
}

.grade-form label {
  margin-bottom: 0;
  font-size: 0.88rem;
}

.grade-form .feedback-field {
  grid-column: 1 / -1;
}

.grade-form textarea {
  width: 100%;
  min-height: 150px;
  line-height: 1.45;
  resize: vertical;
}

.ai-result {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.35;
}

.filters {
  display: grid;
  grid-template-columns: 0.75fr 1fr 1fr 1fr auto;
  gap: 16px;
  align-items: end;
}

.filters label {
  margin: 0;
}

#workFilterForm {
  grid-template-columns: minmax(170px, 0.7fr) minmax(260px, 1.2fr) minmax(150px, 0.65fr) minmax(190px, 0.8fr) auto;
  width: 100%;
  max-width: 100%;
}

#workFilterForm button {
  white-space: nowrap;
}

#deliveryFilterForm {
  grid-template-columns: 1fr;
  max-width: none;
}

#deliveryFilterForm h2 {
  margin-bottom: 0;
}

.delivery-filter-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(220px, 1fr) minmax(190px, 0.8fr);
  gap: 14px;
  align-items: end;
}

.delivery-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.delivery-search-row label {
  margin: 0;
}

.delivery-search-row input {
  min-height: 46px;
}

.delivery-search-row button {
  min-height: 46px;
  padding-inline: 24px;
}

.work-component-row {
  grid-template-columns: 0.8fr 1.3fr 1.4fr 0.75fr 0.75fr auto;
}

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

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-grid {
  margin-bottom: 18px;
}

.dashboard-card h2 {
  margin-bottom: 14px;
}

.dashboard-card canvas {
  display: block;
  width: 100%;
  min-height: 260px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #fff;
}

.metric {
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 5px;
  padding: 15px;
  background: #fff;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.metric strong {
  display: block;
  margin-top: 5px;
  color: var(--primary-strong);
  font-size: 1.7rem;
}

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

.info-grid div {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 12px;
  background: #fff;
}

.info-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 5px;
}

.info-grid strong {
  color: var(--primary-strong);
}

.phase-summary,
.dashboard-list {
  display: grid;
  gap: 12px;
}

.phase-summary {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--soft-line);
}

.phase-summary:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.dashboard-bar {
  display: grid;
  gap: 7px;
}

.dashboard-bar div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f3;
}

.bar-track span {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: var(--primary);
}

.dashboard-bar.good .bar-track span {
  background: var(--good);
}

.dashboard-bar.warn .bar-track span {
  background: var(--accent);
}

.dashboard-bar.danger .bar-track span {
  background: var(--danger);
}

.dashboard-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 5px;
  padding: 12px;
  background: #fff;
}

.dashboard-item span {
  color: var(--muted);
  line-height: 1.4;
}

canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--accent);
  color: #fff;
  font-size: 0.86rem;
}

tbody tr:nth-child(even) {
  background: #f8f8f8;
}

#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100% - 40px));
  padding: 13px 16px;
  border-radius: 5px;
  background: #242424;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  transition: 0.2s ease;
  pointer-events: none;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .topbar-brand,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-brand {
    min-height: auto;
    justify-content: flex-start;
  }

  .topbar-brand img:first-child,
  .topbar-brand img {
    width: min(230px, 100%);
  }

  .two,
  .three,
  .four,
  .filters,
  .admin-overview,
  .admin-cycle-grid,
  .admin-delivery-layout,
  .admin-delivery-sidebar,
  .fatec-create-form,
  .fatec-create-main,
  .professor-create-main,
  .delivery-upload-layout,
  .login-grid,
  .work-list,
  .grade-breakdown,
  .phase-grid,
  .deadline-grid,
  .component-row,
  .delivery-row,
  .inline-edit,
  .compact-edit,
  .whatsapp-grid,
  .whatsapp-card,
  .component-detail-row,
  .summary,
  .dashboard-metrics,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .delivery-row {
    grid-template-areas:
      "phase"
      "file"
      "date"
      "evaluation"
      "preview"
      "feedback";
  }

  .delivery-phase-label {
    justify-content: flex-start;
    padding: 0 12px;
  }

  .grade-form-top {
    grid-template-columns: 1fr;
  }

  .grade-form-actions {
    justify-content: stretch;
  }

  .grade-form-actions button {
    flex: 1 1 150px;
  }

  .delivery-preview-head {
    display: grid;
  }

  .delivery-preview-head a {
    white-space: normal;
  }

  .delivery-preview iframe {
    min-height: 360px;
  }

  .delivery-filter-row {
    grid-template-columns: 1fr;
  }

  .delivery-search-row {
    grid-template-columns: 1fr;
  }

  .work-card-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .project-summary-head {
    display: grid;
  }

  .delivery-detail-head {
    display: grid;
  }

  .delivery-advisors {
    grid-template-columns: 1fr;
  }

  .delivery-detail-head > strong {
    max-width: none;
    text-align: left;
  }

  .admin-section-title {
    display: grid;
  }

  .admin-section-title p {
    text-align: left;
  }

  .admin-cycle-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-cycle-card:last-child {
    border-bottom: 0;
  }

  .admin-cycle-top-row .admin-cycle-card:last-child {
    border-bottom: 1px solid var(--line);
  }

  .project-summary-head .type-guide-button {
    width: 100%;
    min-width: 0;
  }

  .span-2 {
    grid-column: auto;
  }

  .type-guide-group ul {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal-panel {
    max-height: calc(100vh - 20px);
  }

  .modal-head,
  .type-guide-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .confirm-modal-actions {
    display: grid;
    padding: 16px;
  }

  .type-guide-content {
    padding-bottom: 84px;
  }

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

  .tab,
  #logoutButton {
    min-height: 50px;
  }
}

@media (min-width: 761px) and (max-width: 980px) {
  #workFilterForm {
    grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.2fr) minmax(140px, 0.7fr);
    max-width: 100%;
  }

  #workFilterForm label:nth-of-type(4),
  #workFilterForm button {
    grid-column: auto;
  }

  .work-actions {
    justify-content: flex-start;
  }

  .admin-cycle-top-row {
    grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
  }

  .admin-cycle-top-row .admin-cycle-card:first-child {
    border-right: 1px solid var(--line);
  }

  .deadline-config-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .deadline-config-fields label:first-child,
  .deadline-config-fields button {
    grid-column: 1 / -1;
  }

  .deadline-config-fields button {
    width: auto;
    justify-self: start;
  }
}

@media (max-width: 760px) {
  #workFilterForm {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 100%;
  }

  #workFilterForm label:nth-of-type(2) {
    grid-column: 1 / -1;
    order: 4;
  }

  #workFilterForm button {
    grid-column: 1 / -1;
    order: 5;
    width: 100%;
  }

  #workFilterForm label:nth-of-type(1) {
    order: 1;
  }

  #workFilterForm label:nth-of-type(3) {
    order: 2;
  }

  #workFilterForm label:nth-of-type(4) {
    order: 3;
  }

  .work-card {
    padding: 12px;
  }

  .work-card-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .work-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  .work-actions button {
    width: 100%;
    min-height: 40px;
    padding: 0 8px;
    font-size: 0.86rem;
    white-space: normal;
    line-height: 1.15;
  }

  .topbar {
    position: static;
  }

  .topbar-brand {
    min-height: auto;
    display: grid;
    grid-template-columns: 78px 1fr;
    justify-content: start;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
  }

  .topbar-brand img:first-child {
    display: none;
  }

  .topbar-brand img {
    width: 70px;
    height: 34px;
  }

  .topbar-brand img:not(.topbar-avatar) {
    display: none;
  }

  .topbar-brand .topbar-avatar {
    width: 48px;
    height: 48px;
    grid-column: 1;
    grid-row: 1;
  }

  .topbar-brand > div {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .topbar strong {
    font-size: 1.12rem;
    line-height: 1.05;
  }

  .topbar span {
    margin-top: 2px;
    font-size: 0.82rem;
    line-height: 1.2;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: auto;
  }

  .tab,
  #logoutButton {
    min-height: 42px;
    padding: 0 8px;
    font-size: 0.86rem;
  }

  #logoutButton {
    grid-column: 1 / -1;
    min-height: 38px;
  }

  .admin-cycle-top-row,
  .registration-window-fields,
  .deadline-config-fields {
    grid-template-columns: 1fr;
  }

  .admin-cycle-top-row .admin-cycle-card:first-child {
    border-right: 0;
  }

  .deadline-config-fields label:first-child,
  .deadline-config-fields button {
    grid-column: auto;
  }

  .admin-cycle-card button,
  .deadline-config-fields button {
    width: 100%;
    justify-self: stretch;
  }
}

@media (max-width: 620px) {
  #workFilterForm {
    grid-template-columns: 1fr;
  }

  #workFilterForm label,
  #workFilterForm button {
    grid-column: auto;
  }

  .work-actions {
    grid-template-columns: 1fr;
  }

  .login-screen {
    padding: 190px 14px 32px;
    background:
      linear-gradient(#fff 0 104px, var(--primary) 104px 158px, var(--accent) 158px 208px, var(--bg) 208px 100%);
  }

  .portal-masthead {
    height: 104px;
  }

  .login-panel,
  .panel {
    padding: 14px;
  }

  .admin-panel {
    border-left-width: 4px;
  }

  .fatec-course-panel,
  .professor-panel {
    gap: 14px;
  }

  .fatec-course-panel > h2,
  .professor-panel > h2 {
    font-size: 1.05rem;
  }

  .fatec-create-form,
  .professor-create-form {
    gap: 12px;
    padding-bottom: 14px;
  }

  label {
    gap: 5px;
    font-size: 0.84rem;
  }

  input,
  select,
  textarea {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 0.9rem;
  }

  .fatec-create-main,
  .professor-create-main {
    gap: 11px;
  }

  .admin-section-title h2 {
    font-size: 1.08rem;
  }

  .admin-section-title p {
    font-size: 0.94rem;
    line-height: 1.25;
  }

  .entry-actions {
    grid-template-columns: 1fr;
  }

  main {
    width: calc(100% - 20px);
    margin-top: 22px;
  }

  .context-bar {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.84rem;
  }

  .table-scroll {
    overflow-x: auto;
    overflow-y: hidden;
  }

  .admin-fatec-table,
  .admin-professor-table,
  .admin-group-table {
    display: block;
    min-width: 0;
    width: 100%;
    border-spacing: 0;
  }

  .admin-fatec-table thead,
  .admin-professor-table thead,
  .admin-group-table thead {
    display: none;
  }

  .admin-fatec-table tbody,
  .admin-professor-table tbody,
  .admin-group-table tbody {
    display: grid;
    gap: 12px;
  }

  .admin-fatec-table tr,
  .admin-professor-table tr,
  .admin-group-table tr {
    display: grid;
    gap: 0;
    border: 1px solid var(--soft-line);
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
  }

  .admin-fatec-table td,
  .admin-professor-table td,
  .admin-group-table td {
    display: grid;
    grid-template-columns: minmax(94px, 0.42fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 10px 12px;
    border-bottom: 1px solid var(--soft-line);
    overflow-wrap: anywhere;
  }

  .admin-fatec-table td::before,
  .admin-professor-table td::before,
  .admin-group-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .admin-fatec-table td:last-child,
  .admin-professor-table td:last-child,
  .admin-group-table td:last-child {
    border-bottom: 0;
  }

  .admin-fatec-table td strong,
  .admin-professor-table td strong,
  .admin-group-table td strong {
    display: inline;
  }
}
