/* =============================================
   Reset & Base
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --hubon-green:       #1adc5a;
  --hubon-green-dark:  #13b348;
  --hubon-green-soft:  #dcfce7;
  --hubon-green-glow:  rgba(26, 220, 90, 0.35);
  --hubon-navy:        #0d1b2e;
  --hubon-navy-mid:    #152a45;
  --app-radius:        14px;
  --app-shadow:        0 8px 32px rgba(13, 27, 46, 0.07);
  --app-shadow-sm:     0 2px 12px rgba(13, 27, 46, 0.05);
}

body {
  font-family: 'Sora', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: #eef2f7;
  color: #1a1a2e;
  min-height: 100vh;
  padding: 32px 24px 80px;
}

body.app-page {
  background-color: #e9eef5;
  background-image:
    radial-gradient(ellipse 90% 60% at 0% -20%, rgba(26, 220, 90, 0.09), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(13, 27, 46, 0.07), transparent 50%);
  padding: 20px 24px 88px;
}

/* =============================================
   Layout
   ============================================= */
.page-wrapper {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hidden {
  display: none !important;
}

/* =============================================
   Screens
   ============================================= */
.screen {
  display: none;
}

.screen.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* =============================================
   Cabeçalho
   ============================================= */
.page-header {
  margin-bottom: 4px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.page-subtitle {
  font-size: 14px;
  color: #64748b;
  margin-top: 4px;
}

/* =============================================
   Seletor de Tipo de Ativo
   ============================================= */
.asset-type-selector {
  display: flex;
  gap: 8px;
}

.asset-type-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  transition: all 0.2s;
}

.asset-type-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.asset-type-btn.active {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

/* =============================================
   Logo da Empresa
   ============================================= */
.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 80px;
}

.company-logo {
  max-width: 120px;
  max-height: 80px;
  object-fit: contain;
}



/* =============================================
   Card base
   ============================================= */
.card {
  background: #ffffff;
  border-radius: var(--app-radius);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: var(--app-shadow-sm);
}

body.app-page .card {
  box-shadow: var(--app-shadow);
}

body.app-page .app-hero {
  padding: 28px 32px;
  background: linear-gradient(135deg, var(--hubon-navy) 0%, var(--hubon-navy-mid) 52%, #1a3650 100%);
  border: none;
  position: relative;
  overflow: hidden;
}

body.app-page .app-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -5%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(26, 220, 90, 0.18) 0%, transparent 68%);
  pointer-events: none;
}

body.app-page .app-hero::after {
  content: '';
  position: absolute;
  bottom: -60%;
  left: 10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

body.app-page .app-hero .header-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

body.app-page .app-hero .header-left {
  grid-column: 1;
  justify-self: start;
}

body.app-page .app-hero .header-spacer {
  grid-column: 3;
}

body.app-page .app-hero .page-title {
  color: #fff;
  font-size: 26px;
  letter-spacing: -0.4px;
}

body.app-page .app-hero .page-subtitle {
  color: rgba(255, 255, 255, 0.62);
  margin-top: 6px;
}

body.app-page .app-hero .logo-container {
  grid-column: 2;
  justify-self: center;
  align-self: center;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  min-height: auto;
  height: auto;
  min-width: 0;
  pointer-events: none;
}

body.app-page .app-hero .company-logo-hero {
  max-width: 150px;
  max-height: 52px;
  object-fit: contain;
}

.asset-type-selector-hero {
  margin-top: 18px;
}

body.app-page .app-hero .asset-type-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.75);
  border-radius: 10px;
  padding: 9px 14px;
  backdrop-filter: blur(4px);
}

body.app-page .app-hero .asset-type-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

body.app-page .app-hero .asset-type-btn.active {
  background: var(--hubon-green);
  border-color: var(--hubon-green);
  color: var(--hubon-navy);
  box-shadow: 0 4px 16px var(--hubon-green-glow);
}

/* =============================================
   Barra de ações
   ============================================= */
.action-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  flex-wrap: wrap;
}

