@import url("/css/pages/default.css");

.security-page {
  flex: 1;
  min-height: 0;
}

.security-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px;
}

.security-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.security-title p {
  margin: 4px 0 0;
  max-width: 520px;
  color: #41484c;
  font-size: 16px;
  line-height: 24px;
}

.security-toolbar__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.security-date-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.security-date-clear {
  height: 40px;
  border: 1px solid #c0c7cc;
  border-radius: 8px;
  background: #ffffff;
  color: #41484c;
  cursor: pointer;
  font-family: "Be Vietnam Pro", Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  padding: 0 14px;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.security-date-clear:hover:not(:disabled) {
  border-color: #00658f;
  background: #f5fbff;
  color: #00658f;
}

.security-date-clear:disabled {
  cursor: default;
  opacity: 0.45;
}

.security-date-picker {
  position: relative;
  display: inline-flex;
}

.security-date-picker__trigger {
  display: inline-flex;
  min-width: 200px;
  height: 40px;
  align-items: center;
  gap: 10px;
  border: 1px solid #c0c7cc;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(12, 174, 242, 0.05);
  color: #71787d;
  cursor: pointer;
  font-family: "Be Vietnam Pro", Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 20px;
  padding: 0 14px 0 12px;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.security-date-picker__trigger:hover,
.security-date-picker__trigger:focus-visible {
  border-color: #00658f;
  box-shadow: 0 0 0 2px rgba(0, 101, 143, 0.12);
  outline: none;
}

.security-date-picker.has-value .security-date-picker__trigger {
  color: #191c1d;
}

.security-date-picker__trigger img {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  pointer-events: none;
}

.security-date-picker__label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.security-date-picker.is-open .security-date-picker__trigger {
  border-color: #00658f;
  box-shadow: 0 0 0 2px rgba(0, 101, 143, 0.12);
}

.security-calendar {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: min(320px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid #e2e8ec;
  border-radius: 14px;
  background: #ffffff;
  box-shadow:
    0 4px 6px rgba(25, 28, 29, 0.04),
    0 16px 40px rgba(25, 28, 29, 0.12);
}

.security-calendar[hidden] {
  display: none !important;
}

.security-calendar__header {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
}

.security-calendar__title {
  margin: 0;
  color: #191c1d;
  font-family: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}

.security-calendar__nav {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: #f3f3f5;
  color: #41484c;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.security-calendar__nav:hover {
  background: #e8f4fa;
  color: #00658f;
}

.security-calendar__nav svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.security-calendar__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 6px;
}

.security-calendar__weekdays span {
  color: #71787d;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 16px;
  text-align: center;
  text-transform: uppercase;
}

.security-calendar__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.security-calendar__day {
  display: inline-flex;
  width: 100%;
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #191c1d;
  cursor: pointer;
  font-family: "Be Vietnam Pro", Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  padding: 0;
  transition: background 0.12s ease, color 0.12s ease;
}

.security-calendar__day:hover:not(:disabled) {
  background: #f0f8fc;
  color: #00658f;
}

.security-calendar__day.is-outside {
  color: #a8b0b6;
}

.security-calendar__day.is-today {
  box-shadow: inset 0 0 0 2px #85cfff;
  font-weight: 700;
}

.security-calendar__day.is-selected {
  background: #00658f;
  box-shadow: none;
  color: #ffffff;
  font-weight: 600;
}

.security-calendar__day.is-selected:hover {
  background: #004d6d;
  color: #ffffff;
}

.security-calendar__day:disabled {
  cursor: default;
  opacity: 0.35;
}

.security-calendar__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eef1f3;
}

.security-calendar__action {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #00658f;
  cursor: pointer;
  font-family: "Be Vietnam Pro", Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  padding: 8px 12px;
  transition: background 0.15s ease;
}

.security-calendar__action:hover {
  background: #f0f8fc;
}

.security-calendar__action--primary {
  background: #00658f;
  color: #ffffff;
}

.security-calendar__action--primary:hover {
  background: #004d6d;
}

.security-export {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: #00658f;
  box-shadow: 0 4px 12px rgba(12, 174, 242, 0.1);
  color: #ffffff;
  cursor: pointer;
  font-family: "Be Vietnam Pro", Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 20px;
  padding: 10px 24px;
}

.security-export img {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

.security-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.security-stat-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border: 1px solid #c0c7cc;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(12, 174, 242, 0.05);
}

.security-stat-card__title {
  color: #41484c;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.7px;
  line-height: 20px;
}

.security-stat-card strong {
  color: #191c1d;
  font-family: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
}

.security-stat-card small {
  color: #41484c;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

.security-stat-card small.is-positive {
  color: #33647a;
}

.security-table-card {
  border: 1px solid #c0c7cc;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(12, 174, 242, 0.05);
  overflow: visible;
}

.security-table-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid #c0c7cc;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.security-table-card__title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.security-table-card__head h2 {
  margin: 0;
  color: #191c1d;
  font-family: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.security-refresh {
  display: inline-flex;
  align-items: center;
  align-self: flex-end;
  gap: 6px;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid #c0c7cc;
  border-radius: 8px;
  background: #ffffff;
  color: #00658f;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
  white-space: nowrap;
}

.security-table-search {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.security-table-search__label {
  padding: 0 4px;
  color: #41484c;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

.security-table-search__input {
  box-sizing: border-box;
  width: min(280px, 100%);
  min-height: 40px;
  border: 1px solid #c0c7cc;
  border-radius: 8px;
  background: #f3f3f5;
  color: #191c1d;
  font-family: "Be Vietnam Pro", Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  padding: 8px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.security-table-search__input::placeholder {
  color: #8b949e;
  font-weight: 400;
}

.security-table-search__input:hover {
  border-color: #00658f;
}

.security-table-search__input:focus {
  outline: none;
  border-color: #00658f;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(0, 101, 143, 0.12);
}

.security-refresh img,
.security-refresh svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.security-refresh:hover:not(:disabled) {
  border-color: #00658f;
  background: #f5fbff;
}

.security-refresh:disabled {
  opacity: 0.6;
  cursor: wait;
}

.security-table-wrap.is-refreshing {
  opacity: 0.55;
  pointer-events: none;
}

.security-table-card__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px 16px;
}

.security-table-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.security-table-filter__label {
  padding: 0 4px;
  color: #41484c;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

.security-table-filter .custom-select {
  width: min(280px, 100%);
  min-width: 170px;
}

.security-table-filter .custom-select__button {
  box-sizing: border-box;
  min-height: 40px;
  padding: 8px 12px;
  background: #f3f3f5;
  color: #191c1d;
  font-family: "Be Vietnam Pro", Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.security-table-filter .custom-select.has-value .custom-select__button {
  font-weight: 500;
}

.security-table-filter .custom-select__button:focus-visible,
.security-table-filter .custom-select.is-open .custom-select__button {
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(0, 101, 143, 0.12);
}

.security-table-filter .custom-select__menu {
  z-index: 50;
  min-width: 100%;
  width: max-content;
  max-width: 280px;
}

.security-table-wrap {
  overflow-x: auto;
  border-radius: 0 0 12px 12px;
}

.security-table {
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
}

.security-note-cell {
  max-width: 220px;
}

.security-note {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  color: #191c1d;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  white-space: normal;
  word-break: break-word;
  cursor: pointer;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.security-note:hover {
  color: #00658f;
  text-decoration: underline;
}

.security-table thead {
  background: #f3f3f5;
}

.security-table th {
  padding: 16px 24px;
  color: #41484c;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.7px;
  line-height: 20px;
  text-align: left;
  white-space: nowrap;
}

.security-table td {
  padding: 16px 24px;
  border-top: 1px solid #c0c7cc;
  color: #191c1d;
  font-size: 16px;
  line-height: 24px;
  vertical-align: middle;
}

.security-table__empty td {
  padding: 32px 24px;
  color: #71787d;
  text-align: center;
}

.security-student {
  display: flex;
  align-items: center;
  gap: 12px;
}

.security-student__avatar {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.security-student__avatar--a {
  background: #c7e7ff;
  color: #00658f;
}

.security-student__avatar--b {
  background: #bee9ff;
  color: #33647a;
}

.security-student__avatar--c {
  background: #dfe0ff;
  color: #4455ba;
}

.security-student__avatar--d {
  background: #85cfff;
  color: #004665;
}

.security-student__avatar--e {
  background: #9dcde6;
  color: #316378;
}

.security-student strong {
  font-weight: 500;
}

.security-table td.is-muted {
  color: #41484c;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  line-height: 16px;
  text-transform: uppercase;
  white-space: nowrap;
}

.security-badge::before {
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  content: "";
}

.security-badge.is-delivered {
  background: #ffdad6;
  color: #93000a;
}

.security-badge.is-delivered::before {
  background: #93000a;
}

.security-badge.is-entry {
  background: #addef7;
  color: #316378;
}

.security-badge.is-entry::before {
  background: #316378;
}

.security-actors {
  --actor-marker-size: 16px;
  --actor-line-width: 2px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 168px;
}

.security-actors.has-both::before {
  content: "";
  position: absolute;
  left: calc((var(--actor-marker-size) - var(--actor-line-width)) / 2);
  top: 14px;
  bottom: 14px;
  width: var(--actor-line-width);
  border-radius: 999px;
  background: linear-gradient(180deg, #7eb6d1 0%, #4d9b6a 100%);
}

.security-actor {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--actor-marker-size) minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.security-actor__marker {
  width: var(--actor-marker-size);
  height: var(--actor-marker-size);
  margin-top: 2px;
  border-radius: 999px;
  border: 2px solid currentColor;
  background: #fff;
  box-shadow: 0 0 0 3px #fff;
}

.security-actor.is-request {
  color: #316378;
}

.security-actor.is-approve {
  color: #2f6b45;
}


.security-actors:not(.has-both) .security-actor.is-request {
  color: #2f6b45;
}

.security-actors:not(.has-both) .security-actor.is-request .security-actor__marker {
  background: currentColor;
  box-shadow: 0 0 0 3px #fff, inset 0 0 0 2px #fff;
}


.security-actor.is-approve .security-actor__marker {
  background: currentColor;
  box-shadow: 0 0 0 3px #fff, inset 0 0 0 2px #fff;
}

.security-actor__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.security-actor__role {
  color: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  opacity: 0.85;
}

.security-actor__name {
  color: #191c1d;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}

.security-status-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  color: #00658f;
}

.security-status-icon img {
  width: 22px;
  height: 22px;
}

.security-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}

.security-status.is-confirmed {
  background: #e8f5e9;
  color: #1b5e20;
}

.security-status.is-pending {
  background: #fff8e1;
  color: #7a5a00;
}



body.security-modal-open {
  overflow: hidden;
}

.security-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.security-modal[hidden] {
  display: none !important;
}

.security-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 28, 29, 0.45);
}

.security-modal__panel {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(420px, 100%);
  flex-direction: column;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 48px rgba(25, 28, 29, 0.18);
}

.security-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 0;
}

.security-modal__header h2 {
  margin: 0;
  color: #191c1d;
  font-family: "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

.security-modal__header button {
  border: 0;
  background: transparent;
  color: #71787d;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.security-modal__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 24px 24px;
}

.security-modal__hint {
  margin: 0;
  color: #41484c;
  font-size: 14px;
  line-height: 20px;
}

.security-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.security-export-option {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid #c0c7cc;
  border-radius: 8px;
  background: #f3f3f5;
  color: #191c1d;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  padding: 10px 16px;
}

.security-export-option:hover {
  border-color: #00658f;
  background: #f5fbff;
  color: #00658f;
}

@media (max-width: 1100px) {
  .security-stats {
    grid-template-columns: 1fr;
  }

  .security-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .security-toolbar__actions {
    justify-content: flex-end;
  }
}

@media (max-width: 768px) {
  .security-main {
    padding: 20px 16px 32px;
  }

  .security-toolbar__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .security-date-filter {
    width: 100%;
    flex-wrap: wrap;
  }

  .security-date-picker,
  .security-date-picker__trigger,
  .security-date-clear,
  .security-export {
    width: 100%;
  }

  .security-export {
    justify-content: center;
    text-align: center;
  }

  .security-pagination {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .security-pagination .table-pagination-footer__meta {
    align-self: auto;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }

  .security-pagination .table-pagination-footer__controls {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    align-self: auto;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
    width: auto;
  }

  .security-pagination .table-pagination-footer__controls nav {
    justify-content: flex-end;
    margin-left: 0;
  }

  .security-table-card__head {
    flex-direction: column;
    align-items: stretch;
  }

  .security-table-card__tools {
    flex-direction: column;
    align-items: stretch;
  }

  .security-table-filter .custom-select,
  .security-table-search__input,
  .security-refresh {
    width: 100%;
  }

  .security-refresh {
    justify-content: center;
  }
}
