/* Portal Guintec — paleta: navy, laranja, azul royal, cinza claro */

:root {
  --navy: #1a2744;
  --navy-soft: #2d3e5c;
  --orange: #e85d04;
  --orange-dark: #c44e03;
  --royal: #2563eb;
  --royal-hover: #1d4ed8;
  --bg-page: #e8ecf1;
  --white: #ffffff;
  --text-muted: #64748b;
  --border: #cbd5e1;
  --shadow: 0 4px 14px rgba(26, 39, 68, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg-page);
  color: var(--navy);
}

/* Views SPA */
.view {
  display: none;
  min-height: 100vh;
}

.view-active {
  display: block;
}

/* Login */
#view-login {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(160deg, #f0f4f8 0%, #e2e8f0 100%);
}

#view-login.view-active {
  display: flex;
}

.login-shell {
  width: 100%;
  max-width: 480px;
}

.login-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.logo-img {
  display: block;
  height: auto;
  object-fit: contain;
}

.logo-img--login {
  max-width: min(100%, 360px);
  width: 100%;
  margin: 0 auto 1.25rem;
}

.logo-img--header {
  height: 64px;
  width: auto;
}

.portal-title {
  margin: 0 0 0.5rem;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.t-navy {
  color: var(--navy);
}

.t-orange {
  color: var(--orange);
}

.login-sub {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.login-card .card-title {
  margin: 0 0 1.25rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy);
}

.field {
  display: block;
  margin-bottom: 1rem;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--navy-soft);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--navy);
  background: var(--white);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--royal);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--royal);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--royal-hover);
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--navy);
}

.btn-secondary:hover {
  background: #cbd5e1;
}

.btn-block {
  width: 100%;
}

.hint {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  text-align: center;
}

.msg {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.msg-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.msg-success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* App header */
.app-header {
  background: var(--white);
  box-shadow: 0 1px 0 rgba(26, 39, 68, 0.06);
}

.header-container {
  display: grid;
  grid-template-columns: 180px 1fr 180px;
  align-items: center;
  gap: 12px;
  padding: 12px 0px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  justify-content:flex-start;
}

.header-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  justify-self: center;
  white-space: nowrap;
  color: var(--navy);
}

.header-user {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--royal);
  cursor: pointer;
  text-decoration: underline;
  font-weight: 500;
}

.link-btn:hover {
  color: var(--royal-hover);
}

.main-area {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.main-area.narrow {
  max-width: 560px;
}

.main-area--form {
  max-width: 720px;
}

.form-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1rem 0.25rem;
  margin-bottom: 1.25rem;
  background: #f8fafc;
}

.form-section legend {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0 0.35rem;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.field--half {
  flex: 1;
  min-width: 200px;
}

.welcome-card {
  margin-bottom: 1.25rem;
}

.welcome-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.02em;
}

.welcome-sub {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.section-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
}

.dashboard-grid {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.dashboard-grid.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .dashboard-grid.two-cols {
    grid-template-columns: 1fr 1fr;
  }
}

.vessel-card .vessel-illus {
  font-size: 3rem;
  text-align: center;
  margin: 0.5rem 0;
  filter: grayscale(0.2);
}

.vessel-name {
  margin: 0.25rem 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
}

.vessel-loc {
  text-align: center;
  margin: 0;
  font-size: 0.875rem;
}

.muted {
  color: var(--text-muted);
}

.empty-hint {
  margin: 0.5rem 0 0;
}

.report-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.report-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.report-list li:last-child {
  border-bottom: none;
}

.report-item-title {
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.report-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.report-item-desc {
  font-size: 0.85rem;
  color: var(--navy-soft);
  margin: 0.5rem 0 0;
  line-height: 1.45;
}

.stack-btns {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.small-print {
  font-size: 0.8rem;
  margin: 0 0 1rem;
  line-height: 1.4;
}

.report-list--client li {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.report-list--client .report-item-body {
  flex: 1;
  min-width: 0;
}

.report-list--client .report-item-actions {
  flex-shrink: 0;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
}

.btn-outline {
  background: var(--white);
  color: var(--royal);
  border: 1px solid var(--royal);
}

.btn-outline:hover {
  background: #eff6ff;
}

.clientes-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.clientes-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.clientes-list li:last-child {
  border-bottom: none;
}

.clientes-list .cliente-info {
  flex: 1;
  min-width: 0;
}

.clientes-list .cliente-nome {
  font-weight: 600;
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
}

.clientes-list .cliente-email {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.btn-danger:hover {
  background: #fee2e2;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.form-actions .btn {
  flex: 1;
  min-width: 120px;
}

.cliente-info-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cliente-info-wrapper .img-avatar {
  width: 90px;
  height: 60px;
  max-width: 90px;
  max-height: 60px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 4px;
  border: 2px solid var(--border);
  display: block;
}
.img-vessel {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  border: 1px solid var(--border);
}

@media (max-width: 640px) {
  .header-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .header-left,
  .header-user {
    justify-self: center;
  }

  .header-title {
    order: -1;
    white-space: normal;
  }
}
#client-company-img {
  width: 90px !important;
  height: 60px !important;
  object-fit: contain !important;
  border-radius: 12px !important;
  background: #fff !important;
  padding: 4px !important;
  border: 2px solid var(--border) !important;
}

.img-vessel {
  width: 100% !important;
  height: 140px !important;
  object-fit: cover !important;
  border-radius: 12px !important;
  border: 1px solid var(--border) !important;
  display: block !important;
}
#admin-report-list {
  max-height: 450px;
  overflow-y: auto;
  padding-right: 8px;
}
#admin-embarcacoes-list {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 8px;
}
#client-report-list {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 8px;
}
#admin-empresas-list {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 8px;
}