body.app-page .action-bar {
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

.search-wrapper {
  flex: 1;
  min-width: 240px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 11px 14px 11px 42px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  color: #334155;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.search-input::placeholder {
  color: #94a3b8;
}

.search-input:focus {
  border-color: var(--hubon-green-dark);
  box-shadow: 0 0 0 3px rgba(26, 220, 90, 0.15);
  background: #fff;
}

.action-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

/* =============================================
   Botões
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.18s, box-shadow 0.18s, transform 0.1s, border-color 0.18s;
  white-space: nowrap;
  line-height: 1;
}

.btn:active {
  transform: scale(0.97);
}

.btn-outline {
  background: #fff;
  color: #334155;
  border: 1.5px solid #d1dbe8;
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: var(--app-shadow-sm);
}

.btn-primary {
  background: linear-gradient(180deg, var(--hubon-green) 0%, var(--hubon-green-dark) 100%);
  color: var(--hubon-navy);
  border: 1.5px solid transparent;
  font-weight: 700;
}

.btn-primary:hover {
  box-shadow: 0 6px 20px var(--hubon-green-glow);
  filter: brightness(1.03);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 10px;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-back:hover {
  background: #fff;
  border-color: #cbd5e1;
  box-shadow: var(--app-shadow-sm);
}

/* =============================================
   Painel de Filtros
   ============================================= */
.filter-panel {
  padding: 22px 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.filter-grid {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-select {
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  color: #334155;
  background: #fff;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-select:focus {
  border-color: var(--hubon-green-dark);
  box-shadow: 0 0 0 3px rgba(26, 220, 90, 0.1);
}

.filter-actions {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-left: auto;
}

/* =============================================
   Contador de resultados
   ============================================= */
.result-count {
  font-size: 13px;
  color: #64748b;
  padding: 4px 6px;
  font-weight: 500;
}

body.app-page .result-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body.app-page .result-count::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hubon-green);
  box-shadow: 0 0 0 3px rgba(26, 220, 90, 0.2);
}

/* =============================================
   Tabela
   ============================================= */
.table-card {
  overflow: hidden;
}

body.app-page .table-card {
  border: 1px solid rgba(226, 232, 240, 0.95);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead tr {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f6 100%);
  border-bottom: 2px solid #e2e8f0;
}

.data-table th {
  padding: 14px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table th.th-actions {
  width: 72px;
  text-align: center;
}

.data-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.18s, box-shadow 0.18s;
  cursor: pointer;
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(26, 220, 90, 0.06) 0%, rgba(248, 250, 252, 0.9) 12%);
  box-shadow: inset 3px 0 0 var(--hubon-green);
}

body.app-page .data-table tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.55);
}

body.app-page .data-table tbody tr:nth-child(even):hover {
  background: linear-gradient(90deg, rgba(26, 220, 90, 0.06) 0%, rgba(248, 250, 252, 0.95) 12%);
}

.data-table td {
  padding: 15px 20px;
  color: #334155;
  vertical-align: middle;
}

.data-table td:first-child {
  font-weight: 600;
  color: #1e293b;
}

/* =============================================
   Badges de Status
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-em-uso {
  background: #dcfce7;
  color: #15803d;
  font-weight: 600;
}

.badge-manutencao {
  background: #fef9c3;
  color: #a16207;
  font-weight: 600;
}

.badge-estoque {
  background: #e0e7ff;
  color: #4338ca;
  font-weight: 600;
}

/* =============================================
   Barra de Nota
   ============================================= */
.nota-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 130px;
}

.nota-value {
  font-weight: 600;
  color: #1e293b;
  min-width: 28px;
  font-size: 14px;
}

.nota-bar-bg {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.nota-bar-fill {
  height: 100%;
  background: #16a34a;
  border-radius: 4px;
  transition: width 0.4s ease, background 0.3s ease;
}

.nota-bar-fill.red {
  background: #dc2626;
}

.nota-bar-fill.yellow {
  background: #eab308;
}

.nota-bar-fill.green {
  background: linear-gradient(90deg, var(--hubon-green-dark), var(--hubon-green));
}

/* =============================================
   Formulário
   ============================================= */
.form-container {
  padding: 0;
  border-radius: var(--app-radius);
  overflow: hidden;
}

body.app-page .form-container {
  box-shadow: var(--app-shadow);
}

.form-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 28px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.form-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--hubon-navy);
  letter-spacing: -0.3px;
}

