/* ============================ Administrators Page Layout Start ============================ */
.admin-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
  min-height: 0;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-toolbar h1 {
  margin: 0;
  color: var(--dark4txt);
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 500;
  line-height: 26px;
}

.admin-toolbar h1 .admin-count {
  font-family: var(--font-body);
  font-size: 14px;
}

/* ============================ Administrators Page Layout End ============================ */


/* ============================ Administrators Table Start ============================ */
.admin-table-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-width: none;
}

.admin-table-shell::-webkit-scrollbar {
  display: none;
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 1px 2px;
}

.admin-table thead.admin-table-head th {
  padding: 10px 16px;
  color: var(--dark4txt);
  background: var(--white);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  text-align: left;
  box-shadow: 1px 0 0 0 var(--white);
}

.admin-table-gap td {
  height: 8px;
  padding: 0;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none;
}

.admin-table thead.admin-table-head th:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.admin-table thead.admin-table-head th:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  text-align: right;
}

.admin-table thead.admin-table-head th:nth-child(3) {
  text-align: right;
}

.admin-row {
  cursor: pointer;
}

.admin-row td {
  padding: 12px 16px;
  color: var(--grey4txt);
  background: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  vertical-align: middle;
}

.admin-row.is-alt td {
  background: rgba(255, 255, 255, 0.3);
}

.admin-row td:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  width: 80px;
}

.admin-row td:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  text-align: right;
}

.admin-row td:nth-child(3) {
  text-align: right;
  width: 140px;
  white-space: nowrap;
}

.admin-row td:last-child {
  width: 90px;
}

.admin-row:hover td {
  background: var(--white);
}

.admin-id-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.admin-id-cell i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 2px solid var(--white);
  border-radius: 999px;
  background: var(--accent-pink);
}

.admin-id-cell i.green {
  background: var(--accent-green);
}

/* ============================ Administrators Table End ============================ */


/* ============================ Switch Component Start ============================ */
.admin-page .switch,
.admin-modal .switch {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 40px;
  height: 20px;
  padding: 2px;
  border: 0;
  border-radius: 999px;
  background: #4b4b4b;
  cursor: pointer;
  vertical-align: middle;
}

.admin-page .switch span,
.admin-modal .switch span {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--white);
  transition: transform 120ms ease;
}

.admin-page .switch.is-on,
.admin-modal .switch.is-on {
  background: #48e6cf;
}

.admin-page .switch.is-on span,
.admin-modal .switch.is-on span {
  transform: translateX(20px);
}

/* ============================ Switch Component End ============================ */


/* ============================ Admin Modal Overlay & Card Start ============================ */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: var(--font-body);
}

.admin-modal.is-open {
  display: flex;
}

.admin-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 34, 0.38);
}

.admin-modal.admin-modal-instance {
  background: transparent;
  pointer-events: none;
}

.admin-modal.admin-modal-instance .admin-modal-overlay {
  display: none;
}

.admin-modal.admin-modal-instance .admin-modal-card {
  pointer-events: auto;
}


.admin-modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(820px, 100vw - 48px);
  max-height: calc(100vh - 48px);
  padding: 24px 26px 22px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--dark4txt) url("../../assets/images/app-bg.png") center / cover no-repeat;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

/* ============================ Admin Modal Overlay & Card End ============================ */


/* ============================ Admin Modal Head Start ============================ */
.admin-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--white);
  cursor: move;
  -webkit-user-select: none;
  user-select: none;
}

.admin-modal-close {
  cursor: pointer;
}

.admin-modal-title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-modal-eyebrow {
  font-size: 13px;
  opacity: 0.9;
}

.admin-modal-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 28px;
  line-height: 30px;
  font-weight: 700;
}

.admin-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  flex: 0 0 40px;
}

.admin-modal-close img {
  width: 18px;
  height: 18px;
}

/* ============================ Admin Modal Head End ============================ */


/* ============================ Admin Modal Body Start ============================ */
.admin-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  padding-right: 2px;
}

.admin-modal-body::-webkit-scrollbar {
  display: none;
}

/* ============================ Admin Modal Body End ============================ */


/* ============================ Admin Accordion Start ============================ */
.admin-accordion {
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  overflow: hidden;
}

.admin-accordion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 24px;
  border: 0;
  color: var(--dark4txt);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.admin-accordion-head span {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 500;
}

