.logbook-page {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding-top: 8px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  padding: 0 0 8px 18px;
}

.page-header h1 {
  margin: 0;
  color: #07132c;
  font-size: clamp(25px, 2.1vw, 34px);
  line-height: 1.08;
}

.page-header p {
  max-width: 100%;
  margin: 8px 0 0;
  color: #344054;
  font-size: 15px;
  font-weight: 560;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.profile {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 244px;
  margin-right: 18px;
  color: #111827;
}

.profile-button {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(16, 24, 40, 0.09);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.56);
  font-size: 17px;
  font-weight: 950;
}

.profile-details,
.profile-details strong,
.profile-details span {
  display: block;
}

.profile-details strong {
  margin-bottom: 3px;
  font-size: 14px;
}

.profile-details span {
  color: #344054;
  font-size: 12px;
  font-weight: 650;
}

.log-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.action-log {
  padding-top: 20px;
}

.tab-row {
  display: inline-flex;
  min-height: 40px;
  margin: 0 18px 18px;
  overflow: hidden;
  border: 1px solid rgba(16, 24, 40, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.tab-button {
  min-width: 108px;
  padding: 0 18px;
  color: #25324d;
  border-right: 1px solid rgba(16, 24, 40, 0.08);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
}

.tab-button:last-child {
  border-right: 0;
}

.tab-button.active {
  color: var(--dept-design);
  background: #fff;
  box-shadow: inset 0 -3px 0 var(--dept-design);
}

.card-title {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 18px;
}

.card-title h2 {
  margin: 0;
  color: #101828;
  font-size: 18px;
  line-height: 1.1;
}

.log-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr)) minmax(210px, 1.3fr);
  gap: 12px;
  align-items: end;
  padding: 0 18px 18px;
}

.log-filters.compact {
  grid-template-columns: minmax(190px, 0.95fr) minmax(160px, 0.85fr) minmax(160px, 0.85fr) minmax(260px, 1.35fr);
}

.filter-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.filter-field > span:first-child:not(.search-box) {
  color: #101828;
  font-size: 11px;
  font-weight: 900;
}

.input-button,
.search-box,
.filter-button,
.small-select,
.pagination button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  color: #142033;
  border: 1px solid rgba(16, 24, 40, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  font-size: 12px;
  font-weight: 800;
}

.input-button {
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 0 12px;
  text-align: left;
}

.input-button.muted {
  color: #667085;
}