/* =============================================
   Abas
   ============================================= */
.tabs-container {
  padding: 24px 28px;
}

.tabs-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 28px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tabs-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
  position: relative;
  bottom: -2px;
}

.tab-btn:hover {
  color: #334155;
}

.tab-btn.active {
  color: var(--hubon-green-dark);
  border-bottom-color: var(--hubon-green);
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =============================================
   Formulário - Grid e Grupos
   ============================================= */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.form-full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.form-input {
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  color: #334155;
  background: #fafbfc;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  width: 100%;
  font-family: inherit;
}

.form-input:focus {
  border-color: var(--hubon-green-dark);
  box-shadow: 0 0 0 3px rgba(26, 220, 90, 0.12);
  background: #fff;
}

/* Remove setinhas de inputs numéricos */
.form-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.form-input[type="number"]::-webkit-outer-spin-button,
.form-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.password-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field-wrap .form-input {
  padding-right: 42px;
}

.password-toggle-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle-btn:hover {
  color: #334155;
}

.custody-log-section {
  margin-top: 4px;
}

.custody-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.custody-log-toolbar {
  display: flex;
  justify-content: flex-end;
}

.custody-log-toolbar-view {
  margin-top: 12px;
}

.btn-custody-add {
  font-size: 13px;
  padding: 7px 12px;
  white-space: nowrap;
}

.custody-edit-intro {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 4px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.custody-log-table tr.custody-log-row-clickable {
  cursor: pointer;
  transition: background 0.15s;
}

.custody-log-table tr.custody-log-row-clickable:hover td {
  background: #ecfdf5;
}

.custody-log-table tr.custody-log-row-clickable.custody-log-current:hover td {
  background: #d1fae5;
}

.custody-log-click-hint {
  margin: 10px 12px 12px;
  font-size: 12px;
  color: #16a34a;
  text-align: center;
}

.custody-log-footer {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
}

.btn-custody-plus {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #16a34a;
  background: #fff;
  color: #16a34a;
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.15);
}

.btn-custody-plus:hover {
  background: #16a34a;
  color: #fff;
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
}

.custody-col-drag {
  width: 36px;
  padding: 0 !important;
}

.custody-drag-cell {
  text-align: center;
  vertical-align: middle;
  cursor: grab;
  user-select: none;
}

.custody-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  padding: 8px 6px;
}

.custody-drag-cell:hover .custody-drag-handle {
  color: #16a34a;
}

.custody-log-table tr.custody-log-dragging td {
  opacity: 0.45;
  background: #f1f5f9 !important;
}

.custody-log-table tr.custody-log-drop-before td {
  box-shadow: inset 0 3px 0 0 #16a34a;
}

.custody-log-table tr.custody-log-drop-after td {
  box-shadow: inset 0 -3px 0 0 #16a34a;
}

.custody-col-actions {
  width: 72px;
}

