.daily-journal-page {
  min-height: 100%;
  padding: 18px;
  background: #f3f6fb;
  color: #0f172a;
}

.dj-header,
.dj-card,
.dj-summary article {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .05);
}

.dj-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 12px;
  border-top: 4px solid var(--bs-primary, #2563eb);
}

.dj-kicker,
.dj-scope-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
  color: #2563eb;
  font-size: .78rem;
  font-weight: 800;
}

.dj-header h1 {
  margin: 8px 0 4px;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  font-weight: 900;
}

.dj-header p,
.dj-table-title p {
  margin: 0;
  color: #64748b;
  font-size: .9rem;
}

.dj-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dj-actions .btn,
.dj-filters .btn {
  min-height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.dj-filter-card {
  padding: 14px;
  margin-bottom: 12px;
}

.dj-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
}

.dj-filters label {
  display: grid;
  gap: 5px;
  margin: 0;
}

.dj-filters label > span,
.dj-check span {
  color: #475569;
  font-size: .78rem;
  font-weight: 800;
}

.dj-filters .form-control,
.dj-filters .form-select {
  min-height: 40px;
  border-radius: 12px;
  border-color: rgba(148, 163, 184, .35);
}

.dj-search {
  grid-column: span 2;
}

.dj-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.dj-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.dj-summary article {
  padding: 14px;
}

.dj-summary span {
  display: block;
  color: #64748b;
  font-size: .8rem;
  font-weight: 800;
}

.dj-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 1.25rem;
  font-weight: 900;
}

.dj-table-card {
  overflow: hidden;
}

.dj-table-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
}

.dj-table-title h2 {
  margin: 0 0 3px;
  font-size: 1rem;
  font-weight: 900;
}

#dailyJournalTable {
  min-width: 1100px;
  font-size: 13px;
}

#dailyJournalTable th {
  background: #edf3fb;
  color: #334155;
  font-size: .78rem;
  font-weight: 900;
  white-space: nowrap;
}

#dailyJournalTable th,
#dailyJournalTable td {
  padding: 10px 12px;
  border-color: rgba(148, 163, 184, .16);
  vertical-align: middle;
}

.dj-entry-row {
  cursor: pointer;
}

.dj-entry-row:hover {
  background: #f8fafc;
}

.dj-entry-no {
  color: #2563eb;
  font-weight: 900;
}

.dj-diff-ok {
  color: #059669;
  font-weight: 900;
}

.dj-diff-bad {
  color: #dc2626;
  font-weight: 900;
}

.dj-lines-row td {
  background: #fbfdff;
  padding: 0 !important;
}

.dj-lines {
  padding: 10px 14px 14px;
}

.dj-lines table {
  width: 100%;
  border-collapse: collapse;
}

.dj-lines th,
.dj-lines td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, .15);
}

.dj-line-out {
  opacity: .58;
}

.dj-line-scope {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: .72rem;
  font-weight: 900;
}

.dj-line-out .dj-line-scope {
  background: #fff1f2;
  color: #be123c;
}

.dj-row-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.dj-row-links a {
  color: #2563eb;
  font-size: .74rem;
  font-weight: 900;
  text-decoration: none;
}

.dj-row-links a:hover {
  text-decoration: underline;
}

.dj-audit-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 2px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .72rem;
  font-weight: 900;
  white-space: nowrap;
}

.dj-audit-badge.ok {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #047857;
}

.dj-audit-badge.warning {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.dj-audit-badge.danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

@media (max-width: 992px) {
  .dj-header,
  .dj-table-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .dj-filters,
  .dj-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dj-search {
    grid-column: span 2;
  }
}

@media (max-width: 576px) {
  .daily-journal-page {
    padding: 10px;
  }

  .dj-filters,
  .dj-summary {
    grid-template-columns: 1fr;
  }

  .dj-search {
    grid-column: auto;
  }
}

@media print {
  .acc-sidebar,
  .acc-mobile-menu-btn,
  .dj-actions,
  .dj-filter-card {
    display: none !important;
  }

  .daily-journal-page {
    padding: 0;
    background: #fff;
  }

  .dj-header,
  .dj-card,
  .dj-summary article {
    box-shadow: none;
  }
}