.admin-accordion-chev {
  width: 20px;
  height: 20px;
  transition: transform 150ms ease;
}

.admin-accordion.is-open .admin-accordion-chev {
  transform: rotate(180deg);
}

.admin-accordion-body {
  display: none;
  padding: 0 24px 22px;
}

.admin-accordion.is-open .admin-accordion-body {
  display: block;
  max-height: 60vh;
  overflow-y: auto;
  scrollbar-width: none;
}


.admin-accordion-footer {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.admin-save-btn {
  min-width: 140px;
  padding: 10px 28px;
  border: 1px solid var(--white);
  border-radius: var(--radius-sm);
  color: var(--dark4txt);
  background: var(--button-bg);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.admin-save-btn:hover {
  background: rgba(255, 255, 255, 0.85);
}

/* ============================ Admin Accordion End ============================ */


/* ============================ Admin Info Fields Start ============================ */
.admin-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.admin-field>span {
  font-size: 14px;
  color: var(--dark4txt);
}

.admin-input {
  width: 100%;
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--white);
  font: inherit;
  color: var(--dark4txt);
  outline: 0;
}

.admin-input::placeholder {
  color: var(--grey4txt);
  opacity: 0.7;
}

.admin-field-row {
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

.admin-field-row>span:first-child {
  flex: 0 0 auto;
}

.admin-stepper {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  background: var(--white);
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 0px 10px;
}

.admin-stepper button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  border-radius: 50%;
  height: 35px;
  padding: 3px 0px 0px 0px;
  border: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  background: #e9e9ed;
  cursor: pointer;
  font-size: 20px;
  font-weight: 500;
  color: var(--dark4txt);
  line-height: 1;
}

.admin-stepper button:last-child {
  border-right: 0;
  border-left: 1px solid rgba(0, 0, 0, 0.06);
}

.admin-stepper-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  font-weight: 500;
  color: var(--dark4txt);
  outline: 0;
}

.admin-readonly-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 0 2px;
  font-size: 14px;
  color: var(--dark4txt);
}

/* ============================ Admin Info Fields End ============================ */


/* ============================ Admin Permissions Table Start ============================ */
.admin-perms-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 1px 2px;
}



.admin-perms-table thead th:nth-child(n+2) {
  text-align: center;
  width: 130px;
}

.admin-perms-table tbody td {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  color: var(--dark4txt);
  vertical-align: middle;
}

.admin-perms-table tbody tr.is-alt td {
  background: rgba(255, 255, 255, 0.3);
}

.admin-perms-table tbody td:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.admin-perms-table tbody td:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.admin-perms-table tbody td:nth-child(n+2) {
  text-align: center;
  width: 130px;
}

/* ============================ Admin Permissions Table End ============================ */

.admin-accordion.is-open {
  display: flex;
  flex-direction: column;
  max-height: 600px;
  /* Limits total height of the accordion block */
}

.admin-accordion-head,
.admin-accordion-footer {
  flex: 0 0 auto;
}

.admin-accordion.is-open .admin-accordion-body {
  display: block;
  flex: 1 1 auto;
  overflow-y: auto;
  /* Enables row scrolling */
  scrollbar-width: none;
  /* Hides scrollbar track on Firefox */
  max-height: 400px;
  /* Specific visual row clipping limit */
  padding: 0 10px 10px;

}

.admin-accordion-body::-webkit-scrollbar {
  display: none;
  /* Hides scrollbar track on Chrome/Safari */
}

/* 4. PIN THE TABLE HEADERS STICKY AT THE TOP */

.admin-perms-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-perms-table thead th {
  position: sticky;
  top: 0;
  background-color: #cdcdd1;
  padding: 10px 16px;
  color: var(--dark4txt);
  font-size: 14px;
  font-weight: 400;
  text-align: left;
}

.admin-accordion-footer {
  padding: 14px 24px 18px;
  margin-top: 0;
}