.custody-actions {
  width: auto;
  min-width: 40px;
  text-align: center;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-custody-delete {
  background: none;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 5px 7px;
  cursor: pointer;
  color: #dc2626;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-custody-delete:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #b91c1c;
}

.custody-delete-summary {
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}

.custody-log-table-reorderable .custody-log-row-clickable {
  cursor: pointer;
}

.custody-log-table-reorderable .custody-drag-cell {
  cursor: grab;
}

.custody-log-table-reorderable .custody-drag-cell:active {
  cursor: grabbing;
}

.custody-log-hint {
  font-size: 12px;
  color: #64748b;
  margin: -2px 0 10px;
}

.custody-log {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
}

.custody-log-empty {
  padding: 16px;
  font-size: 13px;
  color: #64748b;
  text-align: center;
}

.custody-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.custody-log-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.custody-log-table td {
  padding: 10px 12px;
  border-top: 1px solid #e2e8f0;
  color: #334155;
}

.custody-log-table tr.custody-log-current td {
  background: #ecfdf5;
}

.custody-badge-atual {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.custody-badge-estoque {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
  font-size: 11px;
  font-weight: 600;
}

.custody-badge-manutencao {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 600;
}

.custody-badge-uso {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 600;
}

.custody-text-muted {
  color: #94a3b8;
}

.btn-custody-edit {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 5px 7px;
  cursor: pointer;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-custody-edit:hover {
  background: #f1f5f9;
  color: #16a34a;
  border-color: #bbf7d0;
}

.custody-obs-row td {
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
  padding-top: 6px !important;
  padding-bottom: 10px !important;
}

.custody-obs-label {
  font-weight: 600;
  color: #475569;
}

.custody-edit-modal {
  max-width: 480px;
}

.custody-edit-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.custody-edit-hint {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

.custody-log-view {
  width: 100%;
}

.custody-log-view .custody-log {
  border: none;
  background: transparent;
}

@media (max-width: 768px) {
  .custody-log-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* =============================================
   Checkboxes
   ============================================= */
.form-checkbox-group {
  gap: 12px;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #16a34a;
}

.form-checkbox span {
  font-size: 14px;
  color: #334155;
  font-weight: 500;
}

/* =============================================
   Slider
   ============================================= */
.slider-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.form-slider {
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: #e2e8f0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #16a34a;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
  transition: box-shadow 0.2s;
}

.form-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.4);
}

.form-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #16a34a;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
  transition: box-shadow 0.2s;
}

.form-slider::-moz-range-thumb:hover {
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.4);
}

.slider-value {
  min-width: 60px;
  padding: 8px 12px;
  background: #f1f5f9;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  color: #2563eb;
  font-size: 14px;
}

/* =============================================
   Rodapé do Formulário
   ============================================= */
.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 28px 24px;
  border-top: 1px solid #e2e8f0;
  background: #fafbfc;
}

/* =============================================
   Botão de Ajuda Flutuante
   ============================================= */
.help-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1e293b;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  z-index: 100;
}

.help-btn:hover {
  background: #0f172a;
  transform: scale(1.07);
}

.help-modal {
  max-width: 520px;
}

.help-modal-body {
  line-height: 1.6;
}

.help-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-list li {
  color: #334155;
}

/* =============================================
   Tela de Visualização
   ============================================= */
.view-section {
  margin-bottom: 28px;
}

body.app-page .view-section:not(:has(.custody-log-view)) {
  padding: 20px 22px;
  background: #fafbfc;
  border: 1px solid #eef2f7;
  border-radius: 12px;
}

.view-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--hubon-navy);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--hubon-green-soft);
}

.view-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 16px;
}

.view-row.full {
  grid-template-columns: 1fr;
}

.view-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.view-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.view-value {
  font-size: 14px;
  color: #1e293b;
  font-weight: 500;
  padding: 10px 14px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #eef2f7;
}

.view-value.empty {
  color: #94a3b8;
  font-style: italic;
}

.view-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
}

.view-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.view-photo {
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
  aspect-ratio: 1;
  border: 1px solid #e2e8f0;
  box-shadow: var(--app-shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.view-photo:hover {
  transform: translateY(-2px);
  box-shadow: var(--app-shadow);
}

.view-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =============================================
   Resumo de Avaliação
   ============================================= */
.evaluation-summary {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1.5px solid #bbf7d0;
  border-radius: 12px;
  padding: 18px 20px;
}

.summary-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--hubon-navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(224, 231, 255, 0.6);
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-label {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.summary-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--hubon-green-dark);
  padding: 4px 10px;
  background: var(--hubon-green-soft);
  border-radius: 6px;
}

.summary-value.atencao {
  color: #dc2626;
  background: #fee2e2;
}

.summary-value.bom {
  color: #2563eb;
  background: #dbeafe;
}

.summary-value.excelente {
  color: #059669;
  background: #d1fae5;
}

/* =============================================
   Upload de Fotos
   ============================================= */
.photo-upload {
  position: relative;
}

.photo-input {
  display: none;
}

.photo-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 20px;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.photo-label:hover {
  border-color: var(--hubon-green);
  background: #f0fdf4;
}

.photo-label svg {
  color: #94a3b8;
  transition: color 0.2s;
}

.photo-label:hover svg {
  color: var(--hubon-green-dark);
}

.photo-label span {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
}

.photo-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.photo-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
}

