:root {
  color-scheme: light;
  --bg: #f3f4f6;
  --panel: #ffffff;
  --ink: #111111;
  --muted: #667085;
  --line: #d7dde5;
  --line-strong: #aeb8c6;
  --accent: #007c89;
  --accent-strong: #005e68;
  --accent-soft: #d9f4f6;
  --gold: #f5b841;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --shadow: 0 18px 40px rgba(16, 24, 40, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
}

.hidden {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

button,
label.upload-button,
.dropzone,
a.secondary-button {
  -webkit-tap-highlight-color: transparent;
}

.shell,
.login-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.login-shell {
  min-height: 100dvh;
  display: grid;
  align-items: start;
  justify-items: center;
  padding-top: clamp(28px, 12dvh, 120px);
  padding-bottom: 28px;
}

.login-panel {
  width: min(460px, 100%);
  display: grid;
  gap: 22px;
  border-radius: 8px;
  padding: 28px;
  background: #111;
  color: #fff;
  box-shadow: var(--shadow);
}

.login-logo {
  display: block;
  width: min(320px, 100%);
  height: auto;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: #fff;
}

.login-error {
  min-height: 20px;
  margin: -2px 0 0;
  color: #fda29b;
  font-size: 0.9rem;
  font-weight: 800;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 20px;
  border-radius: 8px;
  background: #111;
  color: #fff;
}

.brand-lockup {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 3vw, 3.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 8px;
  background: #fff;
  color: #111;
  cursor: pointer;
  font-weight: 900;
  border: 1px solid #fff;
  white-space: nowrap;
}

.upload-button.disabled,
.dropzone.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.session-card {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  align-items: center;
  gap: 2px 10px;
  min-width: 210px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
}

.session-card span {
  font-weight: 900;
}

.session-card small {
  color: #d0d5dd;
  font-weight: 800;
}

.session-card .secondary-button {
  grid-row: 1 / span 2;
  grid-column: 2;
  min-height: 36px;
  padding: 0 12px;
}

.upload-button input,
.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-icon,
.drop-icon,
.empty-mark,
.close-button span {
  display: inline-block;
  position: relative;
}

.upload-icon {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top: 0;
}

.upload-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -4px;
  width: 8px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
}

.tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e9edf2;
}

.tabs button {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.tabs button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.workspace {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.sidebar,
.content,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 16px;
  padding: 16px;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 170px;
  padding: 18px;
  border: 2px dashed var(--line-strong);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

.dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.upload-status {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 900;
}

.upload-status[data-tone="success"] {
  color: #067647;
}

.upload-status[data-tone="error"] {
  color: var(--danger);
}

.dropzone strong {
  color: var(--ink);
  font-size: 1.08rem;
}

.drop-icon {
  width: 48px;
  height: 38px;
  border: 2px solid currentColor;
  border-radius: 7px;
}

.drop-icon::before {
  content: "";
  position: absolute;
  inset: 8px 11px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}

.control-block {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

label,
.sort-wrap label {
  color: #344054;
  font-size: 0.82rem;
  font-weight: 900;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(0, 124, 137, 0.24);
  outline-offset: 2px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f4f7;
}

.segmented button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.segmented button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.stats span {
  display: block;
  font-size: 1.18rem;
  font-weight: 900;
}

.stats small {
  color: var(--muted);
  font-weight: 800;
}

.content {
  min-height: calc(100vh - 176px);
  padding: 18px;
}

.content-bar,
.inline-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  margin-bottom: 16px;
}

.content-tools {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bulk-actions span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.bulk-actions .secondary-button,
.bulk-actions .danger-button {
  min-height: 42px;
  padding: 0 12px;
}

.content-bar h2,
.section-heading h2 {
  margin-bottom: 4px;
  font-size: 1.35rem;
}

.content-bar p,
.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.sort-wrap {
  display: grid;
  gap: 6px;
  width: min(190px, 44vw);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.image-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.image-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.12);
}

.image-open {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  background: #eef2f6;
  cursor: pointer;
}

.image-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.select-check {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.16);
  cursor: pointer;
}

.select-check input {
  width: 18px;
  min-height: 18px;
}

.select-check span {
  font-size: 0.78rem;
  font-weight: 900;
}

.campus-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(17, 17, 17, 0.84);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
}

.card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
}

.card-body h3 {
  margin-bottom: 3px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.95rem;
}