.log-select-menu {
  position: fixed;
  z-index: 150;
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid rgba(16, 24, 40, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
}

.log-select-menu button {
  min-height: 32px;
  padding: 0 10px;
  color: #142033;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  font-size: 12px;
  font-weight: 850;
}

.log-select-menu button:hover {
  background: rgba(230, 241, 255, 0.9);
}

.search-box {
  gap: 10px;
  width: 100%;
  padding: 0 12px;
  color: #667085;
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111827;
  font: inherit;
}

.search-box input::placeholder {
  color: #667085;
  opacity: 1;
}

.filter-button {
  justify-content: center;
  gap: 8px;
  min-width: 92px;
  padding: 0 14px;
  color: #172033;
}

.table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.log-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

.error-table {
  min-width: 940px;
}

.log-table th {
  height: 42px;
  padding: 0 14px;
  color: #253248;
  border-top: 1px solid rgba(16, 24, 40, 0.08);
  border-bottom: 1px solid rgba(16, 24, 40, 0.09);
  background: rgba(248, 250, 252, 0.72);
  font-size: 11px;
  font-weight: 900;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-table td {
  height: 48px;
  padding: 0 14px;
  color: #26354f;
  border-top: 1px solid rgba(16, 24, 40, 0.08);
  font-size: 12px;
  font-weight: 650;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-table th:first-child,
.log-table td:first-child {
  width: 46px;
  padding-right: 4px;
  text-align: center;
}

.log-table th:last-child,
.log-table td:last-child {
  width: 44px;
  padding-right: 6px;
  padding-left: 6px;
  text-align: center;
}

.log-table td:last-child {
  overflow: visible;
  text-overflow: clip;
}

.log-table th:nth-child(2),
.log-table td:nth-child(2) {
  width: 148px;
}

.log-table th:nth-child(3),
.log-table td:nth-child(3) {
  width: 126px;
}

.log-table th:nth-child(4),
.log-table td:nth-child(4) {
  width: 128px;
}

.log-table th:nth-child(5),
.log-table td:nth-child(5) {
  width: 104px;
}

.log-table th:nth-child(7),
.log-table td:nth-child(7) {
  width: 138px;
}

.error-table th:nth-child(5),
.error-table td:nth-child(5) {
  width: 150px;
}

.error-table th:nth-child(6),
.error-table td:nth-child(6) {
  width: auto;
}

.error-table th:nth-child(7),
.error-table td:nth-child(7) {
  width: 96px;
}

.log-table tbody tr:hover {
  background: rgba(248, 250, 252, 0.6);
}

.error-table tbody tr {
  background: rgba(255, 241, 242, 0.42);
}

.row-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.row-icon.info {
  color: var(--dept-design);
  background: color-mix(in srgb, var(--dept-design) 12%, #fff);
}

.row-icon.error {
  color: var(--dept-business);
  background: color-mix(in srgb, var(--dept-business) 12%, #fff);
}

.module-chip,
.level-chip {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.module-dashboard {
  color: #9a382f;
  background: color-mix(in srgb, var(--dept-business) 14%, #fff);
}

.module-absences {
  color: var(--dept-care);
  background: color-mix(in srgb, var(--dept-care) 14%, #fff);
}

.module-replacements {
  color: var(--dept-work);
  background: color-mix(in srgb, var(--dept-work) 13%, #fff);
}

.module-planning {
  color: var(--dept-design);
  background: color-mix(in srgb, var(--dept-design) 13%, #fff);
}

.module-roster {
  color: var(--dept-it);
  background: color-mix(in srgb, var(--dept-it) 16%, #fff);
}

.module-reflection {
  color: var(--dept-stem);
  background: color-mix(in srgb, var(--dept-stem) 14%, #fff);
}

.module-logbook,
.module-system {
  color: #475467;
  border: 1px solid rgba(71, 84, 103, 0.16);
  background: #fff;
}

.level-chip.info {
  color: var(--dept-design);
  background: color-mix(in srgb, var(--dept-design) 12%, #fff);
}

.level-chip.warning {
  color: #b45309;
  background: color-mix(in srgb, var(--dept-it) 16%, #fff);
}

.level-chip.error {
  color: var(--dept-business);
  background: color-mix(in srgb, var(--dept-business) 12%, #fff);
}

.error-message {
  color: var(--dept-business);
  font-weight: 760;
}

.more-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #344054;
  border-radius: 6px;
  background: transparent;
}

.more-button:hover {
  background: rgba(16, 24, 40, 0.06);
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 10px 18px;
  border-top: 1px solid rgba(16, 24, 40, 0.08);
}

.page-size,
.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #52627c;
  font-size: 12px;
  font-weight: 680;
}

.small-select {
  justify-content: center;
  gap: 10px;
  min-width: 68px;
  padding: 0 10px;
}

.pagination {
  margin-left: auto;
}

.pagination button {
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  color: #344054;
}

.pagination button.active {
  color: var(--dept-design);
  border-color: var(--dept-design);
  background: #fff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dept-design) 18%, transparent);
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 1320px) {
  .log-filters,
  .log-filters.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-button {
    width: 100%;
  }
}

@media (max-width: 1040px) {
.logbook-page {
    padding-top: 0;
  }

  .page-header {
    padding-left: 0;
  }
}

@media (max-width: 1500px) {
  .log-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .log-filters.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: calc(100vw - 16px);
    overflow: hidden;
  }

  .page-header > div {
    max-width: 100%;
    min-width: 0;
  }

  .page-header p {
    max-width: 330px;
  }

  .profile {
    width: 100%;
    min-width: 0;
    margin-right: 0;
    padding: 12px;
    border: 1px solid rgba(16, 24, 40, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.62);
  }

  .log-filters,
  .log-filters.compact {
    grid-template-columns: 1fr;
    padding: 0 12px 14px;
  }

  .tab-row {
    display: flex;
    margin: 0 12px 14px;
  }

  .tab-button {
    flex: 1;
  }

  .card-title {
    padding: 0 12px;
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination {
    flex-wrap: wrap;
    margin-left: 0;
  }
}

.module-admin {
  color: #7c3aed;
  background: color-mix(in srgb, #7c3aed 13%, #fff);
}

.module-supervision {
  color: #0f766e;
  background: color-mix(in srgb, #0f766e 13%, #fff);
}
