/* Mock styling derived from the UCS@school / UMC theme tokens (theme.css). */

:root {
  --color-accent: #659a0d;
  --bgc-content-body: #fff;
  --bgc-content-header: #efefee;
  --bgc-content-container: #efefee;
  --bgc-inputfield-on-container: #d7d7d6;
  --bgc-grid-row-hover: rgba(0, 0, 0, 0.04);
  --bgc-success: #76b413;

  --font-color-contrast-high: #1e1e1d;
  --font-color-contrast-middle: #4e4e4b;
  --font-color-contrast-low: #6c6c6c;
  --link-color: #00697d;

  --button-bgc: #bdbdbb;
  --button-bgc-hover: #c8c8c6;
  --button-text-bgc-hover: rgba(0, 0, 0, 0.06);

  --font-size-1: 1.5rem;
  --font-size-2: 1.25rem;
  --font-size-3: 1rem;
  --font-size-4: 0.875rem;
  --font-size-5: 0.75rem;

  --border-radius-interactable: 0.25rem;
  --border-radius-container: 0.5rem;

  --module-orange: #ec894a;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
  font-size: var(--font-size-4);
  line-height: 1.5;
  color: var(--font-color-contrast-high);
  background-color: var(--bgc-content-body);
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 2.5rem;
}

/* --- Header / breadcrumb --------------------------------------------------- */

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--font-size-1);
  line-height: 1.3;
}

.module-icon {
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: var(--border-radius-interactable);
  background-color: var(--module-orange);
  position: relative;
}

/* Simple "user" glyph drawn with pseudo-elements. */
.module-icon::before {
  content: "";
  position: absolute;
  top: 0.32rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: #fff;
}
.module-icon::after {
  content: "";
  position: absolute;
  bottom: 0.28rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1.1rem;
  height: 0.7rem;
  border-radius: 0.55rem 0.55rem 0 0;
  background: #fff;
}

.module-title { font-weight: 600; }
.crumb-sep { color: var(--font-color-contrast-low); font-weight: 400; }
.crumb-current { font-weight: 600; }

.page-heading {
  margin: 0 0 1.5rem;
  font-size: var(--font-size-2);
  font-weight: 600;
}

/* --- Buttons --------------------------------------------------------------- */

.btn {
  font-family: inherit;
  font-size: var(--font-size-4);
  border: none;
  border-radius: var(--border-radius-interactable);
  cursor: pointer;
  padding: 0.5rem 1rem;
}

.btn-default {
  background-color: var(--button-bgc);
  color: var(--font-color-contrast-high);
  text-transform: uppercase;
  font-size: var(--font-size-5);
  letter-spacing: 0.03em;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
}
.btn-default:hover { background-color: var(--button-bgc-hover); }

.btn-text {
  background: transparent;
  color: var(--font-color-contrast-high);
  text-transform: uppercase;
  font-size: var(--font-size-5);
  letter-spacing: 0.03em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.btn-text:hover { background-color: var(--button-text-bgc-hover); }
.btn-text .plus { font-size: 1.1rem; line-height: 1; }

/* --- Filter area ----------------------------------------------------------- */

.filters {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.filter-fields {
  display: grid;
  gap: 1.25rem;
}
.filter-fields.is-advanced { grid-template-columns: repeat(3, 1fr) 1.3fr; }
.filter-fields.is-simple { grid-template-columns: 1fr 1.6fr; }

.filter-toolbar {
  display: flex;
  justify-content: flex-end;
}

.mode-toggle { white-space: nowrap; }

.filter-field { display: flex; flex-direction: column; gap: 0.4rem; }

.filter-field label {
  font-size: var(--font-size-4);
  color: var(--font-color-contrast-middle);
}

.select-wrap, .search-wrap { position: relative; }

select,
input[type="search"] {
  width: 100%;
  font-family: inherit;
  font-size: var(--font-size-4);
  color: var(--font-color-contrast-high);
  background-color: var(--bgc-content-container);
  border: none;
  border-radius: var(--border-radius-interactable);
  padding: 0.7rem 0.9rem;
  height: 2.85rem;
  appearance: none;
  -webkit-appearance: none;
}

select { padding-right: 2.4rem; cursor: pointer; }

input[type="search"]::-webkit-search-cancel-button { display: none; }

select:focus,
input[type="search"]:focus {
  outline: 2px solid var(--font-color-contrast-high);
  outline-offset: -2px;
}

/* Dropdown chevron */
.select-wrap::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--font-color-contrast-middle);
  border-bottom: 2px solid var(--font-color-contrast-middle);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.search-icon {
  position: absolute;
  right: 0.95rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  transform: translateY(-50%);
  pointer-events: none;
}
.search-icon::before {
  content: "";
  position: absolute;
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid var(--font-color-contrast-middle);
  border-radius: 50%;
}
.search-icon::after {
  content: "";
  position: absolute;
  left: 0.62rem;
  top: 0.62rem;
  width: 0.45rem;
  height: 2px;
  background: var(--font-color-contrast-middle);
  transform: rotate(45deg);
}

input::placeholder { color: var(--font-color-contrast-low); }

/* --- Grid / table ---------------------------------------------------------- */

.grid {
  border-radius: var(--border-radius-container);
  overflow: hidden;
  border: 1px solid var(--bgc-content-container);
}

.grid-toolbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--bgc-content-header);
  padding: 0.75rem 1.1rem;
}