.photo-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}

.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.photo-remove:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* =============================================
   Ações na Tabela
   ============================================= */
.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, border-color 0.2s, box-shadow 0.2s;
  background: #fff;
  color: #64748b;
}

.btn-action:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: var(--app-shadow-sm);
}

.btn-action.delete:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.btn-action:active {
  transform: scale(0.95);
}

/* =============================================
   Modal de Confirmação
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 27, 46, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(13, 27, 46, 0.2);
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 24px;
}

.modal-header {
  margin-bottom: 16px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.modal-body {
  margin-bottom: 24px;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* =============================================
   Lightbox (Visualizador de Fotos)
   ============================================= */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 36px;
  color: #fff;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
  transition: opacity 0.2s;
}

.lightbox-close:hover {
  opacity: 0.7;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox-nav {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 10;
}

.lightbox-prev,
.lightbox-next {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.6);
}

.lightbox-counter {
  position: absolute;
  top: 20px;
  left: 20px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 12px;
  border-radius: 6px;
}

/* =============================================
   Fotos Clicáveis
   ============================================= */
.view-photo,
.photo-item img {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.view-photo:hover,
.photo-item:hover img {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* =============================================
   Estado vazio
   ============================================= */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: #94a3b8;
  font-size: 15px;
  line-height: 1.5;
}

body.app-page .empty-state {
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  border-radius: 0 0 12px 12px;
}

/* =============================================
   Responsividade
   ============================================= */
@media (max-width: 1024px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   Fotos Clicáveis
   ============================================= */
.view-photo,
.photo-item img {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.view-photo:hover,
.photo-item:hover img {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  body {
    padding: 20px 12px 80px;
  }

  .page-title {
    font-size: 22px;
  }

  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  body.app-page .app-hero .header-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  body.app-page .app-hero .header-spacer {
    display: none;
  }

  body.app-page .app-hero .logo-container {
    grid-column: auto;
    width: 100%;
    justify-content: center;
    margin-top: 20px;
    pointer-events: auto;
  }

  .logo-container {
    width: 100%;
    justify-content: flex-start;
  }

  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .action-buttons {
    justify-content: flex-end;
  }

  .tabs-nav {
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    padding: 10px 12px;
    font-size: 12px;
  }

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

  .data-table th,
  .data-table td {
    padding: 12px 14px;
    font-size: 12px;
  }

  .nota-wrapper {
    min-width: 100px;
  }

  .form-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .slider-container {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  body {
    padding: 16px 8px 80px;
  }

  .page-title {
    font-size: 18px;
  }

  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .logo-container {
    width: 100%;
    justify-content: flex-start;
    min-width: 100px;
    height: 60px;
  }

  .company-logo {
    max-width: 100px;
    max-height: 60px;
  }

  .logo-upload-label {
    width: 100px;
    height: 60px;
    font-size: 10px;
  }

  .lightbox-image {
    max-width: 95vw;
    max-height: 80vh;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .action-buttons {
    width: 100%;
    justify-content: stretch;
  }

  .action-buttons .btn {
    flex: 1;
    justify-content: center;
  }

  .tabs-nav {
    margin-bottom: 20px;
  }

  .tab-btn {
    padding: 8px 10px;
    font-size: 11px;
  }

  .form-container {
    border-radius: 8px;
  }

  .form-header {
    padding: 16px 16px 12px;
  }

  .tabs-container {
    padding: 16px;
  }

  .form-footer {
    padding: 12px 16px 16px;
  }
}

/* =============================================
   HubOn – Variáveis de marca (login usa as do :root global)
   ============================================= */

/* =============================================
   Login – página base
   ============================================= */
body.login-page {
  background: var(--hubon-navy);
  padding: 0;
  overflow: hidden;
  font-family: 'Sora', 'Segoe UI', sans-serif;
}

/* Background full-screen */
.login-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

/* Dark overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: linear-gradient(135deg, rgba(8, 15, 26, 0.72) 0%, rgba(13, 27, 46, 0.55) 50%, rgba(8, 15, 26, 0.65) 100%);
}

/* Linha divisória vertical */
.login-divider {
  position: fixed;
  left: 36%;
  top: 0; bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.09);
  z-index: 2;
}

/* =============================================
   Login – Painel esquerdo
   ============================================= */
.login-panel {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 38%;
  min-width: 340px;
  z-index: 3;
  background: rgba(8, 15, 26, 0.62);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 52px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 20px 0 60px rgba(0, 0, 0, 0.25);
}

/* =============================================
   Login – Logo
   ============================================= */
.login-logo-wrap {
  margin-bottom: 44px;
}

.login-logo-img {
  height: 36px;
  object-fit: contain;
  object-position: left;
}

.login-tagline {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--hubon-green);
  margin-top: 10px;
}

/* =============================================
   Login – Títulos
   ============================================= */
.login-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 8px;
  letter-spacing: -0.4px;
}

.login-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 36px;
  line-height: 1.5;
}

/* =============================================
   Login – Mensagem de erro
   ============================================= */
.login-error {
  display: none;
  background: rgba(255, 70, 70, 0.1);
  border: 1px solid rgba(255, 70, 70, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #ff7a7a;
  margin-bottom: 14px;
  animation: loginFadeIn 0.3s ease;
}

@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   Login – Campos do formulário
   ============================================= */
.login-form-group {
  margin-bottom: 16px;
}

.login-form-group label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  margin-bottom: 8px;
}

.login-input-wrap {
  position: relative;
}

.login-input-wrap input {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  padding: 13px 44px 13px 16px;
  font-family: 'Sora', 'Segoe UI', sans-serif;
  font-size: 13px;
  color: #fff;
  outline: none;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.login-input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.login-input-wrap input:focus {
  border-color: rgba(26, 220, 90, 0.55);
  background: rgba(26, 220, 90, 0.04);
  box-shadow: 0 0 0 3px rgba(26, 220, 90, 0.09);
}

.login-icon {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.3);
  display: flex;
  transition: color 0.2s;
}

.login-icon:hover {
  color: var(--hubon-green);
}

/* =============================================
   Login – Botão entrar
   ============================================= */
.login-btn {
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  background: linear-gradient(180deg, var(--hubon-green) 0%, var(--hubon-green-dark) 100%);
  border: none;
  border-radius: 10px;
  font-family: 'Sora', 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--hubon-navy);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}

