@font-face {
  font-family: "SGS Inter";
  src: url("/assets/fonts/inter-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "SGS Inter";
  src: url("/assets/fonts/inter-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
:root {
  --sgs-primary: #004A8D;
  --sgs-primary-hover: #033663;
  --sgs-accent: #FFC107;
  --sgs-bg-page: #F4F6F9;
  --sgs-card-bg: #FFFFFF;
  --sgs-border-subtle: #E2E8F0;
  --sgs-shadow-card: 0 4px 20px rgba(0, 74, 141, 0.08);
  --sgs-on-primary: #f7f4ee;
  --sgs-on-surface: #163028;
  --sgs-focus-ring: #FFC107;
  --sgs-sidebar-hover: #e7f0ea;
  --sgs-sub-indent: 18px;
  --sgs-control-radius: 8px;
  --sgs-control-min-height: 42px;
  --sgs-form-gap: 10px;
  --sgs-field-margin: 12px;
  --sgs-label-gap: 5px;
  --sgs-input-height: 42px;
  --sgs-section-spacing: 16px;
}
body {
  background-color: var(--sgs-bg-page) !important;
}
.sgs-shell {
  min-height: 100vh;
}
.sgs-appbar,
.sgs-sidebar,
.sgs-footer,
.sgs-appbar button,
.sgs-appbar a,
.sgs-sidebar a,
.sgs-sidebar summary {
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
}
.sgs-appbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: 60px !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background-color: var(--sgs-primary) !important;
  color: #f7f4ee;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}
.sgs-shell:not(.sgs-public) > .sgs-appbar {
  justify-content: flex-start;
}
.sgs-toggle {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #f7f4ee;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.sgs-toggle img { width: 22px; height: 22px; filter: invert(1); }
.sgs-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sgs-on-primary);
  text-decoration: none;
  min-width: 0;
}
.sgs-brand img { height: 40px; width: auto; background: #fff; border-radius: 4px; padding: 2px; }
.sgs-brand-text {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.sgs-badge,
.sgs-version,
.sgs-user,
.sgs-logoff {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  line-height: 1.3;
  text-decoration: none;
}
.sgs-badge { background: #1f5c49; color: #f7f4ee; }
.sgs-user { margin-left: auto; color: #f7f4ee; max-width: 28vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sgs-version { background: #efe6cf; color: #12352c; font-weight: 600; }
.sgs-logoff { background: transparent; color: #f7f4ee; border: 1px solid rgba(247, 244, 238, 0.45); }
.sgs-sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  bottom: 0;
  z-index: 30;
  width: 268px;
  overflow: auto;
  background: #f6f7f4;
  color: #163028;
  border-right: 1px solid #d9e0da;
  padding: 12px 10px 24px;
  transition: width 0.2s ease-in-out;
}
.sgs-sidebar a,
.sgs-sidebar summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #163028;
  text-decoration: none;
  cursor: pointer;
}
.sgs-sidebar a:hover,
.sgs-sidebar summary:hover { background: #e7f0ea; }
.sgs-sidebar img { width: 18px; height: 18px; flex: 0 0 18px; }
.sgs-group { margin: 0 0 6px; }
.sgs-group summary { font-weight: 600; list-style: none; }
.sgs-group summary::-webkit-details-marker { display: none; }
.sgs-sub { display: flex; flex-direction: column; padding: 0 0 4px 12px; }
.sgs-sub a { font-weight: 400; }
.sgs-quick {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #d9e0da;
  font-size: 13px;
}
.sgs-shell:has(.sgs-sidebar) .sgs-content { margin-left: 268px; }
html.sgs-is-collapsed .sgs-sidebar { width: 76px; }
html.sgs-is-collapsed .sgs-sidebar .sgs-label,
html.sgs-is-collapsed .sgs-quick { display: none; }
html.sgs-is-collapsed .sgs-shell:has(.sgs-sidebar) .sgs-content { margin-left: 76px; }
html.sgs-is-collapsed .sgs-sub { padding-left: 0; }
.sgs-content {
  padding: 76px 16px 24px;
  min-width: 0;
  transition: margin-left 0.2s ease-in-out;
}
.sgs-public .sgs-content { margin-left: 0; }
.sgs-footer {
  margin: 28px 0 8px;
  padding: 14px 8px 4px;
  border-top: 1px solid #d9e0da;
  color: #3d4a44;
  font-size: 13px;
  text-align: center;
}
.sgs-footer p { margin: 0; }
@media (max-width: 860px) {
  .sgs-brand-text { display: none; }
  .sgs-user { display: none; }
  .sgs-shell:has(.sgs-sidebar) .sgs-content,
  html.sgs-is-collapsed .sgs-shell:has(.sgs-sidebar) .sgs-content { margin-left: 0; }
  .sgs-sidebar { width: min(88vw, 300px); transform: translateX(-110%); }
  html.sgs-drawer-open .sgs-sidebar { transform: none; }
  html.sgs-drawer-open .sgs-sidebar .sgs-label,
  html.sgs-drawer-open .sgs-quick { display: block; }
  html.sgs-drawer-open .sgs-sidebar a,
  html.sgs-drawer-open .sgs-sidebar summary { display: flex; }
}

.sgs-chevron {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid #163028;
  border-bottom: 2px solid #163028;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex: 0 0 8px;
}
.sgs-group[open] > summary .sgs-chevron { transform: rotate(45deg); }
.sgs-sub .sgs-group-nested { margin: 2px 0 4px; }
.sgs-sub .sgs-group-nested > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.sgs-sub .sgs-group-nested > summary:hover { background: #e7f0ea; }
.sgs-sub .sgs-group-nested > .sgs-sub { padding-left: 14px; }

.sgs-sidebar a.sgs-active {
  background: #e7f0ea;
  color: #12352c;
  font-weight: 600;
}
html.sgs-is-collapsed .sgs-chevron { display: none; }
.sgs-public { background: var(--sgs-bg-page); }
.sgs-public .sgs-content {
  background: var(--sgs-bg-page);
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
}
.sgs-portal {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 20px;
  max-width: 1100px;
  margin: 8px auto 0;
  align-items: start;
}
.sgs-card {
  background: var(--sgs-card-bg);
  border: 1px solid var(--sgs-border-subtle) !important;
  border-radius: 12px !important;
  box-shadow: var(--sgs-shadow-card) !important;
  padding: 22px 22px 18px;
  min-width: 0;
}
.sgs-card-title {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
  color: #12352c;
}
.sgs-card-sub { margin: 0 0 16px; color: #3d4a44; font-size: 14px; }
.sgs-form-group { margin: 0 0 var(--sgs-field-margin, 12px); }
.sgs-form .sgs-form-group + .sgs-form-group { margin-top: var(--sgs-form-gap, 10px); }
.sgs-card .sgs-form { margin-bottom: var(--sgs-section-spacing, 16px); }
.sgs-form-group label,
.sgs-form .sgs-label {
  display: block;
  margin: 0 0 var(--sgs-label-gap, 5px);
  font-size: 14px;
  font-weight: 600;
  color: #163028;
}
.sgs-select,
.sgs-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  height: var(--sgs-input-height, 42px);
  border: 1px solid #cfd6d1;
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
  color: #163028;
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
  font-size: 15px;
}
.sgs-btn-primary {
  background: var(--sgs-primary);
  color: #f7f4ee;
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 8px 18px;
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.sgs-btn-primary:hover {
  background: var(--sgs-primary-hover);
}
.sgs-card-login .sgs-btn-primary { width: 100%; }
.sgs-portal form#form2 { color: #163028; font-size: 15px; line-height: 1.55; }
.sgs-portal form#form2 input[type="radio"] {
  accent-color: #12352c;
  width: 18px;
  height: 18px;
  margin: 10px 8px 10px 0;
  vertical-align: middle;
}
.sgs-portal-foot { max-width: 1100px; margin: 0 auto; }
@media (max-width: 860px) {
  .sgs-portal { grid-template-columns: minmax(0, 1fr); }
  .sgs-card { padding: 16px; }
  .sgs-card-title { font-size: 20px; }
}

.sgs-portal { min-width: 0; }
.sgs-portal table { width: 100%; max-width: 100%; }

html.sgs-is-collapsed .sgs-sidebar .sgs-label,
html.sgs-is-collapsed .sgs-quick { display: none; }
.sgs-page { width: 100%; max-width: none; margin: 0; padding: 0 0 8px; }
.sgs-data {
  background: #fff;
  border: 1px solid #E5E8EC;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 22px 22px 18px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.sgs-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}
.sgs-data .sgs-card-title {
  margin: 0;
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #12352c;
}
.sgs-card-tools { display: flex; gap: 8px; flex: 0 0 auto; }
.sgs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #D0D5DD;
  background: #fff;
  color: #163028;
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.sgs-data .sgs-btn-primary { width: auto; }
.sgs-table-wrap { width: 100%; overflow-x: auto; }
.sgs-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
  font-size: 14px;
  color: #163028;
}
.sgs-table thead th {
  background: #F8F9FA;
  color: #3d4a44;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #E5E8EC;
}
.sgs-table tbody td {
  background: #fff;
  padding: 12px 10px;
  border-bottom: 1px solid #F0F2F5;
  vertical-align: middle;
}
.sgs-table tbody tr:hover td { background: #F9FAFB; }
.sgs-badge-success,
.sgs-badge-neutral {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.sgs-badge-success { background: #e5f4ec; color: #0f6b45; }
.sgs-badge-neutral { background: #eef1f4; color: #52606d; }
.sgs-table .link_imagem { margin: 0 4px; text-decoration: none; }
.sgs-meta { color: #3d4a44; font-size: 14px; }
.sgs-alert {
  background: #fdecec;
  color: #8a1f1f;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 600;
}
.sgs-form { display: grid; gap: 4px; max-width: 760px; }
.sgs-form .sgs-label {
  display: block;
  margin: 12px 0 6px;
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #163028;
}
.sgs-form .sgs-input,
.sgs-form .sgs-select {
  max-width: 100%;
}
.sgs-form textarea.sgs-input { height: auto; min-height: 120px; }
.sgs-form .sgs-input:focus,
.sgs-form .sgs-select:focus {
  outline: 2px solid rgba(18, 53, 44, 0.28);
  border-color: #1f5c49;
}
.sgs-callout {
  margin: 12px 0;
  padding: 10px 12px;
  background: #f4f8ff;
  border-left: 4px solid #2f6f9f;
  border-radius: 8px;
  color: #163028;
}
.sgs-callout-warn {
  background: #fff8e8;
  border-left-color: #b8860b;
}
.sgs-form-actions { display: flex; gap: 8px; margin-top: 16px; }
@media (max-width: 860px) {
  .sgs-card-head { flex-direction: column; }
  .sgs-data { padding: 16px; }
  .sgs-page { overflow-x: hidden; }
}

.sgs-callout-warning {
  margin: 12px 0;
  padding: 12px 14px;
  background: #fff8e8;
  border-left: 4px solid #b8860b;
  border-radius: 8px;
  color: #163028;
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
.sgs-callout-info {
  margin: 12px 0;
  padding: 12px 14px;
  background: #f4f8ff;
  border-left: 4px solid #2f6f9f;
  border-radius: 8px;
  color: #163028;
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
.sgs-section-title {
  margin: 18px 0 8px;
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #12352c;
}
.sgs-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.sgs-check-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 8px 0;
}
.sgs-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
  font-size: 14px;
  color: #163028;
  line-height: 1.45;
}
.sgs-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #12352c;
  flex: 0 0 auto;
}
.sgs-form input[type="file"].sgs-input {
  height: auto;
  min-height: 42px;
  padding: 8px;
}
.sgs-file-hint {
  margin: 6px 0 0;
  color: #52606d;
  font-size: 13px;
}
@media (max-width: 860px) {
  .sgs-grid-2 { grid-template-columns: minmax(0, 1fr); }
}

.sgs-ocup-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0 16px;
  padding: 12px;
  background: #F8F9FA;
  border: 1px solid #E5E8EC;
  border-radius: 12px;
}
.sgs-ocup-bar .sgs-input,
.sgs-ocup-bar .sgs-select { width: auto; min-width: 180px; max-width: 100%; }
.sgs-data .sgs-table,
.sgs-planner .sgs-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
  font-size: 14px;
  color: #163028;
}
.sgs-data .sgs-table thead th,
.sgs-data .sgs-table thead td,
.sgs-planner .sgs-table thead th,
.sgs-planner .sgs-table thead td {
  background: #F8F9FA;
  color: #3d4a44;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 8px;
  border-bottom: 1px solid #E5E8EC;
}
.sgs-data .sgs-table td,
.sgs-planner .sgs-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #F0F2F5;
  vertical-align: top;
  background: #fff;
}
.sgs-planner .sgs-table td.sgs-day { background: #EEF2F6; }
.sgs-planner .sgs-table tbody tr:hover td { background: #F9FAFB; }
.sgs-data td h2 {
  margin: 8px 0;
  padding: 12px 14px;
  background: #fff8e8;
  border-left: 4px solid #b8860b;
  border-radius: 8px;
  font-size: 16px;
}
.sgs-data form select,
.sgs-data form input[type="text"],
.sgs-data form input[type="password"] {
  max-width: 100%;
}
#gridOcupacaoContainer .bloco-sala-ocupacao {
  margin: 0 0 18px;
  padding: 8px 0 4px;
  border-bottom: 1px solid #F0F2F5;
}
@media (max-width: 860px) {
  .sgs-ocup-bar .sgs-input,
  .sgs-ocup-bar .sgs-select,
  .sgs-ocup-bar .sgs-btn { width: 100%; }
}

.sgs-public .sgs-appbar {
  justify-content: space-between;
  gap: 16px;
}
.sgs-public .sgs-appbar > .sgs-brand {
  flex: 0 1 auto;
  min-width: 0;
  margin-right: auto;
}
.sgs-public .sgs-brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sgs-public .sgs-appbar > .sgs-appbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}
.sgs-public .sgs-appbar .sgs-appbar-login {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid #ffffff;
  border-radius: 6px;
  background: #ffffff;
  color: #12352C;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  opacity: 1;
}
.sgs-public .sgs-appbar .sgs-appbar-login svg { display: block; flex: 0 0 auto; }
.sgs-public .sgs-appbar .sgs-appbar-login:hover { background: #f0fdf4; border-color: #f0fdf4; }
.sgs-public .sgs-appbar .sgs-appbar-login:focus {
  outline: 2px solid #efe6cf;
  outline-offset: 2px;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(239, 230, 207, 0.95);
}
@media (max-width: 860px) {
  .sgs-public .sgs-appbar { gap: 8px; padding: 0 10px; }
  .sgs-public .sgs-appbar .sgs-appbar-login { padding: 8px 10px; font-size: 13px; }
}
.sgs-public .sgs-content > .sgs-portal.sgs-portal-solo {
  display: block;
  width: 100%;
  max-width: 680px;
  margin: 40px auto;
}
.sgs-public .sgs-content > .sgs-portal.sgs-portal-solo > .sgs-public-card {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}
.sgs-modal[hidden] { display: none !important; }
.sgs-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.sgs-modal-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}
.sgs-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(16, 24, 40, 0.28);
  padding: 22px 22px 18px;
}
.sgs-modal-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #163028;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.sgs-date-label {
  display: block;
  margin: 0 0 6px;
  text-align: left;
  word-spacing: normal;
  letter-spacing: normal;
}
.sgs-date-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.sgs-date-line .sgs-input {
  width: 180px;
  max-width: 180px;
  flex: 0 0 180px;
}
.sgs-date-line img,
.sgs-date-line .tcalIcon {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  max-width: none;
}
.sgs-public #opc1,
.sgs-public #opc3,
.sgs-public #opc4,
.sgs-public .sgs-public-card,
.sgs-public .sgs-public-card p,
.sgs-public .sgs-public-card strong,
.sgs-public .sgs-public-card label {
  text-align: left;
  word-spacing: normal;
  letter-spacing: normal;
}
#numsalarel { max-width: 420px; }
#protocolo { max-width: 260px; }
.sgs-field-curso,
.sgs-field-periodo,
.sgs-field-acao {
  text-align: left;
  margin-bottom: 20px;
}
.sgs-field-curso .sgs-select { max-width: 420px; }
.sgs-field-periodo .sgs-select { max-width: 220px; }
.sgs-field-curso label,
.sgs-field-periodo label,
.sgs-field-acao label {
  text-align: left;
  word-spacing: normal;
}
textarea.sgs-input { height: auto; min-height: 120px; }
.sgs-print-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.sgs-btn-print svg {
  width: 16px;
  height: 16px;
  vertical-align: -2px;
  margin-right: 6px;
}
.sgs-print-head { display: none; }
@media print {
  .sgs-help-fab,
  .sgs-help-panel,
  .sgs-help-backdrop,
  .sgs-appbar,
  .sgs-sidebar,
  .sgs-footer,
  .sgs-ocup-bar,
  .sgs-print-actions,
  .sgs-modal,
  .sgs-no-print,
  .row.menu,
  .row.copyright,
  dialog,
  #avisoBloqueio,
  #gridOcupacaoStatus,
  .sgs-btn,
  button {
    display: none !important;
  }
  .sgs-print-head {
    display: block !important;
    margin: 0 0 8px;
    font-weight: 700;
    color: #12352c;
  }
  .sgs-shell,
  .sgs-content,
  .sgs-page,
  .sgs-card,
  .sgs-card-body {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    width: auto !important;
    max-width: none !important;
  }
  .bloco-sala-ocupacao { break-inside: avoid; page-break-inside: avoid; }
}

.sgs-filter-stack {
  text-align: left;
  word-spacing: normal;
  letter-spacing: normal;
}
.sgs-filter-stack .sgs-form-group,
.sgs-filter-action {
  text-align: left;
  margin-bottom: 16px;
}
.sgs-filter-stack label {
  text-align: left;
  word-spacing: normal;
  letter-spacing: normal;
}
.sgs-filter-sala .sgs-select,
.sgs-filter-wide .sgs-select {
  width: 100%;
  max-width: 360px;
}
.sgs-filter-bin .sgs-select {
  width: 100%;
  max-width: 220px;
}
.sgs-definir {
  text-align: left;
  word-spacing: normal;
}
.sgs-definir .sgs-definir-field,
.sgs-definir .asmContainer,
.sgs-definir .asmSelect,
.sgs-definir .asmList,
.sgs-definir select[multiple] {
  width: 100%;
  max-width: 480px;
}
.sgs-definir .asmSelect {
  height: 42px;
  border: 1px solid #cfd6d1;
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
  color: #163028;
}
.sgs-definir .asmList {
  margin: 12px 0 16px;
  padding: 0;
  list-style: none;
  border: 1px solid #E5E8EC;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.sgs-definir .asmListItem {
  background: #fff;
  border: 0;
  border-bottom: 1px solid #F0F2F5;
  width: auto;
  margin: 0;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
}
.sgs-definir .asmListItem:hover { background: #F9FAFB; }
.sgs-definir .asmListItemLabel {
  padding: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: #163028;
}
.sgs-definir .asmListItemRemove,
.sgs-definir .sgs-btn-trash {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  color: #8a1f1f;
  background: transparent;
  text-decoration: none;
  line-height: 0;
  white-space: nowrap;
}
.sgs-definir .sgs-btn-trash:hover,
.sgs-definir .asmListItemRemove:hover {
  background: #fdecec;
  color: #8a1f1f;
}
.sgs-definir .sgs-btn-trash svg {
  display: block;
  width: 18px;
  height: 18px;
}
.sgs-definir-actions { text-align: left; }
.sgs-definir-actions .sgs-btn { margin: 0 8px 0 0; }

.sgs-help-fab,
.sgs-help-panel,
.sgs-help-backdrop {
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
}
.sgs-help-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9994;
  background: rgba(15, 23, 42, 0.28);
}
.sgs-help-backdrop[hidden] { display: none; }
.sgs-help-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 16px 0 14px;
  border: 0;
  border-radius: 999px;
  background: #004A8D;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 74, 141, 0.25);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.sgs-help-fab svg { display: block; flex: 0 0 auto; }
.sgs-help-panel {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 9995;
  display: flex;
  flex-direction: column;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  background: #ffffff;
  color: #163028;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 74, 141, 0.18);
  overflow: hidden;
}
.sgs-help-panel[hidden] { display: none; }
.sgs-help-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 8px 10px;
  background: #004A8D;
  color: #ffffff;
}
.sgs-help-title {
  margin: 0;
  flex: 1 1 auto;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}
.sgs-help-back,
.sgs-help-close {
  border: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
}
.sgs-help-back { padding: 6px 8px; }
.sgs-help-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 24px;
  line-height: 1;
}
.sgs-help-search {
  margin: 12px 12px 0;
  height: 42px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  color: #163028;
}
.sgs-help-body {
  overflow: auto;
  padding: 12px;
}
.sgs-help-kicker {
  margin: 8px 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #52606d;
}
.sgs-help-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}
.sgs-help-list li { margin: 0 0 6px; }
.sgs-help-item {
  width: 100%;
  text-align: left;
  border: 1px solid #E2E8F0;
  background: #ffffff;
  color: #163028;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.sgs-help-item:hover { background: #F4F6F9; }
.sgs-help-question {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.35;
}
.sgs-help-answer,
.sgs-help-note {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.5;
}
.sgs-help-steps {
  margin: 0 0 12px;
  padding-left: 1.2em;
  font-size: 14px;
  line-height: 1.45;
}
.sgs-help-steps li { margin: 0 0 6px; }
.sgs-help-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #004A8D;
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}
.sgs-help-fab:focus-visible,
.sgs-help-panel button:focus-visible,
.sgs-help-panel a:focus-visible,
.sgs-help-panel input:focus-visible {
  outline: 2px solid #FFC107;
  outline-offset: 2px;
}
@media (max-width: 599px) {
  .sgs-help-fab-label { display: none; }
  .sgs-help-fab {
    width: 56px;
    height: 56px;
    min-height: 56px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .sgs-help-panel {
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
  }
}

/* Neutralização global da faixa legada de menu (bgMenu.png 45px) */
.sgs-shell div.row.menu,
.sgs-page div.row.menu,
div.row.menu {
  height: 0 !important;
  min-height: 0 !important;
  background: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow: visible !important;
}

/* Grupo de Ações Segmentadas (Outline Button Group) */
.sgs-btn-group {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  overflow: hidden;
  vertical-align: middle;
}

.sgs-btn-group .sgs-btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  background-color: #ffffff;
  border: 1px solid #dcdcdc;
  border-right: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, filter 0.15s ease;
  padding: 0;
}

.sgs-btn-group .sgs-btn-action:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.sgs-btn-group .sgs-btn-action:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  border-right: 1px solid; /* Fecha a borda na ponta direita */
}

/* Variação Azul (Editar) */
.sgs-btn-group .sgs-btn-action.btn-edit {
  border-color: #007bff;
  color: #007bff;
}
.sgs-btn-group .sgs-btn-action.btn-edit:hover {
  background-color: #f0f7ff;
}

/* Variação Amarela/Âmbar (Status / Bloqueio / Obs) */
.sgs-btn-group .sgs-btn-action.btn-status,
.sgs-btn-group .sgs-btn-action.btn-obs {
  border-color: #ff9800;
  color: #ff9800;
}
.sgs-btn-group .sgs-btn-action.btn-status:hover,
.sgs-btn-group .sgs-btn-action.btn-obs:hover {
  background-color: #fffbf0;
}

/* Variação Vermelha (Excluir / Deletar) */
.sgs-btn-group .sgs-btn-action.btn-delete {
  border-color: #dc3545;
  color: #dc3545;
}
.sgs-btn-group .sgs-btn-action.btn-delete:hover {
  background-color: #fff5f5;
}

/* Variação Verde (Inserir / Confirmar) */
.sgs-btn-group .sgs-btn-action.btn-add {
  border-color: #28a745;
  color: #28a745;
}
.sgs-btn-group .sgs-btn-action.btn-add:hover {
  background-color: #f2fbf4;
}

.sgs-btn-group .sgs-btn-action svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ==========================================================================
   PADRONIZAÇÃO GLOBAL DE FORMULÁRIOS E INPUTS (Fase 29)
   ========================================================================== */

/* Limitação de largura proporcional no container de formulário */
.sgs-form,
.sgs-card form {
  max-width: 820px; /* Evita que o formulário se espalhe descontroladamente em monitores widescreen */
}

/* Rótulos: alinhamento natural à esquerda, sem justificação de palavras */
.sgs-form label,
.sgs-label,
.sgs-card form label,
.sgs-card form td:first-child {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: #334155;
  margin-bottom: 6px;
  text-align: left !important;
  letter-spacing: normal !important;
  word-spacing: normal !important;
}

/* Larguras máximas semânticas por tipo/função de campo */
.sgs-input,
.sgs-select,
.sgs-card form input[type="text"],
.sgs-card form input[type="password"],
.sgs-card form select {
  width: 100%;
  max-width: 520px; /* Largura padrão confortável */
  height: 38px;
  padding: 8px 12px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

/* Campos de data e códigos curtos: nunca esticar.
   Somente type=text: um hidden name=data não pode voltar a aparecer. */
.sgs-input-date,
input[type="text"][name*="data"],
input[type="text"][name*="dt"],
input[type="text"][name="data"] {
  max-width: 180px !important;
  display: inline-block !important;
  vertical-align: middle;
}

input[type="text"][name*="codigo"],
input[type="text"][name*="sigla"],
input[type="text"][name*="creditos"] {
  max-width: 160px !important;
}

/* Wrapper para campo de data com ícone de calendário alinhado */
.sgs-date-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
}

.sgs-date-wrapper img,
.sgs-date-wrapper a {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  cursor: pointer;
}

/* Botões de ação em formulários */
.sgs-card form input[type="button"],
.sgs-card form input[type="submit"],
.sgs-card form button {
  height: 38px;
  padding: 0 20px;
  border-radius: 6px;
  font-weight: 500;
}

/* A grade dentro do formulário não herda o teto de 820px nem vira bloco.
   O alinhamento à esquerda do rótulo permanece. */
.sgs-card form:has(table) {
  max-width: none;
}
.sgs-card form td,
.sgs-card form th {
  display: table-cell;
  margin-bottom: 0;
  font-weight: inherit;
  font-size: inherit;
  color: inherit;
}

/* O teto de 520px precisa vencer .sgs-form .sgs-select { max-width: 100% }.
   Os tetos mais estreitos ja existentes sao repetidos depois. */
.sgs-form .sgs-input,
.sgs-form .sgs-select,
.sgs-card .sgs-form .sgs-select,
.sgs-card .sgs-form .sgs-input {
  max-width: 520px;
}
.sgs-field-curso .sgs-select { max-width: 420px; }
.sgs-field-periodo .sgs-select { max-width: 220px; }
.sgs-filter-sala .sgs-select,
.sgs-filter-wide .sgs-select { max-width: 360px; }
.sgs-filter-bin .sgs-select { max-width: 220px; }

.sgs-card form input[type="button"],
.sgs-card form input[type="submit"],
.sgs-card form button {
  box-sizing: border-box;
  min-height: 38px;
  height: 38px;
}

/* Celula de tabela continua celula. display:block no primeiro td
   empilhava o rotulo e escondia o campo ao lado. */
.sgs-card form table td:first-child,
.sgs-card form table th:first-child {
  display: table-cell;
  margin-bottom: 0;
  font-weight: inherit;
  font-size: inherit;
  color: inherit;
}

/* ==========================================================================
   SUBFASE 32.2 — blocos <style> centralizados
   Seletores de empilhamento ficam presos a tabela.sgs-stack ou a
   #form:has(select#diaaula). @page nao entra: valeria para o sistema inteiro.
   ========================================================================== */

.sgs-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  margin: 0 0 16px;
  padding: 8px 14px;
  border: 1px solid #004A8D;
  border-radius: 8px;
  background: #ffffff;
  color: #004A8D;
  font-weight: 600;
  text-decoration: none;
}
.sgs-btn-secondary:hover { background: #F4F6F9; color: #004A8D; }

.sgs-req { color: #8a1f1f; font-weight: 700; }

a.sgs-btn-edit,
a.sgs-btn-trash,
a.sgs-btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  text-decoration: none;
}
a.sgs-btn-edit,
a.sgs-btn-copy { color: #004A8D; margin: 0 4px 0 0; }
a.sgs-btn-edit:hover,
a.sgs-btn-copy:hover { background: #F4F6F9; color: #004A8D; }
a.sgs-btn-trash { color: #8a1f1f; }
.sgs-card:has(a.sgs-btn-edit) a.sgs-btn-trash { margin: 0 4px 0 0; }
a.sgs-btn-trash:hover { background: #fdecec; color: #8a1f1f; }
a.sgs-btn-edit svg,
a.sgs-btn-trash svg,
a.sgs-btn-copy svg { display: block; width: 18px; height: 18px; }

.sgs-card:has(a.sgs-btn-edit) .sgs-table thead th,
.sgs-card:has(a.sgs-btn-edit) .sgs-table thead th a,
.sgs-card:has(a.sgs-btn-edit) .sgs-table thead th b,
.sgs-card:has(a.sgs-btn-edit) .sgs-table thead th u,
.sgs-card:has(.sgs-opc) .sgs-table thead th,
.sgs-card:has(.sgs-opc) .sgs-table thead th a,
.sgs-card:has(.sgs-opc) .sgs-table thead th b,
.sgs-card:has(.sgs-opc) .sgs-table thead th u {
  background: #F8F9FA;
  color: #3d4a44;
}

.sgs-opc { width: auto; text-align: left; }

.sgs-form table.sgs-stack,
.sgs-form table.sgs-stack tbody,
.sgs-form table.sgs-stack tr,
.sgs-form table.sgs-stack td,
.sgs-card table.sgs-stack,
.sgs-card table.sgs-stack tbody,
.sgs-card table.sgs-stack tr,
.sgs-card table.sgs-stack td {
  display: block;
  width: auto;
  max-width: 760px;
  text-align: left;
}
.sgs-card:not(:has(#motivoindef)):not(:has(#data)) table.sgs-stack,
.sgs-card:not(:has(#motivoindef)):not(:has(#data)) table.sgs-stack tbody,
.sgs-card:not(:has(#motivoindef)):not(:has(#data)) table.sgs-stack tr,
.sgs-card:not(:has(#motivoindef)):not(:has(#data)) table.sgs-stack td,
.sgs-form:not(:has(#motivoindef)):not(:has(#data)) table.sgs-stack,
.sgs-form:not(:has(#motivoindef)):not(:has(#data)) table.sgs-stack tbody,
.sgs-form:not(:has(#motivoindef)):not(:has(#data)) table.sgs-stack tr,
.sgs-form:not(:has(#motivoindef)):not(:has(#data)) table.sgs-stack td {
  border: 0;
}
.sgs-card:not(:has(#motivoindef)):not(:has(#data)) table.sgs-stack td,
.sgs-form:not(:has(#motivoindef)):not(:has(#data)) table.sgs-stack td { padding: 0 0 12px; }
.sgs-card:has(#motivoindef) table.sgs-stack td,
.sgs-card:has(#data) table.sgs-stack td,
.sgs-form:has(#motivoindef) table.sgs-stack td,
.sgs-form:has(#data) table.sgs-stack td { padding: 0 0 8px; }
.sgs-card:has(#motivoindef) table.sgs-stack td b,
.sgs-card:has(#data) table.sgs-stack td b,
.sgs-form:has(#motivoindef) table.sgs-stack td b,
.sgs-form:has(#data) table.sgs-stack td b {
  display: block;
  margin: 12px 0 6px;
}

.sgs-form-actions { text-align: left; margin-top: 16px; }
.sgs-card:has(table.sgs-stack) .sgs-form-actions .sgs-btn,
.sgs-form:has(table.sgs-stack) .sgs-form-actions .sgs-btn { margin: 0 8px 0 0; }

.sgs-filter-sala .sgs-select,
.sgs-filter-wide .sgs-select { max-width: 380px; }

#form .sgs-table:has(select#diaaula),
#form .sgs-table:has(select#diaaula) tbody,
#form .sgs-table:has(select#diaaula) tr,
#form .sgs-table:has(select#diaaula) td {
  display: block;
  width: auto;
  max-width: 420px;
  text-align: left;
}
#form:has(select#diaaula) .sgs-select,
#form:has(select#diaaula) .sgs-input { max-width: 380px; width: 100%; }
#form:has(select#diaaula) select#diaaula,
#form:has(select#diaaula) select#periodoaulas,
#form:has(select#diaaula) select#opcnumalunos,
#form:has(select#diaaula) select#prioridade,
#form:has(select#diaaula) select#bloquear,
#form:has(select#diaaula) input#numalunos { max-width: 220px; }
#form:has(select#diaaula) .sgs-filter-action { text-align: left; margin: 8px 0 16px; }

.sgs-page > .row.menu {
  height: 0 !important;
  min-height: 0 !important;
  background: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow: visible !important;
}
.sgs-dashboard-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 1200px) {
  .sgs-dashboard-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .sgs-dashboard-cards { grid-template-columns: repeat(1, 1fr); }
}
.sgs-kpi-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-top: 4px solid #004A8D;
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 2px 10px rgba(0,74,141,0.05);
}
.sgs-kpi-card.kpi-blue { border-top-color: #004A8D; }
.sgs-kpi-card.kpi-green { border-top-color: #0f6b45; }
.sgs-kpi-card.kpi-amber { border-top-color: #FFC107; }
.sgs-kpi-card.kpi-red { border-top-color: #8a1f1f; }
.sgs-kpi-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sgs-kpi-title { font-size: 13px; color: #475569; font-weight: 600; }
.sgs-kpi-value { font-size: 28px; font-weight: 700; line-height: 1.15; }
.sgs-kpi-card.kpi-blue .sgs-kpi-value,
.sgs-kpi-card.kpi-blue .sgs-kpi-icon { color: #004A8D; }
.sgs-kpi-card.kpi-green .sgs-kpi-value,
.sgs-kpi-card.kpi-green .sgs-kpi-icon { color: #0f6b45; }
.sgs-kpi-card.kpi-amber .sgs-kpi-value,
.sgs-kpi-card.kpi-amber .sgs-kpi-icon { color: #b45309; }
.sgs-kpi-card.kpi-red .sgs-kpi-value,
.sgs-kpi-card.kpi-red .sgs-kpi-icon { color: #8a1f1f; }
.sgs-kpi-footer { font-size: 11px; color: #64748B; margin-top: 4px; }
.sgs-kpi-badge { font-size: 12px; font-weight: 600; color: #475569; }
#gridOcupacaoStatus { text-align: center; padding: 12px; color: #555; }
#dlgBloqueio { border: 1px solid #d1d5db; border-radius: 4px; padding: 16px; max-width: 440px; font-size: 13px; }
#dlgBloqueio::backdrop { background: rgba(0,0,0,.35); }
#dlgBloqueio h3 { margin: 0 0 8px; font-size: 16px; }
#dlgBloqueio label { display: block; margin: 8px 0; }
#dlgBloqueio input,
#dlgBloqueio select { width: 100%; box-sizing: border-box; padding: 4px 8px; font-size: 13px; }
#dlgBloqueio .acoes { display: flex; gap: 6px; justify-content: flex-end; margin-top: 12px; }
#erroBloqueio { color: #a40000; min-height: 1.2em; margin: 8px 0 0; }
#avisoBloqueio { text-align: center; color: #146c43; min-height: 1.2em; }
.sgs-spinner { display: inline-block; width: 14px; height: 14px; margin-right: 8px; border: 2px solid #d1d5db; border-top-color: #336699; border-radius: 50%; vertical-align: middle; animation: sgs-giro .8s linear infinite; }
@keyframes sgs-giro { to { transform: rotate(360deg); } }
#gridOcupacaoContainer.modo-foco { min-height: 100vh; }
#gridOcupacaoContainer.modo-foco .bloco-sala-ocupacao { display: none !important; }
#gridOcupacaoContainer.modo-foco .bloco-sala-ocupacao.sala-ativa { display: block !important; }
#gridOcupacaoContainer .bloco-sala-ocupacao.oculta { display: none !important; }

/* Classes semanticas complementares (Fase 33) */
.sgs-badge-danger {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  background-color: #fdecec;
  color: #8a1f1f;
  border: 1px solid #f5c2c7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sgs-col-sorted {
  background-color: #f1f5f9 !important;
}

.sgs-section-header {
  background-color: #f8fafc;
  color: #1e293b;
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 2px solid #e2e8f0;
}

.sgs-badge-info {
  display: inline-block; padding: 3px 8px; font-size: 11px; font-weight: 600;
  border-radius: 4px; background-color: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.sgs-badge.sgs-badge-success {
  background-color: #e5f4ec;
  color: #0f6b45;
  border: 1px solid #b7e4c7;
}
.sgs-badge.sgs-badge-danger {
  background-color: #fdecec;
  color: #8a1f1f;
  border: 1px solid #f5c2c7;
}
.sgs-badge.sgs-badge-info {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.sgs-badge.sgs-badge-neutral {
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

/* F3: respiro vertical botoes/upload empilhados */
input[type="file"] + button,
input[type="file"] + input[type="submit"],
input[type="file"] + .sgs-btn,
input[type="file"] + .btn {
  margin-top: 12px;
}
/* Botao frequentemente envolvido em <p> no assistente legado */
input[type="file"] + p {
  margin-top: 12px;
}
.sgs-form-actions,
.sgs-actions-group {
  margin-top: 16px;
}

/* UXUI-01 global interactive states */
.sgs-appbar .sgs-brand,
.sgs-appbar .sgs-brand:link,
.sgs-appbar .sgs-brand:visited,
.sgs-appbar .sgs-brand:hover,
.sgs-appbar .sgs-brand:active,
.sgs-appbar .sgs-brand:focus {
  color: var(--sgs-on-primary);
  text-decoration: none;
}
.sgs-appbar .sgs-brand:focus-visible {
  outline: 2px solid var(--sgs-focus-ring);
  outline-offset: 3px;
  border-radius: 6px;
}
.sgs-appbar .sgs-brand-text { color: inherit; }
.sgs-appbar .sgs-version,
.sgs-appbar .sgs-version:link,
.sgs-appbar .sgs-version:visited,
.sgs-appbar .sgs-version:hover,
.sgs-appbar .sgs-version:focus {
  color: #12352c;
  text-decoration: none;
}
.sgs-appbar .sgs-version:focus-visible,
.sgs-appbar .sgs-logoff:focus-visible,
.sgs-appbar .sgs-toggle:focus-visible,
.sgs-appbar .sgs-appbar-login:focus-visible {
  outline: 2px solid var(--sgs-focus-ring);
  outline-offset: 2px;
}
.sgs-appbar .sgs-logoff,
.sgs-appbar .sgs-logoff:link,
.sgs-appbar .sgs-logoff:visited,
.sgs-appbar .sgs-logoff:hover,
.sgs-appbar .sgs-logoff:focus {
  color: var(--sgs-on-primary);
  text-decoration: none;
}
.sgs-btn-primary,
.sgs-btn-primary:link,
.sgs-btn-primary:visited,
input.sgs-btn-primary,
button.sgs-btn-primary,
.botao.sgs-btn-primary {
  color: var(--sgs-on-primary);
  background: var(--sgs-primary);
  min-height: var(--sgs-control-min-height);
  border-radius: var(--sgs-control-radius);
}
.sgs-btn-primary:hover,
.sgs-btn-primary:focus,
.botao.sgs-btn-primary:hover,
.botao.sgs-btn-primary:focus {
  color: var(--sgs-on-primary);
  background: var(--sgs-primary-hover);
  text-decoration: none;
}
.sgs-btn-primary:focus-visible,
.botao.sgs-btn-primary:focus-visible,
.sgs-btn:focus-visible,
.sgs-btn-secondary:focus-visible {
  outline: 2px solid var(--sgs-focus-ring);
  outline-offset: 2px;
}
.sgs-sidebar a:focus-visible,
.sgs-sidebar summary:focus-visible {
  outline: 2px solid var(--sgs-primary);
  outline-offset: 1px;
}
.sgs-sidebar a:hover,
.sgs-sidebar summary:hover {
  background: var(--sgs-sidebar-hover);
  color: var(--sgs-on-surface);
}
.sgs-sidebar a:visited { color: var(--sgs-on-surface); }
.sgs-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0 10px var(--sgs-sub-indent);
}
.sgs-sub > a,
.sgs-sub > .sgs-group-nested > summary {
  padding-top: 10px;
  padding-bottom: 10px;
  padding-left: 10px;
  margin: 1px 0;
}
.sgs-sub .sgs-group-nested > .sgs-sub {
  padding-left: 16px;
  margin-left: 6px;
  border-left: 2px solid #d9e0da;
}
.sgs-sub img {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  opacity: 0.9;
}
.sgs-label-icon {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--sgs-on-surface);
  margin: 0 0 6px;
}
.sgs-label-icon .sgs-field-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}
.sgs-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* UXUI-01.1 — login field icons integrated (modal only) */
.sgs-modal .sgs-input-with-icon {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 46px;
  border: 1px solid #c5ced8;
  border-radius: var(--sgs-control-radius, 8px);
  overflow: hidden;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sgs-modal .sgs-input-with-icon:hover {
  border-color: #9aabbc;
}
.sgs-modal .sgs-input-with-icon:focus-within {
  border-color: var(--sgs-primary, #004A8D);
  box-shadow: 0 0 0 3px rgba(0, 74, 141, 0.22);
}
.sgs-modal .sgs-input-affix {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 48px;
  width: 48px;
  margin: 0;
  padding: 0;
  background: #5a6b7c;
  color: #f7f4ee;
  border: 0;
  border-right: 1px solid #4a5a6a;
  cursor: pointer;
}
.sgs-modal .sgs-input-affix .sgs-field-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: block;
  /* SVG stroke is dark; invert for light-on-slate affix */
  filter: brightness(0) invert(1);
  opacity: 1;
}
.sgs-modal .sgs-input-with-icon .sgs-select,
.sgs-modal .sgs-input-with-icon .sgs-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: none;
  height: 46px;
  min-height: 46px;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 10px 14px;
  background: #fff;
  color: #163028;
  font-size: 15px;
  box-shadow: none;
}
.sgs-modal .sgs-input-with-icon .sgs-select:focus,
.sgs-modal .sgs-input-with-icon .sgs-input:focus {
  outline: none;
  box-shadow: none;
  border-color: transparent;
}
.sgs-modal .sgs-input-with-icon .sgs-select:focus-visible,
.sgs-modal .sgs-input-with-icon .sgs-input:focus-visible {
  outline: none;
}
.sgs-modal .sgs-login-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}
.sgs-modal .sgs-login-actions .sgs-btn-primary {
  min-width: 128px;
  min-height: 42px;
}
.sgs-modal .sgs-login-actions .sgs-btn-primary:focus-visible {
  outline: 2px solid var(--sgs-focus-ring, #FFC107);
  outline-offset: 2px;
}
div.row.rodape a:link,
div.row.rodape a:visited,
div.row.rodape a:hover,
div.row.copyright a:link,
div.row.copyright a:visited,
div.row.copyright a:hover,
div.tituloProcessoBarra a:link,
div.tituloProcessoBarra a:visited,
div.tituloProcessoBarra a:hover {
  color: #ffffff;
}



/* SGS Lote 4 — tabelas .datagrid e grade de horarios (sgs-quadro)
   Carregado depois de master.css. Nao altera contratos PHP. */
.datagrid,
.datagrid2,
.datagrid3 {
  font-family: "SGS Inter", "DejaVu Sans", sans-serif !important;
  font-size: 14px;
  background: var(--sgs-card-bg, #fff);
  border: 1px solid var(--sgs-border-subtle, #E2E8F0) !important;
  border-radius: 12px !important;
  box-shadow: none;
  overflow-x: auto;
}
.datagrid2 {
  border-color: transparent !important;
}
.datagrid table,
.datagrid2 table,
.datagrid3 table {
  width: 100%;
  border-collapse: collapse;
  color: var(--sgs-on-surface, #163028);
}
.datagrid table thead th,
.datagrid2 table thead th,
.datagrid3 table thead th {
  background: #F8F9FA !important;
  background-image: none !important;
  filter: none !important;
  color: #3d4a44 !important;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  padding: 12px 10px !important;
  border-bottom: 1px solid #E5E8EC !important;
  border-left: 0 !important;
}
.datagrid table tbody td,
.datagrid2 table tbody td,
.datagrid3 table tbody td {
  background: #fff;
  color: #163028 !important;
  padding: 12px 10px !important;
  border-bottom: 1px solid #F0F2F5 !important;
  border-left: 1px solid #F0F2F5 !important;
  font-size: 14px;
  vertical-align: top;
}
.datagrid table tbody tr:hover td,
.datagrid2 table tbody tr:hover td,
.datagrid3 table tbody tr:hover td {
  background: #F9FAFB !important;
}
.datagrid table tfoot td,
.datagrid2 table tfoot td,
.datagrid3 table tfoot td,
.datagrid table tfoot td div,
.datagrid3 table tfoot td div {
  background: #F8F9FA !important;
  background-image: none !important;
  color: #163028 !important;
  border-top: 1px solid #E5E8EC !important;
}
.datagrid table tfoot li a,
.datagrid3 table tfoot li a {
  background: #fff !important;
  background-image: none !important;
  color: #004A8D !important;
  border: 1px solid #D0D5DD !important;
  border-radius: 8px !important;
}

/* Grade de horarios (consultaquadropasso2) */
.sgs-quadro-page {
  background: var(--sgs-bg-page, #F4F6F9);
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
  color: #163028;
  margin: 0;
  padding: 12px 8px 20px;
}
.sgs-quadro-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: #12352c;
}
.sgs-quadro-wrap,
.sgs-quadro-page .datagrid {
  width: 100%;
  overflow-x: auto;
}
.sgs-quadro,
table.sgs-quadro {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 8px;
  background: transparent;
}
.sgs-quadro thead th,
.datagrid table.sgs-quadro thead th {
  background: var(--sgs-primary, #004A8D) !important;
  color: #f7f4ee !important;
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 13px;
  font-weight: 600;
  text-align: center !important;
  padding: 10px 8px !important;
  border: 0 !important;
  border-radius: 10px;
}
.sgs-quadro tbody td,
.datagrid table.sgs-quadro tbody td {
  background: #fff !important;
  border: 1px solid var(--sgs-border-subtle, #E2E8F0) !important;
  border-radius: 10px;
  padding: 12px 10px !important;
  vertical-align: top;
  min-width: 140px;
}
.sgs-quadro tbody tr:hover td,
.datagrid table.sgs-quadro tbody tr:hover td {
  background: #fff !important;
}
.sgs-quadro-slot {
  text-align: left;
  padding: 0 0 10px;
}
.sgs-quadro-slot + .sgs-quadro-sep + .sgs-quadro-slot,
.sgs-quadro-slot + .sgs-quadro-slot {
  padding-top: 10px;
}
.sgs-quadro-hora {
  display: inline-block;
  background: #e8f1fb;
  color: #004A8D;
  font-weight: 600;
  font-size: 13px;
  border-radius: 999px;
  padding: 2px 10px;
  margin: 0 0 6px;
}
.sgs-quadro-disc {
  font-weight: 600;
  color: #12352c;
  font-size: 13px;
}
.sgs-quadro-nome {
  color: #3d4a44;
  font-size: 13px;
  line-height: 1.4;
}
.sgs-quadro-meta {
  color: #52606d;
  font-size: 12px;
  margin-top: 6px;
}
.sgs-quadro-sep {
  height: 1px;
  background: #E5E8EC;
  margin: 10px 0;
  border: 0;
}
.sgs-quadro-empty {
  color: #9aa3ad;
  text-align: center;
}
@media (max-width: 768px) {
  .sgs-quadro,
  table.sgs-quadro { min-width: 640px; }
}
@media print {
  .sgs-quadro-page { background: #fff; padding: 0; }
  .sgs-quadro { border-spacing: 4px; min-width: 0; }
  .sgs-quadro thead th { background: #004A8D !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sgs-appbar, .sgs-sidebar, .sgs-toggle { display: none !important; }
}


/* SGS Lote 4.1 — iframe, calendario tcal, placeholder e impressao */
iframe#iframe,
iframe#iframemenu,
iframe[name="iframe"],
iframe[name="iframemenu"] {
  width: 100%;
  max-width: 100%;
  border: 0;
  background: transparent;
}
.sgs-iframe-blank {
  margin: 0;
  min-height: 40px;
  background: var(--sgs-bg-page, #F4F6F9);
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
}

/* tcal: alinha o popup legado ao design system (nao altera calendar_bz.js) */
div#tcal {
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 74, 141, 0.16);
  overflow: hidden;
  padding: 6px 6px 8px;
  background: #fff;
  border: 1px solid var(--sgs-border-subtle, #E2E8F0);
}
div#tcal table {
  border: 0 !important;
  background: #fff;
  font-family: "SGS Inter", "DejaVu Sans", sans-serif;
  font-size: 13px;
  color: #163028;
}
div#tcal table.ctrl th {
  background: #fff !important;
  color: #12352c !important;
  font-weight: 600;
  border: 0 !important;
}
div#tcal th {
  border: 0 !important;
  background: #F8F9FA;
  color: #3d4a44;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 6px 0 !important;
}
div#tcal td {
  border: 0 !important;
  text-align: center;
  padding: 4px 0;
}
div#tcal td a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  min-height: 26px;
  border-radius: 8px;
  color: #163028;
  text-decoration: none;
}
div#tcal td a:hover {
  background: #e8f1fb;
  color: #004A8D;
}
img.tcalIcon {
  border-radius: 6px;
}

@media print {
  iframe#iframe,
  iframe#iframemenu,
  .sgs-help-root,
  #sgsHelpRoot,
  .sgs-appbar,
  .sgs-sidebar,
  .sgs-toggle {
    /* appbar/sidebar ja ocultos no Lote 4; reforco */
  }
}

/* SGS Lote 4.4 — widget, calendario e impressao A4 (nao desativa o FAB) */
@media (max-width: 900px) {
  .sgs-content {
    padding-bottom: 96px;
  }
  .sgs-page {
    padding-bottom: 96px;
  }
  html {
    scroll-padding-top: 72px;
  }
  .sgs-table-wrap.sgs-planner {
    overflow-x: auto;
    max-width: 100%;
    max-height: calc(100vh - 190px);
    -webkit-overflow-scrolling: touch;
  }
  .sgs-help-panel {
    max-height: min(70vh, 520px);
  }
}
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm;
  }
  .sgs-quadro-wrap {
    overflow: visible !important;
  }
  .sgs-quadro,
  table.sgs-quadro {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-spacing: 2px !important;
  }
  .sgs-quadro thead th,
  .sgs-quadro tbody td,
  .datagrid table.sgs-quadro thead th,
  .datagrid table.sgs-quadro tbody td {
    min-width: 0 !important;
    width: auto !important;
    padding: 4px 3px !important;
    font-size: 8pt !important;
  }
}

/* SGS Lote 4.8.1 - separacao vertical data e Sala */
.sgs-public #opc3 .sgs-date-line {
  margin-bottom: 14px;
}