.add-btn { padding: 0.35rem 0.6rem; }

/* Export button: enabled by default styling, greyed out while nothing is
   selected. */
.export-btn { padding: 0.35rem 0.6rem; text-decoration: none; }
.export-btn.is-disabled {
  color: var(--font-color-contrast-low);
  cursor: default;
  pointer-events: none;
  opacity: 0.6;
}

.selection-info {
  margin-left: auto;
  font-size: var(--font-size-4);
  color: var(--font-color-contrast-middle);
}

.grid-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--bgc-content-body);
}

.grid-table th,
.grid-table td {
  text-align: left;
  padding: 0.75rem 1.1rem;
  font-size: var(--font-size-4);
}

.grid-table thead th {
  color: var(--font-color-contrast-high);
  font-weight: 700;
  border-bottom: 1px solid var(--bgc-content-container);
}

.grid-table tbody tr { border-bottom: 1px solid var(--bgc-content-container); }
.grid-table tbody tr:last-child { border-bottom: none; }
.grid-table tbody tr:hover { background-color: var(--bgc-grid-row-hover); }

.col-check { width: 2.5rem; }
.col-role  { width: 16%; }
.col-klasse { width: 10%; }
.col-status { width: 14%; }
.col-groups { width: 18%; }
.col-birthday { width: 11%; }
.col-must_change_password { width: 14%; }
.col-email { width: 22%; }

/* --- Column configuration (gear menu) -------------------------------------- */

.cols-menu { position: relative; margin-left: 0.5rem; }

.cols-menu > summary {
  list-style: none;
  cursor: pointer;
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.32rem; /* 10% larger than the previous 1.2rem */
  line-height: 1;
  color: var(--font-color-contrast-middle);
  border-radius: var(--border-radius-interactable);
}
.cols-menu > summary::-webkit-details-marker { display: none; }
.cols-menu > summary:hover { background-color: var(--button-text-bgc-hover); }
.cols-menu[open] > summary { background-color: var(--button-text-bgc-hover); }

.cols-panel {
  position: absolute;
  right: 0;
  top: 2.6rem;
  z-index: 10;
  min-width: 16rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.5rem;
  background-color: var(--bgc-content-body);
  border: 1px solid var(--bgc-content-container);
  border-radius: var(--border-radius-container);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
}

.cols-title {
  margin: 0;
  padding: 0.3rem 0.6rem 0.5rem;
  font-weight: 700;
  font-size: var(--font-size-5);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--font-color-contrast-low);
}

/* Each option is a full-width, clickable menu row. */
.cols-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  padding: 0.5rem 0.6rem;
  border-radius: var(--border-radius-interactable);
  font-size: var(--font-size-4);
  color: var(--font-color-contrast-high);
}
.cols-option:hover { background-color: var(--bgc-grid-row-hover); }

.cols-option input {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.cols-label { line-height: 1.2; }

/* Highlight the currently active columns. */
.cols-option input:checked:not(:disabled) + .cols-label {
  font-weight: 600;
  color: var(--color-accent);
}

/* The fixed "Name" column: always on, can't be toggled, visually separated. */
.cols-option--fixed {
  cursor: default;
  color: var(--font-color-contrast-low);
  margin-bottom: 0.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--bgc-content-container);
  border-radius: 0;
}
.cols-option--fixed:hover { background-color: transparent; }
.cols-option--fixed input { cursor: default; }

/* Sortable column headers */
.grid-table th.col-sortable { cursor: pointer; user-select: none; }
.grid-table th.col-sortable:hover { background-color: var(--bgc-grid-row-hover); }
.grid-table th.sort-active { color: var(--color-accent); }

.sort-arrow {
  display: inline-block;
  margin-left: 0.3rem;
  font-size: 0.72em;
  color: var(--color-accent);
  vertical-align: middle;
}

.user-link {
  color: var(--link-color);
  text-decoration: none;
}
.user-link:hover { text-decoration: underline; }

input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.empty-row td {
  color: var(--font-color-contrast-low);
  font-style: italic;
}

/* Scrollable body that mimics the fixed-height grid in the original. */
.grid-table tbody {
  display: block;
  max-height: 60vh;
  overflow-y: auto;
}
.grid-table thead,
.grid-table tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}