.login-btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 8px 28px var(--hubon-green-glow);
  transform: translateY(-1px);
}

.login-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.login-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transform: scale(0);
  animation: loginRipple 0.55s linear;
  pointer-events: none;
}

@keyframes loginRipple {
  to { transform: scale(4); opacity: 0; }
}

.login-btn .login-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(13, 27, 46, 0.25);
  border-top-color: var(--hubon-navy);
  border-radius: 50%;
  animation: loginSpin 0.7s linear infinite;
  margin: 0 auto;
}

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

.login-btn.loading .login-btn-text { display: none; }
.login-btn.loading .login-spinner   { display: block; }

/* =============================================
   Login – Esqueceu a senha / rodapé
   ============================================= */
.login-forgot {
  text-align: center;
  margin-top: 16px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
}

.login-forgot a {
  color: var(--hubon-green);
  text-decoration: none;
  font-weight: 500;
}

.login-forgot a:hover { text-decoration: underline; }

.login-footer-note {
  position: absolute;
  bottom: 24px;
  left: 52px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.18);
  letter-spacing: 0.5px;
}

/* =============================================
   Login – Animações de entrada
   ============================================= */
.login-panel > * {
  opacity: 0;
  transform: translateY(14px);
  animation: loginSlideUp 0.5s ease forwards;
}