/* ============================ Admin History Table Fixed Setup ============================ */
.admin-history-table {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.admin-history-table thead {
  display: block;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 2;
}

.admin-history-table thead tr {
  display: grid;
  grid-template-columns: 115px 1fr;
  width: 100%;
}

.admin-history-table thead th {
  padding: 4px 16px 12px;
  background: transparent;
  border: 0;
  color: var(--grey4txt);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

.admin-history-table tbody {
  display: block;
  width: 100%;
  height: 360px;
  overflow-y: auto;
  scrollbar-width: none;
}

.admin-history-table tbody::-webkit-scrollbar {
  display: none;
}

.admin-history-table tbody tr.admin-history-row {
  display: grid !important;
  grid-template-columns: 115px 1fr;
  grid-template-rows: auto auto;
  width: 100%;
  /* Forces the card component to expand to its container borders */
  margin-bottom: 12px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.6);
  color: var(--dark4txt);
  box-sizing: border-box;
}

.admin-history-row.is-alt {
  background: rgba(255, 255, 255, 0.3);
}

.admin-history-row.is-warning {
  background: #fdfbb7 !important;
}

.admin-history-row>td {
  vertical-align: top;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  box-sizing: border-box;
}

.admin-history-row>td:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  border-right: 2px solid rgba(3, 5, 34, 0.06);
}

.admin-history-row>td:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
  font-size: 15px;
  font-weight: 600;
  padding-left: 20px;
}

.admin-history-row>td:nth-child(3) {
  grid-column: 1 / -1;
  grid-row: 2;
  padding: 14px 16px;
  font-family: "Courier Prime", "Courier New", Courier, monospace;
  font-weight: 400;
  font-style: normal;
  font-size: 12px;
  line-height: 15px;
  letter-spacing: -0.2px;
  white-space: pre-line;
  word-break: break-word;
  color: var(--text-color);
  border-top: 2px solid rgba(3, 5, 34, 0.06);
}

/* ============================ Admin History Table End ============================ */


/* ============================ Administrators Responsive Start ============================ */
/* @media (max-width: 768px) {
  .admin-toolbar h1 {
    font-size: 18px;
  }

  .admin-table thead.admin-table-head {
    display: none;
  }

  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
  }

  .admin-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "id status"
      "name name"
      "debt debt";
    gap: 4px 12px;
    margin-bottom: 8px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.6);
  }

  .admin-row.is-alt {
    background: rgba(255, 255, 255, 0.3);
  }

  .admin-row td {
    padding: 0;
    background: transparent !important;
    width: auto;
    border-radius: 0;
  }

  .admin-row td:first-child { grid-area: id; }
  .admin-row td:nth-child(2) { grid-area: name; font-weight: 600; }
  .admin-row td:nth-child(3) { grid-area: debt; text-align: left; }
  .admin-row td:last-child { grid-area: status; text-align: right; }

  .admin-row td:nth-child(3)::before {
    content: "Skola: ";
    font-weight: 500;
    color: var(--dark4txt);
  }

  .admin-modal {
    padding: 0;
  }

  .admin-modal-card {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    padding: 18px 16px 16px;
  }

  .admin-modal-title {
    font-size: 22px;
    line-height: 26px;
  }

  .admin-accordion-head {
    padding: 14px 16px;
  }

  .admin-accordion-body {
    padding: 0 16px 16px;
  }

  .admin-field-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .admin-perms-table thead th:nth-child(n+2),
  .admin-perms-table tbody td:nth-child(n+2) {
    width: auto;
  }

  .admin-perms-table thead th {
    font-size: 12px;
    padding: 6px 8px;
  }

  .admin-perms-table tbody td {
    padding: 10px 8px;
  }

  .admin-history-head {
    display: none;
  }

  .admin-history-row {
    flex-direction: column;
  }

  .admin-history-date {
    flex: 0 0 auto;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }
} */
@media (max-width: 600px) {
  .admin-modal.admin-modal-instance .admin-modal-card {
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .admin-modal {
    padding: 0;
  }

  .admin-modal-card {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    padding: 18px 16px 16px;
  }
}

@media (max-width: 428px) {
  .content-shell {
    padding: 18px 10px;
  }
}

@media (max-width: 408px) {
  .admin-row td {
    padding: 12px 5px;
  }

  .admin-id-cell {
    display: flex;
    align-items: center;
    gap: 3px;
    justify-content: center;
  }
}

@media (max-width: 400px) {
  .admin-perms-table tbody td {
    padding: 12px 10px;
  }

  .admin-accordion-body {
    padding: 0 10px 22px;
  }
}

/* ============================ Administrators Responsive End ============================ */