/* Global site styles for shared typography, layout, and component defaults. */
html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin: 0;
  background: linear-gradient(170deg, #eaf2ff 0%, #f7fbff 60%, #eef8f2 100%);
  color: #22313f;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.app-header {
  background: linear-gradient(90deg, #083b66 0%, #0f5f93 100%);
  color: #fff;
}

.app-header .navbar-brand {
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.login-shell {
  min-height: calc(100vh - 90px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: min(430px, 92vw);
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 12px 30px rgba(0, 36, 74, 0.15);
}

.login-title {
  margin: 0 0 0.4rem;
  font-size: 1.8rem;
}

.login-subtitle {
  margin-bottom: 1.4rem;
  color: #4a5f74;
}

.home-grid {
  min-height: calc(100vh - 110px);
  display: grid;
  grid-template-rows: minmax(0, 30fr) minmax(0, 60fr) minmax(0, 10fr);
  gap: 0;
}

.panel {
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(10, 54, 90, 0.08);
  padding: 1rem;
  overflow: auto;
  min-height: 0;
}

.panel-header {
  border-top: 4px solid #0f5f93;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  height: 400px;
  min-height: 400px;
  max-height: 400px;
  overflow: hidden;
}

.offhome-header-split {
  display: flex;
  gap: 1rem;
  min-height: 0;
  height: 100%;
}

.offhome-header-left {
  flex: 0 0 70%;
  max-width: 70%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.offhome-header-right {
  flex: 0 0 30%;
  max-width: 30%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-left: 1px solid #dbe6ef;
  padding-left: 1rem;
  overflow: auto;
}

.offhome-action-list .list-group-item {
  padding-left: 0;
  padding-right: 0;
  background: transparent;
}

.panel-body {
  border-top: 4px solid #1d7c58;
  overflow: auto;
}

.panel-footer {
  border-top: 4px solid #b76f1a;
}

.panel-subtitle {
  color: #5e7182;
  margin-bottom: 0.75rem;
}

.itinerary-table-wrap {
  flex: 1 1 0;
  overflow-y: auto;
  min-height: 0;
}

.itinerary-table {
  font-size: 0.9rem;
}

.da-report-shell {
  padding-bottom: 0.25rem;
}

.tab-content {
  min-height: 0;
}

.tab-pane {
  min-height: 0;
}

.tab-pane.active {
  height: 100%;
  overflow: auto;
}

.da-template {
  border: 1px solid #b5c8d8;
  border-radius: 8px;
  padding: 1rem;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f8fc 100%);
}

.da-template-title,
.da-template-vessel {
  border: 1px solid #91acc0;
  padding: 0.5rem 0.75rem;
  text-align: center;
  font-weight: 700;
  background: #fff;
}

.da-template-vessel {
  margin-top: 0.4rem;
  margin-bottom: 0.85rem;
}

.da-form-table {
  margin-bottom: 0.75rem;
  background: #fff;
}

.da-form-table th,
.da-form-table td {
  text-align: center;
  vertical-align: middle;
}

.da-form-table td:nth-child(2),
.da-form-table td:nth-child(3) {
  text-align: left;
}

.da-form-table .form-control[readonly] {
  background: #eef4f8;
}

.da-template-note {
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.da-signature-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
}

.da-sig-cell {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.da-sig-cell .da-sig-name {
  width: 100%;
  text-align: center;
}

.da-sig-cell .da-sig-name-readonly {
  width: 100%;
  min-height: 1.8rem;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  background: #fff;
}

.da-signature-row span {
  border-top: 1px solid #4d6475;
  padding-top: 0.45rem;
  text-align: center;
  font-weight: 600;
  width: 100%;
}

.da-row-actions,
.da-submit-actions {
  margin-top: 0.85rem;
}

.da-row-actions .btn,
.da-submit-actions .btn {
  min-width: 140px;
}

.da-pdf-value {
  display: block;
  width: 100%;
  min-height: calc(1.5em + 0.5rem + 2px);
  padding: 0.25rem 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  background: #ffffff;
  line-height: 1.5;
  text-align: left;
}

.da-readonly .da-template {
  background: #fff;
}

@media (max-width: 768px) {
  .home-grid {
    grid-template-rows: auto auto auto;
    min-height: auto;
  }

  .panel-header {
    height: auto;
    min-height: auto;
    max-height: none;
    overflow: auto;
  }

  .offhome-header-split {
    flex-direction: column;
  }

  .offhome-header-left,
  .offhome-header-right {
    flex: 1 1 auto;
    max-width: 100%;
  }

  .offhome-header-right {
    border-left: 0;
    border-top: 1px solid #dbe6ef;
    padding-left: 0;
    padding-top: 0.75rem;
  }

  .da-signature-row {
    flex-direction: column;
  }
}