/* Daily log. Uses the redesign tokens already on body.dtf-redesign. */

.dtf-job-line {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}

.dtf-job-line:last-child {
  border-bottom: 0;
}

.dtf-job-line .dtf-row {
  flex: 1;
  border-bottom: 0;
  min-width: 0;
}

.dtf-job-log {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 56px;
  padding: 0 14px;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.dtf-daily-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  min-height: 56pt;
  margin: 0 0 12pt;
  padding: 0 16px;
  border: 1px solid #c5d0da;
  border-radius: 14px;
  background: #ffffff;
  color: #24303a;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.dtf-daily-entry::after {
  content: "›";
  color: #5b6b79;
  font-size: 22px;
  font-weight: 400;
}

html[data-theme="dark"] .dtf-daily-entry {
  background: #10202c;
  color: #e8f4f6;
  border-color: #24545c;
}

html[data-theme="dark"] .dtf-daily-entry::after {
  color: #c5d5df;
}

.dtf-daily-log .dtf-inline-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
}

.dtf-log-notes {
  min-height: 96px;
  resize: vertical;
}

.dtf-log-block {
  padding-bottom: 8px;
}

.dtf-log-crew,
.dtf-log-delivery {
  display: grid;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.dtf-log-crew {
  grid-template-columns: 1fr 1fr 88px;
}

.dtf-log-crew .dtf-text-btn,
.dtf-log-delivery .dtf-text-btn {
  justify-self: start;
}

.dtf-log-crew label,
.dtf-log-delivery label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.dtf-log-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px 0;
}

.dtf-log-photo {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dtf-log-photo img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--accent-soft);
}

.dtf-log-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dtf-log-dates .is-on .dtf-row-title {
  color: var(--accent);
}

@media (max-width: 520px) {
  .dtf-log-crew {
    grid-template-columns: 1fr;
  }
}

/* Daily log cards. Bottom padding clears the 64pt bar, the safe area, and 16pt. */
body.dtf-daily-open > .app-header,
body.dtf-daily-open > #app-top-chrome {
  display: none !important;
}

body.dtf-daily-open .dtf-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  background: #0b3d4a;
  color: #f4fbfb;
  min-height: 64pt;
  height: auto;
}

body.dtf-daily-open .dtf-log-back {
  min-height: 56pt;
  min-width: 56pt;
  color: #f4fbfb;
  font-weight: 700;
}

.dtf-log-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  text-align: center;
  gap: 2px;
}

.dtf-log-banner strong {
  color: #f4fbfb;
  font-size: 17px;
  font-weight: 700;
}

.dtf-log-banner span {
  color: #d5e4ea;
  font-size: 13px;
  line-height: 1.3;
}

body.dtf-daily-open .dtf-screen {
  padding-bottom: calc(64pt + env(safe-area-inset-bottom, 34pt) + 16pt);
}

body.dtf-log-editing .dtf-screen {
  padding-bottom: calc(56pt + env(safe-area-inset-bottom, 34pt) + 16pt);
}

.dtf-daily-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dtf-log-card {
  background: #ffffff;
  color: #24303a;
  border: 1px solid #c5d0da;
  border-radius: 14px;
  padding: 16px;
}

.dtf-log-card h2 {
  margin: 0 0 6px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: #24303a;
}

.dtf-log-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  color: #24303a;
}

.dtf-log-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 8px;
}

.dtf-log-line-title {
  font-size: 16px;
  font-weight: 600;
  color: #24303a;
}

.dtf-log-line-meta {
  font-size: 14px;
  color: #5b6b79;
}

.dtf-log-empty {
  text-align: center;
}

.dtf-log-empty h2 {
  font-size: 18px;
}

.dtf-log-empty p {
  color: #5b6b79;
  margin-bottom: 12px;
}

.dtf-log-pill,
.dtf-log-save {
  width: 100%;
  min-height: 56pt;
  border: 0;
  border-radius: 999px;
  background: #24303a;
  color: #ffffff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.dtf-log-card .dtf-log-pill {
  margin-top: 12px;
}

textarea.dtf-log-note {
  display: block;
  width: 100%;
  min-height: 140px;
  margin-top: 12px;
  padding: 12px;
  box-sizing: border-box;
  border: 2pt solid #0f766e;
  border-radius: 12px;
  background: #ffffff;
  color: #24303a;
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  resize: vertical;
}

.dtf-log-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 34pt));
  background: #eef2f5;
}

.dtf-log-cancel {
  min-height: 56pt;
  border-radius: 999px;
  border: 1px solid #c5d0da;
  background: #ffffff;
  color: #0f766e;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

html[data-theme="dark"] .dtf-log-card {
  background: #10202c;
  color: #e8f4f6;
  border-color: #24545c;
}

html[data-theme="dark"] .dtf-log-card h2,
html[data-theme="dark"] .dtf-log-card p,
html[data-theme="dark"] .dtf-log-line-title {
  color: #e8f4f6;
}

html[data-theme="dark"] .dtf-log-line-meta,
html[data-theme="dark"] .dtf-log-empty p {
  color: #c5d5df;
}

html[data-theme="dark"] .dtf-log-pill,
html[data-theme="dark"] .dtf-log-save {
  background: #e8f4f6;
  color: #10202c;
}

html[data-theme="dark"] .dtf-log-note {
  background: #10202c;
  color: #e8f4f6;
  border-color: #5eead4;
}

html[data-theme="dark"] .dtf-log-bar {
  background: #07141c;
}

html[data-theme="dark"] .dtf-log-cancel {
  background: #10202c;
  color: #5eead4;
  border-color: #24545c;
}