.login-logo-wrap              { animation-delay: 0.05s; }
.login-title                  { animation-delay: 0.14s; }
.login-subtitle               { animation-delay: 0.20s; }
.login-error                  { animation-delay: 0s; }
.login-form-group:nth-child(4){ animation-delay: 0.28s; }
.login-form-group:nth-child(5){ animation-delay: 0.35s; }
.login-btn                    { animation-delay: 0.43s; }
.login-forgot                 { animation-delay: 0.49s; }

@keyframes loginSlideUp {
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   Login – Responsivo
   ============================================= */
@media (max-width: 640px) {
  .login-panel {
    width: 100%;
    min-width: unset;
    padding: 40px 28px;
  }
  .login-divider { display: none; }
}

/* =============================================
   App – Barra de usuário logado no topo
   ============================================= */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 20px;
  margin-bottom: 0;
}

body.app-page .app-topbar {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-sm);
  backdrop-filter: blur(8px);
}

.app-topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
  font-weight: 500;
}

.app-topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hubon-navy) 0%, var(--hubon-navy-mid) 100%);
  color: var(--hubon-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(13, 27, 46, 0.2);
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn-logout:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

.app-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #15803d;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.btn-topbar-link:hover {
  background: #dcfce7;
  border-color: #86efac;
}

button.btn-topbar-link {
  cursor: pointer;
  font-family: inherit;
}

/* Telas estreitas: com o botão "Senha" a barra não cabe numa linha e o início dela saía da tela */
@media (max-width: 520px) {
  .app-topbar {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px 12px;
    padding: 12px 14px;
  }

  .app-topbar-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.role-admin {
  background: #dcfce7;
  color: #15803d;
}

.role-viewer {
  background: #e0f2fe;
  color: #0369a1;
}

.viewer-mode .photo-upload,
.viewer-mode #custodyLogFooter {
  display: none !important;
}

/* =============================================
   Controle de Acessos
   ============================================= */
.access-header {
  margin-bottom: 0;
}

.access-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  margin-bottom: 10px;
}

.access-back-link:hover {
  color: #16a34a;
}

.access-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}

.access-form-card,
.access-list-card,
.access-info-card {
  padding: 24px;
}

.access-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.access-card-desc {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 20px;
  line-height: 1.5;
}

.access-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.access-email-wrap {
  display: flex;
  align-items: center;
  gap: 0;
}

.access-email-wrap .form-input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
  flex: 1;
}

.access-email-suffix {
  padding: 10px 12px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-left: none;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
}

.access-role-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.access-role-option {
  display: block;
  cursor: pointer;
}

.access-role-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.access-role-box {
  display: block;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  transition: border-color 0.2s, background 0.2s;
}

.access-role-box strong {
  display: block;
  font-size: 14px;
  color: #0f172a;
  margin-bottom: 2px;
}

.access-role-box small {
  font-size: 12px;
  color: #64748b;
}

.access-role-option input:checked + .access-role-box {
  border-color: #16a34a;
  background: #f0fdf4;
}

.access-submit-btn {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

.access-list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.access-list-header .access-card-desc {
  margin-bottom: 0;
}

.access-table-wrap {
  padding: 0;
  overflow: hidden;
}

.access-users-table th:last-child,
.access-users-table td:last-child {
  width: 56px;
  text-align: center;
}

.access-user-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.access-user-email {
  font-weight: 600;
  color: #0f172a;
}

.access-self-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
}

.access-role-select {
  padding: 6px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
}

.access-role-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.access-date {
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
}

.access-loading {
  padding: 32px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

.access-alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.access-alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

.access-alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.access-info-card {
  margin-top: 4px;
}

.access-info-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #0f172a;
}

.access-info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.access-info-list li {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.access-info-note {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}

.access-info-note code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

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