.card-body p {
  margin-bottom: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.favorite-toggle {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0 10px;
}

.favorite-toggle.active {
  color: #b54708;
  background: #fffaeb;
  border-color: #fedf89;
}

.empty-state {
  display: none;
  min-height: 420px;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  color: var(--muted);
}

.empty-state.visible {
  display: grid;
}

.empty-state h2 {
  margin-bottom: 0;
  color: var(--ink);
}

.empty-state p {
  margin-bottom: 0;
}

.empty-mark {
  width: 72px;
  height: 58px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
}

.empty-mark::before {
  content: "";
  position: absolute;
  left: 14px;
  bottom: 12px;
  width: 38px;
  height: 26px;
  background: linear-gradient(135deg, transparent 0 42%, var(--line-strong) 43% 48%, transparent 49%),
    linear-gradient(45deg, transparent 0 46%, var(--line-strong) 47% 52%, transparent 53%);
}

.admin-layout,
.settings-grid {
  display: grid;
  gap: 18px;
}

.admin-layout {
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
}

.settings-grid {
  grid-template-columns: minmax(280px, 520px) minmax(0, 1fr);
}

.panel {
  padding: 18px;
}

.section-heading {
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 7px;
}

.source-box {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.source-box span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.source-box strong {
  margin-bottom: 6px;
  color: var(--ink);
}

.form-grid .primary-button,
.form-grid .checkbox-row {
  grid-column: 1 / -1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.secondary-button {
  padding: 0 14px;
}

.danger-button {
  grid-column: 1 / -1;
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #fda29b;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #344054;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.empty-cell {
  color: var(--muted);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-weight: 900;
}

.row-actions {
  white-space: nowrap;
}

.row-actions .text-button:first-child {
  color: var(--accent-strong);
}

.text-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.campus-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.campus-row {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.campus-row span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.details {
  width: min(1080px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 28px 70px rgba(16, 24, 40, 0.28);
}

.user-dialog {
  width: min(560px, calc(100vw - 28px));
}

.details::backdrop {
  background: rgba(15, 23, 42, 0.58);
}

.details-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 360px;
  gap: 0;
  margin: 0;
  background: #fff;
}

.user-edit-panel {
  width: min(560px, calc(100vw - 24px));
  grid-template-columns: 1fr;
}

.close-button {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
}

.close-button span,
.close-button span::after {
  width: 18px;
  height: 2px;
  background: currentColor;
}

.close-button span {
  transform: rotate(45deg);
}

.close-button span::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  transform: rotate(90deg);
}

.preview-wrap {
  min-height: 460px;
  background: #101828;
  display: grid;
  place-items: center;
}

.preview-wrap img {
  max-width: 100%;
  max-height: min(76vh, 720px);
  object-fit: contain;
}

.details-body {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 56px 18px 18px;
}

.details-body label {
  display: grid;
  gap: 7px;
}

.detail-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

@media (max-width: 980px) {
  .brand-lockup {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .workspace,
  .admin-layout,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 17px;
  }

  .shell {
    padding: 8px;
  }

  .login-shell {
    padding: 18px 14px;
    align-items: start;
  }

  .login-panel {
    gap: 18px;
    padding: 24px;
  }

  .topbar {
    display: grid;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 10px;
    padding: 18px;
  }

  .brand-lockup {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .brand-logo {
    max-width: 290px;
  }

  h1 {
    font-size: 2.05rem;
    line-height: 1.04;
  }

  .upload-button,
  .session-card,
  .tabs {
    width: 100%;
  }

  .session-card {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px;
  }

  .upload-button,
  .primary-button,
  .secondary-button,
  .danger-button,
  input,
  select {
    min-height: 54px;
  }

  .tabs {
    display: grid;
    margin-bottom: 12px;
  }

  .tabs button,
  .segmented button {
    min-height: 52px;
  }

  .content-bar,
  .inline-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .sort-wrap {
    width: 100%;
  }

  .dropzone {
    min-height: 154px;
    padding: 20px;
  }

  .content {
    min-height: auto;
    padding: 16px;
  }

  .empty-state {
    min-height: 260px;
    padding: 24px 8px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .details-panel {
    grid-template-columns: 1fr;
  }

  .preview-wrap {
    min-height: 280px;
  }

  .details-body {
    padding-top: 18px;
  }
}

@media (max-width: 560px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .card-body {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px;
  }

  .card-body h3 {
    font-size: 1rem;
  }

  .icon-button {
    width: 46px;
    height: 46px;
  }

  th,
  td {
    padding: 10px 8px;
  }
}
